From 4d963bdd85333614887a91a15c5997c2b32f7576 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Thu, 19 Mar 2026 10:02:34 +0000 Subject: [PATCH] Configurations: 'specification/servicebus/resource-manager/Microsoft.ServiceBus/ServiceBus/tspconfig.yaml', API Version: 2025-05-01-preview, SDK Release Type: beta, and CommitSHA: 'aa822c9c01b9e83fbc8ad8ec4c308203a3c29287' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6034394 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../servicebus/armservicebus/CHANGELOG.md | 56 + .../servicebus/armservicebus/README.md | 4 +- .../servicebus/armservicebus/autorest.md | 13 - .../servicebus/armservicebus/build.go | 7 - .../armservicebus/client_factory.go | 90 +- .../servicebus/armservicebus/constants.go | 162 +- .../disasterrecoveryconfig_live_test.go | 2 +- .../disasterrecoveryconfigs_client.go | 172 +- ...sterrecoveryconfigs_client_example_test.go | 369 ++- .../fake/disasterrecoveryconfigs_server.go | 112 +- .../servicebus/armservicebus/fake/internal.go | 16 +- .../fake/migrationconfigs_server.go | 86 +- .../armservicebus/fake/namespaces_server.go | 279 +- ...rksecurityperimeterconfiguration_server.go | 133 + ...ksecurityperimeterconfigurations_server.go | 168 + .../armservicebus/fake/operations_server.go | 54 +- .../fake/privateendpointconnections_server.go | 80 +- .../fake/privatelinkresources_server.go | 56 +- .../armservicebus/fake/queues_server.go | 112 +- .../armservicebus/fake/rules_server.go | 74 +- .../armservicebus/fake/server_factory.go | 110 +- .../fake/subscriptions_server.go | 74 +- .../armservicebus/fake/time_rfc3339.go | 83 - .../armservicebus/fake/topics_server.go | 112 +- .../servicebus/armservicebus/go.mod | 12 +- .../servicebus/armservicebus/go.sum | 20 +- .../armservicebus/migrationconfigs_client.go | 124 +- .../migrationconfigs_client_example_test.go | 159 +- .../migrationconfigs_live_test.go | 2 +- .../servicebus/armservicebus/models.go | 516 +-- .../servicebus/armservicebus/models_serde.go | 1020 ++++-- .../armservicebus/namespace_live_test.go | 2 +- .../armservicebus/namespaces_client.go | 392 ++- .../namespaces_client_example_test.go | 2939 +++++++++-------- ...rksecurityperimeterconfiguration_client.go | 105 + ...imeterconfiguration_client_example_test.go | 75 + ...ksecurityperimeterconfigurations_client.go | 169 + ...meterconfigurations_client_example_test.go | 89 + .../armservicebus/operations_client.go | 13 +- .../operations_client_example_test.go | 596 ++-- .../armservicebus/operations_live_test.go | 2 +- .../servicebus/armservicebus/options.go | 54 +- .../privateendpointconnections_client.go | 70 +- ...endpointconnections_client_example_test.go | 169 +- .../privatelinkresources_client.go | 24 +- ...rivatelinkresources_client_example_test.go | 44 +- .../armservicebus/queue_live_test.go | 2 +- .../servicebus/armservicebus/queues_client.go | 173 +- .../queues_client_example_test.go | 393 ++- .../{response_types.go => responses.go} | 60 +- .../servicebus/armservicebus/rules_client.go | 72 +- .../rules_client_example_test.go | 241 +- .../armservicebus/rules_live_test.go | 2 +- .../armservicebus/subscriptions_client.go | 72 +- .../subscriptions_client_example_test.go | 255 +- .../armservicebus/subscriptions_live_test.go | 2 +- .../armservicebus/testdata/_metadata.json | 6 + .../servicebus/armservicebus/time_rfc3339.go | 83 - .../servicebus/armservicebus/topics_client.go | 173 +- .../topics_client_example_test.go | 385 ++- .../armservicebus/topics_live_test.go | 2 +- .../armservicebus/tsp-location.yaml | 4 + .../servicebus/armservicebus/version.go | 10 + 63 files changed, 6483 insertions(+), 4472 deletions(-) delete mode 100644 sdk/resourcemanager/servicebus/armservicebus/autorest.md delete mode 100644 sdk/resourcemanager/servicebus/armservicebus/build.go create mode 100644 sdk/resourcemanager/servicebus/armservicebus/fake/networksecurityperimeterconfiguration_server.go create mode 100644 sdk/resourcemanager/servicebus/armservicebus/fake/networksecurityperimeterconfigurations_server.go delete mode 100644 sdk/resourcemanager/servicebus/armservicebus/fake/time_rfc3339.go create mode 100644 sdk/resourcemanager/servicebus/armservicebus/networksecurityperimeterconfiguration_client.go create mode 100644 sdk/resourcemanager/servicebus/armservicebus/networksecurityperimeterconfiguration_client_example_test.go create mode 100644 sdk/resourcemanager/servicebus/armservicebus/networksecurityperimeterconfigurations_client.go create mode 100644 sdk/resourcemanager/servicebus/armservicebus/networksecurityperimeterconfigurations_client_example_test.go rename sdk/resourcemanager/servicebus/armservicebus/{response_types.go => responses.go} (87%) create mode 100644 sdk/resourcemanager/servicebus/armservicebus/testdata/_metadata.json delete mode 100644 sdk/resourcemanager/servicebus/armservicebus/time_rfc3339.go create mode 100644 sdk/resourcemanager/servicebus/armservicebus/tsp-location.yaml create mode 100644 sdk/resourcemanager/servicebus/armservicebus/version.go diff --git a/sdk/resourcemanager/servicebus/armservicebus/CHANGELOG.md b/sdk/resourcemanager/servicebus/armservicebus/CHANGELOG.md index 8dbf1b760a7b..bb6d6bc451a1 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/CHANGELOG.md +++ b/sdk/resourcemanager/servicebus/armservicebus/CHANGELOG.md @@ -1,5 +1,61 @@ # Release History +## 2.0.0-beta.4 (2026-03-19) +### Breaking Changes + +- Type of `DisasterRecoveryConfigsClientFailOverOptions.Parameters` has been changed from `*FailoverProperties` to `*NamespaceFailoverProperties` +- Operation `*NamespacesClient.Update` has been changed to LRO, use `*NamespacesClient.BeginUpdate` instead. +- Struct `ErrorAdditionalInfo` has been removed +- Struct `ErrorResponse` has been removed +- Struct `ErrorResponseError` has been removed +- Struct `FailoverProperties` has been removed +- Struct `ProxyResource` has been removed +- Struct `Resource` has been removed +- Struct `ResourceNamespacePatch` has been removed +- Struct `SQLRuleAction` has been removed +- Struct `TrackedResource` has been removed + +### Features Added + +- New value `TLSVersion13` added to enum type `TLSVersion` +- New enum type `GeoDRRoleType` with values `GeoDRRoleTypePrimary`, `GeoDRRoleTypeSecondary` +- New enum type `Mode` with values `ModeDisabled`, `ModeEnabled` +- New enum type `NetworkSecurityPerimeterConfigurationProvisioningState` with values `NetworkSecurityPerimeterConfigurationProvisioningStateAccepted`, `NetworkSecurityPerimeterConfigurationProvisioningStateCanceled`, `NetworkSecurityPerimeterConfigurationProvisioningStateCreating`, `NetworkSecurityPerimeterConfigurationProvisioningStateDeleted`, `NetworkSecurityPerimeterConfigurationProvisioningStateDeleting`, `NetworkSecurityPerimeterConfigurationProvisioningStateFailed`, `NetworkSecurityPerimeterConfigurationProvisioningStateInvalidResponse`, `NetworkSecurityPerimeterConfigurationProvisioningStateSucceeded`, `NetworkSecurityPerimeterConfigurationProvisioningStateSucceededWithIssues`, `NetworkSecurityPerimeterConfigurationProvisioningStateUnknown`, `NetworkSecurityPerimeterConfigurationProvisioningStateUpdating` +- New enum type `NspAccessRuleDirection` with values `NspAccessRuleDirectionInbound`, `NspAccessRuleDirectionOutbound` +- New enum type `ResourceAssociationAccessMode` with values `ResourceAssociationAccessModeAuditMode`, `ResourceAssociationAccessModeEnforcedMode`, `ResourceAssociationAccessModeLearningMode`, `ResourceAssociationAccessModeNoAssociationMode`, `ResourceAssociationAccessModeUnspecifiedMode` +- New function `*ClientFactory.NewNetworkSecurityPerimeterConfigurationClient() *NetworkSecurityPerimeterConfigurationClient` +- New function `*ClientFactory.NewNetworkSecurityPerimeterConfigurationsClient() *NetworkSecurityPerimeterConfigurationsClient` +- New function `*NamespacesClient.BeginFailover(ctx context.Context, resourceGroupName string, namespaceName string, parameters FailOver, options *NamespacesClientBeginFailoverOptions) (*runtime.Poller[NamespacesClientFailoverResponse], error)` +- New function `NewNetworkSecurityPerimeterConfigurationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkSecurityPerimeterConfigurationClient, error)` +- New function `*NetworkSecurityPerimeterConfigurationClient.NewListPager(resourceGroupName string, namespaceName string, options *NetworkSecurityPerimeterConfigurationClientListOptions) *runtime.Pager[NetworkSecurityPerimeterConfigurationClientListResponse]` +- New function `NewNetworkSecurityPerimeterConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkSecurityPerimeterConfigurationsClient, error)` +- New function `*NetworkSecurityPerimeterConfigurationsClient.GetResourceAssociationName(ctx context.Context, resourceGroupName string, namespaceName string, resourceAssociationName string, options *NetworkSecurityPerimeterConfigurationsClientGetResourceAssociationNameOptions) (NetworkSecurityPerimeterConfigurationsClientGetResourceAssociationNameResponse, error)` +- New function `*NetworkSecurityPerimeterConfigurationsClient.Reconcile(ctx context.Context, resourceGroupName string, namespaceName string, resourceAssociationName string, options *NetworkSecurityPerimeterConfigurationsClientReconcileOptions) (NetworkSecurityPerimeterConfigurationsClientReconcileResponse, error)` +- New struct `ConfidentialCompute` +- New struct `FailOver` +- New struct `FailOverProperties` +- New struct `GeoDataReplicationProperties` +- New struct `NamespaceFailoverProperties` +- New struct `NamespaceReplicaLocation` +- New struct `NetworkSecurityPerimeter` +- New struct `NetworkSecurityPerimeterConfiguration` +- New struct `NetworkSecurityPerimeterConfigurationList` +- New struct `NetworkSecurityPerimeterConfigurationProperties` +- New struct `NetworkSecurityPerimeterConfigurationPropertiesProfile` +- New struct `NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation` +- New struct `NspAccessRule` +- New struct `NspAccessRuleProperties` +- New struct `NspAccessRulePropertiesSubscriptionsItem` +- New struct `PlatformCapabilities` +- New struct `ProvisioningIssue` +- New struct `ProvisioningIssueProperties` +- New field `GeoDataReplication`, `PlatformCapabilities` in struct `SBNamespaceProperties` +- New field `SystemData` in struct `SBNamespaceUpdateParameters` +- New field `UserMetadata` in struct `SBQueueProperties` +- New field `UserMetadata` in struct `SBSubscriptionProperties` +- New field `UserMetadata` in struct `SBTopicProperties` + + ## 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..fdca08285d21 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/README.md +++ b/sdk/resourcemanager/servicebus/armservicebus/README.md @@ -18,7 +18,7 @@ This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for ve Install the Azure Service Bus module: ```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2 ``` ## Authorization @@ -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 deleted file mode 100644 index cb4273177ff7..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/autorest.md +++ /dev/null @@ -1,13 +0,0 @@ -### AutoRest Configuration - -> see https://aka.ms/autorest - -``` 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 -license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.2.0 -tag: package-2021-11 -``` \ No newline at end of file diff --git a/sdk/resourcemanager/servicebus/armservicebus/build.go b/sdk/resourcemanager/servicebus/armservicebus/build.go deleted file mode 100644 index 18768a472ff1..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/build.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. - -// This file enables 'go generate' to regenerate this specific SDK -//go:generate pwsh ../../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate resourcemanager/servicebus/armservicebus - -package armservicebus diff --git a/sdk/resourcemanager/servicebus/armservicebus/client_factory.go b/sdk/resourcemanager/servicebus/armservicebus/client_factory.go index 5f4dd72bffc4..bd0230137adf 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/client_factory.go +++ b/sdk/resourcemanager/servicebus/armservicebus/client_factory.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicebus @@ -14,83 +13,116 @@ 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. // The parameter values will be propagated to any client created from this factory. -// - subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - 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, + } +} + +// NewNetworkSecurityPerimeterConfigurationClient creates a new instance of NetworkSecurityPerimeterConfigurationClient. +func (c *ClientFactory) NewNetworkSecurityPerimeterConfigurationClient() *NetworkSecurityPerimeterConfigurationClient { + return &NetworkSecurityPerimeterConfigurationClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewNetworkSecurityPerimeterConfigurationsClient creates a new instance of NetworkSecurityPerimeterConfigurationsClient. +func (c *ClientFactory) NewNetworkSecurityPerimeterConfigurationsClient() *NetworkSecurityPerimeterConfigurationsClient { + return &NetworkSecurityPerimeterConfigurationsClient{ + 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 02f9a40a6445..044fc338f180 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/constants.go +++ b/sdk/resourcemanager/servicebus/armservicebus/constants.go @@ -1,15 +1,9 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicebus -const ( - moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" - moduleVersion = "v1.2.0" -) - type AccessRights string const ( @@ -27,14 +21,18 @@ func PossibleAccessRightsValues() []AccessRights { } } -// CreatedByType - The type of identity that created the resource. +// CreatedByType - The kind of entity that created the resource. type CreatedByType string const ( - CreatedByTypeApplication CreatedByType = "Application" - CreatedByTypeKey CreatedByType = "Key" + // CreatedByTypeApplication - The entity was created by an application. + CreatedByTypeApplication CreatedByType = "Application" + // CreatedByTypeKey - The entity was created by a key. + CreatedByTypeKey CreatedByType = "Key" + // CreatedByTypeManagedIdentity - The entity was created by a managed identity. CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" - CreatedByTypeUser CreatedByType = "User" + // CreatedByTypeUser - The entity was created by a user. + CreatedByTypeUser CreatedByType = "User" ) // PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type. @@ -133,6 +131,22 @@ func PossibleFilterTypeValues() []FilterType { } } +// GeoDRRoleType - GeoDR Role Types +type GeoDRRoleType string + +const ( + GeoDRRoleTypePrimary GeoDRRoleType = "Primary" + GeoDRRoleTypeSecondary GeoDRRoleType = "Secondary" +) + +// PossibleGeoDRRoleTypeValues returns the possible values for the GeoDRRoleType const type. +func PossibleGeoDRRoleTypeValues() []GeoDRRoleType { + return []GeoDRRoleType{ + GeoDRRoleTypePrimary, + GeoDRRoleTypeSecondary, + } +} + // KeyType - The access key to regenerate. type KeyType string @@ -182,6 +196,22 @@ func PossibleMigrationConfigurationNameValues() []MigrationConfigurationName { } } +// Mode - Setting to Enable or Disable Confidential Compute +type Mode string + +const ( + ModeDisabled Mode = "Disabled" + ModeEnabled Mode = "Enabled" +) + +// PossibleModeValues returns the possible values for the Mode const type. +func PossibleModeValues() []Mode { + return []Mode{ + ModeDisabled, + ModeEnabled, + } +} + // NetworkRuleIPAction - The IP Filter Action type NetworkRuleIPAction string @@ -196,6 +226,56 @@ func PossibleNetworkRuleIPActionValues() []NetworkRuleIPAction { } } +// NetworkSecurityPerimeterConfigurationProvisioningState - Provisioning state of NetworkSecurityPerimeter configuration propagation +type NetworkSecurityPerimeterConfigurationProvisioningState string + +const ( + NetworkSecurityPerimeterConfigurationProvisioningStateAccepted NetworkSecurityPerimeterConfigurationProvisioningState = "Accepted" + NetworkSecurityPerimeterConfigurationProvisioningStateCanceled NetworkSecurityPerimeterConfigurationProvisioningState = "Canceled" + NetworkSecurityPerimeterConfigurationProvisioningStateCreating NetworkSecurityPerimeterConfigurationProvisioningState = "Creating" + NetworkSecurityPerimeterConfigurationProvisioningStateDeleted NetworkSecurityPerimeterConfigurationProvisioningState = "Deleted" + NetworkSecurityPerimeterConfigurationProvisioningStateDeleting NetworkSecurityPerimeterConfigurationProvisioningState = "Deleting" + NetworkSecurityPerimeterConfigurationProvisioningStateFailed NetworkSecurityPerimeterConfigurationProvisioningState = "Failed" + NetworkSecurityPerimeterConfigurationProvisioningStateInvalidResponse NetworkSecurityPerimeterConfigurationProvisioningState = "InvalidResponse" + NetworkSecurityPerimeterConfigurationProvisioningStateSucceeded NetworkSecurityPerimeterConfigurationProvisioningState = "Succeeded" + NetworkSecurityPerimeterConfigurationProvisioningStateSucceededWithIssues NetworkSecurityPerimeterConfigurationProvisioningState = "SucceededWithIssues" + NetworkSecurityPerimeterConfigurationProvisioningStateUnknown NetworkSecurityPerimeterConfigurationProvisioningState = "Unknown" + NetworkSecurityPerimeterConfigurationProvisioningStateUpdating NetworkSecurityPerimeterConfigurationProvisioningState = "Updating" +) + +// PossibleNetworkSecurityPerimeterConfigurationProvisioningStateValues returns the possible values for the NetworkSecurityPerimeterConfigurationProvisioningState const type. +func PossibleNetworkSecurityPerimeterConfigurationProvisioningStateValues() []NetworkSecurityPerimeterConfigurationProvisioningState { + return []NetworkSecurityPerimeterConfigurationProvisioningState{ + NetworkSecurityPerimeterConfigurationProvisioningStateAccepted, + NetworkSecurityPerimeterConfigurationProvisioningStateCanceled, + NetworkSecurityPerimeterConfigurationProvisioningStateCreating, + NetworkSecurityPerimeterConfigurationProvisioningStateDeleted, + NetworkSecurityPerimeterConfigurationProvisioningStateDeleting, + NetworkSecurityPerimeterConfigurationProvisioningStateFailed, + NetworkSecurityPerimeterConfigurationProvisioningStateInvalidResponse, + NetworkSecurityPerimeterConfigurationProvisioningStateSucceeded, + NetworkSecurityPerimeterConfigurationProvisioningStateSucceededWithIssues, + NetworkSecurityPerimeterConfigurationProvisioningStateUnknown, + NetworkSecurityPerimeterConfigurationProvisioningStateUpdating, + } +} + +// NspAccessRuleDirection - Direction of Access Rule +type NspAccessRuleDirection string + +const ( + NspAccessRuleDirectionInbound NspAccessRuleDirection = "Inbound" + NspAccessRuleDirectionOutbound NspAccessRuleDirection = "Outbound" +) + +// PossibleNspAccessRuleDirectionValues returns the possible values for the NspAccessRuleDirection const type. +func PossibleNspAccessRuleDirectionValues() []NspAccessRuleDirection { + return []NspAccessRuleDirection{ + NspAccessRuleDirectionInbound, + NspAccessRuleDirectionOutbound, + } +} + // PrivateLinkConnectionStatus - Status of the connection. type PrivateLinkConnectionStatus string @@ -235,6 +315,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 @@ -251,6 +349,28 @@ func PossiblePublicNetworkAccessFlagValues() []PublicNetworkAccessFlag { } } +// ResourceAssociationAccessMode - Access Mode of the resource association +type ResourceAssociationAccessMode string + +const ( + ResourceAssociationAccessModeAuditMode ResourceAssociationAccessMode = "AuditMode" + ResourceAssociationAccessModeEnforcedMode ResourceAssociationAccessMode = "EnforcedMode" + ResourceAssociationAccessModeLearningMode ResourceAssociationAccessMode = "LearningMode" + ResourceAssociationAccessModeNoAssociationMode ResourceAssociationAccessMode = "NoAssociationMode" + ResourceAssociationAccessModeUnspecifiedMode ResourceAssociationAccessMode = "UnspecifiedMode" +) + +// PossibleResourceAssociationAccessModeValues returns the possible values for the ResourceAssociationAccessMode const type. +func PossibleResourceAssociationAccessModeValues() []ResourceAssociationAccessMode { + return []ResourceAssociationAccessMode{ + ResourceAssociationAccessModeAuditMode, + ResourceAssociationAccessModeEnforcedMode, + ResourceAssociationAccessModeLearningMode, + ResourceAssociationAccessModeNoAssociationMode, + ResourceAssociationAccessModeUnspecifiedMode, + } +} + // RoleDisasterRecovery - role of namespace in GEO DR - possible values 'Primary' or 'PrimaryNotReplicating' or 'Secondary' type RoleDisasterRecovery string @@ -305,6 +425,26 @@ func PossibleSKUTierValues() []SKUTier { } } +// TLSVersion - The minimum TLS version for the cluster to support, e.g. '1.3' +type TLSVersion string + +const ( + TLSVersion13 TLSVersion = "1.3" + 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{ + TLSVersion13, + TLSVersionOne0, + TLSVersionOne1, + TLSVersionOne2, + } +} + // UnavailableReason - Specifies the reason for the unavailability of the service. type UnavailableReason string diff --git a/sdk/resourcemanager/servicebus/armservicebus/disasterrecoveryconfig_live_test.go b/sdk/resourcemanager/servicebus/armservicebus/disasterrecoveryconfig_live_test.go index 10715d155263..c41cad1a73ff 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/disasterrecoveryconfig_live_test.go +++ b/sdk/resourcemanager/servicebus/armservicebus/disasterrecoveryconfig_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/servicebus/armservicebus/disasterrecoveryconfigs_client.go b/sdk/resourcemanager/servicebus/armservicebus/disasterrecoveryconfigs_client.go index 2363a7b7f8b1..9d30f3fdf6bc 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/disasterrecoveryconfigs_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/disasterrecoveryconfigs_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicebus @@ -25,10 +24,9 @@ type DisasterRecoveryConfigsClient struct { } // NewDisasterRecoveryConfigsClient creates a new instance of DisasterRecoveryConfigsClient with the specified values. -// - subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewDisasterRecoveryConfigsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DisasterRecoveryConfigsClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -44,8 +42,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 2025-05-01-preview +// - 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 @@ -72,8 +70,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -86,26 +88,21 @@ func (client *DisasterRecoveryConfigsClient) breakPairingCreateRequest(ctx conte return nil, errors.New("parameter alias cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{alias}", url.PathEscape(alias)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // 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 2025-05-01-preview +// - 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 @@ -133,8 +130,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -143,18 +144,15 @@ func (client *DisasterRecoveryConfigsClient) checkNameAvailabilityCreateRequest( return nil, errors.New("parameter namespaceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -173,8 +171,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 2025-05-01-preview +// - 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) @@ -203,8 +201,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -217,18 +219,15 @@ func (client *DisasterRecoveryConfigsClient) createOrUpdateCreateRequest(ctx con return nil, errors.New("parameter alias cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{alias}", url.PathEscape(alias)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, 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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -247,8 +246,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 2025-05-01-preview +// - 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 @@ -275,8 +274,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -289,26 +292,21 @@ func (client *DisasterRecoveryConfigsClient) deleteCreateRequest(ctx context.Con return nil, errors.New("parameter alias cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{alias}", url.PathEscape(alias)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, 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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // 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 2025-05-01-preview +// - 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 @@ -337,6 +335,10 @@ func (client *DisasterRecoveryConfigsClient) FailOver(ctx context.Context, resou // failOverCreateRequest creates the FailOver request. func (client *DisasterRecoveryConfigsClient) failOverCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, alias string, options *DisasterRecoveryConfigsClientFailOverOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/failover" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -349,19 +351,15 @@ func (client *DisasterRecoveryConfigsClient) failOverCreateRequest(ctx context.C return nil, errors.New("parameter alias cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{alias}", url.PathEscape(alias)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { return nil, err } @@ -373,8 +371,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 2025-05-01-preview +// - 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 @@ -402,8 +400,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -416,16 +418,12 @@ func (client *DisasterRecoveryConfigsClient) getCreateRequest(ctx context.Contex return nil, errors.New("parameter alias cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{alias}", url.PathEscape(alias)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -443,8 +441,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 2025-05-01-preview +// - 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. @@ -473,8 +471,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -491,16 +493,12 @@ func (client *DisasterRecoveryConfigsClient) getAuthorizationRuleCreateRequest(c return nil, errors.New("parameter authorizationRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{authorizationRuleName}", url.PathEscape(authorizationRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -517,8 +515,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 2025-05-01-preview +// - 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. @@ -546,8 +544,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -556,16 +558,12 @@ func (client *DisasterRecoveryConfigsClient) listCreateRequest(ctx context.Conte return nil, errors.New("parameter namespaceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -582,8 +580,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 2025-05-01-preview +// - 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 @@ -612,8 +610,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -626,16 +628,12 @@ func (client *DisasterRecoveryConfigsClient) listAuthorizationRulesCreateRequest return nil, errors.New("parameter alias cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{alias}", url.PathEscape(alias)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -653,8 +651,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 2025-05-01-preview +// - 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. @@ -683,8 +681,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -701,16 +703,12 @@ func (client *DisasterRecoveryConfigsClient) listKeysCreateRequest(ctx context.C return nil, errors.New("parameter authorizationRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{authorizationRuleName}", url.PathEscape(authorizationRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicebus/armservicebus/disasterrecoveryconfigs_client_example_test.go b/sdk/resourcemanager/servicebus/armservicebus/disasterrecoveryconfigs_client_example_test.go index ce4ba099e0b2..93ba7653d188 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/disasterrecoveryconfigs_client_example_test.go +++ b/sdk/resourcemanager/servicebus/armservicebus/disasterrecoveryconfigs_client_example_test.go @@ -1,66 +1,76 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. 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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" + "log" ) -// 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() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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), - // }, - // }}, - // } + res, 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) } + // 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 = armservicebus.DisasterRecoveryConfigsClientBreakPairingResponse{ + // } } -// 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 +// Generated from example definition: 2025-05-01-preview/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("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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 = armservicebus.DisasterRecoveryConfigsClientCheckNameAvailabilityResponse{ + // CheckNameAvailabilityResult: &armservicebus.CheckNameAvailabilityResult{ + // Message: to.Ptr(""), + // NameAvailable: to.Ptr(true), + // Reason: to.Ptr(armservicebus.UnavailableReasonNone), + // }, + // } +} + +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -76,44 +86,73 @@ func ExampleDisasterRecoveryConfigsClient_CreateOrUpdate() { // 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), + // res = armservicebus.DisasterRecoveryConfigsClientCreateOrUpdateResponse{ + // 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.ProvisioningStateDRAccepted), + // 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 +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, 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) + } + // 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 = armservicebus.DisasterRecoveryConfigsClientDeleteResponse{ + // } +} + +// Generated from example definition: 2025-05-01-preview/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("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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) + res, err := clientFactory.NewDisasterRecoveryConfigsClient().FailOver(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 = armservicebus.DisasterRecoveryConfigsClientFailOverResponse{ + // } } -// 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 +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -124,61 +163,103 @@ func ExampleDisasterRecoveryConfigsClient_Get() { // 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), + // res = armservicebus.DisasterRecoveryConfigsClientGetResponse{ + // 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.ProvisioningStateDRAccepted), + // 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() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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) + 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 = armservicebus.DisasterRecoveryConfigsClientGetAuthorizationRuleResponse{ + // SBAuthorizationRule: &armservicebus.SBAuthorizationRule{ + // Name: to.Ptr("sdk-Authrules-4879"), + // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/DisasterRecoveryConfig/AuthorizationRules"), + // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/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/SBAliasFailOver.json -func ExampleDisasterRecoveryConfigsClient_FailOver() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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) + 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 = armservicebus.DisasterRecoveryConfigsClientListResponse{ + // 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.ProvisioningStateDRAccepted), + // 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/SBAliasAuthorizationRuleListAll.json +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -193,91 +274,68 @@ func ExampleDisasterRecoveryConfigsClient_NewListAuthorizationRulesPager() { _ = 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)}, + // page = armservicebus.DisasterRecoveryConfigsClientListAuthorizationRulesResponse{ + // SBAuthorizationRuleListResult: armservicebus.SBAuthorizationRuleListResult{ + // Value: []*armservicebus.SBAuthorizationRule{ + // { + // Name: to.Ptr("RootManageSharedAccessKey"), + // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/DisasterRecoveryConfig/AuthorizationRules"), + // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/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"), + // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/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)}, + // 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-1684"), + // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/DisasterRecoveryConfig/AuthorizationRules"), + // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/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) + // }, + // }, + // { + // Name: to.Ptr("sdk-Authrules-4879"), + // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/DisasterRecoveryConfig/AuthorizationRules"), + // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/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), + // }, + // }, + // }, + // }, + // }, + // } } - // 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 +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -288,38 +346,13 @@ func ExampleDisasterRecoveryConfigsClient_ListKeys() { // 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), + // res = armservicebus.DisasterRecoveryConfigsClientListKeysResponse{ + // 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("############################################"), + // }, // } } diff --git a/sdk/resourcemanager/servicebus/armservicebus/fake/disasterrecoveryconfigs_server.go b/sdk/resourcemanager/servicebus/armservicebus/fake/disasterrecoveryconfigs_server.go index 44f2219c0483..34b4a2f4183c 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/fake/disasterrecoveryconfigs_server.go +++ b/sdk/resourcemanager/servicebus/armservicebus/fake/disasterrecoveryconfigs_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" "net/http" "net/url" "reflect" @@ -90,39 +89,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) { @@ -132,7 +150,7 @@ func (d *DisasterRecoveryConfigsServerTransport) dispatchBreakPairing(req *http. const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/disasterRecoveryConfigs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/breakPairing` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -169,7 +187,7 @@ func (d *DisasterRecoveryConfigsServerTransport) dispatchCheckNameAvailability(r const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/disasterRecoveryConfigs/CheckNameAvailability` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicebus.CheckNameAvailability](req) @@ -206,7 +224,7 @@ func (d *DisasterRecoveryConfigsServerTransport) dispatchCreateOrUpdate(req *htt const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/disasterRecoveryConfigs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicebus.ArmDisasterRecovery](req) @@ -247,7 +265,7 @@ func (d *DisasterRecoveryConfigsServerTransport) dispatchDelete(req *http.Reques const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/disasterRecoveryConfigs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -284,10 +302,10 @@ func (d *DisasterRecoveryConfigsServerTransport) dispatchFailOver(req *http.Requ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/disasterRecoveryConfigs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/failover` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - body, err := server.UnmarshalRequestAsJSON[armservicebus.FailoverProperties](req) + body, err := server.UnmarshalRequestAsJSON[armservicebus.NamespaceFailoverProperties](req) if err != nil { return nil, err } @@ -331,7 +349,7 @@ func (d *DisasterRecoveryConfigsServerTransport) dispatchGet(req *http.Request) const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/disasterRecoveryConfigs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -368,7 +386,7 @@ func (d *DisasterRecoveryConfigsServerTransport) dispatchGetAuthorizationRule(re const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/disasterRecoveryConfigs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/authorizationRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { + if len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -411,7 +429,7 @@ func (d *DisasterRecoveryConfigsServerTransport) dispatchNewListPager(req *http. const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/disasterRecoveryConfigs` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -452,7 +470,7 @@ func (d *DisasterRecoveryConfigsServerTransport) dispatchNewListAuthorizationRul const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/disasterRecoveryConfigs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/authorizationRules` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -495,7 +513,7 @@ func (d *DisasterRecoveryConfigsServerTransport) dispatchListKeys(req *http.Requ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/disasterRecoveryConfigs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/authorizationRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listKeys` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { + if len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -528,3 +546,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 87d49951b19e..8abccb460355 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/fake/internal.go +++ b/sdk/resourcemanager/servicebus/armservicebus/fake/internal.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -11,6 +10,11 @@ import ( "sync" ) +type result struct { + resp *http.Response + err error +} + type nonRetriableError struct { error } @@ -28,6 +32,14 @@ func contains[T comparable](s []T, v T) bool { return false } +func initServer[T any](mu *sync.Mutex, dst **T, src func() *T) { + mu.Lock() + if *dst == nil { + *dst = src() + } + mu.Unlock() +} + func parseOptional[T any](v string, parse func(v string) (T, error)) (*T, error) { if v == "" { return nil, nil diff --git a/sdk/resourcemanager/servicebus/armservicebus/fake/migrationconfigs_server.go b/sdk/resourcemanager/servicebus/armservicebus/fake/migrationconfigs_server.go index 23d719088c8d..2fd46c3fe052 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/fake/migrationconfigs_server.go +++ b/sdk/resourcemanager/servicebus/armservicebus/fake/migrationconfigs_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" "net/http" "net/url" "regexp" @@ -73,31 +72,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) { @@ -107,7 +125,7 @@ func (m *MigrationConfigsServerTransport) dispatchCompleteMigration(req *http.Re const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrationConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/upgrade` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -152,7 +170,7 @@ func (m *MigrationConfigsServerTransport) dispatchBeginCreateAndStartMigration(r const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrationConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicebus.MigrationConfigProperties](req) @@ -208,7 +226,7 @@ func (m *MigrationConfigsServerTransport) dispatchDelete(req *http.Request) (*ht const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrationConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -251,7 +269,7 @@ func (m *MigrationConfigsServerTransport) dispatchGet(req *http.Request) (*http. const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrationConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -296,7 +314,7 @@ func (m *MigrationConfigsServerTransport) dispatchNewListPager(req *http.Request const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrationConfigurations` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -335,7 +353,7 @@ func (m *MigrationConfigsServerTransport) dispatchRevert(req *http.Request) (*ht const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrationConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/revert` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -370,3 +388,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 a2edf03cf8d3..ee19b68724a2 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/fake/namespaces_server.go +++ b/sdk/resourcemanager/servicebus/armservicebus/fake/namespaces_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" "net/http" "net/url" "regexp" @@ -45,6 +44,10 @@ type NamespacesServer struct { // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent DeleteAuthorizationRule func(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, options *armservicebus.NamespacesClientDeleteAuthorizationRuleOptions) (resp azfake.Responder[armservicebus.NamespacesClientDeleteAuthorizationRuleResponse], errResp azfake.ErrorResponder) + // BeginFailover is the fake for method NamespacesClient.BeginFailover + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginFailover func(ctx context.Context, resourceGroupName string, namespaceName string, parameters armservicebus.FailOver, options *armservicebus.NamespacesClientBeginFailoverOptions) (resp azfake.PollerResponder[armservicebus.NamespacesClientFailoverResponse], errResp azfake.ErrorResponder) + // Get is the fake for method NamespacesClient.Get // HTTP status codes to indicate success: http.StatusOK Get func(ctx context.Context, resourceGroupName string, namespaceName string, options *armservicebus.NamespacesClientGetOptions) (resp azfake.Responder[armservicebus.NamespacesClientGetResponse], errResp azfake.ErrorResponder) @@ -81,9 +84,9 @@ type NamespacesServer struct { // HTTP status codes to indicate success: http.StatusOK RegenerateKeys func(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, parameters armservicebus.RegenerateAccessKeyParameters, options *armservicebus.NamespacesClientRegenerateKeysOptions) (resp azfake.Responder[armservicebus.NamespacesClientRegenerateKeysResponse], errResp azfake.ErrorResponder) - // Update is the fake for method NamespacesClient.Update - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated, http.StatusAccepted - Update func(ctx context.Context, resourceGroupName string, namespaceName string, parameters armservicebus.SBNamespaceUpdateParameters, options *armservicebus.NamespacesClientUpdateOptions) (resp azfake.Responder[armservicebus.NamespacesClientUpdateResponse], errResp azfake.ErrorResponder) + // BeginUpdate is the fake for method NamespacesClient.BeginUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginUpdate func(ctx context.Context, resourceGroupName string, namespaceName string, parameters armservicebus.SBNamespaceUpdateParameters, options *armservicebus.NamespacesClientBeginUpdateOptions) (resp azfake.PollerResponder[armservicebus.NamespacesClientUpdateResponse], errResp azfake.ErrorResponder) } // NewNamespacesServerTransport creates a new instance of NamespacesServerTransport with the provided implementation. @@ -94,10 +97,12 @@ func NewNamespacesServerTransport(srv *NamespacesServer) *NamespacesServerTransp srv: srv, beginCreateOrUpdate: newTracker[azfake.PollerResponder[armservicebus.NamespacesClientCreateOrUpdateResponse]](), beginDelete: newTracker[azfake.PollerResponder[armservicebus.NamespacesClientDeleteResponse]](), + beginFailover: newTracker[azfake.PollerResponder[armservicebus.NamespacesClientFailoverResponse]](), newListPager: newTracker[azfake.PagerResponder[armservicebus.NamespacesClientListResponse]](), newListAuthorizationRulesPager: newTracker[azfake.PagerResponder[armservicebus.NamespacesClientListAuthorizationRulesResponse]](), newListByResourceGroupPager: newTracker[azfake.PagerResponder[armservicebus.NamespacesClientListByResourceGroupResponse]](), newListNetworkRuleSetsPager: newTracker[azfake.PagerResponder[armservicebus.NamespacesClientListNetworkRuleSetsResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armservicebus.NamespacesClientUpdateResponse]](), } } @@ -107,10 +112,12 @@ type NamespacesServerTransport struct { srv *NamespacesServer beginCreateOrUpdate *tracker[azfake.PollerResponder[armservicebus.NamespacesClientCreateOrUpdateResponse]] beginDelete *tracker[azfake.PollerResponder[armservicebus.NamespacesClientDeleteResponse]] + beginFailover *tracker[azfake.PollerResponder[armservicebus.NamespacesClientFailoverResponse]] newListPager *tracker[azfake.PagerResponder[armservicebus.NamespacesClientListResponse]] newListAuthorizationRulesPager *tracker[azfake.PagerResponder[armservicebus.NamespacesClientListAuthorizationRulesResponse]] newListByResourceGroupPager *tracker[azfake.PagerResponder[armservicebus.NamespacesClientListByResourceGroupResponse]] newListNetworkRuleSetsPager *tracker[azfake.PagerResponder[armservicebus.NamespacesClientListNetworkRuleSetsResponse]] + beginUpdate *tracker[azfake.PollerResponder[armservicebus.NamespacesClientUpdateResponse]] } // Do implements the policy.Transporter interface for NamespacesServerTransport. @@ -121,61 +128,82 @@ 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.BeginFailover": + res.resp, res.err = n.dispatchBeginFailover(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.BeginUpdate": + res.resp, res.err = n.dispatchBeginUpdate(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) { if n.srv.CheckNameAvailability == nil { return nil, &nonRetriableError{errors.New("fake for method CheckNameAvailability not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/CheckNameAvailability` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/checkNameAvailability` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { + if len(matches) < 2 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicebus.CheckNameAvailability](req) @@ -206,7 +234,7 @@ func (n *NamespacesServerTransport) dispatchBeginCreateOrUpdate(req *http.Reques const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicebus.SBNamespace](req) @@ -252,7 +280,7 @@ func (n *NamespacesServerTransport) dispatchCreateOrUpdateAuthorizationRule(req const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/AuthorizationRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicebus.SBAuthorizationRule](req) @@ -293,7 +321,7 @@ func (n *NamespacesServerTransport) dispatchCreateOrUpdateNetworkRuleSet(req *ht const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkRuleSets/default` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicebus.NetworkRuleSet](req) @@ -332,7 +360,7 @@ func (n *NamespacesServerTransport) dispatchBeginDelete(req *http.Request) (*htt const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -374,7 +402,7 @@ func (n *NamespacesServerTransport) dispatchDeleteAuthorizationRule(req *http.Re const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/AuthorizationRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -404,6 +432,54 @@ func (n *NamespacesServerTransport) dispatchDeleteAuthorizationRule(req *http.Re return resp, nil } +func (n *NamespacesServerTransport) dispatchBeginFailover(req *http.Request) (*http.Response, error) { + if n.srv.BeginFailover == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginFailover not implemented")} + } + beginFailover := n.beginFailover.get(req) + if beginFailover == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/failover` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armservicebus.FailOver](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + namespaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("namespaceName")]) + if err != nil { + return nil, err + } + respr, errRespr := n.srv.BeginFailover(req.Context(), resourceGroupNameParam, namespaceNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginFailover = &respr + n.beginFailover.add(req, beginFailover) + } + + resp, err := server.PollerResponderNext(beginFailover, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + n.beginFailover.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginFailover) { + n.beginFailover.remove(req) + } + + return resp, nil +} + func (n *NamespacesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { if n.srv.Get == nil { return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} @@ -411,7 +487,7 @@ func (n *NamespacesServerTransport) dispatchGet(req *http.Request) (*http.Respon const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -444,7 +520,7 @@ func (n *NamespacesServerTransport) dispatchGetAuthorizationRule(req *http.Reque const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/AuthorizationRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -481,7 +557,7 @@ func (n *NamespacesServerTransport) dispatchGetNetworkRuleSet(req *http.Request) const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkRuleSets/default` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -516,7 +592,7 @@ func (n *NamespacesServerTransport) dispatchNewListPager(req *http.Request) (*ht const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { + if len(matches) < 2 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := n.srv.NewListPager(nil) @@ -546,10 +622,10 @@ func (n *NamespacesServerTransport) dispatchNewListAuthorizationRulesPager(req * } newListAuthorizationRulesPager := n.newListAuthorizationRulesPager.get(req) if newListAuthorizationRulesPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/AuthorizationRules` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/authorizationRules` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -590,7 +666,7 @@ func (n *NamespacesServerTransport) dispatchNewListByResourceGroupPager(req *htt const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -625,7 +701,7 @@ func (n *NamespacesServerTransport) dispatchListKeys(req *http.Request) (*http.R const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/AuthorizationRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listKeys` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -664,7 +740,7 @@ func (n *NamespacesServerTransport) dispatchNewListNetworkRuleSetsPager(req *htt const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkRuleSets` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -703,7 +779,7 @@ func (n *NamespacesServerTransport) dispatchRegenerateKeys(req *http.Request) (* const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/AuthorizationRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/regenerateKeys` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicebus.RegenerateAccessKeyParameters](req) @@ -737,39 +813,56 @@ func (n *NamespacesServerTransport) dispatchRegenerateKeys(req *http.Request) (* return resp, nil } -func (n *NamespacesServerTransport) dispatchUpdate(req *http.Request) (*http.Response, error) { - if n.srv.Update == nil { - return nil, &nonRetriableError{errors.New("fake for method Update not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) +func (n *NamespacesServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { + if n.srv.BeginUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} } - body, err := server.UnmarshalRequestAsJSON[armservicebus.SBNamespaceUpdateParameters](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err + beginUpdate := n.beginUpdate.get(req) + if beginUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armservicebus.SBNamespaceUpdateParameters](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + namespaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("namespaceName")]) + if err != nil { + return nil, err + } + respr, errRespr := n.srv.BeginUpdate(req.Context(), resourceGroupNameParam, namespaceNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUpdate = &respr + n.beginUpdate.add(req, beginUpdate) } - namespaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("namespaceName")]) + + resp, err := server.PollerResponderNext(beginUpdate, req) if err != nil { return nil, err } - respr, errRespr := n.srv.Update(req.Context(), resourceGroupNameParam, namespaceNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + n.beginUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - respContent := server.GetResponseContent(respr) - 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).SBNamespace, req) - if err != nil { - return nil, err + if !server.PollerResponderMore(beginUpdate) { + n.beginUpdate.remove(req) } + 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/networksecurityperimeterconfiguration_server.go b/sdk/resourcemanager/servicebus/armservicebus/fake/networksecurityperimeterconfiguration_server.go new file mode 100644 index 000000000000..3b01107bba68 --- /dev/null +++ b/sdk/resourcemanager/servicebus/armservicebus/fake/networksecurityperimeterconfiguration_server.go @@ -0,0 +1,133 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package fake + +import ( + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" + "net/http" + "net/url" + "regexp" +) + +// NetworkSecurityPerimeterConfigurationServer is a fake server for instances of the armservicebus.NetworkSecurityPerimeterConfigurationClient type. +type NetworkSecurityPerimeterConfigurationServer struct { + // NewListPager is the fake for method NetworkSecurityPerimeterConfigurationClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, namespaceName string, options *armservicebus.NetworkSecurityPerimeterConfigurationClientListOptions) (resp azfake.PagerResponder[armservicebus.NetworkSecurityPerimeterConfigurationClientListResponse]) +} + +// NewNetworkSecurityPerimeterConfigurationServerTransport creates a new instance of NetworkSecurityPerimeterConfigurationServerTransport with the provided implementation. +// The returned NetworkSecurityPerimeterConfigurationServerTransport instance is connected to an instance of armservicebus.NetworkSecurityPerimeterConfigurationClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewNetworkSecurityPerimeterConfigurationServerTransport(srv *NetworkSecurityPerimeterConfigurationServer) *NetworkSecurityPerimeterConfigurationServerTransport { + return &NetworkSecurityPerimeterConfigurationServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armservicebus.NetworkSecurityPerimeterConfigurationClientListResponse]](), + } +} + +// NetworkSecurityPerimeterConfigurationServerTransport connects instances of armservicebus.NetworkSecurityPerimeterConfigurationClient to instances of NetworkSecurityPerimeterConfigurationServer. +// Don't use this type directly, use NewNetworkSecurityPerimeterConfigurationServerTransport instead. +type NetworkSecurityPerimeterConfigurationServerTransport struct { + srv *NetworkSecurityPerimeterConfigurationServer + newListPager *tracker[azfake.PagerResponder[armservicebus.NetworkSecurityPerimeterConfigurationClientListResponse]] +} + +// Do implements the policy.Transporter interface for NetworkSecurityPerimeterConfigurationServerTransport. +func (n *NetworkSecurityPerimeterConfigurationServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return n.dispatchToMethodFake(req, method) +} + +func (n *NetworkSecurityPerimeterConfigurationServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if networkSecurityPerimeterConfigurationServerTransportInterceptor != nil { + res.resp, res.err, intercepted = networkSecurityPerimeterConfigurationServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "NetworkSecurityPerimeterConfigurationClient.NewListPager": + res.resp, res.err = n.dispatchNewListPager(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 *NetworkSecurityPerimeterConfigurationServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if n.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := n.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkSecurityPerimeterConfigurations` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + namespaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("namespaceName")]) + if err != nil { + return nil, err + } + resp := n.srv.NewListPager(resourceGroupNameParam, namespaceNameParam, nil) + newListPager = &resp + n.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armservicebus.NetworkSecurityPerimeterConfigurationClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + n.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + n.newListPager.remove(req) + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to NetworkSecurityPerimeterConfigurationServerTransport +var networkSecurityPerimeterConfigurationServerTransportInterceptor 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/networksecurityperimeterconfigurations_server.go b/sdk/resourcemanager/servicebus/armservicebus/fake/networksecurityperimeterconfigurations_server.go new file mode 100644 index 000000000000..b1c73a29701a --- /dev/null +++ b/sdk/resourcemanager/servicebus/armservicebus/fake/networksecurityperimeterconfigurations_server.go @@ -0,0 +1,168 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" + "net/http" + "net/url" + "regexp" +) + +// NetworkSecurityPerimeterConfigurationsServer is a fake server for instances of the armservicebus.NetworkSecurityPerimeterConfigurationsClient type. +type NetworkSecurityPerimeterConfigurationsServer struct { + // GetResourceAssociationName is the fake for method NetworkSecurityPerimeterConfigurationsClient.GetResourceAssociationName + // HTTP status codes to indicate success: http.StatusOK + GetResourceAssociationName func(ctx context.Context, resourceGroupName string, namespaceName string, resourceAssociationName string, options *armservicebus.NetworkSecurityPerimeterConfigurationsClientGetResourceAssociationNameOptions) (resp azfake.Responder[armservicebus.NetworkSecurityPerimeterConfigurationsClientGetResourceAssociationNameResponse], errResp azfake.ErrorResponder) + + // Reconcile is the fake for method NetworkSecurityPerimeterConfigurationsClient.Reconcile + // HTTP status codes to indicate success: http.StatusOK + Reconcile func(ctx context.Context, resourceGroupName string, namespaceName string, resourceAssociationName string, options *armservicebus.NetworkSecurityPerimeterConfigurationsClientReconcileOptions) (resp azfake.Responder[armservicebus.NetworkSecurityPerimeterConfigurationsClientReconcileResponse], errResp azfake.ErrorResponder) +} + +// NewNetworkSecurityPerimeterConfigurationsServerTransport creates a new instance of NetworkSecurityPerimeterConfigurationsServerTransport with the provided implementation. +// The returned NetworkSecurityPerimeterConfigurationsServerTransport instance is connected to an instance of armservicebus.NetworkSecurityPerimeterConfigurationsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewNetworkSecurityPerimeterConfigurationsServerTransport(srv *NetworkSecurityPerimeterConfigurationsServer) *NetworkSecurityPerimeterConfigurationsServerTransport { + return &NetworkSecurityPerimeterConfigurationsServerTransport{srv: srv} +} + +// NetworkSecurityPerimeterConfigurationsServerTransport connects instances of armservicebus.NetworkSecurityPerimeterConfigurationsClient to instances of NetworkSecurityPerimeterConfigurationsServer. +// Don't use this type directly, use NewNetworkSecurityPerimeterConfigurationsServerTransport instead. +type NetworkSecurityPerimeterConfigurationsServerTransport struct { + srv *NetworkSecurityPerimeterConfigurationsServer +} + +// Do implements the policy.Transporter interface for NetworkSecurityPerimeterConfigurationsServerTransport. +func (n *NetworkSecurityPerimeterConfigurationsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return n.dispatchToMethodFake(req, method) +} + +func (n *NetworkSecurityPerimeterConfigurationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if networkSecurityPerimeterConfigurationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = networkSecurityPerimeterConfigurationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "NetworkSecurityPerimeterConfigurationsClient.GetResourceAssociationName": + res.resp, res.err = n.dispatchGetResourceAssociationName(req) + case "NetworkSecurityPerimeterConfigurationsClient.Reconcile": + res.resp, res.err = n.dispatchReconcile(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 *NetworkSecurityPerimeterConfigurationsServerTransport) dispatchGetResourceAssociationName(req *http.Request) (*http.Response, error) { + if n.srv.GetResourceAssociationName == nil { + return nil, &nonRetriableError{errors.New("fake for method GetResourceAssociationName not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkSecurityPerimeterConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + namespaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("namespaceName")]) + if err != nil { + return nil, err + } + resourceAssociationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceAssociationName")]) + if err != nil { + return nil, err + } + respr, errRespr := n.srv.GetResourceAssociationName(req.Context(), resourceGroupNameParam, namespaceNameParam, resourceAssociationNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).NetworkSecurityPerimeterConfiguration, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (n *NetworkSecurityPerimeterConfigurationsServerTransport) dispatchReconcile(req *http.Request) (*http.Response, error) { + if n.srv.Reconcile == nil { + return nil, &nonRetriableError{errors.New("fake for method Reconcile not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkSecurityPerimeterConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/reconcile` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + namespaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("namespaceName")]) + if err != nil { + return nil, err + } + resourceAssociationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceAssociationName")]) + if err != nil { + return nil, err + } + respr, errRespr := n.srv.Reconcile(req.Context(), resourceGroupNameParam, namespaceNameParam, resourceAssociationNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to NetworkSecurityPerimeterConfigurationsServerTransport +var networkSecurityPerimeterConfigurationsServerTransportInterceptor 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 a0b0097bb2da..0a545bb0386d 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/fake/operations_server.go +++ b/sdk/resourcemanager/servicebus/armservicebus/fake/operations_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,7 +11,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" "net/http" ) @@ -48,21 +47,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) { @@ -91,3 +109,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 b85df8e3e8aa..324b5c857445 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/fake/privateendpointconnections_server.go +++ b/sdk/resourcemanager/servicebus/armservicebus/fake/privateendpointconnections_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" "net/http" "net/url" "regexp" @@ -22,7 +21,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 @@ -65,27 +64,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) { @@ -95,7 +113,7 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchCreateOrUpdate(req * const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicebus.PrivateEndpointConnection](req) @@ -119,8 +137,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 { @@ -138,7 +156,7 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchBeginDelete(req *htt const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -184,7 +202,7 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchGet(req *http.Reques const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -223,7 +241,7 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchNewListPager(req *ht const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -254,3 +272,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 6ce6a379d78b..e71926717160 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/fake/privatelinkresources_server.go +++ b/sdk/resourcemanager/servicebus/armservicebus/fake/privatelinkresources_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,7 +11,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" "net/http" "net/url" "regexp" @@ -46,21 +45,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) { @@ -70,7 +88,7 @@ func (p *PrivateLinkResourcesServerTransport) dispatchGet(req *http.Request) (*h const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateLinkResources` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -95,3 +113,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 5a0a084ad3f4..adff18bab11d 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/fake/queues_server.go +++ b/sdk/resourcemanager/servicebus/armservicebus/fake/queues_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" "net/http" "net/url" "regexp" @@ -90,39 +89,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) { @@ -132,7 +150,7 @@ func (q *QueuesServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/queues/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicebus.SBQueue](req) @@ -173,7 +191,7 @@ func (q *QueuesServerTransport) dispatchCreateOrUpdateAuthorizationRule(req *htt const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/queues/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/authorizationRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { + if len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicebus.SBAuthorizationRule](req) @@ -218,7 +236,7 @@ func (q *QueuesServerTransport) dispatchDelete(req *http.Request) (*http.Respons const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/queues/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -255,7 +273,7 @@ func (q *QueuesServerTransport) dispatchDeleteAuthorizationRule(req *http.Reques const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/queues/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/authorizationRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { + if len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -296,7 +314,7 @@ func (q *QueuesServerTransport) dispatchGet(req *http.Request) (*http.Response, const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/queues/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -333,7 +351,7 @@ func (q *QueuesServerTransport) dispatchGetAuthorizationRule(req *http.Request) const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/queues/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/authorizationRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { + if len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -376,7 +394,7 @@ func (q *QueuesServerTransport) dispatchNewListAuthorizationRulesPager(req *http const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/queues/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/authorizationRules` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -421,7 +439,7 @@ func (q *QueuesServerTransport) dispatchNewListByNamespacePager(req *http.Reques const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/queues` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } qp := req.URL.Query() @@ -493,10 +511,10 @@ func (q *QueuesServerTransport) dispatchListKeys(req *http.Request) (*http.Respo if q.srv.ListKeys == nil { return nil, &nonRetriableError{errors.New("fake for method ListKeys not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/queues/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/authorizationRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/ListKeys` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/queues/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/authorizationRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listKeys` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { + if len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -537,7 +555,7 @@ func (q *QueuesServerTransport) dispatchRegenerateKeys(req *http.Request) (*http const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/queues/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/authorizationRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/regenerateKeys` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { + if len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicebus.RegenerateAccessKeyParameters](req) @@ -574,3 +592,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 4ced2117f67a..0e850562adc6 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/fake/rules_server.go +++ b/sdk/resourcemanager/servicebus/armservicebus/fake/rules_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" "net/http" "net/url" "regexp" @@ -64,27 +63,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) { @@ -94,7 +112,7 @@ func (r *RulesServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http. const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/topics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/rules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 6 { + if len(matches) < 7 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicebus.Rule](req) @@ -143,7 +161,7 @@ func (r *RulesServerTransport) dispatchDelete(req *http.Request) (*http.Response const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/topics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/rules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 6 { + if len(matches) < 7 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -188,7 +206,7 @@ func (r *RulesServerTransport) dispatchGet(req *http.Request) (*http.Response, e const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/topics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/rules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 6 { + if len(matches) < 7 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -235,7 +253,7 @@ func (r *RulesServerTransport) dispatchNewListBySubscriptionsPager(req *http.Req const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/topics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/rules` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { + if len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } qp := req.URL.Query() @@ -310,3 +328,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 4d6622684ab7..1fa9dd6e0101 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/fake/server_factory.go +++ b/sdk/resourcemanager/servicebus/armservicebus/fake/server_factory.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -16,16 +15,41 @@ 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 + + // NetworkSecurityPerimeterConfigurationServer contains the fakes for client NetworkSecurityPerimeterConfigurationClient + NetworkSecurityPerimeterConfigurationServer NetworkSecurityPerimeterConfigurationServer + + // NetworkSecurityPerimeterConfigurationsServer contains the fakes for client NetworkSecurityPerimeterConfigurationsClient + NetworkSecurityPerimeterConfigurationsServer NetworkSecurityPerimeterConfigurationsServer + + // 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. @@ -40,18 +64,20 @@ func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport { // ServerFactoryTransport connects instances of armservicebus.ClientFactory to instances of ServerFactory. // Don't use this type directly, use NewServerFactoryTransport instead. type ServerFactoryTransport struct { - srv *ServerFactory - trMu sync.Mutex - trDisasterRecoveryConfigsServer *DisasterRecoveryConfigsServerTransport - trMigrationConfigsServer *MigrationConfigsServerTransport - trNamespacesServer *NamespacesServerTransport - trOperationsServer *OperationsServerTransport - trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport - trPrivateLinkResourcesServer *PrivateLinkResourcesServerTransport - trQueuesServer *QueuesServerTransport - trRulesServer *RulesServerTransport - trSubscriptionsServer *SubscriptionsServerTransport - trTopicsServer *TopicsServerTransport + srv *ServerFactory + trMu sync.Mutex + trDisasterRecoveryConfigsServer *DisasterRecoveryConfigsServerTransport + trMigrationConfigsServer *MigrationConfigsServerTransport + trNamespacesServer *NamespacesServerTransport + trNetworkSecurityPerimeterConfigurationServer *NetworkSecurityPerimeterConfigurationServerTransport + trNetworkSecurityPerimeterConfigurationsServer *NetworkSecurityPerimeterConfigurationsServerTransport + trOperationsServer *OperationsServerTransport + trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport + trPrivateLinkResourcesServer *PrivateLinkResourcesServerTransport + trQueuesServer *QueuesServerTransport + trRulesServer *RulesServerTransport + trSubscriptionsServer *SubscriptionsServerTransport + trTopicsServer *TopicsServerTransport } // Do implements the policy.Transporter interface for ServerFactoryTransport. @@ -68,44 +94,54 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { switch client { case "DisasterRecoveryConfigsClient": - initServer(s, &s.trDisasterRecoveryConfigsServer, func() *DisasterRecoveryConfigsServerTransport { + initServer(&s.trMu, &s.trDisasterRecoveryConfigsServer, func() *DisasterRecoveryConfigsServerTransport { return NewDisasterRecoveryConfigsServerTransport(&s.srv.DisasterRecoveryConfigsServer) }) resp, err = s.trDisasterRecoveryConfigsServer.Do(req) case "MigrationConfigsClient": - initServer(s, &s.trMigrationConfigsServer, func() *MigrationConfigsServerTransport { + initServer(&s.trMu, &s.trMigrationConfigsServer, func() *MigrationConfigsServerTransport { return NewMigrationConfigsServerTransport(&s.srv.MigrationConfigsServer) }) resp, err = s.trMigrationConfigsServer.Do(req) case "NamespacesClient": - initServer(s, &s.trNamespacesServer, func() *NamespacesServerTransport { return NewNamespacesServerTransport(&s.srv.NamespacesServer) }) + initServer(&s.trMu, &s.trNamespacesServer, func() *NamespacesServerTransport { return NewNamespacesServerTransport(&s.srv.NamespacesServer) }) resp, err = s.trNamespacesServer.Do(req) + case "NetworkSecurityPerimeterConfigurationClient": + initServer(&s.trMu, &s.trNetworkSecurityPerimeterConfigurationServer, func() *NetworkSecurityPerimeterConfigurationServerTransport { + return NewNetworkSecurityPerimeterConfigurationServerTransport(&s.srv.NetworkSecurityPerimeterConfigurationServer) + }) + resp, err = s.trNetworkSecurityPerimeterConfigurationServer.Do(req) + case "NetworkSecurityPerimeterConfigurationsClient": + initServer(&s.trMu, &s.trNetworkSecurityPerimeterConfigurationsServer, func() *NetworkSecurityPerimeterConfigurationsServerTransport { + return NewNetworkSecurityPerimeterConfigurationsServerTransport(&s.srv.NetworkSecurityPerimeterConfigurationsServer) + }) + resp, err = s.trNetworkSecurityPerimeterConfigurationsServer.Do(req) case "OperationsClient": - initServer(s, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) }) + initServer(&s.trMu, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) }) resp, err = s.trOperationsServer.Do(req) case "PrivateEndpointConnectionsClient": - initServer(s, &s.trPrivateEndpointConnectionsServer, func() *PrivateEndpointConnectionsServerTransport { + initServer(&s.trMu, &s.trPrivateEndpointConnectionsServer, func() *PrivateEndpointConnectionsServerTransport { return NewPrivateEndpointConnectionsServerTransport(&s.srv.PrivateEndpointConnectionsServer) }) resp, err = s.trPrivateEndpointConnectionsServer.Do(req) case "PrivateLinkResourcesClient": - initServer(s, &s.trPrivateLinkResourcesServer, func() *PrivateLinkResourcesServerTransport { + initServer(&s.trMu, &s.trPrivateLinkResourcesServer, func() *PrivateLinkResourcesServerTransport { return NewPrivateLinkResourcesServerTransport(&s.srv.PrivateLinkResourcesServer) }) resp, err = s.trPrivateLinkResourcesServer.Do(req) case "QueuesClient": - initServer(s, &s.trQueuesServer, func() *QueuesServerTransport { return NewQueuesServerTransport(&s.srv.QueuesServer) }) + initServer(&s.trMu, &s.trQueuesServer, func() *QueuesServerTransport { return NewQueuesServerTransport(&s.srv.QueuesServer) }) resp, err = s.trQueuesServer.Do(req) case "RulesClient": - initServer(s, &s.trRulesServer, func() *RulesServerTransport { return NewRulesServerTransport(&s.srv.RulesServer) }) + initServer(&s.trMu, &s.trRulesServer, func() *RulesServerTransport { return NewRulesServerTransport(&s.srv.RulesServer) }) resp, err = s.trRulesServer.Do(req) case "SubscriptionsClient": - initServer(s, &s.trSubscriptionsServer, func() *SubscriptionsServerTransport { + initServer(&s.trMu, &s.trSubscriptionsServer, func() *SubscriptionsServerTransport { return NewSubscriptionsServerTransport(&s.srv.SubscriptionsServer) }) resp, err = s.trSubscriptionsServer.Do(req) case "TopicsClient": - initServer(s, &s.trTopicsServer, func() *TopicsServerTransport { return NewTopicsServerTransport(&s.srv.TopicsServer) }) + initServer(&s.trMu, &s.trTopicsServer, func() *TopicsServerTransport { return NewTopicsServerTransport(&s.srv.TopicsServer) }) resp, err = s.trTopicsServer.Do(req) default: err = fmt.Errorf("unhandled client %s", client) @@ -117,11 +153,3 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return resp, nil } - -func initServer[T any](s *ServerFactoryTransport, dst **T, src func() *T) { - s.trMu.Lock() - if *dst == nil { - *dst = src() - } - s.trMu.Unlock() -} diff --git a/sdk/resourcemanager/servicebus/armservicebus/fake/subscriptions_server.go b/sdk/resourcemanager/servicebus/armservicebus/fake/subscriptions_server.go index adcd9a53f364..6d4216093ae9 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/fake/subscriptions_server.go +++ b/sdk/resourcemanager/servicebus/armservicebus/fake/subscriptions_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" "net/http" "net/url" "regexp" @@ -64,27 +63,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) { @@ -94,7 +112,7 @@ func (s *SubscriptionsServerTransport) dispatchCreateOrUpdate(req *http.Request) const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/topics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { + if len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicebus.SBSubscription](req) @@ -139,7 +157,7 @@ func (s *SubscriptionsServerTransport) dispatchDelete(req *http.Request) (*http. const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/topics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { + if len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -180,7 +198,7 @@ func (s *SubscriptionsServerTransport) dispatchGet(req *http.Request) (*http.Res const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/topics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { + if len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -223,7 +241,7 @@ func (s *SubscriptionsServerTransport) dispatchNewListByTopicPager(req *http.Req const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/topics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/subscriptions` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } qp := req.URL.Query() @@ -294,3 +312,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 b98c0b0402be..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/fake/time_rfc3339.go +++ /dev/null @@ -1,83 +0,0 @@ -// 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 79806dda5b92..1a5d6722cf3f 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/fake/topics_server.go +++ b/sdk/resourcemanager/servicebus/armservicebus/fake/topics_server.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" "net/http" "net/url" "regexp" @@ -90,39 +89,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) { @@ -132,7 +150,7 @@ func (t *TopicsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/topics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicebus.SBTopic](req) @@ -173,7 +191,7 @@ func (t *TopicsServerTransport) dispatchCreateOrUpdateAuthorizationRule(req *htt const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/topics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/authorizationRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { + if len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicebus.SBAuthorizationRule](req) @@ -218,7 +236,7 @@ func (t *TopicsServerTransport) dispatchDelete(req *http.Request) (*http.Respons const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/topics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -255,7 +273,7 @@ func (t *TopicsServerTransport) dispatchDeleteAuthorizationRule(req *http.Reques const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/topics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/authorizationRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { + if len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -296,7 +314,7 @@ func (t *TopicsServerTransport) dispatchGet(req *http.Request) (*http.Response, const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/topics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -333,7 +351,7 @@ func (t *TopicsServerTransport) dispatchGetAuthorizationRule(req *http.Request) const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/topics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/authorizationRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { + if len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -376,7 +394,7 @@ func (t *TopicsServerTransport) dispatchNewListAuthorizationRulesPager(req *http const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/topics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/authorizationRules` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -421,7 +439,7 @@ func (t *TopicsServerTransport) dispatchNewListByNamespacePager(req *http.Reques const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/topics` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } qp := req.URL.Query() @@ -493,10 +511,10 @@ func (t *TopicsServerTransport) dispatchListKeys(req *http.Request) (*http.Respo if t.srv.ListKeys == nil { return nil, &nonRetriableError{errors.New("fake for method ListKeys not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/topics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/authorizationRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/ListKeys` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/topics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/authorizationRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listKeys` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { + if len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -537,7 +555,7 @@ func (t *TopicsServerTransport) dispatchRegenerateKeys(req *http.Request) (*http const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceBus/namespaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/topics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/authorizationRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/regenerateKeys` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { + if len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicebus.RegenerateAccessKeyParameters](req) @@ -574,3 +592,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 23120af9c026..519986ad791a 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/go.mod +++ b/sdk/resourcemanager/servicebus/armservicebus/go.mod @@ -1,9 +1,9 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2 go 1.24.0 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0 github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0 @@ -19,9 +19,9 @@ require ( github.com/kylelemons/godebug v1.1.0 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/crypto v0.45.0 // indirect - golang.org/x/net v0.47.0 // indirect - golang.org/x/sys v0.38.0 // indirect - golang.org/x/text v0.31.0 // indirect + golang.org/x/crypto v0.47.0 // indirect + golang.org/x/net v0.49.0 // indirect + golang.org/x/sys v0.40.0 // indirect + golang.org/x/text v0.33.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/sdk/resourcemanager/servicebus/armservicebus/go.sum b/sdk/resourcemanager/servicebus/armservicebus/go.sum index cc236fb92e86..f4450ac568ee 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/go.sum +++ b/sdk/resourcemanager/servicebus/armservicebus/go.sum @@ -1,5 +1,5 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0 h1:JXg2dwJUmPB9JmtVmdEB16APJ7jurfbY5jnfXpJoRMc= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0/go.mod h1:YD5h/ldMsG0XiIw7PdyNhLxaM317eFh5yNLccNfGdyw= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0 h1:fou+2+WFTib47nS+nz/ozhEBnvU96bKHy6LjRsY4E28= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0/go.mod h1:t76Ruy8AHvUAC8GfMWJMa0ElSbuIcO03NLpynfbgsPA= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 h1:Hk5QBxZQC1jb2Fwj6mpzme37xbCDdNTxU7O9eb5+LB4= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1/go.mod h1:IYus9qsFobWIc2YVwe/WPjcnyCkPKtnHAqUYeebc8z0= github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2 h1:yz1bePFlP5Vws5+8ez6T3HWXPmwOK7Yvq8QxDBD3SKY= @@ -40,15 +40,15 @@ github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q= -golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4= -golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY= -golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU= +golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8= +golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A= +golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o= +golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc= -golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM= -golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM= +golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ= +golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE= +golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/sdk/resourcemanager/servicebus/armservicebus/migrationconfigs_client.go b/sdk/resourcemanager/servicebus/armservicebus/migrationconfigs_client.go index 58a1ddd531bf..78f6c48b8889 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/migrationconfigs_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/migrationconfigs_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicebus @@ -25,10 +24,9 @@ type MigrationConfigsClient struct { } // NewMigrationConfigsClient creates a new instance of MigrationConfigsClient with the specified values. -// - subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewMigrationConfigsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MigrationConfigsClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -42,14 +40,14 @@ func NewMigrationConfigsClient(subscriptionID string, credential azcore.TokenCre } // CompleteMigration - This operation Completes Migration of entities by pointing the connection strings to Premium namespace -// and any entities created after the operation will be under Premium Namespace. CompleteMigration -// operation will fail when entity migration is in-progress. +// and any entities created after the operation will be under Premium Namespace. CompleteMigration operation will fail when +// entity migration is in-progress. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2025-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name -// - configName - The configuration name. Should always be "$default". +// - configName - The configuration name. Should always be $default. // - options - MigrationConfigsClientCompleteMigrationOptions contains the optional parameters for the MigrationConfigsClient.CompleteMigration // method. func (client *MigrationConfigsClient) CompleteMigration(ctx context.Context, resourceGroupName string, namespaceName string, configName MigrationConfigurationName, options *MigrationConfigsClientCompleteMigrationOptions) (MigrationConfigsClientCompleteMigrationResponse, error) { @@ -74,8 +72,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -88,18 +90,13 @@ func (client *MigrationConfigsClient) completeMigrationCreateRequest(ctx context return nil, errors.New("parameter configName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{configName}", url.PathEscape(string(configName))) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -107,10 +104,10 @@ 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 2025-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name -// - configName - The configuration name. Should always be "$default". +// - configName - The configuration name. Should always be $default. // - parameters - Parameters required to create Migration Configuration // - options - MigrationConfigsClientBeginCreateAndStartMigrationOptions contains the optional parameters for the MigrationConfigsClient.BeginCreateAndStartMigration // method. @@ -134,7 +131,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 2025-05-01-preview 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" @@ -157,8 +154,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -171,18 +172,15 @@ func (client *MigrationConfigsClient) createAndStartMigrationCreateRequest(ctx c return nil, errors.New("parameter configName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{configName}", url.PathEscape(string(configName))) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, 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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -192,10 +190,10 @@ 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 2025-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name -// - configName - The configuration name. Should always be "$default". +// - configName - The configuration name. Should always be $default. // - options - MigrationConfigsClientDeleteOptions contains the optional parameters for the MigrationConfigsClient.Delete method. func (client *MigrationConfigsClient) Delete(ctx context.Context, resourceGroupName string, namespaceName string, configName MigrationConfigurationName, options *MigrationConfigsClientDeleteOptions) (MigrationConfigsClientDeleteResponse, error) { var err error @@ -219,8 +217,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -233,28 +235,23 @@ func (client *MigrationConfigsClient) deleteCreateRequest(ctx context.Context, r return nil, errors.New("parameter configName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{configName}", url.PathEscape(string(configName))) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, 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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // 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 2025-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name -// - configName - The configuration name. Should always be "$default". +// - configName - The configuration name. Should always be $default. // - options - MigrationConfigsClientGetOptions contains the optional parameters for the MigrationConfigsClient.Get method. func (client *MigrationConfigsClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, configName MigrationConfigurationName, options *MigrationConfigsClientGetOptions) (MigrationConfigsClientGetResponse, error) { var err error @@ -279,8 +276,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -293,16 +294,12 @@ func (client *MigrationConfigsClient) getCreateRequest(ctx context.Context, reso return nil, errors.New("parameter configName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{configName}", url.PathEscape(string(configName))) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -319,8 +316,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 2025-05-01-preview +// - 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. @@ -348,8 +345,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -358,16 +359,12 @@ func (client *MigrationConfigsClient) listCreateRequest(ctx context.Context, res return nil, errors.New("parameter namespaceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -385,10 +382,10 @@ 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 2025-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name -// - configName - The configuration name. Should always be "$default". +// - configName - The configuration name. Should always be $default. // - options - MigrationConfigsClientRevertOptions contains the optional parameters for the MigrationConfigsClient.Revert method. func (client *MigrationConfigsClient) Revert(ctx context.Context, resourceGroupName string, namespaceName string, configName MigrationConfigurationName, options *MigrationConfigsClientRevertOptions) (MigrationConfigsClientRevertResponse, error) { var err error @@ -412,8 +409,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -426,17 +427,12 @@ func (client *MigrationConfigsClient) revertCreateRequest(ctx context.Context, r return nil, errors.New("parameter configName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{configName}", url.PathEscape(string(configName))) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/servicebus/armservicebus/migrationconfigs_client_example_test.go b/sdk/resourcemanager/servicebus/armservicebus/migrationconfigs_client_example_test.go index 1835abff3224..05a2eebfcc6f 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/migrationconfigs_client_example_test.go +++ b/sdk/resourcemanager/servicebus/armservicebus/migrationconfigs_client_example_test.go @@ -1,74 +1,54 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. 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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" + "log" ) -// 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() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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"), - // }, - // }}, - // } + res, err := clientFactory.NewMigrationConfigsClient().CompleteMigration(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 = armservicebus.MigrationConfigsClientCompleteMigrationResponse{ + // } } -// 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 +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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"), + TargetNamespace: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ResourceGroup/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-4028"), }, }, nil) if err != nil { @@ -81,44 +61,51 @@ func ExampleMigrationConfigsClient_BeginCreateAndStartMigration() { // 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"), + // res = armservicebus.MigrationConfigsClientCreateAndStartMigrationResponse{ + // MigrationConfigProperties: &armservicebus.MigrationConfigProperties{ + // Name: to.Ptr("sdk-Namespace-41"), + // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/disasterrecoveryconfigs"), + // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/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("Accepted"), + // TargetNamespace: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/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 +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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) + res, err := clientFactory.NewMigrationConfigsClient().Delete(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 = armservicebus.MigrationConfigsClientDeleteResponse{ + // } } -// 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 +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -129,50 +116,82 @@ func ExampleMigrationConfigsClient_Get() { // 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"), + // res = armservicebus.MigrationConfigsClientGetResponse{ + // MigrationConfigProperties: &armservicebus.MigrationConfigProperties{ + // Name: to.Ptr("sdk-Namespace-41"), + // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/disasterrecoveryconfigs"), + // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/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/5f750a97-50d9-4e36-8081-c9ee4c0210d4/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() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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) + 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 = armservicebus.MigrationConfigsClientListResponse{ + // MigrationConfigListResult: armservicebus.MigrationConfigListResult{ + // Value: []*armservicebus.MigrationConfigProperties{ + // { + // Name: to.Ptr("sdk-Namespace-9259"), + // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/migrationconfigurations"), + // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/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/5f750a97-50d9-4e36-8081-c9ee4c0210d4/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/SBMigrationconfigurationRevert.json +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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) + res, err := clientFactory.NewMigrationConfigsClient().Revert(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 = armservicebus.MigrationConfigsClientRevertResponse{ + // } } diff --git a/sdk/resourcemanager/servicebus/armservicebus/migrationconfigs_live_test.go b/sdk/resourcemanager/servicebus/armservicebus/migrationconfigs_live_test.go index 09542d538db0..81558ddc02aa 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/migrationconfigs_live_test.go +++ b/sdk/resourcemanager/servicebus/armservicebus/migrationconfigs_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/servicebus/armservicebus/models.go b/sdk/resourcemanager/servicebus/armservicebus/models.go index b6fcda86822c..533b94010fdb 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/models.go +++ b/sdk/resourcemanager/servicebus/armservicebus/models.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicebus @@ -58,19 +57,19 @@ type ArmDisasterRecovery struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; The system meta data relating to this resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData - // READ-ONLY; The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs" + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// ArmDisasterRecoveryListResult - The result of the List Alias(Disaster Recovery configuration) operation. +// ArmDisasterRecoveryListResult - The response of a ArmDisasterRecovery list operation. type ArmDisasterRecoveryListResult struct { - // List of Alias(Disaster Recovery configurations) + // REQUIRED; The ArmDisasterRecovery items on this page Value []*ArmDisasterRecovery - // READ-ONLY; Link to the next set of results. Not empty if Value contains incomplete list of Alias(Disaster Recovery configuration) + // The link to the next page of items NextLink *string } @@ -96,8 +95,7 @@ type ArmDisasterRecoveryProperties struct { // CheckNameAvailability - Description of a Check Name availability request properties. type CheckNameAvailability struct { // REQUIRED; The Name to check the namespace name availability and The namespace name can contain only letters, numbers, and - // hyphens. The namespace must start with a letter, and it must end with a letter or - // number. + // hyphens. The namespace must start with a letter, and it must end with a letter or number. Name *string } @@ -113,6 +111,11 @@ type CheckNameAvailabilityResult struct { Message *string } +type ConfidentialCompute struct { + // Setting to Enable or Disable Confidential Compute + Mode *Mode +} + // ConnectionState information. type ConnectionState struct { // Description of the connection state. @@ -157,7 +160,8 @@ type CorrelationFilter struct { // Encryption - Properties to configure Encryption type Encryption struct { - // Enumerates the possible value of keySource for Encryption + // FLAG; 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 @@ -167,44 +171,17 @@ type Encryption struct { RequireInfrastructureEncryption *bool } -// ErrorAdditionalInfo - The resource management error additional info. -type ErrorAdditionalInfo struct { - // READ-ONLY; The additional info. - Info any - - // READ-ONLY; The additional info type. - Type *string +type FailOver struct { + Properties *FailOverProperties } -// ErrorResponse - The resource management error response. -type ErrorResponse struct { - // The error object. - Error *ErrorResponseError -} - -// ErrorResponseError - The error object. -type ErrorResponseError struct { - // READ-ONLY; The error additional info. - AdditionalInfo []*ErrorAdditionalInfo - - // READ-ONLY; The error code. - Code *string +type FailOverProperties struct { + // If Force is false then graceful failover is attempted after ensuring no data loss. If Force flag is set to true, Forced + // failover is attempted with possible data loss. + Force *bool - // READ-ONLY; The error details. - Details []*ErrorResponse - - // READ-ONLY; The error message. - Message *string - - // READ-ONLY; The error target. - Target *string -} - -// FailoverProperties - Safe failover is to indicate the service should wait for pending replication to finish before switching -// to the secondary. -type FailoverProperties struct { - // Safe failover is to indicate the service should wait for pending replication to finish before switching to the secondary. - Properties *FailoverPropertiesProperties + // Query parameter for the new primary location after failover. + PrimaryLocation *string } // FailoverPropertiesProperties - Safe failover is to indicate the service should wait for pending replication to finish before @@ -214,6 +191,17 @@ type FailoverPropertiesProperties struct { IsSafeFailover *bool } +// GeoDataReplicationProperties - GeoDR Replication properties +type GeoDataReplicationProperties struct { + // A list of regions where replicas of the namespace are maintained. + Locations []*NamespaceReplicaLocation + + // The maximum acceptable lag for data replication operations from the primary replica to a quorum of secondary replicas. + // When the lag exceeds the configured amount, operations on the primary replica will be failed. The allowed values are 0 + // and 5 minutes to 1 day. + MaxReplicationLagDurationInSeconds *int32 +} + // Identity - Properties to configure User Assigned Identities for Bring your Own Keys type Identity struct { // Type of managed service identity. @@ -261,12 +249,12 @@ type MessageCountDetails struct { TransferMessageCount *int64 } -// MigrationConfigListResult - The result of the List migrationConfigurations operation. +// MigrationConfigListResult - The response of a MigrationConfigProperties list operation. type MigrationConfigListResult struct { - // List of Migration Configs + // REQUIRED; The MigrationConfigProperties items on this page Value []*MigrationConfigProperties - // READ-ONLY; Link to the next set of results. Not empty if Value contains incomplete list of migrationConfigurations + // The link to the next page of items NextLink *string } @@ -284,10 +272,10 @@ type MigrationConfigProperties struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; The system meta data relating to this resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData - // READ-ONLY; The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs" + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -306,7 +294,7 @@ type MigrationConfigPropertiesProperties struct { // READ-ONLY; Number of entities pending to be replicated. PendingReplicationOperationsCount *int64 - // READ-ONLY; Provisioning state of Migration Configuration + // READ-ONLY; Provisioning state of Migration ConfigurationProvisioning state of Migration Configuration ProvisioningState *string } @@ -328,6 +316,26 @@ type NWRuleSetVirtualNetworkRules struct { Subnet *Subnet } +// NamespaceFailoverProperties - Safe failover is to indicate the service should wait for pending replication to finish before +// switching to the secondary. +type NamespaceFailoverProperties struct { + // Safe failover is to indicate the service should wait for pending replication to finish before switching to the secondary. + Properties *FailoverPropertiesProperties +} + +// NamespaceReplicaLocation - Namespace replication properties +type NamespaceReplicaLocation struct { + // Optional property that denotes the ARM ID of the Cluster. This is required, if a namespace replica should be placed in + // a Dedicated Event Hub Cluster + ClusterArmID *string + + // Azure regions where a replica of the namespace is maintained + LocationName *string + + // GeoDR Role Types + RoleType *GeoDRRoleType +} + // NetworkRuleSet - Description of NetworkRuleSet resource. type NetworkRuleSet struct { // NetworkRuleSet properties @@ -342,20 +350,20 @@ type NetworkRuleSet struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; The system meta data relating to this resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData - // READ-ONLY; The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs" + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// NetworkRuleSetListResult - The response of the List NetworkRuleSet operation. +// NetworkRuleSetListResult - The response of a NetworkRuleSet list operation. type NetworkRuleSetListResult struct { - // Link to the next set of results. Not empty if Value contains incomplete list of NetworkRuleSet. - NextLink *string - - // Result of the List NetworkRuleSet operation. + // REQUIRED; The NetworkRuleSet items on this page Value []*NetworkRuleSet + + // The link to the next page of items + NextLink *string } // NetworkRuleSetProperties - NetworkRuleSet properties @@ -376,6 +384,139 @@ type NetworkRuleSetProperties struct { VirtualNetworkRules []*NWRuleSetVirtualNetworkRules } +// NetworkSecurityPerimeter related information +type NetworkSecurityPerimeter struct { + // Fully qualified identifier of the resource + ID *string + + // Location of the resource + Location *string + + // Guid of the resource + PerimeterGUID *string +} + +// NetworkSecurityPerimeterConfiguration - Network Security Perimeter related configurations of a given namespace +type NetworkSecurityPerimeterConfiguration struct { + // Properties of the Network Security Perimeter Configuration + Properties *NetworkSecurityPerimeterConfigurationProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The geo-location where the resource lives + Location *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// NetworkSecurityPerimeterConfigurationList - Result of the List NetworkSecurityPerimeterConfiguration operation. +type NetworkSecurityPerimeterConfigurationList struct { + // REQUIRED; The NetworkSecurityPerimeterConfiguration items on this page + Value []*NetworkSecurityPerimeterConfiguration + + // The link to the next page of items + NextLink *string +} + +// NetworkSecurityPerimeterConfigurationProperties - Properties of NetworkSecurityPerimeterConfiguration +type NetworkSecurityPerimeterConfigurationProperties struct { + // NetworkSecurityPerimeter related information + NetworkSecurityPerimeter *NetworkSecurityPerimeter + + // List of Provisioning Issues if any + ProvisioningIssues []*ProvisioningIssue + + // READ-ONLY; Indicates that the NSP controls related to backing association are only applicable to a specific feature in + // backing resource's data plane. + ApplicableFeatures []*string + + // READ-ONLY; True if the ServiceBus namespace is backed by another Azure resource and not visible to end users. + IsBackingResource *bool + + // READ-ONLY; Source Resource Association name + ParentAssociationName *string + + // READ-ONLY; Information about current network profile + Profile *NetworkSecurityPerimeterConfigurationPropertiesProfile + + // READ-ONLY; Provisioning state of NetworkSecurityPerimeter configuration propagation + ProvisioningState *NetworkSecurityPerimeterConfigurationProvisioningState + + // READ-ONLY; Information about resource association + ResourceAssociation *NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation + + // READ-ONLY; ARM Id of source resource + SourceResourceID *string +} + +// NetworkSecurityPerimeterConfigurationPropertiesProfile - Information about current network profile +type NetworkSecurityPerimeterConfigurationPropertiesProfile struct { + // List of Access Rules + AccessRules []*NspAccessRule + + // Current access rules version + AccessRulesVersion *string + + // Name of the resource + Name *string +} + +// NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation - Information about resource association +type NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation struct { + // Access Mode of the resource association + AccessMode *ResourceAssociationAccessMode + + // Name of the resource association + Name *string +} + +// NspAccessRule - Information of Access Rule in Network Profile +type NspAccessRule struct { + // Fully qualified identifier of the resource + ID *string + + // Name of the resource + Name *string + + // Type of the resource + Type *string + + // READ-ONLY; Properties of Access Rule + Properties *NspAccessRuleProperties +} + +// NspAccessRuleProperties - Properties of Access Rule +type NspAccessRuleProperties struct { + // Address prefixes in the CIDR format for inbound rules + AddressPrefixes []*string + + // Direction of Access Rule + Direction *NspAccessRuleDirection + + // Subscriptions for inbound rules + Subscriptions []*NspAccessRulePropertiesSubscriptionsItem + + // READ-ONLY; FQDN for outbound rules + FullyQualifiedDomainNames []*string + + // READ-ONLY; NetworkSecurityPerimeters for inbound rules + NetworkSecurityPerimeters []*NetworkSecurityPerimeter +} + +// NspAccessRulePropertiesSubscriptionsItem - Subscription for inbound rule +type NspAccessRulePropertiesSubscriptionsItem struct { + // Fully qualified identifier of subscription + ID *string +} + // Operation - A Service Bus REST API operation type Operation struct { // Display of the operation @@ -409,14 +550,17 @@ type OperationDisplay struct { Resource *string } -// OperationListResult - Result of the request to list ServiceBus operations. It contains a list of operations and a URL link -// to get the next set of results. +// OperationListResult - The list of available operations. type OperationListResult struct { - // READ-ONLY; URL to get the next set of operation list results if there are any. + // REQUIRED; The list of operations. + Value []*Operation + + // The URL to get the next set of results, if any. NextLink *string +} - // READ-ONLY; List of ServiceBus operations supported by the Microsoft.ServiceBus resource provider. - Value []*Operation +type PlatformCapabilities struct { + ConfidentialCompute *ConfidentialCompute } // PrivateEndpoint information. @@ -439,20 +583,20 @@ type PrivateEndpointConnection struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; The system meta data relating to this resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData - // READ-ONLY; The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs" + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// PrivateEndpointConnectionListResult - Result of the list of all private endpoint connections operation. +// PrivateEndpointConnectionListResult - The response of a PrivateEndpointConnection list operation. type PrivateEndpointConnectionListResult struct { - // A link for the next page of private endpoint connection resources. - NextLink *string - - // A collection of private endpoint connection resources. + // REQUIRED; The PrivateEndpointConnection items on this page Value []*PrivateEndpointConnection + + // The link to the next page of items + NextLink *string } // PrivateEndpointConnectionProperties - Properties of the private endpoint connection resource. @@ -493,28 +637,31 @@ type PrivateLinkResourceProperties struct { RequiredZoneNames []*string } -// PrivateLinkResourcesListResult - Result of the List private link resources operation. +// PrivateLinkResourcesListResult - The response of a PrivateLinkResource list operation. type PrivateLinkResourcesListResult struct { - // A link for the next page of private link resources. - NextLink *string - - // A collection of private link resources + // REQUIRED; The PrivateLinkResource items on this page Value []*PrivateLinkResource + + // The link to the next page of items + NextLink *string } -// ProxyResource - Common fields that are returned in the response for all Azure Resource Manager resources -type ProxyResource struct { - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string +// ProvisioningIssue - Describes Provisioning issue for given NetworkSecurityPerimeterConfiguration +type ProvisioningIssue struct { + // Name of the issue + Name *string - // READ-ONLY; The geo-location where the resource lives - Location *string + // READ-ONLY; Properties of Provisioning Issue + Properties *ProvisioningIssueProperties +} - // READ-ONLY; The name of the resource - Name *string +// ProvisioningIssueProperties - Properties of Provisioning Issue +type ProvisioningIssueProperties struct { + // Description of the issue + Description *string - // READ-ONLY; The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs" - Type *string + // Type of Issue + IssueType *string } // RegenerateAccessKeyParameters - Parameters supplied to the Regenerate Authorization Rule operation, specifies which key @@ -527,36 +674,6 @@ type RegenerateAccessKeyParameters struct { Key *string } -// Resource - The Resource definition for other than namespace. -type Resource struct { - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// ResourceNamespacePatch - The Resource definition. -type ResourceNamespacePatch struct { - // Resource location - Location *string - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - // Rule - Description of Rule Resource. type Rule struct { // Properties of Rule resource @@ -571,20 +688,20 @@ type Rule struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; The system meta data relating to this resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData - // READ-ONLY; The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs" + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// RuleListResult - The response of the List rule operation. +// RuleListResult - The response of a Rule list operation. type RuleListResult struct { - // Link to the next set of results. Not empty if Value contains incomplete list of rules - NextLink *string - - // Result of the List Rules operation. + // REQUIRED; The Rule items on this page Value []*Rule + + // The link to the next page of items + NextLink *string } // Ruleproperties - Description of Rule Resource. @@ -617,20 +734,20 @@ type SBAuthorizationRule struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; The system meta data relating to this resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData - // READ-ONLY; The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs" + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// SBAuthorizationRuleListResult - The response to the List Namespace operation. +// SBAuthorizationRuleListResult - The response of a SBAuthorizationRule list operation. type SBAuthorizationRuleListResult struct { - // Link to the next set of results. Not empty if Value contains incomplete list of Authorization Rules. - NextLink *string - - // Result of the List Authorization Rules operation. + // REQUIRED; The SBAuthorizationRule items on this page Value []*SBAuthorizationRule + + // The link to the next page of items + NextLink *string } // SBAuthorizationRuleProperties - AuthorizationRule properties. @@ -653,7 +770,7 @@ type SBClientAffineProperties struct { // SBNamespace - Description of a namespace resource. type SBNamespace struct { - // REQUIRED; The Geo-location where the resource lives + // REQUIRED; The geo-location where the resource lives Location *string // Properties of BYOK Identity description @@ -665,29 +782,29 @@ type SBNamespace struct { // Properties of SKU SKU *SBSKU - // Resource tags + // Resource tags. Tags map[string]*string - // READ-ONLY; Resource Id + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Resource name + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; The system meta data relating to this resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData - // READ-ONLY; Resource type + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// SBNamespaceListResult - The response of the List Namespace operation. +// SBNamespaceListResult - The response of a SBNamespace list operation. type SBNamespaceListResult struct { - // Link to the next set of results. Not empty if Value contains incomplete list of Namespaces. - NextLink *string - - // Result of the List Namespace operation. + // REQUIRED; The SBNamespace items on this page Value []*SBNamespace + + // The link to the next page of items + NextLink *string } // SBNamespaceProperties - Properties of the namespace. @@ -701,9 +818,23 @@ type SBNamespaceProperties struct { // Properties of BYOK Encryption description Encryption *Encryption + // Geo Data Replication settings for the namespace + GeoDataReplication *GeoDataReplicationProperties + + // The minimum TLS version for the cluster to support, e.g. '1.2' + MinimumTLSVersion *TLSVersion + PlatformCapabilities *PlatformCapabilities + + // 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 @@ -743,13 +874,16 @@ type SBNamespaceUpdateParameters struct { // Resource tags Tags map[string]*string - // READ-ONLY; Resource Id + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Resource name + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Resource type + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -800,20 +934,20 @@ type SBQueue struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; The system meta data relating to this resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData - // READ-ONLY; The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs" + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// SBQueueListResult - The response to the List Queues operation. +// SBQueueListResult - The response of a SBQueue list operation. type SBQueueListResult struct { - // Link to the next set of results. Not empty if Value contains incomplete list of queues. - NextLink *string - - // Result of the List Queues operation. + // REQUIRED; The SBQueue items on this page Value []*SBQueue + + // The link to the next page of items + NextLink *string } // SBQueueProperties - The Queue Properties definition. @@ -825,8 +959,7 @@ type SBQueueProperties struct { DeadLetteringOnMessageExpiration *bool // ISO 8601 default message timespan to live value. This is the duration after which the message expires, starting from when - // the message is sent to Service Bus. This is the default value used when - // TimeToLive is not set on a message itself. + // the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself. DefaultMessageTimeToLive *string // ISO 8601 timeSpan structure that defines the duration of the duplicate detection history. The default value is 10 minutes. @@ -871,6 +1004,9 @@ type SBQueueProperties struct { // Enumerates the possible values for the status of a messaging entity. Status *EntityStatus + // Gets and Sets Metadata of User. + UserMetadata *string + // READ-ONLY; Last time a message was sent, or the last time there was a receive request to this queue. AccessedAt *time.Time @@ -895,7 +1031,9 @@ 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. @@ -916,20 +1054,20 @@ type SBSubscription struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; The system meta data relating to this resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData - // READ-ONLY; The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs" + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// SBSubscriptionListResult - The response to the List Subscriptions operation. +// SBSubscriptionListResult - The response of a SBSubscription list operation. type SBSubscriptionListResult struct { - // Link to the next set of results. Not empty if Value contains incomplete list of subscriptions. - NextLink *string - - // Result of the List Subscriptions operation. + // REQUIRED; The SBSubscription items on this page Value []*SBSubscription + + // The link to the next page of items + NextLink *string } // SBSubscriptionProperties - Description of Subscription Resource. @@ -947,8 +1085,7 @@ type SBSubscriptionProperties struct { DeadLetteringOnMessageExpiration *bool // ISO 8061 Default message timespan to live value. This is the duration after which the message expires, starting from when - // the message is sent to Service Bus. This is the default value used when - // TimeToLive is not set on a message itself. + // the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself. DefaultMessageTimeToLive *string // ISO 8601 timeSpan structure that defines the duration of the duplicate detection history. The default value is 10 minutes. @@ -978,6 +1115,9 @@ type SBSubscriptionProperties struct { // Enumerates the possible values for the status of a messaging entity. Status *EntityStatus + // Gets and Sets Metadata of User. + UserMetadata *string + // READ-ONLY; Last time there was a receive request to this subscription. AccessedAt *time.Time @@ -1008,20 +1148,20 @@ type SBTopic struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; The system meta data relating to this resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData - // READ-ONLY; The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs" + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// SBTopicListResult - The response to the List Topics operation. +// SBTopicListResult - The response of a SBTopic list operation. type SBTopicListResult struct { - // Link to the next set of results. Not empty if Value contains incomplete list of topics. - NextLink *string - - // Result of the List Topics operation. + // REQUIRED; The SBTopic items on this page Value []*SBTopic + + // The link to the next page of items + NextLink *string } // SBTopicProperties - The Topic Properties definition. @@ -1030,8 +1170,7 @@ type SBTopicProperties struct { AutoDeleteOnIdle *string // ISO 8601 Default message timespan to live value. This is the duration after which the message expires, starting from when - // the message is sent to Service Bus. This is the default value used when - // TimeToLive is not set on a message itself. + // the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself. DefaultMessageTimeToLive *string // ISO8601 timespan structure that defines the duration of the duplicate detection history. The default value is 10 minutes. @@ -1063,6 +1202,9 @@ type SBTopicProperties struct { // Value that indicates whether the topic supports ordering. SupportOrdering *bool + // Gets and Sets Metadata of User. + UserMetadata *string + // READ-ONLY; Last time the message was sent, or a request was received, for this topic. AccessedAt *time.Time @@ -1094,18 +1236,6 @@ type SQLFilter struct { SQLExpression *string } -// SQLRuleAction - Represents set of actions written in SQL language-based syntax that is performed against a ServiceBus.Messaging.BrokeredMessage -type SQLRuleAction struct { - // This property is reserved for future use. An integer value showing the compatibility level, currently hard-coded to 20. - CompatibilityLevel *int32 - - // Value that indicates whether the rule action requires preprocessing. - RequiresPreprocessing *bool - - // SQL expression. e.g. MyProperty='ABC' - SQLExpression *string -} - // Subnet - Properties supplied for Subnet type Subnet struct { // REQUIRED; Resource ID of Virtual Network Subnet @@ -1123,7 +1253,7 @@ type SystemData struct { // The type of identity that created the resource. CreatedByType *CreatedByType - // The type of identity that last modified the resource. + // The timestamp of resource last modification (UTC) LastModifiedAt *time.Time // The identity that last modified the resource. @@ -1133,24 +1263,6 @@ type SystemData struct { LastModifiedByType *CreatedByType } -// TrackedResource - The Resource definition. -type TrackedResource struct { - // REQUIRED; The Geo-location where the resource lives - Location *string - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - // UserAssignedIdentity - Recognized Dictionary value. type UserAssignedIdentity struct { // READ-ONLY; Client Id of user assigned identity diff --git a/sdk/resourcemanager/servicebus/armservicebus/models_serde.go b/sdk/resourcemanager/servicebus/armservicebus/models_serde.go index 0397f020408b..906aa603de4d 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/models_serde.go +++ b/sdk/resourcemanager/servicebus/armservicebus/models_serde.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicebus @@ -9,7 +8,9 @@ import ( "encoding/json" "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/datetime" "reflect" + "time" ) // MarshalJSON implements the json.Marshaller interface for type AccessKeys. @@ -281,6 +282,33 @@ func (c *CheckNameAvailabilityResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ConfidentialCompute. +func (c ConfidentialCompute) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "mode", c.Mode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfidentialCompute. +func (c *ConfidentialCompute) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "mode": + err = unpopulate(val, "Mode", &c.Mode) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ConnectionState. func (c ConnectionState) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -378,7 +406,9 @@ func (c *CorrelationFilter) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Encryption. func (e Encryption) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["keySource"] = "Microsoft.KeyVault" + if e.KeySource != nil { + objectMap["keySource"] = "Microsoft.KeyVault" + } populate(objectMap, "keyVaultProperties", e.KeyVaultProperties) populate(objectMap, "requireInfrastructureEncryption", e.RequireInfrastructureEncryption) return json.Marshal(objectMap) @@ -410,116 +440,73 @@ func (e *Encryption) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. -func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populateAny(objectMap, "info", e.Info) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. -func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "info": - err = unpopulate(val, "Info", &e.Info) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. -func (e ErrorResponse) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type FailOver. +func (f FailOver) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "error", e.Error) + populate(objectMap, "properties", f.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. -func (e *ErrorResponse) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type FailOver. +func (f *FailOver) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "error": - err = unpopulate(val, "Error", &e.Error) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ErrorResponseError. -func (e ErrorResponseError) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type FailOverProperties. +func (f FailOverProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "additionalInfo", e.AdditionalInfo) - populate(objectMap, "code", e.Code) - populate(objectMap, "details", e.Details) - populate(objectMap, "message", e.Message) - populate(objectMap, "target", e.Target) + populate(objectMap, "force", f.Force) + populate(objectMap, "primaryLocation", f.PrimaryLocation) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseError. -func (e *ErrorResponseError) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type FailOverProperties. +func (f *FailOverProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "additionalInfo": - err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) - delete(rawMsg, key) - case "code": - err = unpopulate(val, "Code", &e.Code) + case "force": + err = unpopulate(val, "Force", &f.Force) delete(rawMsg, key) - case "details": - err = unpopulate(val, "Details", &e.Details) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &e.Message) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &e.Target) + case "primaryLocation": + err = unpopulate(val, "PrimaryLocation", &f.PrimaryLocation) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FailoverProperties. -func (f FailoverProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type FailoverPropertiesProperties. +func (f FailoverPropertiesProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", f.Properties) + populate(objectMap, "IsSafeFailover", f.IsSafeFailover) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type FailoverProperties. -func (f *FailoverProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type FailoverPropertiesProperties. +func (f *FailoverPropertiesProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", f, err) @@ -527,8 +514,8 @@ func (f *FailoverProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &f.Properties) + case "IsSafeFailover": + err = unpopulate(val, "IsSafeFailover", &f.IsSafeFailover) delete(rawMsg, key) } if err != nil { @@ -538,28 +525,32 @@ func (f *FailoverProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type FailoverPropertiesProperties. -func (f FailoverPropertiesProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GeoDataReplicationProperties. +func (g GeoDataReplicationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "IsSafeFailover", f.IsSafeFailover) + populate(objectMap, "locations", g.Locations) + populate(objectMap, "maxReplicationLagDurationInSeconds", g.MaxReplicationLagDurationInSeconds) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type FailoverPropertiesProperties. -func (f *FailoverPropertiesProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GeoDataReplicationProperties. +func (g *GeoDataReplicationProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "IsSafeFailover": - err = unpopulate(val, "IsSafeFailover", &f.IsSafeFailover) + case "locations": + err = unpopulate(val, "Locations", &g.Locations) + delete(rawMsg, key) + case "maxReplicationLagDurationInSeconds": + err = unpopulate(val, "MaxReplicationLagDurationInSeconds", &g.MaxReplicationLagDurationInSeconds) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil @@ -838,16 +829,437 @@ func (n *NWRuleSetIPRules) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NWRuleSetVirtualNetworkRules. -func (n NWRuleSetVirtualNetworkRules) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NWRuleSetVirtualNetworkRules. +func (n NWRuleSetVirtualNetworkRules) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ignoreMissingVnetServiceEndpoint", n.IgnoreMissingVnetServiceEndpoint) + populate(objectMap, "subnet", n.Subnet) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NWRuleSetVirtualNetworkRules. +func (n *NWRuleSetVirtualNetworkRules) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ignoreMissingVnetServiceEndpoint": + err = unpopulate(val, "IgnoreMissingVnetServiceEndpoint", &n.IgnoreMissingVnetServiceEndpoint) + delete(rawMsg, key) + case "subnet": + err = unpopulate(val, "Subnet", &n.Subnet) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NamespaceFailoverProperties. +func (n NamespaceFailoverProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", n.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NamespaceFailoverProperties. +func (n *NamespaceFailoverProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NamespaceReplicaLocation. +func (n NamespaceReplicaLocation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clusterArmId", n.ClusterArmID) + populate(objectMap, "locationName", n.LocationName) + populate(objectMap, "roleType", n.RoleType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NamespaceReplicaLocation. +func (n *NamespaceReplicaLocation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clusterArmId": + err = unpopulate(val, "ClusterArmID", &n.ClusterArmID) + delete(rawMsg, key) + case "locationName": + err = unpopulate(val, "LocationName", &n.LocationName) + delete(rawMsg, key) + case "roleType": + err = unpopulate(val, "RoleType", &n.RoleType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkRuleSet. +func (n NetworkRuleSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "systemData", n.SystemData) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRuleSet. +func (n *NetworkRuleSet) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &n.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &n.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkRuleSetListResult. +func (n NetworkRuleSetListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRuleSetListResult. +func (n *NetworkRuleSetListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &n.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkRuleSetProperties. +func (n NetworkRuleSetProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "defaultAction", n.DefaultAction) + populate(objectMap, "ipRules", n.IPRules) + populate(objectMap, "publicNetworkAccess", n.PublicNetworkAccess) + populate(objectMap, "trustedServiceAccessEnabled", n.TrustedServiceAccessEnabled) + populate(objectMap, "virtualNetworkRules", n.VirtualNetworkRules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRuleSetProperties. +func (n *NetworkRuleSetProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "defaultAction": + err = unpopulate(val, "DefaultAction", &n.DefaultAction) + delete(rawMsg, key) + case "ipRules": + err = unpopulate(val, "IPRules", &n.IPRules) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &n.PublicNetworkAccess) + delete(rawMsg, key) + case "trustedServiceAccessEnabled": + err = unpopulate(val, "TrustedServiceAccessEnabled", &n.TrustedServiceAccessEnabled) + delete(rawMsg, key) + case "virtualNetworkRules": + err = unpopulate(val, "VirtualNetworkRules", &n.VirtualNetworkRules) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeter. +func (n NetworkSecurityPerimeter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) + populate(objectMap, "perimeterGuid", n.PerimeterGUID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeter. +func (n *NetworkSecurityPerimeter) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &n.Location) + delete(rawMsg, key) + case "perimeterGuid": + err = unpopulate(val, "PerimeterGUID", &n.PerimeterGUID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfiguration. +func (n NetworkSecurityPerimeterConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "systemData", n.SystemData) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfiguration. +func (n *NetworkSecurityPerimeterConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &n.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &n.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationList. +func (n NetworkSecurityPerimeterConfigurationList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationList. +func (n *NetworkSecurityPerimeterConfigurationList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &n.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationProperties. +func (n NetworkSecurityPerimeterConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "applicableFeatures", n.ApplicableFeatures) + populate(objectMap, "isBackingResource", n.IsBackingResource) + populate(objectMap, "networkSecurityPerimeter", n.NetworkSecurityPerimeter) + populate(objectMap, "parentAssociationName", n.ParentAssociationName) + populate(objectMap, "profile", n.Profile) + populate(objectMap, "provisioningIssues", n.ProvisioningIssues) + populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "resourceAssociation", n.ResourceAssociation) + populate(objectMap, "sourceResourceId", n.SourceResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationProperties. +func (n *NetworkSecurityPerimeterConfigurationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "applicableFeatures": + err = unpopulate(val, "ApplicableFeatures", &n.ApplicableFeatures) + delete(rawMsg, key) + case "isBackingResource": + err = unpopulate(val, "IsBackingResource", &n.IsBackingResource) + delete(rawMsg, key) + case "networkSecurityPerimeter": + err = unpopulate(val, "NetworkSecurityPerimeter", &n.NetworkSecurityPerimeter) + delete(rawMsg, key) + case "parentAssociationName": + err = unpopulate(val, "ParentAssociationName", &n.ParentAssociationName) + delete(rawMsg, key) + case "profile": + err = unpopulate(val, "Profile", &n.Profile) + delete(rawMsg, key) + case "provisioningIssues": + err = unpopulate(val, "ProvisioningIssues", &n.ProvisioningIssues) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + case "resourceAssociation": + err = unpopulate(val, "ResourceAssociation", &n.ResourceAssociation) + delete(rawMsg, key) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &n.SourceResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationPropertiesProfile. +func (n NetworkSecurityPerimeterConfigurationPropertiesProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accessRules", n.AccessRules) + populate(objectMap, "accessRulesVersion", n.AccessRulesVersion) + populate(objectMap, "name", n.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationPropertiesProfile. +func (n *NetworkSecurityPerimeterConfigurationPropertiesProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accessRules": + err = unpopulate(val, "AccessRules", &n.AccessRules) + delete(rawMsg, key) + case "accessRulesVersion": + err = unpopulate(val, "AccessRulesVersion", &n.AccessRulesVersion) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation. +func (n NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "ignoreMissingVnetServiceEndpoint", n.IgnoreMissingVnetServiceEndpoint) - populate(objectMap, "subnet", n.Subnet) + populate(objectMap, "accessMode", n.AccessMode) + populate(objectMap, "name", n.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NWRuleSetVirtualNetworkRules. -func (n *NWRuleSetVirtualNetworkRules) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation. +func (n *NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -855,11 +1267,11 @@ func (n *NWRuleSetVirtualNetworkRules) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "ignoreMissingVnetServiceEndpoint": - err = unpopulate(val, "IgnoreMissingVnetServiceEndpoint", &n.IgnoreMissingVnetServiceEndpoint) + case "accessMode": + err = unpopulate(val, "AccessMode", &n.AccessMode) delete(rawMsg, key) - case "subnet": - err = unpopulate(val, "Subnet", &n.Subnet) + case "name": + err = unpopulate(val, "Name", &n.Name) delete(rawMsg, key) } if err != nil { @@ -869,20 +1281,18 @@ func (n *NWRuleSetVirtualNetworkRules) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkRuleSet. -func (n NetworkRuleSet) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NspAccessRule. +func (n NspAccessRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", n.ID) - populate(objectMap, "location", n.Location) populate(objectMap, "name", n.Name) populate(objectMap, "properties", n.Properties) - populate(objectMap, "systemData", n.SystemData) populate(objectMap, "type", n.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRuleSet. -func (n *NetworkRuleSet) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NspAccessRule. +func (n *NspAccessRule) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -893,18 +1303,12 @@ func (n *NetworkRuleSet) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &n.ID) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &n.Location) - delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &n.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &n.Properties) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &n.SystemData) - delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &n.Type) delete(rawMsg, key) @@ -916,16 +1320,19 @@ func (n *NetworkRuleSet) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkRuleSetListResult. -func (n NetworkRuleSetListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NspAccessRuleProperties. +func (n NspAccessRuleProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", n.NextLink) - populate(objectMap, "value", n.Value) + populate(objectMap, "addressPrefixes", n.AddressPrefixes) + populate(objectMap, "direction", n.Direction) + populate(objectMap, "fullyQualifiedDomainNames", n.FullyQualifiedDomainNames) + populate(objectMap, "networkSecurityPerimeters", n.NetworkSecurityPerimeters) + populate(objectMap, "subscriptions", n.Subscriptions) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRuleSetListResult. -func (n *NetworkRuleSetListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NspAccessRuleProperties. +func (n *NspAccessRuleProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -933,11 +1340,20 @@ func (n *NetworkRuleSetListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &n.NextLink) + case "addressPrefixes": + err = unpopulate(val, "AddressPrefixes", &n.AddressPrefixes) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &n.Value) + case "direction": + err = unpopulate(val, "Direction", &n.Direction) + delete(rawMsg, key) + case "fullyQualifiedDomainNames": + err = unpopulate(val, "FullyQualifiedDomainNames", &n.FullyQualifiedDomainNames) + delete(rawMsg, key) + case "networkSecurityPerimeters": + err = unpopulate(val, "NetworkSecurityPerimeters", &n.NetworkSecurityPerimeters) + delete(rawMsg, key) + case "subscriptions": + err = unpopulate(val, "Subscriptions", &n.Subscriptions) delete(rawMsg, key) } if err != nil { @@ -947,19 +1363,15 @@ func (n *NetworkRuleSetListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkRuleSetProperties. -func (n NetworkRuleSetProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NspAccessRulePropertiesSubscriptionsItem. +func (n NspAccessRulePropertiesSubscriptionsItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "defaultAction", n.DefaultAction) - populate(objectMap, "ipRules", n.IPRules) - populate(objectMap, "publicNetworkAccess", n.PublicNetworkAccess) - populate(objectMap, "trustedServiceAccessEnabled", n.TrustedServiceAccessEnabled) - populate(objectMap, "virtualNetworkRules", n.VirtualNetworkRules) + populate(objectMap, "id", n.ID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRuleSetProperties. -func (n *NetworkRuleSetProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NspAccessRulePropertiesSubscriptionsItem. +func (n *NspAccessRulePropertiesSubscriptionsItem) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -967,20 +1379,8 @@ func (n *NetworkRuleSetProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "defaultAction": - err = unpopulate(val, "DefaultAction", &n.DefaultAction) - delete(rawMsg, key) - case "ipRules": - err = unpopulate(val, "IPRules", &n.IPRules) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &n.PublicNetworkAccess) - delete(rawMsg, key) - case "trustedServiceAccessEnabled": - err = unpopulate(val, "TrustedServiceAccessEnabled", &n.TrustedServiceAccessEnabled) - delete(rawMsg, key) - case "virtualNetworkRules": - err = unpopulate(val, "VirtualNetworkRules", &n.VirtualNetworkRules) + case "id": + err = unpopulate(val, "ID", &n.ID) delete(rawMsg, key) } if err != nil { @@ -1103,6 +1503,33 @@ func (o *OperationListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type PlatformCapabilities. +func (p PlatformCapabilities) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "confidentialCompute", p.ConfidentialCompute) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PlatformCapabilities. +func (p *PlatformCapabilities) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "confidentialCompute": + err = unpopulate(val, "ConfidentialCompute", &p.ConfidentialCompute) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint. func (p PrivateEndpoint) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1348,18 +1775,16 @@ func (p *PrivateLinkResourcesListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ProxyResource. -func (p ProxyResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProvisioningIssue. +func (p ProvisioningIssue) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "location", p.Location) populate(objectMap, "name", p.Name) - populate(objectMap, "type", p.Type) + populate(objectMap, "properties", p.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. -func (p *ProxyResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProvisioningIssue. +func (p *ProvisioningIssue) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -1367,17 +1792,11 @@ func (p *ProxyResource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) - delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) } if err != nil { @@ -1387,85 +1806,47 @@ func (p *ProxyResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RegenerateAccessKeyParameters. -func (r RegenerateAccessKeyParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "key", r.Key) - populate(objectMap, "keyType", r.KeyType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RegenerateAccessKeyParameters. -func (r *RegenerateAccessKeyParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "key": - err = unpopulate(val, "Key", &r.Key) - delete(rawMsg, key) - case "keyType": - err = unpopulate(val, "KeyType", &r.KeyType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Resource. -func (r Resource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProvisioningIssueProperties. +func (p ProvisioningIssueProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "type", r.Type) + populate(objectMap, "description", p.Description) + populate(objectMap, "issueType", p.IssueType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. -func (r *Resource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProvisioningIssueProperties. +func (p *ProvisioningIssueProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) + case "description": + err = unpopulate(val, "Description", &p.Description) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "issueType": + err = unpopulate(val, "IssueType", &p.IssueType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceNamespacePatch. -func (r ResourceNamespacePatch) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegenerateAccessKeyParameters. +func (r RegenerateAccessKeyParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) + populate(objectMap, "key", r.Key) + populate(objectMap, "keyType", r.KeyType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceNamespacePatch. -func (r *ResourceNamespacePatch) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegenerateAccessKeyParameters. +func (r *RegenerateAccessKeyParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -1473,20 +1854,11 @@ func (r *ResourceNamespacePatch) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) + case "key": + err = unpopulate(val, "Key", &r.Key) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "keyType": + err = unpopulate(val, "KeyType", &r.KeyType) delete(rawMsg, key) } if err != nil { @@ -1847,15 +2219,20 @@ func (s *SBNamespaceListResult) UnmarshalJSON(data []byte) error { func (s SBNamespaceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "alternateName", s.AlternateName) - populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populateTime[datetime.RFC3339](objectMap, "createdAt", s.CreatedAt) populate(objectMap, "disableLocalAuth", s.DisableLocalAuth) populate(objectMap, "encryption", s.Encryption) + populate(objectMap, "geoDataReplication", s.GeoDataReplication) populate(objectMap, "metricId", s.MetricID) + populate(objectMap, "minimumTlsVersion", s.MinimumTLSVersion) + populate(objectMap, "platformCapabilities", s.PlatformCapabilities) + 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) + populateTime[datetime.RFC3339](objectMap, "updatedAt", s.UpdatedAt) populate(objectMap, "zoneRedundant", s.ZoneRedundant) return json.Marshal(objectMap) } @@ -1873,7 +2250,7 @@ func (s *SBNamespaceProperties) UnmarshalJSON(data []byte) error { err = unpopulate(val, "AlternateName", &s.AlternateName) delete(rawMsg, key) case "createdAt": - err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + err = unpopulateTime[datetime.RFC3339](val, "CreatedAt", &s.CreatedAt) delete(rawMsg, key) case "disableLocalAuth": err = unpopulate(val, "DisableLocalAuth", &s.DisableLocalAuth) @@ -1881,15 +2258,30 @@ func (s *SBNamespaceProperties) UnmarshalJSON(data []byte) error { case "encryption": err = unpopulate(val, "Encryption", &s.Encryption) delete(rawMsg, key) + case "geoDataReplication": + err = unpopulate(val, "GeoDataReplication", &s.GeoDataReplication) + delete(rawMsg, key) case "metricId": err = unpopulate(val, "MetricID", &s.MetricID) delete(rawMsg, key) + case "minimumTlsVersion": + err = unpopulate(val, "MinimumTLSVersion", &s.MinimumTLSVersion) + delete(rawMsg, key) + case "platformCapabilities": + err = unpopulate(val, "PlatformCapabilities", &s.PlatformCapabilities) + 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) @@ -1897,7 +2289,7 @@ func (s *SBNamespaceProperties) UnmarshalJSON(data []byte) error { err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) case "updatedAt": - err = unpopulateDateTimeRFC3339(val, "UpdatedAt", &s.UpdatedAt) + err = unpopulateTime[datetime.RFC3339](val, "UpdatedAt", &s.UpdatedAt) delete(rawMsg, key) case "zoneRedundant": err = unpopulate(val, "ZoneRedundant", &s.ZoneRedundant) @@ -1919,6 +2311,7 @@ func (s SBNamespaceUpdateParameters) MarshalJSON() ([]byte, error) { populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) populate(objectMap, "sku", s.SKU) + populate(objectMap, "systemData", s.SystemData) populate(objectMap, "tags", s.Tags) populate(objectMap, "type", s.Type) return json.Marshal(objectMap) @@ -1951,6 +2344,9 @@ func (s *SBNamespaceUpdateParameters) UnmarshalJSON(data []byte) error { case "sku": err = unpopulate(val, "SKU", &s.SKU) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &s.Tags) delete(rawMsg, key) @@ -1969,7 +2365,7 @@ func (s *SBNamespaceUpdateParameters) UnmarshalJSON(data []byte) error { func (s SBNamespaceUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "alternateName", s.AlternateName) - populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populateTime[datetime.RFC3339](objectMap, "createdAt", s.CreatedAt) populate(objectMap, "disableLocalAuth", s.DisableLocalAuth) populate(objectMap, "encryption", s.Encryption) populate(objectMap, "metricId", s.MetricID) @@ -1977,7 +2373,7 @@ func (s SBNamespaceUpdateProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "provisioningState", s.ProvisioningState) populate(objectMap, "serviceBusEndpoint", s.ServiceBusEndpoint) populate(objectMap, "status", s.Status) - populateDateTimeRFC3339(objectMap, "updatedAt", s.UpdatedAt) + populateTime[datetime.RFC3339](objectMap, "updatedAt", s.UpdatedAt) return json.Marshal(objectMap) } @@ -1994,7 +2390,7 @@ func (s *SBNamespaceUpdateProperties) UnmarshalJSON(data []byte) error { err = unpopulate(val, "AlternateName", &s.AlternateName) delete(rawMsg, key) case "createdAt": - err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + err = unpopulateTime[datetime.RFC3339](val, "CreatedAt", &s.CreatedAt) delete(rawMsg, key) case "disableLocalAuth": err = unpopulate(val, "DisableLocalAuth", &s.DisableLocalAuth) @@ -2018,7 +2414,7 @@ func (s *SBNamespaceUpdateProperties) UnmarshalJSON(data []byte) error { err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) case "updatedAt": - err = unpopulateDateTimeRFC3339(val, "UpdatedAt", &s.UpdatedAt) + err = unpopulateTime[datetime.RFC3339](val, "UpdatedAt", &s.UpdatedAt) delete(rawMsg, key) } if err != nil { @@ -2109,10 +2505,10 @@ func (s *SBQueueListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SBQueueProperties. func (s SBQueueProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "accessedAt", s.AccessedAt) + populateTime[datetime.RFC3339](objectMap, "accessedAt", s.AccessedAt) populate(objectMap, "autoDeleteOnIdle", s.AutoDeleteOnIdle) populate(objectMap, "countDetails", s.CountDetails) - populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populateTime[datetime.RFC3339](objectMap, "createdAt", s.CreatedAt) populate(objectMap, "deadLetteringOnMessageExpiration", s.DeadLetteringOnMessageExpiration) populate(objectMap, "defaultMessageTimeToLive", s.DefaultMessageTimeToLive) populate(objectMap, "duplicateDetectionHistoryTimeWindow", s.DuplicateDetectionHistoryTimeWindow) @@ -2130,7 +2526,8 @@ func (s SBQueueProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "requiresSession", s.RequiresSession) populate(objectMap, "sizeInBytes", s.SizeInBytes) populate(objectMap, "status", s.Status) - populateDateTimeRFC3339(objectMap, "updatedAt", s.UpdatedAt) + populateTime[datetime.RFC3339](objectMap, "updatedAt", s.UpdatedAt) + populate(objectMap, "userMetadata", s.UserMetadata) return json.Marshal(objectMap) } @@ -2144,7 +2541,7 @@ func (s *SBQueueProperties) UnmarshalJSON(data []byte) error { var err error switch key { case "accessedAt": - err = unpopulateDateTimeRFC3339(val, "AccessedAt", &s.AccessedAt) + err = unpopulateTime[datetime.RFC3339](val, "AccessedAt", &s.AccessedAt) delete(rawMsg, key) case "autoDeleteOnIdle": err = unpopulate(val, "AutoDeleteOnIdle", &s.AutoDeleteOnIdle) @@ -2153,7 +2550,7 @@ func (s *SBQueueProperties) UnmarshalJSON(data []byte) error { err = unpopulate(val, "CountDetails", &s.CountDetails) delete(rawMsg, key) case "createdAt": - err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + err = unpopulateTime[datetime.RFC3339](val, "CreatedAt", &s.CreatedAt) delete(rawMsg, key) case "deadLetteringOnMessageExpiration": err = unpopulate(val, "DeadLetteringOnMessageExpiration", &s.DeadLetteringOnMessageExpiration) @@ -2207,7 +2604,10 @@ func (s *SBQueueProperties) UnmarshalJSON(data []byte) error { err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) case "updatedAt": - err = unpopulateDateTimeRFC3339(val, "UpdatedAt", &s.UpdatedAt) + err = unpopulateTime[datetime.RFC3339](val, "UpdatedAt", &s.UpdatedAt) + delete(rawMsg, key) + case "userMetadata": + err = unpopulate(val, "UserMetadata", &s.UserMetadata) delete(rawMsg, key) } if err != nil { @@ -2333,11 +2733,11 @@ func (s *SBSubscriptionListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SBSubscriptionProperties. func (s SBSubscriptionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "accessedAt", s.AccessedAt) + populateTime[datetime.RFC3339](objectMap, "accessedAt", s.AccessedAt) populate(objectMap, "autoDeleteOnIdle", s.AutoDeleteOnIdle) populate(objectMap, "clientAffineProperties", s.ClientAffineProperties) populate(objectMap, "countDetails", s.CountDetails) - populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populateTime[datetime.RFC3339](objectMap, "createdAt", s.CreatedAt) populate(objectMap, "deadLetteringOnFilterEvaluationExceptions", s.DeadLetteringOnFilterEvaluationExceptions) populate(objectMap, "deadLetteringOnMessageExpiration", s.DeadLetteringOnMessageExpiration) populate(objectMap, "defaultMessageTimeToLive", s.DefaultMessageTimeToLive) @@ -2351,7 +2751,8 @@ func (s SBSubscriptionProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "messageCount", s.MessageCount) populate(objectMap, "requiresSession", s.RequiresSession) populate(objectMap, "status", s.Status) - populateDateTimeRFC3339(objectMap, "updatedAt", s.UpdatedAt) + populateTime[datetime.RFC3339](objectMap, "updatedAt", s.UpdatedAt) + populate(objectMap, "userMetadata", s.UserMetadata) return json.Marshal(objectMap) } @@ -2365,7 +2766,7 @@ func (s *SBSubscriptionProperties) UnmarshalJSON(data []byte) error { var err error switch key { case "accessedAt": - err = unpopulateDateTimeRFC3339(val, "AccessedAt", &s.AccessedAt) + err = unpopulateTime[datetime.RFC3339](val, "AccessedAt", &s.AccessedAt) delete(rawMsg, key) case "autoDeleteOnIdle": err = unpopulate(val, "AutoDeleteOnIdle", &s.AutoDeleteOnIdle) @@ -2377,7 +2778,7 @@ func (s *SBSubscriptionProperties) UnmarshalJSON(data []byte) error { err = unpopulate(val, "CountDetails", &s.CountDetails) delete(rawMsg, key) case "createdAt": - err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + err = unpopulateTime[datetime.RFC3339](val, "CreatedAt", &s.CreatedAt) delete(rawMsg, key) case "deadLetteringOnFilterEvaluationExceptions": err = unpopulate(val, "DeadLetteringOnFilterEvaluationExceptions", &s.DeadLetteringOnFilterEvaluationExceptions) @@ -2419,7 +2820,10 @@ func (s *SBSubscriptionProperties) UnmarshalJSON(data []byte) error { err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) case "updatedAt": - err = unpopulateDateTimeRFC3339(val, "UpdatedAt", &s.UpdatedAt) + err = unpopulateTime[datetime.RFC3339](val, "UpdatedAt", &s.UpdatedAt) + delete(rawMsg, key) + case "userMetadata": + err = unpopulate(val, "UserMetadata", &s.UserMetadata) delete(rawMsg, key) } if err != nil { @@ -2510,10 +2914,10 @@ func (s *SBTopicListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SBTopicProperties. func (s SBTopicProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "accessedAt", s.AccessedAt) + populateTime[datetime.RFC3339](objectMap, "accessedAt", s.AccessedAt) populate(objectMap, "autoDeleteOnIdle", s.AutoDeleteOnIdle) populate(objectMap, "countDetails", s.CountDetails) - populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populateTime[datetime.RFC3339](objectMap, "createdAt", s.CreatedAt) populate(objectMap, "defaultMessageTimeToLive", s.DefaultMessageTimeToLive) populate(objectMap, "duplicateDetectionHistoryTimeWindow", s.DuplicateDetectionHistoryTimeWindow) populate(objectMap, "enableBatchedOperations", s.EnableBatchedOperations) @@ -2526,7 +2930,8 @@ func (s SBTopicProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "status", s.Status) populate(objectMap, "subscriptionCount", s.SubscriptionCount) populate(objectMap, "supportOrdering", s.SupportOrdering) - populateDateTimeRFC3339(objectMap, "updatedAt", s.UpdatedAt) + populateTime[datetime.RFC3339](objectMap, "updatedAt", s.UpdatedAt) + populate(objectMap, "userMetadata", s.UserMetadata) return json.Marshal(objectMap) } @@ -2540,7 +2945,7 @@ func (s *SBTopicProperties) UnmarshalJSON(data []byte) error { var err error switch key { case "accessedAt": - err = unpopulateDateTimeRFC3339(val, "AccessedAt", &s.AccessedAt) + err = unpopulateTime[datetime.RFC3339](val, "AccessedAt", &s.AccessedAt) delete(rawMsg, key) case "autoDeleteOnIdle": err = unpopulate(val, "AutoDeleteOnIdle", &s.AutoDeleteOnIdle) @@ -2549,7 +2954,7 @@ func (s *SBTopicProperties) UnmarshalJSON(data []byte) error { err = unpopulate(val, "CountDetails", &s.CountDetails) delete(rawMsg, key) case "createdAt": - err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + err = unpopulateTime[datetime.RFC3339](val, "CreatedAt", &s.CreatedAt) delete(rawMsg, key) case "defaultMessageTimeToLive": err = unpopulate(val, "DefaultMessageTimeToLive", &s.DefaultMessageTimeToLive) @@ -2588,7 +2993,10 @@ func (s *SBTopicProperties) UnmarshalJSON(data []byte) error { err = unpopulate(val, "SupportOrdering", &s.SupportOrdering) delete(rawMsg, key) case "updatedAt": - err = unpopulateDateTimeRFC3339(val, "UpdatedAt", &s.UpdatedAt) + err = unpopulateTime[datetime.RFC3339](val, "UpdatedAt", &s.UpdatedAt) + delete(rawMsg, key) + case "userMetadata": + err = unpopulate(val, "UserMetadata", &s.UserMetadata) delete(rawMsg, key) } if err != nil { @@ -2633,41 +3041,6 @@ func (s *SQLFilter) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SQLRuleAction. -func (s SQLRuleAction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "compatibilityLevel", s.CompatibilityLevel) - populate(objectMap, "requiresPreprocessing", s.RequiresPreprocessing) - populate(objectMap, "sqlExpression", s.SQLExpression) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SQLRuleAction. -func (s *SQLRuleAction) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "compatibilityLevel": - err = unpopulate(val, "CompatibilityLevel", &s.CompatibilityLevel) - delete(rawMsg, key) - case "requiresPreprocessing": - err = unpopulate(val, "RequiresPreprocessing", &s.RequiresPreprocessing) - delete(rawMsg, key) - case "sqlExpression": - err = unpopulate(val, "SQLExpression", &s.SQLExpression) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type Subnet. func (s Subnet) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2698,10 +3071,10 @@ func (s *Subnet) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populateTime[datetime.RFC3339](objectMap, "createdAt", s.CreatedAt) populate(objectMap, "createdBy", s.CreatedBy) populate(objectMap, "createdByType", s.CreatedByType) - populateDateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populateTime[datetime.RFC3339](objectMap, "lastModifiedAt", s.LastModifiedAt) populate(objectMap, "lastModifiedBy", s.LastModifiedBy) populate(objectMap, "lastModifiedByType", s.LastModifiedByType) return json.Marshal(objectMap) @@ -2717,7 +3090,7 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { var err error switch key { case "createdAt": - err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + err = unpopulateTime[datetime.RFC3339](val, "CreatedAt", &s.CreatedAt) delete(rawMsg, key) case "createdBy": err = unpopulate(val, "CreatedBy", &s.CreatedBy) @@ -2726,7 +3099,7 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { err = unpopulate(val, "CreatedByType", &s.CreatedByType) delete(rawMsg, key) case "lastModifiedAt": - err = unpopulateDateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + err = unpopulateTime[datetime.RFC3339](val, "LastModifiedAt", &s.LastModifiedAt) delete(rawMsg, key) case "lastModifiedBy": err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) @@ -2742,49 +3115,6 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type TrackedResource. -func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", t.ID) - populate(objectMap, "location", t.Location) - populate(objectMap, "name", t.Name) - populate(objectMap, "tags", t.Tags) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource. -func (t *TrackedResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &t.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &t.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &t.Name) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &t.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &t.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity. func (u UserAssignedIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2853,6 +3183,17 @@ func populate(m map[string]any, k string, v any) { } } +func populateTime[T dateTimeConstraints](m map[string]any, k string, t *time.Time) { + if t == nil { + return + } else if azcore.IsNullValue(t) { + m[k] = nil + } else if !reflect.ValueOf(t).IsNil() { + newTime := T(*t) + m[k] = (*T)(&newTime) + } +} + func populateAny(m map[string]any, k string, v any) { if v == nil { return @@ -2864,7 +3205,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 { @@ -2872,3 +3213,20 @@ func unpopulate(data json.RawMessage, fn string, v any) error { } return nil } + +func unpopulateTime[T dateTimeConstraints](data json.RawMessage, fn string, t **time.Time) error { + if data == nil || string(data) == "null" { + return nil + } + var aux T + if err := json.Unmarshal(data, &aux); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + newTime := time.Time(aux) + *t = &newTime + return nil +} + +type dateTimeConstraints interface { + datetime.PlainDate | datetime.PlainTime | datetime.RFC1123 | datetime.RFC3339 | datetime.Unix +} diff --git a/sdk/resourcemanager/servicebus/armservicebus/namespace_live_test.go b/sdk/resourcemanager/servicebus/armservicebus/namespace_live_test.go index 9187b10ea4e7..ff5a2ce5abaa 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/namespace_live_test.go +++ b/sdk/resourcemanager/servicebus/armservicebus/namespace_live_test.go @@ -14,7 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/servicebus/armservicebus/namespaces_client.go b/sdk/resourcemanager/servicebus/armservicebus/namespaces_client.go index 99f88d2af683..ea0bb73d1b12 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/namespaces_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/namespaces_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicebus @@ -25,10 +24,9 @@ type NamespacesClient struct { } // NewNamespacesClient creates a new instance of NamespacesClient with the specified values. -// - subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewNamespacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NamespacesClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -44,8 +42,8 @@ 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 -// - parameters - Parameters to check availability of the given namespace name +// Generated from API version 2025-05-01-preview +// - parameters - The request body // - options - NamespacesClientCheckNameAvailabilityOptions contains the optional parameters for the NamespacesClient.CheckNameAvailability // method. func (client *NamespacesClient) CheckNameAvailability(ctx context.Context, parameters CheckNameAvailability, options *NamespacesClientCheckNameAvailabilityOptions) (NamespacesClientCheckNameAvailabilityResponse, error) { @@ -71,8 +69,8 @@ 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) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/CheckNameAvailability" +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") } @@ -82,9 +80,10 @@ 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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -104,9 +103,9 @@ 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. -// - namespaceName - The namespace name. +// Generated from API version 2025-05-01-preview +// - 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 // method. @@ -131,7 +130,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 2025-05-01-preview 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" @@ -154,8 +153,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -164,18 +167,15 @@ func (client *NamespacesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, errors.New("parameter namespaceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, 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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -185,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 2025-05-01-preview +// - 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. @@ -215,8 +215,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -229,18 +233,15 @@ func (client *NamespacesClient) createOrUpdateAuthorizationRuleCreateRequest(ctx return nil, errors.New("parameter authorizationRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{authorizationRuleName}", url.PathEscape(authorizationRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, 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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -259,8 +260,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 2025-05-01-preview +// - 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 @@ -288,8 +289,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -298,18 +303,15 @@ func (client *NamespacesClient) createOrUpdateNetworkRuleSetCreateRequest(ctx co return nil, errors.New("parameter namespaceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, 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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -328,8 +330,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 2025-05-01-preview +// - 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) { @@ -352,7 +354,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 2025-05-01-preview func (client *NamespacesClient) deleteOperation(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespacesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "NamespacesClient.BeginDelete" @@ -375,8 +377,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -385,26 +391,21 @@ func (client *NamespacesClient) deleteCreateRequest(ctx context.Context, resourc return nil, errors.New("parameter namespaceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, 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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // 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 2025-05-01-preview +// - 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 @@ -431,8 +432,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -445,26 +450,102 @@ func (client *NamespacesClient) deleteAuthorizationRuleCreateRequest(ctx context return nil, errors.New("parameter authorizationRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{authorizationRuleName}", url.PathEscape(authorizationRuleName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// BeginFailover - GeoDR Failover +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - The namespace name +// - parameters - Parameters for updating a namespace resource. +// - options - NamespacesClientBeginFailoverOptions contains the optional parameters for the NamespacesClient.BeginFailover +// method. +func (client *NamespacesClient) BeginFailover(ctx context.Context, resourceGroupName string, namespaceName string, parameters FailOver, options *NamespacesClientBeginFailoverOptions) (*runtime.Poller[NamespacesClientFailoverResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.failover(ctx, resourceGroupName, namespaceName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NamespacesClientFailoverResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[NamespacesClientFailoverResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Failover - GeoDR Failover +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-05-01-preview +func (client *NamespacesClient) failover(ctx context.Context, resourceGroupName string, namespaceName string, parameters FailOver, options *NamespacesClientBeginFailoverOptions) (*http.Response, error) { + var err error + const operationName = "NamespacesClient.BeginFailover" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.failoverCreateRequest(ctx, resourceGroupName, namespaceName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// failoverCreateRequest creates the Failover request. +func (client *NamespacesClient) failoverCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, parameters FailOver, _ *NamespacesClientBeginFailoverOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/failover" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, 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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } return req, nil } // 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 2025-05-01-preview +// - 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) { @@ -490,8 +571,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -500,16 +585,12 @@ func (client *NamespacesClient) getCreateRequest(ctx context.Context, resourceGr return nil, errors.New("parameter namespaceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -527,8 +608,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 2025-05-01-preview +// - 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 @@ -556,8 +637,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -570,16 +655,12 @@ func (client *NamespacesClient) getAuthorizationRuleCreateRequest(ctx context.Co return nil, errors.New("parameter authorizationRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{authorizationRuleName}", url.PathEscape(authorizationRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -597,8 +678,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 2025-05-01-preview +// - 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. @@ -625,8 +706,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -635,16 +720,12 @@ func (client *NamespacesClient) getNetworkRuleSetCreateRequest(ctx context.Conte return nil, errors.New("parameter namespaceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -661,7 +742,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 2025-05-01-preview // - options - NamespacesClientListOptions contains the optional parameters for the NamespacesClient.NewListPager method. func (client *NamespacesClient) NewListPager(options *NamespacesClientListOptions) *runtime.Pager[NamespacesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[NamespacesClientListResponse]{ @@ -687,7 +768,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") @@ -698,7 +779,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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -715,8 +796,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 2025-05-01-preview +// - 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. @@ -744,8 +825,12 @@ 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) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules" +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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -754,16 +839,12 @@ func (client *NamespacesClient) listAuthorizationRulesCreateRequest(ctx context. return nil, errors.New("parameter namespaceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -780,8 +861,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 2025-05-01-preview +// - 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] { @@ -808,22 +889,22 @@ 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") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) 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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -841,8 +922,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 2025-05-01-preview +// - 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. @@ -869,8 +950,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -883,16 +968,12 @@ func (client *NamespacesClient) listKeysCreateRequest(ctx context.Context, resou return nil, errors.New("parameter authorizationRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{authorizationRuleName}", url.PathEscape(authorizationRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -909,8 +990,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 2025-05-01-preview +// - 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. @@ -938,8 +1019,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -948,16 +1033,12 @@ func (client *NamespacesClient) listNetworkRuleSetsCreateRequest(ctx context.Con return nil, errors.New("parameter namespaceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -975,8 +1056,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 2025-05-01-preview +// - 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. @@ -1005,8 +1086,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -1019,18 +1104,15 @@ func (client *NamespacesClient) regenerateKeysCreateRequest(ctx context.Context, return nil, errors.New("parameter authorizationRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{authorizationRuleName}", url.PathEscape(authorizationRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -1046,40 +1128,66 @@ func (client *NamespacesClient) regenerateKeysHandleResponse(resp *http.Response return result, nil } -// Update - Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is -// idempotent. +// BeginUpdate - Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation +// is idempotent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 -// - resourceGroupName - Name of the Resource group within the Azure subscription. +// Generated from API version 2025-05-01-preview +// - 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. -func (client *NamespacesClient) Update(ctx context.Context, resourceGroupName string, namespaceName string, parameters SBNamespaceUpdateParameters, options *NamespacesClientUpdateOptions) (NamespacesClientUpdateResponse, error) { +// - options - NamespacesClientBeginUpdateOptions contains the optional parameters for the NamespacesClient.BeginUpdate method. +func (client *NamespacesClient) BeginUpdate(ctx context.Context, resourceGroupName string, namespaceName string, parameters SBNamespaceUpdateParameters, options *NamespacesClientBeginUpdateOptions) (*runtime.Poller[NamespacesClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, namespaceName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NamespacesClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[NamespacesClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Update - Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is +// idempotent. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-05-01-preview +func (client *NamespacesClient) update(ctx context.Context, resourceGroupName string, namespaceName string, parameters SBNamespaceUpdateParameters, options *NamespacesClientBeginUpdateOptions) (*http.Response, error) { var err error - const operationName = "NamespacesClient.Update" + const operationName = "NamespacesClient.BeginUpdate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() req, err := client.updateCreateRequest(ctx, resourceGroupName, namespaceName, parameters, options) if err != nil { - return NamespacesClientUpdateResponse{}, err + return nil, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return NamespacesClientUpdateResponse{}, err + return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) - return NamespacesClientUpdateResponse{}, err + return nil, err } - resp, err := client.updateHandleResponse(httpResp) - return resp, err + return httpResp, nil } // 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, _ *NamespacesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -1088,29 +1196,17 @@ func (client *NamespacesClient) updateCreateRequest(ctx context.Context, resourc return nil, errors.New("parameter namespaceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, 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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } return req, nil } - -// updateHandleResponse handles the Update response. -func (client *NamespacesClient) updateHandleResponse(resp *http.Response) (NamespacesClientUpdateResponse, error) { - result := NamespacesClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SBNamespace); err != nil { - return NamespacesClientUpdateResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/servicebus/armservicebus/namespaces_client_example_test.go b/sdk/resourcemanager/servicebus/armservicebus/namespaces_client_example_test.go index 01cfe5f32e3d..eb0de65a49e0 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/namespaces_client_example_test.go +++ b/sdk/resourcemanager/servicebus/armservicebus/namespaces_client_example_test.go @@ -1,1070 +1,365 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. 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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" + "log" ) -// 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() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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), - // }, - // }}, - // } + 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 = armservicebus.NamespacesClientCheckNameAvailabilityResponse{ + // CheckNameAvailabilityResult: &armservicebus.CheckNameAvailabilityResult{ + // Message: to.Ptr(""), + // NameAvailable: to.Ptr(true), + // Reason: to.Ptr(armservicebus.UnavailableReasonNone), + // }, + // } } -// 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() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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), - // }, - // }}, - // } + poller, err := clientFactory.NewNamespacesClient().BeginCreateOrUpdate(ctx, "ArunMonocle", "sdk-Namespace2924", armservicebus.SBNamespace{ + Location: to.Ptr("South Central US"), + Properties: &armservicebus.SBNamespaceProperties{ + GeoDataReplication: &armservicebus.GeoDataReplicationProperties{ + Locations: []*armservicebus.NamespaceReplicaLocation{ + { + LocationName: to.Ptr("eastus"), + RoleType: to.Ptr(armservicebus.GeoDRRoleTypePrimary), + }, + { + LocationName: to.Ptr("southcentralus"), + RoleType: to.Ptr(armservicebus.GeoDRRoleTypeSecondary), + }, + }, + MaxReplicationLagDurationInSeconds: to.Ptr[int32](300), + }, + PremiumMessagingPartitions: to.Ptr[int32](2), + }, + SKU: &armservicebus.SBSKU{ + Name: to.Ptr(armservicebus.SKUNamePremium), + Capacity: to.Ptr[int32](4), + Tier: to.Ptr(armservicebus.SKUTierPremium), + }, + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, 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 = armservicebus.NamespacesClientCreateOrUpdateResponse{ + // 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"), + // Properties: &armservicebus.SBNamespaceProperties{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-25T22:26:36.76Z"); return t}()), + // GeoDataReplication: &armservicebus.GeoDataReplicationProperties{ + // Locations: []*armservicebus.NamespaceReplicaLocation{ + // { + // LocationName: to.Ptr("eastus"), + // RoleType: to.Ptr(armservicebus.GeoDRRoleTypePrimary), + // }, + // { + // LocationName: to.Ptr("southcentralus"), + // RoleType: to.Ptr(armservicebus.GeoDRRoleTypeSecondary), + // }, + // }, + // MaxReplicationLagDurationInSeconds: to.Ptr[int32](300), + // }, + // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:sdk-namespace-2924"), + // MinimumTLSVersion: to.Ptr(armservicebus.TLSVersionOne2), + // PlatformCapabilities: &armservicebus.PlatformCapabilities{ + // ConfidentialCompute: &armservicebus.ConfidentialCompute{ + // Mode: to.Ptr(armservicebus.ModeDisabled), + // }, + // }, + // PremiumMessagingPartitions: to.Ptr[int32](2), + // ProvisioningState: to.Ptr("Created"), + // 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.76Z"); return t}()), + // }, + // SKU: &armservicebus.SBSKU{ + // Name: to.Ptr(armservicebus.SKUNamePremium), + // Capacity: to.Ptr[int32](4), + // Tier: to.Ptr(armservicebus.SKUTierPremium), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // } +} + +// Generated from example definition: 2025-05-01-preview/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("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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 = armservicebus.NamespacesClientCreateOrUpdateAuthorizationRuleResponse{ + // 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: 2025-05-01-preview/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("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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 = armservicebus.NamespacesClientCreateOrUpdateNetworkRuleSetResponse{ + // 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: 2025-05-01-preview/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("00000000-0000-0000-0000-000000000000", 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) + } + 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 = armservicebus.NamespacesClientDeleteResponse{ + // } } -// 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() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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) + res, 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) } - 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), - // }, + // res = armservicebus.NamespacesClientDeleteAuthorizationRuleResponse{ // } } -// 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() { +// Generated from example definition: 2025-05-01-preview/NameSpaces/SBNamespaceFailover.json +func ExampleNamespacesClient_BeginFailover() { 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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNamespacesClient().BeginDelete(ctx, "ArunMonocle", "sdk-Namespace-3285", nil) + poller, err := clientFactory.NewNamespacesClient().BeginFailover(ctx, "ResurceGroupSample", "NamespaceGeoDRFailoverSample", armservicebus.FailOver{ + Properties: &armservicebus.FailOverProperties{ + Force: to.Ptr(true), + PrimaryLocation: to.Ptr("centralus"), + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -1074,14 +369,14 @@ func ExampleNamespacesClient_BeginDelete() { } } -// 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 +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -1092,288 +387,1113 @@ func ExampleNamespacesClient_Get() { // 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), + // res = armservicebus.NamespacesClientGetResponse{ + // 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"), + // Properties: &armservicebus.SBNamespaceProperties{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-25T22:26:36.76Z"); return t}()), + // DisableLocalAuth: to.Ptr(false), + // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:sdk-namespace-2924"), + // MinimumTLSVersion: to.Ptr(armservicebus.TLSVersionOne2), + // PlatformCapabilities: &armservicebus.PlatformCapabilities{ + // ConfidentialCompute: &armservicebus.ConfidentialCompute{ + // Mode: to.Ptr(armservicebus.ModeDisabled), + // }, + // }, + // PrivateEndpointConnections: []*armservicebus.PrivateEndpointConnection{ + // { + // Name: to.Ptr("privateEndpointConnectionName"), + // Type: to.Ptr("Microsoft.EventHub/Namespaces/PrivateEndpointConnections"), + // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ResurceGroupSample/providers/Microsoft.EventHub/namespaces/NamespaceSample/privateEndpointConnections/privateEndpointConnectionName"), + // Properties: &armservicebus.PrivateEndpointConnectionProperties{ + // PrivateEndpoint: &armservicebus.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/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(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), + // }, + // 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.35Z"); return t}()), + // }, + // SKU: &armservicebus.SBSKU{ + // Name: to.Ptr(armservicebus.SKUNameStandard), + // Tier: to.Ptr(armservicebus.SKUTierStandard), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, // }, // } } -// 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() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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) + 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.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), + // res = armservicebus.NamespacesClientGetAuthorizationRuleResponse{ + // 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/VirtualNetworkRule/SBNetworkRuleSetCreate.json -func ExampleNamespacesClient_CreateOrUpdateNetworkRuleSet() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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) + 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/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"), + // res = armservicebus.NamespacesClientGetNetworkRuleSetResponse{ + // NetworkRuleSet: &armservicebus.NetworkRuleSet{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/NetworkRuleSet"), + // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/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"), // }, - // }, - // { - // 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"), + // { + // 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"), // }, // }, - // { - // 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"), + // PublicNetworkAccess: to.Ptr(armservicebus.PublicNetworkAccessFlagEnabled), + // VirtualNetworkRules: []*armservicebus.NWRuleSetVirtualNetworkRules{ + // { + // IgnoreMissingVnetServiceEndpoint: to.Ptr(true), + // Subnet: &armservicebus.Subnet{ + // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourcegroups/alitest/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet2"), + // }, + // }, + // { + // IgnoreMissingVnetServiceEndpoint: to.Ptr(false), + // Subnet: &armservicebus.Subnet{ + // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourcegroups/alitest/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet3"), + // }, + // }, + // { + // IgnoreMissingVnetServiceEndpoint: to.Ptr(false), + // Subnet: &armservicebus.Subnet{ + // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/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() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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) + 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 = armservicebus.NamespacesClientListResponse{ + // 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"), + // Properties: &armservicebus.SBNamespaceProperties{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-23T02:40:17.27Z"); return t}()), + // DisableLocalAuth: to.Ptr(false), + // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:ns-91f08e47-2b04-4943-b0cd-a5fb02b88f20"), + // MinimumTLSVersion: to.Ptr(armservicebus.TLSVersionOne2), + // 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.78Z"); return t}()), + // }, + // SKU: &armservicebus.SBSKU{ + // Name: to.Ptr(armservicebus.SKUNameStandard), + // Tier: to.Ptr(armservicebus.SKUTierStandard), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // Properties: &armservicebus.SBNamespaceProperties{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-23T03:50:38.98Z"); 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), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // 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), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // Properties: &armservicebus.SBNamespaceProperties{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-10-10T22:01:00.42Z"); return t}()), + // DisableLocalAuth: to.Ptr(false), + // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:sbpremium"), + // PremiumMessagingPartitions: to.Ptr[int32](1), + // ProvisioningState: to.Ptr("Created"), + // 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.42Z"); return t}()), + // }, + // SKU: &armservicebus.SBSKU{ + // Name: to.Ptr(armservicebus.SKUNamePremium), + // Capacity: to.Ptr[int32](1), + // Tier: to.Ptr(armservicebus.SKUTierPremium), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // 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), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // Properties: &armservicebus.SBNamespaceProperties{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-23T03:30:49.16Z"); 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), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // Properties: &armservicebus.SBNamespaceProperties{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-16T18:07:30.05Z"); 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), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // 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"), + // PremiumMessagingPartitions: to.Ptr[int32](2), + // ProvisioningState: to.Ptr("Created"), + // 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](4), + // Tier: to.Ptr(armservicebus.SKUTierPremium), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // Properties: &armservicebus.SBNamespaceProperties{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-16T01:01:58.73Z"); 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.8Z"); return t}()), + // }, + // SKU: &armservicebus.SBSKU{ + // Name: to.Ptr(armservicebus.SKUNameStandard), + // Tier: to.Ptr(armservicebus.SKUTierStandard), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // 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), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // Properties: &armservicebus.SBNamespaceProperties{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-05T03:29:19.75Z"); 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), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // 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), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // 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), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // 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.77Z"); return t}()), + // }, + // SKU: &armservicebus.SBSKU{ + // Name: to.Ptr(armservicebus.SKUNameStandard), + // Tier: to.Ptr(armservicebus.SKUTierStandard), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // 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), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // 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.95Z"); return t}()), + // }, + // SKU: &armservicebus.SBSKU{ + // Name: to.Ptr(armservicebus.SKUNameStandard), + // Tier: to.Ptr(armservicebus.SKUTierStandard), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // 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), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // Properties: &armservicebus.SBNamespaceProperties{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-10-10T22:16:30.87Z"); return t}()), + // DisableLocalAuth: to.Ptr(false), + // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:sbprem"), + // PremiumMessagingPartitions: to.Ptr[int32](2), + // ProvisioningState: to.Ptr("Created"), + // 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.87Z"); return t}()), + // }, + // SKU: &armservicebus.SBSKU{ + // Name: to.Ptr(armservicebus.SKUNamePremium), + // Capacity: to.Ptr[int32](1), + // Tier: to.Ptr(armservicebus.SKUTierPremium), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // 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), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // 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), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // Properties: &armservicebus.SBNamespaceProperties{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-16T01:33:50.45Z"); 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), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // 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), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // 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.56Z"); return t}()), + // }, + // SKU: &armservicebus.SBSKU{ + // Name: to.Ptr(armservicebus.SKUNameStandard), + // Tier: to.Ptr(armservicebus.SKUTierStandard), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // Properties: &armservicebus.SBNamespaceProperties{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-23T03:59:12.1Z"); 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.23Z"); return t}()), + // }, + // SKU: &armservicebus.SBSKU{ + // Name: to.Ptr(armservicebus.SKUNameStandard), + // Tier: to.Ptr(armservicebus.SKUTierStandard), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // Properties: &armservicebus.SBNamespaceProperties{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-05T03:45:09.27Z"); 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), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // 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), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // 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.26Z"); return t}()), + // }, + // SKU: &armservicebus.SBSKU{ + // Name: to.Ptr(armservicebus.SKUNameStandard), + // Tier: to.Ptr(armservicebus.SKUTierStandard), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // 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.64Z"); return t}()), + // }, + // SKU: &armservicebus.SBSKU{ + // Name: to.Ptr(armservicebus.SKUNameStandard), + // Tier: to.Ptr(armservicebus.SKUTierStandard), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // Properties: &armservicebus.SBNamespaceProperties{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-16T17:35:32.61Z"); 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.27Z"); return t}()), + // }, + // SKU: &armservicebus.SBSKU{ + // Name: to.Ptr(armservicebus.SKUNameStandard), + // Tier: to.Ptr(armservicebus.SKUTierStandard), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // 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), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // Properties: &armservicebus.SBNamespaceProperties{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-16T17:43:25.71Z"); 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.89Z"); return t}()), + // }, + // SKU: &armservicebus.SBSKU{ + // Name: to.Ptr(armservicebus.SKUNameStandard), + // Tier: to.Ptr(armservicebus.SKUTierStandard), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // 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), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // 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("Created"), + // 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), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // 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.96Z"); return t}()), + // }, + // SKU: &armservicebus.SBSKU{ + // Name: to.Ptr(armservicebus.SKUNameStandard), + // Tier: to.Ptr(armservicebus.SKUTierStandard), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // Properties: &armservicebus.SBNamespaceProperties{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-23T03:42:40.01Z"); 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), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // Properties: &armservicebus.SBNamespaceProperties{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-05T04:28:10.71Z"); 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), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // Properties: &armservicebus.SBNamespaceProperties{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-25T22:26:36.76Z"); 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.35Z"); return t}()), + // }, + // SKU: &armservicebus.SBSKU{ + // Name: to.Ptr(armservicebus.SKUNameStandard), + // Tier: to.Ptr(armservicebus.SKUTierStandard), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // { + // 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"), + // 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), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // 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), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // Properties: &armservicebus.SBNamespaceProperties{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-16T17:51:27.73Z"); 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), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // 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), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // 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("Created"), + // 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), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // 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), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // Properties: &armservicebus.SBNamespaceProperties{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-28T23:57:40.82Z"); return t}()), + // DisableLocalAuth: to.Ptr(false), + // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:bn3-rrama-foo2"), + // ProvisioningState: to.Ptr("Created"), + // 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.82Z"); return t}()), + // }, + // SKU: &armservicebus.SBSKU{ + // Name: to.Ptr(armservicebus.SKUNameStandard), + // Tier: to.Ptr(armservicebus.SKUTierStandard), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // 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"), + // 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), + // }, + // Tags: map[string]*string{ + // }, + // }, + // }, + // }, + // } } - // 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() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewNamespacesClient().NewListNetworkRuleSetsPager("ResourceGroup", "sdk-Namespace-6019", nil) + pager := clientFactory.NewNamespacesClient().NewListAuthorizationRulesPager("ArunMonocle", "sdk-Namespace-6914", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -1384,72 +1504,50 @@ func ExampleNamespacesClient_NewListNetworkRuleSetsPager() { _ = 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"), - // }, + // page = armservicebus.NamespacesClientListAuthorizationRulesResponse{ + // SBAuthorizationRuleListResult: armservicebus.SBAuthorizationRuleListResult{ + // Value: []*armservicebus.SBAuthorizationRule{ + // { + // Name: to.Ptr("RootManageSharedAccessKey"), + // 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.AccessRightsManage), + // to.Ptr(armservicebus.AccessRightsSend), // }, - // { - // IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - // Subnet: &armservicebus.Subnet{ - // ID: to.Ptr("/subscriptions/subscriptionid/resourcegroups/resourcegroupid/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet3"), - // }, + // }, + // }, + // { + // 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-1789"), + // Properties: &armservicebus.SBAuthorizationRuleProperties{ + // Rights: []*armservicebus.AccessRights{ + // to.Ptr(armservicebus.AccessRightsListen), + // to.Ptr(armservicebus.AccessRightsSend), // }, - // { - // 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() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewNamespacesClient().NewListAuthorizationRulesPager("ArunMonocle", "sdk-Namespace-6914", nil) + pager := clientFactory.NewNamespacesClient().NewListByResourceGroupPager("ArunMonocle", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -1460,151 +1558,155 @@ func ExampleNamespacesClient_NewListAuthorizationRulesPager() { _ = 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)}, + // page = armservicebus.NamespacesClientListByResourceGroupResponse{ + // 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"), + // Properties: &armservicebus.SBNamespaceProperties{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-25T22:26:36.76Z"); 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.35Z"); return t}()), + // }, + // SKU: &armservicebus.SBSKU{ + // Name: to.Ptr(armservicebus.SKUNameStandard), + // Tier: to.Ptr(armservicebus.SKUTierStandard), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), // }, // }, - // { - // 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() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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) + 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.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)}, - // }, - // } + // res = armservicebus.NamespacesClientListKeysResponse{ + // 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/SBNameSpaceAuthorizationRuleListKey.json -func ExampleNamespacesClient_ListKeys() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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) + 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 = armservicebus.NamespacesClientListNetworkRuleSetsResponse{ + // NetworkRuleSetListResult: armservicebus.NetworkRuleSetListResult{ + // Value: []*armservicebus.NetworkRuleSet{ + // { + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/NetworkRuleSet"), + // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/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/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourcegroups/resourcegroupid/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet2"), + // }, + // }, + // { + // IgnoreMissingVnetServiceEndpoint: to.Ptr(false), + // Subnet: &armservicebus.Subnet{ + // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourcegroups/resourcegroupid/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet3"), + // }, + // }, + // { + // IgnoreMissingVnetServiceEndpoint: to.Ptr(false), + // Subnet: &armservicebus.Subnet{ + // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourcegroups/resourcegroupid/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet6"), + // }, + // }, + // }, + // }, + // }, + // }, + // }, + // } } - // 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 +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -1617,38 +1719,73 @@ func ExampleNamespacesClient_RegenerateKeys() { // 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("#############################################"), + // res = armservicebus.NamespacesClientRegenerateKeysResponse{ + // 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() { +// Generated from example definition: 2025-05-01-preview/NameSpaces/SBNameSpaceUpdate.json +func ExampleNamespacesClient_BeginUpdate() { 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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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"), + poller, err := clientFactory.NewNamespacesClient().BeginUpdate(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) } + 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.CheckNameAvailabilityResult = armservicebus.CheckNameAvailabilityResult{ - // Message: to.Ptr(""), - // NameAvailable: to.Ptr(true), - // Reason: to.Ptr(armservicebus.UnavailableReasonNone), + // res = armservicebus.NamespacesClientUpdateResponse{ + // 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"), + // Properties: &armservicebus.SBNamespaceProperties{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-25T23:07:58.17Z"); return t}()), + // DisableLocalAuth: to.Ptr(false), + // MetricID: to.Ptr("5f750a97-50d9-4e36-8081-c9ee4c0210d4:sdk-namespace-3285"), + // MinimumTLSVersion: to.Ptr(armservicebus.TLSVersionOne1), + // PlatformCapabilities: &armservicebus.PlatformCapabilities{ + // ConfidentialCompute: &armservicebus.ConfidentialCompute{ + // Mode: to.Ptr(armservicebus.ModeDisabled), + // }, + // }, + // ProvisioningState: to.Ptr("Updating"), + // 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), + // }, + // Tags: map[string]*string{ + // "tag3": to.Ptr("value3"), + // "tag4": to.Ptr("value4"), + // }, + // }, // } } diff --git a/sdk/resourcemanager/servicebus/armservicebus/networksecurityperimeterconfiguration_client.go b/sdk/resourcemanager/servicebus/armservicebus/networksecurityperimeterconfiguration_client.go new file mode 100644 index 000000000000..628f51d6ecb9 --- /dev/null +++ b/sdk/resourcemanager/servicebus/armservicebus/networksecurityperimeterconfiguration_client.go @@ -0,0 +1,105 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armservicebus + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// NetworkSecurityPerimeterConfigurationClient contains the methods for the NetworkSecurityPerimeterConfiguration group. +// Don't use this type directly, use NewNetworkSecurityPerimeterConfigurationClient() instead. +type NetworkSecurityPerimeterConfigurationClient struct { + internal *arm.Client + subscriptionID string +} + +// NewNetworkSecurityPerimeterConfigurationClient creates a new instance of NetworkSecurityPerimeterConfigurationClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - Contains optional client configuration. Pass nil to accept the default values. +func NewNetworkSecurityPerimeterConfigurationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkSecurityPerimeterConfigurationClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &NetworkSecurityPerimeterConfigurationClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListPager - Gets list of current NetworkSecurityPerimeterConfiguration for Namespace +// +// Generated from API version 2025-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - The namespace name +// - options - NetworkSecurityPerimeterConfigurationClientListOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationClient.NewListPager +// method. +func (client *NetworkSecurityPerimeterConfigurationClient) NewListPager(resourceGroupName string, namespaceName string, options *NetworkSecurityPerimeterConfigurationClientListOptions) *runtime.Pager[NetworkSecurityPerimeterConfigurationClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[NetworkSecurityPerimeterConfigurationClientListResponse]{ + More: func(page NetworkSecurityPerimeterConfigurationClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *NetworkSecurityPerimeterConfigurationClientListResponse) (NetworkSecurityPerimeterConfigurationClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "NetworkSecurityPerimeterConfigurationClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, namespaceName, options) + }, nil) + if err != nil { + return NetworkSecurityPerimeterConfigurationClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *NetworkSecurityPerimeterConfigurationClient) listCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, _ *NetworkSecurityPerimeterConfigurationClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/networkSecurityPerimeterConfigurations" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + 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", "2025-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *NetworkSecurityPerimeterConfigurationClient) listHandleResponse(resp *http.Response) (NetworkSecurityPerimeterConfigurationClientListResponse, error) { + result := NetworkSecurityPerimeterConfigurationClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkSecurityPerimeterConfigurationList); err != nil { + return NetworkSecurityPerimeterConfigurationClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/servicebus/armservicebus/networksecurityperimeterconfiguration_client_example_test.go b/sdk/resourcemanager/servicebus/armservicebus/networksecurityperimeterconfiguration_client_example_test.go new file mode 100644 index 000000000000..c2ad5fd453eb --- /dev/null +++ b/sdk/resourcemanager/servicebus/armservicebus/networksecurityperimeterconfiguration_client_example_test.go @@ -0,0 +1,75 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armservicebus_test + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" + "log" +) + +// Generated from example definition: 2025-05-01-preview/NameSpaces/NetworkSecurityPerimeterConfigurationList.json +func ExampleNetworkSecurityPerimeterConfigurationClient_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("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewNetworkSecurityPerimeterConfigurationClient().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 = armservicebus.NetworkSecurityPerimeterConfigurationClientListResponse{ + // NetworkSecurityPerimeterConfigurationList: armservicebus.NetworkSecurityPerimeterConfigurationList{ + // Value: []*armservicebus.NetworkSecurityPerimeterConfiguration{ + // { + // Name: to.Ptr("resourceAssociation1"), + // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/networkSecurityPerimeterConfigurations"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SDK-ServiceBus-4794/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-5705-new/networkSecurityPerimeterConfigurations/resourceAssociation1"), + // Properties: &armservicebus.NetworkSecurityPerimeterConfigurationProperties{ + // NetworkSecurityPerimeter: &armservicebus.NetworkSecurityPerimeter{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SDK-ServiceBus-4794/providers/Microsoft.Network/networkSecurityPerimeters/nsp1"), + // Location: to.Ptr("East US"), + // PerimeterGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // Profile: &armservicebus.NetworkSecurityPerimeterConfigurationPropertiesProfile{ + // Name: to.Ptr("devProfile"), + // AccessRules: []*armservicebus.NspAccessRule{ + // { + // Name: to.Ptr("inVpnRule"), + // Properties: &armservicebus.NspAccessRuleProperties{ + // AddressPrefixes: []*string{ + // to.Ptr("148.0.0.0/8"), + // to.Ptr("152.4.6.0/24"), + // }, + // Direction: to.Ptr(armservicebus.NspAccessRuleDirectionInbound), + // }, + // }, + // }, + // AccessRulesVersion: to.Ptr("10"), + // }, + // ProvisioningState: to.Ptr(armservicebus.NetworkSecurityPerimeterConfigurationProvisioningStateUpdating), + // ResourceAssociation: &armservicebus.NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation{ + // Name: to.Ptr("association1"), + // }, + // }, + // }, + // }, + // }, + // } + } +} diff --git a/sdk/resourcemanager/servicebus/armservicebus/networksecurityperimeterconfigurations_client.go b/sdk/resourcemanager/servicebus/armservicebus/networksecurityperimeterconfigurations_client.go new file mode 100644 index 000000000000..376a47ed71a5 --- /dev/null +++ b/sdk/resourcemanager/servicebus/armservicebus/networksecurityperimeterconfigurations_client.go @@ -0,0 +1,169 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armservicebus + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// NetworkSecurityPerimeterConfigurationsClient contains the methods for the NetworkSecurityPerimeterConfigurations group. +// Don't use this type directly, use NewNetworkSecurityPerimeterConfigurationsClient() instead. +type NetworkSecurityPerimeterConfigurationsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewNetworkSecurityPerimeterConfigurationsClient creates a new instance of NetworkSecurityPerimeterConfigurationsClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - Contains optional client configuration. Pass nil to accept the default values. +func NewNetworkSecurityPerimeterConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkSecurityPerimeterConfigurationsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &NetworkSecurityPerimeterConfigurationsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// GetResourceAssociationName - Return a NetworkSecurityPerimeterConfigurations resourceAssociationName +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - The namespace name +// - resourceAssociationName - The ResourceAssociation Name +// - options - NetworkSecurityPerimeterConfigurationsClientGetResourceAssociationNameOptions contains the optional parameters +// for the NetworkSecurityPerimeterConfigurationsClient.GetResourceAssociationName method. +func (client *NetworkSecurityPerimeterConfigurationsClient) GetResourceAssociationName(ctx context.Context, resourceGroupName string, namespaceName string, resourceAssociationName string, options *NetworkSecurityPerimeterConfigurationsClientGetResourceAssociationNameOptions) (NetworkSecurityPerimeterConfigurationsClientGetResourceAssociationNameResponse, error) { + var err error + const operationName = "NetworkSecurityPerimeterConfigurationsClient.GetResourceAssociationName" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getResourceAssociationNameCreateRequest(ctx, resourceGroupName, namespaceName, resourceAssociationName, options) + if err != nil { + return NetworkSecurityPerimeterConfigurationsClientGetResourceAssociationNameResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkSecurityPerimeterConfigurationsClientGetResourceAssociationNameResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkSecurityPerimeterConfigurationsClientGetResourceAssociationNameResponse{}, err + } + resp, err := client.getResourceAssociationNameHandleResponse(httpResp) + return resp, err +} + +// getResourceAssociationNameCreateRequest creates the GetResourceAssociationName request. +func (client *NetworkSecurityPerimeterConfigurationsClient) getResourceAssociationNameCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, resourceAssociationName string, _ *NetworkSecurityPerimeterConfigurationsClientGetResourceAssociationNameOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/networkSecurityPerimeterConfigurations/{resourceAssociationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if resourceAssociationName == "" { + return nil, errors.New("parameter resourceAssociationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceAssociationName}", url.PathEscape(resourceAssociationName)) + 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", "2025-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getResourceAssociationNameHandleResponse handles the GetResourceAssociationName response. +func (client *NetworkSecurityPerimeterConfigurationsClient) getResourceAssociationNameHandleResponse(resp *http.Response) (NetworkSecurityPerimeterConfigurationsClientGetResourceAssociationNameResponse, error) { + result := NetworkSecurityPerimeterConfigurationsClientGetResourceAssociationNameResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkSecurityPerimeterConfiguration); err != nil { + return NetworkSecurityPerimeterConfigurationsClientGetResourceAssociationNameResponse{}, err + } + return result, nil +} + +// Reconcile - Refreshes any information about the association. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - The namespace name +// - resourceAssociationName - The ResourceAssociation Name +// - options - NetworkSecurityPerimeterConfigurationsClientReconcileOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.Reconcile +// method. +func (client *NetworkSecurityPerimeterConfigurationsClient) Reconcile(ctx context.Context, resourceGroupName string, namespaceName string, resourceAssociationName string, options *NetworkSecurityPerimeterConfigurationsClientReconcileOptions) (NetworkSecurityPerimeterConfigurationsClientReconcileResponse, error) { + var err error + const operationName = "NetworkSecurityPerimeterConfigurationsClient.Reconcile" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.reconcileCreateRequest(ctx, resourceGroupName, namespaceName, resourceAssociationName, options) + if err != nil { + return NetworkSecurityPerimeterConfigurationsClientReconcileResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkSecurityPerimeterConfigurationsClientReconcileResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkSecurityPerimeterConfigurationsClientReconcileResponse{}, err + } + return NetworkSecurityPerimeterConfigurationsClientReconcileResponse{}, nil +} + +// reconcileCreateRequest creates the Reconcile request. +func (client *NetworkSecurityPerimeterConfigurationsClient) reconcileCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, resourceAssociationName string, _ *NetworkSecurityPerimeterConfigurationsClientReconcileOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/networkSecurityPerimeterConfigurations/{resourceAssociationName}/reconcile" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if resourceAssociationName == "" { + return nil, errors.New("parameter resourceAssociationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceAssociationName}", url.PathEscape(resourceAssociationName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} diff --git a/sdk/resourcemanager/servicebus/armservicebus/networksecurityperimeterconfigurations_client_example_test.go b/sdk/resourcemanager/servicebus/armservicebus/networksecurityperimeterconfigurations_client_example_test.go new file mode 100644 index 000000000000..1f709329254b --- /dev/null +++ b/sdk/resourcemanager/servicebus/armservicebus/networksecurityperimeterconfigurations_client_example_test.go @@ -0,0 +1,89 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armservicebus_test + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" + "log" +) + +// Generated from example definition: 2025-05-01-preview/NameSpaces/NetworkSecurityPerimeterConfigurationAssociationproxy.json +func ExampleNetworkSecurityPerimeterConfigurationsClient_GetResourceAssociationName() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armservicebus.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewNetworkSecurityPerimeterConfigurationsClient().GetResourceAssociationName(ctx, "SDK-ServiceBus-4794", "sdk-Namespace-5828", "resourceAssociation1", 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 = armservicebus.NetworkSecurityPerimeterConfigurationsClientGetResourceAssociationNameResponse{ + // NetworkSecurityPerimeterConfiguration: &armservicebus.NetworkSecurityPerimeterConfiguration{ + // Name: to.Ptr("resourceAssociation1"), + // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/networkSecurityPerimeterConfigurations"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SDK-ServiceBus-4794/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-5705-new/networkSecurityPerimeterConfigurations/resourceAssociation1"), + // Properties: &armservicebus.NetworkSecurityPerimeterConfigurationProperties{ + // NetworkSecurityPerimeter: &armservicebus.NetworkSecurityPerimeter{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SDK-ServiceBus-4794/providers/Microsoft.Network/networkSecurityPerimeters/nsp1"), + // Location: to.Ptr("East US"), + // PerimeterGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // Profile: &armservicebus.NetworkSecurityPerimeterConfigurationPropertiesProfile{ + // Name: to.Ptr("devProfile"), + // AccessRules: []*armservicebus.NspAccessRule{ + // { + // Name: to.Ptr("inVpnRule"), + // Properties: &armservicebus.NspAccessRuleProperties{ + // AddressPrefixes: []*string{ + // to.Ptr("148.0.0.0/8"), + // to.Ptr("152.4.6.0/24"), + // }, + // Direction: to.Ptr(armservicebus.NspAccessRuleDirectionInbound), + // }, + // }, + // }, + // AccessRulesVersion: to.Ptr("10"), + // }, + // ProvisioningState: to.Ptr(armservicebus.NetworkSecurityPerimeterConfigurationProvisioningStateUpdating), + // ResourceAssociation: &armservicebus.NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation{ + // Name: to.Ptr("association1"), + // AccessMode: to.Ptr(armservicebus.ResourceAssociationAccessModeEnforcedMode), + // }, + // }, + // }, + // } +} + +// Generated from example definition: 2025-05-01-preview/NameSpaces/NetworkSecurityPerimeterConfigurationReconcile.json +func ExampleNetworkSecurityPerimeterConfigurationsClient_Reconcile() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewNetworkSecurityPerimeterConfigurationsClient().Reconcile(ctx, "SDK-ServiceBus-4794", "sdk-Namespace-5828", "resourceAssociation1", 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 = armservicebus.NetworkSecurityPerimeterConfigurationsClientReconcileResponse{ + // } +} diff --git a/sdk/resourcemanager/servicebus/armservicebus/operations_client.go b/sdk/resourcemanager/servicebus/armservicebus/operations_client.go index 385e243a4321..a93fbfe15ffc 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/operations_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/operations_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicebus @@ -22,7 +21,7 @@ type OperationsClient struct { // NewOperationsClient creates a new instance of OperationsClient with the specified values. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -34,9 +33,9 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO return client, nil } -// NewListPager - Lists all of the available ServiceBus REST API operations. +// NewListPager - List the operations for the provider // -// Generated from API version 2021-11-01 +// Generated from API version 2025-05-01-preview // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -62,14 +61,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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicebus/armservicebus/operations_client_example_test.go b/sdk/resourcemanager/servicebus/armservicebus/operations_client_example_test.go index a1c9009c47ec..b8d61d4aaf39 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/operations_client_example_test.go +++ b/sdk/resourcemanager/servicebus/armservicebus/operations_client_example_test.go @@ -1,27 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. 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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" + "log" ) -// 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 +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -36,296 +33,299 @@ func ExampleOperationsClient_NewListPager() { _ = 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"), - // }, - // }}, + // page = armservicebus.OperationsClientListResponse{ + // 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/operations_live_test.go b/sdk/resourcemanager/servicebus/armservicebus/operations_live_test.go index 7817908fc265..1ca91cabacc1 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/operations_live_test.go +++ b/sdk/resourcemanager/servicebus/armservicebus/operations_live_test.go @@ -12,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/servicebus/armservicebus/options.go b/sdk/resourcemanager/servicebus/armservicebus/options.go index 7a37e093010f..fd0e27e06228 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/options.go +++ b/sdk/resourcemanager/servicebus/armservicebus/options.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicebus @@ -33,7 +32,7 @@ type DisasterRecoveryConfigsClientDeleteOptions struct { // method. type DisasterRecoveryConfigsClientFailOverOptions struct { // Parameters required to create an Alias(Disaster Recovery configuration) - Parameters *FailoverProperties + Parameters *NamespaceFailoverProperties } // DisasterRecoveryConfigsClientGetAuthorizationRuleOptions contains the optional parameters for the DisasterRecoveryConfigsClient.GetAuthorizationRule @@ -68,7 +67,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 } @@ -101,13 +100,25 @@ 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 +} + +// NamespacesClientBeginFailoverOptions contains the optional parameters for the NamespacesClient.BeginFailover method. +type NamespacesClientBeginFailoverOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// NamespacesClientBeginUpdateOptions contains the optional parameters for the NamespacesClient.BeginUpdate method. +type NamespacesClientBeginUpdateOptions struct { + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -184,8 +195,21 @@ type NamespacesClientRegenerateKeysOptions struct { // placeholder for future optional parameters } -// NamespacesClientUpdateOptions contains the optional parameters for the NamespacesClient.Update method. -type NamespacesClientUpdateOptions struct { +// NetworkSecurityPerimeterConfigurationClientListOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationClient.NewListPager +// method. +type NetworkSecurityPerimeterConfigurationClientListOptions struct { + // placeholder for future optional parameters +} + +// NetworkSecurityPerimeterConfigurationsClientGetResourceAssociationNameOptions contains the optional parameters for the +// NetworkSecurityPerimeterConfigurationsClient.GetResourceAssociationName method. +type NetworkSecurityPerimeterConfigurationsClientGetResourceAssociationNameOptions struct { + // placeholder for future optional parameters +} + +// NetworkSecurityPerimeterConfigurationsClientReconcileOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.Reconcile +// method. +type NetworkSecurityPerimeterConfigurationsClientReconcileOptions struct { // placeholder for future optional parameters } @@ -197,7 +221,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 } @@ -265,8 +289,7 @@ type QueuesClientListAuthorizationRulesOptions struct { // QueuesClientListByNamespaceOptions contains the optional parameters for the QueuesClient.NewListByNamespacePager method. type QueuesClientListByNamespaceOptions struct { // Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skip parameter that specifies - // a starting point to use for subsequent calls. + // the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. Skip *int32 // May be used to limit the number of results to the most recent N usageDetails. @@ -302,8 +325,7 @@ type RulesClientGetOptions struct { // method. type RulesClientListBySubscriptionsOptions struct { // Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skip parameter that specifies - // a starting point to use for subsequent calls. + // the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. Skip *int32 // May be used to limit the number of results to the most recent N usageDetails. @@ -329,8 +351,7 @@ type SubscriptionsClientGetOptions struct { // method. type SubscriptionsClientListByTopicOptions struct { // Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skip parameter that specifies - // a starting point to use for subsequent calls. + // the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. Skip *int32 // May be used to limit the number of results to the most recent N usageDetails. @@ -378,8 +399,7 @@ type TopicsClientListAuthorizationRulesOptions struct { // TopicsClientListByNamespaceOptions contains the optional parameters for the TopicsClient.NewListByNamespacePager method. type TopicsClientListByNamespaceOptions struct { // Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, - // the value of the nextLink element will include a skip parameter that specifies - // a starting point to use for subsequent calls. + // the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. Skip *int32 // May be used to limit the number of results to the most recent N usageDetails. diff --git a/sdk/resourcemanager/servicebus/armservicebus/privateendpointconnections_client.go b/sdk/resourcemanager/servicebus/armservicebus/privateendpointconnections_client.go index 5eb4e0231d37..c0493048c4bb 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/privateendpointconnections_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/privateendpointconnections_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicebus @@ -25,10 +24,9 @@ type PrivateEndpointConnectionsClient struct { } // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values. -// - subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -44,8 +42,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 2025-05-01-preview +// - 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. @@ -65,7 +63,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 } @@ -74,7 +72,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") @@ -97,9 +95,10 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -118,8 +117,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 2025-05-01-preview +// - 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 @@ -144,7 +143,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 2025-05-01-preview 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" @@ -167,8 +166,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -177,10 +180,6 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, errors.New("parameter namespaceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if privateEndpointConnectionName == "" { return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") } @@ -190,17 +189,16 @@ 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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // 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 2025-05-01-preview +// - 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 @@ -228,8 +226,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -242,16 +244,12 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,8 +266,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 2025-05-01-preview +// - 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. @@ -297,8 +295,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -307,16 +309,12 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co return nil, errors.New("parameter namespaceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicebus/armservicebus/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/servicebus/armservicebus/privateendpointconnections_client_example_test.go index 704e17d185ad..7b3e83fb442d 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/privateendpointconnections_client_example_test.go +++ b/sdk/resourcemanager/servicebus/armservicebus/privateendpointconnections_client_example_test.go @@ -1,71 +1,25 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. 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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" + "log" ) -// 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 +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -87,31 +41,33 @@ func ExamplePrivateEndpointConnectionsClient_CreateOrUpdate() { // 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), + // res = armservicebus.PrivateEndpointConnectionsClientCreateOrUpdateResponse{ + // 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), // }, - // 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 +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -119,20 +75,25 @@ func ExamplePrivateEndpointConnectionsClient_BeginDelete() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + 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 = armservicebus.PrivateEndpointConnectionsClientDeleteResponse{ + // } } -// 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 +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -143,19 +104,67 @@ func ExamplePrivateEndpointConnectionsClient_Get() { // 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"), + // res = armservicebus.PrivateEndpointConnectionsClientGetResponse{ + // 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), // }, - // PrivateLinkServiceConnectionState: &armservicebus.ConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // Status: to.Ptr(armservicebus.PrivateLinkConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armservicebus.EndPointProvisioningStateSucceeded), // }, // } } + +// Generated from example definition: 2025-05-01-preview/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("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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 = armservicebus.PrivateEndpointConnectionsClientListResponse{ + // 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), + // }, + // }, + // }, + // }, + // } + } +} diff --git a/sdk/resourcemanager/servicebus/armservicebus/privatelinkresources_client.go b/sdk/resourcemanager/servicebus/armservicebus/privatelinkresources_client.go index d4b0663cdc02..0dabdcd4eee5 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/privatelinkresources_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/privatelinkresources_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicebus @@ -25,10 +24,9 @@ type PrivateLinkResourcesClient struct { } // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values. -// - subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -44,8 +42,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 2025-05-01-preview +// - 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. @@ -72,8 +70,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -82,16 +84,12 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, errors.New("parameter namespaceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicebus/armservicebus/privatelinkresources_client_example_test.go b/sdk/resourcemanager/servicebus/armservicebus/privatelinkresources_client_example_test.go index e5e20123c44f..25c9c059a868 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/privatelinkresources_client_example_test.go +++ b/sdk/resourcemanager/servicebus/armservicebus/privatelinkresources_client_example_test.go @@ -1,27 +1,24 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. 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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" + "log" ) -// 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 +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -32,19 +29,24 @@ func ExamplePrivateLinkResourcesClient_Get() { // 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")}, + // res = armservicebus.PrivateLinkResourcesClientGetResponse{ + // PrivateLinkResourcesListResult: &armservicebus.PrivateLinkResourcesListResult{ + // Value: []*armservicebus.PrivateLinkResource{ + // { + // Name: to.Ptr("namespace"), + // Type: to.Ptr("Microsoft.ServiceBus/namespaces/privateLinkResources"), + // ID: to.Ptr("subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/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")}, + // to.Ptr("privatelink.servicebus.windows.net"), // }, - // }}, - // } + // }, + // }, + // }, + // }, + // } } diff --git a/sdk/resourcemanager/servicebus/armservicebus/queue_live_test.go b/sdk/resourcemanager/servicebus/armservicebus/queue_live_test.go index 4d60c6bbd4a2..6a51d6a22ecd 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/queue_live_test.go +++ b/sdk/resourcemanager/servicebus/armservicebus/queue_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/servicebus/armservicebus/queues_client.go b/sdk/resourcemanager/servicebus/armservicebus/queues_client.go index 9a3a1e10aee5..7f136964e422 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/queues_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/queues_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicebus @@ -26,10 +25,9 @@ type QueuesClient struct { } // NewQueuesClient creates a new instance of QueuesClient with the specified values. -// - subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewQueuesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*QueuesClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -45,8 +43,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 2025-05-01-preview +// - 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. @@ -74,8 +72,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -88,18 +90,15 @@ func (client *QueuesClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, errors.New("parameter queueName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{queueName}", url.PathEscape(queueName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, 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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -118,8 +117,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 2025-05-01-preview +// - 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. @@ -149,8 +148,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -167,18 +170,15 @@ func (client *QueuesClient) createOrUpdateAuthorizationRuleCreateRequest(ctx con return nil, errors.New("parameter authorizationRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{authorizationRuleName}", url.PathEscape(authorizationRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, 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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -197,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 2025-05-01-preview +// - 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. @@ -224,8 +224,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -238,26 +242,21 @@ func (client *QueuesClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, errors.New("parameter queueName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{queueName}", url.PathEscape(queueName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, 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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // 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 2025-05-01-preview +// - 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. @@ -285,8 +284,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -303,26 +306,21 @@ func (client *QueuesClient) deleteAuthorizationRuleCreateRequest(ctx context.Con return nil, errors.New("parameter authorizationRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{authorizationRuleName}", url.PathEscape(authorizationRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, 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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // 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 2025-05-01-preview +// - 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. @@ -349,8 +347,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -363,16 +365,12 @@ func (client *QueuesClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, errors.New("parameter queueName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{queueName}", url.PathEscape(queueName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -390,8 +388,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 2025-05-01-preview +// - 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. @@ -420,8 +418,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -438,16 +440,12 @@ func (client *QueuesClient) getAuthorizationRuleCreateRequest(ctx context.Contex return nil, errors.New("parameter authorizationRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{authorizationRuleName}", url.PathEscape(authorizationRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -464,8 +462,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 2025-05-01-preview +// - 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 @@ -494,8 +492,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -508,16 +510,12 @@ func (client *QueuesClient) listAuthorizationRulesCreateRequest(ctx context.Cont return nil, errors.New("parameter queueName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{queueName}", url.PathEscape(queueName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -534,8 +532,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 2025-05-01-preview +// - 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. @@ -565,6 +563,10 @@ func (client *QueuesClient) NewListByNamespacePager(resourceGroupName string, na // listByNamespaceCreateRequest creates the ListByNamespace request. func (client *QueuesClient) listByNamespaceCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, options *QueuesClientListByNamespaceOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -573,22 +575,18 @@ func (client *QueuesClient) listByNamespaceCreateRequest(ctx context.Context, re return nil, errors.New("parameter namespaceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { 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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -606,8 +604,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 2025-05-01-preview +// - 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. @@ -635,8 +633,12 @@ 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) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}/ListKeys" +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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -653,16 +655,12 @@ func (client *QueuesClient) listKeysCreateRequest(ctx context.Context, resourceG return nil, errors.New("parameter authorizationRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{authorizationRuleName}", url.PathEscape(authorizationRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -680,8 +678,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 2025-05-01-preview +// - 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. @@ -710,8 +708,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -728,18 +730,15 @@ func (client *QueuesClient) regenerateKeysCreateRequest(ctx context.Context, res return nil, errors.New("parameter authorizationRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{authorizationRuleName}", url.PathEscape(authorizationRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/servicebus/armservicebus/queues_client_example_test.go b/sdk/resourcemanager/servicebus/armservicebus/queues_client_example_test.go index 14fb63bec8ce..2e12b6ebc313 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/queues_client_example_test.go +++ b/sdk/resourcemanager/servicebus/armservicebus/queues_client_example_test.go @@ -1,66 +1,75 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. 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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" + "log" ) -// 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() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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)}, - // }, - // }}, - // } + 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 = armservicebus.QueuesClientCreateOrUpdateResponse{ + // 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.68Z"); 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/SBQueueAuthorizationRuleCreate.json +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -68,7 +77,8 @@ func ExampleQueuesClient_CreateOrUpdateAuthorizationRule() { Properties: &armservicebus.SBAuthorizationRuleProperties{ Rights: []*armservicebus.AccessRights{ to.Ptr(armservicebus.AccessRightsListen), - to.Ptr(armservicebus.AccessRightsSend)}, + to.Ptr(armservicebus.AccessRightsSend), + }, }, }, nil) if err != nil { @@ -77,135 +87,156 @@ func ExampleQueuesClient_CreateOrUpdateAuthorizationRule() { // 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)}, + // res = armservicebus.QueuesClientCreateOrUpdateAuthorizationRuleResponse{ + // 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() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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) + res, 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) } + // 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 = armservicebus.QueuesClientDeleteResponse{ + // } } -// 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() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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) + res, 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) } // 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)}, - // }, - // } + // res = armservicebus.QueuesClientDeleteAuthorizationRuleResponse{ + // } } -// 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() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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) + 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.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("############################################"), + // res = armservicebus.QueuesClientGetResponse{ + // 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, "0001-01-01T00:00:00Z"); return t}()), + // AutoDeleteOnIdle: to.Ptr("P10675199DT2H48M5.4775807S"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-26T18:07:32.4592931Z"); 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.6243761Z"); 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/SBQueueAuthorizationRuleRegenerateKey.json -func ExampleQueuesClient_RegenerateKeys() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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) + 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.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("############################################"), + // res = armservicebus.QueuesClientGetAuthorizationRuleResponse{ + // 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/SBQueueListByNameSpace.json -func ExampleQueuesClient_NewListByNamespacePager() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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, - }) + pager := clientFactory.NewQueuesClient().NewListAuthorizationRulesPager("ArunMonocle", "sdk-Namespace-7982", "sdk-Queues-2317", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -216,141 +247,137 @@ func ExampleQueuesClient_NewListByNamespacePager() { _ = 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}()), + // page = armservicebus.QueuesClientListAuthorizationRulesResponse{ + // 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/SBQueueCreate.json -func ExampleQueuesClient_CreateOrUpdate() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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) + pager := clientFactory.NewQueuesClient().NewListByNamespacePager("ArunMonocle", "sdk-Namespace-3174", 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 = armservicebus.QueuesClientListByNamespaceResponse{ + // 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, "0001-01-01T00:00:00Z"); return t}()), + // AutoDeleteOnIdle: to.Ptr("P10675199DT2H48M5.4775807S"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-26T18:07:32.4592931Z"); 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.6243761Z"); return t}()), + // }, + // }, + // }, + // }, + // } } - // 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() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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) + 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 = armservicebus.QueuesClientListKeysResponse{ + // 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/SBQueueGet.json -func ExampleQueuesClient_Get() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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) + 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.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}()), + // res = armservicebus.QueuesClientRegenerateKeysResponse{ + // 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("############################################"), // }, // } } diff --git a/sdk/resourcemanager/servicebus/armservicebus/response_types.go b/sdk/resourcemanager/servicebus/armservicebus/responses.go similarity index 87% rename from sdk/resourcemanager/servicebus/armservicebus/response_types.go rename to sdk/resourcemanager/servicebus/armservicebus/responses.go index f3fcb38b40fb..ea146a30db25 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/response_types.go +++ b/sdk/resourcemanager/servicebus/armservicebus/responses.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicebus @@ -46,7 +45,7 @@ type DisasterRecoveryConfigsClientGetResponse struct { // DisasterRecoveryConfigsClientListAuthorizationRulesResponse contains the response from method DisasterRecoveryConfigsClient.NewListAuthorizationRulesPager. type DisasterRecoveryConfigsClientListAuthorizationRulesResponse struct { - // The response to the List Namespace operation. + // The response of a SBAuthorizationRule list operation. SBAuthorizationRuleListResult } @@ -58,7 +57,7 @@ type DisasterRecoveryConfigsClientListKeysResponse struct { // DisasterRecoveryConfigsClientListResponse contains the response from method DisasterRecoveryConfigsClient.NewListPager. type DisasterRecoveryConfigsClientListResponse struct { - // The result of the List Alias(Disaster Recovery configuration) operation. + // The response of a ArmDisasterRecovery list operation. ArmDisasterRecoveryListResult } @@ -86,7 +85,7 @@ type MigrationConfigsClientGetResponse struct { // MigrationConfigsClientListResponse contains the response from method MigrationConfigsClient.NewListPager. type MigrationConfigsClientListResponse struct { - // The result of the List migrationConfigurations operation. + // The response of a MigrationConfigProperties list operation. MigrationConfigListResult } @@ -129,6 +128,11 @@ type NamespacesClientDeleteResponse struct { // placeholder for future response values } +// NamespacesClientFailoverResponse contains the response from method NamespacesClient.BeginFailover. +type NamespacesClientFailoverResponse struct { + FailOver +} + // NamespacesClientGetAuthorizationRuleResponse contains the response from method NamespacesClient.GetAuthorizationRule. type NamespacesClientGetAuthorizationRuleResponse struct { // Description of a namespace authorization rule. @@ -149,13 +153,13 @@ type NamespacesClientGetResponse struct { // NamespacesClientListAuthorizationRulesResponse contains the response from method NamespacesClient.NewListAuthorizationRulesPager. type NamespacesClientListAuthorizationRulesResponse struct { - // The response to the List Namespace operation. + // The response of a SBAuthorizationRule list operation. SBAuthorizationRuleListResult } // NamespacesClientListByResourceGroupResponse contains the response from method NamespacesClient.NewListByResourceGroupPager. type NamespacesClientListByResourceGroupResponse struct { - // The response of the List Namespace operation. + // The response of a SBNamespace list operation. SBNamespaceListResult } @@ -167,13 +171,13 @@ type NamespacesClientListKeysResponse struct { // NamespacesClientListNetworkRuleSetsResponse contains the response from method NamespacesClient.NewListNetworkRuleSetsPager. type NamespacesClientListNetworkRuleSetsResponse struct { - // The response of the List NetworkRuleSet operation. + // The response of a NetworkRuleSet list operation. NetworkRuleSetListResult } // NamespacesClientListResponse contains the response from method NamespacesClient.NewListPager. type NamespacesClientListResponse struct { - // The response of the List Namespace operation. + // The response of a SBNamespace list operation. SBNamespaceListResult } @@ -183,16 +187,32 @@ type NamespacesClientRegenerateKeysResponse struct { AccessKeys } -// NamespacesClientUpdateResponse contains the response from method NamespacesClient.Update. +// NamespacesClientUpdateResponse contains the response from method NamespacesClient.BeginUpdate. type NamespacesClientUpdateResponse struct { // Description of a namespace resource. SBNamespace } +// NetworkSecurityPerimeterConfigurationClientListResponse contains the response from method NetworkSecurityPerimeterConfigurationClient.NewListPager. +type NetworkSecurityPerimeterConfigurationClientListResponse struct { + // Result of the List NetworkSecurityPerimeterConfiguration operation. + NetworkSecurityPerimeterConfigurationList +} + +// NetworkSecurityPerimeterConfigurationsClientGetResourceAssociationNameResponse contains the response from method NetworkSecurityPerimeterConfigurationsClient.GetResourceAssociationName. +type NetworkSecurityPerimeterConfigurationsClientGetResourceAssociationNameResponse struct { + // Network Security Perimeter related configurations of a given namespace + NetworkSecurityPerimeterConfiguration +} + +// NetworkSecurityPerimeterConfigurationsClientReconcileResponse contains the response from method NetworkSecurityPerimeterConfigurationsClient.Reconcile. +type NetworkSecurityPerimeterConfigurationsClientReconcileResponse struct { + // placeholder for future response values +} + // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { - // Result of the request to list ServiceBus operations. It contains a list of operations and a URL link to get the next set - // of results. + // The list of available operations. OperationListResult } @@ -215,13 +235,13 @@ type PrivateEndpointConnectionsClientGetResponse struct { // PrivateEndpointConnectionsClientListResponse contains the response from method PrivateEndpointConnectionsClient.NewListPager. type PrivateEndpointConnectionsClientListResponse struct { - // Result of the list of all private endpoint connections operation. + // The response of a PrivateEndpointConnection list operation. PrivateEndpointConnectionListResult } // PrivateLinkResourcesClientGetResponse contains the response from method PrivateLinkResourcesClient.Get. type PrivateLinkResourcesClientGetResponse struct { - // Result of the List private link resources operation. + // The response of a PrivateLinkResource list operation. PrivateLinkResourcesListResult } @@ -261,13 +281,13 @@ type QueuesClientGetResponse struct { // QueuesClientListAuthorizationRulesResponse contains the response from method QueuesClient.NewListAuthorizationRulesPager. type QueuesClientListAuthorizationRulesResponse struct { - // The response to the List Namespace operation. + // The response of a SBAuthorizationRule list operation. SBAuthorizationRuleListResult } // QueuesClientListByNamespaceResponse contains the response from method QueuesClient.NewListByNamespacePager. type QueuesClientListByNamespaceResponse struct { - // The response to the List Queues operation. + // The response of a SBQueue list operation. SBQueueListResult } @@ -302,7 +322,7 @@ type RulesClientGetResponse struct { // RulesClientListBySubscriptionsResponse contains the response from method RulesClient.NewListBySubscriptionsPager. type RulesClientListBySubscriptionsResponse struct { - // The response of the List rule operation. + // The response of a Rule list operation. RuleListResult } @@ -325,7 +345,7 @@ type SubscriptionsClientGetResponse struct { // SubscriptionsClientListByTopicResponse contains the response from method SubscriptionsClient.NewListByTopicPager. type SubscriptionsClientListByTopicResponse struct { - // The response to the List Subscriptions operation. + // The response of a SBSubscription list operation. SBSubscriptionListResult } @@ -365,13 +385,13 @@ type TopicsClientGetResponse struct { // TopicsClientListAuthorizationRulesResponse contains the response from method TopicsClient.NewListAuthorizationRulesPager. type TopicsClientListAuthorizationRulesResponse struct { - // The response to the List Namespace operation. + // The response of a SBAuthorizationRule list operation. SBAuthorizationRuleListResult } // TopicsClientListByNamespaceResponse contains the response from method TopicsClient.NewListByNamespacePager. type TopicsClientListByNamespaceResponse struct { - // The response to the List Topics operation. + // The response of a SBTopic list operation. SBTopicListResult } diff --git a/sdk/resourcemanager/servicebus/armservicebus/rules_client.go b/sdk/resourcemanager/servicebus/armservicebus/rules_client.go index 21ad59cc02d1..af6498817a00 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/rules_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/rules_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicebus @@ -26,10 +25,9 @@ type RulesClient struct { } // NewRulesClient creates a new instance of RulesClient with the specified values. -// - subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RulesClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -45,8 +43,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 2025-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - topicName - The topic name. // - subscriptionName - The subscription name. @@ -76,8 +74,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -98,18 +100,15 @@ func (client *RulesClient) createOrUpdateCreateRequest(ctx context.Context, reso return nil, errors.New("parameter ruleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ruleName}", url.PathEscape(ruleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, 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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -128,8 +127,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 2025-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - topicName - The topic name. // - subscriptionName - The subscription name. @@ -157,8 +156,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -179,26 +182,21 @@ func (client *RulesClient) deleteCreateRequest(ctx context.Context, resourceGrou return nil, errors.New("parameter ruleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ruleName}", url.PathEscape(ruleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, 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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // 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 2025-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - topicName - The topic name. // - subscriptionName - The subscription name. @@ -227,8 +225,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -249,16 +251,12 @@ func (client *RulesClient) getCreateRequest(ctx context.Context, resourceGroupNa return nil, errors.New("parameter ruleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ruleName}", url.PathEscape(ruleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -275,8 +273,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 2025-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - topicName - The topic name. // - subscriptionName - The subscription name. @@ -308,6 +306,10 @@ func (client *RulesClient) NewListBySubscriptionsPager(resourceGroupName string, // listBySubscriptionsCreateRequest creates the ListBySubscriptions request. func (client *RulesClient) listBySubscriptionsCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, subscriptionName string, options *RulesClientListBySubscriptionsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -324,22 +326,18 @@ func (client *RulesClient) listBySubscriptionsCreateRequest(ctx context.Context, return nil, errors.New("parameter subscriptionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionName}", url.PathEscape(subscriptionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { 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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicebus/armservicebus/rules_client_example_test.go b/sdk/resourcemanager/servicebus/armservicebus/rules_client_example_test.go index 30d7662ef703..3e949eeccc4c 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/rules_client_example_test.go +++ b/sdk/resourcemanager/servicebus/armservicebus/rules_client_example_test.go @@ -1,72 +1,61 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. 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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" + "log" ) -// 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() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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"), - // }, - // }, - // }}, - // } + 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 = armservicebus.RulesClientCreateOrUpdateResponse{ + // 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/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_CorrelationFilter.json +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -86,65 +75,33 @@ func ExampleRulesClient_CreateOrUpdate_rulesCreateCorrelationFilter() { // 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"), + // res = armservicebus.RulesClientCreateOrUpdateResponse{ + // 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/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.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"), + // 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_SqlFilter.json +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -162,47 +119,54 @@ func ExampleRulesClient_CreateOrUpdate_rulesCreateSqlFilter() { // 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"), + // res = armservicebus.RulesClientCreateOrUpdateResponse{ + // 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/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 +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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) + res, 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) } + // 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 = armservicebus.RulesClientDeleteResponse{ + // } } -// 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 +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -213,18 +177,65 @@ func ExampleRulesClient_Get() { // 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"), + // res = armservicebus.RulesClientGetResponse{ + // 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"), + // }, // }, // }, // } } + +// Generated from example definition: 2025-05-01-preview/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("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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", 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 = armservicebus.RulesClientListBySubscriptionsResponse{ + // 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"), + // }, + // }, + // }, + // }, + // }, + // } + } +} diff --git a/sdk/resourcemanager/servicebus/armservicebus/rules_live_test.go b/sdk/resourcemanager/servicebus/armservicebus/rules_live_test.go index 086b5d1398b7..85e774b72849 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/rules_live_test.go +++ b/sdk/resourcemanager/servicebus/armservicebus/rules_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/servicebus/armservicebus/subscriptions_client.go b/sdk/resourcemanager/servicebus/armservicebus/subscriptions_client.go index 68da7736f2ab..637976bed081 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/subscriptions_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/subscriptions_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicebus @@ -26,10 +25,9 @@ type SubscriptionsClient struct { } // NewSubscriptionsClient creates a new instance of SubscriptionsClient with the specified values. -// - subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewSubscriptionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SubscriptionsClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -45,8 +43,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 2025-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - topicName - The topic name. // - subscriptionName - The subscription name. @@ -76,8 +74,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -94,18 +96,15 @@ func (client *SubscriptionsClient) createOrUpdateCreateRequest(ctx context.Conte return nil, errors.New("parameter subscriptionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionName}", url.PathEscape(subscriptionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, 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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,8 +123,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 2025-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - topicName - The topic name. // - subscriptionName - The subscription name. @@ -152,8 +151,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -170,26 +173,21 @@ func (client *SubscriptionsClient) deleteCreateRequest(ctx context.Context, reso return nil, errors.New("parameter subscriptionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionName}", url.PathEscape(subscriptionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, 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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // 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 2025-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - namespaceName - The namespace name // - topicName - The topic name. // - subscriptionName - The subscription name. @@ -217,8 +215,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -235,16 +237,12 @@ func (client *SubscriptionsClient) getCreateRequest(ctx context.Context, resourc return nil, errors.New("parameter subscriptionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionName}", url.PathEscape(subscriptionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -261,8 +259,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 2025-05-01-preview +// - 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 @@ -293,6 +291,10 @@ func (client *SubscriptionsClient) NewListByTopicPager(resourceGroupName string, // listByTopicCreateRequest creates the ListByTopic request. func (client *SubscriptionsClient) listByTopicCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, options *SubscriptionsClientListByTopicOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -305,22 +307,18 @@ func (client *SubscriptionsClient) listByTopicCreateRequest(ctx context.Context, return nil, errors.New("parameter topicName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{topicName}", url.PathEscape(topicName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { 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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicebus/armservicebus/subscriptions_client_example_test.go b/sdk/resourcemanager/servicebus/armservicebus/subscriptions_client_example_test.go index 6158f566838d..33d3e2f875f2 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/subscriptions_client_example_test.go +++ b/sdk/resourcemanager/servicebus/armservicebus/subscriptions_client_example_test.go @@ -1,87 +1,25 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. 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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" + "log" ) -// 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 +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -96,62 +34,69 @@ func ExampleSubscriptionsClient_CreateOrUpdate() { // 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), + // res = armservicebus.SubscriptionsClientCreateOrUpdateResponse{ + // SBSubscription: &armservicebus.SBSubscription{ + // Name: to.Ptr("sdk-Subscriptions-2178"), + // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/Topics/Subscriptions"), + // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/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.5992764Z"); 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.5992764Z"); 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.5992764Z"); return t}()), // }, - // 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 +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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) + res, 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) } + // 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 = armservicebus.SubscriptionsClientDeleteResponse{ + // } } -// 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 +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -162,33 +107,95 @@ func ExampleSubscriptionsClient_Get() { // 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), + // res = armservicebus.SubscriptionsClientGetResponse{ + // SBSubscription: &armservicebus.SBSubscription{ + // Name: to.Ptr("sdk-Subscriptions-2178"), + // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/Topics/Subscriptions"), + // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/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.5992764Z"); 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.5992764Z"); 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.5992764Z"); return t}()), // }, - // 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: 2025-05-01-preview/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("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewSubscriptionsClient().NewListByTopicPager("ResourceGroup", "sdk-Namespace-1349", "sdk-Topics-8740", 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 = armservicebus.SubscriptionsClientListByTopicResponse{ + // SBSubscriptionListResult: armservicebus.SBSubscriptionListResult{ + // Value: []*armservicebus.SBSubscription{ + // { + // Name: to.Ptr("sdk-Subscriptions-2178"), + // Type: to.Ptr("Microsoft.ServiceBus/Namespaces/Topics/Subscriptions"), + // ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/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.5992764Z"); 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.5992764Z"); 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.5992764Z"); return t}()), + // }, + // }, + // }, + // }, + // } + } +} diff --git a/sdk/resourcemanager/servicebus/armservicebus/subscriptions_live_test.go b/sdk/resourcemanager/servicebus/armservicebus/subscriptions_live_test.go index 6c370bb020d7..5e59f1323fc2 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/subscriptions_live_test.go +++ b/sdk/resourcemanager/servicebus/armservicebus/subscriptions_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/servicebus/armservicebus/testdata/_metadata.json b/sdk/resourcemanager/servicebus/armservicebus/testdata/_metadata.json new file mode 100644 index 000000000000..6ea3597b2dfb --- /dev/null +++ b/sdk/resourcemanager/servicebus/armservicebus/testdata/_metadata.json @@ -0,0 +1,6 @@ +{ + "apiVersions": { + "Microsoft.ServiceBus": "2025-05-01-preview" + }, + "emitterVersion": "0.10.2" +} diff --git a/sdk/resourcemanager/servicebus/armservicebus/time_rfc3339.go b/sdk/resourcemanager/servicebus/armservicebus/time_rfc3339.go deleted file mode 100644 index 855f212a3e0e..000000000000 --- a/sdk/resourcemanager/servicebus/armservicebus/time_rfc3339.go +++ /dev/null @@ -1,83 +0,0 @@ -// 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 armservicebus - -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/topics_client.go b/sdk/resourcemanager/servicebus/armservicebus/topics_client.go index 55ddbe242b98..0780484137ee 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/topics_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/topics_client.go @@ -1,7 +1,6 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicebus @@ -26,10 +25,9 @@ type TopicsClient struct { } // NewTopicsClient creates a new instance of TopicsClient with the specified values. -// - subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewTopicsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TopicsClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -45,8 +43,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 2025-05-01-preview +// - 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. @@ -74,8 +72,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -88,18 +90,15 @@ func (client *TopicsClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, errors.New("parameter topicName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{topicName}", url.PathEscape(topicName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, 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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -118,8 +117,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 2025-05-01-preview +// - 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. @@ -149,8 +148,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -167,18 +170,15 @@ func (client *TopicsClient) createOrUpdateAuthorizationRuleCreateRequest(ctx con return nil, errors.New("parameter authorizationRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{authorizationRuleName}", url.PathEscape(authorizationRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, 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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -197,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 2025-05-01-preview +// - 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. @@ -224,8 +224,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -238,26 +242,21 @@ func (client *TopicsClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, errors.New("parameter topicName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{topicName}", url.PathEscape(topicName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, 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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // 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 2025-05-01-preview +// - 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. @@ -285,8 +284,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -303,26 +306,21 @@ func (client *TopicsClient) deleteAuthorizationRuleCreateRequest(ctx context.Con return nil, errors.New("parameter authorizationRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{authorizationRuleName}", url.PathEscape(authorizationRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, 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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // 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 2025-05-01-preview +// - 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. @@ -349,8 +347,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -363,16 +365,12 @@ func (client *TopicsClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, errors.New("parameter topicName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{topicName}", url.PathEscape(topicName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -390,8 +388,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 2025-05-01-preview +// - 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. @@ -420,8 +418,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -438,16 +440,12 @@ func (client *TopicsClient) getAuthorizationRuleCreateRequest(ctx context.Contex return nil, errors.New("parameter authorizationRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{authorizationRuleName}", url.PathEscape(authorizationRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -464,8 +462,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 2025-05-01-preview +// - 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 @@ -494,8 +492,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -508,16 +510,12 @@ func (client *TopicsClient) listAuthorizationRulesCreateRequest(ctx context.Cont return nil, errors.New("parameter topicName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{topicName}", url.PathEscape(topicName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -534,8 +532,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 2025-05-01-preview +// - 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. @@ -565,6 +563,10 @@ func (client *TopicsClient) NewListByNamespacePager(resourceGroupName string, na // listByNamespaceCreateRequest creates the ListByNamespace request. func (client *TopicsClient) listByNamespaceCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, options *TopicsClientListByNamespaceOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -573,22 +575,18 @@ func (client *TopicsClient) listByNamespaceCreateRequest(ctx context.Context, re return nil, errors.New("parameter namespaceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { 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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -606,8 +604,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 2025-05-01-preview +// - 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. @@ -635,8 +633,12 @@ 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) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/ListKeys" +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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -653,16 +655,12 @@ func (client *TopicsClient) listKeysCreateRequest(ctx context.Context, resourceG return nil, errors.New("parameter authorizationRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{authorizationRuleName}", url.PathEscape(authorizationRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -680,8 +678,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 2025-05-01-preview +// - 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. @@ -710,8 +708,12 @@ 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 client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -728,18 +730,15 @@ func (client *TopicsClient) regenerateKeysCreateRequest(ctx context.Context, res return nil, errors.New("parameter authorizationRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{authorizationRuleName}", url.PathEscape(authorizationRuleName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.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", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/servicebus/armservicebus/topics_client_example_test.go b/sdk/resourcemanager/servicebus/armservicebus/topics_client_example_test.go index 0b870356ea46..d450060c9f41 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/topics_client_example_test.go +++ b/sdk/resourcemanager/servicebus/armservicebus/topics_client_example_test.go @@ -1,66 +1,74 @@ // 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. +// Code generated by Microsoft (R) Go Code Generator. 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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" + "log" ) -// 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() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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)}, - // }, - // }}, - // } + 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 = armservicebus.TopicsClientCreateOrUpdateResponse{ + // 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.32Z"); return t}()), + // AutoDeleteOnIdle: to.Ptr("P10675199DT2H48M5.4775807S"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-26T20:50:34.1Z"); 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.32Z"); 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/SBTopicAuthorizationRuleCreate.json +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -68,7 +76,8 @@ func ExampleTopicsClient_CreateOrUpdateAuthorizationRule() { Properties: &armservicebus.SBAuthorizationRuleProperties{ Rights: []*armservicebus.AccessRights{ to.Ptr(armservicebus.AccessRightsListen), - to.Ptr(armservicebus.AccessRightsSend)}, + to.Ptr(armservicebus.AccessRightsSend), + }, }, }, nil) if err != nil { @@ -77,135 +86,155 @@ func ExampleTopicsClient_CreateOrUpdateAuthorizationRule() { // 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)}, + // res = armservicebus.TopicsClientCreateOrUpdateAuthorizationRuleResponse{ + // 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() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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) + res, 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) } // 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)}, - // }, - // } + // res = armservicebus.TopicsClientDeleteResponse{ + // } } -// 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 +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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) + res, 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) } + // 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 = armservicebus.TopicsClientDeleteAuthorizationRuleResponse{ + // } } -// 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() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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) + 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.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("#############################################"), + // res = armservicebus.TopicsClientGetResponse{ + // 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, "0001-01-01T00:00:00Z"); return t}()), + // AutoDeleteOnIdle: to.Ptr("P10675199DT2H48M5.4775807S"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-26T20:50:31.4442694Z"); 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.2092264Z"); 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/SBTopicAuthorizationRuleRegenerateKey.json -func ExampleTopicsClient_RegenerateKeys() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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) + 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.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("#############################################"), + // res = armservicebus.TopicsClientGetAuthorizationRuleResponse{ + // 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/SBTopicListByNameSpace.json -func ExampleTopicsClient_NewListByNamespacePager() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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, - }) + pager := clientFactory.NewTopicsClient().NewListAuthorizationRulesPager("ArunMonocle", "sdk-Namespace-6261", "sdk-Topics-1984", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -216,138 +245,136 @@ func ExampleTopicsClient_NewListByNamespacePager() { _ = 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}()), + // page = armservicebus.TopicsClientListAuthorizationRulesResponse{ + // 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/SBTopicCreate.json -func ExampleTopicsClient_CreateOrUpdate() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("5f750a97-50d9-4e36-8081-c9ee4c0210d4", 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) + pager := clientFactory.NewTopicsClient().NewListByNamespacePager("Default-ServiceBus-WestUS", "sdk-Namespace-1617", 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 = armservicebus.TopicsClientListByNamespaceResponse{ + // 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, "0001-01-01T00:00:00Z"); return t}()), + // AutoDeleteOnIdle: to.Ptr("P10675199DT2H48M5.4775807S"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-26T20:50:31.4442694Z"); 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.2092264Z"); return t}()), + // }, + // }, + // }, + // }, + // } } - // 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() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("e2f361f0-3b27-4503-a9cc-21cfba380093", 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) + 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 = armservicebus.TopicsClientListKeysResponse{ + // 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/SBTopicGet.json -func ExampleTopicsClient_Get() { +// Generated from example definition: 2025-05-01-preview/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) + clientFactory, err := armservicebus.NewClientFactory("e2f361f0-3b27-4503-a9cc-21cfba380093", 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) + 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.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}()), + // res = armservicebus.TopicsClientRegenerateKeysResponse{ + // 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("#############################################"), // }, // } } diff --git a/sdk/resourcemanager/servicebus/armservicebus/topics_live_test.go b/sdk/resourcemanager/servicebus/armservicebus/topics_live_test.go index c991043b86c8..cd5340ffbae3 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/topics_live_test.go +++ b/sdk/resourcemanager/servicebus/armservicebus/topics_live_test.go @@ -13,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/servicebus/armservicebus/tsp-location.yaml b/sdk/resourcemanager/servicebus/armservicebus/tsp-location.yaml new file mode 100644 index 000000000000..3d60e15caf79 --- /dev/null +++ b/sdk/resourcemanager/servicebus/armservicebus/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/servicebus/resource-manager/Microsoft.ServiceBus/ServiceBus +commit: aa822c9c01b9e83fbc8ad8ec4c308203a3c29287 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/resourcemanager/servicebus/armservicebus/version.go b/sdk/resourcemanager/servicebus/armservicebus/version.go new file mode 100644 index 000000000000..beca724222ad --- /dev/null +++ b/sdk/resourcemanager/servicebus/armservicebus/version.go @@ -0,0 +1,10 @@ +// 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) Go Code Generator. + +package armservicebus + +const ( + moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" + moduleVersion = "v2.0.0-beta.4" +)