Skip to content

Commit

Permalink
added again ServiceToken field for legacy compability with a deprecat…
Browse files Browse the repository at this point in the history
…ion note
  • Loading branch information
ocobles committed Jul 15, 2022
1 parent e3b4077 commit aeda3b6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,23 @@ type L2Connection struct {
RedundancyType *string
RedundancyGroup *string
Actions []L2ConnectionAction
// ServiceToken is used to create connections with an a-side Equinix Fabric Token
// Applicable for CREATE operations: CreateL2Connection, CreateL2RedundantConnection...
//
// Deprecated: ServiceToken (GET operations) - Starting with v2.3.0 this field should not be
// used to populate the a-side token with which the connection was created. It is maintained
// for historical compability but can contain both a-side/z-side tokens. To access the token
// returned by a GET operation (GetL2Connection, GetL2OutgoingConnections...), use the
// L2Connection.VendorToken string.
ServiceToken *string
// ZSideServiceToken is used to create connections using a z-side Equinix Fabric Token
// Applicable for CREATE operations: CreateL2Connection, CreateL2RedundantConnection...
ZSideServiceToken *string
// VendorToken is used in GET Operations (GetL2Connection, GetL2OutgoingConnections...) to
// populate the Equinix Fabric Token the connection was created with (if applicable). The token
// can be any of ServiceToken (a-side) or ZSideServiceToken (z-side). Any mechanism to
// determine the token type (a-side/z-side), must be implemented by the user/consumer of the
// SDK.
VendorToken *string
}

Expand Down
1 change: 1 addition & 0 deletions rest_l2_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ func mapGETToL2Connection(getResponse api.L2ConnectionResponse) *L2Connection {
RedundancyType: getResponse.RedundancyType,
RedundancyGroup: getResponse.RedundancyGroup,
Actions: mapL2ConnectionActionsAPIToDomain(getResponse.ActionDetails),
ServiceToken: getResponse.VendorToken,
VendorToken: getResponse.VendorToken,
}
}
Expand Down

0 comments on commit aeda3b6

Please sign in to comment.