diff --git a/sdk/resourcemanager/servicebus/armservicebus/CHANGELOG.md b/sdk/resourcemanager/servicebus/armservicebus/CHANGELOG.md index 374382f5caab..4d0d8247fd82 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/CHANGELOG.md +++ b/sdk/resourcemanager/servicebus/armservicebus/CHANGELOG.md @@ -1,5 +1,16 @@ # Release History +## 2.0.0-beta.2 (2023-02-02) +### Breaking Changes + +- Type of `Encryption.KeySource` has been changed from `*KeySource` to `*string` +- Type alias `KeySource` has been removed + +### Features Added + +- New field `PremiumMessagingPartitions` 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 96% rename from sdk/resourcemanager/servicebus/armservicebus/zz_generated_constants.go rename to sdk/resourcemanager/servicebus/armservicebus/constants.go index 37c14db45b59..055158a29913 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_constants.go +++ b/sdk/resourcemanager/servicebus/armservicebus/constants.go @@ -5,28 +5,29 @@ // 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 const ( - AccessRightsListen AccessRights = "Listen" AccessRightsManage AccessRights = "Manage" AccessRightsSend AccessRights = "Send" + AccessRightsListen AccessRights = "Listen" ) // PossibleAccessRightsValues returns the possible values for the AccessRights const type. func PossibleAccessRightsValues() []AccessRights { return []AccessRights{ - AccessRightsListen, AccessRightsManage, AccessRightsSend, + AccessRightsListen, } } @@ -124,29 +125,15 @@ func PossibleEntityStatusValues() []EntityStatus { type FilterType string const ( - FilterTypeCorrelationFilter FilterType = "CorrelationFilter" FilterTypeSQLFilter FilterType = "SqlFilter" + FilterTypeCorrelationFilter FilterType = "CorrelationFilter" ) // PossibleFilterTypeValues returns the possible values for the FilterType const type. func PossibleFilterTypeValues() []FilterType { return []FilterType{ - FilterTypeCorrelationFilter, FilterTypeSQLFilter, - } -} - -// KeySource - Enumerates the possible value of keySource for Encryption -type KeySource string - -const ( - KeySourceMicrosoftKeyVault KeySource = "Microsoft.KeyVault" -) - -// PossibleKeySourceValues returns the possible values for the KeySource const type. -func PossibleKeySourceValues() []KeySource { - return []KeySource{ - KeySourceMicrosoftKeyVault, + FilterTypeCorrelationFilter, } } @@ -170,19 +157,19 @@ func PossibleKeyTypeValues() []KeyType { type ManagedServiceIdentityType string const ( - ManagedServiceIdentityTypeNone ManagedServiceIdentityType = "None" ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = "SystemAssigned" - ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = "SystemAssigned, UserAssigned" ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = "UserAssigned" + ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = "SystemAssigned, UserAssigned" + ManagedServiceIdentityTypeNone ManagedServiceIdentityType = "None" ) // PossibleManagedServiceIdentityTypeValues returns the possible values for the ManagedServiceIdentityType const type. func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType { return []ManagedServiceIdentityType{ - ManagedServiceIdentityTypeNone, ManagedServiceIdentityTypeSystemAssigned, - ManagedServiceIdentityTypeSystemAssignedUserAssigned, ManagedServiceIdentityTypeUserAssigned, + ManagedServiceIdentityTypeSystemAssignedUserAssigned, + ManagedServiceIdentityTypeNone, } } @@ -239,16 +226,16 @@ type ProvisioningStateDR string const ( ProvisioningStateDRAccepted ProvisioningStateDR = "Accepted" - ProvisioningStateDRFailed ProvisioningStateDR = "Failed" ProvisioningStateDRSucceeded ProvisioningStateDR = "Succeeded" + ProvisioningStateDRFailed ProvisioningStateDR = "Failed" ) // PossibleProvisioningStateDRValues returns the possible values for the ProvisioningStateDR const type. func PossibleProvisioningStateDRValues() []ProvisioningStateDR { return []ProvisioningStateDR{ ProvisioningStateDRAccepted, - ProvisioningStateDRFailed, ProvisioningStateDRSucceeded, + ProvisioningStateDRFailed, } } @@ -309,16 +296,16 @@ type SKUName string const ( SKUNameBasic SKUName = "Basic" - SKUNamePremium SKUName = "Premium" SKUNameStandard SKUName = "Standard" + SKUNamePremium SKUName = "Premium" ) // PossibleSKUNameValues returns the possible values for the SKUName const type. func PossibleSKUNameValues() []SKUName { return []SKUName{ SKUNameBasic, - SKUNamePremium, SKUNameStandard, + SKUNamePremium, } } @@ -327,16 +314,16 @@ type SKUTier string const ( SKUTierBasic SKUTier = "Basic" - SKUTierPremium SKUTier = "Premium" SKUTierStandard SKUTier = "Standard" + SKUTierPremium SKUTier = "Premium" ) // PossibleSKUTierValues returns the possible values for the SKUTier const type. func PossibleSKUTierValues() []SKUTier { return []SKUTier{ SKUTierBasic, - SKUTierPremium, SKUTierStandard, + SKUTierPremium, } } @@ -362,22 +349,22 @@ func PossibleTLSVersionValues() []TLSVersion { type UnavailableReason string const ( - UnavailableReasonInvalidName UnavailableReason = "InvalidName" - UnavailableReasonNameInLockdown UnavailableReason = "NameInLockdown" - UnavailableReasonNameInUse UnavailableReason = "NameInUse" UnavailableReasonNone UnavailableReason = "None" + UnavailableReasonInvalidName UnavailableReason = "InvalidName" UnavailableReasonSubscriptionIsDisabled UnavailableReason = "SubscriptionIsDisabled" + UnavailableReasonNameInUse UnavailableReason = "NameInUse" + UnavailableReasonNameInLockdown UnavailableReason = "NameInLockdown" UnavailableReasonTooManyNamespaceInCurrentSubscription UnavailableReason = "TooManyNamespaceInCurrentSubscription" ) // PossibleUnavailableReasonValues returns the possible values for the UnavailableReason const type. func PossibleUnavailableReasonValues() []UnavailableReason { return []UnavailableReason{ - UnavailableReasonInvalidName, - UnavailableReasonNameInLockdown, - UnavailableReasonNameInUse, UnavailableReasonNone, + UnavailableReasonInvalidName, UnavailableReasonSubscriptionIsDisabled, + UnavailableReasonNameInUse, + UnavailableReasonNameInLockdown, UnavailableReasonTooManyNamespaceInCurrentSubscription, } } diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_disasterrecoveryconfigs_client.go b/sdk/resourcemanager/servicebus/armservicebus/disasterrecoveryconfigs_client.go similarity index 86% rename from sdk/resourcemanager/servicebus/armservicebus/zz_generated_disasterrecoveryconfigs_client.go rename to sdk/resourcemanager/servicebus/armservicebus/disasterrecoveryconfigs_client.go index ca08de18c167..1121fc551fb0 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 @@ -31,10 +32,10 @@ type DisasterRecoveryConfigsClient struct { } // NewDisasterRecoveryConfigsClient creates a new instance of DisasterRecoveryConfigsClient with the specified values. -// subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDisasterRecoveryConfigsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DisasterRecoveryConfigsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +58,13 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// alias - The Disaster Recovery configuration name -// options - DisasterRecoveryConfigsClientBreakPairingOptions contains the optional parameters for the DisasterRecoveryConfigsClient.BreakPairing -// method. +// +// 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 +// - options - DisasterRecoveryConfigsClientBreakPairingOptions contains the optional parameters for the DisasterRecoveryConfigsClient.BreakPairing +// method. func (client *DisasterRecoveryConfigsClient) BreakPairing(ctx context.Context, resourceGroupName string, namespaceName string, alias string, options *DisasterRecoveryConfigsClientBreakPairingOptions) (DisasterRecoveryConfigsClientBreakPairingResponse, error) { req, err := client.breakPairingCreateRequest(ctx, resourceGroupName, namespaceName, alias, options) if err != nil { @@ -102,7 +104,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,12 +112,13 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// parameters - Parameters to check availability of the given namespace name -// options - DisasterRecoveryConfigsClientCheckNameAvailabilityOptions contains the optional parameters for the DisasterRecoveryConfigsClient.CheckNameAvailability -// method. +// +// 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 +// - options - DisasterRecoveryConfigsClientCheckNameAvailabilityOptions contains the optional parameters for the DisasterRecoveryConfigsClient.CheckNameAvailability +// method. func (client *DisasterRecoveryConfigsClient) CheckNameAvailability(ctx context.Context, resourceGroupName string, namespaceName string, parameters CheckNameAvailability, options *DisasterRecoveryConfigsClientCheckNameAvailabilityOptions) (DisasterRecoveryConfigsClientCheckNameAvailabilityResponse, error) { req, err := client.checkNameAvailabilityCreateRequest(ctx, resourceGroupName, namespaceName, parameters, options) if err != nil { @@ -151,7 +154,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,13 +171,14 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// alias - The Disaster Recovery configuration name -// parameters - Parameters required to create an Alias(Disaster Recovery configuration) -// options - DisasterRecoveryConfigsClientCreateOrUpdateOptions contains the optional parameters for the DisasterRecoveryConfigsClient.CreateOrUpdate -// method. +// +// 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 +// - parameters - Parameters required to create an Alias(Disaster Recovery configuration) +// - options - DisasterRecoveryConfigsClientCreateOrUpdateOptions contains the optional parameters for the DisasterRecoveryConfigsClient.CreateOrUpdate +// method. func (client *DisasterRecoveryConfigsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, alias string, parameters ArmDisasterRecovery, options *DisasterRecoveryConfigsClientCreateOrUpdateOptions) (DisasterRecoveryConfigsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, namespaceName, alias, parameters, options) if err != nil { @@ -214,7 +218,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,12 +235,13 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// alias - The Disaster Recovery configuration name -// options - DisasterRecoveryConfigsClientDeleteOptions contains the optional parameters for the DisasterRecoveryConfigsClient.Delete -// method. +// +// 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 +// - options - DisasterRecoveryConfigsClientDeleteOptions contains the optional parameters for the DisasterRecoveryConfigsClient.Delete +// method. func (client *DisasterRecoveryConfigsClient) Delete(ctx context.Context, resourceGroupName string, namespaceName string, alias string, options *DisasterRecoveryConfigsClientDeleteOptions) (DisasterRecoveryConfigsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, namespaceName, alias, options) if err != nil { @@ -276,7 +281,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,12 +289,13 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// alias - The Disaster Recovery configuration name -// options - DisasterRecoveryConfigsClientFailOverOptions contains the optional parameters for the DisasterRecoveryConfigsClient.FailOver -// method. +// +// 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 +// - options - DisasterRecoveryConfigsClientFailOverOptions contains the optional parameters for the DisasterRecoveryConfigsClient.FailOver +// method. func (client *DisasterRecoveryConfigsClient) FailOver(ctx context.Context, resourceGroupName string, namespaceName string, alias string, options *DisasterRecoveryConfigsClientFailOverOptions) (DisasterRecoveryConfigsClientFailOverResponse, error) { req, err := client.failOverCreateRequest(ctx, resourceGroupName, namespaceName, alias, options) if err != nil { @@ -329,7 +335,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,12 +346,13 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// alias - The Disaster Recovery configuration name -// options - DisasterRecoveryConfigsClientGetOptions contains the optional parameters for the DisasterRecoveryConfigsClient.Get -// method. +// +// 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 +// - options - DisasterRecoveryConfigsClientGetOptions contains the optional parameters for the DisasterRecoveryConfigsClient.Get +// method. func (client *DisasterRecoveryConfigsClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, alias string, options *DisasterRecoveryConfigsClientGetOptions) (DisasterRecoveryConfigsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, namespaceName, alias, options) if err != nil { @@ -385,7 +392,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,13 +409,14 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// alias - The Disaster Recovery configuration name -// authorizationRuleName - The authorization rule name. -// options - DisasterRecoveryConfigsClientGetAuthorizationRuleOptions contains the optional parameters for the DisasterRecoveryConfigsClient.GetAuthorizationRule -// method. +// +// 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 +// - authorizationRuleName - The authorization rule name. +// - options - DisasterRecoveryConfigsClientGetAuthorizationRuleOptions contains the optional parameters for the DisasterRecoveryConfigsClient.GetAuthorizationRule +// method. func (client *DisasterRecoveryConfigsClient) GetAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, alias string, authorizationRuleName string, options *DisasterRecoveryConfigsClientGetAuthorizationRuleOptions) (DisasterRecoveryConfigsClientGetAuthorizationRuleResponse, error) { req, err := client.getAuthorizationRuleCreateRequest(ctx, resourceGroupName, namespaceName, alias, authorizationRuleName, options) if err != nil { @@ -452,7 +460,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,12 +476,12 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// options - DisasterRecoveryConfigsClientListOptions contains the optional parameters for the DisasterRecoveryConfigsClient.List -// method. +// +// 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.NewListPager +// method. func (client *DisasterRecoveryConfigsClient) NewListPager(resourceGroupName string, namespaceName string, options *DisasterRecoveryConfigsClientListOptions) *runtime.Pager[DisasterRecoveryConfigsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[DisasterRecoveryConfigsClientListResponse]{ More: func(page DisasterRecoveryConfigsClientListResponse) bool { @@ -522,7 +530,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,13 +546,13 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// alias - The Disaster Recovery configuration name -// options - DisasterRecoveryConfigsClientListAuthorizationRulesOptions contains the optional parameters for the DisasterRecoveryConfigsClient.ListAuthorizationRules -// method. +// +// 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 +// - options - DisasterRecoveryConfigsClientListAuthorizationRulesOptions contains the optional parameters for the DisasterRecoveryConfigsClient.NewListAuthorizationRulesPager +// method. func (client *DisasterRecoveryConfigsClient) NewListAuthorizationRulesPager(resourceGroupName string, namespaceName string, alias string, options *DisasterRecoveryConfigsClientListAuthorizationRulesOptions) *runtime.Pager[DisasterRecoveryConfigsClientListAuthorizationRulesResponse] { return runtime.NewPager(runtime.PagingHandler[DisasterRecoveryConfigsClientListAuthorizationRulesResponse]{ More: func(page DisasterRecoveryConfigsClientListAuthorizationRulesResponse) bool { @@ -597,7 +605,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,13 +622,14 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// alias - The Disaster Recovery configuration name -// authorizationRuleName - The authorization rule name. -// options - DisasterRecoveryConfigsClientListKeysOptions contains the optional parameters for the DisasterRecoveryConfigsClient.ListKeys -// method. +// +// 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 +// - authorizationRuleName - The authorization rule name. +// - options - DisasterRecoveryConfigsClientListKeysOptions contains the optional parameters for the DisasterRecoveryConfigsClient.ListKeys +// method. func (client *DisasterRecoveryConfigsClient) ListKeys(ctx context.Context, resourceGroupName string, namespaceName string, alias string, authorizationRuleName string, options *DisasterRecoveryConfigsClientListKeysOptions) (DisasterRecoveryConfigsClientListKeysResponse, error) { req, err := client.listKeysCreateRequest(ctx, resourceGroupName, namespaceName, alias, authorizationRuleName, options) if err != nil { @@ -664,7 +673,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/disasterrecoveryconfigs_live_test.go b/sdk/resourcemanager/servicebus/armservicebus/disasterrecoveryconfigs_live_test.go deleted file mode 100644 index 5dca6ea281f7..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/disasterrecoveryconfigs_live_test.go +++ /dev/null @@ -1,176 +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" - "fmt" - "testing" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" - "github.com/stretchr/testify/suite" -) - -type DisasterrecoveryconfigsTestSuite struct { - suite.Suite - - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - alias string - authorizationRuleName string - namespaceName string - primaryNamespaceId string - primaryNamespaceName string - location string - resourceGroupName string - subscriptionId string -} - -func (testsuite *DisasterrecoveryconfigsTestSuite) SetupSuite() { - testutil.StartRecording(testsuite.T(), "sdk/resourcemanager/servicebus/armservicebus/testdata") - testsuite.ctx = context.Background() - testsuite.cred, testsuite.options = testutil.GetCredAndClientOptions(testsuite.T()) - testsuite.alias = testutil.GenerateAlphaNumericID(testsuite.T(), "sbalias", 6) - testsuite.authorizationRuleName = testutil.GenerateAlphaNumericID(testsuite.T(), "sbauthrule", 6) - testsuite.namespaceName = testutil.GenerateAlphaNumericID(testsuite.T(), "sbnamespacedrc", 6) - testsuite.primaryNamespaceName = testutil.GenerateAlphaNumericID(testsuite.T(), "sbnamespacetwodrc", 6) - testsuite.location = testutil.GetEnv("LOCATION", "westus") - testsuite.resourceGroupName = testutil.GetEnv("RESOURCE_GROUP_NAME", "scenarioTestTempGroup") - testsuite.subscriptionId = testutil.GetEnv("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - - resourceGroup, _, err := testutil.CreateResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.location) - testsuite.Require().NoError(err) - testsuite.resourceGroupName = *resourceGroup.Name - testsuite.Prepare() -} - -func (testsuite *DisasterrecoveryconfigsTestSuite) TearDownSuite() { - _, err := testutil.DeleteResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName) - testsuite.Require().NoError(err) - testutil.StopRecording(testsuite.T()) -} - -func TestDisasterrecoveryconfigsTestSuite(t *testing.T) { - suite.Run(t, new(DisasterrecoveryconfigsTestSuite)) -} - -func (testsuite *DisasterrecoveryconfigsTestSuite) Prepare() { - var err error - // From step Namespace_Create - fmt.Println("Call operation: Namespaces_CreateOrUpdate") - namespacesClient, err := armservicebus.NewNamespacesClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - namespacesClientCreateOrUpdateResponsePoller, err := namespacesClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, armservicebus.SBNamespace{ - Location: to.Ptr(testsuite.location), - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - SKU: &armservicebus.SBSKU{ - Name: to.Ptr(armservicebus.SKUNamePremium), - Tier: to.Ptr(armservicebus.SKUTierPremium), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, namespacesClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) - - // From step Namespace_Create2 - fmt.Println("Call operation: Namespaces_Create") - namespacesClientCreateOrUpdateResponsePoller, err = namespacesClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.primaryNamespaceName, armservicebus.SBNamespace{ - Location: to.Ptr("westus2"), - SKU: &armservicebus.SBSKU{ - Name: to.Ptr(armservicebus.SKUNamePremium), - Tier: to.Ptr(armservicebus.SKUTierPremium), - }, - }, nil) - testsuite.Require().NoError(err) - var namespacesClientCreateOrUpdateResponse *armservicebus.NamespacesClientCreateOrUpdateResponse - namespacesClientCreateOrUpdateResponse, err = testutil.PollForTest(testsuite.ctx, namespacesClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) - testsuite.primaryNamespaceId = *namespacesClientCreateOrUpdateResponse.ID -} - -// Microsoft.ServiceBus/namespaces/disasterRecoveryConfigs -func (testsuite *DisasterrecoveryconfigsTestSuite) TestDisasterrecoveryconfig() { - var err error - // From step Namespace_CreateAuthorizationRule - fmt.Println("Call operation: Namespaces_CreateAuthorizationRule") - namespacesClient, err := armservicebus.NewNamespacesClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = namespacesClient.CreateOrUpdateAuthorizationRule(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.authorizationRuleName, armservicebus.SBAuthorizationRule{ - Properties: &armservicebus.SBAuthorizationRuleProperties{ - Rights: []*armservicebus.AccessRights{ - to.Ptr(armservicebus.AccessRightsListen), - to.Ptr(armservicebus.AccessRightsSend)}, - }, - }, nil) - testsuite.Require().NoError(err) - - // From step DisasterRecoveryConfig_CheckNameAvailability - fmt.Println("Call operation: DisasterRecoveryConfigs_CheckNameAvailability") - disasterRecoveryConfigsClient, err := armservicebus.NewDisasterRecoveryConfigsClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = disasterRecoveryConfigsClient.CheckNameAvailability(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, armservicebus.CheckNameAvailability{ - Name: to.Ptr("sdk-DisasterRecovery-9474"), - }, nil) - testsuite.Require().NoError(err) - - // From step DisasterRecoveryConfig_Create - fmt.Println("Call operation: DisasterRecoveryConfigs_Create") - _, err = disasterRecoveryConfigsClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.alias, armservicebus.ArmDisasterRecovery{ - Properties: &armservicebus.ArmDisasterRecoveryProperties{ - PartnerNamespace: to.Ptr(testsuite.primaryNamespaceId), - }, - }, nil) - testsuite.Require().NoError(err) - - // From step DisasterRecoveryConfig_Get - fmt.Println("Call operation: DisasterRecoveryConfigs_Get") - _, err = disasterRecoveryConfigsClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.alias, nil) - testsuite.Require().NoError(err) - - // From step DisasterRecoveryConfig_List - fmt.Println("Call operation: DisasterRecoveryConfigs_List") - disasterRecoveryConfigsClientNewListPager := disasterRecoveryConfigsClient.NewListPager(testsuite.resourceGroupName, testsuite.namespaceName, nil) - for disasterRecoveryConfigsClientNewListPager.More() { - _, err := disasterRecoveryConfigsClientNewListPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step DisasterRecoveryConfig_GetAuthorizationRule - fmt.Println("Call operation: DisasterRecoveryConfigs_GetAuthorizationRule") - _, err = disasterRecoveryConfigsClient.GetAuthorizationRule(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.alias, testsuite.authorizationRuleName, nil) - testsuite.Require().NoError(err) - - // From step DisasterRecoveryConfig_ListAuthorizationRules - fmt.Println("Call operation: DisasterRecoveryConfigs_ListAuthorizationRules") - disasterRecoveryConfigsClientNewListAuthorizationRulesPager := disasterRecoveryConfigsClient.NewListAuthorizationRulesPager(testsuite.resourceGroupName, testsuite.namespaceName, testsuite.alias, nil) - for disasterRecoveryConfigsClientNewListAuthorizationRulesPager.More() { - _, err := disasterRecoveryConfigsClientNewListAuthorizationRulesPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step DisasterRecoveryConfig_ListKeys - fmt.Println("Call operation: DisasterRecoveryConfigs_ListKeys") - _, err = disasterRecoveryConfigsClient.ListKeys(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.alias, testsuite.authorizationRuleName, nil) - testsuite.Require().NoError(err) - - // From step DisasterRecoveryConfig_FailOver - fmt.Println("Call operation: DisasterRecoveryConfigs_FailOver") - _, err = disasterRecoveryConfigsClient.FailOver(testsuite.ctx, testsuite.resourceGroupName, testsuite.primaryNamespaceName, testsuite.alias, &armservicebus.DisasterRecoveryConfigsClientFailOverOptions{Parameters: nil}) - testsuite.Require().NoError(err) -} diff --git a/sdk/resourcemanager/servicebus/armservicebus/go.mod b/sdk/resourcemanager/servicebus/armservicebus/go.mod index e8974730f53e..faabc5be108f 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/go.mod +++ b/sdk/resourcemanager/servicebus/armservicebus/go.mod @@ -2,28 +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.1.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.1 - github.com/stretchr/testify v1.7.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/dnaeon/go-vcr v1.1.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 - github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // 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.v2 v2.4.0 // 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 07096d31831b..fcd024b572be 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/go.sum +++ b/sdk/resourcemanager/servicebus/armservicebus/go.sum @@ -1,50 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.0 h1:Ut0ZGdOwJDw0npYEg+TLlPls3Pq6JiZaP2/aGKir7Zw= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.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/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.1 h1:BZOe7ExNYNGmapT91ZUrxtMYsqVljMxTHEnwjOdG7pk= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.1/go.mod h1:TSPEzbGHEgqFa3kUn09SpCrfKNbj7+mMulU/72Vg84E= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 h1:ECsQtyERDVz3NP3kvDOTLvbQhqWp/x9EsGKtb4ogUr8= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0/go.mod h1:s1tW/At+xHqjNFvWU4G0c0Qv33KOhvbGNj0RCTQDV8s= -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.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= -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/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= -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/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -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/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 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 85% rename from sdk/resourcemanager/servicebus/armservicebus/zz_generated_migrationconfigs_client.go rename to sdk/resourcemanager/servicebus/armservicebus/migrationconfigs_client.go index ffad3adad3e6..67334b53d76f 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 @@ -31,10 +32,10 @@ type MigrationConfigsClient struct { } // NewMigrationConfigsClient creates a new instance of MigrationConfigsClient with the specified values. -// subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewMigrationConfigsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MigrationConfigsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -59,12 +60,13 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// configName - The configuration name. Should always be "$default". -// options - MigrationConfigsClientCompleteMigrationOptions contains the optional parameters for the MigrationConfigsClient.CompleteMigration -// method. +// +// 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". +// - options - MigrationConfigsClientCompleteMigrationOptions contains the optional parameters for the MigrationConfigsClient.CompleteMigration +// method. func (client *MigrationConfigsClient) CompleteMigration(ctx context.Context, resourceGroupName string, namespaceName string, configName MigrationConfigurationName, options *MigrationConfigsClientCompleteMigrationOptions) (MigrationConfigsClientCompleteMigrationResponse, error) { req, err := client.completeMigrationCreateRequest(ctx, resourceGroupName, namespaceName, configName, options) if err != nil { @@ -104,7 +106,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,13 +115,14 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// configName - The configuration name. Should always be "$default". -// parameters - Parameters required to create Migration Configuration -// options - MigrationConfigsClientBeginCreateAndStartMigrationOptions contains the optional parameters for the MigrationConfigsClient.BeginCreateAndStartMigration -// method. +// +// 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". +// - parameters - Parameters required to create Migration Configuration +// - options - MigrationConfigsClientBeginCreateAndStartMigrationOptions contains the optional parameters for the MigrationConfigsClient.BeginCreateAndStartMigration +// method. func (client *MigrationConfigsClient) BeginCreateAndStartMigration(ctx context.Context, resourceGroupName string, namespaceName string, configName MigrationConfigurationName, parameters MigrationConfigProperties, options *MigrationConfigsClientBeginCreateAndStartMigrationOptions) (*runtime.Poller[MigrationConfigsClientCreateAndStartMigrationResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createAndStartMigration(ctx, resourceGroupName, namespaceName, configName, parameters, options) @@ -134,7 +137,8 @@ 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 +178,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,11 +186,12 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// configName - The configuration name. Should always be "$default". -// options - MigrationConfigsClientDeleteOptions contains the optional parameters for the MigrationConfigsClient.Delete method. +// +// 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". +// - options - MigrationConfigsClientDeleteOptions contains the optional parameters for the MigrationConfigsClient.Delete method. func (client *MigrationConfigsClient) Delete(ctx context.Context, resourceGroupName string, namespaceName string, configName MigrationConfigurationName, options *MigrationConfigsClientDeleteOptions) (MigrationConfigsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, namespaceName, configName, options) if err != nil { @@ -226,7 +231,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,11 +239,12 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// configName - The configuration name. Should always be "$default". -// options - MigrationConfigsClientGetOptions contains the optional parameters for the MigrationConfigsClient.Get method. +// +// 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". +// - options - MigrationConfigsClientGetOptions contains the optional parameters for the MigrationConfigsClient.Get method. func (client *MigrationConfigsClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, configName MigrationConfigurationName, options *MigrationConfigsClientGetOptions) (MigrationConfigsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, namespaceName, configName, options) if err != nil { @@ -278,7 +284,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,11 +300,12 @@ 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 -// 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. +// +// 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.NewListPager +// method. func (client *MigrationConfigsClient) NewListPager(resourceGroupName string, namespaceName string, options *MigrationConfigsClientListOptions) *runtime.Pager[MigrationConfigsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[MigrationConfigsClientListResponse]{ More: func(page MigrationConfigsClientListResponse) bool { @@ -347,7 +354,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,11 +371,12 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// configName - The configuration name. Should always be "$default". -// options - MigrationConfigsClientRevertOptions contains the optional parameters for the MigrationConfigsClient.Revert method. +// +// 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". +// - options - MigrationConfigsClientRevertOptions contains the optional parameters for the MigrationConfigsClient.Revert method. func (client *MigrationConfigsClient) Revert(ctx context.Context, resourceGroupName string, namespaceName string, configName MigrationConfigurationName, options *MigrationConfigsClientRevertOptions) (MigrationConfigsClientRevertResponse, error) { req, err := client.revertCreateRequest(ctx, resourceGroupName, namespaceName, configName, options) if err != nil { @@ -408,7 +416,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/migrationconfigs_live_test.go b/sdk/resourcemanager/servicebus/armservicebus/migrationconfigs_live_test.go deleted file mode 100644 index 7ec453d981c1..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/migrationconfigs_live_test.go +++ /dev/null @@ -1,143 +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" - "fmt" - "testing" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" - "github.com/stretchr/testify/suite" -) - -type MigrationconfigsTestSuite struct { - suite.Suite - - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - namespaceName string - namespaceName2 string - postMigrationName string - recondNamespaceId string - location string - resourceGroupName string - subscriptionId string -} - -func (testsuite *MigrationconfigsTestSuite) SetupSuite() { - testutil.StartRecording(testsuite.T(), "sdk/resourcemanager/servicebus/armservicebus/testdata") - testsuite.ctx = context.Background() - testsuite.cred, testsuite.options = testutil.GetCredAndClientOptions(testsuite.T()) - testsuite.namespaceName = testutil.GenerateAlphaNumericID(testsuite.T(), "sbnamespacemc", 6) - testsuite.namespaceName2 = testutil.GenerateAlphaNumericID(testsuite.T(), "sbnamespacetwomc", 6) - testsuite.postMigrationName = testutil.GenerateAlphaNumericID(testsuite.T(), "postmigrationna", 6) - testsuite.location = testutil.GetEnv("LOCATION", "westus") - testsuite.resourceGroupName = testutil.GetEnv("RESOURCE_GROUP_NAME", "scenarioTestTempGroup") - testsuite.subscriptionId = testutil.GetEnv("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - - resourceGroup, _, err := testutil.CreateResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.location) - testsuite.Require().NoError(err) - testsuite.resourceGroupName = *resourceGroup.Name - testsuite.Prepare() -} - -func (testsuite *MigrationconfigsTestSuite) TearDownSuite() { - _, err := testutil.DeleteResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName) - testsuite.Require().NoError(err) - testutil.StopRecording(testsuite.T()) -} - -func TestMigrationconfigsTestSuite(t *testing.T) { - suite.Run(t, new(MigrationconfigsTestSuite)) -} - -func (testsuite *MigrationconfigsTestSuite) Prepare() { - var err error - // From step Namespace_Create - fmt.Println("Call operation: Namespaces_CreateOrUpdate") - namespacesClient, err := armservicebus.NewNamespacesClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - namespacesClientCreateOrUpdateResponsePoller, err := namespacesClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, armservicebus.SBNamespace{ - Location: to.Ptr(testsuite.location), - 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) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, namespacesClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) - - // From step Namespace_Create2 - fmt.Println("Call operation: Namespaces_CreateOrUpdate") - namespacesClientCreateOrUpdateResponsePoller, err = namespacesClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName2, armservicebus.SBNamespace{ - Location: to.Ptr("westus2"), - SKU: &armservicebus.SBSKU{ - Name: to.Ptr(armservicebus.SKUNamePremium), - Tier: to.Ptr(armservicebus.SKUTierPremium), - }, - }, nil) - testsuite.Require().NoError(err) - var namespacesClientCreateOrUpdateResponse *armservicebus.NamespacesClientCreateOrUpdateResponse - namespacesClientCreateOrUpdateResponse, err = testutil.PollForTest(testsuite.ctx, namespacesClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) - testsuite.recondNamespaceId = *namespacesClientCreateOrUpdateResponse.ID -} - -// Microsoft.ServiceBus/namespaces/migrationConfigurations -func (testsuite *MigrationconfigsTestSuite) TestMigrationconfig() { - var err error - // From step MigrationConfig_Create - fmt.Println("Call operation: MigrationConfigs_Create") - migrationConfigsClient, err := armservicebus.NewMigrationConfigsClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - migrationConfigsClientCreateAndStartMigrationResponsePoller, err := migrationConfigsClient.BeginCreateAndStartMigration(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, armservicebus.MigrationConfigurationNameDefault, armservicebus.MigrationConfigProperties{ - Properties: &armservicebus.MigrationConfigPropertiesProperties{ - PostMigrationName: to.Ptr(testsuite.postMigrationName), - TargetNamespace: to.Ptr(testsuite.recondNamespaceId), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, migrationConfigsClientCreateAndStartMigrationResponsePoller) - testsuite.Require().NoError(err) - - // From step MigrationConfig_Get - fmt.Println("Call operation: MigrationConfigs_Get") - _, err = migrationConfigsClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, armservicebus.MigrationConfigurationNameDefault, nil) - testsuite.Require().NoError(err) - - // From step MigrationConfig_List - fmt.Println("Call operation: MigrationConfigs_List") - migrationConfigsClientNewListPager := migrationConfigsClient.NewListPager(testsuite.resourceGroupName, testsuite.namespaceName, nil) - for migrationConfigsClientNewListPager.More() { - _, err := migrationConfigsClientNewListPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step MigrationConfig_Revert - fmt.Println("Call operation: MigrationConfigs_Revert") - _, err = migrationConfigsClient.Revert(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, armservicebus.MigrationConfigurationNameDefault, nil) - testsuite.Require().NoError(err) - - // From step MigrationConfig_CompleteMigration - fmt.Println("Call operation: MigrationConfigs_CompleteMigration") - _, err = migrationConfigsClient.CompleteMigration(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, armservicebus.MigrationConfigurationNameDefault, nil) - testsuite.Require().NoError(err) -} diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_models.go b/sdk/resourcemanager/servicebus/armservicebus/models.go similarity index 97% rename from sdk/resourcemanager/servicebus/armservicebus/zz_generated_models.go rename to sdk/resourcemanager/servicebus/armservicebus/models.go index d55c108f78fd..087326b7725f 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 @@ -200,7 +201,7 @@ type DisasterRecoveryConfigsClientGetOptions struct { // placeholder for future optional parameters } -// DisasterRecoveryConfigsClientListAuthorizationRulesOptions contains the optional parameters for the DisasterRecoveryConfigsClient.ListAuthorizationRules +// DisasterRecoveryConfigsClientListAuthorizationRulesOptions contains the optional parameters for the DisasterRecoveryConfigsClient.NewListAuthorizationRulesPager // method. type DisasterRecoveryConfigsClientListAuthorizationRulesOptions struct { // placeholder for future optional parameters @@ -212,7 +213,8 @@ type DisasterRecoveryConfigsClientListKeysOptions struct { // placeholder for future optional parameters } -// DisasterRecoveryConfigsClientListOptions contains the optional parameters for the DisasterRecoveryConfigsClient.List method. +// DisasterRecoveryConfigsClientListOptions contains the optional parameters for the DisasterRecoveryConfigsClient.NewListPager +// method. type DisasterRecoveryConfigsClientListOptions struct { // placeholder for future optional parameters } @@ -220,7 +222,7 @@ type DisasterRecoveryConfigsClientListOptions struct { // Encryption - Properties to configure Encryption type Encryption struct { // Enumerates the possible value of keySource for Encryption - KeySource *KeySource `json:"keySource,omitempty"` + KeySource *string `json:"keySource,omitempty"` // Properties of KeyVault KeyVaultProperties []*KeyVaultProperties `json:"keyVaultProperties,omitempty"` @@ -232,7 +234,7 @@ type Encryption struct { // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. - Info interface{} `json:"info,omitempty" azure:"ro"` + Info any `json:"info,omitempty" azure:"ro"` // READ-ONLY; The additional info type. Type *string `json:"type,omitempty" azure:"ro"` @@ -395,7 +397,7 @@ type MigrationConfigsClientGetOptions struct { // placeholder for future optional parameters } -// MigrationConfigsClientListOptions contains the optional parameters for the MigrationConfigsClient.List method. +// MigrationConfigsClientListOptions contains the optional parameters for the MigrationConfigsClient.NewListPager method. type MigrationConfigsClientListOptions struct { // placeholder for future optional parameters } @@ -476,13 +478,13 @@ type NamespacesClientGetOptions struct { // placeholder for future optional parameters } -// NamespacesClientListAuthorizationRulesOptions contains the optional parameters for the NamespacesClient.ListAuthorizationRules +// NamespacesClientListAuthorizationRulesOptions contains the optional parameters for the NamespacesClient.NewListAuthorizationRulesPager // method. type NamespacesClientListAuthorizationRulesOptions struct { // placeholder for future optional parameters } -// NamespacesClientListByResourceGroupOptions contains the optional parameters for the NamespacesClient.ListByResourceGroup +// NamespacesClientListByResourceGroupOptions contains the optional parameters for the NamespacesClient.NewListByResourceGroupPager // method. type NamespacesClientListByResourceGroupOptions struct { // placeholder for future optional parameters @@ -493,13 +495,13 @@ type NamespacesClientListKeysOptions struct { // placeholder for future optional parameters } -// NamespacesClientListNetworkRuleSetsOptions contains the optional parameters for the NamespacesClient.ListNetworkRuleSets +// NamespacesClientListNetworkRuleSetsOptions contains the optional parameters for the NamespacesClient.NewListNetworkRuleSetsPager // method. type NamespacesClientListNetworkRuleSetsOptions struct { // placeholder for future optional parameters } -// NamespacesClientListOptions contains the optional parameters for the NamespacesClient.List method. +// NamespacesClientListOptions contains the optional parameters for the NamespacesClient.NewListPager method. type NamespacesClientListOptions struct { // placeholder for future optional parameters } @@ -574,7 +576,7 @@ type Operation struct { Origin *string `json:"origin,omitempty"` // Properties of the operation - Properties interface{} `json:"properties,omitempty"` + Properties any `json:"properties,omitempty"` // READ-ONLY; Operation name: {provider}/{resource}/{operation} Name *string `json:"name,omitempty" azure:"ro"` @@ -605,7 +607,7 @@ type OperationListResult struct { Value []*Operation `json:"value,omitempty" azure:"ro"` } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters } @@ -677,7 +679,7 @@ type PrivateEndpointConnectionsClientGetOptions struct { // placeholder for future optional parameters } -// PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.List +// PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListPager // method. type PrivateEndpointConnectionsClientListOptions struct { // placeholder for future optional parameters @@ -770,13 +772,13 @@ type QueuesClientGetOptions struct { // placeholder for future optional parameters } -// QueuesClientListAuthorizationRulesOptions contains the optional parameters for the QueuesClient.ListAuthorizationRules +// QueuesClientListAuthorizationRulesOptions contains the optional parameters for the QueuesClient.NewListAuthorizationRulesPager // method. type QueuesClientListAuthorizationRulesOptions struct { // placeholder for future optional parameters } -// QueuesClientListByNamespaceOptions contains the optional parameters for the QueuesClient.ListByNamespace method. +// QueuesClientListByNamespaceOptions contains the optional parameters for the QueuesClient.NewListByNamespacePager method. type QueuesClientListByNamespaceOptions struct { // Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, // the value of the nextLink element will include a skip parameter that specifies @@ -897,7 +899,8 @@ type RulesClientGetOptions struct { // placeholder for future optional parameters } -// RulesClientListBySubscriptionsOptions contains the optional parameters for the RulesClient.ListBySubscriptions method. +// RulesClientListBySubscriptionsOptions contains the optional parameters for the RulesClient.NewListBySubscriptionsPager +// method. type RulesClientListBySubscriptionsOptions struct { // Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, // the value of the nextLink element will include a skip parameter that specifies @@ -1008,6 +1011,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, 2 and 4 + PremiumMessagingPartitions *int32 `json:"premiumMessagingPartitions,omitempty"` + // List of private endpoint connections. PrivateEndpointConnections []*PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` @@ -1205,7 +1212,10 @@ type SBSKU struct { // REQUIRED; Name of this SKU. Name *SKUName `json:"name,omitempty"` - // The specified messaging units for the tier. For Premium tier, capacity are 1,2 and 4. + // Messaging units for your service bus premium namespace. Valid capacities are {1, 2, 4, 8, 16} multiples of your properties.premiumMessagingPartitions + // setting. For example, If + // properties.premiumMessagingPartitions is 1 then possible capacity values are 1, 2, 4, 8, and 16. If properties.premiumMessagingPartitions + // is 4 then possible capacity values are 4, 8, 16, 32 and 64 Capacity *int32 `json:"capacity,omitempty"` // The billing tier of this particular SKU. @@ -1437,7 +1447,8 @@ type SubscriptionsClientGetOptions struct { // placeholder for future optional parameters } -// SubscriptionsClientListByTopicOptions contains the optional parameters for the SubscriptionsClient.ListByTopic method. +// SubscriptionsClientListByTopicOptions contains the optional parameters for the SubscriptionsClient.NewListByTopicPager +// method. type SubscriptionsClientListByTopicOptions struct { // Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, // the value of the nextLink element will include a skip parameter that specifies @@ -1500,13 +1511,13 @@ type TopicsClientGetOptions struct { // placeholder for future optional parameters } -// TopicsClientListAuthorizationRulesOptions contains the optional parameters for the TopicsClient.ListAuthorizationRules +// TopicsClientListAuthorizationRulesOptions contains the optional parameters for the TopicsClient.NewListAuthorizationRulesPager // method. type TopicsClientListAuthorizationRulesOptions struct { // placeholder for future optional parameters } -// TopicsClientListByNamespaceOptions contains the optional parameters for the TopicsClient.ListByNamespace method. +// TopicsClientListByNamespaceOptions contains the optional parameters for the TopicsClient.NewListByNamespacePager method. type TopicsClientListByNamespaceOptions struct { // Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, // the value of the nextLink element will include a skip parameter that specifies diff --git a/sdk/resourcemanager/servicebus/armservicebus/models_serde.go b/sdk/resourcemanager/servicebus/armservicebus/models_serde.go new file mode 100644 index 000000000000..83dd3388e361 --- /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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + objectMap["keySource"] = "Microsoft.KeyVault" + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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, "premiumMessagingPartitions", s.PremiumMessagingPartitions) + 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 "premiumMessagingPartitions": + err = unpopulate(val, "PremiumMessagingPartitions", &s.PremiumMessagingPartitions) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any, k string, v any) { + 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 any) 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 87% rename from sdk/resourcemanager/servicebus/armservicebus/zz_generated_namespaces_client.go rename to sdk/resourcemanager/servicebus/armservicebus/namespaces_client.go index d74ca90f88bb..54109ebb7b8d 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 @@ -31,10 +32,10 @@ type NamespacesClient struct { } // NewNamespacesClient creates a new instance of NamespacesClient with the specified values. -// subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewNamespacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NamespacesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,10 +58,11 @@ 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 -// parameters - Parameters to check availability of the given namespace name -// options - NamespacesClientCheckNameAvailabilityOptions contains the optional parameters for the NamespacesClient.CheckNameAvailability -// method. +// +// 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. func (client *NamespacesClient) CheckNameAvailability(ctx context.Context, parameters CheckNameAvailability, options *NamespacesClientCheckNameAvailabilityOptions) (NamespacesClientCheckNameAvailabilityResponse, error) { req, err := client.checkNameAvailabilityCreateRequest(ctx, parameters, options) if err != nil { @@ -88,7 +90,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,12 +108,13 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name. -// parameters - Parameters supplied to create a namespace resource. -// options - NamespacesClientBeginCreateOrUpdateOptions contains the optional parameters for the NamespacesClient.BeginCreateOrUpdate -// method. +// +// 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. +// - options - NamespacesClientBeginCreateOrUpdateOptions contains the optional parameters for the NamespacesClient.BeginCreateOrUpdate +// method. func (client *NamespacesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, parameters SBNamespace, options *NamespacesClientBeginCreateOrUpdateOptions) (*runtime.Poller[NamespacesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, namespaceName, parameters, options) @@ -127,7 +130,8 @@ 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 +167,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,13 +175,14 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// authorizationRuleName - The authorization rule name. -// parameters - The shared access authorization rule. -// options - NamespacesClientCreateOrUpdateAuthorizationRuleOptions contains the optional parameters for the NamespacesClient.CreateOrUpdateAuthorizationRule -// method. +// +// 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. +// - parameters - The shared access authorization rule. +// - options - NamespacesClientCreateOrUpdateAuthorizationRuleOptions contains the optional parameters for the NamespacesClient.CreateOrUpdateAuthorizationRule +// method. func (client *NamespacesClient) CreateOrUpdateAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, parameters SBAuthorizationRule, options *NamespacesClientCreateOrUpdateAuthorizationRuleOptions) (NamespacesClientCreateOrUpdateAuthorizationRuleResponse, error) { req, err := client.createOrUpdateAuthorizationRuleCreateRequest(ctx, resourceGroupName, namespaceName, authorizationRuleName, parameters, options) if err != nil { @@ -217,7 +222,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,12 +239,13 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// parameters - The Namespace IpFilterRule. -// options - NamespacesClientCreateOrUpdateNetworkRuleSetOptions contains the optional parameters for the NamespacesClient.CreateOrUpdateNetworkRuleSet -// method. +// +// 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. +// - options - NamespacesClientCreateOrUpdateNetworkRuleSetOptions contains the optional parameters for the NamespacesClient.CreateOrUpdateNetworkRuleSet +// method. func (client *NamespacesClient) CreateOrUpdateNetworkRuleSet(ctx context.Context, resourceGroupName string, namespaceName string, parameters NetworkRuleSet, options *NamespacesClientCreateOrUpdateNetworkRuleSetOptions) (NamespacesClientCreateOrUpdateNetworkRuleSetResponse, error) { req, err := client.createOrUpdateNetworkRuleSetCreateRequest(ctx, resourceGroupName, namespaceName, parameters, options) if err != nil { @@ -275,7 +281,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,10 +298,11 @@ 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 -// 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. +// +// 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. func (client *NamespacesClient) BeginDelete(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespacesClientBeginDeleteOptions) (*runtime.Poller[NamespacesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, namespaceName, options) @@ -310,7 +317,8 @@ 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 +354,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,12 +362,13 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// authorizationRuleName - The authorization rule name. -// options - NamespacesClientDeleteAuthorizationRuleOptions contains the optional parameters for the NamespacesClient.DeleteAuthorizationRule -// method. +// +// 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. +// - options - NamespacesClientDeleteAuthorizationRuleOptions contains the optional parameters for the NamespacesClient.DeleteAuthorizationRule +// method. func (client *NamespacesClient) DeleteAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, options *NamespacesClientDeleteAuthorizationRuleOptions) (NamespacesClientDeleteAuthorizationRuleResponse, error) { req, err := client.deleteAuthorizationRuleCreateRequest(ctx, resourceGroupName, namespaceName, authorizationRuleName, options) if err != nil { @@ -399,7 +408,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,10 +416,11 @@ 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 -// 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. +// +// 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. func (client *NamespacesClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespacesClientGetOptions) (NamespacesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, namespaceName, options) if err != nil { @@ -446,7 +456,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,12 +473,13 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// authorizationRuleName - The authorization rule name. -// options - NamespacesClientGetAuthorizationRuleOptions contains the optional parameters for the NamespacesClient.GetAuthorizationRule -// method. +// +// 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. +// - options - NamespacesClientGetAuthorizationRuleOptions contains the optional parameters for the NamespacesClient.GetAuthorizationRule +// method. func (client *NamespacesClient) GetAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, options *NamespacesClientGetAuthorizationRuleOptions) (NamespacesClientGetAuthorizationRuleResponse, error) { req, err := client.getAuthorizationRuleCreateRequest(ctx, resourceGroupName, namespaceName, authorizationRuleName, options) if err != nil { @@ -508,7 +519,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,11 +536,12 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// options - NamespacesClientGetNetworkRuleSetOptions contains the optional parameters for the NamespacesClient.GetNetworkRuleSet -// method. +// +// 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 +// method. func (client *NamespacesClient) GetNetworkRuleSet(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespacesClientGetNetworkRuleSetOptions) (NamespacesClientGetNetworkRuleSetResponse, error) { req, err := client.getNetworkRuleSetCreateRequest(ctx, resourceGroupName, namespaceName, options) if err != nil { @@ -565,7 +577,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,9 +593,9 @@ 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 -// options - NamespacesClientListOptions contains the optional parameters for the NamespacesClient.List method. +// +// Generated from API version 2022-10-01-preview +// - options - NamespacesClientListOptions contains the optional parameters for the NamespacesClient.NewListPager method. func (client *NamespacesClient) NewListPager(options *NamespacesClientListOptions) *runtime.Pager[NamespacesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[NamespacesClientListResponse]{ More: func(page NamespacesClientListResponse) bool { @@ -624,7 +636,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,12 +652,12 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// options - NamespacesClientListAuthorizationRulesOptions contains the optional parameters for the NamespacesClient.ListAuthorizationRules -// method. +// +// 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.NewListAuthorizationRulesPager +// method. func (client *NamespacesClient) NewListAuthorizationRulesPager(resourceGroupName string, namespaceName string, options *NamespacesClientListAuthorizationRulesOptions) *runtime.Pager[NamespacesClientListAuthorizationRulesResponse] { return runtime.NewPager(runtime.PagingHandler[NamespacesClientListAuthorizationRulesResponse]{ More: func(page NamespacesClientListAuthorizationRulesResponse) bool { @@ -694,7 +706,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,11 +722,11 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// options - NamespacesClientListByResourceGroupOptions contains the optional parameters for the NamespacesClient.ListByResourceGroup -// method. +// +// 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.NewListByResourceGroupPager +// method. func (client *NamespacesClient) NewListByResourceGroupPager(resourceGroupName string, options *NamespacesClientListByResourceGroupOptions) *runtime.Pager[NamespacesClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[NamespacesClientListByResourceGroupResponse]{ More: func(page NamespacesClientListByResourceGroupResponse) bool { @@ -759,7 +771,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,11 +788,12 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// authorizationRuleName - The authorization rule name. -// options - NamespacesClientListKeysOptions contains the optional parameters for the NamespacesClient.ListKeys method. +// +// 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. +// - options - NamespacesClientListKeysOptions contains the optional parameters for the NamespacesClient.ListKeys method. func (client *NamespacesClient) ListKeys(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, options *NamespacesClientListKeysOptions) (NamespacesClientListKeysResponse, error) { req, err := client.listKeysCreateRequest(ctx, resourceGroupName, namespaceName, authorizationRuleName, options) if err != nil { @@ -820,7 +833,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,12 +849,12 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// options - NamespacesClientListNetworkRuleSetsOptions contains the optional parameters for the NamespacesClient.ListNetworkRuleSets -// method. +// +// 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.NewListNetworkRuleSetsPager +// method. func (client *NamespacesClient) NewListNetworkRuleSetsPager(resourceGroupName string, namespaceName string, options *NamespacesClientListNetworkRuleSetsOptions) *runtime.Pager[NamespacesClientListNetworkRuleSetsResponse] { return runtime.NewPager(runtime.PagingHandler[NamespacesClientListNetworkRuleSetsResponse]{ More: func(page NamespacesClientListNetworkRuleSetsResponse) bool { @@ -890,7 +903,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,13 +920,14 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// authorizationRuleName - The authorization rule name. -// parameters - Parameters supplied to regenerate the authorization rule. -// options - NamespacesClientRegenerateKeysOptions contains the optional parameters for the NamespacesClient.RegenerateKeys -// method. +// +// 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. +// - parameters - Parameters supplied to regenerate the authorization rule. +// - options - NamespacesClientRegenerateKeysOptions contains the optional parameters for the NamespacesClient.RegenerateKeys +// method. func (client *NamespacesClient) RegenerateKeys(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, parameters RegenerateAccessKeyParameters, options *NamespacesClientRegenerateKeysOptions) (NamespacesClientRegenerateKeysResponse, error) { req, err := client.regenerateKeysCreateRequest(ctx, resourceGroupName, namespaceName, authorizationRuleName, parameters, options) if err != nil { @@ -953,7 +967,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,11 +985,12 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// parameters - Parameters supplied to update a namespace resource. -// options - NamespacesClientUpdateOptions contains the optional parameters for the NamespacesClient.Update method. +// +// 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. +// - options - NamespacesClientUpdateOptions contains the optional parameters for the NamespacesClient.Update method. func (client *NamespacesClient) Update(ctx context.Context, resourceGroupName string, namespaceName string, parameters SBNamespaceUpdateParameters, options *NamespacesClientUpdateOptions) (NamespacesClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, namespaceName, parameters, options) if err != nil { @@ -1011,7 +1026,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/namespaces_live_test.go b/sdk/resourcemanager/servicebus/armservicebus/namespaces_live_test.go deleted file mode 100644 index e4d59de66a63..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/namespaces_live_test.go +++ /dev/null @@ -1,198 +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" - "fmt" - "testing" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" - "github.com/stretchr/testify/suite" -) - -type NamespacesTestSuite struct { - suite.Suite - - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - authorizationRuleName string - namespaceName string - location string - resourceGroupName string - subscriptionId string -} - -func (testsuite *NamespacesTestSuite) SetupSuite() { - testutil.StartRecording(testsuite.T(), "sdk/resourcemanager/servicebus/armservicebus/testdata") - testsuite.ctx = context.Background() - testsuite.cred, testsuite.options = testutil.GetCredAndClientOptions(testsuite.T()) - testsuite.authorizationRuleName = testutil.GenerateAlphaNumericID(testsuite.T(), "sbauthrule", 6) - testsuite.namespaceName = testutil.GenerateAlphaNumericID(testsuite.T(), "sbnamespace", 6) - testsuite.location = testutil.GetEnv("LOCATION", "westus") - testsuite.resourceGroupName = testutil.GetEnv("RESOURCE_GROUP_NAME", "scenarioTestTempGroup") - testsuite.subscriptionId = testutil.GetEnv("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - - resourceGroup, _, err := testutil.CreateResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.location) - testsuite.Require().NoError(err) - testsuite.resourceGroupName = *resourceGroup.Name -} - -func (testsuite *NamespacesTestSuite) TearDownSuite() { - _, err := testutil.DeleteResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName) - testsuite.Require().NoError(err) - testutil.StopRecording(testsuite.T()) -} - -func TestNamespacesTestSuite(t *testing.T) { - suite.Run(t, new(NamespacesTestSuite)) -} - -// Microsoft.ServiceBus/namespaces -func (testsuite *NamespacesTestSuite) TestNamespace() { - var err error - // From step Namespace_CheckNameAvailability - fmt.Println("Call operation: Namespaces_CheckNameAvailability") - namespacesClient, err := armservicebus.NewNamespacesClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = namespacesClient.CheckNameAvailability(testsuite.ctx, armservicebus.CheckNameAvailability{ - Name: to.Ptr(testsuite.namespaceName), - }, nil) - testsuite.Require().NoError(err) - - // From step Namespace_Create - fmt.Println("Call operation: Namespaces_CreateOrUpdate") - namespacesClientCreateOrUpdateResponsePoller, err := namespacesClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, armservicebus.SBNamespace{ - Location: to.Ptr(testsuite.location), - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - SKU: &armservicebus.SBSKU{ - Name: to.Ptr(armservicebus.SKUNamePremium), - Tier: to.Ptr(armservicebus.SKUTierPremium), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, namespacesClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) - - // From step Namespace_Update - fmt.Println("Call operation: Namespaces_Update") - _, err = namespacesClient.Update(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, armservicebus.SBNamespaceUpdateParameters{ - Location: to.Ptr(testsuite.location), - Tags: map[string]*string{ - "tag3": to.Ptr("value3"), - "tag4": to.Ptr("value4"), - }, - }, nil) - testsuite.Require().NoError(err) - - // From step Namespace_Get - fmt.Println("Call operation: Namespaces_Get") - _, err = namespacesClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, nil) - testsuite.Require().NoError(err) - - // From step Namespace_List - fmt.Println("Call operation: Namespaces_List") - namespacesClientNewListPager := namespacesClient.NewListPager(nil) - for namespacesClientNewListPager.More() { - _, err := namespacesClientNewListPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Namespace_ListByResourceGroup - fmt.Println("Call operation: Namespaces_ListByResourceGroup") - namespacesClientNewListByResourceGroupPager := namespacesClient.NewListByResourceGroupPager(testsuite.resourceGroupName, nil) - for namespacesClientNewListByResourceGroupPager.More() { - _, err := namespacesClientNewListByResourceGroupPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Operation_List - fmt.Println("Call operation: Operations_List") - operationsClient, err := armservicebus.NewOperationsClient(testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - operationsClientNewListPager := operationsClient.NewListPager(nil) - for operationsClientNewListPager.More() { - _, err := operationsClientNewListPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Namespace_CreateAuthorizationRule - fmt.Println("Call operation: Namespaces_CreateOrUpdateAuthorizationRule") - _, err = namespacesClient.CreateOrUpdateAuthorizationRule(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.authorizationRuleName, armservicebus.SBAuthorizationRule{ - Properties: &armservicebus.SBAuthorizationRuleProperties{ - Rights: []*armservicebus.AccessRights{ - to.Ptr(armservicebus.AccessRightsListen), - to.Ptr(armservicebus.AccessRightsSend)}, - }, - }, nil) - testsuite.Require().NoError(err) - - // From step Namespace_GetAuthorizationRule - fmt.Println("Call operation: Namespaces_GetAuthorizationRule") - _, err = namespacesClient.GetAuthorizationRule(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.authorizationRuleName, nil) - testsuite.Require().NoError(err) - - // From step Namespace_ListAuthorizationRules - fmt.Println("Call operation: Namespaces_ListAuthorizationRules") - namespacesClientNewListAuthorizationRulesPager := namespacesClient.NewListAuthorizationRulesPager(testsuite.resourceGroupName, testsuite.namespaceName, nil) - for namespacesClientNewListAuthorizationRulesPager.More() { - _, err := namespacesClientNewListAuthorizationRulesPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Namespace_RegenerateKeys - fmt.Println("Call operation: Namespaces_RegenerateKeys") - _, err = namespacesClient.RegenerateKeys(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.authorizationRuleName, armservicebus.RegenerateAccessKeyParameters{ - KeyType: to.Ptr(armservicebus.KeyTypePrimaryKey), - }, nil) - testsuite.Require().NoError(err) - - // From step Namespace_ListKeys - fmt.Println("Call operation: Namespaces_ListKeys") - _, err = namespacesClient.ListKeys(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.authorizationRuleName, nil) - testsuite.Require().NoError(err) - - // From step Namespace_GetNetworkRuleSet - fmt.Println("Call operation: Namespaces_GetNetworkRuleSet") - _, err = namespacesClient.GetNetworkRuleSet(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, nil) - testsuite.Require().NoError(err) - - // From step Namespace_ListNetworkRuleSets - fmt.Println("Call operation: Namespaces_ListNetworkRuleSets") - namespacesClientNewListNetworkRuleSetsPager := namespacesClient.NewListNetworkRuleSetsPager(testsuite.resourceGroupName, testsuite.namespaceName, nil) - for namespacesClientNewListNetworkRuleSetsPager.More() { - _, err := namespacesClientNewListNetworkRuleSetsPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Namespace_DeleteAuthorizationRule - fmt.Println("Call operation: Namespaces_DeleteAuthorizationRule") - _, err = namespacesClient.DeleteAuthorizationRule(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.authorizationRuleName, nil) - testsuite.Require().NoError(err) - - // From step Namespace_Delete - fmt.Println("Call operation: Namespaces_Delete") - namespacesClientDeleteResponsePoller, err := namespacesClient.BeginDelete(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, namespacesClientDeleteResponsePoller) - testsuite.Require().NoError(err) -} diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_operations_client.go b/sdk/resourcemanager/servicebus/armservicebus/operations_client.go similarity index 89% rename from sdk/resourcemanager/servicebus/armservicebus/zz_generated_operations_client.go rename to sdk/resourcemanager/servicebus/armservicebus/operations_client.go index 4e923bb8e0cf..e7c8cb85cb16 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 @@ -27,8 +28,8 @@ type OperationsClient struct { } // NewOperationsClient creates a new instance of OperationsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -49,9 +50,9 @@ 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 -// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// +// Generated from API version 2022-10-01-preview +// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ More: func(page OperationsClientListResponse) bool { @@ -88,7 +89,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 86% rename from sdk/resourcemanager/servicebus/armservicebus/zz_generated_privateendpointconnections_client.go rename to sdk/resourcemanager/servicebus/armservicebus/privateendpointconnections_client.go index 586b28922785..c7a2619f4a3e 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 @@ -31,10 +32,10 @@ type PrivateEndpointConnectionsClient struct { } // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values. -// subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,13 +58,14 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// privateEndpointConnectionName - The PrivateEndpointConnection name -// parameters - Parameters supplied to update Status of PrivateEndPoint Connection to namespace resource. -// options - PrivateEndpointConnectionsClientCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.CreateOrUpdate -// method. +// +// 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 +// - parameters - Parameters supplied to update Status of PrivateEndPoint Connection to namespace resource. +// - options - PrivateEndpointConnectionsClientCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.CreateOrUpdate +// method. func (client *PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientCreateOrUpdateOptions) (PrivateEndpointConnectionsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, namespaceName, privateEndpointConnectionName, parameters, options) if err != nil { @@ -73,7 +75,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 +105,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,12 +122,13 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// privateEndpointConnectionName - The PrivateEndpointConnection name -// options - PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete -// method. +// +// 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 +// - options - PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete +// method. func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, namespaceName, privateEndpointConnectionName, options) @@ -140,7 +143,8 @@ 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 +184,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,12 +192,13 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// privateEndpointConnectionName - The PrivateEndpointConnection name -// options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get -// method. +// +// 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 +// - options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get +// method. func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, namespaceName, privateEndpointConnectionName, options) if err != nil { @@ -233,7 +238,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,12 +254,12 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.List -// method. +// +// 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.NewListPager +// method. func (client *PrivateEndpointConnectionsClient) NewListPager(resourceGroupName string, namespaceName string, options *PrivateEndpointConnectionsClientListOptions) *runtime.Pager[PrivateEndpointConnectionsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[PrivateEndpointConnectionsClientListResponse]{ More: func(page PrivateEndpointConnectionsClientListResponse) bool { @@ -303,7 +308,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 85% rename from sdk/resourcemanager/servicebus/armservicebus/zz_generated_privatelinkresources_client.go rename to sdk/resourcemanager/servicebus/armservicebus/privatelinkresources_client.go index 1baddbf9c02e..332e1d71217a 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 @@ -31,10 +32,10 @@ type PrivateLinkResourcesClient struct { } // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values. -// subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +58,12 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// options - PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get -// method. +// +// 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 +// method. func (client *PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, options *PrivateLinkResourcesClientGetOptions) (PrivateLinkResourcesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, namespaceName, options) if err != nil { @@ -97,7 +99,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 86% rename from sdk/resourcemanager/servicebus/armservicebus/zz_generated_queues_client.go rename to sdk/resourcemanager/servicebus/armservicebus/queues_client.go index cda67835859a..2e85f52bd4c3 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 @@ -32,10 +33,10 @@ type QueuesClient struct { } // NewQueuesClient creates a new instance of QueuesClient with the specified values. -// subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewQueuesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*QueuesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +59,13 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// queueName - The queue name. -// parameters - Parameters supplied to create or update a queue resource. -// options - QueuesClientCreateOrUpdateOptions contains the optional parameters for the QueuesClient.CreateOrUpdate method. +// +// 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. +// - parameters - Parameters supplied to create or update a queue resource. +// - options - QueuesClientCreateOrUpdateOptions contains the optional parameters for the QueuesClient.CreateOrUpdate method. func (client *QueuesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, parameters SBQueue, options *QueuesClientCreateOrUpdateOptions) (QueuesClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, namespaceName, queueName, parameters, options) if err != nil { @@ -103,7 +105,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,14 +122,15 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// queueName - The queue name. -// authorizationRuleName - The authorization rule name. -// parameters - The shared access authorization rule. -// options - QueuesClientCreateOrUpdateAuthorizationRuleOptions contains the optional parameters for the QueuesClient.CreateOrUpdateAuthorizationRule -// method. +// +// 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. +// - authorizationRuleName - The authorization rule name. +// - parameters - The shared access authorization rule. +// - options - QueuesClientCreateOrUpdateAuthorizationRuleOptions contains the optional parameters for the QueuesClient.CreateOrUpdateAuthorizationRule +// method. func (client *QueuesClient) CreateOrUpdateAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string, parameters SBAuthorizationRule, options *QueuesClientCreateOrUpdateAuthorizationRuleOptions) (QueuesClientCreateOrUpdateAuthorizationRuleResponse, error) { req, err := client.createOrUpdateAuthorizationRuleCreateRequest(ctx, resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters, options) if err != nil { @@ -171,7 +174,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,11 +191,12 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// queueName - The queue name. -// options - QueuesClientDeleteOptions contains the optional parameters for the QueuesClient.Delete method. +// +// 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. +// - options - QueuesClientDeleteOptions contains the optional parameters for the QueuesClient.Delete method. func (client *QueuesClient) Delete(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, options *QueuesClientDeleteOptions) (QueuesClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, namespaceName, queueName, options) if err != nil { @@ -232,7 +236,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,13 +244,14 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// queueName - The queue name. -// authorizationRuleName - The authorization rule name. -// options - QueuesClientDeleteAuthorizationRuleOptions contains the optional parameters for the QueuesClient.DeleteAuthorizationRule -// method. +// +// 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. +// - authorizationRuleName - The authorization rule name. +// - options - QueuesClientDeleteAuthorizationRuleOptions contains the optional parameters for the QueuesClient.DeleteAuthorizationRule +// method. func (client *QueuesClient) DeleteAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string, options *QueuesClientDeleteAuthorizationRuleOptions) (QueuesClientDeleteAuthorizationRuleResponse, error) { req, err := client.deleteAuthorizationRuleCreateRequest(ctx, resourceGroupName, namespaceName, queueName, authorizationRuleName, options) if err != nil { @@ -290,7 +295,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,11 +303,12 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// queueName - The queue name. -// options - QueuesClientGetOptions contains the optional parameters for the QueuesClient.Get method. +// +// 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. +// - options - QueuesClientGetOptions contains the optional parameters for the QueuesClient.Get method. func (client *QueuesClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, options *QueuesClientGetOptions) (QueuesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, namespaceName, queueName, options) if err != nil { @@ -342,7 +348,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,13 +365,14 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// queueName - The queue name. -// authorizationRuleName - The authorization rule name. -// options - QueuesClientGetAuthorizationRuleOptions contains the optional parameters for the QueuesClient.GetAuthorizationRule -// method. +// +// 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. +// - authorizationRuleName - The authorization rule name. +// - options - QueuesClientGetAuthorizationRuleOptions contains the optional parameters for the QueuesClient.GetAuthorizationRule +// method. func (client *QueuesClient) GetAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string, options *QueuesClientGetAuthorizationRuleOptions) (QueuesClientGetAuthorizationRuleResponse, error) { req, err := client.getAuthorizationRuleCreateRequest(ctx, resourceGroupName, namespaceName, queueName, authorizationRuleName, options) if err != nil { @@ -409,7 +416,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,13 +432,13 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// queueName - The queue name. -// options - QueuesClientListAuthorizationRulesOptions contains the optional parameters for the QueuesClient.ListAuthorizationRules -// method. +// +// 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. +// - options - QueuesClientListAuthorizationRulesOptions contains the optional parameters for the QueuesClient.NewListAuthorizationRulesPager +// method. func (client *QueuesClient) NewListAuthorizationRulesPager(resourceGroupName string, namespaceName string, queueName string, options *QueuesClientListAuthorizationRulesOptions) *runtime.Pager[QueuesClientListAuthorizationRulesResponse] { return runtime.NewPager(runtime.PagingHandler[QueuesClientListAuthorizationRulesResponse]{ More: func(page QueuesClientListAuthorizationRulesResponse) bool { @@ -484,7 +491,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,11 +507,12 @@ 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 -// 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. +// +// 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.NewListByNamespacePager +// method. func (client *QueuesClient) NewListByNamespacePager(resourceGroupName string, namespaceName string, options *QueuesClientListByNamespaceOptions) *runtime.Pager[QueuesClientListByNamespaceResponse] { return runtime.NewPager(runtime.PagingHandler[QueuesClientListByNamespaceResponse]{ More: func(page QueuesClientListByNamespaceResponse) bool { @@ -553,7 +561,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,12 +584,13 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// queueName - The queue name. -// authorizationRuleName - The authorization rule name. -// options - QueuesClientListKeysOptions contains the optional parameters for the QueuesClient.ListKeys method. +// +// 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. +// - authorizationRuleName - The authorization rule name. +// - options - QueuesClientListKeysOptions contains the optional parameters for the QueuesClient.ListKeys method. func (client *QueuesClient) ListKeys(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string, options *QueuesClientListKeysOptions) (QueuesClientListKeysResponse, error) { req, err := client.listKeysCreateRequest(ctx, resourceGroupName, namespaceName, queueName, authorizationRuleName, options) if err != nil { @@ -625,7 +634,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,13 +651,14 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// queueName - The queue name. -// authorizationRuleName - The authorization rule name. -// parameters - Parameters supplied to regenerate the authorization rule. -// options - QueuesClientRegenerateKeysOptions contains the optional parameters for the QueuesClient.RegenerateKeys method. +// +// 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. +// - authorizationRuleName - The authorization rule name. +// - parameters - Parameters supplied to regenerate the authorization rule. +// - options - QueuesClientRegenerateKeysOptions contains the optional parameters for the QueuesClient.RegenerateKeys method. func (client *QueuesClient) RegenerateKeys(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string, parameters RegenerateAccessKeyParameters, options *QueuesClientRegenerateKeysOptions) (QueuesClientRegenerateKeysResponse, error) { req, err := client.regenerateKeysCreateRequest(ctx, resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters, options) if err != nil { @@ -692,7 +702,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/queues_live_test.go b/sdk/resourcemanager/servicebus/armservicebus/queues_live_test.go deleted file mode 100644 index f9856b435b6a..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/queues_live_test.go +++ /dev/null @@ -1,176 +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" - "fmt" - "testing" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" - "github.com/stretchr/testify/suite" -) - -type QueuesTestSuite struct { - suite.Suite - - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - authorizationRuleName string - namespaceName string - queueName string - location string - resourceGroupName string - subscriptionId string -} - -func (testsuite *QueuesTestSuite) SetupSuite() { - testutil.StartRecording(testsuite.T(), "sdk/resourcemanager/servicebus/armservicebus/testdata") - testsuite.ctx = context.Background() - testsuite.cred, testsuite.options = testutil.GetCredAndClientOptions(testsuite.T()) - testsuite.authorizationRuleName = testutil.GenerateAlphaNumericID(testsuite.T(), "queueauthrule", 6) - testsuite.namespaceName = testutil.GenerateAlphaNumericID(testsuite.T(), "sbnamespaceq", 6) - testsuite.queueName = testutil.GenerateAlphaNumericID(testsuite.T(), "queuena", 6) - testsuite.location = testutil.GetEnv("LOCATION", "westus") - testsuite.resourceGroupName = testutil.GetEnv("RESOURCE_GROUP_NAME", "scenarioTestTempGroup") - testsuite.subscriptionId = testutil.GetEnv("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - - resourceGroup, _, err := testutil.CreateResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.location) - testsuite.Require().NoError(err) - testsuite.resourceGroupName = *resourceGroup.Name - testsuite.Prepare() -} - -func (testsuite *QueuesTestSuite) TearDownSuite() { - testsuite.Cleanup() - _, err := testutil.DeleteResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName) - testsuite.Require().NoError(err) - testutil.StopRecording(testsuite.T()) -} - -func TestQueuesTestSuite(t *testing.T) { - suite.Run(t, new(QueuesTestSuite)) -} - -func (testsuite *QueuesTestSuite) Prepare() { - var err error - // From step Namespace_Create - fmt.Println("Call operation: Namespaces_Create") - namespacesClient, err := armservicebus.NewNamespacesClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - namespacesClientCreateOrUpdateResponsePoller, err := namespacesClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, armservicebus.SBNamespace{ - Location: to.Ptr(testsuite.location), - 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) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, namespacesClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) -} - -// Microsoft.ServiceBus/namespaces/queues -func (testsuite *QueuesTestSuite) TestQueue() { - var err error - // From step Queue_Create - fmt.Println("Call operation: Queue_Create") - queuesClient, err := armservicebus.NewQueuesClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = queuesClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.queueName, armservicebus.SBQueue{ - Properties: &armservicebus.SBQueueProperties{ - EnablePartitioning: to.Ptr(true), - }, - }, nil) - testsuite.Require().NoError(err) - - // From step Queue_Get - fmt.Println("Call operation: Queue_Get") - _, err = queuesClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.queueName, nil) - testsuite.Require().NoError(err) - - // From step Queue_ListByNamespace - fmt.Println("Call operation: Queue_ListByNamespace") - queuesClientNewListByNamespacePager := queuesClient.NewListByNamespacePager(testsuite.resourceGroupName, testsuite.namespaceName, &armservicebus.QueuesClientListByNamespaceOptions{Skip: nil, - Top: nil, - }) - for queuesClientNewListByNamespacePager.More() { - _, err := queuesClientNewListByNamespacePager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Queue_CreateAuthorizationRule - fmt.Println("Call operation: Queue_CreateAuthorizationRule") - _, err = queuesClient.CreateOrUpdateAuthorizationRule(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.queueName, testsuite.authorizationRuleName, armservicebus.SBAuthorizationRule{ - Properties: &armservicebus.SBAuthorizationRuleProperties{ - Rights: []*armservicebus.AccessRights{ - to.Ptr(armservicebus.AccessRightsListen), - to.Ptr(armservicebus.AccessRightsSend)}, - }, - }, nil) - testsuite.Require().NoError(err) - - // From step Queue_GetAuthorizationRule - fmt.Println("Call operation: Queue_GetAuthorizationRule") - _, err = queuesClient.GetAuthorizationRule(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.queueName, testsuite.authorizationRuleName, nil) - testsuite.Require().NoError(err) - - // From step Queue_ListAuthorizationRules - fmt.Println("Call operation: Queue_ListAuthorizationRules") - queuesClientNewListAuthorizationRulesPager := queuesClient.NewListAuthorizationRulesPager(testsuite.resourceGroupName, testsuite.namespaceName, testsuite.queueName, nil) - for queuesClientNewListAuthorizationRulesPager.More() { - _, err := queuesClientNewListAuthorizationRulesPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Queue_RegenerateKeys - fmt.Println("Call operation: Queue_RegenerateKeys") - _, err = queuesClient.RegenerateKeys(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.queueName, testsuite.authorizationRuleName, armservicebus.RegenerateAccessKeyParameters{ - KeyType: to.Ptr(armservicebus.KeyTypePrimaryKey), - }, nil) - testsuite.Require().NoError(err) - - // From step Queue_ListKeys - fmt.Println("Call operation: Queue_ListKeys") - _, err = queuesClient.ListKeys(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.queueName, testsuite.authorizationRuleName, nil) - testsuite.Require().NoError(err) - - // From step Queue_DeleteAuthorizationRule - fmt.Println("Call operation: Queue_DeleteAuthorizationRule") - _, err = queuesClient.DeleteAuthorizationRule(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.queueName, testsuite.authorizationRuleName, nil) - testsuite.Require().NoError(err) - - // From step Queue_Delete - fmt.Println("Call operation: Queue_Delete") - _, err = queuesClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.queueName, nil) - testsuite.Require().NoError(err) -} - -func (testsuite *QueuesTestSuite) Cleanup() { - var err error - // From step Namespace_Delete - fmt.Println("Call operation: Namespace_Delete") - namespacesClient, err := armservicebus.NewNamespacesClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - namespacesClientDeleteResponsePoller, err := namespacesClient.BeginDelete(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, namespacesClientDeleteResponsePoller) - testsuite.Require().NoError(err) -} diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_response_types.go b/sdk/resourcemanager/servicebus/armservicebus/response_types.go similarity index 91% rename from sdk/resourcemanager/servicebus/armservicebus/zz_generated_response_types.go rename to sdk/resourcemanager/servicebus/armservicebus/response_types.go index 2435c03710ca..bbcc03d4abd4 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 @@ -43,7 +44,7 @@ type DisasterRecoveryConfigsClientGetResponse struct { ArmDisasterRecovery } -// DisasterRecoveryConfigsClientListAuthorizationRulesResponse contains the response from method DisasterRecoveryConfigsClient.ListAuthorizationRules. +// DisasterRecoveryConfigsClientListAuthorizationRulesResponse contains the response from method DisasterRecoveryConfigsClient.NewListAuthorizationRulesPager. type DisasterRecoveryConfigsClientListAuthorizationRulesResponse struct { SBAuthorizationRuleListResult } @@ -53,7 +54,7 @@ type DisasterRecoveryConfigsClientListKeysResponse struct { AccessKeys } -// DisasterRecoveryConfigsClientListResponse contains the response from method DisasterRecoveryConfigsClient.List. +// DisasterRecoveryConfigsClientListResponse contains the response from method DisasterRecoveryConfigsClient.NewListPager. type DisasterRecoveryConfigsClientListResponse struct { ArmDisasterRecoveryListResult } @@ -63,7 +64,7 @@ type MigrationConfigsClientCompleteMigrationResponse struct { // placeholder for future response values } -// MigrationConfigsClientCreateAndStartMigrationResponse contains the response from method MigrationConfigsClient.CreateAndStartMigration. +// MigrationConfigsClientCreateAndStartMigrationResponse contains the response from method MigrationConfigsClient.BeginCreateAndStartMigration. type MigrationConfigsClientCreateAndStartMigrationResponse struct { MigrationConfigProperties } @@ -78,7 +79,7 @@ type MigrationConfigsClientGetResponse struct { MigrationConfigProperties } -// MigrationConfigsClientListResponse contains the response from method MigrationConfigsClient.List. +// MigrationConfigsClientListResponse contains the response from method MigrationConfigsClient.NewListPager. type MigrationConfigsClientListResponse struct { MigrationConfigListResult } @@ -103,7 +104,7 @@ type NamespacesClientCreateOrUpdateNetworkRuleSetResponse struct { NetworkRuleSet } -// NamespacesClientCreateOrUpdateResponse contains the response from method NamespacesClient.CreateOrUpdate. +// NamespacesClientCreateOrUpdateResponse contains the response from method NamespacesClient.BeginCreateOrUpdate. type NamespacesClientCreateOrUpdateResponse struct { SBNamespace } @@ -113,7 +114,7 @@ type NamespacesClientDeleteAuthorizationRuleResponse struct { // placeholder for future response values } -// NamespacesClientDeleteResponse contains the response from method NamespacesClient.Delete. +// NamespacesClientDeleteResponse contains the response from method NamespacesClient.BeginDelete. type NamespacesClientDeleteResponse struct { // placeholder for future response values } @@ -133,12 +134,12 @@ type NamespacesClientGetResponse struct { SBNamespace } -// NamespacesClientListAuthorizationRulesResponse contains the response from method NamespacesClient.ListAuthorizationRules. +// NamespacesClientListAuthorizationRulesResponse contains the response from method NamespacesClient.NewListAuthorizationRulesPager. type NamespacesClientListAuthorizationRulesResponse struct { SBAuthorizationRuleListResult } -// NamespacesClientListByResourceGroupResponse contains the response from method NamespacesClient.ListByResourceGroup. +// NamespacesClientListByResourceGroupResponse contains the response from method NamespacesClient.NewListByResourceGroupPager. type NamespacesClientListByResourceGroupResponse struct { SBNamespaceListResult } @@ -148,12 +149,12 @@ type NamespacesClientListKeysResponse struct { AccessKeys } -// NamespacesClientListNetworkRuleSetsResponse contains the response from method NamespacesClient.ListNetworkRuleSets. +// NamespacesClientListNetworkRuleSetsResponse contains the response from method NamespacesClient.NewListNetworkRuleSetsPager. type NamespacesClientListNetworkRuleSetsResponse struct { NetworkRuleSetListResult } -// NamespacesClientListResponse contains the response from method NamespacesClient.List. +// NamespacesClientListResponse contains the response from method NamespacesClient.NewListPager. type NamespacesClientListResponse struct { SBNamespaceListResult } @@ -168,7 +169,7 @@ type NamespacesClientUpdateResponse struct { SBNamespace } -// OperationsClientListResponse contains the response from method OperationsClient.List. +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { OperationListResult } @@ -178,7 +179,7 @@ type PrivateEndpointConnectionsClientCreateOrUpdateResponse struct { PrivateEndpointConnection } -// PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.Delete. +// PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.BeginDelete. type PrivateEndpointConnectionsClientDeleteResponse struct { // placeholder for future response values } @@ -188,7 +189,7 @@ type PrivateEndpointConnectionsClientGetResponse struct { PrivateEndpointConnection } -// PrivateEndpointConnectionsClientListResponse contains the response from method PrivateEndpointConnectionsClient.List. +// PrivateEndpointConnectionsClientListResponse contains the response from method PrivateEndpointConnectionsClient.NewListPager. type PrivateEndpointConnectionsClientListResponse struct { PrivateEndpointConnectionListResult } @@ -228,12 +229,12 @@ type QueuesClientGetResponse struct { SBQueue } -// QueuesClientListAuthorizationRulesResponse contains the response from method QueuesClient.ListAuthorizationRules. +// QueuesClientListAuthorizationRulesResponse contains the response from method QueuesClient.NewListAuthorizationRulesPager. type QueuesClientListAuthorizationRulesResponse struct { SBAuthorizationRuleListResult } -// QueuesClientListByNamespaceResponse contains the response from method QueuesClient.ListByNamespace. +// QueuesClientListByNamespaceResponse contains the response from method QueuesClient.NewListByNamespacePager. type QueuesClientListByNamespaceResponse struct { SBQueueListResult } @@ -263,7 +264,7 @@ type RulesClientGetResponse struct { Rule } -// RulesClientListBySubscriptionsResponse contains the response from method RulesClient.ListBySubscriptions. +// RulesClientListBySubscriptionsResponse contains the response from method RulesClient.NewListBySubscriptionsPager. type RulesClientListBySubscriptionsResponse struct { RuleListResult } @@ -283,7 +284,7 @@ type SubscriptionsClientGetResponse struct { SBSubscription } -// SubscriptionsClientListByTopicResponse contains the response from method SubscriptionsClient.ListByTopic. +// SubscriptionsClientListByTopicResponse contains the response from method SubscriptionsClient.NewListByTopicPager. type SubscriptionsClientListByTopicResponse struct { SBSubscriptionListResult } @@ -318,12 +319,12 @@ type TopicsClientGetResponse struct { SBTopic } -// TopicsClientListAuthorizationRulesResponse contains the response from method TopicsClient.ListAuthorizationRules. +// TopicsClientListAuthorizationRulesResponse contains the response from method TopicsClient.NewListAuthorizationRulesPager. type TopicsClientListAuthorizationRulesResponse struct { SBAuthorizationRuleListResult } -// TopicsClientListByNamespaceResponse contains the response from method TopicsClient.ListByNamespace. +// TopicsClientListByNamespaceResponse contains the response from method TopicsClient.NewListByNamespacePager. type TopicsClientListByNamespaceResponse struct { SBTopicListResult } diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_rules_client.go b/sdk/resourcemanager/servicebus/armservicebus/rules_client.go similarity index 86% rename from sdk/resourcemanager/servicebus/armservicebus/zz_generated_rules_client.go rename to sdk/resourcemanager/servicebus/armservicebus/rules_client.go index 2657027e1988..54a21e7e36f0 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 @@ -32,10 +33,10 @@ type RulesClient struct { } // NewRulesClient creates a new instance of RulesClient with the specified values. -// subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RulesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,14 +59,15 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// topicName - The topic name. -// subscriptionName - The subscription name. -// ruleName - The rule name. -// parameters - Parameters supplied to create a rule. -// options - RulesClientCreateOrUpdateOptions contains the optional parameters for the RulesClient.CreateOrUpdate method. +// +// 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. +// - subscriptionName - The subscription name. +// - ruleName - The rule name. +// - parameters - Parameters supplied to create a rule. +// - options - RulesClientCreateOrUpdateOptions contains the optional parameters for the RulesClient.CreateOrUpdate method. func (client *RulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, subscriptionName string, ruleName string, parameters Rule, options *RulesClientCreateOrUpdateOptions) (RulesClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, parameters, options) if err != nil { @@ -113,7 +115,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,13 +132,14 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// topicName - The topic name. -// subscriptionName - The subscription name. -// ruleName - The rule name. -// options - RulesClientDeleteOptions contains the optional parameters for the RulesClient.Delete method. +// +// 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. +// - subscriptionName - The subscription name. +// - ruleName - The rule name. +// - options - RulesClientDeleteOptions contains the optional parameters for the RulesClient.Delete method. func (client *RulesClient) Delete(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, subscriptionName string, ruleName string, options *RulesClientDeleteOptions) (RulesClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, options) if err != nil { @@ -184,7 +187,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,13 +195,14 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// topicName - The topic name. -// subscriptionName - The subscription name. -// ruleName - The rule name. -// options - RulesClientGetOptions contains the optional parameters for the RulesClient.Get method. +// +// 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. +// - subscriptionName - The subscription name. +// - ruleName - The rule name. +// - options - RulesClientGetOptions contains the optional parameters for the RulesClient.Get method. func (client *RulesClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, subscriptionName string, ruleName string, options *RulesClientGetOptions) (RulesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, options) if err != nil { @@ -246,7 +250,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,14 +266,14 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// topicName - The topic name. -// subscriptionName - The subscription name. -// options - RulesClientListBySubscriptionsOptions contains the optional parameters for the RulesClient.ListBySubscriptions -// method. +// +// 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. +// - subscriptionName - The subscription name. +// - options - RulesClientListBySubscriptionsOptions contains the optional parameters for the RulesClient.NewListBySubscriptionsPager +// method. func (client *RulesClient) NewListBySubscriptionsPager(resourceGroupName string, namespaceName string, topicName string, subscriptionName string, options *RulesClientListBySubscriptionsOptions) *runtime.Pager[RulesClientListBySubscriptionsResponse] { return runtime.NewPager(runtime.PagingHandler[RulesClientListBySubscriptionsResponse]{ More: func(page RulesClientListBySubscriptionsResponse) bool { @@ -326,7 +330,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 86% rename from sdk/resourcemanager/servicebus/armservicebus/zz_generated_subscriptions_client.go rename to sdk/resourcemanager/servicebus/armservicebus/subscriptions_client.go index 0e93db69d1d1..ddc529a2c7f9 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 @@ -32,10 +33,10 @@ type SubscriptionsClient struct { } // NewSubscriptionsClient creates a new instance of SubscriptionsClient with the specified values. -// subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSubscriptionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SubscriptionsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,14 +59,15 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// topicName - The topic name. -// subscriptionName - The subscription name. -// parameters - Parameters supplied to create a subscription resource. -// options - SubscriptionsClientCreateOrUpdateOptions contains the optional parameters for the SubscriptionsClient.CreateOrUpdate -// method. +// +// 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. +// - subscriptionName - The subscription name. +// - parameters - Parameters supplied to create a subscription resource. +// - options - SubscriptionsClientCreateOrUpdateOptions contains the optional parameters for the SubscriptionsClient.CreateOrUpdate +// method. func (client *SubscriptionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, subscriptionName string, parameters SBSubscription, options *SubscriptionsClientCreateOrUpdateOptions) (SubscriptionsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, namespaceName, topicName, subscriptionName, parameters, options) if err != nil { @@ -109,7 +111,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,12 +128,13 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// topicName - The topic name. -// subscriptionName - The subscription name. -// options - SubscriptionsClientDeleteOptions contains the optional parameters for the SubscriptionsClient.Delete method. +// +// 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. +// - subscriptionName - The subscription name. +// - options - SubscriptionsClientDeleteOptions contains the optional parameters for the SubscriptionsClient.Delete method. func (client *SubscriptionsClient) Delete(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, subscriptionName string, options *SubscriptionsClientDeleteOptions) (SubscriptionsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, namespaceName, topicName, subscriptionName, options) if err != nil { @@ -175,7 +178,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,12 +186,13 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// topicName - The topic name. -// subscriptionName - The subscription name. -// options - SubscriptionsClientGetOptions contains the optional parameters for the SubscriptionsClient.Get method. +// +// 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. +// - subscriptionName - The subscription name. +// - options - SubscriptionsClientGetOptions contains the optional parameters for the SubscriptionsClient.Get method. func (client *SubscriptionsClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, subscriptionName string, options *SubscriptionsClientGetOptions) (SubscriptionsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, namespaceName, topicName, subscriptionName, options) if err != nil { @@ -232,7 +236,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,13 +252,13 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// topicName - The topic name. -// options - SubscriptionsClientListByTopicOptions contains the optional parameters for the SubscriptionsClient.ListByTopic -// method. +// +// 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. +// - options - SubscriptionsClientListByTopicOptions contains the optional parameters for the SubscriptionsClient.NewListByTopicPager +// method. func (client *SubscriptionsClient) NewListByTopicPager(resourceGroupName string, namespaceName string, topicName string, options *SubscriptionsClientListByTopicOptions) *runtime.Pager[SubscriptionsClientListByTopicResponse] { return runtime.NewPager(runtime.PagingHandler[SubscriptionsClientListByTopicResponse]{ More: func(page SubscriptionsClientListByTopicResponse) bool { @@ -307,7 +311,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 96% rename from sdk/resourcemanager/servicebus/armservicebus/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/servicebus/armservicebus/time_rfc3339.go index 42470250449b..ee207f208f99 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 @@ -61,7 +62,7 @@ func (t *timeRFC3339) Parse(layout, value string) error { return err } -func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { +func populateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return } else if azcore.IsNullValue(t) { diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_topics_client.go b/sdk/resourcemanager/servicebus/armservicebus/topics_client.go similarity index 86% rename from sdk/resourcemanager/servicebus/armservicebus/zz_generated_topics_client.go rename to sdk/resourcemanager/servicebus/armservicebus/topics_client.go index 4a4e12f585ec..c0152437d7dc 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 @@ -32,10 +33,10 @@ type TopicsClient struct { } // NewTopicsClient creates a new instance of TopicsClient with the specified values. -// subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewTopicsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TopicsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +59,13 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// topicName - The topic name. -// parameters - Parameters supplied to create a topic resource. -// options - TopicsClientCreateOrUpdateOptions contains the optional parameters for the TopicsClient.CreateOrUpdate method. +// +// 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. +// - parameters - Parameters supplied to create a topic resource. +// - options - TopicsClientCreateOrUpdateOptions contains the optional parameters for the TopicsClient.CreateOrUpdate method. func (client *TopicsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, parameters SBTopic, options *TopicsClientCreateOrUpdateOptions) (TopicsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, namespaceName, topicName, parameters, options) if err != nil { @@ -103,7 +105,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,14 +122,15 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// topicName - The topic name. -// authorizationRuleName - The authorization rule name. -// parameters - The shared access authorization rule. -// options - TopicsClientCreateOrUpdateAuthorizationRuleOptions contains the optional parameters for the TopicsClient.CreateOrUpdateAuthorizationRule -// method. +// +// 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. +// - authorizationRuleName - The authorization rule name. +// - parameters - The shared access authorization rule. +// - options - TopicsClientCreateOrUpdateAuthorizationRuleOptions contains the optional parameters for the TopicsClient.CreateOrUpdateAuthorizationRule +// method. func (client *TopicsClient) CreateOrUpdateAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string, parameters SBAuthorizationRule, options *TopicsClientCreateOrUpdateAuthorizationRuleOptions) (TopicsClientCreateOrUpdateAuthorizationRuleResponse, error) { req, err := client.createOrUpdateAuthorizationRuleCreateRequest(ctx, resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters, options) if err != nil { @@ -171,7 +174,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,11 +191,12 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// topicName - The topic name. -// options - TopicsClientDeleteOptions contains the optional parameters for the TopicsClient.Delete method. +// +// 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. +// - options - TopicsClientDeleteOptions contains the optional parameters for the TopicsClient.Delete method. func (client *TopicsClient) Delete(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, options *TopicsClientDeleteOptions) (TopicsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, namespaceName, topicName, options) if err != nil { @@ -232,7 +236,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,13 +244,14 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// topicName - The topic name. -// authorizationRuleName - The authorization rule name. -// options - TopicsClientDeleteAuthorizationRuleOptions contains the optional parameters for the TopicsClient.DeleteAuthorizationRule -// method. +// +// 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. +// - authorizationRuleName - The authorization rule name. +// - options - TopicsClientDeleteAuthorizationRuleOptions contains the optional parameters for the TopicsClient.DeleteAuthorizationRule +// method. func (client *TopicsClient) DeleteAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string, options *TopicsClientDeleteAuthorizationRuleOptions) (TopicsClientDeleteAuthorizationRuleResponse, error) { req, err := client.deleteAuthorizationRuleCreateRequest(ctx, resourceGroupName, namespaceName, topicName, authorizationRuleName, options) if err != nil { @@ -290,7 +295,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,11 +303,12 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// topicName - The topic name. -// options - TopicsClientGetOptions contains the optional parameters for the TopicsClient.Get method. +// +// 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. +// - options - TopicsClientGetOptions contains the optional parameters for the TopicsClient.Get method. func (client *TopicsClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, options *TopicsClientGetOptions) (TopicsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, namespaceName, topicName, options) if err != nil { @@ -342,7 +348,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,13 +365,14 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// topicName - The topic name. -// authorizationRuleName - The authorization rule name. -// options - TopicsClientGetAuthorizationRuleOptions contains the optional parameters for the TopicsClient.GetAuthorizationRule -// method. +// +// 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. +// - authorizationRuleName - The authorization rule name. +// - options - TopicsClientGetAuthorizationRuleOptions contains the optional parameters for the TopicsClient.GetAuthorizationRule +// method. func (client *TopicsClient) GetAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string, options *TopicsClientGetAuthorizationRuleOptions) (TopicsClientGetAuthorizationRuleResponse, error) { req, err := client.getAuthorizationRuleCreateRequest(ctx, resourceGroupName, namespaceName, topicName, authorizationRuleName, options) if err != nil { @@ -409,7 +416,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,13 +432,13 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// topicName - The topic name. -// options - TopicsClientListAuthorizationRulesOptions contains the optional parameters for the TopicsClient.ListAuthorizationRules -// method. +// +// 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. +// - options - TopicsClientListAuthorizationRulesOptions contains the optional parameters for the TopicsClient.NewListAuthorizationRulesPager +// method. func (client *TopicsClient) NewListAuthorizationRulesPager(resourceGroupName string, namespaceName string, topicName string, options *TopicsClientListAuthorizationRulesOptions) *runtime.Pager[TopicsClientListAuthorizationRulesResponse] { return runtime.NewPager(runtime.PagingHandler[TopicsClientListAuthorizationRulesResponse]{ More: func(page TopicsClientListAuthorizationRulesResponse) bool { @@ -484,7 +491,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,11 +507,12 @@ 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 -// 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. +// +// 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.NewListByNamespacePager +// method. func (client *TopicsClient) NewListByNamespacePager(resourceGroupName string, namespaceName string, options *TopicsClientListByNamespaceOptions) *runtime.Pager[TopicsClientListByNamespaceResponse] { return runtime.NewPager(runtime.PagingHandler[TopicsClientListByNamespaceResponse]{ More: func(page TopicsClientListByNamespaceResponse) bool { @@ -553,7 +561,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,12 +584,13 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// topicName - The topic name. -// authorizationRuleName - The authorization rule name. -// options - TopicsClientListKeysOptions contains the optional parameters for the TopicsClient.ListKeys method. +// +// 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. +// - authorizationRuleName - The authorization rule name. +// - options - TopicsClientListKeysOptions contains the optional parameters for the TopicsClient.ListKeys method. func (client *TopicsClient) ListKeys(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string, options *TopicsClientListKeysOptions) (TopicsClientListKeysResponse, error) { req, err := client.listKeysCreateRequest(ctx, resourceGroupName, namespaceName, topicName, authorizationRuleName, options) if err != nil { @@ -625,7 +634,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,13 +651,14 @@ 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 -// resourceGroupName - Name of the Resource group within the Azure subscription. -// namespaceName - The namespace name -// topicName - The topic name. -// authorizationRuleName - The authorization rule name. -// parameters - Parameters supplied to regenerate the authorization rule. -// options - TopicsClientRegenerateKeysOptions contains the optional parameters for the TopicsClient.RegenerateKeys method. +// +// 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. +// - authorizationRuleName - The authorization rule name. +// - parameters - Parameters supplied to regenerate the authorization rule. +// - options - TopicsClientRegenerateKeysOptions contains the optional parameters for the TopicsClient.RegenerateKeys method. func (client *TopicsClient) RegenerateKeys(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string, parameters RegenerateAccessKeyParameters, options *TopicsClientRegenerateKeysOptions) (TopicsClientRegenerateKeysResponse, error) { req, err := client.regenerateKeysCreateRequest(ctx, resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters, options) if err != nil { @@ -692,7 +702,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/topics_live_test.go b/sdk/resourcemanager/servicebus/armservicebus/topics_live_test.go deleted file mode 100644 index 2fce464fbfd1..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/topics_live_test.go +++ /dev/null @@ -1,249 +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" - "fmt" - "testing" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" - "github.com/stretchr/testify/suite" -) - -type TopicsTestSuite struct { - suite.Suite - - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - authorizationRuleName string - namespaceName string - ruleName string - subscriptionName string - topicName string - location string - resourceGroupName string - subscriptionId string -} - -func (testsuite *TopicsTestSuite) SetupSuite() { - testutil.StartRecording(testsuite.T(), "sdk/resourcemanager/servicebus/armservicebus/testdata") - testsuite.ctx = context.Background() - testsuite.cred, testsuite.options = testutil.GetCredAndClientOptions(testsuite.T()) - testsuite.authorizationRuleName = testutil.GenerateAlphaNumericID(testsuite.T(), "topicauthrule", 6) - testsuite.namespaceName = testutil.GenerateAlphaNumericID(testsuite.T(), "sbnamespacet", 6) - testsuite.ruleName = testutil.GenerateAlphaNumericID(testsuite.T(), "rulena", 6) - testsuite.subscriptionName = testutil.GenerateAlphaNumericID(testsuite.T(), "subscriptionna", 6) - testsuite.topicName = testutil.GenerateAlphaNumericID(testsuite.T(), "topicna", 6) - testsuite.location = testutil.GetEnv("LOCATION", "westus") - testsuite.resourceGroupName = testutil.GetEnv("RESOURCE_GROUP_NAME", "scenarioTestTempGroup") - testsuite.subscriptionId = testutil.GetEnv("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - - resourceGroup, _, err := testutil.CreateResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.location) - testsuite.Require().NoError(err) - testsuite.resourceGroupName = *resourceGroup.Name - testsuite.Prepare() -} - -func (testsuite *TopicsTestSuite) TearDownSuite() { - testsuite.Cleanup() - _, err := testutil.DeleteResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName) - testsuite.Require().NoError(err) - testutil.StopRecording(testsuite.T()) -} - -func TestTopicsTestSuite(t *testing.T) { - suite.Run(t, new(TopicsTestSuite)) -} - -func (testsuite *TopicsTestSuite) Prepare() { - var err error - // From step Namespace_Create - fmt.Println("Call operation: Namespaces_CreateOrUpdate") - namespacesClient, err := armservicebus.NewNamespacesClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - namespacesClientCreateOrUpdateResponsePoller, err := namespacesClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, armservicebus.SBNamespace{ - Location: to.Ptr(testsuite.location), - 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) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, namespacesClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) -} - -// Microsoft.ServiceBus/namespaces/topics -func (testsuite *TopicsTestSuite) TestTopic() { - var err error - // From step Topic_Create - fmt.Println("Call operation: Topics_Create") - topicsClient, err := armservicebus.NewTopicsClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = topicsClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.topicName, armservicebus.SBTopic{ - Properties: &armservicebus.SBTopicProperties{ - EnableExpress: to.Ptr(true), - }, - }, nil) - testsuite.Require().NoError(err) - - // From step Topic_Get - fmt.Println("Call operation: Topics_Get") - _, err = topicsClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.topicName, nil) - testsuite.Require().NoError(err) - - // From step Topic_ListByNamespace - fmt.Println("Call operation: Topics_ListByNamespace") - topicsClientNewListByNamespacePager := topicsClient.NewListByNamespacePager(testsuite.resourceGroupName, testsuite.namespaceName, &armservicebus.TopicsClientListByNamespaceOptions{Skip: nil, - Top: nil, - }) - for topicsClientNewListByNamespacePager.More() { - _, err := topicsClientNewListByNamespacePager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Topic_CreateAuthorizationRule - fmt.Println("Call operation: Topics_CreateOrUpdateAuthorizationRule") - _, err = topicsClient.CreateOrUpdateAuthorizationRule(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.topicName, testsuite.authorizationRuleName, armservicebus.SBAuthorizationRule{ - Properties: &armservicebus.SBAuthorizationRuleProperties{ - Rights: []*armservicebus.AccessRights{ - to.Ptr(armservicebus.AccessRightsListen), - to.Ptr(armservicebus.AccessRightsSend)}, - }, - }, nil) - testsuite.Require().NoError(err) - - // From step Topic_GetAuthorizationRule - fmt.Println("Call operation: Topics_GetAuthorizationRule") - _, err = topicsClient.GetAuthorizationRule(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.topicName, testsuite.authorizationRuleName, nil) - testsuite.Require().NoError(err) - - // From step Topic_ListAuthorizationRules - fmt.Println("Call operation: Topics_ListAuthorizationRules") - topicsClientNewListAuthorizationRulesPager := topicsClient.NewListAuthorizationRulesPager(testsuite.resourceGroupName, testsuite.namespaceName, testsuite.topicName, nil) - for topicsClientNewListAuthorizationRulesPager.More() { - _, err := topicsClientNewListAuthorizationRulesPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Topic_RegenerateKeys - fmt.Println("Call operation: Topics_RegenerateKeys") - _, err = topicsClient.RegenerateKeys(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.topicName, testsuite.authorizationRuleName, armservicebus.RegenerateAccessKeyParameters{ - KeyType: to.Ptr(armservicebus.KeyTypePrimaryKey), - }, nil) - testsuite.Require().NoError(err) - - // From step Topic_ListKeys - fmt.Println("Call operation: Topics_ListKeys") - _, err = topicsClient.ListKeys(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.topicName, testsuite.authorizationRuleName, nil) - testsuite.Require().NoError(err) - - // From step Topic_DeleteAuthorizationRule - fmt.Println("Call operation: Topics_DeleteAuthorizationRule") - _, err = topicsClient.DeleteAuthorizationRule(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.topicName, testsuite.authorizationRuleName, nil) - testsuite.Require().NoError(err) - - // From step Subscription_Create - fmt.Println("Call operation: Subscriptions_CreateOrUpdate") - subscriptionsClient, err := armservicebus.NewSubscriptionsClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = subscriptionsClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.topicName, testsuite.subscriptionName, armservicebus.SBSubscription{ - Properties: &armservicebus.SBSubscriptionProperties{ - EnableBatchedOperations: to.Ptr(true), - }, - }, nil) - testsuite.Require().NoError(err) - - // From step Subscription_Get - fmt.Println("Call operation: Subscriptions_Get") - _, err = subscriptionsClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.topicName, testsuite.subscriptionName, nil) - testsuite.Require().NoError(err) - - // From step Subscription_ListByTopic - fmt.Println("Call operation: Subscriptions_ListByTopic") - subscriptionsClientNewListByTopicPager := subscriptionsClient.NewListByTopicPager(testsuite.resourceGroupName, testsuite.namespaceName, testsuite.topicName, &armservicebus.SubscriptionsClientListByTopicOptions{Skip: nil, - Top: nil, - }) - for subscriptionsClientNewListByTopicPager.More() { - _, err := subscriptionsClientNewListByTopicPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Rule_Create - fmt.Println("Call operation: Rules_CreateOrUpdate") - rulesClient, err := armservicebus.NewRulesClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = rulesClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.topicName, testsuite.subscriptionName, testsuite.ruleName, armservicebus.Rule{ - Properties: &armservicebus.Ruleproperties{ - CorrelationFilter: &armservicebus.CorrelationFilter{ - Properties: map[string]*string{ - "topicHint": to.Ptr("Crop"), - }, - }, - FilterType: to.Ptr(armservicebus.FilterTypeCorrelationFilter), - }, - }, nil) - testsuite.Require().NoError(err) - - // From step Rule_Get - fmt.Println("Call operation: Rules_Get") - _, err = rulesClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.topicName, testsuite.subscriptionName, testsuite.ruleName, nil) - testsuite.Require().NoError(err) - - // From step Rule_ListBySubscription - fmt.Println("Call operation: Rules_ListBySubscriptions") - rulesClientNewListBySubscriptionsPager := rulesClient.NewListBySubscriptionsPager(testsuite.resourceGroupName, testsuite.namespaceName, testsuite.topicName, testsuite.subscriptionName, &armservicebus.RulesClientListBySubscriptionsOptions{Skip: nil, - Top: nil, - }) - for rulesClientNewListBySubscriptionsPager.More() { - _, err := rulesClientNewListBySubscriptionsPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Rule_Delete - fmt.Println("Call operation: Rules_Delete") - _, err = rulesClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.topicName, testsuite.subscriptionName, testsuite.ruleName, nil) - testsuite.Require().NoError(err) - - // From step Subscription_Delete - fmt.Println("Call operation: Subscriptions_Delete") - _, err = subscriptionsClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.topicName, testsuite.subscriptionName, nil) - testsuite.Require().NoError(err) - - // From step Topic_Delete - fmt.Println("Call operation: Topics_Delete") - _, err = topicsClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.topicName, nil) - testsuite.Require().NoError(err) -} - -func (testsuite *TopicsTestSuite) Cleanup() { - var err error - // From step Namespace_Delete - fmt.Println("Call operation: Namespaces_Delete") - namespacesClient, err := armservicebus.NewNamespacesClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - namespacesClientDeleteResponsePoller, err := namespacesClient.BeginDelete(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, namespacesClientDeleteResponsePoller) - testsuite.Require().NoError(err) -} 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 -}