From aeda3b6a83c40671e2a6017a1ecb6e00485263ad Mon Sep 17 00:00:00 2001 From: Oscar Cobles Date: Fri, 15 Jul 2022 04:14:28 -0500 Subject: [PATCH] added again ServiceToken field for legacy compability with a deprecation note --- client.go | 15 +++++++++++++++ rest_l2_connection.go | 1 + 2 files changed, 16 insertions(+) diff --git a/client.go b/client.go index 8d5dd92..2866a6e 100644 --- a/client.go +++ b/client.go @@ -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 } diff --git a/rest_l2_connection.go b/rest_l2_connection.go index 2f7c800..c248c17 100644 --- a/rest_l2_connection.go +++ b/rest_l2_connection.go @@ -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, } }