Skip to content

Commit

Permalink
Update get service key response model (#789)
Browse files Browse the repository at this point in the history
  • Loading branch information
guptado authored Feb 19, 2025
1 parent b1cf3d8 commit 0dcda2a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 3 additions & 2 deletions partner_interconnect_attachments.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@ type BGP struct {

// ServiceKey represents the service key of a Partner Interconnect Attachment.
type ServiceKey struct {
ServiceKey string `json:"service_key,omitempty"`
State string `json:"state,omitempty"`
Value string `json:"value,omitempty"`
State string `json:"state,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
}

// RemoteRoute represents a route for a Partner Interconnect Attachment.
Expand Down
8 changes: 6 additions & 2 deletions partner_interconnect_attachments_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,13 +292,17 @@ func TestPartnerInterconnectAttachment_GetServiceKey(t *testing.T) {
svc := client.PartnerInterconnectAttachments
path := "/v2/partner_interconnect/attachments"
want := &ServiceKey{
ServiceKey: "my-service-key",
Value: "my-service-key",
State: "ACTIVE",
CreatedAt: time.Date(2024, 12, 26, 21, 48, 40, 995304079, time.UTC),
}
id := "880b7f98-f062-404d-b33c-458d545696f6"
jsonBlob := `
{
"service_key": {
"service_key": "my-service-key"
"value": "my-service-key",
"state": "ACTIVE",
"created_at": "2024-12-26T21:48:40.995304079Z"
}
}
`
Expand Down

0 comments on commit 0dcda2a

Please sign in to comment.