diff --git a/sdk/resourcemanager/servicebus/armservicebus/CHANGELOG.md b/sdk/resourcemanager/servicebus/armservicebus/CHANGELOG.md index 8dbf1b760a7b..169a56d41c58 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/CHANGELOG.md +++ b/sdk/resourcemanager/servicebus/armservicebus/CHANGELOG.md @@ -1,5 +1,13 @@ # Release History +## 1.3.0 (2025-05-09) +### Features Added + +- New enum type `PublicNetworkAccess` with values `PublicNetworkAccessDisabled`, `PublicNetworkAccessEnabled`, `PublicNetworkAccessSecuredByPerimeter` +- New enum type `TLSVersion` with values `TLSVersionOne0`, `TLSVersionOne1`, `TLSVersionOne2` +- New field `MinimumTLSVersion`, `PremiumMessagingPartitions`, `PublicNetworkAccess` in struct `SBNamespaceProperties` + + ## 1.2.0 (2023-11-24) ### Features Added diff --git a/sdk/resourcemanager/servicebus/armservicebus/README.md b/sdk/resourcemanager/servicebus/armservicebus/README.md index 2d7eb4f2a2ff..6e66ce44c319 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/README.md +++ b/sdk/resourcemanager/servicebus/armservicebus/README.md @@ -55,7 +55,7 @@ clientFactory, err := armservicebus.NewClientFactory(, cred, &o A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory. ```go -client := clientFactory.NewNamespacesClient() +client := clientFactory.NewDisasterRecoveryConfigsClient() ``` ## Fakes diff --git a/sdk/resourcemanager/servicebus/armservicebus/autorest.md b/sdk/resourcemanager/servicebus/armservicebus/autorest.md index cb4273177ff7..7f8eb6bf8ba4 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/autorest.md +++ b/sdk/resourcemanager/servicebus/armservicebus/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/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: 1.2.0 -tag: package-2021-11 +module-version: 1.3.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/servicebus/armservicebus/client_factory.go b/sdk/resourcemanager/servicebus/armservicebus/client_factory.go index 00a785c53d18..bdf3c1a92676 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/client_factory.go +++ b/sdk/resourcemanager/servicebus/armservicebus/client_factory.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -17,8 +14,7 @@ import ( // Don't use this type directly, use NewClientFactory instead. type ClientFactory struct { subscriptionID string - credential azcore.TokenCredential - options *arm.ClientOptions + internal *arm.Client } // NewClientFactory creates a new instance of ClientFactory with the specified values. @@ -28,72 +24,91 @@ type ClientFactory struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { - _, err := arm.NewClient(moduleName, moduleVersion, credential, options) + internal, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } return &ClientFactory{ - subscriptionID: subscriptionID, credential: credential, - options: options.Clone(), + subscriptionID: subscriptionID, + internal: internal, }, nil } // NewDisasterRecoveryConfigsClient creates a new instance of DisasterRecoveryConfigsClient. func (c *ClientFactory) NewDisasterRecoveryConfigsClient() *DisasterRecoveryConfigsClient { - subClient, _ := NewDisasterRecoveryConfigsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &DisasterRecoveryConfigsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewMigrationConfigsClient creates a new instance of MigrationConfigsClient. func (c *ClientFactory) NewMigrationConfigsClient() *MigrationConfigsClient { - subClient, _ := NewMigrationConfigsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &MigrationConfigsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewNamespacesClient creates a new instance of NamespacesClient. func (c *ClientFactory) NewNamespacesClient() *NamespacesClient { - subClient, _ := NewNamespacesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &NamespacesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewOperationsClient creates a new instance of OperationsClient. func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) - return subClient + return &OperationsClient{ + internal: c.internal, + } } // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient. func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient { - subClient, _ := NewPrivateEndpointConnectionsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &PrivateEndpointConnectionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient. func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient { - subClient, _ := NewPrivateLinkResourcesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &PrivateLinkResourcesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewQueuesClient creates a new instance of QueuesClient. func (c *ClientFactory) NewQueuesClient() *QueuesClient { - subClient, _ := NewQueuesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &QueuesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewRulesClient creates a new instance of RulesClient. func (c *ClientFactory) NewRulesClient() *RulesClient { - subClient, _ := NewRulesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &RulesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewSubscriptionsClient creates a new instance of SubscriptionsClient. func (c *ClientFactory) NewSubscriptionsClient() *SubscriptionsClient { - subClient, _ := NewSubscriptionsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &SubscriptionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewTopicsClient creates a new instance of TopicsClient. func (c *ClientFactory) NewTopicsClient() *TopicsClient { - subClient, _ := NewTopicsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &TopicsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } diff --git a/sdk/resourcemanager/servicebus/armservicebus/constants.go b/sdk/resourcemanager/servicebus/armservicebus/constants.go index ed464353626f..d744b1fe74c2 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/constants.go +++ b/sdk/resourcemanager/servicebus/armservicebus/constants.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -10,7 +7,7 @@ package armservicebus const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" - moduleVersion = "v1.2.0" + moduleVersion = "v1.3.0" ) type AccessRights string @@ -238,6 +235,24 @@ func PossibleProvisioningStateDRValues() []ProvisioningStateDR { } } +// PublicNetworkAccess - This determines if traffic is allowed over public network. By default it is enabled. +type PublicNetworkAccess string + +const ( + PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" + PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" + PublicNetworkAccessSecuredByPerimeter PublicNetworkAccess = "SecuredByPerimeter" +) + +// PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type. +func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { + return []PublicNetworkAccess{ + PublicNetworkAccessDisabled, + PublicNetworkAccessEnabled, + PublicNetworkAccessSecuredByPerimeter, + } +} + // PublicNetworkAccessFlag - This determines if traffic is allowed over public network. By default it is enabled. type PublicNetworkAccessFlag string @@ -308,6 +323,24 @@ func PossibleSKUTierValues() []SKUTier { } } +// TLSVersion - The minimum TLS version for the cluster to support, e.g. '1.2' +type TLSVersion string + +const ( + TLSVersionOne0 TLSVersion = "1.0" + TLSVersionOne1 TLSVersion = "1.1" + TLSVersionOne2 TLSVersion = "1.2" +) + +// PossibleTLSVersionValues returns the possible values for the TLSVersion const type. +func PossibleTLSVersionValues() []TLSVersion { + return []TLSVersion{ + TLSVersionOne0, + TLSVersionOne1, + TLSVersionOne2, + } +} + // UnavailableReason - Specifies the reason for the unavailability of the service. type UnavailableReason string diff --git a/sdk/resourcemanager/servicebus/armservicebus/disasterrecoveryconfigs_client.go b/sdk/resourcemanager/servicebus/armservicebus/disasterrecoveryconfigs_client.go index 4a2efaf2cbc4..36237b4e5d04 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/disasterrecoveryconfigs_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/disasterrecoveryconfigs_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -47,8 +44,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - alias - The Disaster Recovery configuration name // - options - DisasterRecoveryConfigsClientBreakPairingOptions contains the optional parameters for the DisasterRecoveryConfigsClient.BreakPairing @@ -75,7 +72,7 @@ func (client *DisasterRecoveryConfigsClient) BreakPairing(ctx context.Context, r } // breakPairingCreateRequest creates the BreakPairing request. -func (client *DisasterRecoveryConfigsClient) breakPairingCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, alias string, options *DisasterRecoveryConfigsClientBreakPairingOptions) (*policy.Request, error) { +func (client *DisasterRecoveryConfigsClient) breakPairingCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, alias string, _ *DisasterRecoveryConfigsClientBreakPairingOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/breakPairing" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -98,7 +95,7 @@ func (client *DisasterRecoveryConfigsClient) breakPairingCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -107,8 +104,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - parameters - Parameters to check availability of the given namespace name // - options - DisasterRecoveryConfigsClientCheckNameAvailabilityOptions contains the optional parameters for the DisasterRecoveryConfigsClient.CheckNameAvailability @@ -136,7 +133,7 @@ func (client *DisasterRecoveryConfigsClient) CheckNameAvailability(ctx context.C } // checkNameAvailabilityCreateRequest creates the CheckNameAvailability request. -func (client *DisasterRecoveryConfigsClient) checkNameAvailabilityCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, parameters CheckNameAvailability, options *DisasterRecoveryConfigsClientCheckNameAvailabilityOptions) (*policy.Request, error) { +func (client *DisasterRecoveryConfigsClient) checkNameAvailabilityCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, parameters CheckNameAvailability, _ *DisasterRecoveryConfigsClientCheckNameAvailabilityOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/CheckNameAvailability" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -155,7 +152,7 @@ func (client *DisasterRecoveryConfigsClient) checkNameAvailabilityCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -176,8 +173,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - alias - The Disaster Recovery configuration name // - parameters - Parameters required to create an Alias(Disaster Recovery configuration) @@ -206,7 +203,7 @@ func (client *DisasterRecoveryConfigsClient) CreateOrUpdate(ctx context.Context, } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DisasterRecoveryConfigsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, alias string, parameters ArmDisasterRecovery, options *DisasterRecoveryConfigsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *DisasterRecoveryConfigsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, alias string, parameters ArmDisasterRecovery, _ *DisasterRecoveryConfigsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -229,7 +226,7 @@ func (client *DisasterRecoveryConfigsClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -250,8 +247,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - alias - The Disaster Recovery configuration name // - options - DisasterRecoveryConfigsClientDeleteOptions contains the optional parameters for the DisasterRecoveryConfigsClient.Delete @@ -278,7 +275,7 @@ func (client *DisasterRecoveryConfigsClient) Delete(ctx context.Context, resourc } // deleteCreateRequest creates the Delete request. -func (client *DisasterRecoveryConfigsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, alias string, options *DisasterRecoveryConfigsClientDeleteOptions) (*policy.Request, error) { +func (client *DisasterRecoveryConfigsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, alias string, _ *DisasterRecoveryConfigsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -301,7 +298,7 @@ func (client *DisasterRecoveryConfigsClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -310,8 +307,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - alias - The Disaster Recovery configuration name // - options - DisasterRecoveryConfigsClientFailOverOptions contains the optional parameters for the DisasterRecoveryConfigsClient.FailOver @@ -361,7 +358,7 @@ func (client *DisasterRecoveryConfigsClient) failOverCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -376,8 +373,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - alias - The Disaster Recovery configuration name // - options - DisasterRecoveryConfigsClientGetOptions contains the optional parameters for the DisasterRecoveryConfigsClient.Get @@ -405,7 +402,7 @@ func (client *DisasterRecoveryConfigsClient) Get(ctx context.Context, resourceGr } // getCreateRequest creates the Get request. -func (client *DisasterRecoveryConfigsClient) getCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, alias string, options *DisasterRecoveryConfigsClientGetOptions) (*policy.Request, error) { +func (client *DisasterRecoveryConfigsClient) getCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, alias string, _ *DisasterRecoveryConfigsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -428,7 +425,7 @@ func (client *DisasterRecoveryConfigsClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -446,8 +443,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - alias - The Disaster Recovery configuration name // - authorizationRuleName - The authorization rule name. @@ -476,7 +473,7 @@ func (client *DisasterRecoveryConfigsClient) GetAuthorizationRule(ctx context.Co } // getAuthorizationRuleCreateRequest creates the GetAuthorizationRule request. -func (client *DisasterRecoveryConfigsClient) getAuthorizationRuleCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, alias string, authorizationRuleName string, options *DisasterRecoveryConfigsClientGetAuthorizationRuleOptions) (*policy.Request, error) { +func (client *DisasterRecoveryConfigsClient) getAuthorizationRuleCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, alias string, authorizationRuleName string, _ *DisasterRecoveryConfigsClientGetAuthorizationRuleOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules/{authorizationRuleName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -503,7 +500,7 @@ func (client *DisasterRecoveryConfigsClient) getAuthorizationRuleCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -520,8 +517,8 @@ func (client *DisasterRecoveryConfigsClient) getAuthorizationRuleHandleResponse( // NewListPager - Gets all Alias(Disaster Recovery configurations) // -// Generated from API version 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - options - DisasterRecoveryConfigsClientListOptions contains the optional parameters for the DisasterRecoveryConfigsClient.NewListPager // method. @@ -549,7 +546,7 @@ func (client *DisasterRecoveryConfigsClient) NewListPager(resourceGroupName stri } // listCreateRequest creates the List request. -func (client *DisasterRecoveryConfigsClient) listCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, options *DisasterRecoveryConfigsClientListOptions) (*policy.Request, error) { +func (client *DisasterRecoveryConfigsClient) listCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, _ *DisasterRecoveryConfigsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -568,7 +565,7 @@ func (client *DisasterRecoveryConfigsClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -585,8 +582,8 @@ func (client *DisasterRecoveryConfigsClient) listHandleResponse(resp *http.Respo // NewListAuthorizationRulesPager - Gets the authorization rules for a namespace. // -// Generated from API version 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - alias - The Disaster Recovery configuration name // - options - DisasterRecoveryConfigsClientListAuthorizationRulesOptions contains the optional parameters for the DisasterRecoveryConfigsClient.NewListAuthorizationRulesPager @@ -615,7 +612,7 @@ func (client *DisasterRecoveryConfigsClient) NewListAuthorizationRulesPager(reso } // listAuthorizationRulesCreateRequest creates the ListAuthorizationRules request. -func (client *DisasterRecoveryConfigsClient) listAuthorizationRulesCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, alias string, options *DisasterRecoveryConfigsClientListAuthorizationRulesOptions) (*policy.Request, error) { +func (client *DisasterRecoveryConfigsClient) listAuthorizationRulesCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, alias string, _ *DisasterRecoveryConfigsClientListAuthorizationRulesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -638,7 +635,7 @@ func (client *DisasterRecoveryConfigsClient) listAuthorizationRulesCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -656,8 +653,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - alias - The Disaster Recovery configuration name // - authorizationRuleName - The authorization rule name. @@ -686,7 +683,7 @@ func (client *DisasterRecoveryConfigsClient) ListKeys(ctx context.Context, resou } // listKeysCreateRequest creates the ListKeys request. -func (client *DisasterRecoveryConfigsClient) listKeysCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, alias string, authorizationRuleName string, options *DisasterRecoveryConfigsClientListKeysOptions) (*policy.Request, error) { +func (client *DisasterRecoveryConfigsClient) listKeysCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, alias string, authorizationRuleName string, _ *DisasterRecoveryConfigsClientListKeysOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules/{authorizationRuleName}/listKeys" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -713,7 +710,7 @@ func (client *DisasterRecoveryConfigsClient) listKeysCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicebus/armservicebus/disasterrecoveryconfigs_client_example_test.go b/sdk/resourcemanager/servicebus/armservicebus/disasterrecoveryconfigs_client_example_test.go deleted file mode 100644 index e915a1a0f14f..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/disasterrecoveryconfigs_client_example_test.go +++ /dev/null @@ -1,328 +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. -// DO NOT EDIT. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDisasterRecoveryConfigsClient().NewListPager("ardsouzatestRG", "sdk-Namespace-8860", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ArmDisasterRecoveryListResult = armservicebus.ArmDisasterRecoveryListResult{ - // Value: []*armservicebus.ArmDisasterRecovery{ - // { - // Name: to.Ptr("sdk-DisasterRecovery-3814"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/DisasterRecoveryConfig"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ardsouzatestRG/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-8860/disasterRecoveryConfig/sdk-DisasterRecovery-3814"), - // Properties: &armservicebus.ArmDisasterRecoveryProperties{ - // PartnerNamespace: to.Ptr("sdk-Namespace-37"), - // ProvisioningState: to.Ptr(armservicebus.ProvisioningStateDRSucceeded), - // Role: to.Ptr(armservicebus.RoleDisasterRecoveryPrimary), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDisasterRecoveryConfigsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ArmDisasterRecovery = armservicebus.ArmDisasterRecovery{ - // Name: to.Ptr("sdk-Namespace-8860"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/DisasterRecoveryConfig"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ardsouzatestRG/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-8860/disasterRecoveryConfig/sdk-Namespace-8860"), - // Properties: &armservicebus.ArmDisasterRecoveryProperties{ - // AlternateName: to.Ptr("alternameforAlias-Namespace-8860"), - // PartnerNamespace: to.Ptr("sdk-Namespace-37"), - // ProvisioningState: to.Ptr(armservicebus.ProvisioningStateDRSucceeded), - // Role: to.Ptr(armservicebus.RoleDisasterRecoveryPrimary), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDisasterRecoveryConfigsClient().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/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDisasterRecoveryConfigsClient().Get(ctx, "ardsouzatestRG", "sdk-Namespace-8860", "sdk-DisasterRecovery-3814", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ArmDisasterRecovery = armservicebus.ArmDisasterRecovery{ - // Name: to.Ptr("sdk-DisasterRecovery-3814"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/DisasterRecoveryConfig"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ardsouzatestRG/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-37/disasterRecoveryConfig/sdk-DisasterRecovery-3814"), - // Properties: &armservicebus.ArmDisasterRecoveryProperties{ - // PartnerNamespace: to.Ptr("sdk-Namespace-8860"), - // PendingReplicationOperationsCount: to.Ptr[int64](0), - // ProvisioningState: to.Ptr(armservicebus.ProvisioningStateDRSucceeded), - // Role: to.Ptr(armservicebus.RoleDisasterRecoverySecondary), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDisasterRecoveryConfigsClient().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/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDisasterRecoveryConfigsClient().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/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDisasterRecoveryConfigsClient().NewListAuthorizationRulesPager("exampleResourceGroup", "sdk-Namespace-9080", "sdk-DisasterRecovery-4047", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SBAuthorizationRuleListResult = armservicebus.SBAuthorizationRuleListResult{ - // Value: []*armservicebus.SBAuthorizationRule{ - // { - // Name: to.Ptr("RootManageSharedAccessKey"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/DisasterRecoveryConfig/AuthorizationRules"), - // ID: to.Ptr("/subscriptions/exampleSubscriptionId/resourceGroups/exampleResourceGroup/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-9080/disasterRecoveryConfigs/sdk-DisasterRecovery-4047/AuthorizationRules/RootManageSharedAccessKey"), - // Properties: &armservicebus.SBAuthorizationRuleProperties{ - // Rights: []*armservicebus.AccessRights{ - // to.Ptr(armservicebus.AccessRightsListen), - // to.Ptr(armservicebus.AccessRightsManage), - // to.Ptr(armservicebus.AccessRightsSend)}, - // }, - // }, - // { - // Name: to.Ptr("sdk-Authrules-1067"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/DisasterRecoveryConfig/AuthorizationRules"), - // ID: to.Ptr("/subscriptions/exampleSubscriptionId/resourceGroups/exampleResourceGroup/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-9080/disasterRecoveryConfigs/sdk-DisasterRecovery-4047/AuthorizationRules/sdk-Authrules-1067"), - // Properties: &armservicebus.SBAuthorizationRuleProperties{ - // Rights: []*armservicebus.AccessRights{ - // to.Ptr(armservicebus.AccessRightsListen), - // to.Ptr(armservicebus.AccessRightsSend)}, - // }, - // }, - // { - // Name: to.Ptr("sdk-Authrules-1684"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/DisasterRecoveryConfig/AuthorizationRules"), - // ID: to.Ptr("/subscriptions/exampleSubscriptionId/resourceGroups/exampleResourceGroup/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-9080/disasterRecoveryConfigs/sdk-DisasterRecovery-4047/AuthorizationRules/sdk-Authrules-1684"), - // Properties: &armservicebus.SBAuthorizationRuleProperties{ - // Rights: []*armservicebus.AccessRights{ - // to.Ptr(armservicebus.AccessRightsListen), - // to.Ptr(armservicebus.AccessRightsSend)}, - // }, - // }, - // { - // Name: to.Ptr("sdk-Authrules-4879"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/DisasterRecoveryConfig/AuthorizationRules"), - // ID: to.Ptr("/subscriptions/exampleSubscriptionId/resourceGroups/exampleResourceGroup/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-9080/disasterRecoveryConfigs/sdk-DisasterRecovery-4047/AuthorizationRules/sdk-Authrules-4879"), - // Properties: &armservicebus.SBAuthorizationRuleProperties{ - // Rights: []*armservicebus.AccessRights{ - // to.Ptr(armservicebus.AccessRightsListen), - // to.Ptr(armservicebus.AccessRightsSend)}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDisasterRecoveryConfigsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SBAuthorizationRule = armservicebus.SBAuthorizationRule{ - // Name: to.Ptr("sdk-Authrules-4879"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/DisasterRecoveryConfig/AuthorizationRules"), - // ID: to.Ptr("/subscriptions/exampleSubscriptionId/resourceGroups/exampleResourceGroup/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-9080/disasterRecoveryConfigs/sdk-DisasterRecovery-4047/AuthorizationRules/sdk-Authrules-4879"), - // Properties: &armservicebus.SBAuthorizationRuleProperties{ - // Rights: []*armservicebus.AccessRights{ - // to.Ptr(armservicebus.AccessRightsListen), - // to.Ptr(armservicebus.AccessRightsSend)}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDisasterRecoveryConfigsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AccessKeys = armservicebus.AccessKeys{ - // AliasPrimaryConnectionString: to.Ptr("Endpoint=sb://sdk-disasterrecovery-4047.servicebus.windows-int.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=############################################"), - // AliasSecondaryConnectionString: to.Ptr("Endpoint=sb://sdk-disasterrecovery-4047.servicebus.windows-int.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=############################################"), - // KeyName: to.Ptr("sdk-Authrules-1746"), - // PrimaryKey: to.Ptr("############################################"), - // SecondaryKey: to.Ptr("############################################"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDisasterRecoveryConfigsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckNameAvailabilityResult = armservicebus.CheckNameAvailabilityResult{ - // Message: to.Ptr(""), - // NameAvailable: to.Ptr(true), - // Reason: to.Ptr(armservicebus.UnavailableReasonNone), - // } -} diff --git a/sdk/resourcemanager/servicebus/armservicebus/fake/disasterrecoveryconfigs_server.go b/sdk/resourcemanager/servicebus/armservicebus/fake/disasterrecoveryconfigs_server.go index 6604b897f2c6..2055bf7b93a9 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/fake/disasterrecoveryconfigs_server.go +++ b/sdk/resourcemanager/servicebus/armservicebus/fake/disasterrecoveryconfigs_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -93,39 +90,58 @@ func (d *DisasterRecoveryConfigsServerTransport) Do(req *http.Request) (*http.Re return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return d.dispatchToMethodFake(req, method) +} - switch method { - case "DisasterRecoveryConfigsClient.BreakPairing": - resp, err = d.dispatchBreakPairing(req) - case "DisasterRecoveryConfigsClient.CheckNameAvailability": - resp, err = d.dispatchCheckNameAvailability(req) - case "DisasterRecoveryConfigsClient.CreateOrUpdate": - resp, err = d.dispatchCreateOrUpdate(req) - case "DisasterRecoveryConfigsClient.Delete": - resp, err = d.dispatchDelete(req) - case "DisasterRecoveryConfigsClient.FailOver": - resp, err = d.dispatchFailOver(req) - case "DisasterRecoveryConfigsClient.Get": - resp, err = d.dispatchGet(req) - case "DisasterRecoveryConfigsClient.GetAuthorizationRule": - resp, err = d.dispatchGetAuthorizationRule(req) - case "DisasterRecoveryConfigsClient.NewListPager": - resp, err = d.dispatchNewListPager(req) - case "DisasterRecoveryConfigsClient.NewListAuthorizationRulesPager": - resp, err = d.dispatchNewListAuthorizationRulesPager(req) - case "DisasterRecoveryConfigsClient.ListKeys": - resp, err = d.dispatchListKeys(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (d *DisasterRecoveryConfigsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if disasterRecoveryConfigsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = disasterRecoveryConfigsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "DisasterRecoveryConfigsClient.BreakPairing": + res.resp, res.err = d.dispatchBreakPairing(req) + case "DisasterRecoveryConfigsClient.CheckNameAvailability": + res.resp, res.err = d.dispatchCheckNameAvailability(req) + case "DisasterRecoveryConfigsClient.CreateOrUpdate": + res.resp, res.err = d.dispatchCreateOrUpdate(req) + case "DisasterRecoveryConfigsClient.Delete": + res.resp, res.err = d.dispatchDelete(req) + case "DisasterRecoveryConfigsClient.FailOver": + res.resp, res.err = d.dispatchFailOver(req) + case "DisasterRecoveryConfigsClient.Get": + res.resp, res.err = d.dispatchGet(req) + case "DisasterRecoveryConfigsClient.GetAuthorizationRule": + res.resp, res.err = d.dispatchGetAuthorizationRule(req) + case "DisasterRecoveryConfigsClient.NewListPager": + res.resp, res.err = d.dispatchNewListPager(req) + case "DisasterRecoveryConfigsClient.NewListAuthorizationRulesPager": + res.resp, res.err = d.dispatchNewListAuthorizationRulesPager(req) + case "DisasterRecoveryConfigsClient.ListKeys": + res.resp, res.err = d.dispatchListKeys(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (d *DisasterRecoveryConfigsServerTransport) dispatchBreakPairing(req *http.Request) (*http.Response, error) { @@ -531,3 +547,9 @@ func (d *DisasterRecoveryConfigsServerTransport) dispatchListKeys(req *http.Requ } return resp, nil } + +// set this to conditionally intercept incoming requests to DisasterRecoveryConfigsServerTransport +var disasterRecoveryConfigsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/servicebus/armservicebus/fake/internal.go b/sdk/resourcemanager/servicebus/armservicebus/fake/internal.go index ce49c535df47..d085e0cd6716 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/fake/internal.go +++ b/sdk/resourcemanager/servicebus/armservicebus/fake/internal.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -14,6 +11,11 @@ import ( "sync" ) +type result struct { + resp *http.Response + err error +} + type nonRetriableError struct { error } diff --git a/sdk/resourcemanager/servicebus/armservicebus/fake/migrationconfigs_server.go b/sdk/resourcemanager/servicebus/armservicebus/fake/migrationconfigs_server.go index 92d01740ae46..a917687002e9 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/fake/migrationconfigs_server.go +++ b/sdk/resourcemanager/servicebus/armservicebus/fake/migrationconfigs_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -76,31 +73,50 @@ func (m *MigrationConfigsServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return m.dispatchToMethodFake(req, method) +} - switch method { - case "MigrationConfigsClient.CompleteMigration": - resp, err = m.dispatchCompleteMigration(req) - case "MigrationConfigsClient.BeginCreateAndStartMigration": - resp, err = m.dispatchBeginCreateAndStartMigration(req) - case "MigrationConfigsClient.Delete": - resp, err = m.dispatchDelete(req) - case "MigrationConfigsClient.Get": - resp, err = m.dispatchGet(req) - case "MigrationConfigsClient.NewListPager": - resp, err = m.dispatchNewListPager(req) - case "MigrationConfigsClient.Revert": - resp, err = m.dispatchRevert(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (m *MigrationConfigsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if migrationConfigsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = migrationConfigsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "MigrationConfigsClient.CompleteMigration": + res.resp, res.err = m.dispatchCompleteMigration(req) + case "MigrationConfigsClient.BeginCreateAndStartMigration": + res.resp, res.err = m.dispatchBeginCreateAndStartMigration(req) + case "MigrationConfigsClient.Delete": + res.resp, res.err = m.dispatchDelete(req) + case "MigrationConfigsClient.Get": + res.resp, res.err = m.dispatchGet(req) + case "MigrationConfigsClient.NewListPager": + res.resp, res.err = m.dispatchNewListPager(req) + case "MigrationConfigsClient.Revert": + res.resp, res.err = m.dispatchRevert(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (m *MigrationConfigsServerTransport) dispatchCompleteMigration(req *http.Request) (*http.Response, error) { @@ -373,3 +389,9 @@ func (m *MigrationConfigsServerTransport) dispatchRevert(req *http.Request) (*ht } return resp, nil } + +// set this to conditionally intercept incoming requests to MigrationConfigsServerTransport +var migrationConfigsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/servicebus/armservicebus/fake/namespaces_server.go b/sdk/resourcemanager/servicebus/armservicebus/fake/namespaces_server.go index 4b569763e88b..6130dd5d899c 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/fake/namespaces_server.go +++ b/sdk/resourcemanager/servicebus/armservicebus/fake/namespaces_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -124,51 +121,70 @@ func (n *NamespacesServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "NamespacesClient.CheckNameAvailability": - resp, err = n.dispatchCheckNameAvailability(req) - case "NamespacesClient.BeginCreateOrUpdate": - resp, err = n.dispatchBeginCreateOrUpdate(req) - case "NamespacesClient.CreateOrUpdateAuthorizationRule": - resp, err = n.dispatchCreateOrUpdateAuthorizationRule(req) - case "NamespacesClient.CreateOrUpdateNetworkRuleSet": - resp, err = n.dispatchCreateOrUpdateNetworkRuleSet(req) - case "NamespacesClient.BeginDelete": - resp, err = n.dispatchBeginDelete(req) - case "NamespacesClient.DeleteAuthorizationRule": - resp, err = n.dispatchDeleteAuthorizationRule(req) - case "NamespacesClient.Get": - resp, err = n.dispatchGet(req) - case "NamespacesClient.GetAuthorizationRule": - resp, err = n.dispatchGetAuthorizationRule(req) - case "NamespacesClient.GetNetworkRuleSet": - resp, err = n.dispatchGetNetworkRuleSet(req) - case "NamespacesClient.NewListPager": - resp, err = n.dispatchNewListPager(req) - case "NamespacesClient.NewListAuthorizationRulesPager": - resp, err = n.dispatchNewListAuthorizationRulesPager(req) - case "NamespacesClient.NewListByResourceGroupPager": - resp, err = n.dispatchNewListByResourceGroupPager(req) - case "NamespacesClient.ListKeys": - resp, err = n.dispatchListKeys(req) - case "NamespacesClient.NewListNetworkRuleSetsPager": - resp, err = n.dispatchNewListNetworkRuleSetsPager(req) - case "NamespacesClient.RegenerateKeys": - resp, err = n.dispatchRegenerateKeys(req) - case "NamespacesClient.Update": - resp, err = n.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return n.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err - } +func (n *NamespacesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - return resp, nil + go func() { + var intercepted bool + var res result + if namespacesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = namespacesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "NamespacesClient.CheckNameAvailability": + res.resp, res.err = n.dispatchCheckNameAvailability(req) + case "NamespacesClient.BeginCreateOrUpdate": + res.resp, res.err = n.dispatchBeginCreateOrUpdate(req) + case "NamespacesClient.CreateOrUpdateAuthorizationRule": + res.resp, res.err = n.dispatchCreateOrUpdateAuthorizationRule(req) + case "NamespacesClient.CreateOrUpdateNetworkRuleSet": + res.resp, res.err = n.dispatchCreateOrUpdateNetworkRuleSet(req) + case "NamespacesClient.BeginDelete": + res.resp, res.err = n.dispatchBeginDelete(req) + case "NamespacesClient.DeleteAuthorizationRule": + res.resp, res.err = n.dispatchDeleteAuthorizationRule(req) + case "NamespacesClient.Get": + res.resp, res.err = n.dispatchGet(req) + case "NamespacesClient.GetAuthorizationRule": + res.resp, res.err = n.dispatchGetAuthorizationRule(req) + case "NamespacesClient.GetNetworkRuleSet": + res.resp, res.err = n.dispatchGetNetworkRuleSet(req) + case "NamespacesClient.NewListPager": + res.resp, res.err = n.dispatchNewListPager(req) + case "NamespacesClient.NewListAuthorizationRulesPager": + res.resp, res.err = n.dispatchNewListAuthorizationRulesPager(req) + case "NamespacesClient.NewListByResourceGroupPager": + res.resp, res.err = n.dispatchNewListByResourceGroupPager(req) + case "NamespacesClient.ListKeys": + res.resp, res.err = n.dispatchListKeys(req) + case "NamespacesClient.NewListNetworkRuleSetsPager": + res.resp, res.err = n.dispatchNewListNetworkRuleSetsPager(req) + case "NamespacesClient.RegenerateKeys": + res.resp, res.err = n.dispatchRegenerateKeys(req) + case "NamespacesClient.Update": + res.resp, res.err = n.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (n *NamespacesServerTransport) dispatchCheckNameAvailability(req *http.Request) (*http.Response, error) { @@ -776,3 +792,9 @@ func (n *NamespacesServerTransport) dispatchUpdate(req *http.Request) (*http.Res } return resp, nil } + +// set this to conditionally intercept incoming requests to NamespacesServerTransport +var namespacesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/servicebus/armservicebus/fake/operations_server.go b/sdk/resourcemanager/servicebus/armservicebus/fake/operations_server.go index 95fc10a9ab05..cf6f15c8bb88 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/fake/operations_server.go +++ b/sdk/resourcemanager/servicebus/armservicebus/fake/operations_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -51,21 +48,40 @@ func (o *OperationsServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return o.dispatchToMethodFake(req, method) +} - switch method { - case "OperationsClient.NewListPager": - resp, err = o.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (o *OperationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if operationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = operationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "OperationsClient.NewListPager": + res.resp, res.err = o.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -94,3 +110,9 @@ func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*ht } return resp, nil } + +// set this to conditionally intercept incoming requests to OperationsServerTransport +var operationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/servicebus/armservicebus/fake/privateendpointconnections_server.go b/sdk/resourcemanager/servicebus/armservicebus/fake/privateendpointconnections_server.go index e5ec69336c78..b24774a20c15 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/fake/privateendpointconnections_server.go +++ b/sdk/resourcemanager/servicebus/armservicebus/fake/privateendpointconnections_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -25,7 +22,7 @@ import ( // PrivateEndpointConnectionsServer is a fake server for instances of the armservicebus.PrivateEndpointConnectionsClient type. type PrivateEndpointConnectionsServer struct { // CreateOrUpdate is the fake for method PrivateEndpointConnectionsClient.CreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated, http.StatusAccepted CreateOrUpdate func(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string, parameters armservicebus.PrivateEndpointConnection, options *armservicebus.PrivateEndpointConnectionsClientCreateOrUpdateOptions) (resp azfake.Responder[armservicebus.PrivateEndpointConnectionsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method PrivateEndpointConnectionsClient.BeginDelete @@ -68,27 +65,46 @@ func (p *PrivateEndpointConnectionsServerTransport) Do(req *http.Request) (*http return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return p.dispatchToMethodFake(req, method) +} - switch method { - case "PrivateEndpointConnectionsClient.CreateOrUpdate": - resp, err = p.dispatchCreateOrUpdate(req) - case "PrivateEndpointConnectionsClient.BeginDelete": - resp, err = p.dispatchBeginDelete(req) - case "PrivateEndpointConnectionsClient.Get": - resp, err = p.dispatchGet(req) - case "PrivateEndpointConnectionsClient.NewListPager": - resp, err = p.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (p *PrivateEndpointConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if privateEndpointConnectionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = privateEndpointConnectionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "PrivateEndpointConnectionsClient.CreateOrUpdate": + res.resp, res.err = p.dispatchCreateOrUpdate(req) + case "PrivateEndpointConnectionsClient.BeginDelete": + res.resp, res.err = p.dispatchBeginDelete(req) + case "PrivateEndpointConnectionsClient.Get": + res.resp, res.err = p.dispatchGet(req) + case "PrivateEndpointConnectionsClient.NewListPager": + res.resp, res.err = p.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (p *PrivateEndpointConnectionsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -122,8 +138,8 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchCreateOrUpdate(req * return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} + if !contains([]int{http.StatusOK, http.StatusCreated, http.StatusAccepted}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated, http.StatusAccepted", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PrivateEndpointConnection, req) if err != nil { @@ -257,3 +273,9 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchNewListPager(req *ht } return resp, nil } + +// set this to conditionally intercept incoming requests to PrivateEndpointConnectionsServerTransport +var privateEndpointConnectionsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/servicebus/armservicebus/fake/privatelinkresources_server.go b/sdk/resourcemanager/servicebus/armservicebus/fake/privatelinkresources_server.go index eb6fac85e744..f8276b6ef49a 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/fake/privatelinkresources_server.go +++ b/sdk/resourcemanager/servicebus/armservicebus/fake/privatelinkresources_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -49,21 +46,40 @@ func (p *PrivateLinkResourcesServerTransport) Do(req *http.Request) (*http.Respo return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return p.dispatchToMethodFake(req, method) +} - switch method { - case "PrivateLinkResourcesClient.Get": - resp, err = p.dispatchGet(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (p *PrivateLinkResourcesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if privateLinkResourcesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = privateLinkResourcesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "PrivateLinkResourcesClient.Get": + res.resp, res.err = p.dispatchGet(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (p *PrivateLinkResourcesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -98,3 +114,9 @@ func (p *PrivateLinkResourcesServerTransport) dispatchGet(req *http.Request) (*h } return resp, nil } + +// set this to conditionally intercept incoming requests to PrivateLinkResourcesServerTransport +var privateLinkResourcesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/servicebus/armservicebus/fake/queues_server.go b/sdk/resourcemanager/servicebus/armservicebus/fake/queues_server.go index c285182b3e4f..7f7b6eab210c 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/fake/queues_server.go +++ b/sdk/resourcemanager/servicebus/armservicebus/fake/queues_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -93,39 +90,58 @@ func (q *QueuesServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return q.dispatchToMethodFake(req, method) +} - switch method { - case "QueuesClient.CreateOrUpdate": - resp, err = q.dispatchCreateOrUpdate(req) - case "QueuesClient.CreateOrUpdateAuthorizationRule": - resp, err = q.dispatchCreateOrUpdateAuthorizationRule(req) - case "QueuesClient.Delete": - resp, err = q.dispatchDelete(req) - case "QueuesClient.DeleteAuthorizationRule": - resp, err = q.dispatchDeleteAuthorizationRule(req) - case "QueuesClient.Get": - resp, err = q.dispatchGet(req) - case "QueuesClient.GetAuthorizationRule": - resp, err = q.dispatchGetAuthorizationRule(req) - case "QueuesClient.NewListAuthorizationRulesPager": - resp, err = q.dispatchNewListAuthorizationRulesPager(req) - case "QueuesClient.NewListByNamespacePager": - resp, err = q.dispatchNewListByNamespacePager(req) - case "QueuesClient.ListKeys": - resp, err = q.dispatchListKeys(req) - case "QueuesClient.RegenerateKeys": - resp, err = q.dispatchRegenerateKeys(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (q *QueuesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if queuesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = queuesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "QueuesClient.CreateOrUpdate": + res.resp, res.err = q.dispatchCreateOrUpdate(req) + case "QueuesClient.CreateOrUpdateAuthorizationRule": + res.resp, res.err = q.dispatchCreateOrUpdateAuthorizationRule(req) + case "QueuesClient.Delete": + res.resp, res.err = q.dispatchDelete(req) + case "QueuesClient.DeleteAuthorizationRule": + res.resp, res.err = q.dispatchDeleteAuthorizationRule(req) + case "QueuesClient.Get": + res.resp, res.err = q.dispatchGet(req) + case "QueuesClient.GetAuthorizationRule": + res.resp, res.err = q.dispatchGetAuthorizationRule(req) + case "QueuesClient.NewListAuthorizationRulesPager": + res.resp, res.err = q.dispatchNewListAuthorizationRulesPager(req) + case "QueuesClient.NewListByNamespacePager": + res.resp, res.err = q.dispatchNewListByNamespacePager(req) + case "QueuesClient.ListKeys": + res.resp, res.err = q.dispatchListKeys(req) + case "QueuesClient.RegenerateKeys": + res.resp, res.err = q.dispatchRegenerateKeys(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (q *QueuesServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -577,3 +593,9 @@ func (q *QueuesServerTransport) dispatchRegenerateKeys(req *http.Request) (*http } return resp, nil } + +// set this to conditionally intercept incoming requests to QueuesServerTransport +var queuesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/servicebus/armservicebus/fake/rules_server.go b/sdk/resourcemanager/servicebus/armservicebus/fake/rules_server.go index 64b8cc259ab1..51bb1b5da6ec 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/fake/rules_server.go +++ b/sdk/resourcemanager/servicebus/armservicebus/fake/rules_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -67,27 +64,46 @@ func (r *RulesServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return r.dispatchToMethodFake(req, method) +} - switch method { - case "RulesClient.CreateOrUpdate": - resp, err = r.dispatchCreateOrUpdate(req) - case "RulesClient.Delete": - resp, err = r.dispatchDelete(req) - case "RulesClient.Get": - resp, err = r.dispatchGet(req) - case "RulesClient.NewListBySubscriptionsPager": - resp, err = r.dispatchNewListBySubscriptionsPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (r *RulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if rulesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = rulesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "RulesClient.CreateOrUpdate": + res.resp, res.err = r.dispatchCreateOrUpdate(req) + case "RulesClient.Delete": + res.resp, res.err = r.dispatchDelete(req) + case "RulesClient.Get": + res.resp, res.err = r.dispatchGet(req) + case "RulesClient.NewListBySubscriptionsPager": + res.resp, res.err = r.dispatchNewListBySubscriptionsPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (r *RulesServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -313,3 +329,9 @@ func (r *RulesServerTransport) dispatchNewListBySubscriptionsPager(req *http.Req } return resp, nil } + +// set this to conditionally intercept incoming requests to RulesServerTransport +var rulesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/servicebus/armservicebus/fake/server_factory.go b/sdk/resourcemanager/servicebus/armservicebus/fake/server_factory.go index 84667dc7101f..3c041f4e58b8 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/fake/server_factory.go +++ b/sdk/resourcemanager/servicebus/armservicebus/fake/server_factory.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -19,16 +16,35 @@ import ( // ServerFactory is a fake server for instances of the armservicebus.ClientFactory type. type ServerFactory struct { - DisasterRecoveryConfigsServer DisasterRecoveryConfigsServer - MigrationConfigsServer MigrationConfigsServer - NamespacesServer NamespacesServer - OperationsServer OperationsServer + // DisasterRecoveryConfigsServer contains the fakes for client DisasterRecoveryConfigsClient + DisasterRecoveryConfigsServer DisasterRecoveryConfigsServer + + // MigrationConfigsServer contains the fakes for client MigrationConfigsClient + MigrationConfigsServer MigrationConfigsServer + + // NamespacesServer contains the fakes for client NamespacesClient + NamespacesServer NamespacesServer + + // OperationsServer contains the fakes for client OperationsClient + OperationsServer OperationsServer + + // PrivateEndpointConnectionsServer contains the fakes for client PrivateEndpointConnectionsClient PrivateEndpointConnectionsServer PrivateEndpointConnectionsServer - PrivateLinkResourcesServer PrivateLinkResourcesServer - QueuesServer QueuesServer - RulesServer RulesServer - SubscriptionsServer SubscriptionsServer - TopicsServer TopicsServer + + // PrivateLinkResourcesServer contains the fakes for client PrivateLinkResourcesClient + PrivateLinkResourcesServer PrivateLinkResourcesServer + + // QueuesServer contains the fakes for client QueuesClient + QueuesServer QueuesServer + + // RulesServer contains the fakes for client RulesClient + RulesServer RulesServer + + // SubscriptionsServer contains the fakes for client SubscriptionsClient + SubscriptionsServer SubscriptionsServer + + // TopicsServer contains the fakes for client TopicsClient + TopicsServer TopicsServer } // NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. diff --git a/sdk/resourcemanager/servicebus/armservicebus/fake/subscriptions_server.go b/sdk/resourcemanager/servicebus/armservicebus/fake/subscriptions_server.go index 64f1f8222ddd..b768b0d9e393 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/fake/subscriptions_server.go +++ b/sdk/resourcemanager/servicebus/armservicebus/fake/subscriptions_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -67,27 +64,46 @@ func (s *SubscriptionsServerTransport) Do(req *http.Request) (*http.Response, er return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "SubscriptionsClient.CreateOrUpdate": - resp, err = s.dispatchCreateOrUpdate(req) - case "SubscriptionsClient.Delete": - resp, err = s.dispatchDelete(req) - case "SubscriptionsClient.Get": - resp, err = s.dispatchGet(req) - case "SubscriptionsClient.NewListByTopicPager": - resp, err = s.dispatchNewListByTopicPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *SubscriptionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if subscriptionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = subscriptionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SubscriptionsClient.CreateOrUpdate": + res.resp, res.err = s.dispatchCreateOrUpdate(req) + case "SubscriptionsClient.Delete": + res.resp, res.err = s.dispatchDelete(req) + case "SubscriptionsClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SubscriptionsClient.NewListByTopicPager": + res.resp, res.err = s.dispatchNewListByTopicPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *SubscriptionsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -297,3 +313,9 @@ func (s *SubscriptionsServerTransport) dispatchNewListByTopicPager(req *http.Req } return resp, nil } + +// set this to conditionally intercept incoming requests to SubscriptionsServerTransport +var subscriptionsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/servicebus/armservicebus/fake/time_rfc3339.go b/sdk/resourcemanager/servicebus/armservicebus/fake/time_rfc3339.go deleted file mode 100644 index b0535a7b63e6..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/fake/time_rfc3339.go +++ /dev/null @@ -1,86 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) - -const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` -) - -type dateTimeRFC3339 time.Time - -func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t dateTimeRFC3339) MarshalText() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { - layout = dateTimeJSON - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { - layout = time.RFC3339Nano - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = dateTimeRFC3339(p) - return err -} - -func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*dateTimeRFC3339)(t) -} - -func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { - return nil - } - var aux dateTimeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/sdk/resourcemanager/servicebus/armservicebus/fake/topics_server.go b/sdk/resourcemanager/servicebus/armservicebus/fake/topics_server.go index 548d921cc225..83ae2106bbed 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/fake/topics_server.go +++ b/sdk/resourcemanager/servicebus/armservicebus/fake/topics_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -93,39 +90,58 @@ func (t *TopicsServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return t.dispatchToMethodFake(req, method) +} - switch method { - case "TopicsClient.CreateOrUpdate": - resp, err = t.dispatchCreateOrUpdate(req) - case "TopicsClient.CreateOrUpdateAuthorizationRule": - resp, err = t.dispatchCreateOrUpdateAuthorizationRule(req) - case "TopicsClient.Delete": - resp, err = t.dispatchDelete(req) - case "TopicsClient.DeleteAuthorizationRule": - resp, err = t.dispatchDeleteAuthorizationRule(req) - case "TopicsClient.Get": - resp, err = t.dispatchGet(req) - case "TopicsClient.GetAuthorizationRule": - resp, err = t.dispatchGetAuthorizationRule(req) - case "TopicsClient.NewListAuthorizationRulesPager": - resp, err = t.dispatchNewListAuthorizationRulesPager(req) - case "TopicsClient.NewListByNamespacePager": - resp, err = t.dispatchNewListByNamespacePager(req) - case "TopicsClient.ListKeys": - resp, err = t.dispatchListKeys(req) - case "TopicsClient.RegenerateKeys": - resp, err = t.dispatchRegenerateKeys(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (t *TopicsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if topicsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = topicsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "TopicsClient.CreateOrUpdate": + res.resp, res.err = t.dispatchCreateOrUpdate(req) + case "TopicsClient.CreateOrUpdateAuthorizationRule": + res.resp, res.err = t.dispatchCreateOrUpdateAuthorizationRule(req) + case "TopicsClient.Delete": + res.resp, res.err = t.dispatchDelete(req) + case "TopicsClient.DeleteAuthorizationRule": + res.resp, res.err = t.dispatchDeleteAuthorizationRule(req) + case "TopicsClient.Get": + res.resp, res.err = t.dispatchGet(req) + case "TopicsClient.GetAuthorizationRule": + res.resp, res.err = t.dispatchGetAuthorizationRule(req) + case "TopicsClient.NewListAuthorizationRulesPager": + res.resp, res.err = t.dispatchNewListAuthorizationRulesPager(req) + case "TopicsClient.NewListByNamespacePager": + res.resp, res.err = t.dispatchNewListByNamespacePager(req) + case "TopicsClient.ListKeys": + res.resp, res.err = t.dispatchListKeys(req) + case "TopicsClient.RegenerateKeys": + res.resp, res.err = t.dispatchRegenerateKeys(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (t *TopicsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -577,3 +593,9 @@ func (t *TopicsServerTransport) dispatchRegenerateKeys(req *http.Request) (*http } return resp, nil } + +// set this to conditionally intercept incoming requests to TopicsServerTransport +var topicsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/servicebus/armservicebus/go.mod b/sdk/resourcemanager/servicebus/armservicebus/go.mod index d9db2421c1e5..88aea855c338 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/go.mod +++ b/sdk/resourcemanager/servicebus/armservicebus/go.mod @@ -4,7 +4,6 @@ go 1.23.0 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 @@ -12,6 +11,7 @@ require ( ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/golang-jwt/jwt/v5 v5.2.2 // indirect diff --git a/sdk/resourcemanager/servicebus/armservicebus/migrationconfigs_client.go b/sdk/resourcemanager/servicebus/armservicebus/migrationconfigs_client.go index 8308d1e2dda3..ffd15393cebb 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/migrationconfigs_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/migrationconfigs_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -49,8 +46,8 @@ func NewMigrationConfigsClient(subscriptionID string, credential azcore.TokenCre // operation will fail when entity migration is in-progress. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - configName - The configuration name. Should always be "$default". // - options - MigrationConfigsClientCompleteMigrationOptions contains the optional parameters for the MigrationConfigsClient.CompleteMigration @@ -77,7 +74,7 @@ func (client *MigrationConfigsClient) CompleteMigration(ctx context.Context, res } // completeMigrationCreateRequest creates the CompleteMigration request. -func (client *MigrationConfigsClient) completeMigrationCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, configName MigrationConfigurationName, options *MigrationConfigsClientCompleteMigrationOptions) (*policy.Request, error) { +func (client *MigrationConfigsClient) completeMigrationCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, configName MigrationConfigurationName, _ *MigrationConfigsClientCompleteMigrationOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}/upgrade" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -100,7 +97,7 @@ func (client *MigrationConfigsClient) completeMigrationCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -110,8 +107,8 @@ func (client *MigrationConfigsClient) completeMigrationCreateRequest(ctx context // namespace // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - configName - The configuration name. Should always be "$default". // - parameters - Parameters required to create Migration Configuration @@ -137,7 +134,7 @@ func (client *MigrationConfigsClient) BeginCreateAndStartMigration(ctx context.C // CreateAndStartMigration - Creates Migration configuration and starts migration of entities from Standard to Premium namespace // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2024-01-01 func (client *MigrationConfigsClient) createAndStartMigration(ctx context.Context, resourceGroupName string, namespaceName string, configName MigrationConfigurationName, parameters MigrationConfigProperties, options *MigrationConfigsClientBeginCreateAndStartMigrationOptions) (*http.Response, error) { var err error const operationName = "MigrationConfigsClient.BeginCreateAndStartMigration" @@ -160,7 +157,7 @@ func (client *MigrationConfigsClient) createAndStartMigration(ctx context.Contex } // createAndStartMigrationCreateRequest creates the CreateAndStartMigration request. -func (client *MigrationConfigsClient) createAndStartMigrationCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, configName MigrationConfigurationName, parameters MigrationConfigProperties, options *MigrationConfigsClientBeginCreateAndStartMigrationOptions) (*policy.Request, error) { +func (client *MigrationConfigsClient) createAndStartMigrationCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, configName MigrationConfigurationName, parameters MigrationConfigProperties, _ *MigrationConfigsClientBeginCreateAndStartMigrationOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -183,7 +180,7 @@ func (client *MigrationConfigsClient) createAndStartMigrationCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -195,8 +192,8 @@ func (client *MigrationConfigsClient) createAndStartMigrationCreateRequest(ctx c // Delete - Deletes a MigrationConfiguration // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - configName - The configuration name. Should always be "$default". // - options - MigrationConfigsClientDeleteOptions contains the optional parameters for the MigrationConfigsClient.Delete method. @@ -222,7 +219,7 @@ func (client *MigrationConfigsClient) Delete(ctx context.Context, resourceGroupN } // deleteCreateRequest creates the Delete request. -func (client *MigrationConfigsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, configName MigrationConfigurationName, options *MigrationConfigsClientDeleteOptions) (*policy.Request, error) { +func (client *MigrationConfigsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, configName MigrationConfigurationName, _ *MigrationConfigsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -245,7 +242,7 @@ func (client *MigrationConfigsClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,8 +251,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - configName - The configuration name. Should always be "$default". // - options - MigrationConfigsClientGetOptions contains the optional parameters for the MigrationConfigsClient.Get method. @@ -282,7 +279,7 @@ func (client *MigrationConfigsClient) Get(ctx context.Context, resourceGroupName } // getCreateRequest creates the Get request. -func (client *MigrationConfigsClient) getCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, configName MigrationConfigurationName, options *MigrationConfigsClientGetOptions) (*policy.Request, error) { +func (client *MigrationConfigsClient) getCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, configName MigrationConfigurationName, _ *MigrationConfigsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -305,7 +302,7 @@ func (client *MigrationConfigsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -322,8 +319,8 @@ func (client *MigrationConfigsClient) getHandleResponse(resp *http.Response) (Mi // NewListPager - Gets all migrationConfigurations // -// Generated from API version 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - options - MigrationConfigsClientListOptions contains the optional parameters for the MigrationConfigsClient.NewListPager // method. @@ -351,7 +348,7 @@ func (client *MigrationConfigsClient) NewListPager(resourceGroupName string, nam } // listCreateRequest creates the List request. -func (client *MigrationConfigsClient) listCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, options *MigrationConfigsClientListOptions) (*policy.Request, error) { +func (client *MigrationConfigsClient) listCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, _ *MigrationConfigsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -370,7 +367,7 @@ func (client *MigrationConfigsClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -388,8 +385,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - configName - The configuration name. Should always be "$default". // - options - MigrationConfigsClientRevertOptions contains the optional parameters for the MigrationConfigsClient.Revert method. @@ -415,7 +412,7 @@ func (client *MigrationConfigsClient) Revert(ctx context.Context, resourceGroupN } // revertCreateRequest creates the Revert request. -func (client *MigrationConfigsClient) revertCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, configName MigrationConfigurationName, options *MigrationConfigsClientRevertOptions) (*policy.Request, error) { +func (client *MigrationConfigsClient) revertCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, configName MigrationConfigurationName, _ *MigrationConfigsClientRevertOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}/revert" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -438,7 +435,7 @@ func (client *MigrationConfigsClient) revertCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicebus/armservicebus/migrationconfigs_client_example_test.go b/sdk/resourcemanager/servicebus/armservicebus/migrationconfigs_client_example_test.go deleted file mode 100644 index ee65f5f6e14b..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/migrationconfigs_client_example_test.go +++ /dev/null @@ -1,181 +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. -// DO NOT EDIT. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMigrationConfigsClient().NewListPager("ResourceGroup", "sdk-Namespace-9259", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MigrationConfigListResult = armservicebus.MigrationConfigListResult{ - // Value: []*armservicebus.MigrationConfigProperties{ - // { - // Name: to.Ptr("sdk-Namespace-9259"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/migrationconfigurations"), - // ID: to.Ptr("/subscriptions/SubscriptionId/resourceGroups/ResourceGroup/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-9259/migrationConfigs/sdk-Namespace-9259"), - // Properties: &armservicebus.MigrationConfigPropertiesProperties{ - // MigrationState: to.Ptr("Active"), - // PostMigrationName: to.Ptr("sdk-PostMigration-9423"), - // ProvisioningState: to.Ptr("Succeeded"), - // TargetNamespace: to.Ptr("/subscriptions/SubscriptionId/resourceGroups/ResourceGroup/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-7454"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMigrationConfigsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MigrationConfigProperties = armservicebus.MigrationConfigProperties{ - // Name: to.Ptr("sdk-Namespace-41"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/disasterrecoveryconfigs"), - // ID: to.Ptr("/subscriptions/SubscriptionId/resourceGroups/ResourceGroup/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-41/migrationConfigs/$default"), - // Properties: &armservicebus.MigrationConfigPropertiesProperties{ - // MigrationState: to.Ptr("Initiating"), - // PostMigrationName: to.Ptr("sdk-PostMigration-5919"), - // ProvisioningState: to.Ptr("Succeeded"), - // TargetNamespace: to.Ptr("/subscriptions/SubscriptionId/resourceGroups/ResourceGroup/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-4028"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewMigrationConfigsClient().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/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMigrationConfigsClient().Get(ctx, "ResourceGroup", "sdk-Namespace-41", armservicebus.MigrationConfigurationNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MigrationConfigProperties = armservicebus.MigrationConfigProperties{ - // Name: to.Ptr("sdk-Namespace-41"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/disasterrecoveryconfigs"), - // ID: to.Ptr("/subscriptions/SubscriptionId/resourceGroups/ResourceGroup/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-41/migrationConfigs/$default"), - // Properties: &armservicebus.MigrationConfigPropertiesProperties{ - // MigrationState: to.Ptr("Active"), - // PendingReplicationOperationsCount: to.Ptr[int64](0), - // PostMigrationName: to.Ptr("sdk-PostMigration-5919"), - // ProvisioningState: to.Ptr("Succeeded"), - // TargetNamespace: to.Ptr("/subscriptions/SubscriptionId/resourceGroups/ResourceGroup/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-4028"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewMigrationConfigsClient().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/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewMigrationConfigsClient().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/models.go b/sdk/resourcemanager/servicebus/armservicebus/models.go index 9e84f4f815ab..0e7c50b44b72 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/models.go +++ b/sdk/resourcemanager/servicebus/armservicebus/models.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -160,7 +157,8 @@ type CorrelationFilter struct { // Encryption - Properties to configure Encryption type Encryption struct { - // Enumerates the possible value of keySource for Encryption + // CONSTANT; Enumerates the possible value of keySource for Encryption + // Field has constant value "Microsoft.KeyVault", any specified value is ignored. KeySource *string // Properties of KeyVault @@ -704,9 +702,19 @@ type SBNamespaceProperties struct { // Properties of BYOK Encryption description Encryption *Encryption + // The minimum TLS version for the cluster to support, e.g. '1.2' + MinimumTLSVersion *TLSVersion + + // 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 + // List of private endpoint connections. PrivateEndpointConnections []*PrivateEndpointConnection + // This determines if traffic is allowed over public network. By default it is enabled. + PublicNetworkAccess *PublicNetworkAccess + // Enabling this property creates a Premium Service Bus Namespace in regions supported availability zones. ZoneRedundant *bool @@ -898,7 +906,10 @@ type SBSKU struct { // REQUIRED; Name of this SKU. Name *SKUName - // 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 // The billing tier of this particular SKU. diff --git a/sdk/resourcemanager/servicebus/armservicebus/models_serde.go b/sdk/resourcemanager/servicebus/armservicebus/models_serde.go index 368863a0ea5d..31f7fda7303f 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/models_serde.go +++ b/sdk/resourcemanager/servicebus/armservicebus/models_serde.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -1854,8 +1851,11 @@ func (s SBNamespaceProperties) MarshalJSON() ([]byte, error) { 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) populateDateTimeRFC3339(objectMap, "updatedAt", s.UpdatedAt) @@ -1887,12 +1887,21 @@ func (s *SBNamespaceProperties) UnmarshalJSON(data []byte) error { 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) @@ -2867,7 +2876,7 @@ func populateAny(m map[string]any, k string, v any) { } func unpopulate(data json.RawMessage, fn string, v any) error { - if data == nil { + if data == nil || string(data) == "null" { return nil } if err := json.Unmarshal(data, v); err != nil { diff --git a/sdk/resourcemanager/servicebus/armservicebus/namespaces_client.go b/sdk/resourcemanager/servicebus/armservicebus/namespaces_client.go index 3c3b7331dac0..b7287277079f 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/namespaces_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/namespaces_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -47,7 +44,7 @@ func NewNamespacesClient(subscriptionID string, credential azcore.TokenCredentia // CheckNameAvailability - Check the give namespace name availability. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2024-01-01 // - parameters - Parameters to check availability of the given namespace name // - options - NamespacesClientCheckNameAvailabilityOptions contains the optional parameters for the NamespacesClient.CheckNameAvailability // method. @@ -74,7 +71,7 @@ func (client *NamespacesClient) CheckNameAvailability(ctx context.Context, param } // checkNameAvailabilityCreateRequest creates the CheckNameAvailability request. -func (client *NamespacesClient) checkNameAvailabilityCreateRequest(ctx context.Context, parameters CheckNameAvailability, options *NamespacesClientCheckNameAvailabilityOptions) (*policy.Request, error) { +func (client *NamespacesClient) checkNameAvailabilityCreateRequest(ctx context.Context, parameters CheckNameAvailability, _ *NamespacesClientCheckNameAvailabilityOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/CheckNameAvailability" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -85,7 +82,7 @@ func (client *NamespacesClient) checkNameAvailabilityCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -107,8 +104,8 @@ func (client *NamespacesClient) checkNameAvailabilityHandleResponse(resp *http.R // This operation is idempotent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name. // - parameters - Parameters supplied to create a namespace resource. // - options - NamespacesClientBeginCreateOrUpdateOptions contains the optional parameters for the NamespacesClient.BeginCreateOrUpdate @@ -134,7 +131,7 @@ func (client *NamespacesClient) BeginCreateOrUpdate(ctx context.Context, resourc // This operation is idempotent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2024-01-01 func (client *NamespacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, parameters SBNamespace, options *NamespacesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "NamespacesClient.BeginCreateOrUpdate" @@ -157,7 +154,7 @@ func (client *NamespacesClient) createOrUpdate(ctx context.Context, resourceGrou } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *NamespacesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, parameters SBNamespace, options *NamespacesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *NamespacesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, parameters SBNamespace, _ *NamespacesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -176,7 +173,7 @@ func (client *NamespacesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -188,8 +185,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - authorizationRuleName - The authorization rule name. // - parameters - The shared access authorization rule. @@ -218,7 +215,7 @@ func (client *NamespacesClient) CreateOrUpdateAuthorizationRule(ctx context.Cont } // createOrUpdateAuthorizationRuleCreateRequest creates the CreateOrUpdateAuthorizationRule request. -func (client *NamespacesClient) createOrUpdateAuthorizationRuleCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, parameters SBAuthorizationRule, options *NamespacesClientCreateOrUpdateAuthorizationRuleOptions) (*policy.Request, error) { +func (client *NamespacesClient) createOrUpdateAuthorizationRuleCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, parameters SBAuthorizationRule, _ *NamespacesClientCreateOrUpdateAuthorizationRuleOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -241,7 +238,7 @@ func (client *NamespacesClient) createOrUpdateAuthorizationRuleCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -262,8 +259,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - parameters - The Namespace IpFilterRule. // - options - NamespacesClientCreateOrUpdateNetworkRuleSetOptions contains the optional parameters for the NamespacesClient.CreateOrUpdateNetworkRuleSet @@ -291,7 +288,7 @@ func (client *NamespacesClient) CreateOrUpdateNetworkRuleSet(ctx context.Context } // createOrUpdateNetworkRuleSetCreateRequest creates the CreateOrUpdateNetworkRuleSet request. -func (client *NamespacesClient) createOrUpdateNetworkRuleSetCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, parameters NetworkRuleSet, options *NamespacesClientCreateOrUpdateNetworkRuleSetOptions) (*policy.Request, error) { +func (client *NamespacesClient) createOrUpdateNetworkRuleSetCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, parameters NetworkRuleSet, _ *NamespacesClientCreateOrUpdateNetworkRuleSetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/networkRuleSets/default" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -310,7 +307,7 @@ func (client *NamespacesClient) createOrUpdateNetworkRuleSetCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -331,8 +328,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - 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) { @@ -355,7 +352,7 @@ func (client *NamespacesClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Deletes an existing namespace. This operation also removes all associated resources under the namespace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2024-01-01 func (client *NamespacesClient) deleteOperation(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespacesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "NamespacesClient.BeginDelete" @@ -378,7 +375,7 @@ func (client *NamespacesClient) deleteOperation(ctx context.Context, resourceGro } // deleteCreateRequest creates the Delete request. -func (client *NamespacesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespacesClientBeginDeleteOptions) (*policy.Request, error) { +func (client *NamespacesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, _ *NamespacesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -397,7 +394,7 @@ func (client *NamespacesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -406,8 +403,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - authorizationRuleName - The authorization rule name. // - options - NamespacesClientDeleteAuthorizationRuleOptions contains the optional parameters for the NamespacesClient.DeleteAuthorizationRule @@ -434,7 +431,7 @@ func (client *NamespacesClient) DeleteAuthorizationRule(ctx context.Context, res } // deleteAuthorizationRuleCreateRequest creates the DeleteAuthorizationRule request. -func (client *NamespacesClient) deleteAuthorizationRuleCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, options *NamespacesClientDeleteAuthorizationRuleOptions) (*policy.Request, error) { +func (client *NamespacesClient) deleteAuthorizationRuleCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, _ *NamespacesClientDeleteAuthorizationRuleOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -457,7 +454,7 @@ func (client *NamespacesClient) deleteAuthorizationRuleCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -466,8 +463,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - 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) { @@ -493,7 +490,7 @@ func (client *NamespacesClient) Get(ctx context.Context, resourceGroupName strin } // getCreateRequest creates the Get request. -func (client *NamespacesClient) getCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespacesClientGetOptions) (*policy.Request, error) { +func (client *NamespacesClient) getCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, _ *NamespacesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -512,7 +509,7 @@ func (client *NamespacesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -530,8 +527,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - authorizationRuleName - The authorization rule name. // - options - NamespacesClientGetAuthorizationRuleOptions contains the optional parameters for the NamespacesClient.GetAuthorizationRule @@ -559,7 +556,7 @@ func (client *NamespacesClient) GetAuthorizationRule(ctx context.Context, resour } // getAuthorizationRuleCreateRequest creates the GetAuthorizationRule request. -func (client *NamespacesClient) getAuthorizationRuleCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, options *NamespacesClientGetAuthorizationRuleOptions) (*policy.Request, error) { +func (client *NamespacesClient) getAuthorizationRuleCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, _ *NamespacesClientGetAuthorizationRuleOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -582,7 +579,7 @@ func (client *NamespacesClient) getAuthorizationRuleCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -600,8 +597,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - options - NamespacesClientGetNetworkRuleSetOptions contains the optional parameters for the NamespacesClient.GetNetworkRuleSet // method. @@ -628,7 +625,7 @@ func (client *NamespacesClient) GetNetworkRuleSet(ctx context.Context, resourceG } // getNetworkRuleSetCreateRequest creates the GetNetworkRuleSet request. -func (client *NamespacesClient) getNetworkRuleSetCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespacesClientGetNetworkRuleSetOptions) (*policy.Request, error) { +func (client *NamespacesClient) getNetworkRuleSetCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, _ *NamespacesClientGetNetworkRuleSetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/networkRuleSets/default" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -647,7 +644,7 @@ func (client *NamespacesClient) getNetworkRuleSetCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -664,7 +661,7 @@ func (client *NamespacesClient) getNetworkRuleSetHandleResponse(resp *http.Respo // NewListPager - Gets all the available namespaces within the subscription, irrespective of the resource groups. // -// Generated from API version 2021-11-01 +// Generated from API version 2024-01-01 // - 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]{ @@ -690,7 +687,7 @@ func (client *NamespacesClient) NewListPager(options *NamespacesClientListOption } // listCreateRequest creates the List request. -func (client *NamespacesClient) listCreateRequest(ctx context.Context, options *NamespacesClientListOptions) (*policy.Request, error) { +func (client *NamespacesClient) listCreateRequest(ctx context.Context, _ *NamespacesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/namespaces" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -701,7 +698,7 @@ func (client *NamespacesClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -718,8 +715,8 @@ func (client *NamespacesClient) listHandleResponse(resp *http.Response) (Namespa // NewListAuthorizationRulesPager - Gets the authorization rules for a namespace. // -// Generated from API version 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - options - NamespacesClientListAuthorizationRulesOptions contains the optional parameters for the NamespacesClient.NewListAuthorizationRulesPager // method. @@ -747,7 +744,7 @@ func (client *NamespacesClient) NewListAuthorizationRulesPager(resourceGroupName } // listAuthorizationRulesCreateRequest creates the ListAuthorizationRules request. -func (client *NamespacesClient) listAuthorizationRulesCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespacesClientListAuthorizationRulesOptions) (*policy.Request, error) { +func (client *NamespacesClient) listAuthorizationRulesCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, _ *NamespacesClientListAuthorizationRulesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -766,7 +763,7 @@ func (client *NamespacesClient) listAuthorizationRulesCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -783,8 +780,8 @@ func (client *NamespacesClient) listAuthorizationRulesHandleResponse(resp *http. // NewListByResourceGroupPager - Gets the available namespaces within a resource group. // -// Generated from API version 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - NamespacesClientListByResourceGroupOptions contains the optional parameters for the NamespacesClient.NewListByResourceGroupPager // method. func (client *NamespacesClient) NewListByResourceGroupPager(resourceGroupName string, options *NamespacesClientListByResourceGroupOptions) *runtime.Pager[NamespacesClientListByResourceGroupResponse] { @@ -811,7 +808,7 @@ func (client *NamespacesClient) NewListByResourceGroupPager(resourceGroupName st } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *NamespacesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *NamespacesClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *NamespacesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *NamespacesClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -826,7 +823,7 @@ func (client *NamespacesClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -844,8 +841,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - authorizationRuleName - The authorization rule name. // - options - NamespacesClientListKeysOptions contains the optional parameters for the NamespacesClient.ListKeys method. @@ -872,7 +869,7 @@ func (client *NamespacesClient) ListKeys(ctx context.Context, resourceGroupName } // listKeysCreateRequest creates the ListKeys request. -func (client *NamespacesClient) listKeysCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, options *NamespacesClientListKeysOptions) (*policy.Request, error) { +func (client *NamespacesClient) listKeysCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, _ *NamespacesClientListKeysOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/listKeys" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -895,7 +892,7 @@ func (client *NamespacesClient) listKeysCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -912,8 +909,8 @@ func (client *NamespacesClient) listKeysHandleResponse(resp *http.Response) (Nam // NewListNetworkRuleSetsPager - Gets list of NetworkRuleSet for a Namespace. // -// Generated from API version 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - options - NamespacesClientListNetworkRuleSetsOptions contains the optional parameters for the NamespacesClient.NewListNetworkRuleSetsPager // method. @@ -941,7 +938,7 @@ func (client *NamespacesClient) NewListNetworkRuleSetsPager(resourceGroupName st } // listNetworkRuleSetsCreateRequest creates the ListNetworkRuleSets request. -func (client *NamespacesClient) listNetworkRuleSetsCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespacesClientListNetworkRuleSetsOptions) (*policy.Request, error) { +func (client *NamespacesClient) listNetworkRuleSetsCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, _ *NamespacesClientListNetworkRuleSetsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/networkRuleSets" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -960,7 +957,7 @@ func (client *NamespacesClient) listNetworkRuleSetsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -978,8 +975,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - authorizationRuleName - The authorization rule name. // - parameters - Parameters supplied to regenerate the authorization rule. @@ -1008,7 +1005,7 @@ func (client *NamespacesClient) RegenerateKeys(ctx context.Context, resourceGrou } // regenerateKeysCreateRequest creates the RegenerateKeys request. -func (client *NamespacesClient) regenerateKeysCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, parameters RegenerateAccessKeyParameters, options *NamespacesClientRegenerateKeysOptions) (*policy.Request, error) { +func (client *NamespacesClient) regenerateKeysCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, parameters RegenerateAccessKeyParameters, _ *NamespacesClientRegenerateKeysOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -1031,7 +1028,7 @@ func (client *NamespacesClient) regenerateKeysCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1053,8 +1050,8 @@ func (client *NamespacesClient) regenerateKeysHandleResponse(resp *http.Response // idempotent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - parameters - Parameters supplied to update a namespace resource. // - options - NamespacesClientUpdateOptions contains the optional parameters for the NamespacesClient.Update method. @@ -1081,7 +1078,7 @@ func (client *NamespacesClient) Update(ctx context.Context, resourceGroupName st } // updateCreateRequest creates the Update request. -func (client *NamespacesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, parameters SBNamespaceUpdateParameters, options *NamespacesClientUpdateOptions) (*policy.Request, error) { +func (client *NamespacesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, parameters SBNamespaceUpdateParameters, _ *NamespacesClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -1100,7 +1097,7 @@ func (client *NamespacesClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/servicebus/armservicebus/namespaces_client_example_test.go b/sdk/resourcemanager/servicebus/armservicebus/namespaces_client_example_test.go deleted file mode 100644 index 0c2916d52bae..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/namespaces_client_example_test.go +++ /dev/null @@ -1,1657 +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. -// DO NOT EDIT. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNamespacesClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SBNamespaceListResult = armservicebus.SBNamespaceListResult{ - // Value: []*armservicebus.SBNamespace{ - // { - // Name: to.Ptr("NS-91f08e47-2b04-4943-b0cd-a5fb02b88f20"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-91f08e47-2b04-4943-b0cd-a5fb02b88f20"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-23T02:40:17.270Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-91f08e47-2b04-4943-b0cd-a5fb02b88f20"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-91f08e47-2b04-4943-b0cd-a5fb02b88f20.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T07:15:30.780Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("NS-41dc63f4-0b08-4029-b3ef-535a131bfa65"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-41dc63f4-0b08-4029-b3ef-535a131bfa65"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-23T03:50:38.980Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-41dc63f4-0b08-4029-b3ef-535a131bfa65"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-41dc63f4-0b08-4029-b3ef-535a131bfa65.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T10:42:58.003Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("NS-df52cf51-e831-4bf2-bd92-e9885f68a996"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-df52cf51-e831-4bf2-bd92-e9885f68a996"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-16T01:17:54.997Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-df52cf51-e831-4bf2-bd92-e9885f68a996"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-df52cf51-e831-4bf2-bd92-e9885f68a996.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T06:44:39.737Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("SBPremium"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/RapscallionResources/providers/Microsoft.ServiceBus/namespaces/SBPremium"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-10-10T22:01:00.420Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:sbpremium"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://SBPremium.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-10-10T22:01:00.420Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNamePremium), - // Capacity: to.Ptr[int32](1), - // Tier: to.Ptr(armservicebus.SKUTierPremium), - // }, - // }, - // { - // Name: to.Ptr("rrama-ns2"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/sadfsadfsadf/providers/Microsoft.ServiceBus/namespaces/rrama-ns2"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-23T04:14:00.013Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:rrama-ns2"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://rrama-ns2.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-03T22:53:32.927Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("NS-20e57600-29d0-4035-ac85-74f4c54dcda1"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-20e57600-29d0-4035-ac85-74f4c54dcda1"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-23T03:30:49.160Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-20e57600-29d0-4035-ac85-74f4c54dcda1"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-20e57600-29d0-4035-ac85-74f4c54dcda1.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T04:17:58.483Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("NS-3e538a1a-58fb-4315-b2ce-76f5c944114c"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-3e538a1a-58fb-4315-b2ce-76f5c944114c"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-16T18:07:30.050Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-3e538a1a-58fb-4315-b2ce-76f5c944114c"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-3e538a1a-58fb-4315-b2ce-76f5c944114c.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T10:42:57.747Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("prem-ns123"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/prem-ns123"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-13T00:02:39.997Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:prem-ns123"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://prem-ns123.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-13T00:02:39.997Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNamePremium), - // Capacity: to.Ptr[int32](1), - // Tier: to.Ptr(armservicebus.SKUTierPremium), - // }, - // }, - // { - // Name: to.Ptr("NS-4e1bfdf1-0cff-4e86-ae80-cdcac4873039"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-4e1bfdf1-0cff-4e86-ae80-cdcac4873039"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-16T01:01:58.730Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-4e1bfdf1-0cff-4e86-ae80-cdcac4873039"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-4e1bfdf1-0cff-4e86-ae80-cdcac4873039.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T03:02:59.800Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("NS-6b90b7f3-7aa0-48c9-bc30-b299dcb66c03"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-6b90b7f3-7aa0-48c9-bc30-b299dcb66c03"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-23T03:22:45.327Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-6b90b7f3-7aa0-48c9-bc30-b299dcb66c03"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-6b90b7f3-7aa0-48c9-bc30-b299dcb66c03.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T06:08:01.207Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("NS-c05e9df3-7737-44ee-a321-15f6e0545b97"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-c05e9df3-7737-44ee-a321-15f6e0545b97"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-05T03:29:19.750Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-c05e9df3-7737-44ee-a321-15f6e0545b97"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-c05e9df3-7737-44ee-a321-15f6e0545b97.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T08:10:35.527Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("NS-dcb4152c-231b-4c16-a683-07cc6b38fa46"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-dcb4152c-231b-4c16-a683-07cc6b38fa46"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-05T03:34:35.363Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-dcb4152c-231b-4c16-a683-07cc6b38fa46"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-dcb4152c-231b-4c16-a683-07cc6b38fa46.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T05:33:00.957Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("NS-f501f5e6-1f24-439b-8982-9af665156d40"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-f501f5e6-1f24-439b-8982-9af665156d40"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-16T01:25:55.707Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-f501f5e6-1f24-439b-8982-9af665156d40"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-f501f5e6-1f24-439b-8982-9af665156d40.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T07:42:59.687Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("NS-fe2ed660-2cd6-46f2-a9c3-7e11551a1f30"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-fe2ed660-2cd6-46f2-a9c3-7e11551a1f30"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-23T02:32:08.227Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-fe2ed660-2cd6-46f2-a9c3-7e11551a1f30"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-fe2ed660-2cd6-46f2-a9c3-7e11551a1f30.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T06:32:57.770Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("NS-8a5e3b4e-4e97-4d85-9083-cd33536c9d71"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-8a5e3b4e-4e97-4d85-9083-cd33536c9d71"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-16T00:54:05.103Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-8a5e3b4e-4e97-4d85-9083-cd33536c9d71"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-8a5e3b4e-4e97-4d85-9083-cd33536c9d71.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T10:43:50.313Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("NS-6520cc09-01ac-40a3-bc09-c5c431116e92"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-6520cc09-01ac-40a3-bc09-c5c431116e92"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-16T01:49:59.243Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-6520cc09-01ac-40a3-bc09-c5c431116e92"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-6520cc09-01ac-40a3-bc09-c5c431116e92.servicebus.windows-int.net:443"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T08:15:36.950Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("NS-bfba6d5c-a425-42d9-85db-0f4da770e29a"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-bfba6d5c-a425-42d9-85db-0f4da770e29a"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-05T03:23:32.083Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-bfba6d5c-a425-42d9-85db-0f4da770e29a"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-bfba6d5c-a425-42d9-85db-0f4da770e29a.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T09:02:57.433Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("SBPrem"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/RapscallionResources/providers/Microsoft.ServiceBus/namespaces/SBPrem"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-10-10T22:16:30.870Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:sbprem"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://SBPrem.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-10-10T22:16:30.870Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNamePremium), - // Capacity: to.Ptr[int32](1), - // Tier: to.Ptr(armservicebus.SKUTierPremium), - // }, - // }, - // { - // Name: to.Ptr("NS-43b136b4-8716-40b2-97c5-0d77cac0062c"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-43b136b4-8716-40b2-97c5-0d77cac0062c"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-23T03:14:50.577Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-43b136b4-8716-40b2-97c5-0d77cac0062c"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-43b136b4-8716-40b2-97c5-0d77cac0062c.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T09:23:01.067Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("NS-7c0443de-5f88-450c-b574-83f60a097dd1"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-7c0443de-5f88-450c-b574-83f60a097dd1"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-23T04:07:15.397Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-7c0443de-5f88-450c-b574-83f60a097dd1"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-7c0443de-5f88-450c-b574-83f60a097dd1.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T04:03:03.097Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("NS-62dd7753-a5f9-42fd-a354-ca38a4505d69"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-62dd7753-a5f9-42fd-a354-ca38a4505d69"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-16T01:33:50.450Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-62dd7753-a5f9-42fd-a354-ca38a4505d69"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-62dd7753-a5f9-42fd-a354-ca38a4505d69.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T05:35:33.053Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("NS-ae18a18c-97ab-4089-965d-8acbf4794091"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-ae18a18c-97ab-4089-965d-8acbf4794091"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-23T02:43:36.517Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-ae18a18c-97ab-4089-965d-8acbf4794091"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-ae18a18c-97ab-4089-965d-8acbf4794091.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T12:40:30.587Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("NS-8e3b56c1-0ee8-4e13-ae88-5cadf6e2ce11"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-8e3b56c1-0ee8-4e13-ae88-5cadf6e2ce11"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-16T00:46:03.773Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-8e3b56c1-0ee8-4e13-ae88-5cadf6e2ce11"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-8e3b56c1-0ee8-4e13-ae88-5cadf6e2ce11.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T04:43:54.560Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("NS-7ffca4b4-4728-4fb0-b2d0-1e7c016e3a44"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-7ffca4b4-4728-4fb0-b2d0-1e7c016e3a44"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-23T03:59:12.100Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-7ffca4b4-4728-4fb0-b2d0-1e7c016e3a44"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-7ffca4b4-4728-4fb0-b2d0-1e7c016e3a44.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T06:33:52.230Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("NS-d9337efd-9b27-454c-b2a5-dcfea56920d9"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-d9337efd-9b27-454c-b2a5-dcfea56920d9"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-05T03:45:09.270Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-d9337efd-9b27-454c-b2a5-dcfea56920d9"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-d9337efd-9b27-454c-b2a5-dcfea56920d9.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T06:20:31.863Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("NS-ad5ae732-abea-4e62-9de0-c90de0ddec0a"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-ad5ae732-abea-4e62-9de0-c90de0ddec0a"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-23T02:34:36.447Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-ad5ae732-abea-4e62-9de0-c90de0ddec0a"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-ad5ae732-abea-4e62-9de0-c90de0ddec0a.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T06:15:31.607Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("NS-d447fb03-c7da-40fe-b5eb-14f36888837b"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-d447fb03-c7da-40fe-b5eb-14f36888837b"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-05T00:53:46.697Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-d447fb03-c7da-40fe-b5eb-14f36888837b"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-d447fb03-c7da-40fe-b5eb-14f36888837b.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T11:09:41.260Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("ReproSB"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/RapscallionResources/providers/Microsoft.ServiceBus/namespaces/ReproSB"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-27T19:29:34.523Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:reprosb"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://ReproSB.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-27T19:29:58.640Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("NS-4c90097f-19a8-42e7-bb3c-4ac088994719"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-4c90097f-19a8-42e7-bb3c-4ac088994719"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-16T17:35:32.610Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-4c90097f-19a8-42e7-bb3c-4ac088994719"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-4c90097f-19a8-42e7-bb3c-4ac088994719.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T09:13:52.270Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("rrama-1-23-17"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/rrama-1-23-17"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-01-23T22:54:40.907Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:rrama-1-23-17"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://rrama-1-23-17.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-04T00:53:28.777Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("NS-5191e541-8e4e-4229-9fdc-b89f6c3e7f12"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-5191e541-8e4e-4229-9fdc-b89f6c3e7f12"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-16T17:43:25.710Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-5191e541-8e4e-4229-9fdc-b89f6c3e7f12"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-5191e541-8e4e-4229-9fdc-b89f6c3e7f12.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T11:05:31.890Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("NS-be903820-3533-46e8-90e4-72c132411848"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-be903820-3533-46e8-90e4-72c132411848"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-05T03:24:01.923Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-be903820-3533-46e8-90e4-72c132411848"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-be903820-3533-46e8-90e4-72c132411848.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T10:09:42.513Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("rrama-namespace1"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/rrama-namespace1"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-05T00:47:22.963Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:rrama-namespace1"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://rrama-namespace1.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-05T00:47:27.297Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("NS-a3c38e9b-32a3-4c51-85d7-263150a8dda9"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-a3c38e9b-32a3-4c51-85d7-263150a8dda9"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-16T00:38:02.517Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-a3c38e9b-32a3-4c51-85d7-263150a8dda9"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-a3c38e9b-32a3-4c51-85d7-263150a8dda9.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T05:03:55.960Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("NS-70d3fa25-6bbe-4a6b-a381-a52cf0d539e6"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-70d3fa25-6bbe-4a6b-a381-a52cf0d539e6"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-23T03:42:40.010Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-70d3fa25-6bbe-4a6b-a381-a52cf0d539e6"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-70d3fa25-6bbe-4a6b-a381-a52cf0d539e6.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T06:33:02.363Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("NS-e6536f77-0d1b-4a6b-8f42-29cc15b2930a"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-e6536f77-0d1b-4a6b-8f42-29cc15b2930a"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-05T04:28:10.710Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-e6536f77-0d1b-4a6b-8f42-29cc15b2930a"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-e6536f77-0d1b-4a6b-8f42-29cc15b2930a.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T08:43:51.587Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("sdk-Namespace-2924"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-2924"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-25T22:26:36.760Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:sdk-namespace-2924"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://sdk-Namespace-2924.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-25T22:26:59.350Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("rrama-sb1"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/rrama-sb1"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-01T21:47:34.903Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:rrama-sb1"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://rrama-sb1.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-02T02:10:03.083Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("WhackWhack"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/RapscallionResources/providers/Microsoft.ServiceBus/namespaces/WhackWhack"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-10-10T23:39:01.347Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:whackwhack"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://WhackWhack.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-04T00:56:32.687Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("NS-66ed32d6-611e-4bb0-8e1a-a6d0fc65427c"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-66ed32d6-611e-4bb0-8e1a-a6d0fc65427c"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-16T17:51:27.730Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-66ed32d6-611e-4bb0-8e1a-a6d0fc65427c"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-66ed32d6-611e-4bb0-8e1a-a6d0fc65427c.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T08:19:43.383Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("NS-e0cab401-6df8-465d-8d4a-da9a9e55cf0e"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/NS-e0cab401-6df8-465d-8d4a-da9a9e55cf0e"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-05T01:14:25.613Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-e0cab401-6df8-465d-8d4a-da9a9e55cf0e"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://NS-e0cab401-6df8-465d-8d4a-da9a9e55cf0e.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-11T12:33:01.727Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("bn3-rrama-foo1"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/bn3-rrama-foo1"), - // Location: to.Ptr("East US 2"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-28T23:54:26.927Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:bn3-rrama-foo1"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://bn3-rrama-foo1.servicebus.int7.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-28T23:54:26.927Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("bn3-rrama-foo3"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/bn3-rrama-foo3"), - // Location: to.Ptr("East US 2"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-29T00:24:09.907Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:bn3-rrama-foo3"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://bn3-rrama-foo3.servicebus.int7.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-29T00:24:33.233Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("bn3-rrama-foo2"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/bn3-rrama-foo2"), - // Location: to.Ptr("East US 2"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-28T23:57:40.820Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:bn3-rrama-foo2"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://bn3-rrama-foo2.servicebus.int7.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-28T23:57:40.820Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("db3-rrama-foo2"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.ServiceBus/namespaces/db3-rrama-foo2"), - // Location: to.Ptr("North Europe"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-29T00:10:43.463Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:db3-rrama-foo2"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://db3-rrama-foo2.servicebus.int7.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-29T00:11:09.133Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNamespacesClient().NewListByResourceGroupPager("ArunMonocle", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SBNamespaceListResult = armservicebus.SBNamespaceListResult{ - // Value: []*armservicebus.SBNamespace{ - // { - // Name: to.Ptr("sdk-Namespace-2924"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-2924"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-25T22:26:36.760Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:sdk-namespace-2924"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://sdk-Namespace-2924.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-25T22:26:59.350Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNamespacesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SBNamespace = armservicebus.SBNamespace{ - // Name: to.Ptr("sdk-Namespace-2924"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-2924"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-25T22:26:36.760Z"); return t}()), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:sdk-namespace-2924"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://sdk-Namespace-2924.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-25T22:26:36.760Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNamespacesClient().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/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNamespacesClient().Get(ctx, "ArunMonocle", "sdk-Namespace-2924", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SBNamespace = armservicebus.SBNamespace{ - // Name: to.Ptr("sdk-Namespace-2924"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-2924"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-25T22:26:36.760Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:sdk-namespace-2924"), - // PrivateEndpointConnections: []*armservicebus.PrivateEndpointConnection{ - // { - // Name: to.Ptr("privateEndpointConnectionName"), - // Type: to.Ptr("Microsoft.EventHub/Namespaces/PrivateEndpointConnections"), - // ID: to.Ptr("/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.EventHub/namespaces/NamespaceSample/privateEndpointConnections/privateEndpointConnectionName"), - // Properties: &armservicebus.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armservicebus.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.Network/privateEndpoints/NamespaceSample"), - // }, - // PrivateLinkServiceConnectionState: &armservicebus.ConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // Status: to.Ptr(armservicebus.PrivateLinkConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armservicebus.EndPointProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://sdk-Namespace-2924.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-25T22:26:59.350Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNamespacesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SBNamespace = armservicebus.SBNamespace{ - // Name: to.Ptr("sdk-Namespace-3285"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-3285"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // "tag3": to.Ptr("value3"), - // "tag4": to.Ptr("value4"), - // }, - // Properties: &armservicebus.SBNamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-25T23:07:58.170Z"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:sdk-namespace-3285"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://sdk-Namespace-3285.servicebus.windows-int.net:443/"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-25T23:08:45.497Z"); return t}()), - // }, - // SKU: &armservicebus.SBSKU{ - // Name: to.Ptr(armservicebus.SKUNameStandard), - // Tier: to.Ptr(armservicebus.SKUTierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNamespacesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NetworkRuleSet = armservicebus.NetworkRuleSet{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/NetworkRuleSet"), - // ID: to.Ptr("/subscriptions/854d368f-1828-428f-8f3c-f2affa9b2f7d/resourceGroups/Default-ServiceBus-AustraliaEast/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-9659/networkruleset/default"), - // 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"), - // }}, - // PublicNetworkAccess: to.Ptr(armservicebus.PublicNetworkAccessFlagEnabled), - // 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"), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNamespacesClient().GetNetworkRuleSet(ctx, "ResourceGroup", "sdk-Namespace-6019", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NetworkRuleSet = armservicebus.NetworkRuleSet{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/NetworkRuleSet"), - // ID: to.Ptr("/subscriptions/subscriptionid/resourceGroups/Default-ServiceBus-AustraliaEast/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-9659/networkruleset/default"), - // Properties: &armservicebus.NetworkRuleSetProperties{ - // DefaultAction: to.Ptr(armservicebus.DefaultActionAllow), - // 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"), - // }}, - // PublicNetworkAccess: to.Ptr(armservicebus.PublicNetworkAccessFlagEnabled), - // VirtualNetworkRules: []*armservicebus.NWRuleSetVirtualNetworkRules{ - // { - // IgnoreMissingVnetServiceEndpoint: to.Ptr(true), - // Subnet: &armservicebus.Subnet{ - // ID: to.Ptr("/subscriptions/subscriptionid/resourcegroups/alitest/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet2"), - // }, - // }, - // { - // IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - // Subnet: &armservicebus.Subnet{ - // ID: to.Ptr("/subscriptions/subscriptionid/resourcegroups/alitest/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet3"), - // }, - // }, - // { - // IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - // Subnet: &armservicebus.Subnet{ - // ID: to.Ptr("/subscriptions/subscriptionid/resourcegroups/alitest/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet6"), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNamespacesClient().NewListNetworkRuleSetsPager("ResourceGroup", "sdk-Namespace-6019", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.NetworkRuleSetListResult = armservicebus.NetworkRuleSetListResult{ - // Value: []*armservicebus.NetworkRuleSet{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/NetworkRuleSet"), - // ID: to.Ptr("/subscriptions/subscriptionid/resourceGroups/resourcegroupid/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-9659/networkrulesets/default"), - // 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/subscriptionid/resourcegroups/resourcegroupid/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet2"), - // }, - // }, - // { - // IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - // Subnet: &armservicebus.Subnet{ - // ID: to.Ptr("/subscriptions/subscriptionid/resourcegroups/resourcegroupid/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet3"), - // }, - // }, - // { - // IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - // Subnet: &armservicebus.Subnet{ - // ID: to.Ptr("/subscriptions/subscriptionid/resourcegroups/resourcegroupid/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet6"), - // }, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNamespacesClient().NewListAuthorizationRulesPager("ArunMonocle", "sdk-Namespace-6914", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SBAuthorizationRuleListResult = armservicebus.SBAuthorizationRuleListResult{ - // Value: []*armservicebus.SBAuthorizationRule{ - // { - // Name: to.Ptr("RootManageSharedAccessKey"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/AuthorizationRules"), - // ID: to.Ptr("https://sbgm.windows-int.net/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-6914/AuthorizationRules?api-version=2017-04-01/RootManageSharedAccessKey"), - // Properties: &armservicebus.SBAuthorizationRuleProperties{ - // Rights: []*armservicebus.AccessRights{ - // to.Ptr(armservicebus.AccessRightsListen), - // to.Ptr(armservicebus.AccessRightsManage), - // to.Ptr(armservicebus.AccessRightsSend)}, - // }, - // }, - // { - // Name: to.Ptr("sdk-AuthRules-1788"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/AuthorizationRules"), - // ID: to.Ptr("https://sbgm.windows-int.net/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-6914/AuthorizationRules?api-version=2017-04-01/sdk-AuthRules-1788"), - // Properties: &armservicebus.SBAuthorizationRuleProperties{ - // Rights: []*armservicebus.AccessRights{ - // to.Ptr(armservicebus.AccessRightsListen), - // to.Ptr(armservicebus.AccessRightsSend)}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNamespacesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SBAuthorizationRule = armservicebus.SBAuthorizationRule{ - // Name: to.Ptr("sdk-AuthRules-1788"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/AuthorizationRules"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-6914/AuthorizationRules/sdk-AuthRules-1788"), - // Properties: &armservicebus.SBAuthorizationRuleProperties{ - // Rights: []*armservicebus.AccessRights{ - // to.Ptr(armservicebus.AccessRightsListen), - // to.Ptr(armservicebus.AccessRightsSend)}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewNamespacesClient().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/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNamespacesClient().GetAuthorizationRule(ctx, "ArunMonocle", "sdk-Namespace-6914", "sdk-AuthRules-1788", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SBAuthorizationRule = armservicebus.SBAuthorizationRule{ - // Name: to.Ptr("sdk-AuthRules-1788"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/AuthorizationRules"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-6914/AuthorizationRules/sdk-AuthRules-1788/"), - // Properties: &armservicebus.SBAuthorizationRuleProperties{ - // Rights: []*armservicebus.AccessRights{ - // to.Ptr(armservicebus.AccessRightsListen), - // to.Ptr(armservicebus.AccessRightsSend)}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNamespacesClient().ListKeys(ctx, "ArunMonocle", "sdk-namespace-6914", "sdk-AuthRules-1788", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AccessKeys = armservicebus.AccessKeys{ - // KeyName: to.Ptr("sdk-AuthRules-1788"), - // PrimaryConnectionString: to.Ptr("Endpoint=sb://sdk-namespace-6914.servicebus.windows-int.net/;SharedAccessKeyName=sdk-AuthRules-1788;SharedAccessKey=############################################"), - // PrimaryKey: to.Ptr("############################################"), - // SecondaryConnectionString: to.Ptr("Endpoint=sb://sdk-namespace-6914.servicebus.windows-int.net/;SharedAccessKeyName=sdk-AuthRules-1788;SharedAccessKey=############################################"), - // SecondaryKey: to.Ptr("############################################"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNamespacesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AccessKeys = armservicebus.AccessKeys{ - // KeyName: to.Ptr("sdk-AuthRules-1788"), - // PrimaryConnectionString: to.Ptr("Endpoint=sb://sdk-namespace-6914.servicebus.windows-int.net/;SharedAccessKeyName=sdk-AuthRules-1788;SharedAccessKey=#############################################"), - // PrimaryKey: to.Ptr("#############################################"), - // SecondaryConnectionString: to.Ptr("Endpoint=sb://sdk-namespace-6914.servicebus.windows-int.net/;SharedAccessKeyName=sdk-AuthRules-1788;SharedAccessKey=#############################################"), - // SecondaryKey: to.Ptr("#############################################"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNamespacesClient().CheckNameAvailability(ctx, armservicebus.CheckNameAvailability{ - Name: to.Ptr("sdk-Namespace-2924"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckNameAvailabilityResult = armservicebus.CheckNameAvailabilityResult{ - // Message: to.Ptr(""), - // NameAvailable: to.Ptr(true), - // Reason: to.Ptr(armservicebus.UnavailableReasonNone), - // } -} diff --git a/sdk/resourcemanager/servicebus/armservicebus/operations_client.go b/sdk/resourcemanager/servicebus/armservicebus/operations_client.go index 4ce5dee2458a..adcea46ca111 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/operations_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/operations_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -39,7 +36,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available ServiceBus REST API operations. // -// Generated from API version 2021-11-01 +// Generated from API version 2024-01-01 // - 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]{ @@ -65,14 +62,14 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption } // listCreateRequest creates the List request. -func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { +func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *OperationsClientListOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.ServiceBus/operations" req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicebus/armservicebus/operations_client_example_test.go b/sdk/resourcemanager/servicebus/armservicebus/operations_client_example_test.go deleted file mode 100644 index 346c03c19548..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/operations_client_example_test.go +++ /dev/null @@ -1,334 +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. -// DO NOT EDIT. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armservicebus.OperationListResult{ - // Value: []*armservicebus.Operation{ - // { - // Name: to.Ptr("Microsoft.ServiceBus/checkNameAvailability/action"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Get namespace availability."), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("Non Resource Operation"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/register/action"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Registers the ServiceBus Resource Provider"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("ServiceBus Resource Provider"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/write"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Create Or Update Namespace "), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("Namespace"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/read"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Get Namespace Resource"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("Namespace"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/Delete"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Delete Namespace"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("Namespace"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/authorizationRules/write"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Create or Update Namespace Authorization Rules"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("AuthorizationRules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/authorizationRules/read"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Get Namespace Authorization Rules"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("AuthorizationRules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/authorizationRules/delete"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Delete Namespace Authorization Rule"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("AuthorizationRules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/authorizationRules/listkeys/action"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Get Namespace Listkeys"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("AuthorizationRules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/authorizationRules/regenerateKeys/action"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Resource Regeneratekeys"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("AuthorizationRules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/queues/write"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Create or Update Queue"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("Queue"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/queues/read"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Get Queue"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("Queue"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/queues/Delete"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Delete Queue"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("Queue"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/queues/authorizationRules/write"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Create or Update Queue Authorization Rule"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("Queue AuthorizationRules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/queues/authorizationRules/read"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr(" Get Queue Authorization Rules"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("Queue AuthorizationRules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/queues/authorizationRules/delete"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Delete Queue Authorization Rules"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("Queue AuthorizationRules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/queues/authorizationRules/listkeys/action"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("List Queue keys"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("Queue AuthorizationRules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/queues/authorizationRules/regenerateKeys/action"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Resource Regeneratekeys"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("Queue AuthorizationRules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/topics/write"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Create or Update Topic"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("Topic"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/topics/read"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Get Topic"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("Topic"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/topics/Delete"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Delete Topic"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("Topic"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/topics/authorizationRules/write"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Create or Update Topic Authorization Rule"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("Topic AuthorizationRules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/topics/authorizationRules/read"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr(" Get Topic Authorization Rules"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("Topic AuthorizationRules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/topics/authorizationRules/delete"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Delete Topic Authorization Rules"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("Topic AuthorizationRules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/topics/authorizationRules/listkeys/action"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("List Topic keys"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("Topic AuthorizationRules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/topics/authorizationRules/regenerateKeys/action"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Resource Regeneratekeys"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("Topic AuthorizationRules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/topics/subscriptions/write"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Create or Update TopicSubscription"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("TopicSubscription"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/topics/subscriptions/read"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Get TopicSubscription"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("TopicSubscription"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/topics/subscriptions/Delete"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Delete TopicSubscription"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("TopicSubscription"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/topics/subscriptions/rules/write"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Create or Update Rule"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("Rule"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/topics/subscriptions/rules/read"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Get Rule"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("Rule"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/topics/subscriptions/rules/Delete"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Delete Rule"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("Rule"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/metricDefinitions/read"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Get Namespace metrics"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("Namespace metrics"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/diagnosticSettings/read"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Get Namespace diagnostic settings"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("Namespace diagnostic settings"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/diagnosticSettings/write"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Create or Update Namespace diagnostic settings"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("Namespace diagnostic settings"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceBus/namespaces/logDefinitions/read"), - // Display: &armservicebus.OperationDisplay{ - // Operation: to.Ptr("Get Namespace logs"), - // Provider: to.Ptr("Microsoft Azure ServiceBus"), - // Resource: to.Ptr("Namespace logs"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/servicebus/armservicebus/options.go b/sdk/resourcemanager/servicebus/armservicebus/options.go index 54523d4cd0cf..4105a9b65147 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/options.go +++ b/sdk/resourcemanager/servicebus/armservicebus/options.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -71,7 +68,7 @@ type DisasterRecoveryConfigsClientListOptions struct { // MigrationConfigsClientBeginCreateAndStartMigrationOptions contains the optional parameters for the MigrationConfigsClient.BeginCreateAndStartMigration // method. type MigrationConfigsClientBeginCreateAndStartMigrationOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -104,13 +101,13 @@ type MigrationConfigsClientRevertOptions struct { // NamespacesClientBeginCreateOrUpdateOptions contains the optional parameters for the NamespacesClient.BeginCreateOrUpdate // method. type NamespacesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // NamespacesClientBeginDeleteOptions contains the optional parameters for the NamespacesClient.BeginDelete method. type NamespacesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -200,7 +197,7 @@ type OperationsClientListOptions struct { // PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete // method. type PrivateEndpointConnectionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } diff --git a/sdk/resourcemanager/servicebus/armservicebus/privateendpointconnections_client.go b/sdk/resourcemanager/servicebus/armservicebus/privateendpointconnections_client.go index 16f8818fdd09..685d24038e70 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/privateendpointconnections_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/privateendpointconnections_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -47,8 +44,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - privateEndpointConnectionName - The PrivateEndpointConnection name // - parameters - Parameters supplied to update Status of PrivateEndPoint Connection to namespace resource. @@ -68,7 +65,7 @@ func (client *PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Conte if err != nil { return PrivateEndpointConnectionsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) return PrivateEndpointConnectionsClientCreateOrUpdateResponse{}, err } @@ -77,7 +74,7 @@ func (client *PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Conte } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, _ *PrivateEndpointConnectionsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -100,7 +97,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -121,8 +118,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - privateEndpointConnectionName - The PrivateEndpointConnection name // - options - PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete @@ -147,7 +144,7 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, // Delete - Deletes an existing Private Endpoint Connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2024-01-01 func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PrivateEndpointConnectionsClient.BeginDelete" @@ -170,7 +167,7 @@ func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Cont } // deleteCreateRequest creates the Delete request. -func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string, _ *PrivateEndpointConnectionsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -193,7 +190,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -202,8 +199,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - privateEndpointConnectionName - The PrivateEndpointConnection name // - options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get @@ -231,7 +228,7 @@ func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourc } // getCreateRequest creates the Get request. -func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string, _ *PrivateEndpointConnectionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -254,7 +251,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,8 +268,8 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListPager - Gets the available PrivateEndpointConnections within a namespace. // -// Generated from API version 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListPager // method. @@ -300,7 +297,7 @@ func (client *PrivateEndpointConnectionsClient) NewListPager(resourceGroupName s } // listCreateRequest creates the List request. -func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, options *PrivateEndpointConnectionsClientListOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, _ *PrivateEndpointConnectionsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/privateEndpointConnections" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -319,7 +316,7 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicebus/armservicebus/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/servicebus/armservicebus/privateendpointconnections_client_example_test.go deleted file mode 100644 index 81dc352cd975..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,164 +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. -// DO NOT EDIT. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListPager("SDK-ServiceBus-4794", "sdk-Namespace-5828", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateEndpointConnectionListResult = armservicebus.PrivateEndpointConnectionListResult{ - // Value: []*armservicebus.PrivateEndpointConnection{ - // { - // Name: to.Ptr("5dc668b3-70e4-437f-b61c-a3c1e594be7a"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/PrivateEndpointConnections"), - // ID: to.Ptr("/subscriptions/dbedb4e0-40e6-4145-81f3-f1314c150774/resourceGroups/SDK-ServiceBus-7182/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-5705-new/privateEndpointConnections/5dc668b3-70e4-437f-b61c-a3c1e594be7a"), - // Properties: &armservicebus.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armservicebus.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/dbedb4e0-40e6-4145-81f3-f1314c150774/resourceGroups/SDK-ServiceBus-7182/providers/Microsoft.Network/privateEndpoints/sdk-Namespace-5705-new"), - // }, - // PrivateLinkServiceConnectionState: &armservicebus.ConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // Status: to.Ptr(armservicebus.PrivateLinkConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armservicebus.EndPointProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armservicebus.PrivateEndpointConnection{ - // Name: to.Ptr("928c44d5-b7c6-423b-b6fa-811e0c27b3e0"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/PrivateEndpointConnections"), - // ID: to.Ptr("/subscriptions/dbedb4e0-40e6-4145-81f3-f1314c150774/resourceGroups/SDK-ServiceBus-4794/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-5828/privateEndpointConnections/928c44d5-b7c6-423b-b6fa-811e0c27b3e0"), - // Properties: &armservicebus.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armservicebus.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/dbedb4e0-40e6-4145-81f3-f1314c150774/resourceGroups/SDK-ServiceBus-4794/providers/Microsoft.Network/privateEndpoints/sdk-Namespace-5828"), - // }, - // PrivateLinkServiceConnectionState: &armservicebus.ConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // Status: to.Ptr(armservicebus.PrivateLinkConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armservicebus.EndPointProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().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/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "SDK-ServiceBus-4794", "sdk-Namespace-5828", "privateEndpointConnectionName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armservicebus.PrivateEndpointConnection{ - // Name: to.Ptr("privateEndpointConnectionName"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/PrivateEndpointConnections"), - // ID: to.Ptr("/subscriptions/dbedb4e0-40e6-4145-81f3-f1314c150774/resourceGroups/SDK-ServiceBus-4794/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-5828/privateEndpointConnections/privateEndpointConnectionName"), - // Properties: &armservicebus.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armservicebus.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/dbedb4e0-40e6-4145-81f3-f1314c150774/resourceGroups/SDK-ServiceBus-4794/providers/Microsoft.Network/privateEndpoints/sdk-Namespace-5828"), - // }, - // PrivateLinkServiceConnectionState: &armservicebus.ConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // Status: to.Ptr(armservicebus.PrivateLinkConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armservicebus.EndPointProvisioningStateSucceeded), - // }, - // } -} diff --git a/sdk/resourcemanager/servicebus/armservicebus/privatelinkresources_client.go b/sdk/resourcemanager/servicebus/armservicebus/privatelinkresources_client.go index f2ee0a02c071..3db58d7c11a7 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/privatelinkresources_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/privatelinkresources_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -47,8 +44,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - options - PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get // method. @@ -75,7 +72,7 @@ func (client *PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroup } // getCreateRequest creates the Get request. -func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, options *PrivateLinkResourcesClientGetOptions) (*policy.Request, error) { +func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, _ *PrivateLinkResourcesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/privateLinkResources" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -94,7 +91,7 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicebus/armservicebus/privatelinkresources_client_example_test.go b/sdk/resourcemanager/servicebus/armservicebus/privatelinkresources_client_example_test.go deleted file mode 100644 index f061015c3b64..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,53 +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. -// DO NOT EDIT. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkResourcesClient().Get(ctx, "ArunMonocle", "sdk-Namespace-2924", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateLinkResourcesListResult = armservicebus.PrivateLinkResourcesListResult{ - // Value: []*armservicebus.PrivateLinkResource{ - // { - // Name: to.Ptr("namespace"), - // Type: to.Ptr("Microsoft.ServiceBus/namespaces/privateLinkResources"), - // ID: to.Ptr("subscriptions/subID/resourceGroups/SDK-ServiceBus-4794/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-5828/privateLinkResources/namespace"), - // Properties: &armservicebus.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("namespace"), - // RequiredMembers: []*string{ - // to.Ptr("namespace")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.servicebus.windows.net")}, - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/servicebus/armservicebus/queues_client.go b/sdk/resourcemanager/servicebus/armservicebus/queues_client.go index c4b1a1ca900b..8c8872d74d93 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/queues_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/queues_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -48,8 +45,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - queueName - The queue name. // - parameters - Parameters supplied to create or update a queue resource. @@ -77,7 +74,7 @@ func (client *QueuesClient) CreateOrUpdate(ctx context.Context, resourceGroupNam } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *QueuesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, parameters SBQueue, options *QueuesClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *QueuesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, parameters SBQueue, _ *QueuesClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -100,7 +97,7 @@ func (client *QueuesClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -121,8 +118,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - queueName - The queue name. // - authorizationRuleName - The authorization rule name. @@ -152,7 +149,7 @@ func (client *QueuesClient) CreateOrUpdateAuthorizationRule(ctx context.Context, } // createOrUpdateAuthorizationRuleCreateRequest creates the CreateOrUpdateAuthorizationRule request. -func (client *QueuesClient) createOrUpdateAuthorizationRuleCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string, parameters SBAuthorizationRule, options *QueuesClientCreateOrUpdateAuthorizationRuleOptions) (*policy.Request, error) { +func (client *QueuesClient) createOrUpdateAuthorizationRuleCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string, parameters SBAuthorizationRule, _ *QueuesClientCreateOrUpdateAuthorizationRuleOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -179,7 +176,7 @@ func (client *QueuesClient) createOrUpdateAuthorizationRuleCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -200,8 +197,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - queueName - The queue name. // - options - QueuesClientDeleteOptions contains the optional parameters for the QueuesClient.Delete method. @@ -227,7 +224,7 @@ func (client *QueuesClient) Delete(ctx context.Context, resourceGroupName string } // deleteCreateRequest creates the Delete request. -func (client *QueuesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, options *QueuesClientDeleteOptions) (*policy.Request, error) { +func (client *QueuesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, _ *QueuesClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -250,7 +247,7 @@ func (client *QueuesClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -259,8 +256,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - queueName - The queue name. // - authorizationRuleName - The authorization rule name. @@ -288,7 +285,7 @@ func (client *QueuesClient) DeleteAuthorizationRule(ctx context.Context, resourc } // deleteAuthorizationRuleCreateRequest creates the DeleteAuthorizationRule request. -func (client *QueuesClient) deleteAuthorizationRuleCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string, options *QueuesClientDeleteAuthorizationRuleOptions) (*policy.Request, error) { +func (client *QueuesClient) deleteAuthorizationRuleCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string, _ *QueuesClientDeleteAuthorizationRuleOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -315,7 +312,7 @@ func (client *QueuesClient) deleteAuthorizationRuleCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -324,8 +321,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - queueName - The queue name. // - options - QueuesClientGetOptions contains the optional parameters for the QueuesClient.Get method. @@ -352,7 +349,7 @@ func (client *QueuesClient) Get(ctx context.Context, resourceGroupName string, n } // getCreateRequest creates the Get request. -func (client *QueuesClient) getCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, options *QueuesClientGetOptions) (*policy.Request, error) { +func (client *QueuesClient) getCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, _ *QueuesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -375,7 +372,7 @@ func (client *QueuesClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -393,8 +390,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - queueName - The queue name. // - authorizationRuleName - The authorization rule name. @@ -423,7 +420,7 @@ func (client *QueuesClient) GetAuthorizationRule(ctx context.Context, resourceGr } // getAuthorizationRuleCreateRequest creates the GetAuthorizationRule request. -func (client *QueuesClient) getAuthorizationRuleCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string, options *QueuesClientGetAuthorizationRuleOptions) (*policy.Request, error) { +func (client *QueuesClient) getAuthorizationRuleCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string, _ *QueuesClientGetAuthorizationRuleOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -450,7 +447,7 @@ func (client *QueuesClient) getAuthorizationRuleCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -467,8 +464,8 @@ func (client *QueuesClient) getAuthorizationRuleHandleResponse(resp *http.Respon // NewListAuthorizationRulesPager - Gets all authorization rules for a queue. // -// Generated from API version 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - queueName - The queue name. // - options - QueuesClientListAuthorizationRulesOptions contains the optional parameters for the QueuesClient.NewListAuthorizationRulesPager @@ -497,7 +494,7 @@ func (client *QueuesClient) NewListAuthorizationRulesPager(resourceGroupName str } // listAuthorizationRulesCreateRequest creates the ListAuthorizationRules request. -func (client *QueuesClient) listAuthorizationRulesCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, options *QueuesClientListAuthorizationRulesOptions) (*policy.Request, error) { +func (client *QueuesClient) listAuthorizationRulesCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, _ *QueuesClientListAuthorizationRulesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -520,7 +517,7 @@ func (client *QueuesClient) listAuthorizationRulesCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -537,8 +534,8 @@ func (client *QueuesClient) listAuthorizationRulesHandleResponse(resp *http.Resp // NewListByNamespacePager - Gets the queues within a namespace. // -// Generated from API version 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - options - QueuesClientListByNamespaceOptions contains the optional parameters for the QueuesClient.NewListByNamespacePager // method. @@ -585,13 +582,13 @@ func (client *QueuesClient) listByNamespaceCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -609,8 +606,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - queueName - The queue name. // - authorizationRuleName - The authorization rule name. @@ -638,7 +635,7 @@ func (client *QueuesClient) ListKeys(ctx context.Context, resourceGroupName stri } // listKeysCreateRequest creates the ListKeys request. -func (client *QueuesClient) listKeysCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string, options *QueuesClientListKeysOptions) (*policy.Request, error) { +func (client *QueuesClient) listKeysCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string, _ *QueuesClientListKeysOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}/ListKeys" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -665,7 +662,7 @@ func (client *QueuesClient) listKeysCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -683,8 +680,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - queueName - The queue name. // - authorizationRuleName - The authorization rule name. @@ -713,7 +710,7 @@ func (client *QueuesClient) RegenerateKeys(ctx context.Context, resourceGroupNam } // regenerateKeysCreateRequest creates the RegenerateKeys request. -func (client *QueuesClient) regenerateKeysCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string, parameters RegenerateAccessKeyParameters, options *QueuesClientRegenerateKeysOptions) (*policy.Request, error) { +func (client *QueuesClient) regenerateKeysCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string, parameters RegenerateAccessKeyParameters, _ *QueuesClientRegenerateKeysOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}/regenerateKeys" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -740,7 +737,7 @@ func (client *QueuesClient) regenerateKeysCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/servicebus/armservicebus/queues_client_example_test.go b/sdk/resourcemanager/servicebus/armservicebus/queues_client_example_test.go deleted file mode 100644 index 8193c370f18b..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/queues_client_example_test.go +++ /dev/null @@ -1,359 +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. -// DO NOT EDIT. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewQueuesClient().NewListAuthorizationRulesPager("ArunMonocle", "sdk-Namespace-7982", "sdk-Queues-2317", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SBAuthorizationRuleListResult = armservicebus.SBAuthorizationRuleListResult{ - // Value: []*armservicebus.SBAuthorizationRule{ - // { - // Name: to.Ptr("sdk-AuthRules-5800"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/Queues/AuthorizationRules"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-7982/queues/sdk-Queues-2317/authorizationRules/sdk-AuthRules-5800"), - // Properties: &armservicebus.SBAuthorizationRuleProperties{ - // Rights: []*armservicebus.AccessRights{ - // to.Ptr(armservicebus.AccessRightsListen), - // to.Ptr(armservicebus.AccessRightsSend)}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewQueuesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SBAuthorizationRule = armservicebus.SBAuthorizationRule{ - // Name: to.Ptr("sdk-AuthRules-5800"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/Queues/AuthorizationRules"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-7982/queues/sdk-Queues-2317/authorizationRules/sdk-AuthRules-5800"), - // Properties: &armservicebus.SBAuthorizationRuleProperties{ - // Rights: []*armservicebus.AccessRights{ - // to.Ptr(armservicebus.AccessRightsListen), - // to.Ptr(armservicebus.AccessRightsSend)}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewQueuesClient().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/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewQueuesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SBAuthorizationRule = armservicebus.SBAuthorizationRule{ - // Name: to.Ptr("sdk-AuthRules-5800"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/Queues/AuthorizationRules"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-7982/queues/sdk-Queues-2317/authorizationRules/sdk-AuthRules-5800"), - // Properties: &armservicebus.SBAuthorizationRuleProperties{ - // Rights: []*armservicebus.AccessRights{ - // to.Ptr(armservicebus.AccessRightsListen), - // to.Ptr(armservicebus.AccessRightsSend)}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewQueuesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AccessKeys = armservicebus.AccessKeys{ - // KeyName: to.Ptr("sdk-AuthRules-5800"), - // PrimaryConnectionString: to.Ptr("Endpoint=sb://sdk-namespace-7982.servicebus.windows-int.net/;SharedAccessKeyName=sdk-AuthRules-5800;SharedAccessKey=############################################;EntityPath=sdk-Queues-2317"), - // PrimaryKey: to.Ptr("############################################"), - // SecondaryConnectionString: to.Ptr("Endpoint=sb://sdk-namespace-7982.servicebus.windows-int.net/;SharedAccessKeyName=sdk-AuthRules-5800;SharedAccessKey=############################################;EntityPath=sdk-Queues-2317"), - // SecondaryKey: to.Ptr("############################################"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewQueuesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AccessKeys = armservicebus.AccessKeys{ - // KeyName: to.Ptr("sdk-AuthRules-5800"), - // PrimaryConnectionString: to.Ptr("Endpoint=sb://sdk-namespace-7982.servicebus.windows-int.net/;SharedAccessKeyName=sdk-AuthRules-5800;SharedAccessKey=############################################;EntityPath=sdk-Queues-2317"), - // PrimaryKey: to.Ptr("############################################"), - // SecondaryConnectionString: to.Ptr("Endpoint=sb://sdk-namespace-7982.servicebus.windows-int.net/;SharedAccessKeyName=sdk-AuthRules-5800;SharedAccessKey=############################################;EntityPath=sdk-Queues-2317"), - // SecondaryKey: to.Ptr("############################################"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewQueuesClient().NewListByNamespacePager("ArunMonocle", "sdk-Namespace-3174", &armservicebus.QueuesClientListByNamespaceOptions{Skip: nil, - Top: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SBQueueListResult = armservicebus.SBQueueListResult{ - // Value: []*armservicebus.SBQueue{ - // { - // Name: to.Ptr("sdk-queues-5647"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/Queues"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-3174/queues/sdk-queues-5647"), - // Properties: &armservicebus.SBQueueProperties{ - // AccessedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1-01-01T00:00:00.000Z"); return t}()), - // AutoDeleteOnIdle: to.Ptr("P10675199DT2H48M5.4775807S"), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-26T18:07:32.459Z"); return t}()), - // DefaultMessageTimeToLive: to.Ptr("P10675199DT2H48M5.4775807S"), - // DuplicateDetectionHistoryTimeWindow: to.Ptr("PT10M"), - // EnableExpress: to.Ptr(false), - // EnablePartitioning: to.Ptr(true), - // LockDuration: to.Ptr("PT1M"), - // MaxDeliveryCount: to.Ptr[int32](10), - // MaxMessageSizeInKilobytes: to.Ptr[int64](10240), - // MaxSizeInMegabytes: to.Ptr[int32](163840), - // MessageCount: to.Ptr[int64](0), - // RequiresDuplicateDetection: to.Ptr(false), - // RequiresSession: to.Ptr(false), - // SizeInBytes: to.Ptr[int64](0), - // Status: to.Ptr(armservicebus.EntityStatusActive), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-26T18:07:34.624Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewQueuesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SBQueue = armservicebus.SBQueue{ - // Name: to.Ptr("sdk-Queues-5647"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/Queues"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-3174/queues/sdk-Queues-5647"), - // Properties: &armservicebus.SBQueueProperties{ - // AccessedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-26T18:07:34.227Z"); return t}()), - // AutoDeleteOnIdle: to.Ptr("P10675199DT2H48M5.4775807S"), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-26T18:07:33.680Z"); return t}()), - // DefaultMessageTimeToLive: to.Ptr("P10675199DT2H48M5.4775807S"), - // DuplicateDetectionHistoryTimeWindow: to.Ptr("PT10M"), - // EnableExpress: to.Ptr(false), - // EnablePartitioning: to.Ptr(true), - // LockDuration: to.Ptr("PT1M"), - // MaxDeliveryCount: to.Ptr[int32](10), - // MaxMessageSizeInKilobytes: to.Ptr[int64](10240), - // MaxSizeInMegabytes: to.Ptr[int32](163840), - // MessageCount: to.Ptr[int64](0), - // RequiresDuplicateDetection: to.Ptr(false), - // RequiresSession: to.Ptr(false), - // SizeInBytes: to.Ptr[int64](0), - // Status: to.Ptr(armservicebus.EntityStatusActive), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-26T18:07:34.227Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewQueuesClient().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/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewQueuesClient().Get(ctx, "ArunMonocle", "sdk-Namespace-3174", "sdk-Queues-5647", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SBQueue = armservicebus.SBQueue{ - // Name: to.Ptr("sdk-Queues-5647"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/Queues"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-3174/queues/sdk-Queues-5647"), - // Properties: &armservicebus.SBQueueProperties{ - // AccessedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1-01-01T00:00:00.000Z"); return t}()), - // AutoDeleteOnIdle: to.Ptr("P10675199DT2H48M5.4775807S"), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-26T18:07:32.459Z"); return t}()), - // DefaultMessageTimeToLive: to.Ptr("P10675199DT2H48M5.4775807S"), - // DuplicateDetectionHistoryTimeWindow: to.Ptr("PT10M"), - // EnableExpress: to.Ptr(false), - // EnablePartitioning: to.Ptr(true), - // LockDuration: to.Ptr("PT1M"), - // MaxDeliveryCount: to.Ptr[int32](10), - // MaxMessageSizeInKilobytes: to.Ptr[int64](10240), - // MaxSizeInMegabytes: to.Ptr[int32](163840), - // MessageCount: to.Ptr[int64](0), - // RequiresDuplicateDetection: to.Ptr(false), - // RequiresSession: to.Ptr(false), - // SizeInBytes: to.Ptr[int64](0), - // Status: to.Ptr(armservicebus.EntityStatusActive), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-26T18:07:34.624Z"); return t}()), - // }, - // } -} diff --git a/sdk/resourcemanager/servicebus/armservicebus/response_types.go b/sdk/resourcemanager/servicebus/armservicebus/responses.go similarity index 99% rename from sdk/resourcemanager/servicebus/armservicebus/response_types.go rename to sdk/resourcemanager/servicebus/armservicebus/responses.go index b345ef80bbd5..f3fcb38b40fb 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/response_types.go +++ b/sdk/resourcemanager/servicebus/armservicebus/responses.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. diff --git a/sdk/resourcemanager/servicebus/armservicebus/rules_client.go b/sdk/resourcemanager/servicebus/armservicebus/rules_client.go index cb13cb885637..8e3ad7516195 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/rules_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/rules_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -48,8 +45,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - topicName - The topic name. // - subscriptionName - The subscription name. @@ -79,7 +76,7 @@ func (client *RulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *RulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, subscriptionName string, ruleName string, parameters Rule, options *RulesClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *RulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, subscriptionName string, ruleName string, parameters Rule, _ *RulesClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -110,7 +107,7 @@ func (client *RulesClient) createOrUpdateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -131,8 +128,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - topicName - The topic name. // - subscriptionName - The subscription name. @@ -160,7 +157,7 @@ func (client *RulesClient) Delete(ctx context.Context, resourceGroupName string, } // deleteCreateRequest creates the Delete request. -func (client *RulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, subscriptionName string, ruleName string, options *RulesClientDeleteOptions) (*policy.Request, error) { +func (client *RulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, subscriptionName string, ruleName string, _ *RulesClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -191,7 +188,7 @@ func (client *RulesClient) deleteCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -200,8 +197,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - topicName - The topic name. // - subscriptionName - The subscription name. @@ -230,7 +227,7 @@ func (client *RulesClient) Get(ctx context.Context, resourceGroupName string, na } // getCreateRequest creates the Get request. -func (client *RulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, subscriptionName string, ruleName string, options *RulesClientGetOptions) (*policy.Request, error) { +func (client *RulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, subscriptionName string, ruleName string, _ *RulesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -261,7 +258,7 @@ func (client *RulesClient) getCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -278,8 +275,8 @@ func (client *RulesClient) getHandleResponse(resp *http.Response) (RulesClientGe // NewListBySubscriptionsPager - List all the rules within given topic-subscription // -// Generated from API version 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - topicName - The topic name. // - subscriptionName - The subscription name. @@ -336,13 +333,13 @@ func (client *RulesClient) listBySubscriptionsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicebus/armservicebus/rules_client_example_test.go b/sdk/resourcemanager/servicebus/armservicebus/rules_client_example_test.go deleted file mode 100644 index 8b71ae1ce24b..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/rules_client_example_test.go +++ /dev/null @@ -1,233 +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. -// DO NOT EDIT. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRulesClient().NewListBySubscriptionsPager("ArunMonocle", "sdk-Namespace-1319", "sdk-Topics-2081", "sdk-Subscriptions-8691", &armservicebus.RulesClientListBySubscriptionsOptions{Skip: nil, - Top: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RuleListResult = armservicebus.RuleListResult{ - // Value: []*armservicebus.Rule{ - // { - // Name: to.Ptr("sdk-Rules-6571"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/Topics/Subscriptions/Rules"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-1319/topics/sdk-Topics-2081/subscriptions/sdk-Subscriptions-8691/rules/sdk-Rules-6571"), - // Properties: &armservicebus.Ruleproperties{ - // Action: &armservicebus.Action{ - // }, - // FilterType: to.Ptr(armservicebus.FilterTypeSQLFilter), - // SQLFilter: &armservicebus.SQLFilter{ - // CompatibilityLevel: to.Ptr[int32](20), - // SQLExpression: to.Ptr("1=1"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Rules/RuleCreate_CorrelationFilter.json -func ExampleRulesClient_CreateOrUpdate_rulesCreateCorrelationFilter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRulesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Rule = armservicebus.Rule{ - // Name: to.Ptr("sdk-Rules-6571"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/Topics/Subscriptions/Rules"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-1319/topics/sdk-Topics-2081/subscriptions/sdk-Subscriptions-8691/rules/sdk-Rules-6571"), - // Properties: &armservicebus.Ruleproperties{ - // Action: &armservicebus.Action{ - // }, - // CorrelationFilter: &armservicebus.CorrelationFilter{ - // Properties: map[string]*string{ - // "queueHint": to.Ptr("Crop"), - // }, - // }, - // FilterType: to.Ptr(armservicebus.FilterTypeCorrelationFilter), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Rules/RuleCreate.json -func ExampleRulesClient_CreateOrUpdate_rulesCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRulesClient().CreateOrUpdate(ctx, "resourceGroupName", "sdk-Namespace-1319", "sdk-Topics-2081", "sdk-Subscriptions-8691", "sdk-Rules-6571", armservicebus.Rule{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Rule = armservicebus.Rule{ - // Name: to.Ptr("sdk-Rules-6571"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/Topics/Subscriptions/Rules"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-1319/topics/sdk-Topics-2081/subscriptions/sdk-Subscriptions-8691/rules/sdk-Rules-6571"), - // Properties: &armservicebus.Ruleproperties{ - // Action: &armservicebus.Action{ - // }, - // FilterType: to.Ptr(armservicebus.FilterTypeSQLFilter), - // SQLFilter: &armservicebus.SQLFilter{ - // CompatibilityLevel: to.Ptr[int32](20), - // SQLExpression: to.Ptr("1=1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Rules/RuleCreate_SqlFilter.json -func ExampleRulesClient_CreateOrUpdate_rulesCreateSqlFilter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRulesClient().CreateOrUpdate(ctx, "resourceGroupName", "sdk-Namespace-1319", "sdk-Topics-2081", "sdk-Subscriptions-8691", "sdk-Rules-6571", armservicebus.Rule{ - Properties: &armservicebus.Ruleproperties{ - FilterType: to.Ptr(armservicebus.FilterTypeSQLFilter), - SQLFilter: &armservicebus.SQLFilter{ - SQLExpression: to.Ptr("myproperty=test"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Rule = armservicebus.Rule{ - // Name: to.Ptr("sdk-Rules-6571"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/Topics/Subscriptions/Rules"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-1319/topics/sdk-Topics-2081/subscriptions/sdk-Subscriptions-8691/rules/sdk-Rules-6571"), - // Properties: &armservicebus.Ruleproperties{ - // Action: &armservicebus.Action{ - // }, - // FilterType: to.Ptr(armservicebus.FilterTypeSQLFilter), - // SQLFilter: &armservicebus.SQLFilter{ - // CompatibilityLevel: to.Ptr[int32](20), - // SQLExpression: to.Ptr("myproperty=test"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewRulesClient().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/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRulesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Rule = armservicebus.Rule{ - // Name: to.Ptr("sdk-Rules-6571"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/Topics/Subscriptions/Rules"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-1319/topics/sdk-Topics-2081/subscriptions/sdk-Subscriptions-8691/rules/sdk-Rules-6571"), - // Properties: &armservicebus.Ruleproperties{ - // Action: &armservicebus.Action{ - // }, - // FilterType: to.Ptr(armservicebus.FilterTypeSQLFilter), - // SQLFilter: &armservicebus.SQLFilter{ - // CompatibilityLevel: to.Ptr[int32](20), - // SQLExpression: to.Ptr("1=1"), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/servicebus/armservicebus/subscriptions_client.go b/sdk/resourcemanager/servicebus/armservicebus/subscriptions_client.go index 7919995c37b7..a4d5d31bd6c6 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/subscriptions_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/subscriptions_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -48,8 +45,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - topicName - The topic name. // - subscriptionName - The subscription name. @@ -79,7 +76,7 @@ func (client *SubscriptionsClient) CreateOrUpdate(ctx context.Context, resourceG } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *SubscriptionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, subscriptionName string, parameters SBSubscription, options *SubscriptionsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *SubscriptionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, subscriptionName string, parameters SBSubscription, _ *SubscriptionsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -106,7 +103,7 @@ func (client *SubscriptionsClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -127,8 +124,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - topicName - The topic name. // - subscriptionName - The subscription name. @@ -155,7 +152,7 @@ func (client *SubscriptionsClient) Delete(ctx context.Context, resourceGroupName } // deleteCreateRequest creates the Delete request. -func (client *SubscriptionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, subscriptionName string, options *SubscriptionsClientDeleteOptions) (*policy.Request, error) { +func (client *SubscriptionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, subscriptionName string, _ *SubscriptionsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -182,7 +179,7 @@ func (client *SubscriptionsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,8 +188,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - topicName - The topic name. // - subscriptionName - The subscription name. @@ -220,7 +217,7 @@ func (client *SubscriptionsClient) Get(ctx context.Context, resourceGroupName st } // getCreateRequest creates the Get request. -func (client *SubscriptionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, subscriptionName string, options *SubscriptionsClientGetOptions) (*policy.Request, error) { +func (client *SubscriptionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, subscriptionName string, _ *SubscriptionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -247,7 +244,7 @@ func (client *SubscriptionsClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -264,8 +261,8 @@ func (client *SubscriptionsClient) getHandleResponse(resp *http.Response) (Subsc // NewListByTopicPager - List all the subscriptions under a specified topic. // -// Generated from API version 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - topicName - The topic name. // - options - SubscriptionsClientListByTopicOptions contains the optional parameters for the SubscriptionsClient.NewListByTopicPager @@ -317,13 +314,13 @@ func (client *SubscriptionsClient) listByTopicCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicebus/armservicebus/subscriptions_client_example_test.go b/sdk/resourcemanager/servicebus/armservicebus/subscriptions_client_example_test.go deleted file mode 100644 index 4317b510f1a2..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/subscriptions_client_example_test.go +++ /dev/null @@ -1,197 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSubscriptionsClient().NewListByTopicPager("ResourceGroup", "sdk-Namespace-1349", "sdk-Topics-8740", &armservicebus.SubscriptionsClientListByTopicOptions{Skip: nil, - Top: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SBSubscriptionListResult = armservicebus.SBSubscriptionListResult{ - // Value: []*armservicebus.SBSubscription{ - // { - // Name: to.Ptr("sdk-Subscriptions-2178"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/Topics/Subscriptions"), - // ID: to.Ptr("/subscriptions/Subscriptionid/resourceGroups/ResourceGroup/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-1349/topics/sdk-Topics-8740/subscriptions/sdk-Subscriptions-2178"), - // Properties: &armservicebus.SBSubscriptionProperties{ - // AccessedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-04T18:02:20.599Z"); return t}()), - // AutoDeleteOnIdle: to.Ptr("P10675199DT2H48M5.4775807S"), - // CountDetails: &armservicebus.MessageCountDetails{ - // ActiveMessageCount: to.Ptr[int64](0), - // DeadLetterMessageCount: to.Ptr[int64](0), - // ScheduledMessageCount: to.Ptr[int64](0), - // TransferDeadLetterMessageCount: to.Ptr[int64](0), - // TransferMessageCount: to.Ptr[int64](0), - // }, - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-04T18:02:20.599Z"); return t}()), - // DeadLetteringOnFilterEvaluationExceptions: to.Ptr(true), - // DeadLetteringOnMessageExpiration: to.Ptr(true), - // DefaultMessageTimeToLive: to.Ptr("P10675199DT2H48M5.4775807S"), - // EnableBatchedOperations: to.Ptr(true), - // ForwardDeadLetteredMessagesTo: to.Ptr("sdk-Topics-3065"), - // ForwardTo: to.Ptr("sdk-Topics-3065"), - // LockDuration: to.Ptr("PT1M"), - // MaxDeliveryCount: to.Ptr[int32](10), - // MessageCount: to.Ptr[int64](0), - // RequiresSession: to.Ptr(false), - // Status: to.Ptr(armservicebus.EntityStatusActive), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-04T18:02:20.599Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSubscriptionsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SBSubscription = armservicebus.SBSubscription{ - // Name: to.Ptr("sdk-Subscriptions-2178"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/Topics/Subscriptions"), - // ID: to.Ptr("/subscriptions/Subscriptionid/resourceGroups/ResourceGroup/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-1349/topics/sdk-Topics-8740/subscriptions/sdk-Subscriptions-2178"), - // Properties: &armservicebus.SBSubscriptionProperties{ - // AccessedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-04T18:02:20.599Z"); return t}()), - // AutoDeleteOnIdle: to.Ptr("P10675199DT2H48M5.4775807S"), - // CountDetails: &armservicebus.MessageCountDetails{ - // ActiveMessageCount: to.Ptr[int64](0), - // DeadLetterMessageCount: to.Ptr[int64](0), - // ScheduledMessageCount: to.Ptr[int64](0), - // TransferDeadLetterMessageCount: to.Ptr[int64](0), - // TransferMessageCount: to.Ptr[int64](0), - // }, - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-04T18:02:20.599Z"); return t}()), - // DeadLetteringOnFilterEvaluationExceptions: to.Ptr(true), - // DeadLetteringOnMessageExpiration: to.Ptr(true), - // DefaultMessageTimeToLive: to.Ptr("P10675199DT2H48M5.4775807S"), - // EnableBatchedOperations: to.Ptr(true), - // ForwardDeadLetteredMessagesTo: to.Ptr("sdk-Topics-3065"), - // ForwardTo: to.Ptr("sdk-Topics-3065"), - // LockDuration: to.Ptr("PT1M"), - // MaxDeliveryCount: to.Ptr[int32](10), - // MessageCount: to.Ptr[int64](0), - // RequiresSession: to.Ptr(false), - // Status: to.Ptr(armservicebus.EntityStatusActive), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-04T18:02:20.599Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewSubscriptionsClient().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/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSubscriptionsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SBSubscription = armservicebus.SBSubscription{ - // Name: to.Ptr("sdk-Subscriptions-2178"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/Topics/Subscriptions"), - // ID: to.Ptr("/subscriptions/Subscriptionid/resourceGroups/ResourceGroup/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-1349/topics/sdk-Topics-8740/subscriptions/sdk-Subscriptions-2178"), - // Properties: &armservicebus.SBSubscriptionProperties{ - // AccessedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-04T18:02:20.599Z"); return t}()), - // AutoDeleteOnIdle: to.Ptr("P10675199DT2H48M5.4775807S"), - // CountDetails: &armservicebus.MessageCountDetails{ - // ActiveMessageCount: to.Ptr[int64](0), - // DeadLetterMessageCount: to.Ptr[int64](0), - // ScheduledMessageCount: to.Ptr[int64](0), - // TransferDeadLetterMessageCount: to.Ptr[int64](0), - // TransferMessageCount: to.Ptr[int64](0), - // }, - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-04T18:02:20.599Z"); return t}()), - // DeadLetteringOnFilterEvaluationExceptions: to.Ptr(true), - // DeadLetteringOnMessageExpiration: to.Ptr(true), - // DefaultMessageTimeToLive: to.Ptr("P10675199DT2H48M5.4775807S"), - // EnableBatchedOperations: to.Ptr(true), - // ForwardDeadLetteredMessagesTo: to.Ptr("sdk-Topics-3065"), - // ForwardTo: to.Ptr("sdk-Topics-3065"), - // LockDuration: to.Ptr("PT1M"), - // MaxDeliveryCount: to.Ptr[int32](10), - // MessageCount: to.Ptr[int64](0), - // RequiresSession: to.Ptr(false), - // Status: to.Ptr(armservicebus.EntityStatusActive), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-04T18:02:20.599Z"); return t}()), - // }, - // } -} diff --git a/sdk/resourcemanager/servicebus/armservicebus/time_rfc3339.go b/sdk/resourcemanager/servicebus/armservicebus/time_rfc3339.go index 7d142f1ec3a3..220345149948 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/time_rfc3339.go +++ b/sdk/resourcemanager/servicebus/armservicebus/time_rfc3339.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -19,12 +16,16 @@ import ( ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -40,17 +41,36 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + if len(data) == 0 { + return nil + } + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +81,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -74,7 +98,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339 diff --git a/sdk/resourcemanager/servicebus/armservicebus/topics_client.go b/sdk/resourcemanager/servicebus/armservicebus/topics_client.go index 16066be81111..92a139b651b9 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/topics_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/topics_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -48,8 +45,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - topicName - The topic name. // - parameters - Parameters supplied to create a topic resource. @@ -77,7 +74,7 @@ func (client *TopicsClient) CreateOrUpdate(ctx context.Context, resourceGroupNam } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *TopicsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, parameters SBTopic, options *TopicsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *TopicsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, parameters SBTopic, _ *TopicsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -100,7 +97,7 @@ func (client *TopicsClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -121,8 +118,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - topicName - The topic name. // - authorizationRuleName - The authorization rule name. @@ -152,7 +149,7 @@ func (client *TopicsClient) CreateOrUpdateAuthorizationRule(ctx context.Context, } // createOrUpdateAuthorizationRuleCreateRequest creates the CreateOrUpdateAuthorizationRule request. -func (client *TopicsClient) createOrUpdateAuthorizationRuleCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string, parameters SBAuthorizationRule, options *TopicsClientCreateOrUpdateAuthorizationRuleOptions) (*policy.Request, error) { +func (client *TopicsClient) createOrUpdateAuthorizationRuleCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string, parameters SBAuthorizationRule, _ *TopicsClientCreateOrUpdateAuthorizationRuleOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -179,7 +176,7 @@ func (client *TopicsClient) createOrUpdateAuthorizationRuleCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -200,8 +197,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - topicName - The topic name. // - options - TopicsClientDeleteOptions contains the optional parameters for the TopicsClient.Delete method. @@ -227,7 +224,7 @@ func (client *TopicsClient) Delete(ctx context.Context, resourceGroupName string } // deleteCreateRequest creates the Delete request. -func (client *TopicsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, options *TopicsClientDeleteOptions) (*policy.Request, error) { +func (client *TopicsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, _ *TopicsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -250,7 +247,7 @@ func (client *TopicsClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -259,8 +256,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - topicName - The topic name. // - authorizationRuleName - The authorization rule name. @@ -288,7 +285,7 @@ func (client *TopicsClient) DeleteAuthorizationRule(ctx context.Context, resourc } // deleteAuthorizationRuleCreateRequest creates the DeleteAuthorizationRule request. -func (client *TopicsClient) deleteAuthorizationRuleCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string, options *TopicsClientDeleteAuthorizationRuleOptions) (*policy.Request, error) { +func (client *TopicsClient) deleteAuthorizationRuleCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string, _ *TopicsClientDeleteAuthorizationRuleOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -315,7 +312,7 @@ func (client *TopicsClient) deleteAuthorizationRuleCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -324,8 +321,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - topicName - The topic name. // - options - TopicsClientGetOptions contains the optional parameters for the TopicsClient.Get method. @@ -352,7 +349,7 @@ func (client *TopicsClient) Get(ctx context.Context, resourceGroupName string, n } // getCreateRequest creates the Get request. -func (client *TopicsClient) getCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, options *TopicsClientGetOptions) (*policy.Request, error) { +func (client *TopicsClient) getCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, _ *TopicsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -375,7 +372,7 @@ func (client *TopicsClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -393,8 +390,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - topicName - The topic name. // - authorizationRuleName - The authorization rule name. @@ -423,7 +420,7 @@ func (client *TopicsClient) GetAuthorizationRule(ctx context.Context, resourceGr } // getAuthorizationRuleCreateRequest creates the GetAuthorizationRule request. -func (client *TopicsClient) getAuthorizationRuleCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string, options *TopicsClientGetAuthorizationRuleOptions) (*policy.Request, error) { +func (client *TopicsClient) getAuthorizationRuleCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string, _ *TopicsClientGetAuthorizationRuleOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -450,7 +447,7 @@ func (client *TopicsClient) getAuthorizationRuleCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -467,8 +464,8 @@ func (client *TopicsClient) getAuthorizationRuleHandleResponse(resp *http.Respon // NewListAuthorizationRulesPager - Gets authorization rules for a topic. // -// Generated from API version 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - topicName - The topic name. // - options - TopicsClientListAuthorizationRulesOptions contains the optional parameters for the TopicsClient.NewListAuthorizationRulesPager @@ -497,7 +494,7 @@ func (client *TopicsClient) NewListAuthorizationRulesPager(resourceGroupName str } // listAuthorizationRulesCreateRequest creates the ListAuthorizationRules request. -func (client *TopicsClient) listAuthorizationRulesCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, options *TopicsClientListAuthorizationRulesOptions) (*policy.Request, error) { +func (client *TopicsClient) listAuthorizationRulesCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, _ *TopicsClientListAuthorizationRulesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -520,7 +517,7 @@ func (client *TopicsClient) listAuthorizationRulesCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -537,8 +534,8 @@ func (client *TopicsClient) listAuthorizationRulesHandleResponse(resp *http.Resp // NewListByNamespacePager - Gets all the topics in a namespace. // -// Generated from API version 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - options - TopicsClientListByNamespaceOptions contains the optional parameters for the TopicsClient.NewListByNamespacePager // method. @@ -585,13 +582,13 @@ func (client *TopicsClient) listByNamespaceCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -609,8 +606,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - topicName - The topic name. // - authorizationRuleName - The authorization rule name. @@ -638,7 +635,7 @@ func (client *TopicsClient) ListKeys(ctx context.Context, resourceGroupName stri } // listKeysCreateRequest creates the ListKeys request. -func (client *TopicsClient) listKeysCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string, options *TopicsClientListKeysOptions) (*policy.Request, error) { +func (client *TopicsClient) listKeysCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string, _ *TopicsClientListKeysOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/ListKeys" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -665,7 +662,7 @@ func (client *TopicsClient) listKeysCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -683,8 +680,8 @@ 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 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - topicName - The topic name. // - authorizationRuleName - The authorization rule name. @@ -713,7 +710,7 @@ func (client *TopicsClient) RegenerateKeys(ctx context.Context, resourceGroupNam } // regenerateKeysCreateRequest creates the RegenerateKeys request. -func (client *TopicsClient) regenerateKeysCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string, parameters RegenerateAccessKeyParameters, options *TopicsClientRegenerateKeysOptions) (*policy.Request, error) { +func (client *TopicsClient) regenerateKeysCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string, parameters RegenerateAccessKeyParameters, _ *TopicsClientRegenerateKeysOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/regenerateKeys" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -740,7 +737,7 @@ func (client *TopicsClient) regenerateKeysCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/servicebus/armservicebus/topics_client_example_test.go b/sdk/resourcemanager/servicebus/armservicebus/topics_client_example_test.go deleted file mode 100644 index b820ab01a9c7..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/topics_client_example_test.go +++ /dev/null @@ -1,356 +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. -// DO NOT EDIT. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTopicsClient().NewListAuthorizationRulesPager("ArunMonocle", "sdk-Namespace-6261", "sdk-Topics-1984", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SBAuthorizationRuleListResult = armservicebus.SBAuthorizationRuleListResult{ - // Value: []*armservicebus.SBAuthorizationRule{ - // { - // Name: to.Ptr("sdk-AuthRules-4310"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/Topics/AuthorizationRules"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-6261/topics/sdk-Topics-1984/authorizationRules/sdk-AuthRules-4310"), - // Properties: &armservicebus.SBAuthorizationRuleProperties{ - // Rights: []*armservicebus.AccessRights{ - // to.Ptr(armservicebus.AccessRightsListen), - // to.Ptr(armservicebus.AccessRightsSend)}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTopicsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SBAuthorizationRule = armservicebus.SBAuthorizationRule{ - // Name: to.Ptr("sdk-AuthRules-4310"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/Topics/AuthorizationRules"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-6261/topics/sdk-Topics-1984/authorizationRules/sdk-AuthRules-4310"), - // Properties: &armservicebus.SBAuthorizationRuleProperties{ - // Rights: []*armservicebus.AccessRights{ - // to.Ptr(armservicebus.AccessRightsListen), - // to.Ptr(armservicebus.AccessRightsSend)}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTopicsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SBAuthorizationRule = armservicebus.SBAuthorizationRule{ - // Name: to.Ptr("sdk-AuthRules-4310"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/Topics/AuthorizationRules"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-6261/topics/sdk-Topics-1984/authorizationRules/sdk-AuthRules-4310"), - // Properties: &armservicebus.SBAuthorizationRuleProperties{ - // Rights: []*armservicebus.AccessRights{ - // to.Ptr(armservicebus.AccessRightsListen), - // to.Ptr(armservicebus.AccessRightsSend)}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewTopicsClient().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/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTopicsClient().ListKeys(ctx, "Default-ServiceBus-WestUS", "sdk-Namespace8408", "sdk-Topics2075", "sdk-Authrules5067", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AccessKeys = armservicebus.AccessKeys{ - // KeyName: to.Ptr("sdk-AuthRules-4310"), - // PrimaryConnectionString: to.Ptr("Endpoint=sb://sdk-namespace-6261.servicebus.windows-int.net/;SharedAccessKeyName=sdk-AuthRules-4310;SharedAccessKey=#############################################;EntityPath=sdk-Topics-1984"), - // PrimaryKey: to.Ptr("#############################################"), - // SecondaryConnectionString: to.Ptr("Endpoint=sb://sdk-namespace-6261.servicebus.windows-int.net/;SharedAccessKeyName=sdk-AuthRules-4310;SharedAccessKey=#############################################;EntityPath=sdk-Topics-1984"), - // SecondaryKey: to.Ptr("#############################################"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTopicsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AccessKeys = armservicebus.AccessKeys{ - // KeyName: to.Ptr("sdk-AuthRules-4310"), - // PrimaryConnectionString: to.Ptr("Endpoint=sb://sdk-namespace-6261.servicebus.windows-int.net/;SharedAccessKeyName=sdk-AuthRules-4310;SharedAccessKey=#############################################;EntityPath=sdk-Topics-1984"), - // PrimaryKey: to.Ptr("#############################################"), - // SecondaryConnectionString: to.Ptr("Endpoint=sb://sdk-namespace-6261.servicebus.windows-int.net/;SharedAccessKeyName=sdk-AuthRules-4310;SharedAccessKey=#############################################;EntityPath=sdk-Topics-1984"), - // SecondaryKey: to.Ptr("#############################################"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTopicsClient().NewListByNamespacePager("Default-ServiceBus-WestUS", "sdk-Namespace-1617", &armservicebus.TopicsClientListByNamespaceOptions{Skip: nil, - Top: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SBTopicListResult = armservicebus.SBTopicListResult{ - // Value: []*armservicebus.SBTopic{ - // { - // Name: to.Ptr("sdk-topics-5488"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/Topics"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-1617/topics/sdk-topics-5488"), - // Properties: &armservicebus.SBTopicProperties{ - // AccessedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1-01-01T00:00:00.000Z"); return t}()), - // AutoDeleteOnIdle: to.Ptr("P10675199DT2H48M5.4775807S"), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-26T20:50:31.444Z"); return t}()), - // DefaultMessageTimeToLive: to.Ptr("P10675199DT2H48M5.4775807S"), - // DuplicateDetectionHistoryTimeWindow: to.Ptr("PT10M"), - // EnableBatchedOperations: to.Ptr(true), - // EnableExpress: to.Ptr(true), - // EnablePartitioning: to.Ptr(false), - // MaxMessageSizeInKilobytes: to.Ptr[int64](10240), - // MaxSizeInMegabytes: to.Ptr[int32](10240), - // RequiresDuplicateDetection: to.Ptr(false), - // SizeInBytes: to.Ptr[int64](0), - // Status: to.Ptr(armservicebus.EntityStatusActive), - // SubscriptionCount: to.Ptr[int32](0), - // SupportOrdering: to.Ptr(true), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-26T20:52:32.209Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTopicsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SBTopic = armservicebus.SBTopic{ - // Name: to.Ptr("sdk-Topics-5488"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/Topics"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-1617/topics/sdk-Topics-5488"), - // Properties: &armservicebus.SBTopicProperties{ - // AccessedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-26T20:50:34.320Z"); return t}()), - // AutoDeleteOnIdle: to.Ptr("P10675199DT2H48M5.4775807S"), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-26T20:50:34.100Z"); return t}()), - // DefaultMessageTimeToLive: to.Ptr("P10675199DT2H48M5.4775807S"), - // DuplicateDetectionHistoryTimeWindow: to.Ptr("PT10M"), - // EnableBatchedOperations: to.Ptr(true), - // EnableExpress: to.Ptr(true), - // EnablePartitioning: to.Ptr(false), - // MaxMessageSizeInKilobytes: to.Ptr[int64](10240), - // MaxSizeInMegabytes: to.Ptr[int32](10240), - // RequiresDuplicateDetection: to.Ptr(false), - // SizeInBytes: to.Ptr[int64](0), - // Status: to.Ptr(armservicebus.EntityStatusActive), - // SubscriptionCount: to.Ptr[int32](0), - // SupportOrdering: to.Ptr(true), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-26T20:50:34.320Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewTopicsClient().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/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/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() - clientFactory, err := armservicebus.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTopicsClient().Get(ctx, "ArunMonocle", "sdk-Namespace-1617", "sdk-Topics-5488", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SBTopic = armservicebus.SBTopic{ - // Name: to.Ptr("sdk-Topics-5488"), - // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/Topics"), - // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-1617/topics/sdk-Topics-5488"), - // Properties: &armservicebus.SBTopicProperties{ - // AccessedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1-01-01T00:00:00.000Z"); return t}()), - // AutoDeleteOnIdle: to.Ptr("P10675199DT2H48M5.4775807S"), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-26T20:50:31.444Z"); return t}()), - // DefaultMessageTimeToLive: to.Ptr("P10675199DT2H48M5.4775807S"), - // DuplicateDetectionHistoryTimeWindow: to.Ptr("PT10M"), - // EnableBatchedOperations: to.Ptr(true), - // EnableExpress: to.Ptr(true), - // EnablePartitioning: to.Ptr(false), - // MaxMessageSizeInKilobytes: to.Ptr[int64](10240), - // MaxSizeInMegabytes: to.Ptr[int32](10240), - // RequiresDuplicateDetection: to.Ptr(false), - // SizeInBytes: to.Ptr[int64](0), - // Status: to.Ptr(armservicebus.EntityStatusActive), - // SubscriptionCount: to.Ptr[int32](0), - // SupportOrdering: to.Ptr(true), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-26T20:52:32.209Z"); return t}()), - // }, - // } -}