From 86131e81e7d1d6d2d4f3e85cd5da54f14e32e0ed Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 19 Sep 2022 01:08:57 +0000 Subject: [PATCH] CodeGen from PR 20725 in Azure/azure-rest-api-specs Merge b0ead134a0f0246461ebc4f7e075b92a63c7e0ad into e24bbf6a66cb0a19c072c6f15cee163acbd7acf7 --- .../servicebus/armservicebus/CHANGELOG.md | 6 + .../servicebus/armservicebus/autorest.md | 6 +- ...zz_generated_constants.go => constants.go} | 3 +- ...t.go => disasterrecoveryconfigs_client.go} | 43 +- .../servicebus/armservicebus/go.mod | 14 +- .../servicebus/armservicebus/go.sum | 24 +- ...s_client.go => migrationconfigs_client.go} | 28 +- .../{zz_generated_models.go => models.go} | 5 + .../servicebus/armservicebus/models_serde.go | 2880 +++++++++++++++++ ...espaces_client.go => namespaces_client.go} | 73 +- ...rations_client.go => operations_client.go} | 6 +- ...o => privateendpointconnections_client.go} | 22 +- ...ient.go => privatelinkresources_client.go} | 5 +- ...ated_queues_client.go => queues_client.go} | 43 +- ...ed_response_types.go => response_types.go} | 1 + ...erated_rules_client.go => rules_client.go} | 18 +- ...ions_client.go => subscriptions_client.go} | 18 +- ...erated_time_rfc3339.go => time_rfc3339.go} | 1 + ...ated_topics_client.go => topics_client.go} | 43 +- ...ple_disasterrecoveryconfigs_client_test.go | 259 -- ...ed_example_migrationconfigs_client_test.go | 163 - ...enerated_example_namespaces_client_test.go | 466 --- ...enerated_example_operations_client_test.go | 41 - ..._privateendpointconnections_client_test.go | 127 - ...xample_privatelinkresources_client_test.go | 39 - ...ze_generated_example_queues_client_test.go | 273 -- .../ze_generated_example_rules_client_test.go | 131 - ...rated_example_subscriptions_client_test.go | 122 - ...ze_generated_example_topics_client_test.go | 273 -- .../zz_generated_models_serde.go | 626 ---- 30 files changed, 3051 insertions(+), 2708 deletions(-) rename sdk/resourcemanager/servicebus/armservicebus/{zz_generated_constants.go => constants.go} (99%) rename sdk/resourcemanager/servicebus/armservicebus/{zz_generated_disasterrecoveryconfigs_client.go => disasterrecoveryconfigs_client.go} (96%) rename sdk/resourcemanager/servicebus/armservicebus/{zz_generated_migrationconfigs_client.go => migrationconfigs_client.go} (96%) rename sdk/resourcemanager/servicebus/armservicebus/{zz_generated_models.go => models.go} (99%) create mode 100644 sdk/resourcemanager/servicebus/armservicebus/models_serde.go rename sdk/resourcemanager/servicebus/armservicebus/{zz_generated_namespaces_client.go => namespaces_client.go} (96%) rename sdk/resourcemanager/servicebus/armservicebus/{zz_generated_operations_client.go => operations_client.go} (95%) rename sdk/resourcemanager/servicebus/armservicebus/{zz_generated_privateendpointconnections_client.go => privateendpointconnections_client.go} (96%) rename sdk/resourcemanager/servicebus/armservicebus/{zz_generated_privatelinkresources_client.go => privatelinkresources_client.go} (97%) rename sdk/resourcemanager/servicebus/armservicebus/{zz_generated_queues_client.go => queues_client.go} (96%) rename sdk/resourcemanager/servicebus/armservicebus/{zz_generated_response_types.go => response_types.go} (99%) rename sdk/resourcemanager/servicebus/armservicebus/{zz_generated_rules_client.go => rules_client.go} (97%) rename sdk/resourcemanager/servicebus/armservicebus/{zz_generated_subscriptions_client.go => subscriptions_client.go} (97%) rename sdk/resourcemanager/servicebus/armservicebus/{zz_generated_time_rfc3339.go => time_rfc3339.go} (99%) rename sdk/resourcemanager/servicebus/armservicebus/{zz_generated_topics_client.go => topics_client.go} (96%) delete mode 100644 sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_disasterrecoveryconfigs_client_test.go delete mode 100644 sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_migrationconfigs_client_test.go delete mode 100644 sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_namespaces_client_test.go delete mode 100644 sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_operations_client_test.go delete mode 100644 sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_privateendpointconnections_client_test.go delete mode 100644 sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_privatelinkresources_client_test.go delete mode 100644 sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_queues_client_test.go delete mode 100644 sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_rules_client_test.go delete mode 100644 sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_subscriptions_client_test.go delete mode 100644 sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_topics_client_test.go delete mode 100644 sdk/resourcemanager/servicebus/armservicebus/zz_generated_models_serde.go diff --git a/sdk/resourcemanager/servicebus/armservicebus/CHANGELOG.md b/sdk/resourcemanager/servicebus/armservicebus/CHANGELOG.md index 374382f5caab..8b21ebd30865 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/CHANGELOG.md +++ b/sdk/resourcemanager/servicebus/armservicebus/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +## 2.0.0-beta.2 (2022-09-19) +### Features Added + +- New field `Partitions` in struct `SBNamespaceProperties` + + ## 2.0.0-beta.1 (2022-05-24) ### Breaking Changes diff --git a/sdk/resourcemanager/servicebus/armservicebus/autorest.md b/sdk/resourcemanager/servicebus/armservicebus/autorest.md index 89b40de7dbd6..7ffa18657187 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/autorest.md +++ b/sdk/resourcemanager/servicebus/armservicebus/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/792db17291c758b2bfdbbc0d35d0e2f5b5a1bd05/specification/servicebus/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/792db17291c758b2bfdbbc0d35d0e2f5b5a1bd05/specification/servicebus/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/servicebus/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/servicebus/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 2.0.0-beta.1 +module-version: 2.0.0-beta.2 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_constants.go b/sdk/resourcemanager/servicebus/armservicebus/constants.go similarity index 99% rename from sdk/resourcemanager/servicebus/armservicebus/zz_generated_constants.go rename to sdk/resourcemanager/servicebus/armservicebus/constants.go index 37c14db45b59..006cecb6791e 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_constants.go +++ b/sdk/resourcemanager/servicebus/armservicebus/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 armservicebus const ( moduleName = "armservicebus" - moduleVersion = "v2.0.0-beta.1" + moduleVersion = "v2.0.0-beta.2" ) type AccessRights string diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_disasterrecoveryconfigs_client.go b/sdk/resourcemanager/servicebus/armservicebus/disasterrecoveryconfigs_client.go similarity index 96% rename from sdk/resourcemanager/servicebus/armservicebus/zz_generated_disasterrecoveryconfigs_client.go rename to sdk/resourcemanager/servicebus/armservicebus/disasterrecoveryconfigs_client.go index ca08de18c167..0733d938c97a 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_disasterrecoveryconfigs_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/disasterrecoveryconfigs_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 armservicebus @@ -57,7 +58,7 @@ func NewDisasterRecoveryConfigsClient(subscriptionID string, credential azcore.T // BreakPairing - This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // alias - The Disaster Recovery configuration name @@ -102,7 +103,7 @@ func (client *DisasterRecoveryConfigsClient) breakPairingCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -110,7 +111,7 @@ func (client *DisasterRecoveryConfigsClient) breakPairingCreateRequest(ctx conte // CheckNameAvailability - Check the give namespace name availability. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // parameters - Parameters to check availability of the given namespace name @@ -151,7 +152,7 @@ func (client *DisasterRecoveryConfigsClient) checkNameAvailabilityCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -168,7 +169,7 @@ func (client *DisasterRecoveryConfigsClient) checkNameAvailabilityHandleResponse // CreateOrUpdate - Creates or updates a new Alias(Disaster Recovery configuration) // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // alias - The Disaster Recovery configuration name @@ -214,7 +215,7 @@ func (client *DisasterRecoveryConfigsClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -231,7 +232,7 @@ func (client *DisasterRecoveryConfigsClient) createOrUpdateHandleResponse(resp * // Delete - Deletes an Alias(Disaster Recovery configuration) // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // alias - The Disaster Recovery configuration name @@ -276,7 +277,7 @@ func (client *DisasterRecoveryConfigsClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +285,7 @@ func (client *DisasterRecoveryConfigsClient) deleteCreateRequest(ctx context.Con // FailOver - Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // alias - The Disaster Recovery configuration name @@ -329,7 +330,7 @@ func (client *DisasterRecoveryConfigsClient) failOverCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -340,7 +341,7 @@ func (client *DisasterRecoveryConfigsClient) failOverCreateRequest(ctx context.C // Get - Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // alias - The Disaster Recovery configuration name @@ -385,7 +386,7 @@ func (client *DisasterRecoveryConfigsClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -402,7 +403,7 @@ func (client *DisasterRecoveryConfigsClient) getHandleResponse(resp *http.Respon // GetAuthorizationRule - Gets an authorization rule for a namespace by rule name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // alias - The Disaster Recovery configuration name @@ -452,7 +453,7 @@ func (client *DisasterRecoveryConfigsClient) getAuthorizationRuleCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -468,8 +469,7 @@ func (client *DisasterRecoveryConfigsClient) getAuthorizationRuleHandleResponse( } // NewListPager - Gets all Alias(Disaster Recovery configurations) -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // options - DisasterRecoveryConfigsClientListOptions contains the optional parameters for the DisasterRecoveryConfigsClient.List @@ -522,7 +522,7 @@ func (client *DisasterRecoveryConfigsClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -538,8 +538,7 @@ func (client *DisasterRecoveryConfigsClient) listHandleResponse(resp *http.Respo } // NewListAuthorizationRulesPager - Gets the authorization rules for a namespace. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // alias - The Disaster Recovery configuration name @@ -597,7 +596,7 @@ func (client *DisasterRecoveryConfigsClient) listAuthorizationRulesCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -614,7 +613,7 @@ func (client *DisasterRecoveryConfigsClient) listAuthorizationRulesHandleRespons // ListKeys - Gets the primary and secondary connection strings for the namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // alias - The Disaster Recovery configuration name @@ -664,7 +663,7 @@ func (client *DisasterRecoveryConfigsClient) listKeysCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicebus/armservicebus/go.mod b/sdk/resourcemanager/servicebus/armservicebus/go.mod index a45640256bfb..8293299f5904 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/go.mod +++ b/sdk/resourcemanager/servicebus/armservicebus/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservi 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/servicebus/armservicebus/go.sum b/sdk/resourcemanager/servicebus/armservicebus/go.sum index ed5b814680ee..3afb578030a5 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/go.sum +++ b/sdk/resourcemanager/servicebus/armservicebus/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/servicebus/armservicebus/zz_generated_migrationconfigs_client.go b/sdk/resourcemanager/servicebus/armservicebus/migrationconfigs_client.go similarity index 96% rename from sdk/resourcemanager/servicebus/armservicebus/zz_generated_migrationconfigs_client.go rename to sdk/resourcemanager/servicebus/armservicebus/migrationconfigs_client.go index ffad3adad3e6..dcbf30b83ab2 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_migrationconfigs_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/migrationconfigs_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 armservicebus @@ -59,7 +60,7 @@ func NewMigrationConfigsClient(subscriptionID string, credential azcore.TokenCre // and any entities created after the operation will be under Premium Namespace. CompleteMigration // operation will fail when entity migration is in-progress. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // configName - The configuration name. Should always be "$default". @@ -104,7 +105,7 @@ func (client *MigrationConfigsClient) completeMigrationCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -113,7 +114,7 @@ func (client *MigrationConfigsClient) completeMigrationCreateRequest(ctx context // BeginCreateAndStartMigration - Creates Migration configuration and starts migration of entities from Standard to Premium // namespace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // configName - The configuration name. Should always be "$default". @@ -134,7 +135,7 @@ func (client *MigrationConfigsClient) BeginCreateAndStartMigration(ctx context.C // CreateAndStartMigration - Creates Migration configuration and starts migration of entities from Standard to Premium namespace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview func (client *MigrationConfigsClient) createAndStartMigration(ctx context.Context, resourceGroupName string, namespaceName string, configName MigrationConfigurationName, parameters MigrationConfigProperties, options *MigrationConfigsClientBeginCreateAndStartMigrationOptions) (*http.Response, error) { req, err := client.createAndStartMigrationCreateRequest(ctx, resourceGroupName, namespaceName, configName, parameters, options) if err != nil { @@ -174,7 +175,7 @@ func (client *MigrationConfigsClient) createAndStartMigrationCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -182,7 +183,7 @@ func (client *MigrationConfigsClient) createAndStartMigrationCreateRequest(ctx c // Delete - Deletes a MigrationConfiguration // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // configName - The configuration name. Should always be "$default". @@ -226,7 +227,7 @@ func (client *MigrationConfigsClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,7 +235,7 @@ func (client *MigrationConfigsClient) deleteCreateRequest(ctx context.Context, r // Get - Retrieves Migration Config // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // configName - The configuration name. Should always be "$default". @@ -278,7 +279,7 @@ func (client *MigrationConfigsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -294,8 +295,7 @@ func (client *MigrationConfigsClient) getHandleResponse(resp *http.Response) (Mi } // NewListPager - Gets all migrationConfigurations -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // options - MigrationConfigsClientListOptions contains the optional parameters for the MigrationConfigsClient.List method. @@ -347,7 +347,7 @@ func (client *MigrationConfigsClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -364,7 +364,7 @@ func (client *MigrationConfigsClient) listHandleResponse(resp *http.Response) (M // Revert - This operation reverts Migration // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // configName - The configuration name. Should always be "$default". @@ -408,7 +408,7 @@ func (client *MigrationConfigsClient) revertCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_models.go b/sdk/resourcemanager/servicebus/armservicebus/models.go similarity index 99% rename from sdk/resourcemanager/servicebus/armservicebus/zz_generated_models.go rename to sdk/resourcemanager/servicebus/armservicebus/models.go index d55c108f78fd..38a273de7238 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_models.go +++ b/sdk/resourcemanager/servicebus/armservicebus/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 armservicebus @@ -1008,6 +1009,10 @@ type SBNamespaceProperties struct { // The minimum TLS version for the cluster to support, e.g. '1.2' MinimumTLSVersion *TLSVersion `json:"minimumTlsVersion,omitempty"` + // The number of partitions of a Service Bus namespace. This property is only applicable to Premium SKU namespaces. The default + // value is 1 and possible values are 1 and 4 + Partitions *int32 `json:"partitions,omitempty"` + // List of private endpoint connections. PrivateEndpointConnections []*PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` diff --git a/sdk/resourcemanager/servicebus/armservicebus/models_serde.go b/sdk/resourcemanager/servicebus/armservicebus/models_serde.go new file mode 100644 index 000000000000..95beafaf51cb --- /dev/null +++ b/sdk/resourcemanager/servicebus/armservicebus/models_serde.go @@ -0,0 +1,2880 @@ +//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 armservicebus + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type AccessKeys. +func (a AccessKeys) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "aliasPrimaryConnectionString", a.AliasPrimaryConnectionString) + populate(objectMap, "aliasSecondaryConnectionString", a.AliasSecondaryConnectionString) + populate(objectMap, "keyName", a.KeyName) + populate(objectMap, "primaryConnectionString", a.PrimaryConnectionString) + populate(objectMap, "primaryKey", a.PrimaryKey) + populate(objectMap, "secondaryConnectionString", a.SecondaryConnectionString) + populate(objectMap, "secondaryKey", a.SecondaryKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccessKeys. +func (a *AccessKeys) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "aliasPrimaryConnectionString": + err = unpopulate(val, "AliasPrimaryConnectionString", &a.AliasPrimaryConnectionString) + delete(rawMsg, key) + case "aliasSecondaryConnectionString": + err = unpopulate(val, "AliasSecondaryConnectionString", &a.AliasSecondaryConnectionString) + delete(rawMsg, key) + case "keyName": + err = unpopulate(val, "KeyName", &a.KeyName) + delete(rawMsg, key) + case "primaryConnectionString": + err = unpopulate(val, "PrimaryConnectionString", &a.PrimaryConnectionString) + delete(rawMsg, key) + case "primaryKey": + err = unpopulate(val, "PrimaryKey", &a.PrimaryKey) + delete(rawMsg, key) + case "secondaryConnectionString": + err = unpopulate(val, "SecondaryConnectionString", &a.SecondaryConnectionString) + delete(rawMsg, key) + case "secondaryKey": + err = unpopulate(val, "SecondaryKey", &a.SecondaryKey) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Action. +func (a Action) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "compatibilityLevel", a.CompatibilityLevel) + populate(objectMap, "requiresPreprocessing", a.RequiresPreprocessing) + populate(objectMap, "sqlExpression", a.SQLExpression) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Action. +func (a *Action) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "compatibilityLevel": + err = unpopulate(val, "CompatibilityLevel", &a.CompatibilityLevel) + delete(rawMsg, key) + case "requiresPreprocessing": + err = unpopulate(val, "RequiresPreprocessing", &a.RequiresPreprocessing) + delete(rawMsg, key) + case "sqlExpression": + err = unpopulate(val, "SQLExpression", &a.SQLExpression) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ArmDisasterRecovery. +func (a ArmDisasterRecovery) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", a.ID) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ArmDisasterRecovery. +func (a *ArmDisasterRecovery) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &a.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ArmDisasterRecoveryListResult. +func (a ArmDisasterRecoveryListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ArmDisasterRecoveryListResult. +func (a *ArmDisasterRecoveryListResult) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ArmDisasterRecoveryProperties. +func (a ArmDisasterRecoveryProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "alternateName", a.AlternateName) + populate(objectMap, "partnerNamespace", a.PartnerNamespace) + populate(objectMap, "pendingReplicationOperationsCount", a.PendingReplicationOperationsCount) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "role", a.Role) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ArmDisasterRecoveryProperties. +func (a *ArmDisasterRecoveryProperties) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "alternateName": + err = unpopulate(val, "AlternateName", &a.AlternateName) + delete(rawMsg, key) + case "partnerNamespace": + err = unpopulate(val, "PartnerNamespace", &a.PartnerNamespace) + delete(rawMsg, key) + case "pendingReplicationOperationsCount": + err = unpopulate(val, "PendingReplicationOperationsCount", &a.PendingReplicationOperationsCount) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "role": + err = unpopulate(val, "Role", &a.Role) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CheckNameAvailability. +func (c CheckNameAvailability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", c.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailability. +func (c *CheckNameAvailability) 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 "name": + err = unpopulate(val, "Name", &c.Name) + 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 CheckNameAvailabilityResult. +func (c CheckNameAvailabilityResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "message", c.Message) + populate(objectMap, "nameAvailable", c.NameAvailable) + populate(objectMap, "reason", c.Reason) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityResult. +func (c *CheckNameAvailabilityResult) 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 "message": + err = unpopulate(val, "Message", &c.Message) + delete(rawMsg, key) + case "nameAvailable": + err = unpopulate(val, "NameAvailable", &c.NameAvailable) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &c.Reason) + 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 ConnectionState. +func (c ConnectionState) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", c.Description) + populate(objectMap, "status", c.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionState. +func (c *ConnectionState) 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 "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &c.Status) + 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 CorrelationFilter. +func (c CorrelationFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "contentType", c.ContentType) + populate(objectMap, "correlationId", c.CorrelationID) + populate(objectMap, "label", c.Label) + populate(objectMap, "messageId", c.MessageID) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "replyTo", c.ReplyTo) + populate(objectMap, "replyToSessionId", c.ReplyToSessionID) + populate(objectMap, "requiresPreprocessing", c.RequiresPreprocessing) + populate(objectMap, "sessionId", c.SessionID) + populate(objectMap, "to", c.To) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CorrelationFilter. +func (c *CorrelationFilter) 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 "contentType": + err = unpopulate(val, "ContentType", &c.ContentType) + delete(rawMsg, key) + case "correlationId": + err = unpopulate(val, "CorrelationID", &c.CorrelationID) + delete(rawMsg, key) + case "label": + err = unpopulate(val, "Label", &c.Label) + delete(rawMsg, key) + case "messageId": + err = unpopulate(val, "MessageID", &c.MessageID) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "replyTo": + err = unpopulate(val, "ReplyTo", &c.ReplyTo) + delete(rawMsg, key) + case "replyToSessionId": + err = unpopulate(val, "ReplyToSessionID", &c.ReplyToSessionID) + delete(rawMsg, key) + case "requiresPreprocessing": + err = unpopulate(val, "RequiresPreprocessing", &c.RequiresPreprocessing) + delete(rawMsg, key) + case "sessionId": + err = unpopulate(val, "SessionID", &c.SessionID) + delete(rawMsg, key) + case "to": + err = unpopulate(val, "To", &c.To) + 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 Encryption. +func (e Encryption) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "keySource", e.KeySource) + populate(objectMap, "keyVaultProperties", e.KeyVaultProperties) + populate(objectMap, "requireInfrastructureEncryption", e.RequireInfrastructureEncryption) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Encryption. +func (e *Encryption) 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 "keySource": + err = unpopulate(val, "KeySource", &e.KeySource) + delete(rawMsg, key) + case "keyVaultProperties": + err = unpopulate(val, "KeyVaultProperties", &e.KeyVaultProperties) + delete(rawMsg, key) + case "requireInfrastructureEncryption": + err = unpopulate(val, "RequireInfrastructureEncryption", &e.RequireInfrastructureEncryption) + 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 ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "info", &e.Info) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. +func (e *ErrorAdditionalInfo) 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 "info": + err = unpopulate(val, "Info", &e.Info) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + 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 ErrorResponseError. +func (e ErrorResponseError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseError. +func (e *ErrorResponseError) 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 "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + delete(rawMsg, key) + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) + 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 FailoverProperties. +func (f FailoverProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", f.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FailoverProperties. +func (f *FailoverProperties) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FailoverPropertiesProperties. +func (f FailoverPropertiesProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "IsSafeFailover", f.IsSafeFailover) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FailoverPropertiesProperties. +func (f *FailoverPropertiesProperties) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "IsSafeFailover": + err = unpopulate(val, "IsSafeFailover", &f.IsSafeFailover) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Identity. +func (i Identity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "principalId", i.PrincipalID) + populate(objectMap, "tenantId", i.TenantID) + populate(objectMap, "type", i.Type) + populate(objectMap, "userAssignedIdentities", i.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Identity. +func (i *Identity) 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", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "principalId": + err = unpopulate(val, "PrincipalID", &i.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &i.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &i.UserAssignedIdentities) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KeyVaultProperties. +func (k KeyVaultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "identity", k.Identity) + populate(objectMap, "keyName", k.KeyName) + populate(objectMap, "keyVaultUri", k.KeyVaultURI) + populate(objectMap, "keyVersion", k.KeyVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultProperties. +func (k *KeyVaultProperties) 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", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "identity": + err = unpopulate(val, "Identity", &k.Identity) + delete(rawMsg, key) + case "keyName": + err = unpopulate(val, "KeyName", &k.KeyName) + delete(rawMsg, key) + case "keyVaultUri": + err = unpopulate(val, "KeyVaultURI", &k.KeyVaultURI) + delete(rawMsg, key) + case "keyVersion": + err = unpopulate(val, "KeyVersion", &k.KeyVersion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MessageCountDetails. +func (m MessageCountDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "activeMessageCount", m.ActiveMessageCount) + populate(objectMap, "deadLetterMessageCount", m.DeadLetterMessageCount) + populate(objectMap, "scheduledMessageCount", m.ScheduledMessageCount) + populate(objectMap, "transferDeadLetterMessageCount", m.TransferDeadLetterMessageCount) + populate(objectMap, "transferMessageCount", m.TransferMessageCount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MessageCountDetails. +func (m *MessageCountDetails) 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 "activeMessageCount": + err = unpopulate(val, "ActiveMessageCount", &m.ActiveMessageCount) + delete(rawMsg, key) + case "deadLetterMessageCount": + err = unpopulate(val, "DeadLetterMessageCount", &m.DeadLetterMessageCount) + delete(rawMsg, key) + case "scheduledMessageCount": + err = unpopulate(val, "ScheduledMessageCount", &m.ScheduledMessageCount) + delete(rawMsg, key) + case "transferDeadLetterMessageCount": + err = unpopulate(val, "TransferDeadLetterMessageCount", &m.TransferDeadLetterMessageCount) + delete(rawMsg, key) + case "transferMessageCount": + err = unpopulate(val, "TransferMessageCount", &m.TransferMessageCount) + 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 MigrationConfigListResult. +func (m MigrationConfigListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationConfigListResult. +func (m *MigrationConfigListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + 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 MigrationConfigProperties. +func (m MigrationConfigProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "location", m.Location) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationConfigProperties. +func (m *MigrationConfigProperties) 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 "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &m.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + 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 MigrationConfigPropertiesProperties. +func (m MigrationConfigPropertiesProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "migrationState", m.MigrationState) + populate(objectMap, "pendingReplicationOperationsCount", m.PendingReplicationOperationsCount) + populate(objectMap, "postMigrationName", m.PostMigrationName) + populate(objectMap, "provisioningState", m.ProvisioningState) + populate(objectMap, "targetNamespace", m.TargetNamespace) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationConfigPropertiesProperties. +func (m *MigrationConfigPropertiesProperties) 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 "migrationState": + err = unpopulate(val, "MigrationState", &m.MigrationState) + delete(rawMsg, key) + case "pendingReplicationOperationsCount": + err = unpopulate(val, "PendingReplicationOperationsCount", &m.PendingReplicationOperationsCount) + delete(rawMsg, key) + case "postMigrationName": + err = unpopulate(val, "PostMigrationName", &m.PostMigrationName) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) + delete(rawMsg, key) + case "targetNamespace": + err = unpopulate(val, "TargetNamespace", &m.TargetNamespace) + 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 NWRuleSetIPRules. +func (n NWRuleSetIPRules) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "action", n.Action) + populate(objectMap, "ipMask", n.IPMask) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NWRuleSetIPRules. +func (n *NWRuleSetIPRules) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "action": + err = unpopulate(val, "Action", &n.Action) + delete(rawMsg, key) + case "ipMask": + err = unpopulate(val, "IPMask", &n.IPMask) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NWRuleSetVirtualNetworkRules. +func (n NWRuleSetVirtualNetworkRules) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "ignoreMissingVnetServiceEndpoint", n.IgnoreMissingVnetServiceEndpoint) + populate(objectMap, "subnet", n.Subnet) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NWRuleSetVirtualNetworkRules. +func (n *NWRuleSetVirtualNetworkRules) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ignoreMissingVnetServiceEndpoint": + err = unpopulate(val, "IgnoreMissingVnetServiceEndpoint", &n.IgnoreMissingVnetServiceEndpoint) + delete(rawMsg, key) + case "subnet": + err = unpopulate(val, "Subnet", &n.Subnet) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkRuleSet. +func (n NetworkRuleSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "systemData", n.SystemData) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRuleSet. +func (n *NetworkRuleSet) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &n.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &n.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkRuleSetListResult. +func (n NetworkRuleSetListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRuleSetListResult. +func (n *NetworkRuleSetListResult) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &n.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkRuleSetProperties. +func (n NetworkRuleSetProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "defaultAction", n.DefaultAction) + populate(objectMap, "ipRules", n.IPRules) + populate(objectMap, "publicNetworkAccess", n.PublicNetworkAccess) + populate(objectMap, "trustedServiceAccessEnabled", n.TrustedServiceAccessEnabled) + populate(objectMap, "virtualNetworkRules", n.VirtualNetworkRules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRuleSetProperties. +func (n *NetworkRuleSetProperties) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "defaultAction": + err = unpopulate(val, "DefaultAction", &n.DefaultAction) + delete(rawMsg, key) + case "ipRules": + err = unpopulate(val, "IPRules", &n.IPRules) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &n.PublicNetworkAccess) + delete(rawMsg, key) + case "trustedServiceAccessEnabled": + err = unpopulate(val, "TrustedServiceAccessEnabled", &n.TrustedServiceAccessEnabled) + delete(rawMsg, key) + case "virtualNetworkRules": + err = unpopulate(val, "VirtualNetworkRules", &n.VirtualNetworkRules) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, 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, "origin", o.Origin) + 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 "origin": + err = unpopulate(val, "Origin", &o.Origin) + 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 OperationDisplay. +func (o OperationDisplay) 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 OperationDisplay. +func (o *OperationDisplay) 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 PrivateEndpoint. +func (p PrivateEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint. +func (p *PrivateEndpoint) 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. +func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection. +func (p *PrivateEndpointConnection) 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 "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 "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + 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 PrivateEndpointConnectionListResult. +func (p PrivateEndpointConnectionListResult) 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 PrivateEndpointConnectionListResult. +func (p *PrivateEndpointConnectionListResult) 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 PrivateEndpointConnectionProperties. +func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "privateEndpoint", p.PrivateEndpoint) + populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) + populate(objectMap, "provisioningState", p.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties. +func (p *PrivateEndpointConnectionProperties) 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 "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) + delete(rawMsg, key) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + 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 PrivateLinkResource. +func (p PrivateLinkResource) 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 PrivateLinkResource. +func (p *PrivateLinkResource) 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 PrivateLinkResourceProperties. +func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groupId", p.GroupID) + populate(objectMap, "requiredMembers", p.RequiredMembers) + populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties. +func (p *PrivateLinkResourceProperties) 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 "groupId": + err = unpopulate(val, "GroupID", &p.GroupID) + delete(rawMsg, key) + case "requiredMembers": + err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) + delete(rawMsg, key) + case "requiredZoneNames": + err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) + 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 PrivateLinkResourcesListResult. +func (p PrivateLinkResourcesListResult) 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 PrivateLinkResourcesListResult. +func (p *PrivateLinkResourcesListResult) 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 ProxyResource. +func (p ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. +func (p *ProxyResource) 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 "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + 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 RegenerateAccessKeyParameters. +func (r RegenerateAccessKeyParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "key", r.Key) + populate(objectMap, "keyType", r.KeyType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RegenerateAccessKeyParameters. +func (r *RegenerateAccessKeyParameters) 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 "key": + err = unpopulate(val, "Key", &r.Key) + delete(rawMsg, key) + case "keyType": + err = unpopulate(val, "KeyType", &r.KeyType) + 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 ResourceNamespacePatch. +func (r ResourceNamespacePatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "tags", r.Tags) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceNamespacePatch. +func (r *ResourceNamespacePatch) 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 "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) + 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 Rule. +func (r Rule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Rule. +func (r *Rule) 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 "location": + err = unpopulate(val, "Location", &r.Location) + 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 "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + 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 RuleListResult. +func (r RuleListResult) 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 RuleListResult. +func (r *RuleListResult) 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 Ruleproperties. +func (r Ruleproperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "action", r.Action) + populate(objectMap, "correlationFilter", r.CorrelationFilter) + populate(objectMap, "filterType", r.FilterType) + populate(objectMap, "sqlFilter", r.SQLFilter) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Ruleproperties. +func (r *Ruleproperties) 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 "action": + err = unpopulate(val, "Action", &r.Action) + delete(rawMsg, key) + case "correlationFilter": + err = unpopulate(val, "CorrelationFilter", &r.CorrelationFilter) + delete(rawMsg, key) + case "filterType": + err = unpopulate(val, "FilterType", &r.FilterType) + delete(rawMsg, key) + case "sqlFilter": + err = unpopulate(val, "SQLFilter", &r.SQLFilter) + 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 SBAuthorizationRule. +func (s SBAuthorizationRule) 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, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SBAuthorizationRule. +func (s *SBAuthorizationRule) 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 "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + 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 SBAuthorizationRuleListResult. +func (s SBAuthorizationRuleListResult) 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 SBAuthorizationRuleListResult. +func (s *SBAuthorizationRuleListResult) 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 SBAuthorizationRuleProperties. +func (s SBAuthorizationRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "rights", s.Rights) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SBAuthorizationRuleProperties. +func (s *SBAuthorizationRuleProperties) 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 "rights": + err = unpopulate(val, "Rights", &s.Rights) + 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 SBClientAffineProperties. +func (s SBClientAffineProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "clientId", s.ClientID) + populate(objectMap, "isDurable", s.IsDurable) + populate(objectMap, "isShared", s.IsShared) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SBClientAffineProperties. +func (s *SBClientAffineProperties) 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 "clientId": + err = unpopulate(val, "ClientID", &s.ClientID) + delete(rawMsg, key) + case "isDurable": + err = unpopulate(val, "IsDurable", &s.IsDurable) + delete(rawMsg, key) + case "isShared": + err = unpopulate(val, "IsShared", &s.IsShared) + 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 SBNamespace. +func (s SBNamespace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "identity", s.Identity) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "sku", s.SKU) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SBNamespace. +func (s *SBNamespace) 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 "identity": + err = unpopulate(val, "Identity", &s.Identity) + 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 "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + 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 SBNamespaceListResult. +func (s SBNamespaceListResult) 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 SBNamespaceListResult. +func (s *SBNamespaceListResult) 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 SBNamespaceProperties. +func (s SBNamespaceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "alternateName", s.AlternateName) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "disableLocalAuth", s.DisableLocalAuth) + populate(objectMap, "encryption", s.Encryption) + populate(objectMap, "metricId", s.MetricID) + populate(objectMap, "minimumTlsVersion", s.MinimumTLSVersion) + populate(objectMap, "partitions", s.Partitions) + populate(objectMap, "privateEndpointConnections", s.PrivateEndpointConnections) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) + populate(objectMap, "serviceBusEndpoint", s.ServiceBusEndpoint) + populate(objectMap, "status", s.Status) + populateTimeRFC3339(objectMap, "updatedAt", s.UpdatedAt) + populate(objectMap, "zoneRedundant", s.ZoneRedundant) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SBNamespaceProperties. +func (s *SBNamespaceProperties) 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 "alternateName": + err = unpopulate(val, "AlternateName", &s.AlternateName) + delete(rawMsg, key) + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &s.DisableLocalAuth) + delete(rawMsg, key) + case "encryption": + err = unpopulate(val, "Encryption", &s.Encryption) + delete(rawMsg, key) + case "metricId": + err = unpopulate(val, "MetricID", &s.MetricID) + delete(rawMsg, key) + case "minimumTlsVersion": + err = unpopulate(val, "MinimumTLSVersion", &s.MinimumTLSVersion) + delete(rawMsg, key) + case "partitions": + err = unpopulate(val, "Partitions", &s.Partitions) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &s.PrivateEndpointConnections) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) + delete(rawMsg, key) + case "serviceBusEndpoint": + err = unpopulate(val, "ServiceBusEndpoint", &s.ServiceBusEndpoint) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + case "updatedAt": + err = unpopulateTimeRFC3339(val, "UpdatedAt", &s.UpdatedAt) + delete(rawMsg, key) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &s.ZoneRedundant) + 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 SBNamespaceUpdateParameters. +func (s SBNamespaceUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "identity", s.Identity) + 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 SBNamespaceUpdateParameters. +func (s *SBNamespaceUpdateParameters) 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 "identity": + err = unpopulate(val, "Identity", &s.Identity) + 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 SBNamespaceUpdateProperties. +func (s SBNamespaceUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "alternateName", s.AlternateName) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "disableLocalAuth", s.DisableLocalAuth) + populate(objectMap, "encryption", s.Encryption) + populate(objectMap, "metricId", s.MetricID) + populate(objectMap, "privateEndpointConnections", s.PrivateEndpointConnections) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "serviceBusEndpoint", s.ServiceBusEndpoint) + populate(objectMap, "status", s.Status) + populateTimeRFC3339(objectMap, "updatedAt", s.UpdatedAt) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SBNamespaceUpdateProperties. +func (s *SBNamespaceUpdateProperties) 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 "alternateName": + err = unpopulate(val, "AlternateName", &s.AlternateName) + delete(rawMsg, key) + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &s.DisableLocalAuth) + delete(rawMsg, key) + case "encryption": + err = unpopulate(val, "Encryption", &s.Encryption) + delete(rawMsg, key) + case "metricId": + err = unpopulate(val, "MetricID", &s.MetricID) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &s.PrivateEndpointConnections) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "serviceBusEndpoint": + err = unpopulate(val, "ServiceBusEndpoint", &s.ServiceBusEndpoint) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + case "updatedAt": + err = unpopulateTimeRFC3339(val, "UpdatedAt", &s.UpdatedAt) + 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 SBQueue. +func (s SBQueue) 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, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SBQueue. +func (s *SBQueue) 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 "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + 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 SBQueueListResult. +func (s SBQueueListResult) 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 SBQueueListResult. +func (s *SBQueueListResult) 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 SBQueueProperties. +func (s SBQueueProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "accessedAt", s.AccessedAt) + populate(objectMap, "autoDeleteOnIdle", s.AutoDeleteOnIdle) + populate(objectMap, "countDetails", s.CountDetails) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "deadLetteringOnMessageExpiration", s.DeadLetteringOnMessageExpiration) + populate(objectMap, "defaultMessageTimeToLive", s.DefaultMessageTimeToLive) + populate(objectMap, "duplicateDetectionHistoryTimeWindow", s.DuplicateDetectionHistoryTimeWindow) + populate(objectMap, "enableBatchedOperations", s.EnableBatchedOperations) + populate(objectMap, "enableExpress", s.EnableExpress) + populate(objectMap, "enablePartitioning", s.EnablePartitioning) + populate(objectMap, "forwardDeadLetteredMessagesTo", s.ForwardDeadLetteredMessagesTo) + populate(objectMap, "forwardTo", s.ForwardTo) + populate(objectMap, "lockDuration", s.LockDuration) + populate(objectMap, "maxDeliveryCount", s.MaxDeliveryCount) + populate(objectMap, "maxMessageSizeInKilobytes", s.MaxMessageSizeInKilobytes) + populate(objectMap, "maxSizeInMegabytes", s.MaxSizeInMegabytes) + populate(objectMap, "messageCount", s.MessageCount) + populate(objectMap, "requiresDuplicateDetection", s.RequiresDuplicateDetection) + populate(objectMap, "requiresSession", s.RequiresSession) + populate(objectMap, "sizeInBytes", s.SizeInBytes) + populate(objectMap, "status", s.Status) + populateTimeRFC3339(objectMap, "updatedAt", s.UpdatedAt) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SBQueueProperties. +func (s *SBQueueProperties) 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 "accessedAt": + err = unpopulateTimeRFC3339(val, "AccessedAt", &s.AccessedAt) + delete(rawMsg, key) + case "autoDeleteOnIdle": + err = unpopulate(val, "AutoDeleteOnIdle", &s.AutoDeleteOnIdle) + delete(rawMsg, key) + case "countDetails": + err = unpopulate(val, "CountDetails", &s.CountDetails) + delete(rawMsg, key) + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "deadLetteringOnMessageExpiration": + err = unpopulate(val, "DeadLetteringOnMessageExpiration", &s.DeadLetteringOnMessageExpiration) + delete(rawMsg, key) + case "defaultMessageTimeToLive": + err = unpopulate(val, "DefaultMessageTimeToLive", &s.DefaultMessageTimeToLive) + delete(rawMsg, key) + case "duplicateDetectionHistoryTimeWindow": + err = unpopulate(val, "DuplicateDetectionHistoryTimeWindow", &s.DuplicateDetectionHistoryTimeWindow) + delete(rawMsg, key) + case "enableBatchedOperations": + err = unpopulate(val, "EnableBatchedOperations", &s.EnableBatchedOperations) + delete(rawMsg, key) + case "enableExpress": + err = unpopulate(val, "EnableExpress", &s.EnableExpress) + delete(rawMsg, key) + case "enablePartitioning": + err = unpopulate(val, "EnablePartitioning", &s.EnablePartitioning) + delete(rawMsg, key) + case "forwardDeadLetteredMessagesTo": + err = unpopulate(val, "ForwardDeadLetteredMessagesTo", &s.ForwardDeadLetteredMessagesTo) + delete(rawMsg, key) + case "forwardTo": + err = unpopulate(val, "ForwardTo", &s.ForwardTo) + delete(rawMsg, key) + case "lockDuration": + err = unpopulate(val, "LockDuration", &s.LockDuration) + delete(rawMsg, key) + case "maxDeliveryCount": + err = unpopulate(val, "MaxDeliveryCount", &s.MaxDeliveryCount) + delete(rawMsg, key) + case "maxMessageSizeInKilobytes": + err = unpopulate(val, "MaxMessageSizeInKilobytes", &s.MaxMessageSizeInKilobytes) + delete(rawMsg, key) + case "maxSizeInMegabytes": + err = unpopulate(val, "MaxSizeInMegabytes", &s.MaxSizeInMegabytes) + delete(rawMsg, key) + case "messageCount": + err = unpopulate(val, "MessageCount", &s.MessageCount) + delete(rawMsg, key) + case "requiresDuplicateDetection": + err = unpopulate(val, "RequiresDuplicateDetection", &s.RequiresDuplicateDetection) + delete(rawMsg, key) + case "requiresSession": + err = unpopulate(val, "RequiresSession", &s.RequiresSession) + delete(rawMsg, key) + case "sizeInBytes": + err = unpopulate(val, "SizeInBytes", &s.SizeInBytes) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + case "updatedAt": + err = unpopulateTimeRFC3339(val, "UpdatedAt", &s.UpdatedAt) + 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 SBSKU. +func (s SBSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "capacity", s.Capacity) + populate(objectMap, "name", s.Name) + populate(objectMap, "tier", s.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SBSKU. +func (s *SBSKU) 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 "capacity": + err = unpopulate(val, "Capacity", &s.Capacity) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + 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 SBSubscription. +func (s SBSubscription) 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, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SBSubscription. +func (s *SBSubscription) 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 "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + 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 SBSubscriptionListResult. +func (s SBSubscriptionListResult) 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 SBSubscriptionListResult. +func (s *SBSubscriptionListResult) 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 SBSubscriptionProperties. +func (s SBSubscriptionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "accessedAt", s.AccessedAt) + populate(objectMap, "autoDeleteOnIdle", s.AutoDeleteOnIdle) + populate(objectMap, "clientAffineProperties", s.ClientAffineProperties) + populate(objectMap, "countDetails", s.CountDetails) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "deadLetteringOnFilterEvaluationExceptions", s.DeadLetteringOnFilterEvaluationExceptions) + populate(objectMap, "deadLetteringOnMessageExpiration", s.DeadLetteringOnMessageExpiration) + populate(objectMap, "defaultMessageTimeToLive", s.DefaultMessageTimeToLive) + populate(objectMap, "duplicateDetectionHistoryTimeWindow", s.DuplicateDetectionHistoryTimeWindow) + populate(objectMap, "enableBatchedOperations", s.EnableBatchedOperations) + populate(objectMap, "forwardDeadLetteredMessagesTo", s.ForwardDeadLetteredMessagesTo) + populate(objectMap, "forwardTo", s.ForwardTo) + populate(objectMap, "isClientAffine", s.IsClientAffine) + populate(objectMap, "lockDuration", s.LockDuration) + populate(objectMap, "maxDeliveryCount", s.MaxDeliveryCount) + populate(objectMap, "messageCount", s.MessageCount) + populate(objectMap, "requiresSession", s.RequiresSession) + populate(objectMap, "status", s.Status) + populateTimeRFC3339(objectMap, "updatedAt", s.UpdatedAt) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SBSubscriptionProperties. +func (s *SBSubscriptionProperties) 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 "accessedAt": + err = unpopulateTimeRFC3339(val, "AccessedAt", &s.AccessedAt) + delete(rawMsg, key) + case "autoDeleteOnIdle": + err = unpopulate(val, "AutoDeleteOnIdle", &s.AutoDeleteOnIdle) + delete(rawMsg, key) + case "clientAffineProperties": + err = unpopulate(val, "ClientAffineProperties", &s.ClientAffineProperties) + delete(rawMsg, key) + case "countDetails": + err = unpopulate(val, "CountDetails", &s.CountDetails) + delete(rawMsg, key) + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "deadLetteringOnFilterEvaluationExceptions": + err = unpopulate(val, "DeadLetteringOnFilterEvaluationExceptions", &s.DeadLetteringOnFilterEvaluationExceptions) + delete(rawMsg, key) + case "deadLetteringOnMessageExpiration": + err = unpopulate(val, "DeadLetteringOnMessageExpiration", &s.DeadLetteringOnMessageExpiration) + delete(rawMsg, key) + case "defaultMessageTimeToLive": + err = unpopulate(val, "DefaultMessageTimeToLive", &s.DefaultMessageTimeToLive) + delete(rawMsg, key) + case "duplicateDetectionHistoryTimeWindow": + err = unpopulate(val, "DuplicateDetectionHistoryTimeWindow", &s.DuplicateDetectionHistoryTimeWindow) + delete(rawMsg, key) + case "enableBatchedOperations": + err = unpopulate(val, "EnableBatchedOperations", &s.EnableBatchedOperations) + delete(rawMsg, key) + case "forwardDeadLetteredMessagesTo": + err = unpopulate(val, "ForwardDeadLetteredMessagesTo", &s.ForwardDeadLetteredMessagesTo) + delete(rawMsg, key) + case "forwardTo": + err = unpopulate(val, "ForwardTo", &s.ForwardTo) + delete(rawMsg, key) + case "isClientAffine": + err = unpopulate(val, "IsClientAffine", &s.IsClientAffine) + delete(rawMsg, key) + case "lockDuration": + err = unpopulate(val, "LockDuration", &s.LockDuration) + delete(rawMsg, key) + case "maxDeliveryCount": + err = unpopulate(val, "MaxDeliveryCount", &s.MaxDeliveryCount) + delete(rawMsg, key) + case "messageCount": + err = unpopulate(val, "MessageCount", &s.MessageCount) + delete(rawMsg, key) + case "requiresSession": + err = unpopulate(val, "RequiresSession", &s.RequiresSession) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + case "updatedAt": + err = unpopulateTimeRFC3339(val, "UpdatedAt", &s.UpdatedAt) + 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 SBTopic. +func (s SBTopic) 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, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SBTopic. +func (s *SBTopic) 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 "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + 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 SBTopicListResult. +func (s SBTopicListResult) 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 SBTopicListResult. +func (s *SBTopicListResult) 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 SBTopicProperties. +func (s SBTopicProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "accessedAt", s.AccessedAt) + populate(objectMap, "autoDeleteOnIdle", s.AutoDeleteOnIdle) + populate(objectMap, "countDetails", s.CountDetails) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "defaultMessageTimeToLive", s.DefaultMessageTimeToLive) + populate(objectMap, "duplicateDetectionHistoryTimeWindow", s.DuplicateDetectionHistoryTimeWindow) + populate(objectMap, "enableBatchedOperations", s.EnableBatchedOperations) + populate(objectMap, "enableExpress", s.EnableExpress) + populate(objectMap, "enablePartitioning", s.EnablePartitioning) + populate(objectMap, "maxMessageSizeInKilobytes", s.MaxMessageSizeInKilobytes) + populate(objectMap, "maxSizeInMegabytes", s.MaxSizeInMegabytes) + populate(objectMap, "requiresDuplicateDetection", s.RequiresDuplicateDetection) + populate(objectMap, "sizeInBytes", s.SizeInBytes) + populate(objectMap, "status", s.Status) + populate(objectMap, "subscriptionCount", s.SubscriptionCount) + populate(objectMap, "supportOrdering", s.SupportOrdering) + populateTimeRFC3339(objectMap, "updatedAt", s.UpdatedAt) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SBTopicProperties. +func (s *SBTopicProperties) 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 "accessedAt": + err = unpopulateTimeRFC3339(val, "AccessedAt", &s.AccessedAt) + delete(rawMsg, key) + case "autoDeleteOnIdle": + err = unpopulate(val, "AutoDeleteOnIdle", &s.AutoDeleteOnIdle) + delete(rawMsg, key) + case "countDetails": + err = unpopulate(val, "CountDetails", &s.CountDetails) + delete(rawMsg, key) + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "defaultMessageTimeToLive": + err = unpopulate(val, "DefaultMessageTimeToLive", &s.DefaultMessageTimeToLive) + delete(rawMsg, key) + case "duplicateDetectionHistoryTimeWindow": + err = unpopulate(val, "DuplicateDetectionHistoryTimeWindow", &s.DuplicateDetectionHistoryTimeWindow) + delete(rawMsg, key) + case "enableBatchedOperations": + err = unpopulate(val, "EnableBatchedOperations", &s.EnableBatchedOperations) + delete(rawMsg, key) + case "enableExpress": + err = unpopulate(val, "EnableExpress", &s.EnableExpress) + delete(rawMsg, key) + case "enablePartitioning": + err = unpopulate(val, "EnablePartitioning", &s.EnablePartitioning) + delete(rawMsg, key) + case "maxMessageSizeInKilobytes": + err = unpopulate(val, "MaxMessageSizeInKilobytes", &s.MaxMessageSizeInKilobytes) + delete(rawMsg, key) + case "maxSizeInMegabytes": + err = unpopulate(val, "MaxSizeInMegabytes", &s.MaxSizeInMegabytes) + delete(rawMsg, key) + case "requiresDuplicateDetection": + err = unpopulate(val, "RequiresDuplicateDetection", &s.RequiresDuplicateDetection) + delete(rawMsg, key) + case "sizeInBytes": + err = unpopulate(val, "SizeInBytes", &s.SizeInBytes) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + case "subscriptionCount": + err = unpopulate(val, "SubscriptionCount", &s.SubscriptionCount) + delete(rawMsg, key) + case "supportOrdering": + err = unpopulate(val, "SupportOrdering", &s.SupportOrdering) + delete(rawMsg, key) + case "updatedAt": + err = unpopulateTimeRFC3339(val, "UpdatedAt", &s.UpdatedAt) + 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 SQLFilter. +func (s SQLFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "compatibilityLevel", s.CompatibilityLevel) + populate(objectMap, "requiresPreprocessing", s.RequiresPreprocessing) + populate(objectMap, "sqlExpression", s.SQLExpression) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SQLFilter. +func (s *SQLFilter) 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 "compatibilityLevel": + err = unpopulate(val, "CompatibilityLevel", &s.CompatibilityLevel) + delete(rawMsg, key) + case "requiresPreprocessing": + err = unpopulate(val, "RequiresPreprocessing", &s.RequiresPreprocessing) + delete(rawMsg, key) + case "sqlExpression": + err = unpopulate(val, "SQLExpression", &s.SQLExpression) + 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 SQLRuleAction. +func (s SQLRuleAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "compatibilityLevel", s.CompatibilityLevel) + populate(objectMap, "requiresPreprocessing", s.RequiresPreprocessing) + populate(objectMap, "sqlExpression", s.SQLExpression) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SQLRuleAction. +func (s *SQLRuleAction) 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 "compatibilityLevel": + err = unpopulate(val, "CompatibilityLevel", &s.CompatibilityLevel) + delete(rawMsg, key) + case "requiresPreprocessing": + err = unpopulate(val, "RequiresPreprocessing", &s.RequiresPreprocessing) + delete(rawMsg, key) + case "sqlExpression": + err = unpopulate(val, "SQLExpression", &s.SQLExpression) + 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 Subnet. +func (s Subnet) 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 Subnet. +func (s *Subnet) 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 +} + +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) 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 "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + 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 TrackedResource. +func (t TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", t.ID) + populate(objectMap, "location", t.Location) + populate(objectMap, "name", t.Name) + populate(objectMap, "tags", t.Tags) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource. +func (t *TrackedResource) 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", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &t.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &t.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity. +func (u UserAssignedIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "clientId", u.ClientID) + populate(objectMap, "principalId", u.PrincipalID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentity. +func (u *UserAssignedIdentity) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientId": + err = unpopulate(val, "ClientID", &u.ClientID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &u.PrincipalID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentityProperties. +func (u UserAssignedIdentityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "userAssignedIdentity", u.UserAssignedIdentity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentityProperties. +func (u *UserAssignedIdentityProperties) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "userAssignedIdentity": + err = unpopulate(val, "UserAssignedIdentity", &u.UserAssignedIdentity) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, 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/servicebus/armservicebus/zz_generated_namespaces_client.go b/sdk/resourcemanager/servicebus/armservicebus/namespaces_client.go similarity index 96% rename from sdk/resourcemanager/servicebus/armservicebus/zz_generated_namespaces_client.go rename to sdk/resourcemanager/servicebus/armservicebus/namespaces_client.go index d74ca90f88bb..1ff64daf8626 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_namespaces_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/namespaces_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 armservicebus @@ -57,7 +58,7 @@ func NewNamespacesClient(subscriptionID string, credential azcore.TokenCredentia // CheckNameAvailability - Check the give namespace name availability. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // parameters - Parameters to check availability of the given namespace name // options - NamespacesClientCheckNameAvailabilityOptions contains the optional parameters for the NamespacesClient.CheckNameAvailability // method. @@ -88,7 +89,7 @@ func (client *NamespacesClient) checkNameAvailabilityCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -106,7 +107,7 @@ func (client *NamespacesClient) checkNameAvailabilityHandleResponse(resp *http.R // BeginCreateOrUpdate - Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. // This operation is idempotent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name. // parameters - Parameters supplied to create a namespace resource. @@ -127,7 +128,7 @@ func (client *NamespacesClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. // This operation is idempotent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview func (client *NamespacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, parameters SBNamespace, options *NamespacesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, namespaceName, parameters, options) if err != nil { @@ -163,7 +164,7 @@ func (client *NamespacesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -171,7 +172,7 @@ func (client *NamespacesClient) createOrUpdateCreateRequest(ctx context.Context, // CreateOrUpdateAuthorizationRule - Creates or updates an authorization rule for a namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // authorizationRuleName - The authorization rule name. @@ -217,7 +218,7 @@ func (client *NamespacesClient) createOrUpdateAuthorizationRuleCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -234,7 +235,7 @@ func (client *NamespacesClient) createOrUpdateAuthorizationRuleHandleResponse(re // CreateOrUpdateNetworkRuleSet - Create or update NetworkRuleSet for a Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // parameters - The Namespace IpFilterRule. @@ -275,7 +276,7 @@ func (client *NamespacesClient) createOrUpdateNetworkRuleSetCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -292,7 +293,7 @@ func (client *NamespacesClient) createOrUpdateNetworkRuleSetHandleResponse(resp // BeginDelete - Deletes an existing namespace. This operation also removes all associated resources under the namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // options - NamespacesClientBeginDeleteOptions contains the optional parameters for the NamespacesClient.BeginDelete method. @@ -310,7 +311,7 @@ func (client *NamespacesClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Deletes an existing namespace. This operation also removes all associated resources under the namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview func (client *NamespacesClient) deleteOperation(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespacesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, namespaceName, options) if err != nil { @@ -346,7 +347,7 @@ func (client *NamespacesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -354,7 +355,7 @@ func (client *NamespacesClient) deleteCreateRequest(ctx context.Context, resourc // DeleteAuthorizationRule - Deletes a namespace authorization rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // authorizationRuleName - The authorization rule name. @@ -399,7 +400,7 @@ func (client *NamespacesClient) deleteAuthorizationRuleCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -407,7 +408,7 @@ func (client *NamespacesClient) deleteAuthorizationRuleCreateRequest(ctx context // Get - Gets a description for the specified namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // options - NamespacesClientGetOptions contains the optional parameters for the NamespacesClient.Get method. @@ -446,7 +447,7 @@ func (client *NamespacesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -463,7 +464,7 @@ func (client *NamespacesClient) getHandleResponse(resp *http.Response) (Namespac // GetAuthorizationRule - Gets an authorization rule for a namespace by rule name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // authorizationRuleName - The authorization rule name. @@ -508,7 +509,7 @@ func (client *NamespacesClient) getAuthorizationRuleCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -525,7 +526,7 @@ func (client *NamespacesClient) getAuthorizationRuleHandleResponse(resp *http.Re // GetNetworkRuleSet - Gets NetworkRuleSet for a Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // options - NamespacesClientGetNetworkRuleSetOptions contains the optional parameters for the NamespacesClient.GetNetworkRuleSet @@ -565,7 +566,7 @@ func (client *NamespacesClient) getNetworkRuleSetCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -581,8 +582,7 @@ func (client *NamespacesClient) getNetworkRuleSetHandleResponse(resp *http.Respo } // NewListPager - Gets all the available namespaces within the subscription, irrespective of the resource groups. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // options - NamespacesClientListOptions contains the optional parameters for the NamespacesClient.List method. func (client *NamespacesClient) NewListPager(options *NamespacesClientListOptions) *runtime.Pager[NamespacesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[NamespacesClientListResponse]{ @@ -624,7 +624,7 @@ func (client *NamespacesClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -640,8 +640,7 @@ func (client *NamespacesClient) listHandleResponse(resp *http.Response) (Namespa } // NewListAuthorizationRulesPager - Gets the authorization rules for a namespace. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // options - NamespacesClientListAuthorizationRulesOptions contains the optional parameters for the NamespacesClient.ListAuthorizationRules @@ -694,7 +693,7 @@ func (client *NamespacesClient) listAuthorizationRulesCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -710,8 +709,7 @@ func (client *NamespacesClient) listAuthorizationRulesHandleResponse(resp *http. } // NewListByResourceGroupPager - Gets the available namespaces within a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // options - NamespacesClientListByResourceGroupOptions contains the optional parameters for the NamespacesClient.ListByResourceGroup // method. @@ -759,7 +757,7 @@ func (client *NamespacesClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -776,7 +774,7 @@ func (client *NamespacesClient) listByResourceGroupHandleResponse(resp *http.Res // ListKeys - Gets the primary and secondary connection strings for the namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // authorizationRuleName - The authorization rule name. @@ -820,7 +818,7 @@ func (client *NamespacesClient) listKeysCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -836,8 +834,7 @@ func (client *NamespacesClient) listKeysHandleResponse(resp *http.Response) (Nam } // NewListNetworkRuleSetsPager - Gets list of NetworkRuleSet for a Namespace. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // options - NamespacesClientListNetworkRuleSetsOptions contains the optional parameters for the NamespacesClient.ListNetworkRuleSets @@ -890,7 +887,7 @@ func (client *NamespacesClient) listNetworkRuleSetsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -907,7 +904,7 @@ func (client *NamespacesClient) listNetworkRuleSetsHandleResponse(resp *http.Res // RegenerateKeys - Regenerates the primary or secondary connection strings for the namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // authorizationRuleName - The authorization rule name. @@ -953,7 +950,7 @@ func (client *NamespacesClient) regenerateKeysCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -971,7 +968,7 @@ func (client *NamespacesClient) regenerateKeysHandleResponse(resp *http.Response // Update - Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is // idempotent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // parameters - Parameters supplied to update a namespace resource. @@ -1011,7 +1008,7 @@ func (client *NamespacesClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_operations_client.go b/sdk/resourcemanager/servicebus/armservicebus/operations_client.go similarity index 95% rename from sdk/resourcemanager/servicebus/armservicebus/zz_generated_operations_client.go rename to sdk/resourcemanager/servicebus/armservicebus/operations_client.go index 4e923bb8e0cf..b7cfe50fe859 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_operations_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/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 armservicebus @@ -49,8 +50,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO } // NewListPager - Lists all of the available ServiceBus REST API operations. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // 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-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_privateendpointconnections_client.go b/sdk/resourcemanager/servicebus/armservicebus/privateendpointconnections_client.go similarity index 96% rename from sdk/resourcemanager/servicebus/armservicebus/zz_generated_privateendpointconnections_client.go rename to sdk/resourcemanager/servicebus/armservicebus/privateendpointconnections_client.go index 586b28922785..d7ccc28b51c6 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_privateendpointconnections_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/privateendpointconnections_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 armservicebus @@ -57,7 +58,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // CreateOrUpdate - Creates or updates PrivateEndpointConnections of service namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // privateEndpointConnectionName - The PrivateEndpointConnection name @@ -73,7 +74,7 @@ func (client *PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Conte if err != nil { return PrivateEndpointConnectionsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { return PrivateEndpointConnectionsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) } return client.createOrUpdateHandleResponse(resp) @@ -103,7 +104,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -120,7 +121,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateHandleResponse(res // BeginDelete - Deletes an existing Private Endpoint Connection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // privateEndpointConnectionName - The PrivateEndpointConnection name @@ -140,7 +141,7 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, // Delete - Deletes an existing Private Endpoint Connection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, namespaceName, privateEndpointConnectionName, options) if err != nil { @@ -180,7 +181,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -188,7 +189,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - Gets a description for the specified Private Endpoint Connection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // privateEndpointConnectionName - The PrivateEndpointConnection name @@ -233,7 +234,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,8 +250,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res } // NewListPager - Gets the available PrivateEndpointConnections within a namespace. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.List @@ -303,7 +303,7 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_privatelinkresources_client.go b/sdk/resourcemanager/servicebus/armservicebus/privatelinkresources_client.go similarity index 97% rename from sdk/resourcemanager/servicebus/armservicebus/zz_generated_privatelinkresources_client.go rename to sdk/resourcemanager/servicebus/armservicebus/privatelinkresources_client.go index 1baddbf9c02e..e728421adcce 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_privatelinkresources_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/privatelinkresources_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 armservicebus @@ -57,7 +58,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // Get - Gets lists of resources that supports Privatelinks. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // options - PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get @@ -97,7 +98,7 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_queues_client.go b/sdk/resourcemanager/servicebus/armservicebus/queues_client.go similarity index 96% rename from sdk/resourcemanager/servicebus/armservicebus/zz_generated_queues_client.go rename to sdk/resourcemanager/servicebus/armservicebus/queues_client.go index cda67835859a..559116230a3e 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_queues_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/queues_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 armservicebus @@ -58,7 +59,7 @@ func NewQueuesClient(subscriptionID string, credential azcore.TokenCredential, o // CreateOrUpdate - Creates or updates a Service Bus queue. This operation is idempotent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // queueName - The queue name. @@ -103,7 +104,7 @@ func (client *QueuesClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -120,7 +121,7 @@ func (client *QueuesClient) createOrUpdateHandleResponse(resp *http.Response) (Q // CreateOrUpdateAuthorizationRule - Creates an authorization rule for a queue. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // queueName - The queue name. @@ -171,7 +172,7 @@ func (client *QueuesClient) createOrUpdateAuthorizationRuleCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -188,7 +189,7 @@ func (client *QueuesClient) createOrUpdateAuthorizationRuleHandleResponse(resp * // Delete - Deletes a queue from the specified namespace in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // queueName - The queue name. @@ -232,7 +233,7 @@ func (client *QueuesClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -240,7 +241,7 @@ func (client *QueuesClient) deleteCreateRequest(ctx context.Context, resourceGro // DeleteAuthorizationRule - Deletes a queue authorization rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // queueName - The queue name. @@ -290,7 +291,7 @@ func (client *QueuesClient) deleteAuthorizationRuleCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -298,7 +299,7 @@ func (client *QueuesClient) deleteAuthorizationRuleCreateRequest(ctx context.Con // Get - Returns a description for the specified queue. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // queueName - The queue name. @@ -342,7 +343,7 @@ func (client *QueuesClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -359,7 +360,7 @@ func (client *QueuesClient) getHandleResponse(resp *http.Response) (QueuesClient // GetAuthorizationRule - Gets an authorization rule for a queue by rule name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // queueName - The queue name. @@ -409,7 +410,7 @@ func (client *QueuesClient) getAuthorizationRuleCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -425,8 +426,7 @@ func (client *QueuesClient) getAuthorizationRuleHandleResponse(resp *http.Respon } // NewListAuthorizationRulesPager - Gets all authorization rules for a queue. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // queueName - The queue name. @@ -484,7 +484,7 @@ func (client *QueuesClient) listAuthorizationRulesCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -500,8 +500,7 @@ func (client *QueuesClient) listAuthorizationRulesHandleResponse(resp *http.Resp } // NewListByNamespacePager - Gets the queues within a namespace. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // options - QueuesClientListByNamespaceOptions contains the optional parameters for the QueuesClient.ListByNamespace method. @@ -553,7 +552,7 @@ func (client *QueuesClient) listByNamespaceCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } @@ -576,7 +575,7 @@ func (client *QueuesClient) listByNamespaceHandleResponse(resp *http.Response) ( // ListKeys - Primary and secondary connection strings to the queue. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // queueName - The queue name. @@ -625,7 +624,7 @@ func (client *QueuesClient) listKeysCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -642,7 +641,7 @@ func (client *QueuesClient) listKeysHandleResponse(resp *http.Response) (QueuesC // RegenerateKeys - Regenerates the primary or secondary connection strings to the queue. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // queueName - The queue name. @@ -692,7 +691,7 @@ func (client *QueuesClient) regenerateKeysCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_response_types.go b/sdk/resourcemanager/servicebus/armservicebus/response_types.go similarity index 99% rename from sdk/resourcemanager/servicebus/armservicebus/zz_generated_response_types.go rename to sdk/resourcemanager/servicebus/armservicebus/response_types.go index 2435c03710ca..9867acb7ea0d 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_response_types.go +++ b/sdk/resourcemanager/servicebus/armservicebus/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 armservicebus diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_rules_client.go b/sdk/resourcemanager/servicebus/armservicebus/rules_client.go similarity index 97% rename from sdk/resourcemanager/servicebus/armservicebus/zz_generated_rules_client.go rename to sdk/resourcemanager/servicebus/armservicebus/rules_client.go index 2657027e1988..4fa01bc9716c 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_rules_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/rules_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 armservicebus @@ -58,7 +59,7 @@ func NewRulesClient(subscriptionID string, credential azcore.TokenCredential, op // CreateOrUpdate - Creates a new rule and updates an existing rule // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -113,7 +114,7 @@ func (client *RulesClient) createOrUpdateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -130,7 +131,7 @@ func (client *RulesClient) createOrUpdateHandleResponse(resp *http.Response) (Ru // Delete - Deletes an existing rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -184,7 +185,7 @@ func (client *RulesClient) deleteCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -192,7 +193,7 @@ func (client *RulesClient) deleteCreateRequest(ctx context.Context, resourceGrou // Get - Retrieves the description for the specified rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -246,7 +247,7 @@ func (client *RulesClient) getCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -262,8 +263,7 @@ func (client *RulesClient) getHandleResponse(resp *http.Response) (RulesClientGe } // NewListBySubscriptionsPager - List all the rules within given topic-subscription -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -326,7 +326,7 @@ func (client *RulesClient) listBySubscriptionsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_subscriptions_client.go b/sdk/resourcemanager/servicebus/armservicebus/subscriptions_client.go similarity index 97% rename from sdk/resourcemanager/servicebus/armservicebus/zz_generated_subscriptions_client.go rename to sdk/resourcemanager/servicebus/armservicebus/subscriptions_client.go index 0e93db69d1d1..1e6c25b7e834 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_subscriptions_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/subscriptions_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 armservicebus @@ -58,7 +59,7 @@ func NewSubscriptionsClient(subscriptionID string, credential azcore.TokenCreden // CreateOrUpdate - Creates a topic subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -109,7 +110,7 @@ func (client *SubscriptionsClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -126,7 +127,7 @@ func (client *SubscriptionsClient) createOrUpdateHandleResponse(resp *http.Respo // Delete - Deletes a subscription from the specified topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -175,7 +176,7 @@ func (client *SubscriptionsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -183,7 +184,7 @@ func (client *SubscriptionsClient) deleteCreateRequest(ctx context.Context, reso // Get - Returns a subscription description for the specified topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -232,7 +233,7 @@ func (client *SubscriptionsClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -248,8 +249,7 @@ func (client *SubscriptionsClient) getHandleResponse(resp *http.Response) (Subsc } // NewListByTopicPager - List all the subscriptions under a specified topic. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -307,7 +307,7 @@ func (client *SubscriptionsClient) listByTopicCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_time_rfc3339.go b/sdk/resourcemanager/servicebus/armservicebus/time_rfc3339.go similarity index 99% rename from sdk/resourcemanager/servicebus/armservicebus/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/servicebus/armservicebus/time_rfc3339.go index 42470250449b..9f151c2cae4b 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/servicebus/armservicebus/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 armservicebus diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_topics_client.go b/sdk/resourcemanager/servicebus/armservicebus/topics_client.go similarity index 96% rename from sdk/resourcemanager/servicebus/armservicebus/zz_generated_topics_client.go rename to sdk/resourcemanager/servicebus/armservicebus/topics_client.go index 4a4e12f585ec..9e430196ac6f 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_topics_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/topics_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 armservicebus @@ -58,7 +59,7 @@ func NewTopicsClient(subscriptionID string, credential azcore.TokenCredential, o // CreateOrUpdate - Creates a topic in the specified namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -103,7 +104,7 @@ func (client *TopicsClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -120,7 +121,7 @@ func (client *TopicsClient) createOrUpdateHandleResponse(resp *http.Response) (T // CreateOrUpdateAuthorizationRule - Creates an authorization rule for the specified topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -171,7 +172,7 @@ func (client *TopicsClient) createOrUpdateAuthorizationRuleCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -188,7 +189,7 @@ func (client *TopicsClient) createOrUpdateAuthorizationRuleHandleResponse(resp * // Delete - Deletes a topic from the specified namespace and resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -232,7 +233,7 @@ func (client *TopicsClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -240,7 +241,7 @@ func (client *TopicsClient) deleteCreateRequest(ctx context.Context, resourceGro // DeleteAuthorizationRule - Deletes a topic authorization rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -290,7 +291,7 @@ func (client *TopicsClient) deleteAuthorizationRuleCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -298,7 +299,7 @@ func (client *TopicsClient) deleteAuthorizationRuleCreateRequest(ctx context.Con // Get - Returns a description for the specified topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -342,7 +343,7 @@ func (client *TopicsClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -359,7 +360,7 @@ func (client *TopicsClient) getHandleResponse(resp *http.Response) (TopicsClient // GetAuthorizationRule - Returns the specified authorization rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -409,7 +410,7 @@ func (client *TopicsClient) getAuthorizationRuleCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -425,8 +426,7 @@ func (client *TopicsClient) getAuthorizationRuleHandleResponse(resp *http.Respon } // NewListAuthorizationRulesPager - Gets authorization rules for a topic. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -484,7 +484,7 @@ func (client *TopicsClient) listAuthorizationRulesCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -500,8 +500,7 @@ func (client *TopicsClient) listAuthorizationRulesHandleResponse(resp *http.Resp } // NewListByNamespacePager - Gets all the topics in a namespace. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // options - TopicsClientListByNamespaceOptions contains the optional parameters for the TopicsClient.ListByNamespace method. @@ -553,7 +552,7 @@ func (client *TopicsClient) listByNamespaceCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } @@ -576,7 +575,7 @@ func (client *TopicsClient) listByNamespaceHandleResponse(resp *http.Response) ( // ListKeys - Gets the primary and secondary connection strings for the topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -625,7 +624,7 @@ func (client *TopicsClient) listKeysCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -642,7 +641,7 @@ func (client *TopicsClient) listKeysHandleResponse(resp *http.Response) (TopicsC // RegenerateKeys - Regenerates primary or secondary connection strings for the topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -692,7 +691,7 @@ func (client *TopicsClient) regenerateKeysCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_disasterrecoveryconfigs_client_test.go b/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_disasterrecoveryconfigs_client_test.go deleted file mode 100644 index dfd0ce736869..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_disasterrecoveryconfigs_client_test.go +++ /dev/null @@ -1,259 +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 armservicebus_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/servicebus/armservicebus/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/SBAliasList.json -func ExampleDisasterRecoveryConfigsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewDisasterRecoveryConfigsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("ardsouzatestRG", - "sdk-Namespace-8860", - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/SBAliasCreate.json -func ExampleDisasterRecoveryConfigsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewDisasterRecoveryConfigsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "ardsouzatestRG", - "sdk-Namespace-8860", - "sdk-Namespace-8860", - armservicebus.ArmDisasterRecovery{ - Properties: &armservicebus.ArmDisasterRecoveryProperties{ - AlternateName: to.Ptr("alternameforAlias-Namespace-8860"), - PartnerNamespace: to.Ptr("sdk-Namespace-37"), - }, - }, - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/SBAliasDelete.json -func ExampleDisasterRecoveryConfigsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewDisasterRecoveryConfigsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "SouthCentralUS", - "sdk-Namespace-8860", - "sdk-DisasterRecovery-3814", - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/SBAliasGet.json -func ExampleDisasterRecoveryConfigsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewDisasterRecoveryConfigsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "ardsouzatestRG", - "sdk-Namespace-8860", - "sdk-DisasterRecovery-3814", - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/SBEHAliasBreakPairing.json -func ExampleDisasterRecoveryConfigsClient_BreakPairing() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewDisasterRecoveryConfigsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.BreakPairing(ctx, - "ardsouzatestRG", - "sdk-Namespace-8860", - "sdk-DisasterRecovery-3814", - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/SBAliasFailOver.json -func ExampleDisasterRecoveryConfigsClient_FailOver() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewDisasterRecoveryConfigsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.FailOver(ctx, - "ardsouzatestRG", - "sdk-Namespace-8860", - "sdk-DisasterRecovery-3814", - &armservicebus.DisasterRecoveryConfigsClientFailOverOptions{Parameters: 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/SBAliasAuthorizationRuleListAll.json -func ExampleDisasterRecoveryConfigsClient_NewListAuthorizationRulesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewDisasterRecoveryConfigsClient("exampleSubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListAuthorizationRulesPager("exampleResourceGroup", - "sdk-Namespace-9080", - "sdk-DisasterRecovery-4047", - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/SBAliasAuthorizationRuleGet.json -func ExampleDisasterRecoveryConfigsClient_GetAuthorizationRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewDisasterRecoveryConfigsClient("exampleSubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetAuthorizationRule(ctx, - "exampleResourceGroup", - "sdk-Namespace-9080", - "sdk-DisasterRecovery-4879", - "sdk-Authrules-4879", - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/SBAliasAuthorizationRuleListKey.json -func ExampleDisasterRecoveryConfigsClient_ListKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewDisasterRecoveryConfigsClient("exampleSubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListKeys(ctx, - "exampleResourceGroup", - "sdk-Namespace-2702", - "sdk-DisasterRecovery-4047", - "sdk-Authrules-1746", - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/SBAliasCheckNameAvailability.json -func ExampleDisasterRecoveryConfigsClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewDisasterRecoveryConfigsClient("exampleSubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckNameAvailability(ctx, - "exampleResourceGroup", - "sdk-Namespace-9080", - armservicebus.CheckNameAvailability{ - Name: to.Ptr("sdk-DisasterRecovery-9474"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_migrationconfigs_client_test.go b/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_migrationconfigs_client_test.go deleted file mode 100644 index a9fb5c811928..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_migrationconfigs_client_test.go +++ /dev/null @@ -1,163 +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 armservicebus_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/servicebus/armservicebus/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Migrationconfigurations/SBMigrationconfigurationList.json -func ExampleMigrationConfigsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewMigrationConfigsClient("SubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("ResourceGroup", - "sdk-Namespace-9259", - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Migrationconfigurations/SBMigrationconfigurationCreateAndStartMigration.json -func ExampleMigrationConfigsClient_BeginCreateAndStartMigration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewMigrationConfigsClient("SubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateAndStartMigration(ctx, - "ResourceGroup", - "sdk-Namespace-41", - armservicebus.MigrationConfigurationNameDefault, - armservicebus.MigrationConfigProperties{ - Properties: &armservicebus.MigrationConfigPropertiesProperties{ - PostMigrationName: to.Ptr("sdk-PostMigration-5919"), - TargetNamespace: to.Ptr("/subscriptions/SubscriptionId/resourceGroups/ResourceGroup/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-4028"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Migrationconfigurations/SBMigrationconfigurationDelete.json -func ExampleMigrationConfigsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewMigrationConfigsClient("SubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "ResourceGroup", - "sdk-Namespace-41", - armservicebus.MigrationConfigurationNameDefault, - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Migrationconfigurations/SBMigrationconfigurationGet.json -func ExampleMigrationConfigsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewMigrationConfigsClient("SubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "ResourceGroup", - "sdk-Namespace-41", - armservicebus.MigrationConfigurationNameDefault, - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Migrationconfigurations/SBMigrationconfigurationCompleteMigration.json -func ExampleMigrationConfigsClient_CompleteMigration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewMigrationConfigsClient("SubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.CompleteMigration(ctx, - "ResourceGroup", - "sdk-Namespace-41", - armservicebus.MigrationConfigurationNameDefault, - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Migrationconfigurations/SBMigrationconfigurationRevert.json -func ExampleMigrationConfigsClient_Revert() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewMigrationConfigsClient("SubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Revert(ctx, - "ResourceGroup", - "sdk-Namespace-41", - armservicebus.MigrationConfigurationNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_namespaces_client_test.go b/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_namespaces_client_test.go deleted file mode 100644 index 4c6cbaaeea25..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_namespaces_client_test.go +++ /dev/null @@ -1,466 +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 armservicebus_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/servicebus/armservicebus/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/SBNameSpaceList.json -func ExampleNamespacesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewNamespacesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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 - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/SBNameSpaceListByResourceGroup.json -func ExampleNamespacesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewNamespacesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("ArunMonocle", - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/SBNameSpaceCreate.json -func ExampleNamespacesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewNamespacesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "ArunMonocle", - "sdk-Namespace2924", - armservicebus.SBNamespace{ - Location: to.Ptr("South Central US"), - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - SKU: &armservicebus.SBSKU{ - Name: to.Ptr(armservicebus.SKUNameStandard), - Tier: to.Ptr(armservicebus.SKUTierStandard), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/SBNameSpaceDelete.json -func ExampleNamespacesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewNamespacesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "ArunMonocle", - "sdk-Namespace-3285", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/SBNameSpaceGet.json -func ExampleNamespacesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewNamespacesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "ArunMonocle", - "sdk-Namespace-2924", - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/SBNameSpaceUpdate.json -func ExampleNamespacesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewNamespacesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "ArunMonocle", - "sdk-Namespace-3285", - armservicebus.SBNamespaceUpdateParameters{ - Location: to.Ptr("South Central US"), - Tags: map[string]*string{ - "tag3": to.Ptr("value3"), - "tag4": to.Ptr("value4"), - }, - }, - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/VirtualNetworkRule/SBNetworkRuleSetCreate.json -func ExampleNamespacesClient_CreateOrUpdateNetworkRuleSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewNamespacesClient("Subscription", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdateNetworkRuleSet(ctx, - "ResourceGroup", - "sdk-Namespace-6019", - armservicebus.NetworkRuleSet{ - Properties: &armservicebus.NetworkRuleSetProperties{ - DefaultAction: to.Ptr(armservicebus.DefaultActionDeny), - IPRules: []*armservicebus.NWRuleSetIPRules{ - { - Action: to.Ptr(armservicebus.NetworkRuleIPActionAllow), - IPMask: to.Ptr("1.1.1.1"), - }, - { - Action: to.Ptr(armservicebus.NetworkRuleIPActionAllow), - IPMask: to.Ptr("1.1.1.2"), - }, - { - Action: to.Ptr(armservicebus.NetworkRuleIPActionAllow), - IPMask: to.Ptr("1.1.1.3"), - }, - { - Action: to.Ptr(armservicebus.NetworkRuleIPActionAllow), - IPMask: to.Ptr("1.1.1.4"), - }, - { - Action: to.Ptr(armservicebus.NetworkRuleIPActionAllow), - IPMask: to.Ptr("1.1.1.5"), - }}, - VirtualNetworkRules: []*armservicebus.NWRuleSetVirtualNetworkRules{ - { - IgnoreMissingVnetServiceEndpoint: to.Ptr(true), - Subnet: &armservicebus.Subnet{ - ID: to.Ptr("/subscriptions/854d368f-1828-428f-8f3c-f2affa9b2f7d/resourcegroups/alitest/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet2"), - }, - }, - { - IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - Subnet: &armservicebus.Subnet{ - ID: to.Ptr("/subscriptions/854d368f-1828-428f-8f3c-f2affa9b2f7d/resourcegroups/alitest/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet3"), - }, - }, - { - IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - Subnet: &armservicebus.Subnet{ - ID: to.Ptr("/subscriptions/854d368f-1828-428f-8f3c-f2affa9b2f7d/resourcegroups/alitest/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet6"), - }, - }}, - }, - }, - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/VirtualNetworkRule/SBNetworkRuleSetGet.json -func ExampleNamespacesClient_GetNetworkRuleSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewNamespacesClient("Subscription", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetNetworkRuleSet(ctx, - "ResourceGroup", - "sdk-Namespace-6019", - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/VirtualNetworkRule/SBNetworkRuleSetList.json -func ExampleNamespacesClient_NewListNetworkRuleSetsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewNamespacesClient("Subscription", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListNetworkRuleSetsPager("ResourceGroup", - "sdk-Namespace-6019", - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/SBNameSpaceAuthorizationRuleListAll.json -func ExampleNamespacesClient_NewListAuthorizationRulesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewNamespacesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListAuthorizationRulesPager("ArunMonocle", - "sdk-Namespace-6914", - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/SBNameSpaceAuthorizationRuleCreate.json -func ExampleNamespacesClient_CreateOrUpdateAuthorizationRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewNamespacesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdateAuthorizationRule(ctx, - "ArunMonocle", - "sdk-Namespace-6914", - "sdk-AuthRules-1788", - armservicebus.SBAuthorizationRule{ - Properties: &armservicebus.SBAuthorizationRuleProperties{ - Rights: []*armservicebus.AccessRights{ - to.Ptr(armservicebus.AccessRightsListen), - to.Ptr(armservicebus.AccessRightsSend)}, - }, - }, - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/SBNameSpaceAuthorizationRuleDelete.json -func ExampleNamespacesClient_DeleteAuthorizationRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewNamespacesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.DeleteAuthorizationRule(ctx, - "ArunMonocle", - "sdk-namespace-6914", - "sdk-AuthRules-1788", - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/SBNameSpaceAuthorizationRuleGet.json -func ExampleNamespacesClient_GetAuthorizationRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewNamespacesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetAuthorizationRule(ctx, - "ArunMonocle", - "sdk-Namespace-6914", - "sdk-AuthRules-1788", - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/SBNameSpaceAuthorizationRuleListKey.json -func ExampleNamespacesClient_ListKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewNamespacesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListKeys(ctx, - "ArunMonocle", - "sdk-namespace-6914", - "sdk-AuthRules-1788", - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/SBNameSpaceAuthorizationRuleRegenerateKey.json -func ExampleNamespacesClient_RegenerateKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewNamespacesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.RegenerateKeys(ctx, - "ArunMonocle", - "sdk-namespace-6914", - "sdk-AuthRules-1788", - armservicebus.RegenerateAccessKeyParameters{ - KeyType: to.Ptr(armservicebus.KeyTypePrimaryKey), - }, - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/SBNameSpaceCheckNameAvailability.json -func ExampleNamespacesClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewNamespacesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckNameAvailability(ctx, - armservicebus.CheckNameAvailability{ - Name: to.Ptr("sdk-Namespace-2924"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_operations_client_test.go deleted file mode 100644 index b78856e81ee8..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/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 armservicebus_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/SBOperations_List.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 := armservicebus.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/servicebus/armservicebus/ze_generated_example_privateendpointconnections_client_test.go b/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_privateendpointconnections_client_test.go deleted file mode 100644 index 57804a2ef9eb..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_privateendpointconnections_client_test.go +++ /dev/null @@ -1,127 +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 armservicebus_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/servicebus/armservicebus/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/PrivateEndPointConnectionList.json -func ExamplePrivateEndpointConnectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewPrivateEndpointConnectionsClient("subID", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("SDK-ServiceBus-4794", - "sdk-Namespace-5828", - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/PrivateEndPointConnectionCreate.json -func ExamplePrivateEndpointConnectionsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewPrivateEndpointConnectionsClient("subID", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "ArunMonocle", - "sdk-Namespace-2924", - "privateEndpointConnectionName", - armservicebus.PrivateEndpointConnection{ - Properties: &armservicebus.PrivateEndpointConnectionProperties{ - PrivateEndpoint: &armservicebus.PrivateEndpoint{ - ID: to.Ptr("/subscriptions/dbedb4e0-40e6-4145-81f3-f1314c150774/resourceGroups/SDK-ServiceBus-8396/providers/Microsoft.Network/privateEndpoints/sdk-Namespace-2847"), - }, - PrivateLinkServiceConnectionState: &armservicebus.ConnectionState{ - Description: to.Ptr("testing"), - Status: to.Ptr(armservicebus.PrivateLinkConnectionStatusRejected), - }, - ProvisioningState: to.Ptr(armservicebus.EndPointProvisioningStateSucceeded), - }, - }, - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/PrivateEndPointConnectionDelete.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewPrivateEndpointConnectionsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "ArunMonocle", - "sdk-Namespace-3285", - "928c44d5-b7c6-423b-b6fa-811e0c27b3e0", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/PrivateEndPointConnectionGet.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewPrivateEndpointConnectionsClient("subID", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "SDK-ServiceBus-4794", - "sdk-Namespace-5828", - "privateEndpointConnectionName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_privatelinkresources_client_test.go b/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_privatelinkresources_client_test.go deleted file mode 100644 index 17edb6abc0be..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_privatelinkresources_client_test.go +++ /dev/null @@ -1,39 +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 armservicebus_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/PrivateLinkResourcesGet.json -func ExamplePrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewPrivateLinkResourcesClient("subID", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "ArunMonocle", - "sdk-Namespace-2924", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_queues_client_test.go b/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_queues_client_test.go deleted file mode 100644 index 7c84d06ed732..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_queues_client_test.go +++ /dev/null @@ -1,273 +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 armservicebus_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/servicebus/armservicebus/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Queues/SBQueueAuthorizationRuleListAll.json -func ExampleQueuesClient_NewListAuthorizationRulesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewQueuesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListAuthorizationRulesPager("ArunMonocle", - "sdk-Namespace-7982", - "sdk-Queues-2317", - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Queues/SBQueueAuthorizationRuleCreate.json -func ExampleQueuesClient_CreateOrUpdateAuthorizationRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewQueuesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdateAuthorizationRule(ctx, - "ArunMonocle", - "sdk-Namespace-7982", - "sdk-Queues-2317", - "sdk-AuthRules-5800", - armservicebus.SBAuthorizationRule{ - Properties: &armservicebus.SBAuthorizationRuleProperties{ - Rights: []*armservicebus.AccessRights{ - to.Ptr(armservicebus.AccessRightsListen), - to.Ptr(armservicebus.AccessRightsSend)}, - }, - }, - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Queues/SBQueueAuthorizationRuleDelete.json -func ExampleQueuesClient_DeleteAuthorizationRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewQueuesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.DeleteAuthorizationRule(ctx, - "ArunMonocle", - "sdk-namespace-7982", - "sdk-Queues-2317", - "sdk-AuthRules-5800", - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Queues/SBQueueAuthorizationRuleGet.json -func ExampleQueuesClient_GetAuthorizationRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewQueuesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetAuthorizationRule(ctx, - "ArunMonocle", - "sdk-Namespace-7982", - "sdk-Queues-2317", - "sdk-AuthRules-5800", - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Queues/SBQueueAuthorizationRuleListKey.json -func ExampleQueuesClient_ListKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewQueuesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListKeys(ctx, - "ArunMonocle", - "sdk-namespace-7982", - "sdk-Queues-2317", - "sdk-AuthRules-5800", - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Queues/SBQueueAuthorizationRuleRegenerateKey.json -func ExampleQueuesClient_RegenerateKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewQueuesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.RegenerateKeys(ctx, - "ArunMonocle", - "sdk-namespace-7982", - "sdk-Queues-2317", - "sdk-AuthRules-5800", - armservicebus.RegenerateAccessKeyParameters{ - KeyType: to.Ptr(armservicebus.KeyTypePrimaryKey), - }, - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Queues/SBQueueListByNameSpace.json -func ExampleQueuesClient_NewListByNamespacePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewQueuesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByNamespacePager("ArunMonocle", - "sdk-Namespace-3174", - &armservicebus.QueuesClientListByNamespaceOptions{Skip: nil, - Top: 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Queues/SBQueueCreate.json -func ExampleQueuesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewQueuesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "ArunMonocle", - "sdk-Namespace-3174", - "sdk-Queues-5647", - armservicebus.SBQueue{ - Properties: &armservicebus.SBQueueProperties{ - EnablePartitioning: to.Ptr(true), - }, - }, - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Queues/SBQueueDelete.json -func ExampleQueuesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewQueuesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "ArunMonocle", - "sdk-Namespace-183", - "sdk-Queues-8708", - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Queues/SBQueueGet.json -func ExampleQueuesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewQueuesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "ArunMonocle", - "sdk-Namespace-3174", - "sdk-Queues-5647", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_rules_client_test.go b/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_rules_client_test.go deleted file mode 100644 index 3d001aac0d1a..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_rules_client_test.go +++ /dev/null @@ -1,131 +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 armservicebus_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/servicebus/armservicebus/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Rules/RuleListBySubscription.json -func ExampleRulesClient_NewListBySubscriptionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewRulesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionsPager("ArunMonocle", - "sdk-Namespace-1319", - "sdk-Topics-2081", - "sdk-Subscriptions-8691", - &armservicebus.RulesClientListBySubscriptionsOptions{Skip: nil, - Top: 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Rules/RuleCreate_CorrelationFilter.json -func ExampleRulesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewRulesClient("subscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "resourceGroupName", - "sdk-Namespace-1319", - "sdk-Topics-2081", - "sdk-Subscriptions-8691", - "sdk-Rules-6571", - armservicebus.Rule{ - Properties: &armservicebus.Ruleproperties{ - CorrelationFilter: &armservicebus.CorrelationFilter{ - Properties: map[string]*string{ - "topicHint": to.Ptr("Crop"), - }, - }, - FilterType: to.Ptr(armservicebus.FilterTypeCorrelationFilter), - }, - }, - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Rules/RuleDelete.json -func ExampleRulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewRulesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "ArunMonocle", - "sdk-Namespace-1319", - "sdk-Topics-2081", - "sdk-Subscriptions-8691", - "sdk-Rules-6571", - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Rules/RuleGet.json -func ExampleRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewRulesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "ArunMonocle", - "sdk-Namespace-1319", - "sdk-Topics-2081", - "sdk-Subscriptions-8691", - "sdk-Rules-6571", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_subscriptions_client_test.go b/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_subscriptions_client_test.go deleted file mode 100644 index 109f7aeba1cc..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_subscriptions_client_test.go +++ /dev/null @@ -1,122 +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 armservicebus_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/servicebus/armservicebus/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Subscriptions/SBSubscriptionListByTopic.json -func ExampleSubscriptionsClient_NewListByTopicPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewSubscriptionsClient("5{Subscriptionid}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByTopicPager("ResourceGroup", - "sdk-Namespace-1349", - "sdk-Topics-8740", - &armservicebus.SubscriptionsClientListByTopicOptions{Skip: nil, - Top: 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Subscriptions/SBSubscriptionCreate.json -func ExampleSubscriptionsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewSubscriptionsClient("Subscriptionid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "ResourceGroup", - "sdk-Namespace-1349", - "sdk-Topics-8740", - "sdk-Subscriptions-2178", - armservicebus.SBSubscription{ - Properties: &armservicebus.SBSubscriptionProperties{ - EnableBatchedOperations: to.Ptr(true), - }, - }, - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Subscriptions/SBSubscriptionDelete.json -func ExampleSubscriptionsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewSubscriptionsClient("subscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "ResourceGroup", - "sdk-Namespace-5882", - "sdk-Topics-1804", - "sdk-Subscriptions-3670", - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Subscriptions/SBSubscriptionGet.json -func ExampleSubscriptionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewSubscriptionsClient("Subscriptionid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "ResourceGroup", - "sdk-Namespace-1349", - "sdk-Topics-8740", - "sdk-Subscriptions-2178", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_topics_client_test.go b/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_topics_client_test.go deleted file mode 100644 index 0ebfd3c7cfe0..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_topics_client_test.go +++ /dev/null @@ -1,273 +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 armservicebus_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/servicebus/armservicebus/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Topics/SBTopicAuthorizationRuleListAll.json -func ExampleTopicsClient_NewListAuthorizationRulesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewTopicsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListAuthorizationRulesPager("ArunMonocle", - "sdk-Namespace-6261", - "sdk-Topics-1984", - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Topics/SBTopicAuthorizationRuleCreate.json -func ExampleTopicsClient_CreateOrUpdateAuthorizationRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewTopicsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdateAuthorizationRule(ctx, - "ArunMonocle", - "sdk-Namespace-6261", - "sdk-Topics-1984", - "sdk-AuthRules-4310", - armservicebus.SBAuthorizationRule{ - Properties: &armservicebus.SBAuthorizationRuleProperties{ - Rights: []*armservicebus.AccessRights{ - to.Ptr(armservicebus.AccessRightsListen), - to.Ptr(armservicebus.AccessRightsSend)}, - }, - }, - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Topics/SBTopicAuthorizationRuleGet.json -func ExampleTopicsClient_GetAuthorizationRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewTopicsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetAuthorizationRule(ctx, - "ArunMonocle", - "sdk-Namespace-6261", - "sdk-Topics-1984", - "sdk-AuthRules-4310", - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Topics/SBTopicAuthorizationRuleDelete.json -func ExampleTopicsClient_DeleteAuthorizationRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewTopicsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.DeleteAuthorizationRule(ctx, - "ArunMonocle", - "sdk-Namespace-6261", - "sdk-Topics-1984", - "sdk-AuthRules-4310", - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Topics/SBTopicAuthorizationRuleListKey.json -func ExampleTopicsClient_ListKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewTopicsClient("e2f361f0-3b27-4503-a9cc-21cfba380093", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListKeys(ctx, - "Default-ServiceBus-WestUS", - "sdk-Namespace8408", - "sdk-Topics2075", - "sdk-Authrules5067", - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Topics/SBTopicAuthorizationRuleRegenerateKey.json -func ExampleTopicsClient_RegenerateKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewTopicsClient("e2f361f0-3b27-4503-a9cc-21cfba380093", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.RegenerateKeys(ctx, - "Default-ServiceBus-WestUS", - "sdk-Namespace8408", - "sdk-Topics2075", - "sdk-Authrules5067", - armservicebus.RegenerateAccessKeyParameters{ - KeyType: to.Ptr(armservicebus.KeyTypePrimaryKey), - }, - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Topics/SBTopicListByNameSpace.json -func ExampleTopicsClient_NewListByNamespacePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewTopicsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByNamespacePager("Default-ServiceBus-WestUS", - "sdk-Namespace-1617", - &armservicebus.TopicsClientListByNamespaceOptions{Skip: nil, - Top: 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Topics/SBTopicCreate.json -func ExampleTopicsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewTopicsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "ArunMonocle", - "sdk-Namespace-1617", - "sdk-Topics-5488", - armservicebus.SBTopic{ - Properties: &armservicebus.SBTopicProperties{ - EnableExpress: to.Ptr(true), - }, - }, - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Topics/SBTopicDelete.json -func ExampleTopicsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewTopicsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "ArunMonocle", - "sdk-Namespace-1617", - "sdk-Topics-5488", - 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/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Topics/SBTopicGet.json -func ExampleTopicsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicebus.NewTopicsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "ArunMonocle", - "sdk-Namespace-1617", - "sdk-Topics-5488", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_models_serde.go b/sdk/resourcemanager/servicebus/armservicebus/zz_generated_models_serde.go deleted file mode 100644 index 362ab1480f2c..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_models_serde.go +++ /dev/null @@ -1,626 +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 armservicebus - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type CorrelationFilter. -func (c CorrelationFilter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "contentType", c.ContentType) - populate(objectMap, "correlationId", c.CorrelationID) - populate(objectMap, "label", c.Label) - populate(objectMap, "messageId", c.MessageID) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "replyTo", c.ReplyTo) - populate(objectMap, "replyToSessionId", c.ReplyToSessionID) - populate(objectMap, "requiresPreprocessing", c.RequiresPreprocessing) - populate(objectMap, "sessionId", c.SessionID) - populate(objectMap, "to", c.To) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Encryption. -func (e Encryption) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "keySource", e.KeySource) - populate(objectMap, "keyVaultProperties", e.KeyVaultProperties) - populate(objectMap, "requireInfrastructureEncryption", e.RequireInfrastructureEncryption) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Identity. -func (i Identity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "principalId", i.PrincipalID) - populate(objectMap, "tenantId", i.TenantID) - populate(objectMap, "type", i.Type) - populate(objectMap, "userAssignedIdentities", i.UserAssignedIdentities) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type NetworkRuleSetProperties. -func (n NetworkRuleSetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "defaultAction", n.DefaultAction) - populate(objectMap, "ipRules", n.IPRules) - populate(objectMap, "publicNetworkAccess", n.PublicNetworkAccess) - populate(objectMap, "trustedServiceAccessEnabled", n.TrustedServiceAccessEnabled) - populate(objectMap, "virtualNetworkRules", n.VirtualNetworkRules) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceNamespacePatch. -func (r ResourceNamespacePatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SBAuthorizationRuleProperties. -func (s SBAuthorizationRuleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "rights", s.Rights) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SBNamespace. -func (s SBNamespace) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "identity", s.Identity) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "sku", s.SKU) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SBNamespaceProperties. -func (s SBNamespaceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "alternateName", s.AlternateName) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "disableLocalAuth", s.DisableLocalAuth) - populate(objectMap, "encryption", s.Encryption) - populate(objectMap, "metricId", s.MetricID) - populate(objectMap, "minimumTlsVersion", s.MinimumTLSVersion) - populate(objectMap, "privateEndpointConnections", s.PrivateEndpointConnections) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) - populate(objectMap, "serviceBusEndpoint", s.ServiceBusEndpoint) - populate(objectMap, "status", s.Status) - populateTimeRFC3339(objectMap, "updatedAt", s.UpdatedAt) - populate(objectMap, "zoneRedundant", s.ZoneRedundant) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SBNamespaceProperties. -func (s *SBNamespaceProperties) 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 "alternateName": - err = unpopulate(val, "AlternateName", &s.AlternateName) - delete(rawMsg, key) - case "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) - case "disableLocalAuth": - err = unpopulate(val, "DisableLocalAuth", &s.DisableLocalAuth) - delete(rawMsg, key) - case "encryption": - err = unpopulate(val, "Encryption", &s.Encryption) - delete(rawMsg, key) - case "metricId": - err = unpopulate(val, "MetricID", &s.MetricID) - delete(rawMsg, key) - case "minimumTlsVersion": - err = unpopulate(val, "MinimumTLSVersion", &s.MinimumTLSVersion) - delete(rawMsg, key) - case "privateEndpointConnections": - err = unpopulate(val, "PrivateEndpointConnections", &s.PrivateEndpointConnections) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) - delete(rawMsg, key) - case "serviceBusEndpoint": - err = unpopulate(val, "ServiceBusEndpoint", &s.ServiceBusEndpoint) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &s.Status) - delete(rawMsg, key) - case "updatedAt": - err = unpopulateTimeRFC3339(val, "UpdatedAt", &s.UpdatedAt) - delete(rawMsg, key) - case "zoneRedundant": - err = unpopulate(val, "ZoneRedundant", &s.ZoneRedundant) - 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 SBNamespaceUpdateParameters. -func (s SBNamespaceUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "identity", s.Identity) - 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 SBNamespaceUpdateProperties. -func (s SBNamespaceUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "alternateName", s.AlternateName) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "disableLocalAuth", s.DisableLocalAuth) - populate(objectMap, "encryption", s.Encryption) - populate(objectMap, "metricId", s.MetricID) - populate(objectMap, "privateEndpointConnections", s.PrivateEndpointConnections) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "serviceBusEndpoint", s.ServiceBusEndpoint) - populate(objectMap, "status", s.Status) - populateTimeRFC3339(objectMap, "updatedAt", s.UpdatedAt) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SBNamespaceUpdateProperties. -func (s *SBNamespaceUpdateProperties) 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 "alternateName": - err = unpopulate(val, "AlternateName", &s.AlternateName) - delete(rawMsg, key) - case "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) - case "disableLocalAuth": - err = unpopulate(val, "DisableLocalAuth", &s.DisableLocalAuth) - delete(rawMsg, key) - case "encryption": - err = unpopulate(val, "Encryption", &s.Encryption) - delete(rawMsg, key) - case "metricId": - err = unpopulate(val, "MetricID", &s.MetricID) - delete(rawMsg, key) - case "privateEndpointConnections": - err = unpopulate(val, "PrivateEndpointConnections", &s.PrivateEndpointConnections) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - case "serviceBusEndpoint": - err = unpopulate(val, "ServiceBusEndpoint", &s.ServiceBusEndpoint) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &s.Status) - delete(rawMsg, key) - case "updatedAt": - err = unpopulateTimeRFC3339(val, "UpdatedAt", &s.UpdatedAt) - 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 SBQueueProperties. -func (s SBQueueProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "accessedAt", s.AccessedAt) - populate(objectMap, "autoDeleteOnIdle", s.AutoDeleteOnIdle) - populate(objectMap, "countDetails", s.CountDetails) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "deadLetteringOnMessageExpiration", s.DeadLetteringOnMessageExpiration) - populate(objectMap, "defaultMessageTimeToLive", s.DefaultMessageTimeToLive) - populate(objectMap, "duplicateDetectionHistoryTimeWindow", s.DuplicateDetectionHistoryTimeWindow) - populate(objectMap, "enableBatchedOperations", s.EnableBatchedOperations) - populate(objectMap, "enableExpress", s.EnableExpress) - populate(objectMap, "enablePartitioning", s.EnablePartitioning) - populate(objectMap, "forwardDeadLetteredMessagesTo", s.ForwardDeadLetteredMessagesTo) - populate(objectMap, "forwardTo", s.ForwardTo) - populate(objectMap, "lockDuration", s.LockDuration) - populate(objectMap, "maxDeliveryCount", s.MaxDeliveryCount) - populate(objectMap, "maxMessageSizeInKilobytes", s.MaxMessageSizeInKilobytes) - populate(objectMap, "maxSizeInMegabytes", s.MaxSizeInMegabytes) - populate(objectMap, "messageCount", s.MessageCount) - populate(objectMap, "requiresDuplicateDetection", s.RequiresDuplicateDetection) - populate(objectMap, "requiresSession", s.RequiresSession) - populate(objectMap, "sizeInBytes", s.SizeInBytes) - populate(objectMap, "status", s.Status) - populateTimeRFC3339(objectMap, "updatedAt", s.UpdatedAt) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SBQueueProperties. -func (s *SBQueueProperties) 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 "accessedAt": - err = unpopulateTimeRFC3339(val, "AccessedAt", &s.AccessedAt) - delete(rawMsg, key) - case "autoDeleteOnIdle": - err = unpopulate(val, "AutoDeleteOnIdle", &s.AutoDeleteOnIdle) - delete(rawMsg, key) - case "countDetails": - err = unpopulate(val, "CountDetails", &s.CountDetails) - delete(rawMsg, key) - case "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) - case "deadLetteringOnMessageExpiration": - err = unpopulate(val, "DeadLetteringOnMessageExpiration", &s.DeadLetteringOnMessageExpiration) - delete(rawMsg, key) - case "defaultMessageTimeToLive": - err = unpopulate(val, "DefaultMessageTimeToLive", &s.DefaultMessageTimeToLive) - delete(rawMsg, key) - case "duplicateDetectionHistoryTimeWindow": - err = unpopulate(val, "DuplicateDetectionHistoryTimeWindow", &s.DuplicateDetectionHistoryTimeWindow) - delete(rawMsg, key) - case "enableBatchedOperations": - err = unpopulate(val, "EnableBatchedOperations", &s.EnableBatchedOperations) - delete(rawMsg, key) - case "enableExpress": - err = unpopulate(val, "EnableExpress", &s.EnableExpress) - delete(rawMsg, key) - case "enablePartitioning": - err = unpopulate(val, "EnablePartitioning", &s.EnablePartitioning) - delete(rawMsg, key) - case "forwardDeadLetteredMessagesTo": - err = unpopulate(val, "ForwardDeadLetteredMessagesTo", &s.ForwardDeadLetteredMessagesTo) - delete(rawMsg, key) - case "forwardTo": - err = unpopulate(val, "ForwardTo", &s.ForwardTo) - delete(rawMsg, key) - case "lockDuration": - err = unpopulate(val, "LockDuration", &s.LockDuration) - delete(rawMsg, key) - case "maxDeliveryCount": - err = unpopulate(val, "MaxDeliveryCount", &s.MaxDeliveryCount) - delete(rawMsg, key) - case "maxMessageSizeInKilobytes": - err = unpopulate(val, "MaxMessageSizeInKilobytes", &s.MaxMessageSizeInKilobytes) - delete(rawMsg, key) - case "maxSizeInMegabytes": - err = unpopulate(val, "MaxSizeInMegabytes", &s.MaxSizeInMegabytes) - delete(rawMsg, key) - case "messageCount": - err = unpopulate(val, "MessageCount", &s.MessageCount) - delete(rawMsg, key) - case "requiresDuplicateDetection": - err = unpopulate(val, "RequiresDuplicateDetection", &s.RequiresDuplicateDetection) - delete(rawMsg, key) - case "requiresSession": - err = unpopulate(val, "RequiresSession", &s.RequiresSession) - delete(rawMsg, key) - case "sizeInBytes": - err = unpopulate(val, "SizeInBytes", &s.SizeInBytes) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &s.Status) - delete(rawMsg, key) - case "updatedAt": - err = unpopulateTimeRFC3339(val, "UpdatedAt", &s.UpdatedAt) - 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 SBSubscriptionProperties. -func (s SBSubscriptionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "accessedAt", s.AccessedAt) - populate(objectMap, "autoDeleteOnIdle", s.AutoDeleteOnIdle) - populate(objectMap, "clientAffineProperties", s.ClientAffineProperties) - populate(objectMap, "countDetails", s.CountDetails) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "deadLetteringOnFilterEvaluationExceptions", s.DeadLetteringOnFilterEvaluationExceptions) - populate(objectMap, "deadLetteringOnMessageExpiration", s.DeadLetteringOnMessageExpiration) - populate(objectMap, "defaultMessageTimeToLive", s.DefaultMessageTimeToLive) - populate(objectMap, "duplicateDetectionHistoryTimeWindow", s.DuplicateDetectionHistoryTimeWindow) - populate(objectMap, "enableBatchedOperations", s.EnableBatchedOperations) - populate(objectMap, "forwardDeadLetteredMessagesTo", s.ForwardDeadLetteredMessagesTo) - populate(objectMap, "forwardTo", s.ForwardTo) - populate(objectMap, "isClientAffine", s.IsClientAffine) - populate(objectMap, "lockDuration", s.LockDuration) - populate(objectMap, "maxDeliveryCount", s.MaxDeliveryCount) - populate(objectMap, "messageCount", s.MessageCount) - populate(objectMap, "requiresSession", s.RequiresSession) - populate(objectMap, "status", s.Status) - populateTimeRFC3339(objectMap, "updatedAt", s.UpdatedAt) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SBSubscriptionProperties. -func (s *SBSubscriptionProperties) 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 "accessedAt": - err = unpopulateTimeRFC3339(val, "AccessedAt", &s.AccessedAt) - delete(rawMsg, key) - case "autoDeleteOnIdle": - err = unpopulate(val, "AutoDeleteOnIdle", &s.AutoDeleteOnIdle) - delete(rawMsg, key) - case "clientAffineProperties": - err = unpopulate(val, "ClientAffineProperties", &s.ClientAffineProperties) - delete(rawMsg, key) - case "countDetails": - err = unpopulate(val, "CountDetails", &s.CountDetails) - delete(rawMsg, key) - case "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) - case "deadLetteringOnFilterEvaluationExceptions": - err = unpopulate(val, "DeadLetteringOnFilterEvaluationExceptions", &s.DeadLetteringOnFilterEvaluationExceptions) - delete(rawMsg, key) - case "deadLetteringOnMessageExpiration": - err = unpopulate(val, "DeadLetteringOnMessageExpiration", &s.DeadLetteringOnMessageExpiration) - delete(rawMsg, key) - case "defaultMessageTimeToLive": - err = unpopulate(val, "DefaultMessageTimeToLive", &s.DefaultMessageTimeToLive) - delete(rawMsg, key) - case "duplicateDetectionHistoryTimeWindow": - err = unpopulate(val, "DuplicateDetectionHistoryTimeWindow", &s.DuplicateDetectionHistoryTimeWindow) - delete(rawMsg, key) - case "enableBatchedOperations": - err = unpopulate(val, "EnableBatchedOperations", &s.EnableBatchedOperations) - delete(rawMsg, key) - case "forwardDeadLetteredMessagesTo": - err = unpopulate(val, "ForwardDeadLetteredMessagesTo", &s.ForwardDeadLetteredMessagesTo) - delete(rawMsg, key) - case "forwardTo": - err = unpopulate(val, "ForwardTo", &s.ForwardTo) - delete(rawMsg, key) - case "isClientAffine": - err = unpopulate(val, "IsClientAffine", &s.IsClientAffine) - delete(rawMsg, key) - case "lockDuration": - err = unpopulate(val, "LockDuration", &s.LockDuration) - delete(rawMsg, key) - case "maxDeliveryCount": - err = unpopulate(val, "MaxDeliveryCount", &s.MaxDeliveryCount) - delete(rawMsg, key) - case "messageCount": - err = unpopulate(val, "MessageCount", &s.MessageCount) - delete(rawMsg, key) - case "requiresSession": - err = unpopulate(val, "RequiresSession", &s.RequiresSession) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &s.Status) - delete(rawMsg, key) - case "updatedAt": - err = unpopulateTimeRFC3339(val, "UpdatedAt", &s.UpdatedAt) - 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 SBTopicProperties. -func (s SBTopicProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "accessedAt", s.AccessedAt) - populate(objectMap, "autoDeleteOnIdle", s.AutoDeleteOnIdle) - populate(objectMap, "countDetails", s.CountDetails) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "defaultMessageTimeToLive", s.DefaultMessageTimeToLive) - populate(objectMap, "duplicateDetectionHistoryTimeWindow", s.DuplicateDetectionHistoryTimeWindow) - populate(objectMap, "enableBatchedOperations", s.EnableBatchedOperations) - populate(objectMap, "enableExpress", s.EnableExpress) - populate(objectMap, "enablePartitioning", s.EnablePartitioning) - populate(objectMap, "maxMessageSizeInKilobytes", s.MaxMessageSizeInKilobytes) - populate(objectMap, "maxSizeInMegabytes", s.MaxSizeInMegabytes) - populate(objectMap, "requiresDuplicateDetection", s.RequiresDuplicateDetection) - populate(objectMap, "sizeInBytes", s.SizeInBytes) - populate(objectMap, "status", s.Status) - populate(objectMap, "subscriptionCount", s.SubscriptionCount) - populate(objectMap, "supportOrdering", s.SupportOrdering) - populateTimeRFC3339(objectMap, "updatedAt", s.UpdatedAt) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SBTopicProperties. -func (s *SBTopicProperties) 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 "accessedAt": - err = unpopulateTimeRFC3339(val, "AccessedAt", &s.AccessedAt) - delete(rawMsg, key) - case "autoDeleteOnIdle": - err = unpopulate(val, "AutoDeleteOnIdle", &s.AutoDeleteOnIdle) - delete(rawMsg, key) - case "countDetails": - err = unpopulate(val, "CountDetails", &s.CountDetails) - delete(rawMsg, key) - case "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) - case "defaultMessageTimeToLive": - err = unpopulate(val, "DefaultMessageTimeToLive", &s.DefaultMessageTimeToLive) - delete(rawMsg, key) - case "duplicateDetectionHistoryTimeWindow": - err = unpopulate(val, "DuplicateDetectionHistoryTimeWindow", &s.DuplicateDetectionHistoryTimeWindow) - delete(rawMsg, key) - case "enableBatchedOperations": - err = unpopulate(val, "EnableBatchedOperations", &s.EnableBatchedOperations) - delete(rawMsg, key) - case "enableExpress": - err = unpopulate(val, "EnableExpress", &s.EnableExpress) - delete(rawMsg, key) - case "enablePartitioning": - err = unpopulate(val, "EnablePartitioning", &s.EnablePartitioning) - delete(rawMsg, key) - case "maxMessageSizeInKilobytes": - err = unpopulate(val, "MaxMessageSizeInKilobytes", &s.MaxMessageSizeInKilobytes) - delete(rawMsg, key) - case "maxSizeInMegabytes": - err = unpopulate(val, "MaxSizeInMegabytes", &s.MaxSizeInMegabytes) - delete(rawMsg, key) - case "requiresDuplicateDetection": - err = unpopulate(val, "RequiresDuplicateDetection", &s.RequiresDuplicateDetection) - delete(rawMsg, key) - case "sizeInBytes": - err = unpopulate(val, "SizeInBytes", &s.SizeInBytes) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &s.Status) - delete(rawMsg, key) - case "subscriptionCount": - err = unpopulate(val, "SubscriptionCount", &s.SubscriptionCount) - delete(rawMsg, key) - case "supportOrdering": - err = unpopulate(val, "SupportOrdering", &s.SupportOrdering) - delete(rawMsg, key) - case "updatedAt": - err = unpopulateTimeRFC3339(val, "UpdatedAt", &s.UpdatedAt) - 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 SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "createdBy", s.CreatedBy) - populate(objectMap, "createdByType", s.CreatedByType) - populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) - populate(objectMap, "lastModifiedBy", s.LastModifiedBy) - populate(objectMap, "lastModifiedByType", s.LastModifiedByType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. -func (s *SystemData) 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 "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, "CreatedBy", &s.CreatedBy) - delete(rawMsg, key) - case "createdByType": - err = unpopulate(val, "CreatedByType", &s.CreatedByType) - delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) - delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) - delete(rawMsg, key) - case "lastModifiedByType": - err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) - 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 TrackedResource. -func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", t.ID) - populate(objectMap, "location", t.Location) - populate(objectMap, "name", t.Name) - populate(objectMap, "tags", t.Tags) - populate(objectMap, "type", t.Type) - 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 -}