diff --git a/sdk/resourcemanager/peering/armpeering/CHANGELOG.md b/sdk/resourcemanager/peering/armpeering/CHANGELOG.md index 128db3293f39..7b4c54a94e22 100644 --- a/sdk/resourcemanager/peering/armpeering/CHANGELOG.md +++ b/sdk/resourcemanager/peering/armpeering/CHANGELOG.md @@ -1,5 +1,23 @@ # Release History +## 1.1.0 (2022-10-31) +### Features Added + +- New const `ConnectionStateTypeChangeInProgress` +- New const `ConnectionStateTypeChangeRequested` +- New function `*RpUnbilledPrefixesClient.NewListPager(string, string, *RpUnbilledPrefixesClientListOptions) *runtime.Pager[RpUnbilledPrefixesClientListResponse]` +- New function `*RegisteredPrefixesClient.Validate(context.Context, string, string, string, *RegisteredPrefixesClientValidateOptions) (RegisteredPrefixesClientValidateResponse, error)` +- New function `NewRpUnbilledPrefixesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*RpUnbilledPrefixesClient, error)` +- New struct `RegisteredPrefixesClientValidateOptions` +- New struct `RegisteredPrefixesClientValidateResponse` +- New struct `RpUnbilledPrefix` +- New struct `RpUnbilledPrefixListResult` +- New struct `RpUnbilledPrefixesClient` +- New struct `RpUnbilledPrefixesClientListOptions` +- New struct `RpUnbilledPrefixesClientListResponse` +- New field `DirectPeeringType` in struct `LegacyPeeringsClientListOptions` + + ## 1.0.0 (2022-05-18) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 1.0.0, which contains breaking changes. diff --git a/sdk/resourcemanager/peering/armpeering/autorest.md b/sdk/resourcemanager/peering/armpeering/autorest.md index b82d4a856423..d971498aa1d9 100644 --- a/sdk/resourcemanager/peering/armpeering/autorest.md +++ b/sdk/resourcemanager/peering/armpeering/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/peering/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/peering/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 1.1.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/peering/armpeering/zz_generated_cdnpeeringprefixes_client.go b/sdk/resourcemanager/peering/armpeering/cdnpeeringprefixes_client.go similarity index 96% rename from sdk/resourcemanager/peering/armpeering/zz_generated_cdnpeeringprefixes_client.go rename to sdk/resourcemanager/peering/armpeering/cdnpeeringprefixes_client.go index cbf9a3aef37c..82d6e289a9d2 100644 --- a/sdk/resourcemanager/peering/armpeering/zz_generated_cdnpeeringprefixes_client.go +++ b/sdk/resourcemanager/peering/armpeering/cdnpeeringprefixes_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armpeering @@ -55,8 +56,7 @@ func NewCdnPeeringPrefixesClient(subscriptionID string, credential azcore.TokenC } // NewListPager - Lists all of the advertised prefixes for the specified peering location -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // peeringLocation - The peering location. // options - CdnPeeringPrefixesClientListOptions contains the optional parameters for the CdnPeeringPrefixesClient.List method. func (client *CdnPeeringPrefixesClient) NewListPager(peeringLocation string, options *CdnPeeringPrefixesClientListOptions) *runtime.Pager[CdnPeeringPrefixesClientListResponse] { @@ -100,7 +100,7 @@ func (client *CdnPeeringPrefixesClient) listCreateRequest(ctx context.Context, p } reqQP := req.Raw().URL.Query() reqQP.Set("peeringLocation", peeringLocation) - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/peering/armpeering/zz_generated_connectionmonitortests_client.go b/sdk/resourcemanager/peering/armpeering/connectionmonitortests_client.go similarity index 97% rename from sdk/resourcemanager/peering/armpeering/zz_generated_connectionmonitortests_client.go rename to sdk/resourcemanager/peering/armpeering/connectionmonitortests_client.go index 5b2567ab4a1b..78352cc17b67 100644 --- a/sdk/resourcemanager/peering/armpeering/zz_generated_connectionmonitortests_client.go +++ b/sdk/resourcemanager/peering/armpeering/connectionmonitortests_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armpeering @@ -57,7 +58,7 @@ func NewConnectionMonitorTestsClient(subscriptionID string, credential azcore.To // CreateOrUpdate - Creates or updates a connection monitor test with the specified name under the given subscription, resource // group and peering service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // resourceGroupName - The name of the resource group. // peeringServiceName - The name of the peering service. // connectionMonitorTestName - The name of the connection monitor test @@ -103,7 +104,7 @@ func (client *ConnectionMonitorTestsClient) createOrUpdateCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, connectionMonitorTest) @@ -121,7 +122,7 @@ func (client *ConnectionMonitorTestsClient) createOrUpdateHandleResponse(resp *h // Delete - Deletes an existing connection monitor test with the specified name under the given subscription, resource group // and peering service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // resourceGroupName - The name of the resource group. // peeringServiceName - The name of the peering service. // connectionMonitorTestName - The name of the connection monitor test @@ -166,7 +167,7 @@ func (client *ConnectionMonitorTestsClient) deleteCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -175,7 +176,7 @@ func (client *ConnectionMonitorTestsClient) deleteCreateRequest(ctx context.Cont // Get - Gets an existing connection monitor test with the specified name under the given subscription, resource group and // peering service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // resourceGroupName - The name of the resource group. // peeringServiceName - The name of the peering service. // connectionMonitorTestName - The name of the connection monitor test @@ -220,7 +221,7 @@ func (client *ConnectionMonitorTestsClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -237,8 +238,7 @@ func (client *ConnectionMonitorTestsClient) getHandleResponse(resp *http.Respons // NewListByPeeringServicePager - Lists all connection monitor tests under the given subscription, resource group and peering // service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // resourceGroupName - The name of the resource group. // peeringServiceName - The name of the peering service. // options - ConnectionMonitorTestsClientListByPeeringServiceOptions contains the optional parameters for the ConnectionMonitorTestsClient.ListByPeeringService @@ -291,7 +291,7 @@ func (client *ConnectionMonitorTestsClient) listByPeeringServiceCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/peering/armpeering/zz_generated_constants.go b/sdk/resourcemanager/peering/armpeering/constants.go similarity index 98% rename from sdk/resourcemanager/peering/armpeering/zz_generated_constants.go rename to sdk/resourcemanager/peering/armpeering/constants.go index c31f3369b72a..8e46c32c582f 100644 --- a/sdk/resourcemanager/peering/armpeering/zz_generated_constants.go +++ b/sdk/resourcemanager/peering/armpeering/constants.go @@ -5,12 +5,13 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armpeering const ( moduleName = "armpeering" - moduleVersion = "v1.0.0" + moduleVersion = "v1.1.0" ) // Command - Invoked command @@ -42,6 +43,8 @@ const ( ConnectionStateProvisioningCompleted ConnectionState = "ProvisioningCompleted" ConnectionStateProvisioningFailed ConnectionState = "ProvisioningFailed" ConnectionStateProvisioningStarted ConnectionState = "ProvisioningStarted" + ConnectionStateTypeChangeInProgress ConnectionState = "TypeChangeInProgress" + ConnectionStateTypeChangeRequested ConnectionState = "TypeChangeRequested" ConnectionStateValidating ConnectionState = "Validating" ) @@ -55,6 +58,8 @@ func PossibleConnectionStateValues() []ConnectionState { ConnectionStateProvisioningCompleted, ConnectionStateProvisioningFailed, ConnectionStateProvisioningStarted, + ConnectionStateTypeChangeInProgress, + ConnectionStateTypeChangeRequested, ConnectionStateValidating, } } diff --git a/sdk/resourcemanager/peering/armpeering/go.mod b/sdk/resourcemanager/peering/armpeering/go.mod index bc57afb4dcd0..ab9614bfbfac 100644 --- a/sdk/resourcemanager/peering/armpeering/go.mod +++ b/sdk/resourcemanager/peering/armpeering/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/peering/armpeering/go.sum b/sdk/resourcemanager/peering/armpeering/go.sum index ed5b814680ee..3afb578030a5 100644 --- a/sdk/resourcemanager/peering/armpeering/go.sum +++ b/sdk/resourcemanager/peering/armpeering/go.sum @@ -1,33 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 h1:Yoicul8bnVdQrhDMTHxdEckRGX01XvwXDHUT9zYZ3k0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/peering/armpeering/zz_generated_legacypeerings_client.go b/sdk/resourcemanager/peering/armpeering/legacypeerings_client.go similarity index 95% rename from sdk/resourcemanager/peering/armpeering/zz_generated_legacypeerings_client.go rename to sdk/resourcemanager/peering/armpeering/legacypeerings_client.go index 0c32b7c077a3..8d62d8acae4f 100644 --- a/sdk/resourcemanager/peering/armpeering/zz_generated_legacypeerings_client.go +++ b/sdk/resourcemanager/peering/armpeering/legacypeerings_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armpeering @@ -56,8 +57,7 @@ func NewLegacyPeeringsClient(subscriptionID string, credential azcore.TokenCrede } // NewListPager - Lists all of the legacy peerings under the given subscription matching the specified kind and location. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // peeringLocation - The location of the peering. // kind - The kind of the peering. // options - LegacyPeeringsClientListOptions contains the optional parameters for the LegacyPeeringsClient.List method. @@ -106,7 +106,10 @@ func (client *LegacyPeeringsClient) listCreateRequest(ctx context.Context, peeri if options != nil && options.Asn != nil { reqQP.Set("asn", strconv.FormatInt(int64(*options.Asn), 10)) } - reqQP.Set("api-version", "2022-01-01") + if options != nil && options.DirectPeeringType != nil { + reqQP.Set("directPeeringType", string(*options.DirectPeeringType)) + } + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/peering/armpeering/zz_generated_locations_client.go b/sdk/resourcemanager/peering/armpeering/locations_client.go similarity index 96% rename from sdk/resourcemanager/peering/armpeering/zz_generated_locations_client.go rename to sdk/resourcemanager/peering/armpeering/locations_client.go index d5ab3b936aa1..8f149e0bd8b4 100644 --- a/sdk/resourcemanager/peering/armpeering/zz_generated_locations_client.go +++ b/sdk/resourcemanager/peering/armpeering/locations_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armpeering @@ -55,8 +56,7 @@ func NewLocationsClient(subscriptionID string, credential azcore.TokenCredential } // NewListPager - Lists all of the available peering locations for the specified kind of peering. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // kind - The kind of the peering. // options - LocationsClientListOptions contains the optional parameters for the LocationsClient.List method. func (client *LocationsClient) NewListPager(kind PeeringLocationsKind, options *LocationsClientListOptions) *runtime.Pager[LocationsClientListResponse] { @@ -103,7 +103,7 @@ func (client *LocationsClient) listCreateRequest(ctx context.Context, kind Peeri if options != nil && options.DirectPeeringType != nil { reqQP.Set("directPeeringType", string(*options.DirectPeeringType)) } - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/peering/armpeering/zz_generated_lookingglass_client.go b/sdk/resourcemanager/peering/armpeering/lookingglass_client.go similarity index 97% rename from sdk/resourcemanager/peering/armpeering/zz_generated_lookingglass_client.go rename to sdk/resourcemanager/peering/armpeering/lookingglass_client.go index 31bd5ea835fc..b84e2fe2252d 100644 --- a/sdk/resourcemanager/peering/armpeering/zz_generated_lookingglass_client.go +++ b/sdk/resourcemanager/peering/armpeering/lookingglass_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armpeering @@ -56,7 +57,7 @@ func NewLookingGlassClient(subscriptionID string, credential azcore.TokenCredent // Invoke - Run looking glass functionality // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // command - The command to be executed: ping, traceroute, bgpRoute. // sourceType - The type of the source: Edge site or Azure Region. // sourceLocation - The location of the source. @@ -93,7 +94,7 @@ func (client *LookingGlassClient) invokeCreateRequest(ctx context.Context, comma reqQP.Set("sourceType", string(sourceType)) reqQP.Set("sourceLocation", sourceLocation) reqQP.Set("destinationIP", destinationIP) - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/peering/armpeering/zz_generated_management_client.go b/sdk/resourcemanager/peering/armpeering/management_client.go similarity index 98% rename from sdk/resourcemanager/peering/armpeering/zz_generated_management_client.go rename to sdk/resourcemanager/peering/armpeering/management_client.go index f57a82f75d5e..cbafef700872 100644 --- a/sdk/resourcemanager/peering/armpeering/zz_generated_management_client.go +++ b/sdk/resourcemanager/peering/armpeering/management_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armpeering @@ -56,7 +57,7 @@ func NewManagementClient(subscriptionID string, credential azcore.TokenCredentia // CheckServiceProviderAvailability - Checks if the peering service provider is present within 1000 miles of customer's location // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // checkServiceProviderAvailabilityInput - The CheckServiceProviderAvailabilityInput indicating customer location and service // provider. // options - ManagementClientCheckServiceProviderAvailabilityOptions contains the optional parameters for the ManagementClient.CheckServiceProviderAvailability @@ -88,7 +89,7 @@ func (client *ManagementClient) checkServiceProviderAvailabilityCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, checkServiceProviderAvailabilityInput) diff --git a/sdk/resourcemanager/peering/armpeering/zz_generated_models.go b/sdk/resourcemanager/peering/armpeering/models.go similarity index 96% rename from sdk/resourcemanager/peering/armpeering/zz_generated_models.go rename to sdk/resourcemanager/peering/armpeering/models.go index baf6c3d3886d..eb3ce2a9bf9e 100644 --- a/sdk/resourcemanager/peering/armpeering/zz_generated_models.go +++ b/sdk/resourcemanager/peering/armpeering/models.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armpeering @@ -126,12 +127,12 @@ type ConnectionMonitorTest struct { Type *string `json:"type,omitempty" azure:"ro"` } -// ConnectionMonitorTestListResult - The paginated list of [T]. +// ConnectionMonitorTestListResult - The paginated list of Connection Monitor Tests. type ConnectionMonitorTestListResult struct { - // The link to fetch the next page of [T]. + // The link to fetch the next page of Connection Monitor Tests. NextLink *string `json:"nextLink,omitempty"` - // The list of [T]. + // The list of Connection Monitor Tests. Value []*ConnectionMonitorTest `json:"value,omitempty"` } @@ -306,6 +307,8 @@ type ExchangePeeringFacility struct { type LegacyPeeringsClientListOptions struct { // The ASN number associated with a legacy peering. Asn *int32 + // The direct peering type. + DirectPeeringType *DirectPeeringType } // ListResult - The paginated list of peerings. @@ -847,6 +850,11 @@ type RegisteredPrefixesClientListByPeeringOptions struct { // placeholder for future optional parameters } +// RegisteredPrefixesClientValidateOptions contains the optional parameters for the RegisteredPrefixesClient.Validate method. +type RegisteredPrefixesClientValidateOptions struct { + // placeholder for future optional parameters +} + // Resource - The ARM resource class. type Resource struct { // READ-ONLY; The ID of the resource. @@ -865,6 +873,33 @@ type ResourceTags struct { Tags map[string]*string `json:"tags,omitempty"` } +// RpUnbilledPrefix - The Routing Preference unbilled prefix +type RpUnbilledPrefix struct { + // READ-ONLY; The Azure region. + AzureRegion *string `json:"azureRegion,omitempty" azure:"ro"` + + // READ-ONLY; The peer ASN. + PeerAsn *int32 `json:"peerAsn,omitempty" azure:"ro"` + + // READ-ONLY; The prefix. + Prefix *string `json:"prefix,omitempty" azure:"ro"` +} + +// RpUnbilledPrefixListResult - The paginated list of RP unbilled prefixes. +type RpUnbilledPrefixListResult struct { + // The link to fetch the next page of RP unbilled prefixes. + NextLink *string `json:"nextLink,omitempty"` + + // The list of RP unbilled prefixes. + Value []*RpUnbilledPrefix `json:"value,omitempty"` +} + +// RpUnbilledPrefixesClientListOptions contains the optional parameters for the RpUnbilledPrefixesClient.List method. +type RpUnbilledPrefixesClientListOptions struct { + // Flag to enable consolidation prefixes + Consolidate *bool +} + // SKU - The SKU that defines the tier and kind of the peering. type SKU struct { // The name of the peering SKU. diff --git a/sdk/resourcemanager/peering/armpeering/models_serde.go b/sdk/resourcemanager/peering/armpeering/models_serde.go new file mode 100644 index 000000000000..83de358cd9c5 --- /dev/null +++ b/sdk/resourcemanager/peering/armpeering/models_serde.go @@ -0,0 +1,2573 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armpeering + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type BandwidthOffer. +func (b BandwidthOffer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "offerName", b.OfferName) + populate(objectMap, "valueInMbps", b.ValueInMbps) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BandwidthOffer. +func (b *BandwidthOffer) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "offerName": + err = unpopulate(val, "OfferName", &b.OfferName) + delete(rawMsg, key) + case "valueInMbps": + err = unpopulate(val, "ValueInMbps", &b.ValueInMbps) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BgpSession. +func (b BgpSession) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "md5AuthenticationKey", b.MD5AuthenticationKey) + populate(objectMap, "maxPrefixesAdvertisedV4", b.MaxPrefixesAdvertisedV4) + populate(objectMap, "maxPrefixesAdvertisedV6", b.MaxPrefixesAdvertisedV6) + populate(objectMap, "microsoftSessionIPv4Address", b.MicrosoftSessionIPv4Address) + populate(objectMap, "microsoftSessionIPv6Address", b.MicrosoftSessionIPv6Address) + populate(objectMap, "peerSessionIPv4Address", b.PeerSessionIPv4Address) + populate(objectMap, "peerSessionIPv6Address", b.PeerSessionIPv6Address) + populate(objectMap, "sessionPrefixV4", b.SessionPrefixV4) + populate(objectMap, "sessionPrefixV6", b.SessionPrefixV6) + populate(objectMap, "sessionStateV4", b.SessionStateV4) + populate(objectMap, "sessionStateV6", b.SessionStateV6) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BgpSession. +func (b *BgpSession) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "md5AuthenticationKey": + err = unpopulate(val, "MD5AuthenticationKey", &b.MD5AuthenticationKey) + delete(rawMsg, key) + case "maxPrefixesAdvertisedV4": + err = unpopulate(val, "MaxPrefixesAdvertisedV4", &b.MaxPrefixesAdvertisedV4) + delete(rawMsg, key) + case "maxPrefixesAdvertisedV6": + err = unpopulate(val, "MaxPrefixesAdvertisedV6", &b.MaxPrefixesAdvertisedV6) + delete(rawMsg, key) + case "microsoftSessionIPv4Address": + err = unpopulate(val, "MicrosoftSessionIPv4Address", &b.MicrosoftSessionIPv4Address) + delete(rawMsg, key) + case "microsoftSessionIPv6Address": + err = unpopulate(val, "MicrosoftSessionIPv6Address", &b.MicrosoftSessionIPv6Address) + delete(rawMsg, key) + case "peerSessionIPv4Address": + err = unpopulate(val, "PeerSessionIPv4Address", &b.PeerSessionIPv4Address) + delete(rawMsg, key) + case "peerSessionIPv6Address": + err = unpopulate(val, "PeerSessionIPv6Address", &b.PeerSessionIPv6Address) + delete(rawMsg, key) + case "sessionPrefixV4": + err = unpopulate(val, "SessionPrefixV4", &b.SessionPrefixV4) + delete(rawMsg, key) + case "sessionPrefixV6": + err = unpopulate(val, "SessionPrefixV6", &b.SessionPrefixV6) + delete(rawMsg, key) + case "sessionStateV4": + err = unpopulate(val, "SessionStateV4", &b.SessionStateV4) + delete(rawMsg, key) + case "sessionStateV6": + err = unpopulate(val, "SessionStateV6", &b.SessionStateV6) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CdnPeeringPrefix. +func (c CdnPeeringPrefix) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CdnPeeringPrefix. +func (c *CdnPeeringPrefix) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CdnPeeringPrefixListResult. +func (c CdnPeeringPrefixListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CdnPeeringPrefixListResult. +func (c *CdnPeeringPrefixListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CdnPeeringPrefixProperties. +func (c CdnPeeringPrefixProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "azureRegion", c.AzureRegion) + populate(objectMap, "azureService", c.AzureService) + populate(objectMap, "bgpCommunity", c.BgpCommunity) + populate(objectMap, "isPrimaryRegion", c.IsPrimaryRegion) + populate(objectMap, "prefix", c.Prefix) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CdnPeeringPrefixProperties. +func (c *CdnPeeringPrefixProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureRegion": + err = unpopulate(val, "AzureRegion", &c.AzureRegion) + delete(rawMsg, key) + case "azureService": + err = unpopulate(val, "AzureService", &c.AzureService) + delete(rawMsg, key) + case "bgpCommunity": + err = unpopulate(val, "BgpCommunity", &c.BgpCommunity) + delete(rawMsg, key) + case "isPrimaryRegion": + err = unpopulate(val, "IsPrimaryRegion", &c.IsPrimaryRegion) + delete(rawMsg, key) + case "prefix": + err = unpopulate(val, "Prefix", &c.Prefix) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CheckServiceProviderAvailabilityInput. +func (c CheckServiceProviderAvailabilityInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "peeringServiceLocation", c.PeeringServiceLocation) + populate(objectMap, "peeringServiceProvider", c.PeeringServiceProvider) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckServiceProviderAvailabilityInput. +func (c *CheckServiceProviderAvailabilityInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "peeringServiceLocation": + err = unpopulate(val, "PeeringServiceLocation", &c.PeeringServiceLocation) + delete(rawMsg, key) + case "peeringServiceProvider": + err = unpopulate(val, "PeeringServiceProvider", &c.PeeringServiceProvider) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConnectionMonitorTest. +func (c ConnectionMonitorTest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorTest. +func (c *ConnectionMonitorTest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConnectionMonitorTestListResult. +func (c ConnectionMonitorTestListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorTestListResult. +func (c *ConnectionMonitorTestListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConnectionMonitorTestProperties. +func (c ConnectionMonitorTestProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "destination", c.Destination) + populate(objectMap, "destinationPort", c.DestinationPort) + populate(objectMap, "isTestSuccessful", c.IsTestSuccessful) + populate(objectMap, "path", c.Path) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "sourceAgent", c.SourceAgent) + populate(objectMap, "testFrequencyInSec", c.TestFrequencyInSec) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorTestProperties. +func (c *ConnectionMonitorTestProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "destination": + err = unpopulate(val, "Destination", &c.Destination) + delete(rawMsg, key) + case "destinationPort": + err = unpopulate(val, "DestinationPort", &c.DestinationPort) + delete(rawMsg, key) + case "isTestSuccessful": + err = unpopulate(val, "IsTestSuccessful", &c.IsTestSuccessful) + delete(rawMsg, key) + case "path": + err = unpopulate(val, "Path", &c.Path) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "sourceAgent": + err = unpopulate(val, "SourceAgent", &c.SourceAgent) + delete(rawMsg, key) + case "testFrequencyInSec": + err = unpopulate(val, "TestFrequencyInSec", &c.TestFrequencyInSec) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContactDetail. +func (c ContactDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "email", c.Email) + populate(objectMap, "phone", c.Phone) + populate(objectMap, "role", c.Role) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContactDetail. +func (c *ContactDetail) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "email": + err = unpopulate(val, "Email", &c.Email) + delete(rawMsg, key) + case "phone": + err = unpopulate(val, "Phone", &c.Phone) + delete(rawMsg, key) + case "role": + err = unpopulate(val, "Role", &c.Role) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DirectConnection. +func (d DirectConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "bandwidthInMbps", d.BandwidthInMbps) + populate(objectMap, "bgpSession", d.BgpSession) + populate(objectMap, "connectionIdentifier", d.ConnectionIdentifier) + populate(objectMap, "connectionState", d.ConnectionState) + populate(objectMap, "errorMessage", d.ErrorMessage) + populate(objectMap, "microsoftTrackingId", d.MicrosoftTrackingID) + populate(objectMap, "peeringDBFacilityId", d.PeeringDBFacilityID) + populate(objectMap, "provisionedBandwidthInMbps", d.ProvisionedBandwidthInMbps) + populate(objectMap, "sessionAddressProvider", d.SessionAddressProvider) + populate(objectMap, "useForPeeringService", d.UseForPeeringService) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DirectConnection. +func (d *DirectConnection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "bandwidthInMbps": + err = unpopulate(val, "BandwidthInMbps", &d.BandwidthInMbps) + delete(rawMsg, key) + case "bgpSession": + err = unpopulate(val, "BgpSession", &d.BgpSession) + delete(rawMsg, key) + case "connectionIdentifier": + err = unpopulate(val, "ConnectionIdentifier", &d.ConnectionIdentifier) + delete(rawMsg, key) + case "connectionState": + err = unpopulate(val, "ConnectionState", &d.ConnectionState) + delete(rawMsg, key) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &d.ErrorMessage) + delete(rawMsg, key) + case "microsoftTrackingId": + err = unpopulate(val, "MicrosoftTrackingID", &d.MicrosoftTrackingID) + delete(rawMsg, key) + case "peeringDBFacilityId": + err = unpopulate(val, "PeeringDBFacilityID", &d.PeeringDBFacilityID) + delete(rawMsg, key) + case "provisionedBandwidthInMbps": + err = unpopulate(val, "ProvisionedBandwidthInMbps", &d.ProvisionedBandwidthInMbps) + delete(rawMsg, key) + case "sessionAddressProvider": + err = unpopulate(val, "SessionAddressProvider", &d.SessionAddressProvider) + delete(rawMsg, key) + case "useForPeeringService": + err = unpopulate(val, "UseForPeeringService", &d.UseForPeeringService) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DirectPeeringFacility. +func (d DirectPeeringFacility) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "address", d.Address) + populate(objectMap, "directPeeringType", d.DirectPeeringType) + populate(objectMap, "peeringDBFacilityId", d.PeeringDBFacilityID) + populate(objectMap, "peeringDBFacilityLink", d.PeeringDBFacilityLink) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DirectPeeringFacility. +func (d *DirectPeeringFacility) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "address": + err = unpopulate(val, "Address", &d.Address) + delete(rawMsg, key) + case "directPeeringType": + err = unpopulate(val, "DirectPeeringType", &d.DirectPeeringType) + delete(rawMsg, key) + case "peeringDBFacilityId": + err = unpopulate(val, "PeeringDBFacilityID", &d.PeeringDBFacilityID) + delete(rawMsg, key) + case "peeringDBFacilityLink": + err = unpopulate(val, "PeeringDBFacilityLink", &d.PeeringDBFacilityLink) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. +func (e ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", e.Code) + populate(objectMap, "message", e.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. +func (e *ErrorDetail) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. +func (e ErrorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "error", e.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. +func (e *ErrorResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &e.Error) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExchangeConnection. +func (e ExchangeConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "bgpSession", e.BgpSession) + populate(objectMap, "connectionIdentifier", e.ConnectionIdentifier) + populate(objectMap, "connectionState", e.ConnectionState) + populate(objectMap, "errorMessage", e.ErrorMessage) + populate(objectMap, "peeringDBFacilityId", e.PeeringDBFacilityID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExchangeConnection. +func (e *ExchangeConnection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "bgpSession": + err = unpopulate(val, "BgpSession", &e.BgpSession) + delete(rawMsg, key) + case "connectionIdentifier": + err = unpopulate(val, "ConnectionIdentifier", &e.ConnectionIdentifier) + delete(rawMsg, key) + case "connectionState": + err = unpopulate(val, "ConnectionState", &e.ConnectionState) + delete(rawMsg, key) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &e.ErrorMessage) + delete(rawMsg, key) + case "peeringDBFacilityId": + err = unpopulate(val, "PeeringDBFacilityID", &e.PeeringDBFacilityID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExchangePeeringFacility. +func (e ExchangePeeringFacility) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "bandwidthInMbps", e.BandwidthInMbps) + populate(objectMap, "exchangeName", e.ExchangeName) + populate(objectMap, "facilityIPv4Prefix", e.FacilityIPv4Prefix) + populate(objectMap, "facilityIPv6Prefix", e.FacilityIPv6Prefix) + populate(objectMap, "microsoftIPv4Address", e.MicrosoftIPv4Address) + populate(objectMap, "microsoftIPv6Address", e.MicrosoftIPv6Address) + populate(objectMap, "peeringDBFacilityId", e.PeeringDBFacilityID) + populate(objectMap, "peeringDBFacilityLink", e.PeeringDBFacilityLink) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExchangePeeringFacility. +func (e *ExchangePeeringFacility) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "bandwidthInMbps": + err = unpopulate(val, "BandwidthInMbps", &e.BandwidthInMbps) + delete(rawMsg, key) + case "exchangeName": + err = unpopulate(val, "ExchangeName", &e.ExchangeName) + delete(rawMsg, key) + case "facilityIPv4Prefix": + err = unpopulate(val, "FacilityIPv4Prefix", &e.FacilityIPv4Prefix) + delete(rawMsg, key) + case "facilityIPv6Prefix": + err = unpopulate(val, "FacilityIPv6Prefix", &e.FacilityIPv6Prefix) + delete(rawMsg, key) + case "microsoftIPv4Address": + err = unpopulate(val, "MicrosoftIPv4Address", &e.MicrosoftIPv4Address) + delete(rawMsg, key) + case "microsoftIPv6Address": + err = unpopulate(val, "MicrosoftIPv6Address", &e.MicrosoftIPv6Address) + delete(rawMsg, key) + case "peeringDBFacilityId": + err = unpopulate(val, "PeeringDBFacilityID", &e.PeeringDBFacilityID) + delete(rawMsg, key) + case "peeringDBFacilityLink": + err = unpopulate(val, "PeeringDBFacilityLink", &e.PeeringDBFacilityLink) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ListResult. +func (l ListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListResult. +func (l *ListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Location. +func (l Location) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", l.ID) + populate(objectMap, "kind", l.Kind) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Location. +func (l *Location) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &l.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LocationListResult. +func (l LocationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LocationListResult. +func (l *LocationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LocationProperties. +func (l LocationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "azureRegion", l.AzureRegion) + populate(objectMap, "country", l.Country) + populate(objectMap, "direct", l.Direct) + populate(objectMap, "exchange", l.Exchange) + populate(objectMap, "peeringLocation", l.PeeringLocation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LocationProperties. +func (l *LocationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureRegion": + err = unpopulate(val, "AzureRegion", &l.AzureRegion) + delete(rawMsg, key) + case "country": + err = unpopulate(val, "Country", &l.Country) + delete(rawMsg, key) + case "direct": + err = unpopulate(val, "Direct", &l.Direct) + delete(rawMsg, key) + case "exchange": + err = unpopulate(val, "Exchange", &l.Exchange) + delete(rawMsg, key) + case "peeringLocation": + err = unpopulate(val, "PeeringLocation", &l.PeeringLocation) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LocationPropertiesDirect. +func (l LocationPropertiesDirect) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "bandwidthOffers", l.BandwidthOffers) + populate(objectMap, "peeringFacilities", l.PeeringFacilities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LocationPropertiesDirect. +func (l *LocationPropertiesDirect) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "bandwidthOffers": + err = unpopulate(val, "BandwidthOffers", &l.BandwidthOffers) + delete(rawMsg, key) + case "peeringFacilities": + err = unpopulate(val, "PeeringFacilities", &l.PeeringFacilities) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LocationPropertiesExchange. +func (l LocationPropertiesExchange) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "peeringFacilities", l.PeeringFacilities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LocationPropertiesExchange. +func (l *LocationPropertiesExchange) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "peeringFacilities": + err = unpopulate(val, "PeeringFacilities", &l.PeeringFacilities) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LogAnalyticsWorkspaceProperties. +func (l LogAnalyticsWorkspaceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "connectedAgents", l.ConnectedAgents) + populate(objectMap, "key", l.Key) + populate(objectMap, "workspaceID", l.WorkspaceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsWorkspaceProperties. +func (l *LogAnalyticsWorkspaceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "connectedAgents": + err = unpopulate(val, "ConnectedAgents", &l.ConnectedAgents) + delete(rawMsg, key) + case "key": + err = unpopulate(val, "Key", &l.Key) + delete(rawMsg, key) + case "workspaceID": + err = unpopulate(val, "WorkspaceID", &l.WorkspaceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LookingGlassOutput. +func (l LookingGlassOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "command", l.Command) + populate(objectMap, "output", l.Output) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LookingGlassOutput. +func (l *LookingGlassOutput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "command": + err = unpopulate(val, "Command", &l.Command) + delete(rawMsg, key) + case "output": + err = unpopulate(val, "Output", &l.Output) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MetricDimension. +func (m MetricDimension) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "displayName", m.DisplayName) + populate(objectMap, "name", m.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricDimension. +func (m *MetricDimension) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "displayName": + err = unpopulate(val, "DisplayName", &m.DisplayName) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MetricSpecification. +func (m MetricSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "aggregationType", m.AggregationType) + populate(objectMap, "dimensions", m.Dimensions) + populate(objectMap, "displayDescription", m.DisplayDescription) + populate(objectMap, "displayName", m.DisplayName) + populate(objectMap, "name", m.Name) + populate(objectMap, "supportedTimeGrainTypes", m.SupportedTimeGrainTypes) + populate(objectMap, "unit", m.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricSpecification. +func (m *MetricSpecification) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "aggregationType": + err = unpopulate(val, "AggregationType", &m.AggregationType) + delete(rawMsg, key) + case "dimensions": + err = unpopulate(val, "Dimensions", &m.Dimensions) + delete(rawMsg, key) + case "displayDescription": + err = unpopulate(val, "DisplayDescription", &m.DisplayDescription) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &m.DisplayName) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "supportedTimeGrainTypes": + err = unpopulate(val, "SupportedTimeGrainTypes", &m.SupportedTimeGrainTypes) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &m.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "display", o.Display) + populate(objectMap, "isDataAction", o.IsDataAction) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationDisplayInfo. +func (o OperationDisplayInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplayInfo. +func (o *OperationDisplayInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. +func (o *OperationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationProperties. +func (o OperationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "serviceSpecification", o.ServiceSpecification) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationProperties. +func (o *OperationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "serviceSpecification": + err = unpopulate(val, "ServiceSpecification", &o.ServiceSpecification) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PeerAsn. +func (p PeerAsn) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PeerAsn. +func (p *PeerAsn) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PeerAsnListResult. +func (p PeerAsnListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PeerAsnListResult. +func (p *PeerAsnListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PeerAsnProperties. +func (p PeerAsnProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "errorMessage", p.ErrorMessage) + populate(objectMap, "peerAsn", p.PeerAsn) + populate(objectMap, "peerContactDetail", p.PeerContactDetail) + populate(objectMap, "peerName", p.PeerName) + populate(objectMap, "validationState", p.ValidationState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PeerAsnProperties. +func (p *PeerAsnProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &p.ErrorMessage) + delete(rawMsg, key) + case "peerAsn": + err = unpopulate(val, "PeerAsn", &p.PeerAsn) + delete(rawMsg, key) + case "peerContactDetail": + err = unpopulate(val, "PeerContactDetail", &p.PeerContactDetail) + delete(rawMsg, key) + case "peerName": + err = unpopulate(val, "PeerName", &p.PeerName) + delete(rawMsg, key) + case "validationState": + err = unpopulate(val, "ValidationState", &p.ValidationState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Peering. +func (p Peering) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "kind", p.Kind) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "sku", p.SKU) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Peering. +func (p *Peering) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &p.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &p.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Properties. +func (p Properties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "direct", p.Direct) + populate(objectMap, "exchange", p.Exchange) + populate(objectMap, "peeringLocation", p.PeeringLocation) + populate(objectMap, "provisioningState", p.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Properties. +func (p *Properties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "direct": + err = unpopulate(val, "Direct", &p.Direct) + delete(rawMsg, key) + case "exchange": + err = unpopulate(val, "Exchange", &p.Exchange) + delete(rawMsg, key) + case "peeringLocation": + err = unpopulate(val, "PeeringLocation", &p.PeeringLocation) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PropertiesDirect. +func (p PropertiesDirect) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "connections", p.Connections) + populate(objectMap, "directPeeringType", p.DirectPeeringType) + populate(objectMap, "peerAsn", p.PeerAsn) + populate(objectMap, "useForPeeringService", p.UseForPeeringService) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PropertiesDirect. +func (p *PropertiesDirect) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "connections": + err = unpopulate(val, "Connections", &p.Connections) + delete(rawMsg, key) + case "directPeeringType": + err = unpopulate(val, "DirectPeeringType", &p.DirectPeeringType) + delete(rawMsg, key) + case "peerAsn": + err = unpopulate(val, "PeerAsn", &p.PeerAsn) + delete(rawMsg, key) + case "useForPeeringService": + err = unpopulate(val, "UseForPeeringService", &p.UseForPeeringService) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PropertiesExchange. +func (p PropertiesExchange) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "connections", p.Connections) + populate(objectMap, "peerAsn", p.PeerAsn) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PropertiesExchange. +func (p *PropertiesExchange) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "connections": + err = unpopulate(val, "Connections", &p.Connections) + delete(rawMsg, key) + case "peerAsn": + err = unpopulate(val, "PeerAsn", &p.PeerAsn) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ReceivedRoute. +func (r ReceivedRoute) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "asPath", r.AsPath) + populate(objectMap, "nextHop", r.NextHop) + populate(objectMap, "originAsValidationState", r.OriginAsValidationState) + populate(objectMap, "prefix", r.Prefix) + populate(objectMap, "receivedTimestamp", r.ReceivedTimestamp) + populate(objectMap, "rpkiValidationState", r.RpkiValidationState) + populate(objectMap, "trustAnchor", r.TrustAnchor) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReceivedRoute. +func (r *ReceivedRoute) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "asPath": + err = unpopulate(val, "AsPath", &r.AsPath) + delete(rawMsg, key) + case "nextHop": + err = unpopulate(val, "NextHop", &r.NextHop) + delete(rawMsg, key) + case "originAsValidationState": + err = unpopulate(val, "OriginAsValidationState", &r.OriginAsValidationState) + delete(rawMsg, key) + case "prefix": + err = unpopulate(val, "Prefix", &r.Prefix) + delete(rawMsg, key) + case "receivedTimestamp": + err = unpopulate(val, "ReceivedTimestamp", &r.ReceivedTimestamp) + delete(rawMsg, key) + case "rpkiValidationState": + err = unpopulate(val, "RpkiValidationState", &r.RpkiValidationState) + delete(rawMsg, key) + case "trustAnchor": + err = unpopulate(val, "TrustAnchor", &r.TrustAnchor) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ReceivedRouteListResult. +func (r ReceivedRouteListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReceivedRouteListResult. +func (r *ReceivedRouteListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RegisteredAsn. +func (r RegisteredAsn) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RegisteredAsn. +func (r *RegisteredAsn) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RegisteredAsnListResult. +func (r RegisteredAsnListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RegisteredAsnListResult. +func (r *RegisteredAsnListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RegisteredAsnProperties. +func (r RegisteredAsnProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "asn", r.Asn) + populate(objectMap, "peeringServicePrefixKey", r.PeeringServicePrefixKey) + populate(objectMap, "provisioningState", r.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RegisteredAsnProperties. +func (r *RegisteredAsnProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "asn": + err = unpopulate(val, "Asn", &r.Asn) + delete(rawMsg, key) + case "peeringServicePrefixKey": + err = unpopulate(val, "PeeringServicePrefixKey", &r.PeeringServicePrefixKey) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RegisteredPrefix. +func (r RegisteredPrefix) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RegisteredPrefix. +func (r *RegisteredPrefix) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RegisteredPrefixListResult. +func (r RegisteredPrefixListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RegisteredPrefixListResult. +func (r *RegisteredPrefixListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RegisteredPrefixProperties. +func (r RegisteredPrefixProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "errorMessage", r.ErrorMessage) + populate(objectMap, "peeringServicePrefixKey", r.PeeringServicePrefixKey) + populate(objectMap, "prefix", r.Prefix) + populate(objectMap, "prefixValidationState", r.PrefixValidationState) + populate(objectMap, "provisioningState", r.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RegisteredPrefixProperties. +func (r *RegisteredPrefixProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &r.ErrorMessage) + delete(rawMsg, key) + case "peeringServicePrefixKey": + err = unpopulate(val, "PeeringServicePrefixKey", &r.PeeringServicePrefixKey) + delete(rawMsg, key) + case "prefix": + err = unpopulate(val, "Prefix", &r.Prefix) + delete(rawMsg, key) + case "prefixValidationState": + err = unpopulate(val, "PrefixValidationState", &r.PrefixValidationState) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceTags. +func (r ResourceTags) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", r.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTags. +func (r *ResourceTags) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &r.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RpUnbilledPrefix. +func (r RpUnbilledPrefix) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "azureRegion", r.AzureRegion) + populate(objectMap, "peerAsn", r.PeerAsn) + populate(objectMap, "prefix", r.Prefix) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RpUnbilledPrefix. +func (r *RpUnbilledPrefix) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureRegion": + err = unpopulate(val, "AzureRegion", &r.AzureRegion) + delete(rawMsg, key) + case "peerAsn": + err = unpopulate(val, "PeerAsn", &r.PeerAsn) + delete(rawMsg, key) + case "prefix": + err = unpopulate(val, "Prefix", &r.Prefix) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RpUnbilledPrefixListResult. +func (r RpUnbilledPrefixListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RpUnbilledPrefixListResult. +func (r *RpUnbilledPrefixListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKU. +func (s SKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "family", s.Family) + populate(objectMap, "name", s.Name) + populate(objectMap, "size", s.Size) + populate(objectMap, "tier", s.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKU. +func (s *SKU) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "family": + err = unpopulate(val, "Family", &s.Family) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "size": + err = unpopulate(val, "Size", &s.Size) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Service. +func (s Service) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "sku", s.SKU) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Service. +func (s *Service) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &s.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &s.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceCountry. +func (s ServiceCountry) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceCountry. +func (s *ServiceCountry) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceCountryListResult. +func (s ServiceCountryListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceCountryListResult. +func (s *ServiceCountryListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceListResult. +func (s ServiceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceListResult. +func (s *ServiceListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceLocation. +func (s ServiceLocation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceLocation. +func (s *ServiceLocation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceLocationListResult. +func (s ServiceLocationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceLocationListResult. +func (s *ServiceLocationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceLocationProperties. +func (s ServiceLocationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "azureRegion", s.AzureRegion) + populate(objectMap, "country", s.Country) + populate(objectMap, "state", s.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceLocationProperties. +func (s *ServiceLocationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureRegion": + err = unpopulate(val, "AzureRegion", &s.AzureRegion) + delete(rawMsg, key) + case "country": + err = unpopulate(val, "Country", &s.Country) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &s.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServicePrefix. +func (s ServicePrefix) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServicePrefix. +func (s *ServicePrefix) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServicePrefixEvent. +func (s ServicePrefixEvent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "eventDescription", s.EventDescription) + populate(objectMap, "eventLevel", s.EventLevel) + populate(objectMap, "eventSummary", s.EventSummary) + populateTimeRFC3339(objectMap, "eventTimestamp", s.EventTimestamp) + populate(objectMap, "eventType", s.EventType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServicePrefixEvent. +func (s *ServicePrefixEvent) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "eventDescription": + err = unpopulate(val, "EventDescription", &s.EventDescription) + delete(rawMsg, key) + case "eventLevel": + err = unpopulate(val, "EventLevel", &s.EventLevel) + delete(rawMsg, key) + case "eventSummary": + err = unpopulate(val, "EventSummary", &s.EventSummary) + delete(rawMsg, key) + case "eventTimestamp": + err = unpopulateTimeRFC3339(val, "EventTimestamp", &s.EventTimestamp) + delete(rawMsg, key) + case "eventType": + err = unpopulate(val, "EventType", &s.EventType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServicePrefixListResult. +func (s ServicePrefixListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServicePrefixListResult. +func (s *ServicePrefixListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServicePrefixProperties. +func (s ServicePrefixProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "errorMessage", s.ErrorMessage) + populate(objectMap, "events", s.Events) + populate(objectMap, "learnedType", s.LearnedType) + populate(objectMap, "peeringServicePrefixKey", s.PeeringServicePrefixKey) + populate(objectMap, "prefix", s.Prefix) + populate(objectMap, "prefixValidationState", s.PrefixValidationState) + populate(objectMap, "provisioningState", s.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServicePrefixProperties. +func (s *ServicePrefixProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &s.ErrorMessage) + delete(rawMsg, key) + case "events": + err = unpopulate(val, "Events", &s.Events) + delete(rawMsg, key) + case "learnedType": + err = unpopulate(val, "LearnedType", &s.LearnedType) + delete(rawMsg, key) + case "peeringServicePrefixKey": + err = unpopulate(val, "PeeringServicePrefixKey", &s.PeeringServicePrefixKey) + delete(rawMsg, key) + case "prefix": + err = unpopulate(val, "Prefix", &s.Prefix) + delete(rawMsg, key) + case "prefixValidationState": + err = unpopulate(val, "PrefixValidationState", &s.PrefixValidationState) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceProperties. +func (s ServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "logAnalyticsWorkspaceProperties", s.LogAnalyticsWorkspaceProperties) + populate(objectMap, "peeringServiceLocation", s.PeeringServiceLocation) + populate(objectMap, "peeringServiceProvider", s.PeeringServiceProvider) + populate(objectMap, "providerBackupPeeringLocation", s.ProviderBackupPeeringLocation) + populate(objectMap, "providerPrimaryPeeringLocation", s.ProviderPrimaryPeeringLocation) + populate(objectMap, "provisioningState", s.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceProperties. +func (s *ServiceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "logAnalyticsWorkspaceProperties": + err = unpopulate(val, "LogAnalyticsWorkspaceProperties", &s.LogAnalyticsWorkspaceProperties) + delete(rawMsg, key) + case "peeringServiceLocation": + err = unpopulate(val, "PeeringServiceLocation", &s.PeeringServiceLocation) + delete(rawMsg, key) + case "peeringServiceProvider": + err = unpopulate(val, "PeeringServiceProvider", &s.PeeringServiceProvider) + delete(rawMsg, key) + case "providerBackupPeeringLocation": + err = unpopulate(val, "ProviderBackupPeeringLocation", &s.ProviderBackupPeeringLocation) + delete(rawMsg, key) + case "providerPrimaryPeeringLocation": + err = unpopulate(val, "ProviderPrimaryPeeringLocation", &s.ProviderPrimaryPeeringLocation) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceProvider. +func (s ServiceProvider) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceProvider. +func (s *ServiceProvider) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceProviderListResult. +func (s ServiceProviderListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceProviderListResult. +func (s *ServiceProviderListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceProviderProperties. +func (s ServiceProviderProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "peeringLocations", s.PeeringLocations) + populate(objectMap, "serviceProviderName", s.ServiceProviderName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceProviderProperties. +func (s *ServiceProviderProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "peeringLocations": + err = unpopulate(val, "PeeringLocations", &s.PeeringLocations) + delete(rawMsg, key) + case "serviceProviderName": + err = unpopulate(val, "ServiceProviderName", &s.ServiceProviderName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceSKU. +func (s ServiceSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", s.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceSKU. +func (s *ServiceSKU) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceSpecification. +func (s ServiceSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "metricSpecifications", s.MetricSpecifications) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceSpecification. +func (s *ServiceSpecification) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "metricSpecifications": + err = unpopulate(val, "MetricSpecifications", &s.MetricSpecifications) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SubResource. +func (s SubResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubResource. +func (s *SubResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +func populate(m map[string]interface{}, k string, v interface{}) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func unpopulate(data json.RawMessage, fn string, v interface{}) error { + if data == nil { + return nil + } + if err := json.Unmarshal(data, v); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + return nil +} diff --git a/sdk/resourcemanager/peering/armpeering/zz_generated_operations_client.go b/sdk/resourcemanager/peering/armpeering/operations_client.go similarity index 96% rename from sdk/resourcemanager/peering/armpeering/zz_generated_operations_client.go rename to sdk/resourcemanager/peering/armpeering/operations_client.go index 37b4afdf2618..1f2834ef2ac4 100644 --- a/sdk/resourcemanager/peering/armpeering/zz_generated_operations_client.go +++ b/sdk/resourcemanager/peering/armpeering/operations_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armpeering @@ -49,8 +50,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO } // NewListPager - Lists all of the available API operations for peering resources. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -88,7 +88,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/peering/armpeering/zz_generated_peerasns_client.go b/sdk/resourcemanager/peering/armpeering/peerasns_client.go similarity index 96% rename from sdk/resourcemanager/peering/armpeering/zz_generated_peerasns_client.go rename to sdk/resourcemanager/peering/armpeering/peerasns_client.go index c8d4e98f70d9..eca5dc98a2d2 100644 --- a/sdk/resourcemanager/peering/armpeering/zz_generated_peerasns_client.go +++ b/sdk/resourcemanager/peering/armpeering/peerasns_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armpeering @@ -56,7 +57,7 @@ func NewPeerAsnsClient(subscriptionID string, credential azcore.TokenCredential, // CreateOrUpdate - Creates a new peer ASN or updates an existing peer ASN with the specified name under the given subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // peerAsnName - The peer ASN name. // peerAsn - The peer ASN. // options - PeerAsnsClientCreateOrUpdateOptions contains the optional parameters for the PeerAsnsClient.CreateOrUpdate method. @@ -91,7 +92,7 @@ func (client *PeerAsnsClient) createOrUpdateCreateRequest(ctx context.Context, p return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, peerAsn) @@ -108,7 +109,7 @@ func (client *PeerAsnsClient) createOrUpdateHandleResponse(resp *http.Response) // Delete - Deletes an existing peer ASN with the specified name under the given subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // peerAsnName - The peer ASN name. // options - PeerAsnsClientDeleteOptions contains the optional parameters for the PeerAsnsClient.Delete method. func (client *PeerAsnsClient) Delete(ctx context.Context, peerAsnName string, options *PeerAsnsClientDeleteOptions) (PeerAsnsClientDeleteResponse, error) { @@ -142,7 +143,7 @@ func (client *PeerAsnsClient) deleteCreateRequest(ctx context.Context, peerAsnNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -150,7 +151,7 @@ func (client *PeerAsnsClient) deleteCreateRequest(ctx context.Context, peerAsnNa // Get - Gets the peer ASN with the specified name under the given subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // peerAsnName - The peer ASN name. // options - PeerAsnsClientGetOptions contains the optional parameters for the PeerAsnsClient.Get method. func (client *PeerAsnsClient) Get(ctx context.Context, peerAsnName string, options *PeerAsnsClientGetOptions) (PeerAsnsClientGetResponse, error) { @@ -184,7 +185,7 @@ func (client *PeerAsnsClient) getCreateRequest(ctx context.Context, peerAsnName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -200,8 +201,7 @@ func (client *PeerAsnsClient) getHandleResponse(resp *http.Response) (PeerAsnsCl } // NewListBySubscriptionPager - Lists all of the peer ASNs under the given subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // options - PeerAsnsClientListBySubscriptionOptions contains the optional parameters for the PeerAsnsClient.ListBySubscription // method. func (client *PeerAsnsClient) NewListBySubscriptionPager(options *PeerAsnsClientListBySubscriptionOptions) *runtime.Pager[PeerAsnsClientListBySubscriptionResponse] { @@ -244,7 +244,7 @@ func (client *PeerAsnsClient) listBySubscriptionCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/peering/armpeering/zz_generated_peerings_client.go b/sdk/resourcemanager/peering/armpeering/peerings_client.go similarity index 96% rename from sdk/resourcemanager/peering/armpeering/zz_generated_peerings_client.go rename to sdk/resourcemanager/peering/armpeering/peerings_client.go index c18d08609dd8..c417bb6f2820 100644 --- a/sdk/resourcemanager/peering/armpeering/zz_generated_peerings_client.go +++ b/sdk/resourcemanager/peering/armpeering/peerings_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armpeering @@ -57,7 +58,7 @@ func NewPeeringsClient(subscriptionID string, credential azcore.TokenCredential, // CreateOrUpdate - Creates a new peering or updates an existing peering with the specified name under the given subscription // and resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // resourceGroupName - The name of the resource group. // peeringName - The name of the peering. // peering - The properties needed to create or update a peering. @@ -97,7 +98,7 @@ func (client *PeeringsClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, peering) @@ -114,7 +115,7 @@ func (client *PeeringsClient) createOrUpdateHandleResponse(resp *http.Response) // Delete - Deletes an existing peering with the specified name under the given subscription and resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // resourceGroupName - The name of the resource group. // peeringName - The name of the peering. // options - PeeringsClientDeleteOptions contains the optional parameters for the PeeringsClient.Delete method. @@ -153,7 +154,7 @@ func (client *PeeringsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -161,7 +162,7 @@ func (client *PeeringsClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Gets an existing peering with the specified name under the given subscription and resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // resourceGroupName - The name of the resource group. // peeringName - The name of the peering. // options - PeeringsClientGetOptions contains the optional parameters for the PeeringsClient.Get method. @@ -200,7 +201,7 @@ func (client *PeeringsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -216,8 +217,7 @@ func (client *PeeringsClient) getHandleResponse(resp *http.Response) (PeeringsCl } // NewListByResourceGroupPager - Lists all of the peerings under the given subscription and resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // resourceGroupName - The name of the resource group. // options - PeeringsClientListByResourceGroupOptions contains the optional parameters for the PeeringsClient.ListByResourceGroup // method. @@ -265,7 +265,7 @@ func (client *PeeringsClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,8 +281,7 @@ func (client *PeeringsClient) listByResourceGroupHandleResponse(resp *http.Respo } // NewListBySubscriptionPager - Lists all of the peerings under the given subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // options - PeeringsClientListBySubscriptionOptions contains the optional parameters for the PeeringsClient.ListBySubscription // method. func (client *PeeringsClient) NewListBySubscriptionPager(options *PeeringsClientListBySubscriptionOptions) *runtime.Pager[PeeringsClientListBySubscriptionResponse] { @@ -325,7 +324,7 @@ func (client *PeeringsClient) listBySubscriptionCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -342,7 +341,7 @@ func (client *PeeringsClient) listBySubscriptionHandleResponse(resp *http.Respon // Update - Updates tags for a peering with the specified name under the given subscription and resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // resourceGroupName - The name of the resource group. // peeringName - The name of the peering. // tags - The resource tags. @@ -382,7 +381,7 @@ func (client *PeeringsClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, tags) diff --git a/sdk/resourcemanager/peering/armpeering/zz_generated_prefixes_client.go b/sdk/resourcemanager/peering/armpeering/prefixes_client.go similarity index 97% rename from sdk/resourcemanager/peering/armpeering/zz_generated_prefixes_client.go rename to sdk/resourcemanager/peering/armpeering/prefixes_client.go index 880cac6f8466..5c43aae867ed 100644 --- a/sdk/resourcemanager/peering/armpeering/zz_generated_prefixes_client.go +++ b/sdk/resourcemanager/peering/armpeering/prefixes_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armpeering @@ -57,7 +58,7 @@ func NewPrefixesClient(subscriptionID string, credential azcore.TokenCredential, // CreateOrUpdate - Creates a new prefix with the specified name under the given subscription, resource group and peering // service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // resourceGroupName - The name of the resource group. // peeringServiceName - The name of the peering service. // prefixName - The name of the prefix. @@ -102,7 +103,7 @@ func (client *PrefixesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, peeringServicePrefix) @@ -119,7 +120,7 @@ func (client *PrefixesClient) createOrUpdateHandleResponse(resp *http.Response) // Delete - Deletes an existing prefix with the specified name under the given subscription, resource group and peering service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // resourceGroupName - The name of the resource group. // peeringServiceName - The name of the peering service. // prefixName - The name of the prefix. @@ -163,7 +164,7 @@ func (client *PrefixesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -171,7 +172,7 @@ func (client *PrefixesClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Gets an existing prefix with the specified name under the given subscription, resource group and peering service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // resourceGroupName - The name of the resource group. // peeringServiceName - The name of the peering service. // prefixName - The name of the prefix. @@ -218,7 +219,7 @@ func (client *PrefixesClient) getCreateRequest(ctx context.Context, resourceGrou if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,8 +235,7 @@ func (client *PrefixesClient) getHandleResponse(resp *http.Response) (PrefixesCl } // NewListByPeeringServicePager - Lists all prefixes under the given subscription, resource group and peering service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // resourceGroupName - The name of the resource group. // peeringServiceName - The name of the peering service. // options - PrefixesClientListByPeeringServiceOptions contains the optional parameters for the PrefixesClient.ListByPeeringService @@ -291,7 +291,7 @@ func (client *PrefixesClient) listByPeeringServiceCreateRequest(ctx context.Cont if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/peering/armpeering/zz_generated_receivedroutes_client.go b/sdk/resourcemanager/peering/armpeering/receivedroutes_client.go similarity index 97% rename from sdk/resourcemanager/peering/armpeering/zz_generated_receivedroutes_client.go rename to sdk/resourcemanager/peering/armpeering/receivedroutes_client.go index 24bb9f463757..3c66e2e7799f 100644 --- a/sdk/resourcemanager/peering/armpeering/zz_generated_receivedroutes_client.go +++ b/sdk/resourcemanager/peering/armpeering/receivedroutes_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armpeering @@ -56,8 +57,7 @@ func NewReceivedRoutesClient(subscriptionID string, credential azcore.TokenCrede // NewListByPeeringPager - Lists the prefixes received over the specified peering under the given subscription and resource // group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // resourceGroupName - The name of the resource group. // peeringName - The name of the peering. // options - ReceivedRoutesClientListByPeeringOptions contains the optional parameters for the ReceivedRoutesClient.ListByPeering @@ -125,7 +125,7 @@ func (client *ReceivedRoutesClient) listByPeeringCreateRequest(ctx context.Conte if options != nil && options.SkipToken != nil { reqQP.Set("$skipToken", *options.SkipToken) } - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/peering/armpeering/zz_generated_registeredasns_client.go b/sdk/resourcemanager/peering/armpeering/registeredasns_client.go similarity index 97% rename from sdk/resourcemanager/peering/armpeering/zz_generated_registeredasns_client.go rename to sdk/resourcemanager/peering/armpeering/registeredasns_client.go index f137c14d37a0..27011a736860 100644 --- a/sdk/resourcemanager/peering/armpeering/zz_generated_registeredasns_client.go +++ b/sdk/resourcemanager/peering/armpeering/registeredasns_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armpeering @@ -57,7 +58,7 @@ func NewRegisteredAsnsClient(subscriptionID string, credential azcore.TokenCrede // CreateOrUpdate - Creates a new registered ASN with the specified name under the given subscription, resource group and // peering. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // resourceGroupName - The name of the resource group. // peeringName - The name of the peering. // registeredAsnName - The name of the ASN. @@ -103,7 +104,7 @@ func (client *RegisteredAsnsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, registeredAsn) @@ -120,7 +121,7 @@ func (client *RegisteredAsnsClient) createOrUpdateHandleResponse(resp *http.Resp // Delete - Deletes an existing registered ASN with the specified name under the given subscription, resource group and peering. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // resourceGroupName - The name of the resource group. // peeringName - The name of the peering. // registeredAsnName - The name of the registered ASN. @@ -164,7 +165,7 @@ func (client *RegisteredAsnsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -172,7 +173,7 @@ func (client *RegisteredAsnsClient) deleteCreateRequest(ctx context.Context, res // Get - Gets an existing registered ASN with the specified name under the given subscription, resource group and peering. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // resourceGroupName - The name of the resource group. // peeringName - The name of the peering. // registeredAsnName - The name of the registered ASN. @@ -216,7 +217,7 @@ func (client *RegisteredAsnsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -232,8 +233,7 @@ func (client *RegisteredAsnsClient) getHandleResponse(resp *http.Response) (Regi } // NewListByPeeringPager - Lists all registered ASNs under the given subscription, resource group and peering. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // resourceGroupName - The name of the resource group. // peeringName - The name of the peering. // options - RegisteredAsnsClientListByPeeringOptions contains the optional parameters for the RegisteredAsnsClient.ListByPeering @@ -286,7 +286,7 @@ func (client *RegisteredAsnsClient) listByPeeringCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/peering/armpeering/zz_generated_registeredprefixes_client.go b/sdk/resourcemanager/peering/armpeering/registeredprefixes_client.go similarity index 80% rename from sdk/resourcemanager/peering/armpeering/zz_generated_registeredprefixes_client.go rename to sdk/resourcemanager/peering/armpeering/registeredprefixes_client.go index 669737d39a8c..8f23989326a4 100644 --- a/sdk/resourcemanager/peering/armpeering/zz_generated_registeredprefixes_client.go +++ b/sdk/resourcemanager/peering/armpeering/registeredprefixes_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armpeering @@ -57,7 +58,7 @@ func NewRegisteredPrefixesClient(subscriptionID string, credential azcore.TokenC // CreateOrUpdate - Creates a new registered prefix with the specified name under the given subscription, resource group and // peering. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // resourceGroupName - The name of the resource group. // peeringName - The name of the peering. // registeredPrefixName - The name of the registered prefix. @@ -103,7 +104,7 @@ func (client *RegisteredPrefixesClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, registeredPrefix) @@ -121,7 +122,7 @@ func (client *RegisteredPrefixesClient) createOrUpdateHandleResponse(resp *http. // Delete - Deletes an existing registered prefix with the specified name under the given subscription, resource group and // peering. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // resourceGroupName - The name of the resource group. // peeringName - The name of the peering. // registeredPrefixName - The name of the registered prefix. @@ -166,7 +167,7 @@ func (client *RegisteredPrefixesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -174,7 +175,7 @@ func (client *RegisteredPrefixesClient) deleteCreateRequest(ctx context.Context, // Get - Gets an existing registered prefix with the specified name under the given subscription, resource group and peering. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // resourceGroupName - The name of the resource group. // peeringName - The name of the peering. // registeredPrefixName - The name of the registered prefix. @@ -218,7 +219,7 @@ func (client *RegisteredPrefixesClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,8 +235,7 @@ func (client *RegisteredPrefixesClient) getHandleResponse(resp *http.Response) ( } // NewListByPeeringPager - Lists all registered prefixes under the given subscription, resource group and peering. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // resourceGroupName - The name of the resource group. // peeringName - The name of the peering. // options - RegisteredPrefixesClientListByPeeringOptions contains the optional parameters for the RegisteredPrefixesClient.ListByPeering @@ -288,7 +288,7 @@ func (client *RegisteredPrefixesClient) listByPeeringCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -302,3 +302,66 @@ func (client *RegisteredPrefixesClient) listByPeeringHandleResponse(resp *http.R } return result, nil } + +// Validate - Validates an existing registered prefix with the specified name under the given subscription, resource group +// and peering. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-10-01 +// resourceGroupName - The name of the resource group. +// peeringName - The name of the peering. +// registeredPrefixName - The name of the registered prefix. +// options - RegisteredPrefixesClientValidateOptions contains the optional parameters for the RegisteredPrefixesClient.Validate +// method. +func (client *RegisteredPrefixesClient) Validate(ctx context.Context, resourceGroupName string, peeringName string, registeredPrefixName string, options *RegisteredPrefixesClientValidateOptions) (RegisteredPrefixesClientValidateResponse, error) { + req, err := client.validateCreateRequest(ctx, resourceGroupName, peeringName, registeredPrefixName, options) + if err != nil { + return RegisteredPrefixesClientValidateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return RegisteredPrefixesClientValidateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return RegisteredPrefixesClientValidateResponse{}, runtime.NewResponseError(resp) + } + return client.validateHandleResponse(resp) +} + +// validateCreateRequest creates the Validate request. +func (client *RegisteredPrefixesClient) validateCreateRequest(ctx context.Context, resourceGroupName string, peeringName string, registeredPrefixName string, options *RegisteredPrefixesClientValidateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings/{peeringName}/registeredPrefixes/{registeredPrefixName}/validate" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if peeringName == "" { + return nil, errors.New("parameter peeringName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) + if registeredPrefixName == "" { + return nil, errors.New("parameter registeredPrefixName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registeredPrefixName}", url.PathEscape(registeredPrefixName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-10-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// validateHandleResponse handles the Validate response. +func (client *RegisteredPrefixesClient) validateHandleResponse(resp *http.Response) (RegisteredPrefixesClientValidateResponse, error) { + result := RegisteredPrefixesClientValidateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RegisteredPrefix); err != nil { + return RegisteredPrefixesClientValidateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/peering/armpeering/zz_generated_response_types.go b/sdk/resourcemanager/peering/armpeering/response_types.go similarity index 95% rename from sdk/resourcemanager/peering/armpeering/zz_generated_response_types.go rename to sdk/resourcemanager/peering/armpeering/response_types.go index 24885bf03eef..0eb77cee28a5 100644 --- a/sdk/resourcemanager/peering/armpeering/zz_generated_response_types.go +++ b/sdk/resourcemanager/peering/armpeering/response_types.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armpeering @@ -173,6 +174,16 @@ type RegisteredPrefixesClientListByPeeringResponse struct { RegisteredPrefixListResult } +// RegisteredPrefixesClientValidateResponse contains the response from method RegisteredPrefixesClient.Validate. +type RegisteredPrefixesClientValidateResponse struct { + RegisteredPrefix +} + +// RpUnbilledPrefixesClientListResponse contains the response from method RpUnbilledPrefixesClient.List. +type RpUnbilledPrefixesClientListResponse struct { + RpUnbilledPrefixListResult +} + // ServiceCountriesClientListResponse contains the response from method ServiceCountriesClient.List. type ServiceCountriesClientListResponse struct { ServiceCountryListResult diff --git a/sdk/resourcemanager/peering/armpeering/rpunbilledprefixes_client.go b/sdk/resourcemanager/peering/armpeering/rpunbilledprefixes_client.go new file mode 100644 index 000000000000..91bcfc757107 --- /dev/null +++ b/sdk/resourcemanager/peering/armpeering/rpunbilledprefixes_client.go @@ -0,0 +1,128 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armpeering + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// RpUnbilledPrefixesClient contains the methods for the RpUnbilledPrefixes group. +// Don't use this type directly, use NewRpUnbilledPrefixesClient() instead. +type RpUnbilledPrefixesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewRpUnbilledPrefixesClient creates a new instance of RpUnbilledPrefixesClient with the specified values. +// subscriptionID - The Azure subscription ID. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewRpUnbilledPrefixesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RpUnbilledPrefixesClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &RpUnbilledPrefixesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// NewListPager - Lists all of the RP unbilled prefixes for the specified peering +// Generated from API version 2022-10-01 +// resourceGroupName - The Azure resource group name. +// peeringName - The peering name. +// options - RpUnbilledPrefixesClientListOptions contains the optional parameters for the RpUnbilledPrefixesClient.List method. +func (client *RpUnbilledPrefixesClient) NewListPager(resourceGroupName string, peeringName string, options *RpUnbilledPrefixesClientListOptions) *runtime.Pager[RpUnbilledPrefixesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[RpUnbilledPrefixesClientListResponse]{ + More: func(page RpUnbilledPrefixesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *RpUnbilledPrefixesClientListResponse) (RpUnbilledPrefixesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, peeringName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return RpUnbilledPrefixesClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return RpUnbilledPrefixesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return RpUnbilledPrefixesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *RpUnbilledPrefixesClient) listCreateRequest(ctx context.Context, resourceGroupName string, peeringName string, options *RpUnbilledPrefixesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings/{peeringName}/rpUnbilledPrefixes" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if peeringName == "" { + return nil, errors.New("parameter peeringName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Consolidate != nil { + reqQP.Set("consolidate", strconv.FormatBool(*options.Consolidate)) + } + reqQP.Set("api-version", "2022-10-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *RpUnbilledPrefixesClient) listHandleResponse(resp *http.Response) (RpUnbilledPrefixesClientListResponse, error) { + result := RpUnbilledPrefixesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RpUnbilledPrefixListResult); err != nil { + return RpUnbilledPrefixesClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/peering/armpeering/zz_generated_servicecountries_client.go b/sdk/resourcemanager/peering/armpeering/servicecountries_client.go similarity index 96% rename from sdk/resourcemanager/peering/armpeering/zz_generated_servicecountries_client.go rename to sdk/resourcemanager/peering/armpeering/servicecountries_client.go index 06ec7eac0295..8690216b4876 100644 --- a/sdk/resourcemanager/peering/armpeering/zz_generated_servicecountries_client.go +++ b/sdk/resourcemanager/peering/armpeering/servicecountries_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armpeering @@ -55,8 +56,7 @@ func NewServiceCountriesClient(subscriptionID string, credential azcore.TokenCre } // NewListPager - Lists all of the available countries for peering service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // options - ServiceCountriesClientListOptions contains the optional parameters for the ServiceCountriesClient.List method. func (client *ServiceCountriesClient) NewListPager(options *ServiceCountriesClientListOptions) *runtime.Pager[ServiceCountriesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ServiceCountriesClientListResponse]{ @@ -98,7 +98,7 @@ func (client *ServiceCountriesClient) listCreateRequest(ctx context.Context, opt return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/peering/armpeering/zz_generated_servicelocations_client.go b/sdk/resourcemanager/peering/armpeering/servicelocations_client.go similarity index 96% rename from sdk/resourcemanager/peering/armpeering/zz_generated_servicelocations_client.go rename to sdk/resourcemanager/peering/armpeering/servicelocations_client.go index 2f315e386280..9e6e65889a1d 100644 --- a/sdk/resourcemanager/peering/armpeering/zz_generated_servicelocations_client.go +++ b/sdk/resourcemanager/peering/armpeering/servicelocations_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armpeering @@ -55,8 +56,7 @@ func NewServiceLocationsClient(subscriptionID string, credential azcore.TokenCre } // NewListPager - Lists all of the available locations for peering service. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // options - ServiceLocationsClientListOptions contains the optional parameters for the ServiceLocationsClient.List method. func (client *ServiceLocationsClient) NewListPager(options *ServiceLocationsClientListOptions) *runtime.Pager[ServiceLocationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ServiceLocationsClientListResponse]{ @@ -101,7 +101,7 @@ func (client *ServiceLocationsClient) listCreateRequest(ctx context.Context, opt if options != nil && options.Country != nil { reqQP.Set("country", *options.Country) } - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/peering/armpeering/zz_generated_serviceproviders_client.go b/sdk/resourcemanager/peering/armpeering/serviceproviders_client.go similarity index 96% rename from sdk/resourcemanager/peering/armpeering/zz_generated_serviceproviders_client.go rename to sdk/resourcemanager/peering/armpeering/serviceproviders_client.go index ca814aceabad..197f57d151ea 100644 --- a/sdk/resourcemanager/peering/armpeering/zz_generated_serviceproviders_client.go +++ b/sdk/resourcemanager/peering/armpeering/serviceproviders_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armpeering @@ -55,8 +56,7 @@ func NewServiceProvidersClient(subscriptionID string, credential azcore.TokenCre } // NewListPager - Lists all of the available peering service locations for the specified kind of peering. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // options - ServiceProvidersClientListOptions contains the optional parameters for the ServiceProvidersClient.List method. func (client *ServiceProvidersClient) NewListPager(options *ServiceProvidersClientListOptions) *runtime.Pager[ServiceProvidersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ServiceProvidersClientListResponse]{ @@ -98,7 +98,7 @@ func (client *ServiceProvidersClient) listCreateRequest(ctx context.Context, opt return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/peering/armpeering/zz_generated_services_client.go b/sdk/resourcemanager/peering/armpeering/services_client.go similarity index 96% rename from sdk/resourcemanager/peering/armpeering/zz_generated_services_client.go rename to sdk/resourcemanager/peering/armpeering/services_client.go index 309e02678be5..bd810ca70468 100644 --- a/sdk/resourcemanager/peering/armpeering/zz_generated_services_client.go +++ b/sdk/resourcemanager/peering/armpeering/services_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armpeering @@ -57,7 +58,7 @@ func NewServicesClient(subscriptionID string, credential azcore.TokenCredential, // CreateOrUpdate - Creates a new peering service or updates an existing peering with the specified name under the given subscription // and resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // resourceGroupName - The name of the resource group. // peeringServiceName - The name of the peering service. // peeringService - The properties needed to create or update a peering service. @@ -97,7 +98,7 @@ func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, peeringService) @@ -114,7 +115,7 @@ func (client *ServicesClient) createOrUpdateHandleResponse(resp *http.Response) // Delete - Deletes an existing peering service with the specified name under the given subscription and resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // resourceGroupName - The name of the resource group. // peeringServiceName - The name of the peering service. // options - ServicesClientDeleteOptions contains the optional parameters for the ServicesClient.Delete method. @@ -153,7 +154,7 @@ func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -161,7 +162,7 @@ func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Gets an existing peering service with the specified name under the given subscription and resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // resourceGroupName - The name of the resource group. // peeringServiceName - The name of the peering. // options - ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method. @@ -200,7 +201,7 @@ func (client *ServicesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -217,7 +218,7 @@ func (client *ServicesClient) getHandleResponse(resp *http.Response) (ServicesCl // InitializeConnectionMonitor - Initialize Peering Service for Connection Monitor functionality // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // options - ServicesClientInitializeConnectionMonitorOptions contains the optional parameters for the ServicesClient.InitializeConnectionMonitor // method. func (client *ServicesClient) InitializeConnectionMonitor(ctx context.Context, options *ServicesClientInitializeConnectionMonitorOptions) (ServicesClientInitializeConnectionMonitorResponse, error) { @@ -247,15 +248,14 @@ func (client *ServicesClient) initializeConnectionMonitorCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // NewListByResourceGroupPager - Lists all of the peering services under the given subscription and resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // resourceGroupName - The name of the resource group. // options - ServicesClientListByResourceGroupOptions contains the optional parameters for the ServicesClient.ListByResourceGroup // method. @@ -303,7 +303,7 @@ func (client *ServicesClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -319,8 +319,7 @@ func (client *ServicesClient) listByResourceGroupHandleResponse(resp *http.Respo } // NewListBySubscriptionPager - Lists all of the peerings under the given subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // options - ServicesClientListBySubscriptionOptions contains the optional parameters for the ServicesClient.ListBySubscription // method. func (client *ServicesClient) NewListBySubscriptionPager(options *ServicesClientListBySubscriptionOptions) *runtime.Pager[ServicesClientListBySubscriptionResponse] { @@ -363,7 +362,7 @@ func (client *ServicesClient) listBySubscriptionCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -380,7 +379,7 @@ func (client *ServicesClient) listBySubscriptionHandleResponse(resp *http.Respon // Update - Updates tags for a peering service with the specified name under the given subscription and resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01 +// Generated from API version 2022-10-01 // resourceGroupName - The name of the resource group. // peeringServiceName - The name of the peering service. // tags - The resource tags. @@ -420,7 +419,7 @@ func (client *ServicesClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01") + reqQP.Set("api-version", "2022-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, tags) diff --git a/sdk/resourcemanager/peering/armpeering/zz_generated_time_rfc3339.go b/sdk/resourcemanager/peering/armpeering/time_rfc3339.go similarity index 99% rename from sdk/resourcemanager/peering/armpeering/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/peering/armpeering/time_rfc3339.go index 7fdc7f888330..d1badef82d67 100644 --- a/sdk/resourcemanager/peering/armpeering/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/peering/armpeering/time_rfc3339.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armpeering diff --git a/sdk/resourcemanager/peering/armpeering/ze_generated_example_cdnpeeringprefixes_client_test.go b/sdk/resourcemanager/peering/armpeering/ze_generated_example_cdnpeeringprefixes_client_test.go deleted file mode 100644 index ebed72c721ea..000000000000 --- a/sdk/resourcemanager/peering/armpeering/ze_generated_example_cdnpeeringprefixes_client_test.go +++ /dev/null @@ -1,42 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armpeering_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListCdnPeeringPrefixes.json -func ExampleCdnPeeringPrefixesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewCdnPeeringPrefixesClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("peeringLocation0", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/peering/armpeering/ze_generated_example_connectionmonitortests_client_test.go b/sdk/resourcemanager/peering/armpeering/ze_generated_example_connectionmonitortests_client_test.go deleted file mode 100644 index 9431c162dea7..000000000000 --- a/sdk/resourcemanager/peering/armpeering/ze_generated_example_connectionmonitortests_client_test.go +++ /dev/null @@ -1,119 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armpeering_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/GetConnectionMonitorTest.json -func ExampleConnectionMonitorTestsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewConnectionMonitorTestsClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rgName", - "peeringServiceName", - "connectionMonitorTestName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/CreateOrUpdateConnectionMonitorTest.json -func ExampleConnectionMonitorTestsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewConnectionMonitorTestsClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rgName", - "peeringServiceName", - "connectionMonitorTestName", - armpeering.ConnectionMonitorTest{ - Properties: &armpeering.ConnectionMonitorTestProperties{ - Destination: to.Ptr("Example Destination"), - DestinationPort: to.Ptr[int32](443), - SourceAgent: to.Ptr("Example Source Agent"), - TestFrequencyInSec: to.Ptr[int32](30), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/DeleteConnectionMonitorTest.json -func ExampleConnectionMonitorTestsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewConnectionMonitorTestsClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rgName", - "peeringServiceName", - "connectionMonitorTestName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListConnectionMonitorTestsByPeeringService.json -func ExampleConnectionMonitorTestsClient_NewListByPeeringServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewConnectionMonitorTestsClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByPeeringServicePager("rgName", - "peeringServiceName", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/peering/armpeering/ze_generated_example_legacypeerings_client_test.go b/sdk/resourcemanager/peering/armpeering/ze_generated_example_legacypeerings_client_test.go deleted file mode 100644 index bdc2bdf77a9a..000000000000 --- a/sdk/resourcemanager/peering/armpeering/ze_generated_example_legacypeerings_client_test.go +++ /dev/null @@ -1,43 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armpeering_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListLegacyPeerings.json -func ExampleLegacyPeeringsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewLegacyPeeringsClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("peeringLocation0", - armpeering.LegacyPeeringsKindExchange, - &armpeering.LegacyPeeringsClientListOptions{Asn: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/peering/armpeering/ze_generated_example_lookingglass_client_test.go b/sdk/resourcemanager/peering/armpeering/ze_generated_example_lookingglass_client_test.go deleted file mode 100644 index d66ab9cc21a7..000000000000 --- a/sdk/resourcemanager/peering/armpeering/ze_generated_example_lookingglass_client_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armpeering_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/LookingGlassInvokeCommand.json -func ExampleLookingGlassClient_Invoke() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewLookingGlassClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Invoke(ctx, - armpeering.LookingGlassCommandTraceroute, - armpeering.LookingGlassSourceTypeAzureRegion, - "West US", - "0.0.0.0", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/peering/armpeering/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/peering/armpeering/ze_generated_example_operations_client_test.go deleted file mode 100644 index 743c6a85af5a..000000000000 --- a/sdk/resourcemanager/peering/armpeering/ze_generated_example_operations_client_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armpeering_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListPeeringOperations.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/peering/armpeering/ze_generated_example_peerasns_client_test.go b/sdk/resourcemanager/peering/armpeering/ze_generated_example_peerasns_client_test.go deleted file mode 100644 index 4e9ce09e98b6..000000000000 --- a/sdk/resourcemanager/peering/armpeering/ze_generated_example_peerasns_client_test.go +++ /dev/null @@ -1,125 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armpeering_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/GetPeerAsn.json -func ExamplePeerAsnsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewPeerAsnsClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "peerAsnName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/CreatePeerAsn.json -func ExamplePeerAsnsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewPeerAsnsClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "peerAsnName", - armpeering.PeerAsn{ - Properties: &armpeering.PeerAsnProperties{ - PeerAsn: to.Ptr[int32](65000), - PeerContactDetail: []*armpeering.ContactDetail{ - { - Email: to.Ptr("noc@contoso.com"), - Phone: to.Ptr("+1 (234) 567-8999"), - Role: to.Ptr(armpeering.RoleNoc), - }, - { - Email: to.Ptr("abc@contoso.com"), - Phone: to.Ptr("+1 (234) 567-8900"), - Role: to.Ptr(armpeering.RolePolicy), - }, - { - Email: to.Ptr("xyz@contoso.com"), - Phone: to.Ptr("+1 (234) 567-8900"), - Role: to.Ptr(armpeering.RoleTechnical), - }}, - PeerName: to.Ptr("Contoso"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/DeletePeerAsn.json -func ExamplePeerAsnsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewPeerAsnsClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "peerAsnName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListPeerAsnsBySubscription.json -func ExamplePeerAsnsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewPeerAsnsClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/peering/armpeering/ze_generated_example_peeringlocations_client_test.go b/sdk/resourcemanager/peering/armpeering/ze_generated_example_peeringlocations_client_test.go deleted file mode 100644 index f8a6a84850fc..000000000000 --- a/sdk/resourcemanager/peering/armpeering/ze_generated_example_peeringlocations_client_test.go +++ /dev/null @@ -1,42 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armpeering_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListDirectPeeringLocations.json -func ExampleLocationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewLocationsClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(armpeering.PeeringLocationsKindDirect, - &armpeering.LocationsClientListOptions{DirectPeeringType: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/peering/armpeering/ze_generated_example_peeringmanagementclient_client_test.go b/sdk/resourcemanager/peering/armpeering/ze_generated_example_peeringmanagementclient_client_test.go deleted file mode 100644 index 9bf8b64cc339..000000000000 --- a/sdk/resourcemanager/peering/armpeering/ze_generated_example_peeringmanagementclient_client_test.go +++ /dev/null @@ -1,42 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armpeering_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/CheckServiceProviderAvailability.json -func ExampleManagementClient_CheckServiceProviderAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewManagementClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckServiceProviderAvailability(ctx, - armpeering.CheckServiceProviderAvailabilityInput{ - PeeringServiceLocation: to.Ptr("peeringServiceLocation1"), - PeeringServiceProvider: to.Ptr("peeringServiceProvider1"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/peering/armpeering/ze_generated_example_peerings_client_test.go b/sdk/resourcemanager/peering/armpeering/ze_generated_example_peerings_client_test.go deleted file mode 100644 index 9f3384a15f47..000000000000 --- a/sdk/resourcemanager/peering/armpeering/ze_generated_example_peerings_client_test.go +++ /dev/null @@ -1,197 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armpeering_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/GetPeering.json -func ExamplePeeringsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewPeeringsClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rgName", - "peeringName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/CreateDirectPeering.json -func ExamplePeeringsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewPeeringsClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rgName", - "peeringName", - armpeering.Peering{ - Kind: to.Ptr(armpeering.KindDirect), - Location: to.Ptr("eastus"), - Properties: &armpeering.Properties{ - Direct: &armpeering.PropertiesDirect{ - Connections: []*armpeering.DirectConnection{ - { - BandwidthInMbps: to.Ptr[int32](10000), - BgpSession: &armpeering.BgpSession{ - MaxPrefixesAdvertisedV4: to.Ptr[int32](1000), - MaxPrefixesAdvertisedV6: to.Ptr[int32](100), - MD5AuthenticationKey: to.Ptr("test-md5-auth-key"), - SessionPrefixV4: to.Ptr("192.168.0.0/31"), - SessionPrefixV6: to.Ptr("fd00::0/127"), - }, - ConnectionIdentifier: to.Ptr("5F4CB5C7-6B43-4444-9338-9ABC72606C16"), - PeeringDBFacilityID: to.Ptr[int32](99999), - SessionAddressProvider: to.Ptr(armpeering.SessionAddressProviderPeer), - UseForPeeringService: to.Ptr(false), - }, - { - BandwidthInMbps: to.Ptr[int32](10000), - ConnectionIdentifier: to.Ptr("8AB00818-D533-4504-A25A-03A17F61201C"), - PeeringDBFacilityID: to.Ptr[int32](99999), - SessionAddressProvider: to.Ptr(armpeering.SessionAddressProviderMicrosoft), - UseForPeeringService: to.Ptr(true), - }}, - DirectPeeringType: to.Ptr(armpeering.DirectPeeringTypeEdge), - PeerAsn: &armpeering.SubResource{ - ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Peering/peerAsns/myAsn1"), - }, - }, - PeeringLocation: to.Ptr("peeringLocation0"), - }, - SKU: &armpeering.SKU{ - Name: to.Ptr("Basic_Direct_Free"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/DeletePeering.json -func ExamplePeeringsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewPeeringsClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rgName", - "peeringName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/UpdatePeeringTags.json -func ExamplePeeringsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewPeeringsClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rgName", - "peeringName", - armpeering.ResourceTags{ - Tags: map[string]*string{ - "tag0": to.Ptr("value0"), - "tag1": to.Ptr("value1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListPeeringsByResourceGroup.json -func ExamplePeeringsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewPeeringsClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("rgName", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListPeeringsBySubscription.json -func ExamplePeeringsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewPeeringsClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/peering/armpeering/ze_generated_example_peeringservicecountries_client_test.go b/sdk/resourcemanager/peering/armpeering/ze_generated_example_peeringservicecountries_client_test.go deleted file mode 100644 index 0dedc7e768d1..000000000000 --- a/sdk/resourcemanager/peering/armpeering/ze_generated_example_peeringservicecountries_client_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armpeering_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListPeeringServiceCountriesBySubscription.json -func ExampleServiceCountriesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewServiceCountriesClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/peering/armpeering/ze_generated_example_peeringservicelocations_client_test.go b/sdk/resourcemanager/peering/armpeering/ze_generated_example_peeringservicelocations_client_test.go deleted file mode 100644 index 948672cd8ed4..000000000000 --- a/sdk/resourcemanager/peering/armpeering/ze_generated_example_peeringservicelocations_client_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armpeering_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListPeeringServiceLocationsBySubscription.json -func ExampleServiceLocationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewServiceLocationsClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(&armpeering.ServiceLocationsClientListOptions{Country: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/peering/armpeering/ze_generated_example_peeringserviceproviders_client_test.go b/sdk/resourcemanager/peering/armpeering/ze_generated_example_peeringserviceproviders_client_test.go deleted file mode 100644 index 3712834ea431..000000000000 --- a/sdk/resourcemanager/peering/armpeering/ze_generated_example_peeringserviceproviders_client_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armpeering_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListPeeringServiceProviders.json -func ExampleServiceProvidersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewServiceProvidersClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/peering/armpeering/ze_generated_example_peeringservices_client_test.go b/sdk/resourcemanager/peering/armpeering/ze_generated_example_peeringservices_client_test.go deleted file mode 100644 index 894a3f91635a..000000000000 --- a/sdk/resourcemanager/peering/armpeering/ze_generated_example_peeringservices_client_test.go +++ /dev/null @@ -1,186 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armpeering_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/GetPeeringService.json -func ExampleServicesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewServicesClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rgName", - "peeringServiceName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/CreatePeeringService.json -func ExampleServicesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewServicesClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rgName", - "peeringServiceName", - armpeering.Service{ - Location: to.Ptr("eastus"), - Properties: &armpeering.ServiceProperties{ - PeeringServiceLocation: to.Ptr("state1"), - PeeringServiceProvider: to.Ptr("serviceProvider1"), - ProviderBackupPeeringLocation: to.Ptr("peeringLocation2"), - ProviderPrimaryPeeringLocation: to.Ptr("peeringLocation1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/DeletePeeringService.json -func ExampleServicesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewServicesClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rgName", - "peeringServiceName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/UpdatePeeringServiceTags.json -func ExampleServicesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewServicesClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rgName", - "peeringServiceName", - armpeering.ResourceTags{ - Tags: map[string]*string{ - "tag0": to.Ptr("value0"), - "tag1": to.Ptr("value1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListPeeringServicesByResourceGroup.json -func ExampleServicesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewServicesClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("rgName", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListPeeringServicesBySubscription.json -func ExampleServicesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewServicesClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/InitializeConnectionMonitor.json -func ExampleServicesClient_InitializeConnectionMonitor() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewServicesClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.InitializeConnectionMonitor(ctx, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/peering/armpeering/ze_generated_example_prefixes_client_test.go b/sdk/resourcemanager/peering/armpeering/ze_generated_example_prefixes_client_test.go deleted file mode 100644 index bc8816829a12..000000000000 --- a/sdk/resourcemanager/peering/armpeering/ze_generated_example_prefixes_client_test.go +++ /dev/null @@ -1,117 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armpeering_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/GetPeeringServicePrefix.json -func ExamplePrefixesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewPrefixesClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rgName", - "peeringServiceName", - "peeringServicePrefixName", - &armpeering.PrefixesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/CreatePeeringServicePrefix.json -func ExamplePrefixesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewPrefixesClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rgName", - "peeringServiceName", - "peeringServicePrefixName", - armpeering.ServicePrefix{ - Properties: &armpeering.ServicePrefixProperties{ - PeeringServicePrefixKey: to.Ptr("00000000-0000-0000-0000-000000000000"), - Prefix: to.Ptr("192.168.1.0/24"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/DeletePeeringServicePrefix.json -func ExamplePrefixesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewPrefixesClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rgName", - "peeringServiceName", - "peeringServicePrefixName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListPrefixesByPeeringService.json -func ExamplePrefixesClient_NewListByPeeringServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewPrefixesClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByPeeringServicePager("rgName", - "peeringServiceName", - &armpeering.PrefixesClientListByPeeringServiceOptions{Expand: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/peering/armpeering/ze_generated_example_receivedroutes_client_test.go b/sdk/resourcemanager/peering/armpeering/ze_generated_example_receivedroutes_client_test.go deleted file mode 100644 index 1197c82ac7c3..000000000000 --- a/sdk/resourcemanager/peering/armpeering/ze_generated_example_receivedroutes_client_test.go +++ /dev/null @@ -1,49 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armpeering_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/GetPeeringReceivedRoutes.json -func ExampleReceivedRoutesClient_NewListByPeeringPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewReceivedRoutesClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByPeeringPager("rgName", - "peeringName", - &armpeering.ReceivedRoutesClientListByPeeringOptions{Prefix: to.Ptr("1.1.1.0/24"), - AsPath: to.Ptr("123 456"), - OriginAsValidationState: to.Ptr("Valid"), - RpkiValidationState: to.Ptr("Valid"), - SkipToken: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/peering/armpeering/ze_generated_example_registeredasns_client_test.go b/sdk/resourcemanager/peering/armpeering/ze_generated_example_registeredasns_client_test.go deleted file mode 100644 index 6152245c9aaf..000000000000 --- a/sdk/resourcemanager/peering/armpeering/ze_generated_example_registeredasns_client_test.go +++ /dev/null @@ -1,116 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armpeering_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/GetRegisteredAsn.json -func ExampleRegisteredAsnsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewRegisteredAsnsClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rgName", - "peeringName", - "registeredAsnName0", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/CreateRegisteredAsn.json -func ExampleRegisteredAsnsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewRegisteredAsnsClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rgName", - "peeringName", - "registeredAsnName", - armpeering.RegisteredAsn{ - Properties: &armpeering.RegisteredAsnProperties{ - Asn: to.Ptr[int32](65000), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/DeleteRegisteredAsn.json -func ExampleRegisteredAsnsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewRegisteredAsnsClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rgName", - "peeringName", - "registeredAsnName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListRegisteredAsnsByPeering.json -func ExampleRegisteredAsnsClient_NewListByPeeringPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewRegisteredAsnsClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByPeeringPager("rgName", - "peeringName", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/peering/armpeering/ze_generated_example_registeredprefixes_client_test.go b/sdk/resourcemanager/peering/armpeering/ze_generated_example_registeredprefixes_client_test.go deleted file mode 100644 index deb4fc214f0a..000000000000 --- a/sdk/resourcemanager/peering/armpeering/ze_generated_example_registeredprefixes_client_test.go +++ /dev/null @@ -1,116 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armpeering_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/GetRegisteredPrefix.json -func ExampleRegisteredPrefixesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewRegisteredPrefixesClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rgName", - "peeringName", - "registeredPrefixName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/CreateRegisteredPrefix.json -func ExampleRegisteredPrefixesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewRegisteredPrefixesClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rgName", - "peeringName", - "registeredPrefixName", - armpeering.RegisteredPrefix{ - Properties: &armpeering.RegisteredPrefixProperties{ - Prefix: to.Ptr("10.22.20.0/24"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/DeleteRegisteredPrefix.json -func ExampleRegisteredPrefixesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewRegisteredPrefixesClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rgName", - "peeringName", - "registeredPrefixName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListRegisteredPrefixesByPeering.json -func ExampleRegisteredPrefixesClient_NewListByPeeringPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armpeering.NewRegisteredPrefixesClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByPeeringPager("rgName", - "peeringName", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/peering/armpeering/zz_generated_models_serde.go b/sdk/resourcemanager/peering/armpeering/zz_generated_models_serde.go deleted file mode 100644 index 7fd2feb9f040..000000000000 --- a/sdk/resourcemanager/peering/armpeering/zz_generated_models_serde.go +++ /dev/null @@ -1,200 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armpeering - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type ConnectionMonitorTestProperties. -func (c ConnectionMonitorTestProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "destination", c.Destination) - populate(objectMap, "destinationPort", c.DestinationPort) - populate(objectMap, "isTestSuccessful", c.IsTestSuccessful) - populate(objectMap, "path", c.Path) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "sourceAgent", c.SourceAgent) - populate(objectMap, "testFrequencyInSec", c.TestFrequencyInSec) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LocationPropertiesDirect. -func (l LocationPropertiesDirect) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "bandwidthOffers", l.BandwidthOffers) - populate(objectMap, "peeringFacilities", l.PeeringFacilities) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LocationPropertiesExchange. -func (l LocationPropertiesExchange) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "peeringFacilities", l.PeeringFacilities) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LogAnalyticsWorkspaceProperties. -func (l LogAnalyticsWorkspaceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "connectedAgents", l.ConnectedAgents) - populate(objectMap, "key", l.Key) - populate(objectMap, "workspaceID", l.WorkspaceID) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type PeerAsnProperties. -func (p PeerAsnProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "errorMessage", p.ErrorMessage) - populate(objectMap, "peerAsn", p.PeerAsn) - populate(objectMap, "peerContactDetail", p.PeerContactDetail) - populate(objectMap, "peerName", p.PeerName) - populate(objectMap, "validationState", p.ValidationState) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Peering. -func (p Peering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", p.ID) - populate(objectMap, "kind", p.Kind) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "sku", p.SKU) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type PropertiesDirect. -func (p PropertiesDirect) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "connections", p.Connections) - populate(objectMap, "directPeeringType", p.DirectPeeringType) - populate(objectMap, "peerAsn", p.PeerAsn) - populate(objectMap, "useForPeeringService", p.UseForPeeringService) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type PropertiesExchange. -func (p PropertiesExchange) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "connections", p.Connections) - populate(objectMap, "peerAsn", p.PeerAsn) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceTags. -func (r ResourceTags) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", r.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Service. -func (s Service) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "sku", s.SKU) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServicePrefixEvent. -func (s ServicePrefixEvent) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "eventDescription", s.EventDescription) - populate(objectMap, "eventLevel", s.EventLevel) - populate(objectMap, "eventSummary", s.EventSummary) - populateTimeRFC3339(objectMap, "eventTimestamp", s.EventTimestamp) - populate(objectMap, "eventType", s.EventType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServicePrefixEvent. -func (s *ServicePrefixEvent) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "eventDescription": - err = unpopulate(val, "EventDescription", &s.EventDescription) - delete(rawMsg, key) - case "eventLevel": - err = unpopulate(val, "EventLevel", &s.EventLevel) - delete(rawMsg, key) - case "eventSummary": - err = unpopulate(val, "EventSummary", &s.EventSummary) - delete(rawMsg, key) - case "eventTimestamp": - err = unpopulateTimeRFC3339(val, "EventTimestamp", &s.EventTimestamp) - delete(rawMsg, key) - case "eventType": - err = unpopulate(val, "EventType", &s.EventType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServicePrefixProperties. -func (s ServicePrefixProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "errorMessage", s.ErrorMessage) - populate(objectMap, "events", s.Events) - populate(objectMap, "learnedType", s.LearnedType) - populate(objectMap, "peeringServicePrefixKey", s.PeeringServicePrefixKey) - populate(objectMap, "prefix", s.Prefix) - populate(objectMap, "prefixValidationState", s.PrefixValidationState) - populate(objectMap, "provisioningState", s.ProvisioningState) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceProviderProperties. -func (s ServiceProviderProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "peeringLocations", s.PeeringLocations) - populate(objectMap, "serviceProviderName", s.ServiceProviderName) - return json.Marshal(objectMap) -} - -func populate(m map[string]interface{}, k string, v interface{}) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else if !reflect.ValueOf(v).IsNil() { - m[k] = v - } -} - -func unpopulate(data json.RawMessage, fn string, v interface{}) error { - if data == nil { - return nil - } - if err := json.Unmarshal(data, v); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - return nil -}