Skip to content

Commit

Permalink
Change attribute type name to id (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
rikbw authored Feb 8, 2021
1 parent 0739c52 commit c13e2a5
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This Go module provides a client for connector interactions with an Elimity Insi
package main

import (
"github.com/elimity-com/insights-client-go/v3"
"github.com/elimity-com/insights-client-go/v4"
"time"
)

Expand All @@ -34,7 +34,7 @@ func main() {
## Installation

```sh
$ go get github.com/elimity-com/insights-client-go/v3
$ go get github.com/elimity-com/insights-client-go/v4
```

## Compatibility
Expand Down
2 changes: 1 addition & 1 deletion client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http/httptest"
"testing"

"github.com/elimity-com/insights-client-go/v3"
"github.com/elimity-com/insights-client-go/v4"
)

func TestNewClientDisableTLSCertificateVerification(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion connectorlog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"
"time"

"github.com/elimity-com/insights-client-go/v3"
"github.com/elimity-com/insights-client-go/v4"
)

func TestClientCreateConnectorLogs(t *testing.T) {
Expand Down
12 changes: 6 additions & 6 deletions domaingraph.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ import (
// A given attribute type and value are compatible if their types are equal. For example, a boolean attribute type can
// only be assigned with a boolean value.
type AttributeAssignment struct {
AttributeTypeName string
Value Value
AttributeTypeID string
Value Value
}

func (a AttributeAssignment) model() attributeAssignmentModel {
return attributeAssignmentModel{
AttributeTypeName: a.AttributeTypeName,
Value: a.Value.model(),
AttributeTypeID: a.AttributeTypeID,
Value: a.Value.model(),
}
}

Expand Down Expand Up @@ -117,8 +117,8 @@ func (r Relationship) model() relationshipModel {
}

type attributeAssignmentModel struct {
AttributeTypeName string `json:"attributeTypeName"`
Value valueModel `json:"value"`
AttributeTypeID string `json:"attributeTypeID"`
Value valueModel `json:"value"`
}

func parseDomainGraphTimestamp(time *tim.Time) *dateTime {
Expand Down
26 changes: 13 additions & 13 deletions domaingraph_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"testing"
"time"

"github.com/elimity-com/insights-client-go/v3"
"github.com/elimity-com/insights-client-go/v4"
"github.com/google/go-cmp/cmp"
)

Expand All @@ -19,14 +19,14 @@ func TestClientReloadDomainGraph(t *testing.T) {
{
"attributeAssignments": [
{
"attributeTypeName": "foo",
"attributeTypeID": "foo",
"value": {
"type": "boolean",
"value": true
}
},
{
"attributeTypeName": "bar",
"attributeTypeID": "bar",
"value": {
"type": "date",
"value": {
Expand All @@ -44,7 +44,7 @@ func TestClientReloadDomainGraph(t *testing.T) {
{
"attributeAssignments": [
{
"attributeTypeName": "baz",
"attributeTypeID": "baz",
"value": {
"type": "time",
"value": {
Expand All @@ -64,7 +64,7 @@ func TestClientReloadDomainGraph(t *testing.T) {
{
"attributeAssignments": [
{
"attributeTypeName": "asd",
"attributeTypeID": "asd",
"value": {
"type": "string",
"value": "asd"
Expand Down Expand Up @@ -94,12 +94,12 @@ func TestClientReloadDomainGraph(t *testing.T) {
{
AttributeAssignments: []insights.AttributeAssignment{
{
AttributeTypeName: "foo",
Value: fooValue,
AttributeTypeID: "foo",
Value: fooValue,
},
{
AttributeTypeName: "bar",
Value: barValue,
AttributeTypeID: "bar",
Value: barValue,
},
},
ID: "foo",
Expand All @@ -109,8 +109,8 @@ func TestClientReloadDomainGraph(t *testing.T) {
{
AttributeAssignments: []insights.AttributeAssignment{
{
AttributeTypeName: "baz",
Value: bazValue,
AttributeTypeID: "baz",
Value: bazValue,
},
},
ID: "bar",
Expand All @@ -122,8 +122,8 @@ func TestClientReloadDomainGraph(t *testing.T) {
{
AttributeAssignments: []insights.AttributeAssignment{
{
AttributeTypeName: "asd",
Value: asdValue,
AttributeTypeID: "asd",
Value: asdValue,
},
},
FromEntityID: "foo",
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/elimity-com/insights-client-go/v3
module github.com/elimity-com/insights-client-go/v4

go 1.13

Expand Down

0 comments on commit c13e2a5

Please sign in to comment.