diff --git a/sdk/resourcemanager/notificationhubs/armnotificationhubs/CHANGELOG.md b/sdk/resourcemanager/notificationhubs/armnotificationhubs/CHANGELOG.md index fbe9e32cd490..eb2a6e209ee8 100644 --- a/sdk/resourcemanager/notificationhubs/armnotificationhubs/CHANGELOG.md +++ b/sdk/resourcemanager/notificationhubs/armnotificationhubs/CHANGELOG.md @@ -1,5 +1,111 @@ # Release History +## 2.0.0-beta.1 (2023-07-01) +### Breaking Changes + +- Function `*Client.CreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, string, NotificationHubCreateOrUpdateParameters, *ClientCreateOrUpdateOptions)` to `(context.Context, string, string, string, NotificationHubResource, *ClientCreateOrUpdateOptions)` +- Function `*Client.CreateOrUpdateAuthorizationRule` parameter(s) have been changed from `(context.Context, string, string, string, string, SharedAccessAuthorizationRuleCreateOrUpdateParameters, *ClientCreateOrUpdateAuthorizationRuleOptions)` to `(context.Context, string, string, string, string, SharedAccessAuthorizationRuleResource, *ClientCreateOrUpdateAuthorizationRuleOptions)` +- Function `*Client.RegenerateKeys` parameter(s) have been changed from `(context.Context, string, string, string, string, PolicykeyResource, *ClientRegenerateKeysOptions)` to `(context.Context, string, string, string, string, PolicyKeyResource, *ClientRegenerateKeysOptions)` +- Function `*NamespacesClient.CreateOrUpdateAuthorizationRule` parameter(s) have been changed from `(context.Context, string, string, string, SharedAccessAuthorizationRuleCreateOrUpdateParameters, *NamespacesClientCreateOrUpdateAuthorizationRuleOptions)` to `(context.Context, string, string, string, SharedAccessAuthorizationRuleResource, *NamespacesClientCreateOrUpdateAuthorizationRuleOptions)` +- Function `*NamespacesClient.RegenerateKeys` parameter(s) have been changed from `(context.Context, string, string, string, PolicykeyResource, *NamespacesClientRegenerateKeysOptions)` to `(context.Context, string, string, string, PolicyKeyResource, *NamespacesClientRegenerateKeysOptions)` +- Type of `DebugSendResult.Failure` has been changed from `*float32` to `*int64` +- Type of `DebugSendResult.Results` has been changed from `any` to `[]*RegistrationResult` +- Type of `DebugSendResult.Success` has been changed from `*float32` to `*int64` +- Type of `NamespaceProperties.ProvisioningState` has been changed from `*string` to `*OperationProvisioningState` +- Type of `NamespaceProperties.Status` has been changed from `*string` to `*NamespaceStatus` +- Type of `PnsCredentialsResource.Properties` has been changed from `*PnsCredentialsProperties` to `*PnsCredentials` +- Type of `SharedAccessAuthorizationRuleProperties.CreatedTime` has been changed from `*string` to `*time.Time` +- Type of `SharedAccessAuthorizationRuleProperties.ModifiedTime` has been changed from `*string` to `*time.Time` +- Function `*Client.Patch` has been removed +- Function `*NamespacesClient.Patch` has been removed +- Operation `*NamespacesClient.CreateOrUpdate` has been changed to LRO, use `*NamespacesClient.BeginCreateOrUpdate` instead. +- Operation `*NamespacesClient.BeginDelete` has been changed to non-LRO, use `*NamespacesClient.Delete` instead. +- Struct `NamespaceCreateOrUpdateParameters` has been removed +- Struct `NotificationHubCreateOrUpdateParameters` has been removed +- Struct `PnsCredentialsProperties` has been removed +- Struct `PolicykeyResource` has been removed +- Struct `SharedAccessAuthorizationRuleCreateOrUpdateParameters` has been removed +- Struct `SubResource` has been removed +- Field `Parameters` of struct `ClientDebugSendOptions` has been removed +- Field `SKU` of struct `DebugSendResponse` has been removed +- Field `Code`, `Message` of struct `ErrorResponse` has been removed +- Field `ID`, `Location`, `Name`, `Type` of struct `NotificationHubPatchParameters` has been removed +- Field `SKU` of struct `PnsCredentialsResource` has been removed +- Field `Location`, `SKU`, `Tags` of struct `Resource` has been removed +- Field `SKU` of struct `SharedAccessAuthorizationRuleResource` has been removed + +### Features Added + +- New enum type `CreatedByType` with values `CreatedByTypeApplication`, `CreatedByTypeKey`, `CreatedByTypeManagedIdentity`, `CreatedByTypeUser` +- New enum type `NamespaceStatus` with values `NamespaceStatusCreated`, `NamespaceStatusCreating`, `NamespaceStatusDeleting`, `NamespaceStatusSuspended` +- New enum type `OperationProvisioningState` with values `OperationProvisioningStateCanceled`, `OperationProvisioningStateDisabled`, `OperationProvisioningStateFailed`, `OperationProvisioningStateInProgress`, `OperationProvisioningStatePending`, `OperationProvisioningStateSucceeded`, `OperationProvisioningStateUnknown` +- New enum type `PolicyKeyType` with values `PolicyKeyTypePrimaryKey`, `PolicyKeyTypeSecondaryKey` +- New enum type `PrivateEndpointConnectionProvisioningState` with values `PrivateEndpointConnectionProvisioningStateCreating`, `PrivateEndpointConnectionProvisioningStateDeleted`, `PrivateEndpointConnectionProvisioningStateDeleting`, `PrivateEndpointConnectionProvisioningStateDeletingByProxy`, `PrivateEndpointConnectionProvisioningStateSucceeded`, `PrivateEndpointConnectionProvisioningStateUnknown`, `PrivateEndpointConnectionProvisioningStateUpdating`, `PrivateEndpointConnectionProvisioningStateUpdatingByProxy` +- New enum type `PrivateLinkConnectionStatus` with values `PrivateLinkConnectionStatusApproved`, `PrivateLinkConnectionStatusDisconnected`, `PrivateLinkConnectionStatusPending`, `PrivateLinkConnectionStatusRejected` +- New enum type `PublicNetworkAccess` with values `PublicNetworkAccessDisabled`, `PublicNetworkAccessEnabled` +- New enum type `ReplicationRegion` with values `ReplicationRegionAustraliaEast`, `ReplicationRegionBrazilSouth`, `ReplicationRegionDefault`, `ReplicationRegionNone`, `ReplicationRegionNorthEurope`, `ReplicationRegionSouthAfricaNorth`, `ReplicationRegionSouthEastAsia`, `ReplicationRegionWestUs2` +- New enum type `ZoneRedundancyPreference` with values `ZoneRedundancyPreferenceDisabled`, `ZoneRedundancyPreferenceEnabled` +- New function `*Client.Update(context.Context, string, string, string, NotificationHubPatchParameters, *ClientUpdateOptions) (ClientUpdateResponse, error)` +- New function `*ClientFactory.NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient` +- New function `NewPrivateEndpointConnectionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error)` +- New function `*PrivateEndpointConnectionsClient.BeginDelete(context.Context, string, string, string, *PrivateEndpointConnectionsClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error)` +- New function `*PrivateEndpointConnectionsClient.Get(context.Context, string, string, string, *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error)` +- New function `*PrivateEndpointConnectionsClient.GetGroupID(context.Context, string, string, string, *PrivateEndpointConnectionsClientGetGroupIDOptions) (PrivateEndpointConnectionsClientGetGroupIDResponse, error)` +- New function `*PrivateEndpointConnectionsClient.NewListGroupIDsPager(string, string, *PrivateEndpointConnectionsClientListGroupIDsOptions) *runtime.Pager[PrivateEndpointConnectionsClientListGroupIDsResponse]` +- New function `*PrivateEndpointConnectionsClient.NewListPager(string, string, *PrivateEndpointConnectionsClientListOptions) *runtime.Pager[PrivateEndpointConnectionsClientListResponse]` +- New function `*PrivateEndpointConnectionsClient.BeginUpdate(context.Context, string, string, string, PrivateEndpointConnectionResource, *PrivateEndpointConnectionsClientBeginUpdateOptions) (*runtime.Poller[PrivateEndpointConnectionsClientUpdateResponse], error)` +- New function `*NamespacesClient.GetPnsCredentials(context.Context, string, string, *NamespacesClientGetPnsCredentialsOptions) (NamespacesClientGetPnsCredentialsResponse, error)` +- New function `*NamespacesClient.Update(context.Context, string, string, NamespacePatchParameters, *NamespacesClientUpdateOptions) (NamespacesClientUpdateResponse, error)` +- New struct `Availability` +- New struct `BrowserCredential` +- New struct `BrowserCredentialProperties` +- New struct `ConnectionDetails` +- New struct `ErrorAdditionalInfo` +- New struct `ErrorDetail` +- New struct `GroupConnectivityInformation` +- New struct `IPRule` +- New struct `LogSpecification` +- New struct `MetricSpecification` +- New struct `NetworkACLs` +- New struct `OperationProperties` +- New struct `PnsCredentials` +- New struct `PolicyKeyResource` +- New struct `PrivateEndpointConnectionProperties` +- New struct `PrivateEndpointConnectionResource` +- New struct `PrivateEndpointConnectionResourceListResult` +- New struct `PrivateLinkResource` +- New struct `PrivateLinkResourceListResult` +- New struct `PrivateLinkResourceProperties` +- New struct `PrivateLinkServiceConnection` +- New struct `ProxyResource` +- New struct `PublicInternetAuthorizationRule` +- New struct `RegistrationResult` +- New struct `RemotePrivateEndpointConnection` +- New struct `RemotePrivateLinkServiceConnectionState` +- New struct `ServiceSpecification` +- New struct `SystemData` +- New struct `TrackedResource` +- New struct `XiaomiCredential` +- New struct `XiaomiCredentialProperties` +- New field `SystemData` in struct `CheckAvailabilityResult` +- New field `SkipToken`, `Top` in struct `ClientListOptions` +- New field `SystemData` in struct `DebugSendResponse` +- New field `Error` in struct `ErrorResponse` +- New field `Properties` in struct `NamespacePatchParameters` +- New field `NetworkACLs`, `PnsCredentials`, `PrivateEndpointConnections`, `PublicNetworkAccess`, `ReplicationRegion`, `ZoneRedundancy` in struct `NamespaceProperties` +- New field `SystemData` in struct `NamespaceResource` +- New field `SkipToken`, `Top` in struct `NamespacesClientListAllOptions` +- New field `SkipToken`, `Top` in struct `NamespacesClientListOptions` +- New field `BrowserCredential`, `DailyMaxActiveDevices`, `XiaomiCredential` in struct `NotificationHubProperties` +- New field `SystemData` in struct `NotificationHubResource` +- New field `IsDataAction`, `Properties` in struct `Operation` +- New field `Description` in struct `OperationDisplay` +- New field `SystemData` in struct `PnsCredentialsResource` +- New field `SystemData` in struct `Resource` +- New field `SystemData` in struct `SharedAccessAuthorizationRuleResource` +- New field `CertificateKey`, `WnsCertificate` in struct `WnsCredentialProperties` + + ## 1.1.1 (2023-04-14) ### Bug Fixes diff --git a/sdk/resourcemanager/notificationhubs/armnotificationhubs/autorest.md b/sdk/resourcemanager/notificationhubs/armnotificationhubs/autorest.md index 35d157573905..82661ad62ed0 100644 --- a/sdk/resourcemanager/notificationhubs/armnotificationhubs/autorest.md +++ b/sdk/resourcemanager/notificationhubs/armnotificationhubs/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/notificationhubs/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/notificationhubs/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/notificationhubs/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/notificationhubs/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.1.1 +module-version: 2.0.0-beta.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/notificationhubs/armnotificationhubs/client.go b/sdk/resourcemanager/notificationhubs/armnotificationhubs/client.go index 8878c3d7b4bd..45fba6af6c0d 100644 --- a/sdk/resourcemanager/notificationhubs/armnotificationhubs/client.go +++ b/sdk/resourcemanager/notificationhubs/armnotificationhubs/client.go @@ -18,6 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" + "strconv" "strings" ) @@ -29,8 +30,7 @@ type Client struct { } // NewClient creates a new instance of Client with the specified values. -// - subscriptionID - Gets subscription credentials which uniquely identify 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 NewClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*Client, error) { @@ -48,10 +48,10 @@ func NewClient(subscriptionID string, credential azcore.TokenCredential, options // CheckNotificationHubAvailability - Checks the availability of the given notificationHub in a namespace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-04-01 -// - resourceGroupName - The name of the resource group. -// - namespaceName - The namespace name. -// - parameters - The notificationHub name. +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name +// - parameters - Request content. // - options - ClientCheckNotificationHubAvailabilityOptions contains the optional parameters for the Client.CheckNotificationHubAvailability // method. func (client *Client) CheckNotificationHubAvailability(ctx context.Context, resourceGroupName string, namespaceName string, parameters CheckAvailabilityParameters, options *ClientCheckNotificationHubAvailabilityOptions) (ClientCheckNotificationHubAvailabilityResponse, error) { @@ -72,6 +72,7 @@ func (client *Client) CheckNotificationHubAvailability(ctx context.Context, reso // checkNotificationHubAvailabilityCreateRequest creates the CheckNotificationHubAvailability request. func (client *Client) checkNotificationHubAvailabilityCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, parameters CheckAvailabilityParameters, options *ClientCheckNotificationHubAvailabilityOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/checkNotificationHubAvailability" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -80,16 +81,12 @@ func (client *Client) checkNotificationHubAvailabilityCreateRequest(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.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -107,13 +104,13 @@ func (client *Client) checkNotificationHubAvailabilityHandleResponse(resp *http. // CreateOrUpdate - Creates/Update a NotificationHub in a namespace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-04-01 -// - resourceGroupName - The name of the resource group. -// - namespaceName - The namespace name. -// - notificationHubName - The notification hub name. -// - parameters - Parameters supplied to the create/update a NotificationHub Resource. +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name +// - notificationHubName - Notification Hub name +// - parameters - Request content. // - options - ClientCreateOrUpdateOptions contains the optional parameters for the Client.CreateOrUpdate method. -func (client *Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, parameters NotificationHubCreateOrUpdateParameters, options *ClientCreateOrUpdateOptions) (ClientCreateOrUpdateResponse, error) { +func (client *Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, parameters NotificationHubResource, options *ClientCreateOrUpdateOptions) (ClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, namespaceName, notificationHubName, parameters, options) if err != nil { return ClientCreateOrUpdateResponse{}, err @@ -129,8 +126,9 @@ func (client *Client) CreateOrUpdate(ctx context.Context, resourceGroupName stri } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *Client) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, parameters NotificationHubCreateOrUpdateParameters, options *ClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *Client) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, parameters NotificationHubResource, options *ClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -143,16 +141,12 @@ func (client *Client) createOrUpdateCreateRequest(ctx context.Context, resourceG return nil, errors.New("parameter notificationHubName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{notificationHubName}", url.PathEscape(notificationHubName)) - 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", "2017-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -170,15 +164,15 @@ func (client *Client) createOrUpdateHandleResponse(resp *http.Response) (ClientC // CreateOrUpdateAuthorizationRule - Creates/Updates an authorization rule for a NotificationHub // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-04-01 -// - resourceGroupName - The name of the resource group. -// - namespaceName - The namespace name. -// - notificationHubName - The notification hub name. -// - authorizationRuleName - Authorization Rule Name. -// - parameters - The shared access authorization rule. +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name +// - notificationHubName - Notification Hub name +// - authorizationRuleName - Authorization Rule Name +// - parameters - Request content. // - options - ClientCreateOrUpdateAuthorizationRuleOptions contains the optional parameters for the Client.CreateOrUpdateAuthorizationRule // method. -func (client *Client) CreateOrUpdateAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string, parameters SharedAccessAuthorizationRuleCreateOrUpdateParameters, options *ClientCreateOrUpdateAuthorizationRuleOptions) (ClientCreateOrUpdateAuthorizationRuleResponse, error) { +func (client *Client) CreateOrUpdateAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string, parameters SharedAccessAuthorizationRuleResource, options *ClientCreateOrUpdateAuthorizationRuleOptions) (ClientCreateOrUpdateAuthorizationRuleResponse, error) { req, err := client.createOrUpdateAuthorizationRuleCreateRequest(ctx, resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters, options) if err != nil { return ClientCreateOrUpdateAuthorizationRuleResponse{}, err @@ -187,15 +181,16 @@ func (client *Client) CreateOrUpdateAuthorizationRule(ctx context.Context, resou if err != nil { return ClientCreateOrUpdateAuthorizationRuleResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { return ClientCreateOrUpdateAuthorizationRuleResponse{}, runtime.NewResponseError(resp) } return client.createOrUpdateAuthorizationRuleHandleResponse(resp) } // createOrUpdateAuthorizationRuleCreateRequest creates the CreateOrUpdateAuthorizationRule request. -func (client *Client) createOrUpdateAuthorizationRuleCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string, parameters SharedAccessAuthorizationRuleCreateOrUpdateParameters, options *ClientCreateOrUpdateAuthorizationRuleOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}" +func (client *Client) createOrUpdateAuthorizationRuleCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string, parameters SharedAccessAuthorizationRuleResource, options *ClientCreateOrUpdateAuthorizationRuleOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/authorizationRules/{authorizationRuleName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -212,16 +207,12 @@ func (client *Client) createOrUpdateAuthorizationRuleCreateRequest(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.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -236,13 +227,13 @@ func (client *Client) createOrUpdateAuthorizationRuleHandleResponse(resp *http.R return result, nil } -// DebugSend - test send a push notification +// DebugSend - Test send a push notification. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-04-01 -// - resourceGroupName - The name of the resource group. -// - namespaceName - The namespace name. -// - notificationHubName - The notification hub name. +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name +// - notificationHubName - Notification Hub name // - options - ClientDebugSendOptions contains the optional parameters for the Client.DebugSend method. func (client *Client) DebugSend(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, options *ClientDebugSendOptions) (ClientDebugSendResponse, error) { req, err := client.debugSendCreateRequest(ctx, resourceGroupName, namespaceName, notificationHubName, options) @@ -253,7 +244,7 @@ func (client *Client) DebugSend(ctx context.Context, resourceGroupName string, n if err != nil { return ClientDebugSendResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusCreated) { + if !runtime.HasStatusCode(resp, http.StatusOK) { return ClientDebugSendResponse{}, runtime.NewResponseError(resp) } return client.debugSendHandleResponse(resp) @@ -262,6 +253,7 @@ func (client *Client) DebugSend(ctx context.Context, resourceGroupName string, n // debugSendCreateRequest creates the DebugSend request. func (client *Client) debugSendCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, options *ClientDebugSendOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/debugsend" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -274,21 +266,14 @@ func (client *Client) debugSendCreateRequest(ctx context.Context, resourceGroupN return nil, errors.New("parameter notificationHubName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{notificationHubName}", url.PathEscape(notificationHubName)) - 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", "2017-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - return req, runtime.MarshalAsJSON(req, options.Parameters) - } return req, nil } @@ -304,10 +289,10 @@ func (client *Client) debugSendHandleResponse(resp *http.Response) (ClientDebugS // Delete - Deletes a notification hub associated with a namespace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-04-01 -// - resourceGroupName - The name of the resource group. -// - namespaceName - The namespace name. -// - notificationHubName - The notification hub name. +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name +// - notificationHubName - Notification Hub name // - options - ClientDeleteOptions contains the optional parameters for the Client.Delete method. func (client *Client) Delete(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, options *ClientDeleteOptions) (ClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, namespaceName, notificationHubName, options) @@ -318,7 +303,7 @@ func (client *Client) Delete(ctx context.Context, resourceGroupName string, name if err != nil { return ClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return ClientDeleteResponse{}, runtime.NewResponseError(resp) } return ClientDeleteResponse{}, nil @@ -327,6 +312,7 @@ func (client *Client) Delete(ctx context.Context, resourceGroupName string, name // deleteCreateRequest creates the Delete request. func (client *Client) deleteCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, options *ClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -339,28 +325,25 @@ func (client *Client) deleteCreateRequest(ctx context.Context, resourceGroupName return nil, errors.New("parameter notificationHubName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{notificationHubName}", url.PathEscape(notificationHubName)) - 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", "2017-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // DeleteAuthorizationRule - Deletes a notificationHub authorization rule // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-04-01 -// - resourceGroupName - The name of the resource group. -// - namespaceName - The namespace name. -// - notificationHubName - The notification hub name. -// - authorizationRuleName - Authorization Rule Name. +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name +// - notificationHubName - Notification Hub name +// - authorizationRuleName - Authorization Rule Name // - options - ClientDeleteAuthorizationRuleOptions contains the optional parameters for the Client.DeleteAuthorizationRule // method. func (client *Client) DeleteAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string, options *ClientDeleteAuthorizationRuleOptions) (ClientDeleteAuthorizationRuleResponse, error) { @@ -380,7 +363,8 @@ func (client *Client) DeleteAuthorizationRule(ctx context.Context, resourceGroup // deleteAuthorizationRuleCreateRequest creates the DeleteAuthorizationRule request. func (client *Client) deleteAuthorizationRuleCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string, options *ClientDeleteAuthorizationRuleOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}" + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/authorizationRules/{authorizationRuleName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -397,27 +381,24 @@ func (client *Client) deleteAuthorizationRuleCreateRequest(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.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Lists the notification hubs associated with a namespace. +// Get - Gets the notification hub. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-04-01 -// - resourceGroupName - The name of the resource group. -// - namespaceName - The namespace name. -// - notificationHubName - The notification hub name. +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name +// - notificationHubName - Notification Hub name // - options - ClientGetOptions contains the optional parameters for the Client.Get method. func (client *Client) Get(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, options *ClientGetOptions) (ClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, namespaceName, notificationHubName, options) @@ -437,6 +418,7 @@ func (client *Client) Get(ctx context.Context, resourceGroupName string, namespa // getCreateRequest creates the Get request. func (client *Client) getCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, options *ClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -449,16 +431,12 @@ func (client *Client) getCreateRequest(ctx context.Context, resourceGroupName st return nil, errors.New("parameter notificationHubName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{notificationHubName}", url.PathEscape(notificationHubName)) - 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", "2017-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -476,11 +454,11 @@ func (client *Client) getHandleResponse(resp *http.Response) (ClientGetResponse, // GetAuthorizationRule - Gets an authorization rule for a NotificationHub by name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-04-01 -// - resourceGroupName - The name of the resource group. -// - namespaceName - The namespace name -// - notificationHubName - The notification hub name. -// - authorizationRuleName - authorization rule name. +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name +// - notificationHubName - Notification Hub name +// - authorizationRuleName - Authorization Rule Name // - options - ClientGetAuthorizationRuleOptions contains the optional parameters for the Client.GetAuthorizationRule method. func (client *Client) GetAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string, options *ClientGetAuthorizationRuleOptions) (ClientGetAuthorizationRuleResponse, error) { req, err := client.getAuthorizationRuleCreateRequest(ctx, resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, options) @@ -499,7 +477,8 @@ func (client *Client) GetAuthorizationRule(ctx context.Context, resourceGroupNam // getAuthorizationRuleCreateRequest creates the GetAuthorizationRule request. func (client *Client) getAuthorizationRuleCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string, options *ClientGetAuthorizationRuleOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}" + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/authorizationRules/{authorizationRuleName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -516,16 +495,12 @@ func (client *Client) getAuthorizationRuleCreateRequest(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.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -540,13 +515,13 @@ func (client *Client) getAuthorizationRuleHandleResponse(resp *http.Response) (C return result, nil } -// GetPnsCredentials - Lists the PNS Credentials associated with a notification hub . +// GetPnsCredentials - Lists the PNS Credentials associated with a notification hub. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-04-01 -// - resourceGroupName - The name of the resource group. -// - namespaceName - The namespace name. -// - notificationHubName - The notification hub name. +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name +// - notificationHubName - Notification Hub name // - options - ClientGetPnsCredentialsOptions contains the optional parameters for the Client.GetPnsCredentials method. func (client *Client) GetPnsCredentials(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, options *ClientGetPnsCredentialsOptions) (ClientGetPnsCredentialsResponse, error) { req, err := client.getPnsCredentialsCreateRequest(ctx, resourceGroupName, namespaceName, notificationHubName, options) @@ -566,6 +541,7 @@ func (client *Client) GetPnsCredentials(ctx context.Context, resourceGroupName s // getPnsCredentialsCreateRequest creates the GetPnsCredentials request. func (client *Client) getPnsCredentialsCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, options *ClientGetPnsCredentialsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/pnsCredentials" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -578,16 +554,12 @@ func (client *Client) getPnsCredentialsCreateRequest(ctx context.Context, resour return nil, errors.New("parameter notificationHubName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{notificationHubName}", url.PathEscape(notificationHubName)) - 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", "2017-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -604,9 +576,9 @@ func (client *Client) getPnsCredentialsHandleResponse(resp *http.Response) (Clie // NewListPager - Lists the notification hubs associated with a namespace. // -// Generated from API version 2017-04-01 -// - resourceGroupName - The name of the resource group. -// - namespaceName - The namespace name. +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name // - options - ClientListOptions contains the optional parameters for the Client.NewListPager method. func (client *Client) NewListPager(resourceGroupName string, namespaceName string, options *ClientListOptions) *runtime.Pager[ClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ClientListResponse]{ @@ -639,6 +611,7 @@ func (client *Client) NewListPager(resourceGroupName string, namespaceName strin // listCreateRequest creates the List request. func (client *Client) listCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, options *ClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -647,16 +620,18 @@ func (client *Client) listCreateRequest(ctx context.Context, resourceGroupName s 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", "2017-04-01") + if options != nil && options.SkipToken != nil { + reqQP.Set("$skipToken", *options.SkipToken) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -673,10 +648,10 @@ func (client *Client) listHandleResponse(resp *http.Response) (ClientListRespons // NewListAuthorizationRulesPager - Gets the authorization rules for a NotificationHub. // -// Generated from API version 2017-04-01 -// - resourceGroupName - The name of the resource group. -// - namespaceName - The namespace name -// - notificationHubName - The notification hub name. +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name +// - notificationHubName - Notification Hub name // - options - ClientListAuthorizationRulesOptions contains the optional parameters for the Client.NewListAuthorizationRulesPager // method. func (client *Client) NewListAuthorizationRulesPager(resourceGroupName string, namespaceName string, notificationHubName string, options *ClientListAuthorizationRulesOptions) *runtime.Pager[ClientListAuthorizationRulesResponse] { @@ -709,7 +684,8 @@ func (client *Client) NewListAuthorizationRulesPager(resourceGroupName string, n // listAuthorizationRulesCreateRequest creates the ListAuthorizationRules request. func (client *Client) listAuthorizationRulesCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, options *ClientListAuthorizationRulesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules" + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/authorizationRules" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -722,16 +698,12 @@ func (client *Client) listAuthorizationRulesCreateRequest(ctx context.Context, r return nil, errors.New("parameter notificationHubName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{notificationHubName}", url.PathEscape(notificationHubName)) - 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", "2017-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -749,11 +721,11 @@ func (client *Client) listAuthorizationRulesHandleResponse(resp *http.Response) // ListKeys - Gets the Primary and Secondary ConnectionStrings to the NotificationHub // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-04-01 -// - resourceGroupName - The name of the resource group. -// - namespaceName - The namespace name. -// - notificationHubName - The notification hub name. -// - authorizationRuleName - The connection string of the NotificationHub for the specified authorizationRule. +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name +// - notificationHubName - Notification Hub name +// - authorizationRuleName - Authorization Rule Name // - options - ClientListKeysOptions contains the optional parameters for the Client.ListKeys method. func (client *Client) ListKeys(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string, options *ClientListKeysOptions) (ClientListKeysResponse, error) { req, err := client.listKeysCreateRequest(ctx, resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, options) @@ -772,7 +744,8 @@ func (client *Client) ListKeys(ctx context.Context, resourceGroupName string, na // listKeysCreateRequest creates the ListKeys request. func (client *Client) listKeysCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string, options *ClientListKeysOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}/listKeys" + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/authorizationRules/{authorizationRuleName}/listKeys" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -789,16 +762,12 @@ func (client *Client) listKeysCreateRequest(ctx context.Context, resourceGroupNa 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", "2017-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -813,32 +782,35 @@ func (client *Client) listKeysHandleResponse(resp *http.Response) (ClientListKey return result, nil } -// Patch - Patch a NotificationHub in a namespace. +// RegenerateKeys - Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-04-01 -// - resourceGroupName - The name of the resource group. -// - namespaceName - The namespace name. -// - notificationHubName - The notification hub name. -// - options - ClientPatchOptions contains the optional parameters for the Client.Patch method. -func (client *Client) Patch(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, options *ClientPatchOptions) (ClientPatchResponse, error) { - req, err := client.patchCreateRequest(ctx, resourceGroupName, namespaceName, notificationHubName, options) +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name +// - notificationHubName - Notification Hub name +// - authorizationRuleName - Authorization Rule Name +// - parameters - Request content. +// - options - ClientRegenerateKeysOptions contains the optional parameters for the Client.RegenerateKeys method. +func (client *Client) RegenerateKeys(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string, parameters PolicyKeyResource, options *ClientRegenerateKeysOptions) (ClientRegenerateKeysResponse, error) { + req, err := client.regenerateKeysCreateRequest(ctx, resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters, options) if err != nil { - return ClientPatchResponse{}, err + return ClientRegenerateKeysResponse{}, err } resp, err := client.internal.Pipeline().Do(req) if err != nil { - return ClientPatchResponse{}, err + return ClientRegenerateKeysResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return ClientPatchResponse{}, runtime.NewResponseError(resp) + return ClientRegenerateKeysResponse{}, runtime.NewResponseError(resp) } - return client.patchHandleResponse(resp) + return client.regenerateKeysHandleResponse(resp) } -// patchCreateRequest creates the Patch request. -func (client *Client) patchCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, options *ClientPatchOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}" +// regenerateKeysCreateRequest creates the RegenerateKeys request. +func (client *Client) regenerateKeysCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string, parameters PolicyKeyResource, options *ClientRegenerateKeysOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/authorizationRules/{authorizationRuleName}/regenerateKeys" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -851,61 +823,58 @@ func (client *Client) patchCreateRequest(ctx context.Context, resourceGroupName return nil, errors.New("parameter notificationHubName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{notificationHubName}", url.PathEscape(notificationHubName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") + if authorizationRuleName == "" { + return nil, errors.New("parameter authorizationRuleName 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)) + urlPath = strings.ReplaceAll(urlPath, "{authorizationRuleName}", url.PathEscape(authorizationRuleName)) + 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", "2017-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - return req, runtime.MarshalAsJSON(req, *options.Parameters) - } - return req, nil + return req, runtime.MarshalAsJSON(req, parameters) } -// patchHandleResponse handles the Patch response. -func (client *Client) patchHandleResponse(resp *http.Response) (ClientPatchResponse, error) { - result := ClientPatchResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.NotificationHubResource); err != nil { - return ClientPatchResponse{}, err +// regenerateKeysHandleResponse handles the RegenerateKeys response. +func (client *Client) regenerateKeysHandleResponse(resp *http.Response) (ClientRegenerateKeysResponse, error) { + result := ClientRegenerateKeysResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ResourceListKeys); err != nil { + return ClientRegenerateKeysResponse{}, err } return result, nil } -// RegenerateKeys - Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule +// Update - Patch a NotificationHub in a namespace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-04-01 -// - resourceGroupName - The name of the resource group. -// - namespaceName - The namespace name. -// - notificationHubName - The notification hub name. -// - authorizationRuleName - The connection string of the NotificationHub for the specified authorizationRule. -// - parameters - Parameters supplied to regenerate the NotificationHub Authorization Rule Key. -// - options - ClientRegenerateKeysOptions contains the optional parameters for the Client.RegenerateKeys method. -func (client *Client) RegenerateKeys(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string, parameters PolicykeyResource, options *ClientRegenerateKeysOptions) (ClientRegenerateKeysResponse, error) { - req, err := client.regenerateKeysCreateRequest(ctx, resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters, options) +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name +// - notificationHubName - Notification Hub name +// - parameters - Request content. +// - options - ClientUpdateOptions contains the optional parameters for the Client.Update method. +func (client *Client) Update(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, parameters NotificationHubPatchParameters, options *ClientUpdateOptions) (ClientUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, namespaceName, notificationHubName, parameters, options) if err != nil { - return ClientRegenerateKeysResponse{}, err + return ClientUpdateResponse{}, err } resp, err := client.internal.Pipeline().Do(req) if err != nil { - return ClientRegenerateKeysResponse{}, err + return ClientUpdateResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return ClientRegenerateKeysResponse{}, runtime.NewResponseError(resp) + return ClientUpdateResponse{}, runtime.NewResponseError(resp) } - return client.regenerateKeysHandleResponse(resp) + return client.updateHandleResponse(resp) } -// regenerateKeysCreateRequest creates the RegenerateKeys request. -func (client *Client) regenerateKeysCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string, parameters PolicykeyResource, options *ClientRegenerateKeysOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys" +// updateCreateRequest creates the Update request. +func (client *Client) updateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, parameters NotificationHubPatchParameters, options *ClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -918,30 +887,22 @@ func (client *Client) regenerateKeysCreateRequest(ctx context.Context, resourceG return nil, errors.New("parameter notificationHubName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{notificationHubName}", url.PathEscape(notificationHubName)) - if authorizationRuleName == "" { - 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)) + 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", "2017-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } -// regenerateKeysHandleResponse handles the RegenerateKeys response. -func (client *Client) regenerateKeysHandleResponse(resp *http.Response) (ClientRegenerateKeysResponse, error) { - result := ClientRegenerateKeysResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ResourceListKeys); err != nil { - return ClientRegenerateKeysResponse{}, err +// updateHandleResponse handles the Update response. +func (client *Client) updateHandleResponse(resp *http.Response) (ClientUpdateResponse, error) { + result := ClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NotificationHubResource); err != nil { + return ClientUpdateResponse{}, err } return result, nil } diff --git a/sdk/resourcemanager/notificationhubs/armnotificationhubs/client_example_test.go b/sdk/resourcemanager/notificationhubs/armnotificationhubs/client_example_test.go deleted file mode 100644 index d4404623f127..000000000000 --- a/sdk/resourcemanager/notificationhubs/armnotificationhubs/client_example_test.go +++ /dev/null @@ -1,473 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnotificationhubs_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/notificationhubs/armnotificationhubs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubCheckNameAvailability.json -func ExampleClient_CheckNotificationHubAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnotificationhubs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().CheckNotificationHubAvailability(ctx, "5ktrial", "locp-newns", armnotificationhubs.CheckAvailabilityParameters{ - Name: to.Ptr("sdktest"), - Location: to.Ptr("West Europe"), - }, 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.CheckAvailabilityResult = armnotificationhubs.CheckAvailabilityResult{ - // Name: to.Ptr("sdktest"), - // Type: to.Ptr("Microsoft.NotificationHubs/namespaces/notificationHubs/checkNotificationHubAvailability"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourcegroups/5ktrial/providers/Microsoft.NotificationHubs/namespaces/locp-newns/CheckNotificationHubAvailability"), - // Location: to.Ptr("West Europe"), - // IsAvailiable: to.Ptr(true), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubCreate.json -func ExampleClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnotificationhubs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().CreateOrUpdate(ctx, "5ktrial", "nh-sdk-ns", "nh-sdk-hub", armnotificationhubs.NotificationHubCreateOrUpdateParameters{ - Location: to.Ptr("eastus"), - Properties: &armnotificationhubs.NotificationHubProperties{}, - }, 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.NotificationHubResource = armnotificationhubs.NotificationHubResource{ - // Name: to.Ptr("nh-sdk-hub"), - // Type: to.Ptr("Microsoft.NotificationHubs/namespaces/notificationHubs"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/sdkresourceGroup/providers/Microsoft.NotificationHubs/namespaces/nh-sdk-ns/notificationHubs/nh-sdk-hub"), - // Location: to.Ptr("eastus"), - // Properties: &armnotificationhubs.NotificationHubProperties{ - // AuthorizationRules: []*armnotificationhubs.SharedAccessAuthorizationRuleProperties{ - // }, - // RegistrationTTL: to.Ptr("10675199.02:48:05.4775807"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubPatch.json -func ExampleClient_Patch() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnotificationhubs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().Patch(ctx, "sdkresourceGroup", "nh-sdk-ns", "sdk-notificationHubs-8708", &armnotificationhubs.ClientPatchOptions{Parameters: &armnotificationhubs.NotificationHubPatchParameters{}}) - 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.NotificationHubResource = armnotificationhubs.NotificationHubResource{ - // Name: to.Ptr("nh-sdk-hub"), - // Type: to.Ptr("Microsoft.NotificationHubs/namespaces/notificationHubs"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/sdkresourceGroup/providers/Microsoft.NotificationHubs/namespaces/nh-sdk-ns/notificationHubs/nh-sdk-hub"), - // Location: to.Ptr("South Central US"), - // Properties: &armnotificationhubs.NotificationHubProperties{ - // AuthorizationRules: []*armnotificationhubs.SharedAccessAuthorizationRuleProperties{ - // }, - // RegistrationTTL: to.Ptr("10675199.02:48:05.4775807"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubDelete.json -func ExampleClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnotificationhubs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewClient().Delete(ctx, "5ktrial", "nh-sdk-ns", "nh-sdk-hub", 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/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubGet.json -func ExampleClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnotificationhubs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().Get(ctx, "5ktrial", "nh-sdk-ns", "nh-sdk-hub", 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.NotificationHubResource = armnotificationhubs.NotificationHubResource{ - // Name: to.Ptr("nh-sdk-hub"), - // Type: to.Ptr("Microsoft.NotificationHubs/namespaces/notificationHubs"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/sdkresourceGroup/providers/Microsoft.NotificationHubs/namespaces/nh-sdk-ns/notificationHubs/nh-sdk-hub"), - // Location: to.Ptr("South Central US"), - // Properties: &armnotificationhubs.NotificationHubProperties{ - // AuthorizationRules: []*armnotificationhubs.SharedAccessAuthorizationRuleProperties{ - // }, - // RegistrationTTL: to.Ptr("10675199.02:48:05.4775807"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubDebugSend.json -func ExampleClient_DebugSend() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnotificationhubs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewClient().DebugSend(ctx, "5ktrial", "nh-sdk-ns", "nh-sdk-hub", &armnotificationhubs.ClientDebugSendOptions{Parameters: map[string]any{ - "data": map[string]any{ - "message": "Hello", - }, - }, - }) - 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/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleCreate.json -func ExampleClient_CreateOrUpdateAuthorizationRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnotificationhubs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().CreateOrUpdateAuthorizationRule(ctx, "5ktrial", "nh-sdk-ns", "nh-sdk-hub", "DefaultListenSharedAccessSignature", armnotificationhubs.SharedAccessAuthorizationRuleCreateOrUpdateParameters{ - Properties: &armnotificationhubs.SharedAccessAuthorizationRuleProperties{ - Rights: []*armnotificationhubs.AccessRights{ - to.Ptr(armnotificationhubs.AccessRightsListen), - to.Ptr(armnotificationhubs.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.SharedAccessAuthorizationRuleResource = armnotificationhubs.SharedAccessAuthorizationRuleResource{ - // Name: to.Ptr("DefaultListenSharedAccessSignature"), - // Type: to.Ptr("Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/5ktrial/providers/Microsoft.NotificationHubs/namespaces/nh-sdk-ns/NotificationHubs/nh-sdk-hub/AuthorizationRules/DefaultListenSharedAccessSignature"), - // Location: to.Ptr("West Europe"), - // Properties: &armnotificationhubs.SharedAccessAuthorizationRuleProperties{ - // ClaimType: to.Ptr("SharedAccessKey"), - // ClaimValue: to.Ptr("None"), - // CreatedTime: to.Ptr("2018-05-02T00:45:22.0150024Z"), - // KeyName: to.Ptr("DefaultListenSharedAccessSignature"), - // ModifiedTime: to.Ptr("2018-05-02T00:45:22.0150024Z"), - // PrimaryKey: to.Ptr("#################################"), - // Rights: []*armnotificationhubs.AccessRights{ - // to.Ptr(armnotificationhubs.AccessRightsListen)}, - // SecondaryKey: to.Ptr("#################################"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleDelete.json -func ExampleClient_DeleteAuthorizationRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnotificationhubs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewClient().DeleteAuthorizationRule(ctx, "5ktrial", "nh-sdk-ns", "nh-sdk-hub", "DefaultListenSharedAccessSignature", 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/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleGet.json -func ExampleClient_GetAuthorizationRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnotificationhubs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().GetAuthorizationRule(ctx, "5ktrial", "nh-sdk-ns", "nh-sdk-hub", "DefaultListenSharedAccessSignature", 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.SharedAccessAuthorizationRuleResource = armnotificationhubs.SharedAccessAuthorizationRuleResource{ - // Name: to.Ptr("DefaultListenSharedAccessSignature"), - // Type: to.Ptr("Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/5ktrial/providers/Microsoft.NotificationHubs/namespaces/nh-sdk-ns/NotificationHubs/nh-sdk-hub/AuthorizationRules/DefaultListenSharedAccessSignature"), - // Location: to.Ptr("West Europe"), - // Properties: &armnotificationhubs.SharedAccessAuthorizationRuleProperties{ - // ClaimType: to.Ptr("SharedAccessKey"), - // ClaimValue: to.Ptr("None"), - // CreatedTime: to.Ptr("2018-05-02T00:45:22.0150024Z"), - // KeyName: to.Ptr("DefaultListenSharedAccessSignature"), - // ModifiedTime: to.Ptr("2018-05-02T00:45:22.0150024Z"), - // PrimaryKey: to.Ptr("#################################"), - // Rights: []*armnotificationhubs.AccessRights{ - // to.Ptr(armnotificationhubs.AccessRightsListen)}, - // SecondaryKey: to.Ptr("#################################"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubListByNameSpace.json -func ExampleClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnotificationhubs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClient().NewListPager("5ktrial", "nh-sdk-ns", 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.NotificationHubListResult = armnotificationhubs.NotificationHubListResult{ - // Value: []*armnotificationhubs.NotificationHubResource{ - // { - // Name: to.Ptr("nh-sdk-hub"), - // Type: to.Ptr("Microsoft.NotificationHubs/namespaces/notificationHubs"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/5ktrial/providers/Microsoft.NotificationHubs/namespaces/nh-sdk-ns/NotificationHubs/nh-sdk-hub"), - // Location: to.Ptr("South Central US"), - // Properties: &armnotificationhubs.NotificationHubProperties{ - // AuthorizationRules: []*armnotificationhubs.SharedAccessAuthorizationRuleProperties{ - // }, - // RegistrationTTL: to.Ptr("10675199.02:48:05.4775807"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleListAll.json -func ExampleClient_NewListAuthorizationRulesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnotificationhubs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClient().NewListAuthorizationRulesPager("5ktrial", "nh-sdk-ns", "nh-sdk-hub", 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.SharedAccessAuthorizationRuleListResult = armnotificationhubs.SharedAccessAuthorizationRuleListResult{ - // Value: []*armnotificationhubs.SharedAccessAuthorizationRuleResource{ - // { - // Name: to.Ptr("DefaultListenSharedAccessSignature"), - // Type: to.Ptr("Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/5ktrial/providers/Microsoft.NotificationHubs/namespaces/nh-sdk-ns/NotificationHubs/nh-sdk-hub/AuthorizationRules/DefaultListenSharedAccessSignature"), - // Location: to.Ptr("West Europe"), - // Properties: &armnotificationhubs.SharedAccessAuthorizationRuleProperties{ - // ClaimType: to.Ptr("SharedAccessKey"), - // ClaimValue: to.Ptr("None"), - // CreatedTime: to.Ptr("2018-05-02T00:45:22.0150024Z"), - // KeyName: to.Ptr("DefaultListenSharedAccessSignature"), - // ModifiedTime: to.Ptr("2018-05-02T00:45:22.0150024Z"), - // PrimaryKey: to.Ptr("#################################"), - // Rights: []*armnotificationhubs.AccessRights{ - // to.Ptr(armnotificationhubs.AccessRightsListen)}, - // SecondaryKey: to.Ptr("#################################"), - // }, - // }, - // { - // Name: to.Ptr("DefaultFullSharedAccessSignature"), - // Type: to.Ptr("Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/5ktrial/providers/Microsoft.NotificationHubs/namespaces/nh-sdk-ns/NotificationHubs/nh-sdk-hub/AuthorizationRules/DefaultFullSharedAccessSignature"), - // Location: to.Ptr("West Europe"), - // Properties: &armnotificationhubs.SharedAccessAuthorizationRuleProperties{ - // ClaimType: to.Ptr("SharedAccessKey"), - // ClaimValue: to.Ptr("None"), - // CreatedTime: to.Ptr("2018-05-02T00:45:22.0150024Z"), - // KeyName: to.Ptr("DefaultFullSharedAccessSignature"), - // ModifiedTime: to.Ptr("2018-05-02T00:45:22.0150024Z"), - // PrimaryKey: to.Ptr("#################################"), - // Rights: []*armnotificationhubs.AccessRights{ - // to.Ptr(armnotificationhubs.AccessRightsListen), - // to.Ptr(armnotificationhubs.AccessRightsManage), - // to.Ptr(armnotificationhubs.AccessRightsSend)}, - // SecondaryKey: to.Ptr("#################################"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleListKey.json -func ExampleClient_ListKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnotificationhubs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().ListKeys(ctx, "5ktrial", "nh-sdk-ns", "nh-sdk-hub", "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.ResourceListKeys = armnotificationhubs.ResourceListKeys{ - // 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-notificationHubs-2317"), - // PrimaryKey: to.Ptr("############################################"), - // SecondaryConnectionString: to.Ptr("Endpoint=sb://sdk-namespace-7982.servicebus.windows-int.net/;SharedAccessKeyName=sdk-AuthRules-5800;SharedAccessKey=############################################;EntityPath=sdk-notificationHubs-2317"), - // SecondaryKey: to.Ptr("############################################"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubAuthorizationRuleRegenrateKey.json -func ExampleClient_RegenerateKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnotificationhubs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().RegenerateKeys(ctx, "5ktrial", "nh-sdk-ns", "nh-sdk-hub", "DefaultListenSharedAccessSignature", armnotificationhubs.PolicykeyResource{ - PolicyKey: to.Ptr("PrimaryKey"), - }, 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.ResourceListKeys = armnotificationhubs.ResourceListKeys{ - // KeyName: to.Ptr("DefaultListenSharedAccessSignature"), - // PrimaryConnectionString: to.Ptr("Endpoint=sb://nh-sdk-ns.servicebus.windows.net/;SharedAccessKeyName=DefaultListenSharedAccessSignature;SharedAccessKey=#################################"), - // PrimaryKey: to.Ptr("#################################"), - // SecondaryConnectionString: to.Ptr("Endpoint=sb://nh-sdk-ns.servicebus.windows.net/;SharedAccessKeyName=DefaultListenSharedAccessSignature;SharedAccessKey=#################################"), - // SecondaryKey: to.Ptr("#################################"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NotificationHubs/NotificationHubPnsCredentials.json -func ExampleClient_GetPnsCredentials() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnotificationhubs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().GetPnsCredentials(ctx, "5ktrial", "nh-sdk-ns", "nh-sdk-hub", 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.PnsCredentialsResource = armnotificationhubs.PnsCredentialsResource{ - // Name: to.Ptr("nh-sdk-hub"), - // Type: to.Ptr("Microsoft.NotificationHubs/namespaces/notificationHubs/pnsCredentials"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/5ktrial/providers/Microsoft.NotificationHubs/namespaces/nh-sdk-ns/notificationHubs/nh-sdk-hub/pnsCredentials"), - // Location: to.Ptr("West Europe"), - // Properties: &armnotificationhubs.PnsCredentialsProperties{ - // MpnsCredential: &armnotificationhubs.MpnsCredential{ - // Properties: &armnotificationhubs.MpnsCredentialProperties{ - // Thumbprint: to.Ptr("#################################"), - // }, - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/notificationhubs/armnotificationhubs/client_factory.go b/sdk/resourcemanager/notificationhubs/armnotificationhubs/client_factory.go index 51d2a04d9794..831e28e88e77 100644 --- a/sdk/resourcemanager/notificationhubs/armnotificationhubs/client_factory.go +++ b/sdk/resourcemanager/notificationhubs/armnotificationhubs/client_factory.go @@ -24,8 +24,7 @@ type ClientFactory struct { // 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 - Gets subscription credentials which uniquely identify 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) { @@ -39,8 +38,8 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, nil } -func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) +func (c *ClientFactory) NewClient() *Client { + subClient, _ := NewClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -49,7 +48,12 @@ func (c *ClientFactory) NewNamespacesClient() *NamespacesClient { return subClient } -func (c *ClientFactory) NewClient() *Client { - subClient, _ := NewClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + subClient, _ := NewOperationsClient(c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient { + subClient, _ := NewPrivateEndpointConnectionsClient(c.subscriptionID, c.credential, c.options) return subClient } diff --git a/sdk/resourcemanager/notificationhubs/armnotificationhubs/constants.go b/sdk/resourcemanager/notificationhubs/armnotificationhubs/constants.go index 5829fc7377cb..e0564a042305 100644 --- a/sdk/resourcemanager/notificationhubs/armnotificationhubs/constants.go +++ b/sdk/resourcemanager/notificationhubs/armnotificationhubs/constants.go @@ -11,27 +11,68 @@ package armnotificationhubs const ( moduleName = "armnotificationhubs" - moduleVersion = "v1.1.1" + moduleVersion = "v2.0.0-beta.1" ) +// AccessRights - Defines values for AccessRights. type AccessRights string const ( + AccessRightsListen AccessRights = "Listen" AccessRightsManage AccessRights = "Manage" AccessRightsSend AccessRights = "Send" - AccessRightsListen AccessRights = "Listen" ) // PossibleAccessRightsValues returns the possible values for the AccessRights const type. func PossibleAccessRightsValues() []AccessRights { return []AccessRights{ + AccessRightsListen, AccessRightsManage, AccessRightsSend, - AccessRightsListen, } } -// NamespaceType - The namespace type. +// CreatedByType - The type of identity that created the resource. +type CreatedByType string + +const ( + CreatedByTypeApplication CreatedByType = "Application" + CreatedByTypeKey CreatedByType = "Key" + CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" + CreatedByTypeUser CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{ + CreatedByTypeApplication, + CreatedByTypeKey, + CreatedByTypeManagedIdentity, + CreatedByTypeUser, + } +} + +// NamespaceStatus - Namespace status. +type NamespaceStatus string + +const ( + NamespaceStatusCreated NamespaceStatus = "Created" + NamespaceStatusCreating NamespaceStatus = "Creating" + NamespaceStatusDeleting NamespaceStatus = "Deleting" + NamespaceStatusSuspended NamespaceStatus = "Suspended" +) + +// PossibleNamespaceStatusValues returns the possible values for the NamespaceStatus const type. +func PossibleNamespaceStatusValues() []NamespaceStatus { + return []NamespaceStatus{ + NamespaceStatusCreated, + NamespaceStatusCreating, + NamespaceStatusDeleting, + NamespaceStatusSuspended, + } +} + +// NamespaceType - Defines values for NamespaceType. type NamespaceType string const ( @@ -47,7 +88,141 @@ func PossibleNamespaceTypeValues() []NamespaceType { } } -// SKUName - Name of the notification hub sku +// OperationProvisioningState - Defines values for OperationProvisioningState. +type OperationProvisioningState string + +const ( + OperationProvisioningStateCanceled OperationProvisioningState = "Canceled" + OperationProvisioningStateDisabled OperationProvisioningState = "Disabled" + OperationProvisioningStateFailed OperationProvisioningState = "Failed" + OperationProvisioningStateInProgress OperationProvisioningState = "InProgress" + OperationProvisioningStatePending OperationProvisioningState = "Pending" + OperationProvisioningStateSucceeded OperationProvisioningState = "Succeeded" + OperationProvisioningStateUnknown OperationProvisioningState = "Unknown" +) + +// PossibleOperationProvisioningStateValues returns the possible values for the OperationProvisioningState const type. +func PossibleOperationProvisioningStateValues() []OperationProvisioningState { + return []OperationProvisioningState{ + OperationProvisioningStateCanceled, + OperationProvisioningStateDisabled, + OperationProvisioningStateFailed, + OperationProvisioningStateInProgress, + OperationProvisioningStatePending, + OperationProvisioningStateSucceeded, + OperationProvisioningStateUnknown, + } +} + +// PolicyKeyType - Type of Shared Access Policy Key (primary or secondary). +type PolicyKeyType string + +const ( + PolicyKeyTypePrimaryKey PolicyKeyType = "PrimaryKey" + PolicyKeyTypeSecondaryKey PolicyKeyType = "SecondaryKey" +) + +// PossiblePolicyKeyTypeValues returns the possible values for the PolicyKeyType const type. +func PossiblePolicyKeyTypeValues() []PolicyKeyType { + return []PolicyKeyType{ + PolicyKeyTypePrimaryKey, + PolicyKeyTypeSecondaryKey, + } +} + +// PrivateEndpointConnectionProvisioningState - State of Private Endpoint Connection. +type PrivateEndpointConnectionProvisioningState string + +const ( + PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" + PrivateEndpointConnectionProvisioningStateDeleted PrivateEndpointConnectionProvisioningState = "Deleted" + PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" + PrivateEndpointConnectionProvisioningStateDeletingByProxy PrivateEndpointConnectionProvisioningState = "DeletingByProxy" + PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" + PrivateEndpointConnectionProvisioningStateUnknown PrivateEndpointConnectionProvisioningState = "Unknown" + PrivateEndpointConnectionProvisioningStateUpdating PrivateEndpointConnectionProvisioningState = "Updating" + PrivateEndpointConnectionProvisioningStateUpdatingByProxy PrivateEndpointConnectionProvisioningState = "UpdatingByProxy" +) + +// PossiblePrivateEndpointConnectionProvisioningStateValues returns the possible values for the PrivateEndpointConnectionProvisioningState const type. +func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState { + return []PrivateEndpointConnectionProvisioningState{ + PrivateEndpointConnectionProvisioningStateCreating, + PrivateEndpointConnectionProvisioningStateDeleted, + PrivateEndpointConnectionProvisioningStateDeleting, + PrivateEndpointConnectionProvisioningStateDeletingByProxy, + PrivateEndpointConnectionProvisioningStateSucceeded, + PrivateEndpointConnectionProvisioningStateUnknown, + PrivateEndpointConnectionProvisioningStateUpdating, + PrivateEndpointConnectionProvisioningStateUpdatingByProxy, + } +} + +// PrivateLinkConnectionStatus - State of Private Link Connection. +type PrivateLinkConnectionStatus string + +const ( + PrivateLinkConnectionStatusApproved PrivateLinkConnectionStatus = "Approved" + PrivateLinkConnectionStatusDisconnected PrivateLinkConnectionStatus = "Disconnected" + PrivateLinkConnectionStatusPending PrivateLinkConnectionStatus = "Pending" + PrivateLinkConnectionStatusRejected PrivateLinkConnectionStatus = "Rejected" +) + +// PossiblePrivateLinkConnectionStatusValues returns the possible values for the PrivateLinkConnectionStatus const type. +func PossiblePrivateLinkConnectionStatusValues() []PrivateLinkConnectionStatus { + return []PrivateLinkConnectionStatus{ + PrivateLinkConnectionStatusApproved, + PrivateLinkConnectionStatusDisconnected, + PrivateLinkConnectionStatusPending, + PrivateLinkConnectionStatusRejected, + } +} + +// PublicNetworkAccess - Type of public network access. +type PublicNetworkAccess string + +const ( + PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" + PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" +) + +// PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type. +func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { + return []PublicNetworkAccess{ + PublicNetworkAccessDisabled, + PublicNetworkAccessEnabled, + } +} + +// ReplicationRegion - Allowed replication region +type ReplicationRegion string + +const ( + ReplicationRegionAustraliaEast ReplicationRegion = "AustraliaEast" + ReplicationRegionBrazilSouth ReplicationRegion = "BrazilSouth" + ReplicationRegionDefault ReplicationRegion = "Default" + ReplicationRegionNone ReplicationRegion = "None" + ReplicationRegionNorthEurope ReplicationRegion = "NorthEurope" + ReplicationRegionSouthAfricaNorth ReplicationRegion = "SouthAfricaNorth" + ReplicationRegionSouthEastAsia ReplicationRegion = "SouthEastAsia" + ReplicationRegionWestUs2 ReplicationRegion = "WestUs2" +) + +// PossibleReplicationRegionValues returns the possible values for the ReplicationRegion const type. +func PossibleReplicationRegionValues() []ReplicationRegion { + return []ReplicationRegion{ + ReplicationRegionAustraliaEast, + ReplicationRegionBrazilSouth, + ReplicationRegionDefault, + ReplicationRegionNone, + ReplicationRegionNorthEurope, + ReplicationRegionSouthAfricaNorth, + ReplicationRegionSouthEastAsia, + ReplicationRegionWestUs2, + } +} + +// SKUName - Namespace SKU name. type SKUName string const ( @@ -64,3 +239,19 @@ func PossibleSKUNameValues() []SKUName { SKUNameStandard, } } + +// ZoneRedundancyPreference - Namespace SKU name. +type ZoneRedundancyPreference string + +const ( + ZoneRedundancyPreferenceDisabled ZoneRedundancyPreference = "Disabled" + ZoneRedundancyPreferenceEnabled ZoneRedundancyPreference = "Enabled" +) + +// PossibleZoneRedundancyPreferenceValues returns the possible values for the ZoneRedundancyPreference const type. +func PossibleZoneRedundancyPreferenceValues() []ZoneRedundancyPreference { + return []ZoneRedundancyPreference{ + ZoneRedundancyPreferenceDisabled, + ZoneRedundancyPreferenceEnabled, + } +} diff --git a/sdk/resourcemanager/notificationhubs/armnotificationhubs/go.mod b/sdk/resourcemanager/notificationhubs/armnotificationhubs/go.mod index 5c1b4e007ca0..a15ee0734d30 100644 --- a/sdk/resourcemanager/notificationhubs/armnotificationhubs/go.mod +++ b/sdk/resourcemanager/notificationhubs/armnotificationhubs/go.mod @@ -1,16 +1,16 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/notificationhubs/armnotificationhubs +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/notificationhubs/armnotificationhubs/v2 go 1.18 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 github.com/stretchr/testify v1.7.0 ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/sdk/resourcemanager/notificationhubs/armnotificationhubs/models.go b/sdk/resourcemanager/notificationhubs/armnotificationhubs/models.go index cd2de4d5ec7e..34cb8e38672d 100644 --- a/sdk/resourcemanager/notificationhubs/armnotificationhubs/models.go +++ b/sdk/resourcemanager/notificationhubs/armnotificationhubs/models.go @@ -13,124 +13,149 @@ import "time" // AdmCredential - Description of a NotificationHub AdmCredential. type AdmCredential struct { - // Properties of NotificationHub AdmCredential. + // REQUIRED; Description of a NotificationHub AdmCredential. Properties *AdmCredentialProperties } // AdmCredentialProperties - Description of a NotificationHub AdmCredential. type AdmCredentialProperties struct { - // The URL of the authorization token. + // REQUIRED; Gets or sets the URL of the authorization token. AuthTokenURL *string - // The client identifier. + // REQUIRED; Gets or sets the client identifier. ClientID *string - // The credential secret access key. + // REQUIRED; Gets or sets the credential secret access key. ClientSecret *string } // ApnsCredential - Description of a NotificationHub ApnsCredential. type ApnsCredential struct { - // Properties of NotificationHub ApnsCredential. + // REQUIRED; Description of a NotificationHub ApnsCredential. Properties *ApnsCredentialProperties } -// ApnsCredentialProperties - Description of a NotificationHub ApnsCredential. Note that there is no explicit switch between -// Certificate and Token Authentication Modes. The mode is determined based on the properties passed in. +// ApnsCredentialProperties - Description of a NotificationHub ApnsCredential. type ApnsCredentialProperties struct { - // The APNS certificate. Specify if using Certificate Authentication Mode. + // REQUIRED; Gets or sets the endpoint of this credential. + Endpoint *string + + // Gets or sets the APNS certificate. ApnsCertificate *string - // The issuer (iss) registered claim key. The value is a 10-character TeamId, obtained from your developer account. Specify - // if using Token Authentication Mode. + // Gets or sets the issuer (iss) registered claim key, whose value is your 10-character Team ID, obtained from your developer + // account AppID *string - // The name of the application or BundleId. Specify if using Token Authentication Mode. + // Gets or sets the name of the application AppName *string - // The APNS certificate password if it exists. + // Gets or sets the certificate key. CertificateKey *string - // The APNS endpoint of this credential. If using Certificate Authentication Mode and Sandbox specify 'gateway.sandbox.push.apple.com'. - // If using Certificate Authentication Mode and Production specify - // 'gateway.push.apple.com'. If using Token Authentication Mode and Sandbox specify 'https://api.development.push.apple.com:443/3/device'. - // If using Token Authentication Mode and Production specify - // 'https://api.push.apple.com:443/3/device'. - Endpoint *string - - // A 10-character key identifier (kid) key, obtained from your developer account. Specify if using Token Authentication Mode. + // Gets or sets a 10-character key identifier (kid) key, obtained from your developer account KeyID *string - // The APNS certificate thumbprint. Specify if using Certificate Authentication Mode. + // Gets or sets the APNS certificate Thumbprint Thumbprint *string - // Provider Authentication Token, obtained through your developer account. Specify if using Token Authentication Mode. + // Gets or sets provider Authentication Token, obtained through your developer account Token *string } +// Availability - Represents metric availability (part of RP operation descriptions). +type Availability struct { + // READ-ONLY; Duration of the availability blob. + BlobDuration *string + + // READ-ONLY; Time grain of the availability. + TimeGrain *string +} + // BaiduCredential - Description of a NotificationHub BaiduCredential. type BaiduCredential struct { - // Properties of NotificationHub BaiduCredential. + // REQUIRED; Description of a NotificationHub BaiduCredential. Properties *BaiduCredentialProperties } // BaiduCredentialProperties - Description of a NotificationHub BaiduCredential. type BaiduCredentialProperties struct { - // Baidu Api Key. + // REQUIRED; Gets or sets baidu Api Key. BaiduAPIKey *string - // Baidu Endpoint. + // REQUIRED; Gets or sets baidu Endpoint. BaiduEndPoint *string - // Baidu Secret Key + // REQUIRED; Gets or sets baidu Secret Key BaiduSecretKey *string } +// BrowserCredential - Description of a NotificationHub BrowserCredential. +type BrowserCredential struct { + // REQUIRED; Description of a NotificationHub BrowserCredential. + Properties *BrowserCredentialProperties +} + +// BrowserCredentialProperties - Description of a NotificationHub BrowserCredential. +type BrowserCredentialProperties struct { + // REQUIRED; Gets or sets web push subject. + Subject *string + + // REQUIRED; Gets or sets VAPID private key. + VapidPrivateKey *string + + // REQUIRED; Gets or sets VAPID public key. + VapidPublicKey *string +} + // CheckAvailabilityParameters - Parameters supplied to the Check Name Availability for Namespace and NotificationHubs. type CheckAvailabilityParameters struct { - // REQUIRED; Resource name + // REQUIRED; Gets or sets resource name Name *string - // True if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. + // Not used and deprecated since API version 2023-01-01-preview IsAvailiable *bool - // Resource location + // Gets or sets resource location Location *string - // The sku of the created namespace + // The Sku description for a namespace SKU *SKU - // Resource tags + // Gets or sets resource tags Tags map[string]*string - // READ-ONLY; Resource Id + // READ-ONLY; Gets resource Id ID *string - // READ-ONLY; Resource type + // READ-ONLY; Gets resource type Type *string } // CheckAvailabilityResult - Description of a CheckAvailability resource. type CheckAvailabilityResult struct { - // True if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. + // Gets or sets true if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. IsAvailiable *bool - // Resource location + // Deprecated - only for compatibility. Location *string - // The sku of the created namespace + // The Sku description for a namespace SKU *SKU - // Resource tags + // Deprecated - only for compatibility. Tags map[string]*string - // READ-ONLY; Resource Id + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/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 } @@ -153,8 +178,7 @@ type ClientCreateOrUpdateOptions struct { // ClientDebugSendOptions contains the optional parameters for the Client.DebugSend method. type ClientDebugSendOptions struct { - // Debug send parameters - Parameters any + // placeholder for future optional parameters } // ClientDeleteAuthorizationRuleOptions contains the optional parameters for the Client.DeleteAuthorizationRule method. @@ -194,13 +218,10 @@ type ClientListKeysOptions struct { // ClientListOptions contains the optional parameters for the Client.NewListPager method. type ClientListOptions struct { - // placeholder for future optional parameters -} - -// ClientPatchOptions contains the optional parameters for the Client.Patch method. -type ClientPatchOptions struct { - // Parameters supplied to patch a NotificationHub Resource. - Parameters *NotificationHubPatchParameters + // Continuation token. + SkipToken *string + // Page size. + Top *int32 } // ClientRegenerateKeysOptions contains the optional parameters for the Client.RegenerateKeys method. @@ -208,199 +229,325 @@ type ClientRegenerateKeysOptions struct { // placeholder for future optional parameters } +// ClientUpdateOptions contains the optional parameters for the Client.Update method. +type ClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// ConnectionDetails - Part of Private Endpoint description that stores information about a connection between Private Endpoint +// and Notification Hubs namespace. This is internal class, not visible to customers, and we use +// it only to discover the link identifier. +type ConnectionDetails struct { + // READ-ONLY; Group name. Always "namespace" for Notification Hubs. + GroupID *string + + // READ-ONLY; A unique ID of the connection. This is not the ARM id, but rather an internal identifier set by the Networking + // RP. Notification Hubs code does not analyze it. + ID *string + + // READ-ONLY; Link identifier. This is a string representation of an integer that is also encoded in every IPv6 frame received + // by Front Door, and we use it to create implicit authorization rule that allows + // connection from the associated Private Endpoint. + LinkIdentifier *string + + // READ-ONLY; Member name. Always "namespace" for Notification Hubs. + MemberName *string + + // READ-ONLY; IP address of the Private Endpoint. This is not used by Notification Hubs. + PrivateIPAddress *string +} + // DebugSendResponse - Description of a NotificationHub Resource. type DebugSendResponse struct { - // Resource location + // Deprecated - only for compatibility. Location *string - // Properties of the NotificationHub. + // Result of DebugSend operations. Properties *DebugSendResult - // The sku of the created namespace - SKU *SKU - - // Resource tags + // Deprecated - only for compatibility. Tags map[string]*string - // READ-ONLY; Resource Id + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/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 } +// DebugSendResult - Result of DebugSend operations. type DebugSendResult struct { - // send failure - Failure *float32 + // READ-ONLY; Gets or sets send failure + Failure *int64 - // actual failure description - Results any + // READ-ONLY; Gets or sets actual failure description + Results []*RegistrationResult - // successful send - Success *float32 + // READ-ONLY; Gets or sets successful send + Success *int64 } -// ErrorResponse - Error response indicates NotificationHubs service is not able to process the incoming request. The reason -// is provided in the error message. -type ErrorResponse struct { - // Error code. +// 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 +} + +// ErrorDetail - The error detail. +type ErrorDetail struct { + // READ-ONLY; The error additional info. + AdditionalInfo []*ErrorAdditionalInfo + + // READ-ONLY; The error code. Code *string - // Error message indicating why the operation failed. + // READ-ONLY; The error details. + Details []*ErrorDetail + + // READ-ONLY; The error message. Message *string + + // READ-ONLY; The error target. + Target *string +} + +// ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. +// (This also follows the OData error response format.). +type ErrorResponse struct { + // The error object. + Error *ErrorDetail } // GCMCredential - Description of a NotificationHub GcmCredential. type GCMCredential struct { - // Properties of NotificationHub GcmCredential. + // REQUIRED; Description of a NotificationHub GcmCredential. Properties *GCMCredentialProperties } // GCMCredentialProperties - Description of a NotificationHub GcmCredential. type GCMCredentialProperties struct { - // The FCM legacy endpoint. Default value is 'https://fcm.googleapis.com/fcm/send' + // REQUIRED; Gets or sets the Google API key. + GoogleAPIKey *string + + // Gets or sets the GCM endpoint. GCMEndpoint *string +} - // The Google API key. - GoogleAPIKey *string +// GroupConnectivityInformation - Represents a connectivity information to Notification Hubs namespace. This is part of PrivateLinkService +// proxy that tell the Networking RP how to connect to the Notification Hubs namespace. +type GroupConnectivityInformation struct { + // READ-ONLY; List of customer-visible domain names that point to a Notification Hubs namespace. + CustomerVisibleFqdns []*string + + // READ-ONLY; Group id. Always set to "namespace". + GroupID *string + + // READ-ONLY; One of the domain name from the customer-visible names; this is used internally by Private Link service to make + // connection to Notification Hubs namespace. + InternalFqdn *string + + // READ-ONLY; Member name. Always set to "namespace". + MemberName *string + + // READ-ONLY; ARM region for Private Link Service. We use the region that contains the connected Notification Hubs namespace. + PrivateLinkServiceArmRegion *string + + // READ-ONLY; Not used by Notification Hubs. + RedirectMapID *string } -// MpnsCredential - Description of a NotificationHub MpnsCredential. -type MpnsCredential struct { - // Properties of NotificationHub MpnsCredential. - Properties *MpnsCredentialProperties +// IPRule - A network authorization rule that filters traffic based on IP address. +type IPRule struct { + // REQUIRED; IP mask. + IPMask *string + + // REQUIRED; List of access rights. + Rights []*AccessRights } -// MpnsCredentialProperties - Description of a NotificationHub MpnsCredential. -type MpnsCredentialProperties struct { - // The certificate key for this credential. - CertificateKey *string +// LogSpecification - A single log category specification. +type LogSpecification struct { + // READ-ONLY; Duration of data written to a single blob. + BlobDuration *string - // The MPNS certificate. - MpnsCertificate *string + // READ-ONLY; Display name of the log category. + DisplayName *string - // The MPNS certificate Thumbprint - Thumbprint *string + // READ-ONLY; Name of the log category. + Name *string } -// NamespaceCreateOrUpdateParameters - Parameters supplied to the CreateOrUpdate Namespace operation. -type NamespaceCreateOrUpdateParameters struct { - // Resource location - Location *string +// MetricSpecification - A metric specification. +type MetricSpecification struct { + // READ-ONLY; Type of the aggregation (Average, Minimum, Maximum, Total or Count). + AggregationType *string - // Properties of the Namespace. - Properties *NamespaceProperties + // READ-ONLY; List of availabilities. + Availabilities []*Availability - // The sku of the created namespace - SKU *SKU + // READ-ONLY; Description of the metric. + DisplayDescription *string - // Resource tags - Tags map[string]*string + // READ-ONLY; User-visible metric name. + DisplayName *string - // READ-ONLY; Resource Id - ID *string + // READ-ONLY; Optional property. If set to true, then zero will be returned for time duration where no metric is emitted / + // published. + FillGapWithZero *bool + + // READ-ONLY; The matching regex pattern to be applied to the field pointed by the "metricsFilterPathSelector" flag in the + // ARM manifest. + MetricFilterPattern *string - // READ-ONLY; Resource name + // READ-ONLY; Metric name / id. Name *string - // READ-ONLY; Resource type - Type *string + // READ-ONLY; Metric unit. + Unit *string +} + +// MpnsCredential - Description of a NotificationHub MpnsCredential. +type MpnsCredential struct { + // REQUIRED; Description of a NotificationHub MpnsCredential. + Properties *MpnsCredentialProperties +} + +// MpnsCredentialProperties - Description of a NotificationHub MpnsCredential. +type MpnsCredentialProperties struct { + // REQUIRED; Gets or sets the certificate key for this credential. + CertificateKey *string + + // REQUIRED; Gets or sets the MPNS certificate. + MpnsCertificate *string + + // REQUIRED; Gets or sets the MPNS certificate Thumbprint + Thumbprint *string } // NamespaceListResult - The response of the List Namespace operation. type NamespaceListResult struct { - // Link to the next set of results. Not empty if Value contains incomplete list of Namespaces + // READ-ONLY; Gets or sets link to the next set of results. NextLink *string - // Result of the List Namespace operation. + // READ-ONLY; Gets or sets result of the List AuthorizationRules operation. Value []*NamespaceResource } -// NamespacePatchParameters - Parameters supplied to the Patch Namespace operation. +// NamespacePatchParameters - Patch parameter for NamespaceResource. type NamespacePatchParameters struct { - // The sku of the created namespace + // Represents namespace properties. + Properties *NamespaceProperties + + // The Sku description for a namespace SKU *SKU - // Resource tags + // Dictionary of Tags map[string]*string } -// NamespaceProperties - Namespace properties. +// NamespaceProperties - Represents namespace properties. type NamespaceProperties struct { - // The time the namespace was created. + // Deprecated. + DataCenter *string + + // Defines values for NamespaceType. + NamespaceType *NamespaceType + + // A collection of network authorization rules. + NetworkACLs *NetworkACLs + + // Collection of Notification Hub or Notification Hub Namespace PNS credentials. + PnsCredentials *PnsCredentials + + // Defines values for OperationProvisioningState. + ProvisioningState *OperationProvisioningState + + // Type of public network access. + PublicNetworkAccess *PublicNetworkAccess + + // Allowed replication region + ReplicationRegion *ReplicationRegion + + // Gets or sets scaleUnit where the namespace gets created + ScaleUnit *string + + // Namespace status. + Status *NamespaceStatus + + // Namespace SKU name. + ZoneRedundancy *ZoneRedundancyPreference + + // READ-ONLY; Time when the namespace was created. CreatedAt *time.Time - // Whether or not the namespace is set as Critical. + // READ-ONLY; Gets or sets whether or not the namespace is set as Critical. Critical *bool - // Data center for the namespace - DataCenter *string - - // Whether or not the namespace is currently enabled. + // READ-ONLY; Gets or sets whether or not the namespace is currently enabled. Enabled *bool - // The name of the namespace. - Name *string + // READ-ONLY; Azure Insights Metrics id. + MetricID *string - // The namespace type. - NamespaceType *NamespaceType + // READ-ONLY; Name of the Notification Hubs namespace. This is immutable property, set automatically by the service when the + // namespace is created. + Name *string - // Provisioning state of the Namespace. - ProvisioningState *string + // READ-ONLY; Private Endpoint Connections for namespace + PrivateEndpointConnections []*PrivateEndpointConnectionResource - // Specifies the targeted region in which the namespace should be created. It can be any of the following values: Australia - // East, Australia Southeast, Central US, East US, East US 2, West US, North - // Central US, South Central US, East Asia, Southeast Asia, Brazil South, Japan East, Japan West, North Europe, West Europe + // READ-ONLY; Region. The value is always set to the same value as Namespace.Location, so we are deprecating this property. Region *string - // ScaleUnit where the namespace gets created - ScaleUnit *string - - // Endpoint you can use to perform NotificationHub operations. + // READ-ONLY; Gets or sets endpoint you can use to perform NotificationHub operations. ServiceBusEndpoint *string - // Status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting - Status *string - - // The Id of the Azure subscription associated with the namespace. + // READ-ONLY; Namespace subscription id. SubscriptionID *string - // The time the namespace was updated. + // READ-ONLY; Time when the namespace was updated. UpdatedAt *time.Time - - // READ-ONLY; Identifier for Azure Insights metrics - MetricID *string } -// NamespaceResource - Description of a Namespace resource. +// NamespaceResource - Notification Hubs Namespace Resource. type NamespaceResource struct { - // Resource location + // REQUIRED; The geo-location where the resource lives Location *string - // Properties of the Namespace. - Properties *NamespaceProperties - - // The sku of the created namespace + // REQUIRED; The Sku description for a namespace SKU *SKU - // Resource tags + // Represents namespace properties. + Properties *NamespaceProperties + + // Resource tags. Tags map[string]*string - // READ-ONLY; Resource Id + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/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 } -// NamespacesClientBeginDeleteOptions contains the optional parameters for the NamespacesClient.BeginDelete method. -type NamespacesClientBeginDeleteOptions struct { +// NamespacesClientBeginCreateOrUpdateOptions contains the optional parameters for the NamespacesClient.BeginCreateOrUpdate +// method. +type NamespacesClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string } @@ -416,17 +563,17 @@ type NamespacesClientCreateOrUpdateAuthorizationRuleOptions struct { // placeholder for future optional parameters } -// NamespacesClientCreateOrUpdateOptions contains the optional parameters for the NamespacesClient.CreateOrUpdate method. -type NamespacesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - // NamespacesClientDeleteAuthorizationRuleOptions contains the optional parameters for the NamespacesClient.DeleteAuthorizationRule // method. type NamespacesClientDeleteAuthorizationRuleOptions struct { // placeholder for future optional parameters } +// NamespacesClientDeleteOptions contains the optional parameters for the NamespacesClient.Delete method. +type NamespacesClientDeleteOptions struct { + // placeholder for future optional parameters +} + // NamespacesClientGetAuthorizationRuleOptions contains the optional parameters for the NamespacesClient.GetAuthorizationRule // method. type NamespacesClientGetAuthorizationRuleOptions struct { @@ -438,9 +585,17 @@ type NamespacesClientGetOptions struct { // placeholder for future optional parameters } +// NamespacesClientGetPnsCredentialsOptions contains the optional parameters for the NamespacesClient.GetPnsCredentials method. +type NamespacesClientGetPnsCredentialsOptions struct { + // placeholder for future optional parameters +} + // NamespacesClientListAllOptions contains the optional parameters for the NamespacesClient.NewListAllPager method. type NamespacesClientListAllOptions struct { - // placeholder for future optional parameters + // Skip token for subsequent requests. + SkipToken *string + // Maximum number of results to return. + Top *int32 } // NamespacesClientListAuthorizationRulesOptions contains the optional parameters for the NamespacesClient.NewListAuthorizationRulesPager @@ -456,12 +611,10 @@ type NamespacesClientListKeysOptions struct { // NamespacesClientListOptions contains the optional parameters for the NamespacesClient.NewListPager method. type NamespacesClientListOptions struct { - // placeholder for future optional parameters -} - -// NamespacesClientPatchOptions contains the optional parameters for the NamespacesClient.Patch method. -type NamespacesClientPatchOptions struct { - // placeholder for future optional parameters + // Skip token for subsequent requests. + SkipToken *string + // Maximum number of results to return. + Top *int32 } // NamespacesClientRegenerateKeysOptions contains the optional parameters for the NamespacesClient.RegenerateKeys method. @@ -469,114 +622,104 @@ type NamespacesClientRegenerateKeysOptions struct { // placeholder for future optional parameters } -// NotificationHubCreateOrUpdateParameters - Parameters supplied to the CreateOrUpdate NotificationHub operation. -type NotificationHubCreateOrUpdateParameters struct { - // REQUIRED; Properties of the NotificationHub. - Properties *NotificationHubProperties - - // Resource location - Location *string - - // The sku of the created namespace - SKU *SKU - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string +// NamespacesClientUpdateOptions contains the optional parameters for the NamespacesClient.Update method. +type NamespacesClientUpdateOptions struct { + // placeholder for future optional parameters +} - // READ-ONLY; Resource name - Name *string +// NetworkACLs - A collection of network authorization rules. +type NetworkACLs struct { + // List of IP rules. + IPRules []*IPRule - // READ-ONLY; Resource type - Type *string + // A default (public Internet) network authorization rule, which contains rights if no other network rule matches. + PublicNetworkRule *PublicInternetAuthorizationRule } // NotificationHubListResult - The response of the List NotificationHub operation. type NotificationHubListResult struct { - // Link to the next set of results. Not empty if Value contains incomplete list of NotificationHub + // READ-ONLY; Gets or sets link to the next set of results. NextLink *string - // Result of the List NotificationHub operation. + // READ-ONLY; Gets or sets result of the List AuthorizationRules operation. Value []*NotificationHubResource } -// NotificationHubPatchParameters - Parameters supplied to the patch NotificationHub operation. +// NotificationHubPatchParameters - Patch parameter for NamespaceResource. type NotificationHubPatchParameters struct { - // Resource location - Location *string - - // Properties of the NotificationHub. + // NotificationHub properties. Properties *NotificationHubProperties - // The sku of the created namespace + // The Sku description for a namespace SKU *SKU - // Resource tags + // Dictionary of Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string } // NotificationHubProperties - NotificationHub properties. type NotificationHubProperties struct { - // The AdmCredential of the created NotificationHub + // Description of a NotificationHub AdmCredential. AdmCredential *AdmCredential - // The ApnsCredential of the created NotificationHub + // Description of a NotificationHub ApnsCredential. ApnsCredential *ApnsCredential - // The AuthorizationRules of the created NotificationHub - AuthorizationRules []*SharedAccessAuthorizationRuleProperties - - // The BaiduCredential of the created NotificationHub + // Description of a NotificationHub BaiduCredential. BaiduCredential *BaiduCredential - // The GcmCredential of the created NotificationHub + // Description of a NotificationHub BrowserCredential. + BrowserCredential *BrowserCredential + + // Description of a NotificationHub GcmCredential. GCMCredential *GCMCredential - // The MpnsCredential of the created NotificationHub + // Description of a NotificationHub MpnsCredential. MpnsCredential *MpnsCredential - // The NotificationHub name. + // Gets or sets the NotificationHub name. Name *string - // The RegistrationTtl of the created NotificationHub + // Gets or sets the RegistrationTtl of the created NotificationHub RegistrationTTL *string - // The WnsCredential of the created NotificationHub + // Description of a NotificationHub WnsCredential. WnsCredential *WnsCredential + + // Description of a NotificationHub XiaomiCredential. + XiaomiCredential *XiaomiCredential + + // READ-ONLY; Gets or sets the AuthorizationRules of the created NotificationHub + AuthorizationRules []*SharedAccessAuthorizationRuleProperties + + // READ-ONLY + DailyMaxActiveDevices *int64 } -// NotificationHubResource - Description of a NotificationHub Resource. +// NotificationHubResource - Notification Hub Resource. type NotificationHubResource struct { - // Resource location + // REQUIRED; The geo-location where the resource lives Location *string - // Properties of the NotificationHub. + // NotificationHub properties. Properties *NotificationHubProperties - // The sku of the created namespace + // The Sku description for a namespace SKU *SKU - // Resource tags + // Resource tags. Tags map[string]*string - // READ-ONLY; Resource Id + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/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 } @@ -585,233 +728,504 @@ type Operation struct { // The object that represents the operation. Display *OperationDisplay - // READ-ONLY; Operation name: {provider}/{resource}/{operation} + // Optional operation properties. + Properties *OperationProperties + + // READ-ONLY; Gets or sets IsDataAction property. It is used to differentiate management and data plane operations. + IsDataAction *bool + + // READ-ONLY; Gets operation name: {provider}/{resource}/{operation} Name *string } // OperationDisplay - The object that represents the operation. type OperationDisplay struct { - // READ-ONLY; Operation type: Read, write, delete, etc. + // READ-ONLY; Human-friendly operation description. + Description *string + + // READ-ONLY; Gets operation type: Read, write, delete, etc. Operation *string - // READ-ONLY; Service provider: Microsoft.NotificationHubs + // READ-ONLY; Gets service provider: Microsoft.NotificationHubs Provider *string - // READ-ONLY; Resource on which the operation is performed: Invoice, etc. + // READ-ONLY; Gets resource on which the operation is performed: Invoice, etc. Resource *string } // OperationListResult - Result of the request to list NotificationHubs operations. It contains a list of operations and a // URL link to get the next set of results. type OperationListResult struct { - // READ-ONLY; URL to get the next set of operation list results if there are any. + // READ-ONLY; Gets URL to get the next set of operation list results if there are any. NextLink *string - // READ-ONLY; List of NotificationHubs operations supported by the Microsoft.NotificationHubs resource provider. + // READ-ONLY; Gets list of NotificationHubs operations supported by the Microsoft.NotificationHubs resource provider. Value []*Operation } +// OperationProperties - Optional operation properties. +type OperationProperties struct { + // Optional service specification used in Operations API. + ServiceSpecification *ServiceSpecification +} + // OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters } -// PnsCredentialsProperties - Description of a NotificationHub PNS Credentials. -type PnsCredentialsProperties struct { - // The AdmCredential of the created NotificationHub +// PnsCredentials - Collection of Notification Hub or Notification Hub Namespace PNS credentials. +type PnsCredentials struct { + // Description of a NotificationHub AdmCredential. AdmCredential *AdmCredential - // The ApnsCredential of the created NotificationHub + // Description of a NotificationHub ApnsCredential. ApnsCredential *ApnsCredential - // The BaiduCredential of the created NotificationHub + // Description of a NotificationHub BaiduCredential. BaiduCredential *BaiduCredential - // The GcmCredential of the created NotificationHub + // Description of a NotificationHub BrowserCredential. + BrowserCredential *BrowserCredential + + // Description of a NotificationHub GcmCredential. GCMCredential *GCMCredential - // The MpnsCredential of the created NotificationHub + // Description of a NotificationHub MpnsCredential. MpnsCredential *MpnsCredential - // The WnsCredential of the created NotificationHub + // Description of a NotificationHub WnsCredential. WnsCredential *WnsCredential + + // Description of a NotificationHub XiaomiCredential. + XiaomiCredential *XiaomiCredential } -// PnsCredentialsResource - Description of a NotificationHub PNS Credentials. +// PnsCredentialsResource - Description of a NotificationHub PNS Credentials. This is a response of the POST requests that +// return namespace or hubs PNS credentials. type PnsCredentialsResource struct { - // Resource location + // Deprecated - only for compatibility. Location *string - // NotificationHub PNS Credentials. - Properties *PnsCredentialsProperties + // Collection of Notification Hub or Notification Hub Namespace PNS credentials. + Properties *PnsCredentials - // The sku of the created namespace - SKU *SKU - - // Resource tags + // Deprecated - only for compatibility. Tags map[string]*string - // READ-ONLY; Resource Id + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/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 } -// PolicykeyResource - Namespace/NotificationHub Regenerate Keys -type PolicykeyResource struct { - // Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary - // Key/Secondary Key. - PolicyKey *string +// PolicyKeyResource - Namespace / NotificationHub Regenerate Keys request. +type PolicyKeyResource struct { + // REQUIRED; Type of Shared Access Policy Key (primary or secondary). + PolicyKey *PolicyKeyType } -type Resource struct { - // Resource location - Location *string +// PrivateEndpointConnectionProperties - Private Endpoint Connection properties. +type PrivateEndpointConnectionProperties struct { + // Represents a Private Endpoint that is connected to Notification Hubs namespace using Private Endpoint Connection. + PrivateEndpoint *RemotePrivateEndpointConnection - // The sku of the created namespace - SKU *SKU + // State of the Private Link Service connection. + PrivateLinkServiceConnectionState *RemotePrivateLinkServiceConnectionState - // Resource tags - Tags map[string]*string + // State of Private Endpoint Connection. + ProvisioningState *PrivateEndpointConnectionProvisioningState + + // READ-ONLY; List of group ids. For Notification Hubs, it always contains a single "namespace" element. + GroupIDs []*string +} - // READ-ONLY; Resource Id +// PrivateEndpointConnectionResource - Represents a Private Endpoint Connection ARM resource - a sub-resource of Notification +// Hubs namespace. +type PrivateEndpointConnectionResource struct { + // Private Endpoint Connection properties. + Properties *PrivateEndpointConnectionProperties + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/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 } -// ResourceListKeys - Namespace/NotificationHub Connection String +// PrivateEndpointConnectionResourceListResult - The response of the List Private Endpoint Connections operation. +type PrivateEndpointConnectionResourceListResult struct { + // READ-ONLY; Gets or sets link to the next set of results. + NextLink *string + + // READ-ONLY; Gets or sets result of the List AuthorizationRules operation. + Value []*PrivateEndpointConnectionResource +} + +// PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete +// method. +type PrivateEndpointConnectionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateEndpointConnectionsClientBeginUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginUpdate +// method. +type PrivateEndpointConnectionsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateEndpointConnectionsClientGetGroupIDOptions contains the optional parameters for the PrivateEndpointConnectionsClient.GetGroupID +// method. +type PrivateEndpointConnectionsClientGetGroupIDOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get +// method. +type PrivateEndpointConnectionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientListGroupIDsOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListGroupIDsPager +// method. +type PrivateEndpointConnectionsClientListGroupIDsOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListPager +// method. +type PrivateEndpointConnectionsClientListOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkResource - A Private Link Arm Resource. +type PrivateLinkResource struct { + // Represents properties of Private Link Resource. + Properties *PrivateLinkResourceProperties + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *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 +} + +// PrivateLinkResourceListResult - The response of the List Private Link Resources operation. +type PrivateLinkResourceListResult struct { + // READ-ONLY; Gets or sets link to the next set of results. + NextLink *string + + // READ-ONLY; Gets or sets result of the List AuthorizationRules operation. + Value []*PrivateLinkResource +} + +// PrivateLinkResourceProperties - Represents properties of Private Link Resource. +type PrivateLinkResourceProperties struct { + // READ-ONLY; A Group Id for Private Link. For Notification Hubs, it is always set to "namespace". + GroupID *string + + // READ-ONLY; Required members. For Notification Hubs, it's always a collection with a single "namespace" item. + RequiredMembers []*string + + // READ-ONLY; Required DNS zone names. For Notification Hubs, it contains two CNames for Service Bus and Notification Hubs + // zones. + RequiredZoneNames []*string +} + +// PrivateLinkServiceConnection - A customer-visible sub-resource of Private Endpoint, which describe the connection between +// Private Endpoint and Notification Hubs namespace. +type PrivateLinkServiceConnection struct { + // List of group ids. Always contains a single element - "namespace" - for Notification Hub Namespace. + GroupIDs []*string + + // Name of the Private Link Service connection. + Name *string + + // Request message provided by the user that created the connection. This is usually used when the connection requires manual + // approval. + RequestMessage *string +} + +// ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a +// location +type ProxyResource struct { + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *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 +} + +// PublicInternetAuthorizationRule - A default (public Internet) network authorization rule, which contains rights if no other +// network rule matches. +type PublicInternetAuthorizationRule struct { + // REQUIRED; List of access rights. + Rights []*AccessRights +} + +// RegistrationResult - Notification result for a single registration. +type RegistrationResult struct { + // READ-ONLY; PNS type. + ApplicationPlatform *string + + // READ-ONLY; Notification outcome. + Outcome *string + + // READ-ONLY; PNS handle. + PnsHandle *string + + // READ-ONLY; Registration id. + RegistrationID *string +} + +// RemotePrivateEndpointConnection - Represents a Private Endpoint that is connected to Notification Hubs namespace using +// Private Endpoint Connection. +type RemotePrivateEndpointConnection struct { + // READ-ONLY; ARM resource ID of the Private Endpoint. This may belong to different subscription and resource group than a + // Notification Hubs namespace. + ID *string +} + +// RemotePrivateLinkServiceConnectionState - State of the Private Link Service connection. +type RemotePrivateLinkServiceConnectionState struct { + // State of Private Link Connection. + Status *PrivateLinkConnectionStatus + + // READ-ONLY; Human-friendly description of required actions. + ActionsRequired *string + + // READ-ONLY; Human-friendly description. + Description *string +} + +// Resource - Common fields that are returned in the response for all Azure Resource Manager resources +type Resource struct { + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *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 +} + +// ResourceListKeys - Response for the POST request that returns Namespace or NotificationHub access keys (connection strings). type ResourceListKeys struct { - // KeyName of the created AuthorizationRule + // READ-ONLY; Gets or sets keyName of the created AuthorizationRule KeyName *string - // PrimaryConnectionString of the AuthorizationRule. + // READ-ONLY; Gets or sets primaryConnectionString of the AuthorizationRule. PrimaryConnectionString *string - // PrimaryKey of the created AuthorizationRule. + // READ-ONLY; Gets or sets primaryKey of the created AuthorizationRule. PrimaryKey *string - // SecondaryConnectionString of the created AuthorizationRule + // READ-ONLY; Gets or sets secondaryConnectionString of the created AuthorizationRule SecondaryConnectionString *string - // SecondaryKey of the created AuthorizationRule + // READ-ONLY; Gets or sets secondaryKey of the created AuthorizationRule SecondaryKey *string } // SKU - The Sku description for a namespace type SKU struct { - // REQUIRED; Name of the notification hub sku + // REQUIRED; Namespace SKU name. Name *SKUName - // The capacity of the resource + // Gets or sets the capacity of the resource Capacity *int32 - // The Sku Family + // Gets or sets the Sku Family Family *string - // The Sku size + // Gets or sets the Sku size Size *string - // The tier of particular sku + // Gets or sets the tier of particular sku Tier *string } -// SharedAccessAuthorizationRuleCreateOrUpdateParameters - Parameters supplied to the CreateOrUpdate Namespace AuthorizationRules. -type SharedAccessAuthorizationRuleCreateOrUpdateParameters struct { - // REQUIRED; Properties of the Namespace AuthorizationRules. - Properties *SharedAccessAuthorizationRuleProperties +// ServiceSpecification - Optional service specification used in Operations API. +type ServiceSpecification struct { + // READ-ONLY; Log specifications. + LogSpecifications []*LogSpecification + + // READ-ONLY; Metric specification. + MetricSpecifications []*MetricSpecification } // SharedAccessAuthorizationRuleListResult - The response of the List Namespace operation. type SharedAccessAuthorizationRuleListResult struct { - // Link to the next set of results. Not empty if Value contains incomplete list of AuthorizationRules + // READ-ONLY; Gets or sets link to the next set of results. NextLink *string - // Result of the List AuthorizationRules operation. + // READ-ONLY; Gets or sets result of the List AuthorizationRules operation. Value []*SharedAccessAuthorizationRuleResource } // SharedAccessAuthorizationRuleProperties - SharedAccessAuthorizationRule properties. type SharedAccessAuthorizationRuleProperties struct { - // The rights associated with the rule. + // REQUIRED; Gets or sets the rights associated with the rule. Rights []*AccessRights - // READ-ONLY; A string that describes the claim type + // Gets a base64-encoded 256-bit primary key for signing and validating the SAS token. + PrimaryKey *string + + // Gets a base64-encoded 256-bit primary key for signing and validating the SAS token. + SecondaryKey *string + + // READ-ONLY; Gets a string that describes the claim type ClaimType *string - // READ-ONLY; A string that describes the claim value + // READ-ONLY; Gets a string that describes the claim value ClaimValue *string - // READ-ONLY; The created time for this rule - CreatedTime *string + // READ-ONLY; Gets the created time for this rule + CreatedTime *time.Time - // READ-ONLY; A string that describes the authorization rule. + // READ-ONLY; Gets a string that describes the authorization rule. KeyName *string - // READ-ONLY; The last modified time for this rule - ModifiedTime *string - - // READ-ONLY; A base64-encoded 256-bit primary key for signing and validating the SAS token. - PrimaryKey *string + // READ-ONLY; Gets the last modified time for this rule + ModifiedTime *time.Time - // READ-ONLY; The revision number for the rule + // READ-ONLY; Gets the revision number for the rule Revision *int32 - - // READ-ONLY; A base64-encoded 256-bit primary key for signing and validating the SAS token. - SecondaryKey *string } -// SharedAccessAuthorizationRuleResource - Description of a Namespace AuthorizationRules. +// SharedAccessAuthorizationRuleResource - Response for POST requests that return single SharedAccessAuthorizationRule. type SharedAccessAuthorizationRuleResource struct { - // Resource location + // Deprecated - only for compatibility. Location *string - // Properties of the Namespace AuthorizationRule. + // SharedAccessAuthorizationRule properties. Properties *SharedAccessAuthorizationRuleProperties - // The sku of the created namespace - SKU *SKU - - // Resource tags + // Deprecated - only for compatibility. Tags map[string]*string - // READ-ONLY; Resource Id + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/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 } -type SubResource struct { - // Resource Id +// SystemData - Metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // The timestamp of resource creation (UTC). + CreatedAt *time.Time + + // The identity that created the resource. + CreatedBy *string + + // The type of identity that created the resource. + CreatedByType *CreatedByType + + // The timestamp of resource last modification (UTC) + LastModifiedAt *time.Time + + // The identity that last modified the resource. + LastModifiedBy *string + + // The type of identity that last modified the resource. + LastModifiedByType *CreatedByType +} + +// TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' +// and a 'location' +type TrackedResource struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *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 } // WnsCredential - Description of a NotificationHub WnsCredential. type WnsCredential struct { - // Properties of NotificationHub WnsCredential. + // REQUIRED; Description of a NotificationHub WnsCredential. Properties *WnsCredentialProperties } // WnsCredentialProperties - Description of a NotificationHub WnsCredential. type WnsCredentialProperties struct { - // The package ID for this credential. + // Ges or sets the WNS Certificate Key. + CertificateKey *string + + // Gets or sets the package ID for this credential. PackageSid *string - // The secret key. + // Gets or sets the secret key. SecretKey *string - // The Windows Live endpoint. + // Gets or sets the Windows Live endpoint. WindowsLiveEndpoint *string + + // Gets or sets the WNS Certificate. + WnsCertificate *string +} + +// XiaomiCredential - Description of a NotificationHub XiaomiCredential. +type XiaomiCredential struct { + // REQUIRED; Description of a NotificationHub XiaomiCredentialProperties. + Properties *XiaomiCredentialProperties +} + +// XiaomiCredentialProperties - Description of a NotificationHub XiaomiCredentialProperties. +type XiaomiCredentialProperties struct { + // Gets or sets app secret. + AppSecret *string + + // Gets or sets xiaomi service endpoint. + Endpoint *string } diff --git a/sdk/resourcemanager/notificationhubs/armnotificationhubs/models_serde.go b/sdk/resourcemanager/notificationhubs/armnotificationhubs/models_serde.go index 1c751efd31ae..e35d67f5347d 100644 --- a/sdk/resourcemanager/notificationhubs/armnotificationhubs/models_serde.go +++ b/sdk/resourcemanager/notificationhubs/armnotificationhubs/models_serde.go @@ -160,6 +160,37 @@ func (a *ApnsCredentialProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type Availability. +func (a Availability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "blobDuration", a.BlobDuration) + populate(objectMap, "timeGrain", a.TimeGrain) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Availability. +func (a *Availability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "blobDuration": + err = unpopulate(val, "BlobDuration", &a.BlobDuration) + delete(rawMsg, key) + case "timeGrain": + err = unpopulate(val, "TimeGrain", &a.TimeGrain) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type BaiduCredential. func (b BaiduCredential) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -222,6 +253,68 @@ func (b *BaiduCredentialProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type BrowserCredential. +func (b BrowserCredential) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", b.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BrowserCredential. +func (b *BrowserCredential) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BrowserCredentialProperties. +func (b BrowserCredentialProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "subject", b.Subject) + populate(objectMap, "vapidPrivateKey", b.VapidPrivateKey) + populate(objectMap, "vapidPublicKey", b.VapidPublicKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BrowserCredentialProperties. +func (b *BrowserCredentialProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "subject": + err = unpopulate(val, "Subject", &b.Subject) + delete(rawMsg, key) + case "vapidPrivateKey": + err = unpopulate(val, "VapidPrivateKey", &b.VapidPrivateKey) + delete(rawMsg, key) + case "vapidPublicKey": + err = unpopulate(val, "VapidPublicKey", &b.VapidPublicKey) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type CheckAvailabilityParameters. func (c CheckAvailabilityParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -281,6 +374,7 @@ func (c CheckAvailabilityResult) MarshalJSON() ([]byte, error) { populate(objectMap, "location", c.Location) populate(objectMap, "name", c.Name) populate(objectMap, "sku", c.SKU) + populate(objectMap, "systemData", c.SystemData) populate(objectMap, "tags", c.Tags) populate(objectMap, "type", c.Type) return json.Marshal(objectMap) @@ -310,6 +404,9 @@ func (c *CheckAvailabilityResult) UnmarshalJSON(data []byte) error { case "sku": err = unpopulate(val, "SKU", &c.SKU) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &c.Tags) delete(rawMsg, key) @@ -324,6 +421,49 @@ func (c *CheckAvailabilityResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ConnectionDetails. +func (c ConnectionDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "groupId", c.GroupID) + populate(objectMap, "id", c.ID) + populate(objectMap, "linkIdentifier", c.LinkIdentifier) + populate(objectMap, "memberName", c.MemberName) + populate(objectMap, "privateIpAddress", c.PrivateIPAddress) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionDetails. +func (c *ConnectionDetails) 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 "groupId": + err = unpopulate(val, "GroupID", &c.GroupID) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "linkIdentifier": + err = unpopulate(val, "LinkIdentifier", &c.LinkIdentifier) + delete(rawMsg, key) + case "memberName": + err = unpopulate(val, "MemberName", &c.MemberName) + delete(rawMsg, key) + case "privateIpAddress": + err = unpopulate(val, "PrivateIPAddress", &c.PrivateIPAddress) + 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 DebugSendResponse. func (d DebugSendResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -331,7 +471,7 @@ func (d DebugSendResponse) MarshalJSON() ([]byte, error) { populate(objectMap, "location", d.Location) populate(objectMap, "name", d.Name) populate(objectMap, "properties", d.Properties) - populate(objectMap, "sku", d.SKU) + populate(objectMap, "systemData", d.SystemData) populate(objectMap, "tags", d.Tags) populate(objectMap, "type", d.Type) return json.Marshal(objectMap) @@ -358,8 +498,8 @@ func (d *DebugSendResponse) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &d.SKU) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &d.Tags) @@ -379,7 +519,7 @@ func (d *DebugSendResponse) UnmarshalJSON(data []byte) error { func (d DebugSendResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "failure", d.Failure) - populateAny(objectMap, "results", d.Results) + populate(objectMap, "results", d.Results) populate(objectMap, "success", d.Success) return json.Marshal(objectMap) } @@ -410,16 +550,50 @@ func (d *DebugSendResult) UnmarshalJSON(data []byte) error { 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 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 ErrorDetail. +func (e ErrorDetail) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "additionalInfo", e.AdditionalInfo) populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. -func (e *ErrorResponse) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. +func (e *ErrorDetail) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -427,12 +601,48 @@ func (e *ErrorResponse) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + delete(rawMsg, key) case "code": err = unpopulate(val, "Code", &e.Code) delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) case "message": err = unpopulate(val, "Message", &e.Message) delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. +func (e ErrorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "error", e.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. +func (e *ErrorResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &e.Error) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -499,198 +709,325 @@ func (g *GCMCredentialProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MpnsCredential. -func (m MpnsCredential) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GroupConnectivityInformation. +func (g GroupConnectivityInformation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", m.Properties) + populate(objectMap, "customerVisibleFqdns", g.CustomerVisibleFqdns) + populate(objectMap, "groupId", g.GroupID) + populate(objectMap, "internalFqdn", g.InternalFqdn) + populate(objectMap, "memberName", g.MemberName) + populate(objectMap, "privateLinkServiceArmRegion", g.PrivateLinkServiceArmRegion) + populate(objectMap, "redirectMapId", g.RedirectMapID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MpnsCredential. -func (m *MpnsCredential) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GroupConnectivityInformation. +func (g *GroupConnectivityInformation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &m.Properties) + case "customerVisibleFqdns": + err = unpopulate(val, "CustomerVisibleFqdns", &g.CustomerVisibleFqdns) + delete(rawMsg, key) + case "groupId": + err = unpopulate(val, "GroupID", &g.GroupID) + delete(rawMsg, key) + case "internalFqdn": + err = unpopulate(val, "InternalFqdn", &g.InternalFqdn) + delete(rawMsg, key) + case "memberName": + err = unpopulate(val, "MemberName", &g.MemberName) + delete(rawMsg, key) + case "privateLinkServiceArmRegion": + err = unpopulate(val, "PrivateLinkServiceArmRegion", &g.PrivateLinkServiceArmRegion) + delete(rawMsg, key) + case "redirectMapId": + err = unpopulate(val, "RedirectMapID", &g.RedirectMapID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MpnsCredentialProperties. -func (m MpnsCredentialProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IPRule. +func (i IPRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "certificateKey", m.CertificateKey) - populate(objectMap, "mpnsCertificate", m.MpnsCertificate) - populate(objectMap, "thumbprint", m.Thumbprint) + populate(objectMap, "ipMask", i.IPMask) + populate(objectMap, "rights", i.Rights) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MpnsCredentialProperties. -func (m *MpnsCredentialProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IPRule. +func (i *IPRule) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "certificateKey": - err = unpopulate(val, "CertificateKey", &m.CertificateKey) - delete(rawMsg, key) - case "mpnsCertificate": - err = unpopulate(val, "MpnsCertificate", &m.MpnsCertificate) + case "ipMask": + err = unpopulate(val, "IPMask", &i.IPMask) delete(rawMsg, key) - case "thumbprint": - err = unpopulate(val, "Thumbprint", &m.Thumbprint) + case "rights": + err = unpopulate(val, "Rights", &i.Rights) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NamespaceCreateOrUpdateParameters. -func (n NamespaceCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LogSpecification. +func (l LogSpecification) 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, "sku", n.SKU) - populate(objectMap, "tags", n.Tags) - populate(objectMap, "type", n.Type) + populate(objectMap, "blobDuration", l.BlobDuration) + populate(objectMap, "displayName", l.DisplayName) + populate(objectMap, "name", l.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NamespaceCreateOrUpdateParameters. -func (n *NamespaceCreateOrUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LogSpecification. +func (l *LogSpecification) 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) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &n.ID) + case "blobDuration": + err = unpopulate(val, "BlobDuration", &l.BlobDuration) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &n.Location) + case "displayName": + err = unpopulate(val, "DisplayName", &l.DisplayName) 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 "sku": - err = unpopulate(val, "SKU", &n.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &n.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &n.Type) + err = unpopulate(val, "Name", &l.Name) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NamespaceListResult. -func (n NamespaceListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MetricSpecification. +func (m MetricSpecification) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", n.NextLink) - populate(objectMap, "value", n.Value) + populate(objectMap, "aggregationType", m.AggregationType) + populate(objectMap, "availabilities", m.Availabilities) + populate(objectMap, "displayDescription", m.DisplayDescription) + populate(objectMap, "displayName", m.DisplayName) + populate(objectMap, "fillGapWithZero", m.FillGapWithZero) + populate(objectMap, "metricFilterPattern", m.MetricFilterPattern) + populate(objectMap, "name", m.Name) + populate(objectMap, "unit", m.Unit) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NamespaceListResult. -func (n *NamespaceListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricSpecification. +func (m *MetricSpecification) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &n.NextLink) + case "aggregationType": + err = unpopulate(val, "AggregationType", &m.AggregationType) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &n.Value) + case "availabilities": + err = unpopulate(val, "Availabilities", &m.Availabilities) + delete(rawMsg, key) + case "displayDescription": + err = unpopulate(val, "DisplayDescription", &m.DisplayDescription) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &m.DisplayName) + delete(rawMsg, key) + case "fillGapWithZero": + err = unpopulate(val, "FillGapWithZero", &m.FillGapWithZero) + delete(rawMsg, key) + case "metricFilterPattern": + err = unpopulate(val, "MetricFilterPattern", &m.MetricFilterPattern) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &m.Unit) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NamespacePatchParameters. -func (n NamespacePatchParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MpnsCredential. +func (m MpnsCredential) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "sku", n.SKU) - populate(objectMap, "tags", n.Tags) + populate(objectMap, "properties", m.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NamespacePatchParameters. -func (n *NamespacePatchParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MpnsCredential. +func (m *MpnsCredential) 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) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "sku": - err = unpopulate(val, "SKU", &n.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &n.Tags) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NamespaceProperties. -func (n NamespaceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MpnsCredentialProperties. +func (m MpnsCredentialProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateTimeRFC3339(objectMap, "createdAt", n.CreatedAt) - populate(objectMap, "critical", n.Critical) + populate(objectMap, "certificateKey", m.CertificateKey) + populate(objectMap, "mpnsCertificate", m.MpnsCertificate) + populate(objectMap, "thumbprint", m.Thumbprint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MpnsCredentialProperties. +func (m *MpnsCredentialProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "certificateKey": + err = unpopulate(val, "CertificateKey", &m.CertificateKey) + delete(rawMsg, key) + case "mpnsCertificate": + err = unpopulate(val, "MpnsCertificate", &m.MpnsCertificate) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &m.Thumbprint) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NamespaceListResult. +func (n NamespaceListResult) 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 NamespaceListResult. +func (n *NamespaceListResult) 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 NamespacePatchParameters. +func (n NamespacePatchParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "sku", n.SKU) + populate(objectMap, "tags", n.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NamespacePatchParameters. +func (n *NamespacePatchParameters) 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) + case "sku": + err = unpopulate(val, "SKU", &n.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) + 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 NamespaceProperties. +func (n NamespaceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "createdAt", n.CreatedAt) + populate(objectMap, "critical", n.Critical) populate(objectMap, "dataCenter", n.DataCenter) populate(objectMap, "enabled", n.Enabled) populate(objectMap, "metricId", n.MetricID) populate(objectMap, "name", n.Name) populate(objectMap, "namespaceType", n.NamespaceType) + populate(objectMap, "networkAcls", n.NetworkACLs) + populate(objectMap, "pnsCredentials", n.PnsCredentials) + populate(objectMap, "privateEndpointConnections", n.PrivateEndpointConnections) populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "publicNetworkAccess", n.PublicNetworkAccess) populate(objectMap, "region", n.Region) + populate(objectMap, "replicationRegion", n.ReplicationRegion) populate(objectMap, "scaleUnit", n.ScaleUnit) populate(objectMap, "serviceBusEndpoint", n.ServiceBusEndpoint) populate(objectMap, "status", n.Status) populate(objectMap, "subscriptionId", n.SubscriptionID) populateTimeRFC3339(objectMap, "updatedAt", n.UpdatedAt) + populate(objectMap, "zoneRedundancy", n.ZoneRedundancy) return json.Marshal(objectMap) } @@ -724,12 +1061,27 @@ func (n *NamespaceProperties) UnmarshalJSON(data []byte) error { case "namespaceType": err = unpopulate(val, "NamespaceType", &n.NamespaceType) delete(rawMsg, key) + case "networkAcls": + err = unpopulate(val, "NetworkACLs", &n.NetworkACLs) + delete(rawMsg, key) + case "pnsCredentials": + err = unpopulate(val, "PnsCredentials", &n.PnsCredentials) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &n.PrivateEndpointConnections) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &n.PublicNetworkAccess) + delete(rawMsg, key) case "region": err = unpopulate(val, "Region", &n.Region) delete(rawMsg, key) + case "replicationRegion": + err = unpopulate(val, "ReplicationRegion", &n.ReplicationRegion) + delete(rawMsg, key) case "scaleUnit": err = unpopulate(val, "ScaleUnit", &n.ScaleUnit) delete(rawMsg, key) @@ -745,6 +1097,9 @@ func (n *NamespaceProperties) UnmarshalJSON(data []byte) error { case "updatedAt": err = unpopulateTimeRFC3339(val, "UpdatedAt", &n.UpdatedAt) delete(rawMsg, key) + case "zoneRedundancy": + err = unpopulate(val, "ZoneRedundancy", &n.ZoneRedundancy) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -761,6 +1116,7 @@ func (n NamespaceResource) MarshalJSON() ([]byte, error) { populate(objectMap, "name", n.Name) populate(objectMap, "properties", n.Properties) populate(objectMap, "sku", n.SKU) + populate(objectMap, "systemData", n.SystemData) populate(objectMap, "tags", n.Tags) populate(objectMap, "type", n.Type) return json.Marshal(objectMap) @@ -790,6 +1146,9 @@ func (n *NamespaceResource) UnmarshalJSON(data []byte) error { case "sku": err = unpopulate(val, "SKU", &n.SKU) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &n.SystemData) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &n.Tags) delete(rawMsg, key) @@ -804,21 +1163,16 @@ func (n *NamespaceResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NotificationHubCreateOrUpdateParameters. -func (n NotificationHubCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkACLs. +func (n NetworkACLs) 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, "sku", n.SKU) - populate(objectMap, "tags", n.Tags) - populate(objectMap, "type", n.Type) + populate(objectMap, "ipRules", n.IPRules) + populate(objectMap, "publicNetworkRule", n.PublicNetworkRule) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NotificationHubCreateOrUpdateParameters. -func (n *NotificationHubCreateOrUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkACLs. +func (n *NetworkACLs) 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) @@ -826,26 +1180,11 @@ func (n *NotificationHubCreateOrUpdateParameters) UnmarshalJSON(data []byte) 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) + case "ipRules": + err = unpopulate(val, "IPRules", &n.IPRules) delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &n.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &n.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &n.Type) + case "publicNetworkRule": + err = unpopulate(val, "PublicNetworkRule", &n.PublicNetworkRule) delete(rawMsg, key) } if err != nil { @@ -889,13 +1228,9 @@ func (n *NotificationHubListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type NotificationHubPatchParameters. func (n NotificationHubPatchParameters) 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, "sku", n.SKU) populate(objectMap, "tags", n.Tags) - populate(objectMap, "type", n.Type) return json.Marshal(objectMap) } @@ -908,15 +1243,6 @@ func (n *NotificationHubPatchParameters) UnmarshalJSON(data []byte) error { 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) @@ -926,9 +1252,6 @@ func (n *NotificationHubPatchParameters) UnmarshalJSON(data []byte) error { case "tags": err = unpopulate(val, "Tags", &n.Tags) 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) @@ -944,11 +1267,14 @@ func (n NotificationHubProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "apnsCredential", n.ApnsCredential) populate(objectMap, "authorizationRules", n.AuthorizationRules) populate(objectMap, "baiduCredential", n.BaiduCredential) + populate(objectMap, "browserCredential", n.BrowserCredential) + populate(objectMap, "dailyMaxActiveDevices", n.DailyMaxActiveDevices) populate(objectMap, "gcmCredential", n.GCMCredential) populate(objectMap, "mpnsCredential", n.MpnsCredential) populate(objectMap, "name", n.Name) populate(objectMap, "registrationTtl", n.RegistrationTTL) populate(objectMap, "wnsCredential", n.WnsCredential) + populate(objectMap, "xiaomiCredential", n.XiaomiCredential) return json.Marshal(objectMap) } @@ -973,6 +1299,12 @@ func (n *NotificationHubProperties) UnmarshalJSON(data []byte) error { case "baiduCredential": err = unpopulate(val, "BaiduCredential", &n.BaiduCredential) delete(rawMsg, key) + case "browserCredential": + err = unpopulate(val, "BrowserCredential", &n.BrowserCredential) + delete(rawMsg, key) + case "dailyMaxActiveDevices": + err = unpopulate(val, "DailyMaxActiveDevices", &n.DailyMaxActiveDevices) + delete(rawMsg, key) case "gcmCredential": err = unpopulate(val, "GCMCredential", &n.GCMCredential) delete(rawMsg, key) @@ -985,285 +1317,763 @@ func (n *NotificationHubProperties) UnmarshalJSON(data []byte) error { case "registrationTtl": err = unpopulate(val, "RegistrationTTL", &n.RegistrationTTL) delete(rawMsg, key) - case "wnsCredential": - err = unpopulate(val, "WnsCredential", &n.WnsCredential) + case "wnsCredential": + err = unpopulate(val, "WnsCredential", &n.WnsCredential) + delete(rawMsg, key) + case "xiaomiCredential": + err = unpopulate(val, "XiaomiCredential", &n.XiaomiCredential) + 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 NotificationHubResource. +func (n NotificationHubResource) 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, "sku", n.SKU) + populate(objectMap, "systemData", n.SystemData) + populate(objectMap, "tags", n.Tags) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NotificationHubResource. +func (n *NotificationHubResource) 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 "sku": + err = unpopulate(val, "SKU", &n.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &n.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) + 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 Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "display", o.Display) + populate(objectMap, "isDataAction", o.IsDataAction) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. +func (o *OperationDisplay) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. +func (o *OperationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationProperties. +func (o OperationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "serviceSpecification", o.ServiceSpecification) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationProperties. +func (o *OperationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "serviceSpecification": + err = unpopulate(val, "ServiceSpecification", &o.ServiceSpecification) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PnsCredentials. +func (p PnsCredentials) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "admCredential", p.AdmCredential) + populate(objectMap, "apnsCredential", p.ApnsCredential) + populate(objectMap, "baiduCredential", p.BaiduCredential) + populate(objectMap, "browserCredential", p.BrowserCredential) + populate(objectMap, "gcmCredential", p.GCMCredential) + populate(objectMap, "mpnsCredential", p.MpnsCredential) + populate(objectMap, "wnsCredential", p.WnsCredential) + populate(objectMap, "xiaomiCredential", p.XiaomiCredential) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PnsCredentials. +func (p *PnsCredentials) 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 "admCredential": + err = unpopulate(val, "AdmCredential", &p.AdmCredential) + delete(rawMsg, key) + case "apnsCredential": + err = unpopulate(val, "ApnsCredential", &p.ApnsCredential) + delete(rawMsg, key) + case "baiduCredential": + err = unpopulate(val, "BaiduCredential", &p.BaiduCredential) + delete(rawMsg, key) + case "browserCredential": + err = unpopulate(val, "BrowserCredential", &p.BrowserCredential) + delete(rawMsg, key) + case "gcmCredential": + err = unpopulate(val, "GCMCredential", &p.GCMCredential) + delete(rawMsg, key) + case "mpnsCredential": + err = unpopulate(val, "MpnsCredential", &p.MpnsCredential) + delete(rawMsg, key) + case "wnsCredential": + err = unpopulate(val, "WnsCredential", &p.WnsCredential) + delete(rawMsg, key) + case "xiaomiCredential": + err = unpopulate(val, "XiaomiCredential", &p.XiaomiCredential) + 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 PnsCredentialsResource. +func (p PnsCredentialsResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PnsCredentialsResource. +func (p *PnsCredentialsResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PolicyKeyResource. +func (p PolicyKeyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "policyKey", p.PolicyKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyKeyResource. +func (p *PolicyKeyResource) 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 "policyKey": + err = unpopulate(val, "PolicyKey", &p.PolicyKey) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. +func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "groupIds", p.GroupIDs) + populate(objectMap, "privateEndpoint", p.PrivateEndpoint) + populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) + populate(objectMap, "provisioningState", p.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties. +func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "groupIds": + err = unpopulate(val, "GroupIDs", &p.GroupIDs) + delete(rawMsg, key) + case "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) + delete(rawMsg, key) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionResource. +func (p PrivateEndpointConnectionResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionResource. +func (p *PrivateEndpointConnectionResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionResourceListResult. +func (p PrivateEndpointConnectionResourceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionResourceListResult. +func (p *PrivateEndpointConnectionResourceListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. +func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource. +func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. +func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult. +func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NotificationHubResource. -func (n NotificationHubResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. +func (p PrivateLinkResourceProperties) 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, "sku", n.SKU) - populate(objectMap, "tags", n.Tags) - populate(objectMap, "type", n.Type) + populate(objectMap, "groupId", p.GroupID) + populate(objectMap, "requiredMembers", p.RequiredMembers) + populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NotificationHubResource. -func (n *NotificationHubResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties. +func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, 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", &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 "sku": - err = unpopulate(val, "SKU", &n.SKU) + case "groupId": + err = unpopulate(val, "GroupID", &p.GroupID) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &n.Tags) + case "requiredMembers": + err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &n.Type) + case "requiredZoneNames": + err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Operation. -func (o Operation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnection. +func (p PrivateLinkServiceConnection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "display", o.Display) - populate(objectMap, "name", o.Name) + populate(objectMap, "groupIds", p.GroupIDs) + populate(objectMap, "name", p.Name) + populate(objectMap, "requestMessage", p.RequestMessage) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. -func (o *Operation) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnection. +func (p *PrivateLinkServiceConnection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "display": - err = unpopulate(val, "Display", &o.Display) + case "groupIds": + err = unpopulate(val, "GroupIDs", &p.GroupIDs) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &o.Name) + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "requestMessage": + err = unpopulate(val, "RequestMessage", &p.RequestMessage) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. -func (o OperationDisplay) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProxyResource. +func (p ProxyResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "operation", o.Operation) - populate(objectMap, "provider", o.Provider) - populate(objectMap, "resource", o.Resource) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. -func (o *OperationDisplay) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. +func (p *ProxyResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "operation": - err = unpopulate(val, "Operation", &o.Operation) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "provider": - err = unpopulate(val, "Provider", &o.Provider) + case "name": + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &o.Resource) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationListResult. -func (o OperationListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PublicInternetAuthorizationRule. +func (p PublicInternetAuthorizationRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) + populate(objectMap, "rights", p.Rights) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. -func (o *OperationListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PublicInternetAuthorizationRule. +func (p *PublicInternetAuthorizationRule) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &o.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &o.Value) + case "rights": + err = unpopulate(val, "Rights", &p.Rights) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PnsCredentialsProperties. -func (p PnsCredentialsProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegistrationResult. +func (r RegistrationResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "admCredential", p.AdmCredential) - populate(objectMap, "apnsCredential", p.ApnsCredential) - populate(objectMap, "baiduCredential", p.BaiduCredential) - populate(objectMap, "gcmCredential", p.GCMCredential) - populate(objectMap, "mpnsCredential", p.MpnsCredential) - populate(objectMap, "wnsCredential", p.WnsCredential) + populate(objectMap, "applicationPlatform", r.ApplicationPlatform) + populate(objectMap, "outcome", r.Outcome) + populate(objectMap, "pnsHandle", r.PnsHandle) + populate(objectMap, "registrationId", r.RegistrationID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PnsCredentialsProperties. -func (p *PnsCredentialsProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistrationResult. +func (r *RegistrationResult) 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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "admCredential": - err = unpopulate(val, "AdmCredential", &p.AdmCredential) - delete(rawMsg, key) - case "apnsCredential": - err = unpopulate(val, "ApnsCredential", &p.ApnsCredential) + case "applicationPlatform": + err = unpopulate(val, "ApplicationPlatform", &r.ApplicationPlatform) delete(rawMsg, key) - case "baiduCredential": - err = unpopulate(val, "BaiduCredential", &p.BaiduCredential) - delete(rawMsg, key) - case "gcmCredential": - err = unpopulate(val, "GCMCredential", &p.GCMCredential) + case "outcome": + err = unpopulate(val, "Outcome", &r.Outcome) delete(rawMsg, key) - case "mpnsCredential": - err = unpopulate(val, "MpnsCredential", &p.MpnsCredential) + case "pnsHandle": + err = unpopulate(val, "PnsHandle", &r.PnsHandle) delete(rawMsg, key) - case "wnsCredential": - err = unpopulate(val, "WnsCredential", &p.WnsCredential) + case "registrationId": + err = unpopulate(val, "RegistrationID", &r.RegistrationID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PnsCredentialsResource. -func (p PnsCredentialsResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RemotePrivateEndpointConnection. +func (r RemotePrivateEndpointConnection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "sku", p.SKU) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) + populate(objectMap, "id", r.ID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PnsCredentialsResource. -func (p *PnsCredentialsResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RemotePrivateEndpointConnection. +func (r *RemotePrivateEndpointConnection) 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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &p.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PolicykeyResource. -func (p PolicykeyResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RemotePrivateLinkServiceConnectionState. +func (r RemotePrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "policyKey", p.PolicyKey) + populate(objectMap, "actionsRequired", r.ActionsRequired) + populate(objectMap, "description", r.Description) + populate(objectMap, "status", r.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PolicykeyResource. -func (p *PolicykeyResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RemotePrivateLinkServiceConnectionState. +func (r *RemotePrivateLinkServiceConnectionState) 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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "policyKey": - err = unpopulate(val, "PolicyKey", &p.PolicyKey) + case "actionsRequired": + err = unpopulate(val, "ActionsRequired", &r.ActionsRequired) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &r.Description) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &r.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil @@ -1273,10 +2083,8 @@ func (p *PolicykeyResource) UnmarshalJSON(data []byte) error { func (r Resource) 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, "sku", r.SKU) - populate(objectMap, "tags", r.Tags) + populate(objectMap, "systemData", r.SystemData) populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } @@ -1293,17 +2101,11 @@ func (r *Resource) UnmarshalJSON(data []byte) error { 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 "sku": - err = unpopulate(val, "SKU", &r.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &r.Type) @@ -1402,15 +2204,16 @@ func (s *SKU) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SharedAccessAuthorizationRuleCreateOrUpdateParameters. -func (s SharedAccessAuthorizationRuleCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServiceSpecification. +func (s ServiceSpecification) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", s.Properties) + populate(objectMap, "logSpecifications", s.LogSpecifications) + populate(objectMap, "metricSpecifications", s.MetricSpecifications) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedAccessAuthorizationRuleCreateOrUpdateParameters. -func (s *SharedAccessAuthorizationRuleCreateOrUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceSpecification. +func (s *ServiceSpecification) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -1418,8 +2221,11 @@ func (s *SharedAccessAuthorizationRuleCreateOrUpdateParameters) UnmarshalJSON(da for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &s.Properties) + case "logSpecifications": + err = unpopulate(val, "LogSpecifications", &s.LogSpecifications) + delete(rawMsg, key) + case "metricSpecifications": + err = unpopulate(val, "MetricSpecifications", &s.MetricSpecifications) delete(rawMsg, key) } if err != nil { @@ -1465,9 +2271,9 @@ func (s SharedAccessAuthorizationRuleProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "claimType", s.ClaimType) populate(objectMap, "claimValue", s.ClaimValue) - populate(objectMap, "createdTime", s.CreatedTime) + populateTimeRFC3339(objectMap, "createdTime", s.CreatedTime) populate(objectMap, "keyName", s.KeyName) - populate(objectMap, "modifiedTime", s.ModifiedTime) + populateTimeRFC3339(objectMap, "modifiedTime", s.ModifiedTime) populate(objectMap, "primaryKey", s.PrimaryKey) populate(objectMap, "revision", s.Revision) populate(objectMap, "rights", s.Rights) @@ -1491,13 +2297,13 @@ func (s *SharedAccessAuthorizationRuleProperties) UnmarshalJSON(data []byte) err err = unpopulate(val, "ClaimValue", &s.ClaimValue) delete(rawMsg, key) case "createdTime": - err = unpopulate(val, "CreatedTime", &s.CreatedTime) + err = unpopulateTimeRFC3339(val, "CreatedTime", &s.CreatedTime) delete(rawMsg, key) case "keyName": err = unpopulate(val, "KeyName", &s.KeyName) delete(rawMsg, key) case "modifiedTime": - err = unpopulate(val, "ModifiedTime", &s.ModifiedTime) + err = unpopulateTimeRFC3339(val, "ModifiedTime", &s.ModifiedTime) delete(rawMsg, key) case "primaryKey": err = unpopulate(val, "PrimaryKey", &s.PrimaryKey) @@ -1526,7 +2332,7 @@ func (s SharedAccessAuthorizationRuleResource) MarshalJSON() ([]byte, error) { populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) - populate(objectMap, "sku", s.SKU) + populate(objectMap, "systemData", s.SystemData) populate(objectMap, "tags", s.Tags) populate(objectMap, "type", s.Type) return json.Marshal(objectMap) @@ -1553,8 +2359,8 @@ func (s *SharedAccessAuthorizationRuleResource) UnmarshalJSON(data []byte) error case "properties": err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &s.SKU) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &s.Tags) @@ -1570,15 +2376,20 @@ func (s *SharedAccessAuthorizationRuleResource) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type SubResource. -func (s SubResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SubResource. -func (s *SubResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -1586,8 +2397,23 @@ func (s *SubResource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) delete(rawMsg, key) } if err != nil { @@ -1597,6 +2423,53 @@ func (s *SubResource) 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, "systemData", t.SystemData) + 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 "systemData": + err = unpopulate(val, "SystemData", &t.SystemData) + 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 WnsCredential. func (w WnsCredential) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1627,9 +2500,11 @@ func (w *WnsCredential) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type WnsCredentialProperties. func (w WnsCredentialProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "certificateKey", w.CertificateKey) populate(objectMap, "packageSid", w.PackageSid) populate(objectMap, "secretKey", w.SecretKey) populate(objectMap, "windowsLiveEndpoint", w.WindowsLiveEndpoint) + populate(objectMap, "wnsCertificate", w.WnsCertificate) return json.Marshal(objectMap) } @@ -1642,6 +2517,9 @@ func (w *WnsCredentialProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "certificateKey": + err = unpopulate(val, "CertificateKey", &w.CertificateKey) + delete(rawMsg, key) case "packageSid": err = unpopulate(val, "PackageSid", &w.PackageSid) delete(rawMsg, key) @@ -1651,6 +2529,9 @@ func (w *WnsCredentialProperties) UnmarshalJSON(data []byte) error { case "windowsLiveEndpoint": err = unpopulate(val, "WindowsLiveEndpoint", &w.WindowsLiveEndpoint) delete(rawMsg, key) + case "wnsCertificate": + err = unpopulate(val, "WnsCertificate", &w.WnsCertificate) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) @@ -1659,6 +2540,64 @@ func (w *WnsCredentialProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type XiaomiCredential. +func (x XiaomiCredential) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", x.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type XiaomiCredential. +func (x *XiaomiCredential) 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", x, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &x.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", x, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type XiaomiCredentialProperties. +func (x XiaomiCredentialProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "appSecret", x.AppSecret) + populate(objectMap, "endpoint", x.Endpoint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type XiaomiCredentialProperties. +func (x *XiaomiCredentialProperties) 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", x, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "appSecret": + err = unpopulate(val, "AppSecret", &x.AppSecret) + delete(rawMsg, key) + case "endpoint": + err = unpopulate(val, "Endpoint", &x.Endpoint) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", x, err) + } + } + return nil +} + func populate(m map[string]any, k string, v any) { if v == nil { return diff --git a/sdk/resourcemanager/notificationhubs/armnotificationhubs/namespaces_client.go b/sdk/resourcemanager/notificationhubs/armnotificationhubs/namespaces_client.go index b999ba208c4a..d299c0d2cfcf 100644 --- a/sdk/resourcemanager/notificationhubs/armnotificationhubs/namespaces_client.go +++ b/sdk/resourcemanager/notificationhubs/armnotificationhubs/namespaces_client.go @@ -18,6 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" + "strconv" "strings" ) @@ -29,8 +30,7 @@ type NamespacesClient struct { } // NewNamespacesClient creates a new instance of NamespacesClient with the specified values. -// - subscriptionID - Gets subscription credentials which uniquely identify 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 NewNamespacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NamespacesClient, error) { @@ -49,8 +49,8 @@ func NewNamespacesClient(subscriptionID string, credential azcore.TokenCredentia // because the domain name is created based on the service namespace name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-04-01 -// - parameters - The namespace name. +// Generated from API version 2023-01-01-preview +// - parameters - Request content. // - options - NamespacesClientCheckAvailabilityOptions contains the optional parameters for the NamespacesClient.CheckAvailability // method. func (client *NamespacesClient) CheckAvailability(ctx context.Context, parameters CheckAvailabilityParameters, options *NamespacesClientCheckAvailabilityOptions) (NamespacesClientCheckAvailabilityResponse, error) { @@ -71,16 +71,13 @@ func (client *NamespacesClient) CheckAvailability(ctx context.Context, parameter // checkAvailabilityCreateRequest creates the CheckAvailability request. func (client *NamespacesClient) checkAvailabilityCreateRequest(ctx context.Context, parameters CheckAvailabilityParameters, options *NamespacesClientCheckAvailabilityOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/checkNamespaceAvailability" - 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", "2017-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -95,34 +92,52 @@ func (client *NamespacesClient) checkAvailabilityHandleResponse(resp *http.Respo return result, nil } -// CreateOrUpdate - Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This -// operation is idempotent. +// BeginCreateOrUpdate - Creates / Updates a Notification Hub namespace. This operation is idempotent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-04-01 -// - resourceGroupName - The name of the resource group. -// - namespaceName - The namespace name. -// - parameters - Parameters supplied to create a Namespace Resource. -// - options - NamespacesClientCreateOrUpdateOptions contains the optional parameters for the NamespacesClient.CreateOrUpdate +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name +// - parameters - Request content. +// - options - NamespacesClientBeginCreateOrUpdateOptions contains the optional parameters for the NamespacesClient.BeginCreateOrUpdate // method. -func (client *NamespacesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, parameters NamespaceCreateOrUpdateParameters, options *NamespacesClientCreateOrUpdateOptions) (NamespacesClientCreateOrUpdateResponse, error) { +func (client *NamespacesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, parameters NamespaceResource, options *NamespacesClientBeginCreateOrUpdateOptions) (*runtime.Poller[NamespacesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, namespaceName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NamespacesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[NamespacesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates / Updates a Notification Hub namespace. This operation is idempotent. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01-preview +func (client *NamespacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, parameters NamespaceResource, options *NamespacesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, namespaceName, parameters, options) if err != nil { - return NamespacesClientCreateOrUpdateResponse{}, err + return nil, err } resp, err := client.internal.Pipeline().Do(req) if err != nil { - return NamespacesClientCreateOrUpdateResponse{}, err + return nil, err } if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return NamespacesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + return nil, runtime.NewResponseError(resp) } - return client.createOrUpdateHandleResponse(resp) + return resp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *NamespacesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, parameters NamespaceCreateOrUpdateParameters, options *NamespacesClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *NamespacesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, parameters NamespaceResource, options *NamespacesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -131,41 +146,28 @@ 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", "2017-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *NamespacesClient) createOrUpdateHandleResponse(resp *http.Response) (NamespacesClientCreateOrUpdateResponse, error) { - result := NamespacesClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.NamespaceResource); err != nil { - return NamespacesClientCreateOrUpdateResponse{}, err - } - return result, nil -} - // CreateOrUpdateAuthorizationRule - Creates an authorization rule for a namespace // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-04-01 -// - resourceGroupName - The name of the resource group. -// - namespaceName - The namespace name. -// - authorizationRuleName - Authorization Rule Name. -// - parameters - The shared access authorization rule. +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name +// - authorizationRuleName - Authorization Rule Name +// - parameters - Request content. // - options - NamespacesClientCreateOrUpdateAuthorizationRuleOptions contains the optional parameters for the NamespacesClient.CreateOrUpdateAuthorizationRule // method. -func (client *NamespacesClient) CreateOrUpdateAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, parameters SharedAccessAuthorizationRuleCreateOrUpdateParameters, options *NamespacesClientCreateOrUpdateAuthorizationRuleOptions) (NamespacesClientCreateOrUpdateAuthorizationRuleResponse, error) { +func (client *NamespacesClient) CreateOrUpdateAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, parameters SharedAccessAuthorizationRuleResource, options *NamespacesClientCreateOrUpdateAuthorizationRuleOptions) (NamespacesClientCreateOrUpdateAuthorizationRuleResponse, error) { req, err := client.createOrUpdateAuthorizationRuleCreateRequest(ctx, resourceGroupName, namespaceName, authorizationRuleName, parameters, options) if err != nil { return NamespacesClientCreateOrUpdateAuthorizationRuleResponse{}, err @@ -174,15 +176,16 @@ func (client *NamespacesClient) CreateOrUpdateAuthorizationRule(ctx context.Cont if err != nil { return NamespacesClientCreateOrUpdateAuthorizationRuleResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { return NamespacesClientCreateOrUpdateAuthorizationRuleResponse{}, runtime.NewResponseError(resp) } return client.createOrUpdateAuthorizationRuleHandleResponse(resp) } // createOrUpdateAuthorizationRuleCreateRequest creates the CreateOrUpdateAuthorizationRule request. -func (client *NamespacesClient) createOrUpdateAuthorizationRuleCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, parameters SharedAccessAuthorizationRuleCreateOrUpdateParameters, options *NamespacesClientCreateOrUpdateAuthorizationRuleOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}" +func (client *NamespacesClient) createOrUpdateAuthorizationRuleCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, parameters SharedAccessAuthorizationRuleResource, options *NamespacesClientCreateOrUpdateAuthorizationRuleOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -195,16 +198,12 @@ 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", "2017-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -219,47 +218,32 @@ func (client *NamespacesClient) createOrUpdateAuthorizationRuleHandleResponse(re return result, nil } -// BeginDelete - Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2017-04-01 -// - resourceGroupName - The name of the resource group. -// - namespaceName - The namespace name. -// - options - NamespacesClientBeginDeleteOptions contains the optional parameters for the NamespacesClient.BeginDelete method. -func (client *NamespacesClient) BeginDelete(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespacesClientBeginDeleteOptions) (*runtime.Poller[NamespacesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, namespaceName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[NamespacesClientDeleteResponse](resp, client.internal.Pipeline(), nil) - } else { - return runtime.NewPollerFromResumeToken[NamespacesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - // Delete - Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-04-01 -func (client *NamespacesClient) deleteOperation(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespacesClientBeginDeleteOptions) (*http.Response, error) { +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name +// - options - NamespacesClientDeleteOptions contains the optional parameters for the NamespacesClient.Delete method. +func (client *NamespacesClient) Delete(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespacesClientDeleteOptions) (NamespacesClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, namespaceName, options) if err != nil { - return nil, err + return NamespacesClientDeleteResponse{}, err } resp, err := client.internal.Pipeline().Do(req) if err != nil { - return nil, err + return NamespacesClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return NamespacesClientDeleteResponse{}, runtime.NewResponseError(resp) } - return resp, nil + return NamespacesClientDeleteResponse{}, nil } // 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, options *NamespacesClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -268,27 +252,24 @@ 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", "2017-04-01") + reqQP.Set("api-version", "2023-01-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 2017-04-01 -// - resourceGroupName - The name of the resource group. -// - namespaceName - The namespace name. -// - authorizationRuleName - Authorization Rule Name. +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name +// - authorizationRuleName - Authorization Rule Name // - options - NamespacesClientDeleteAuthorizationRuleOptions contains the optional parameters for the NamespacesClient.DeleteAuthorizationRule // method. func (client *NamespacesClient) DeleteAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, options *NamespacesClientDeleteAuthorizationRuleOptions) (NamespacesClientDeleteAuthorizationRuleResponse, error) { @@ -308,7 +289,8 @@ 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) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}" + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -321,26 +303,23 @@ func (client *NamespacesClient) deleteAuthorizationRuleCreateRequest(ctx 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.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Returns the description for the specified namespace. +// Get - Returns the given namespace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-04-01 -// - resourceGroupName - The name of the resource group. -// - namespaceName - The namespace name. +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name // - options - NamespacesClientGetOptions contains the optional parameters for the NamespacesClient.Get method. func (client *NamespacesClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespacesClientGetOptions) (NamespacesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, namespaceName, options) @@ -360,6 +339,7 @@ func (client *NamespacesClient) Get(ctx context.Context, resourceGroupName strin // getCreateRequest creates the Get request. func (client *NamespacesClient) getCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespacesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -368,16 +348,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", "2017-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -395,10 +371,10 @@ func (client *NamespacesClient) getHandleResponse(resp *http.Response) (Namespac // GetAuthorizationRule - Gets an authorization rule for a namespace by name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-04-01 -// - resourceGroupName - The name of the resource group. -// - namespaceName - The namespace name -// - authorizationRuleName - Authorization rule name. +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name +// - authorizationRuleName - Authorization Rule Name // - options - NamespacesClientGetAuthorizationRuleOptions contains the optional parameters for the NamespacesClient.GetAuthorizationRule // method. func (client *NamespacesClient) GetAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, options *NamespacesClientGetAuthorizationRuleOptions) (NamespacesClientGetAuthorizationRuleResponse, error) { @@ -418,7 +394,8 @@ 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) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}" + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -431,16 +408,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", "2017-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -455,11 +428,65 @@ func (client *NamespacesClient) getAuthorizationRuleHandleResponse(resp *http.Re return result, nil } -// NewListPager - Lists the available namespaces within a resourceGroup. +// GetPnsCredentials - Lists the PNS credentials associated with a namespace. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name +// - options - NamespacesClientGetPnsCredentialsOptions contains the optional parameters for the NamespacesClient.GetPnsCredentials +// method. +func (client *NamespacesClient) GetPnsCredentials(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespacesClientGetPnsCredentialsOptions) (NamespacesClientGetPnsCredentialsResponse, error) { + req, err := client.getPnsCredentialsCreateRequest(ctx, resourceGroupName, namespaceName, options) + if err != nil { + return NamespacesClientGetPnsCredentialsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NamespacesClientGetPnsCredentialsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NamespacesClientGetPnsCredentialsResponse{}, runtime.NewResponseError(resp) + } + return client.getPnsCredentialsHandleResponse(resp) +} + +// getPnsCredentialsCreateRequest creates the GetPnsCredentials request. +func (client *NamespacesClient) getPnsCredentialsCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespacesClientGetPnsCredentialsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/pnsCredentials" + 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.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getPnsCredentialsHandleResponse handles the GetPnsCredentials response. +func (client *NamespacesClient) getPnsCredentialsHandleResponse(resp *http.Response) (NamespacesClientGetPnsCredentialsResponse, error) { + result := NamespacesClientGetPnsCredentialsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PnsCredentialsResource); err != nil { + return NamespacesClientGetPnsCredentialsResponse{}, err + } + return result, nil +} + +// NewListPager - Lists the available namespaces within a resource group. // -// Generated from API version 2017-04-01 -// - resourceGroupName - The name of the resource group. If resourceGroupName value is null the method lists all the namespaces -// within subscription +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - NamespacesClientListOptions contains the optional parameters for the NamespacesClient.NewListPager method. func (client *NamespacesClient) NewListPager(resourceGroupName string, options *NamespacesClientListOptions) *runtime.Pager[NamespacesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[NamespacesClientListResponse]{ @@ -492,20 +519,23 @@ func (client *NamespacesClient) NewListPager(resourceGroupName string, options * // listCreateRequest creates the List request. func (client *NamespacesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *NamespacesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces" + 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 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", "2017-04-01") + if options != nil && options.SkipToken != nil { + reqQP.Set("$skipToken", *options.SkipToken) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -520,9 +550,9 @@ func (client *NamespacesClient) listHandleResponse(resp *http.Response) (Namespa return result, nil } -// NewListAllPager - Lists all the available namespaces within the subscription irrespective of the resourceGroups. +// NewListAllPager - Lists all the available namespaces within the subscription. // -// Generated from API version 2017-04-01 +// Generated from API version 2023-01-01-preview // - options - NamespacesClientListAllOptions contains the optional parameters for the NamespacesClient.NewListAllPager method. func (client *NamespacesClient) NewListAllPager(options *NamespacesClientListAllOptions) *runtime.Pager[NamespacesClientListAllResponse] { return runtime.NewPager(runtime.PagingHandler[NamespacesClientListAllResponse]{ @@ -555,16 +585,19 @@ func (client *NamespacesClient) NewListAllPager(options *NamespacesClientListAll // listAllCreateRequest creates the ListAll request. func (client *NamespacesClient) listAllCreateRequest(ctx context.Context, options *NamespacesClientListAllOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/namespaces" - 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", "2017-04-01") + if options != nil && options.SkipToken != nil { + reqQP.Set("$skipToken", *options.SkipToken) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -581,9 +614,9 @@ func (client *NamespacesClient) listAllHandleResponse(resp *http.Response) (Name // NewListAuthorizationRulesPager - Gets the authorization rules for a namespace. // -// Generated from API version 2017-04-01 -// - resourceGroupName - The name of the resource group. -// - namespaceName - The namespace name +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name // - options - NamespacesClientListAuthorizationRulesOptions contains the optional parameters for the NamespacesClient.NewListAuthorizationRulesPager // method. func (client *NamespacesClient) NewListAuthorizationRulesPager(resourceGroupName string, namespaceName string, options *NamespacesClientListAuthorizationRulesOptions) *runtime.Pager[NamespacesClientListAuthorizationRulesResponse] { @@ -616,7 +649,8 @@ 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.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules" + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/authorizationRules" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -625,16 +659,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", "2017-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -649,13 +679,13 @@ func (client *NamespacesClient) listAuthorizationRulesHandleResponse(resp *http. return result, nil } -// ListKeys - Gets the Primary and Secondary ConnectionStrings to the namespace +// ListKeys - Gets the Primary and Secondary ConnectionStrings to the namespace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-04-01 -// - resourceGroupName - The name of the resource group. -// - namespaceName - The namespace name. -// - authorizationRuleName - The connection string of the namespace for the specified authorizationRule. +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name +// - authorizationRuleName - Authorization Rule Name // - options - NamespacesClientListKeysOptions contains the optional parameters for the NamespacesClient.ListKeys method. func (client *NamespacesClient) ListKeys(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, options *NamespacesClientListKeysOptions) (NamespacesClientListKeysResponse, error) { req, err := client.listKeysCreateRequest(ctx, resourceGroupName, namespaceName, authorizationRuleName, options) @@ -674,7 +704,8 @@ 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) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/listKeys" + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/listKeys" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -687,16 +718,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", "2017-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -711,32 +738,35 @@ func (client *NamespacesClient) listKeysHandleResponse(resp *http.Response) (Nam return result, nil } -// Patch - Patches the existing namespace +// RegenerateKeys - Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-04-01 -// - resourceGroupName - The name of the resource group. -// - namespaceName - The namespace name. -// - parameters - Parameters supplied to patch a Namespace Resource. -// - options - NamespacesClientPatchOptions contains the optional parameters for the NamespacesClient.Patch method. -func (client *NamespacesClient) Patch(ctx context.Context, resourceGroupName string, namespaceName string, parameters NamespacePatchParameters, options *NamespacesClientPatchOptions) (NamespacesClientPatchResponse, error) { - req, err := client.patchCreateRequest(ctx, resourceGroupName, namespaceName, parameters, options) +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name +// - authorizationRuleName - Authorization Rule Name +// - parameters - Request content. +// - options - NamespacesClientRegenerateKeysOptions contains the optional parameters for the NamespacesClient.RegenerateKeys +// method. +func (client *NamespacesClient) RegenerateKeys(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, parameters PolicyKeyResource, options *NamespacesClientRegenerateKeysOptions) (NamespacesClientRegenerateKeysResponse, error) { + req, err := client.regenerateKeysCreateRequest(ctx, resourceGroupName, namespaceName, authorizationRuleName, parameters, options) if err != nil { - return NamespacesClientPatchResponse{}, err + return NamespacesClientRegenerateKeysResponse{}, err } resp, err := client.internal.Pipeline().Do(req) if err != nil { - return NamespacesClientPatchResponse{}, err + return NamespacesClientRegenerateKeysResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return NamespacesClientPatchResponse{}, runtime.NewResponseError(resp) + return NamespacesClientRegenerateKeysResponse{}, runtime.NewResponseError(resp) } - return client.patchHandleResponse(resp) + return client.regenerateKeysHandleResponse(resp) } -// patchCreateRequest creates the Patch request. -func (client *NamespacesClient) patchCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, parameters NamespacePatchParameters, options *NamespacesClientPatchOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}" +// regenerateKeysCreateRequest creates the RegenerateKeys request. +func (client *NamespacesClient) regenerateKeysCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, parameters PolicyKeyResource, options *NamespacesClientRegenerateKeysOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/regenerateKeys" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -745,58 +775,57 @@ func (client *NamespacesClient) patchCreateRequest(ctx context.Context, resource 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") + if authorizationRuleName == "" { + return nil, errors.New("parameter authorizationRuleName 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)) + urlPath = strings.ReplaceAll(urlPath, "{authorizationRuleName}", url.PathEscape(authorizationRuleName)) + 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", "2017-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } -// patchHandleResponse handles the Patch response. -func (client *NamespacesClient) patchHandleResponse(resp *http.Response) (NamespacesClientPatchResponse, error) { - result := NamespacesClientPatchResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.NamespaceResource); err != nil { - return NamespacesClientPatchResponse{}, err +// regenerateKeysHandleResponse handles the RegenerateKeys response. +func (client *NamespacesClient) regenerateKeysHandleResponse(resp *http.Response) (NamespacesClientRegenerateKeysResponse, error) { + result := NamespacesClientRegenerateKeysResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ResourceListKeys); err != nil { + return NamespacesClientRegenerateKeysResponse{}, err } return result, nil } -// RegenerateKeys - Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule +// Update - Patches the existing namespace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2017-04-01 -// - resourceGroupName - The name of the resource group. -// - namespaceName - The namespace name. -// - authorizationRuleName - The connection string of the namespace for the specified authorizationRule. -// - parameters - Parameters supplied to regenerate the Namespace Authorization Rule Key. -// - options - NamespacesClientRegenerateKeysOptions contains the optional parameters for the NamespacesClient.RegenerateKeys -// method. -func (client *NamespacesClient) RegenerateKeys(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, parameters PolicykeyResource, options *NamespacesClientRegenerateKeysOptions) (NamespacesClientRegenerateKeysResponse, error) { - req, err := client.regenerateKeysCreateRequest(ctx, resourceGroupName, namespaceName, authorizationRuleName, parameters, options) +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name +// - parameters - Request content. +// - options - NamespacesClientUpdateOptions contains the optional parameters for the NamespacesClient.Update method. +func (client *NamespacesClient) Update(ctx context.Context, resourceGroupName string, namespaceName string, parameters NamespacePatchParameters, options *NamespacesClientUpdateOptions) (NamespacesClientUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, namespaceName, parameters, options) if err != nil { - return NamespacesClientRegenerateKeysResponse{}, err + return NamespacesClientUpdateResponse{}, err } resp, err := client.internal.Pipeline().Do(req) if err != nil { - return NamespacesClientRegenerateKeysResponse{}, err + return NamespacesClientUpdateResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return NamespacesClientRegenerateKeysResponse{}, runtime.NewResponseError(resp) + return NamespacesClientUpdateResponse{}, runtime.NewResponseError(resp) } - return client.regenerateKeysHandleResponse(resp) + return client.updateHandleResponse(resp) } -// regenerateKeysCreateRequest creates the RegenerateKeys request. -func (client *NamespacesClient) regenerateKeysCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, parameters PolicykeyResource, options *NamespacesClientRegenerateKeysOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys" +// updateCreateRequest creates the Update request. +func (client *NamespacesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, parameters NamespacePatchParameters, options *NamespacesClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -805,30 +834,22 @@ func (client *NamespacesClient) regenerateKeysCreateRequest(ctx context.Context, return nil, errors.New("parameter namespaceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) - if authorizationRuleName == "" { - 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)) + 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", "2017-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } -// regenerateKeysHandleResponse handles the RegenerateKeys response. -func (client *NamespacesClient) regenerateKeysHandleResponse(resp *http.Response) (NamespacesClientRegenerateKeysResponse, error) { - result := NamespacesClientRegenerateKeysResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ResourceListKeys); err != nil { - return NamespacesClientRegenerateKeysResponse{}, err +// updateHandleResponse handles the Update response. +func (client *NamespacesClient) updateHandleResponse(resp *http.Response) (NamespacesClientUpdateResponse, error) { + result := NamespacesClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NamespaceResource); err != nil { + return NamespacesClientUpdateResponse{}, err } return result, nil } diff --git a/sdk/resourcemanager/notificationhubs/armnotificationhubs/namespaces_client_example_test.go b/sdk/resourcemanager/notificationhubs/armnotificationhubs/namespaces_client_example_test.go deleted file mode 100644 index 04dfe07ea7f7..000000000000 --- a/sdk/resourcemanager/notificationhubs/armnotificationhubs/namespaces_client_example_test.go +++ /dev/null @@ -1,1283 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnotificationhubs_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/notificationhubs/armnotificationhubs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceCheckNameAvailability.json -func ExampleNamespacesClient_CheckAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnotificationhubs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNamespacesClient().CheckAvailability(ctx, armnotificationhubs.CheckAvailabilityParameters{ - 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.CheckAvailabilityResult = armnotificationhubs.CheckAvailabilityResult{ - // Name: to.Ptr("mytestnamespace"), - // Type: to.Ptr("Microsoft.NotificationHubs/namespaces/checkNamespaceAvailability"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/providers/Microsoft.NotificationHubs/CheckNamespaceAvailability"), - // Location: to.Ptr("West Europe"), - // IsAvailiable: to.Ptr(false), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceCreate.json -func ExampleNamespacesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnotificationhubs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNamespacesClient().CreateOrUpdate(ctx, "5ktrial", "nh-sdk-ns", armnotificationhubs.NamespaceCreateOrUpdateParameters{ - Location: to.Ptr("South Central US"), - SKU: &armnotificationhubs.SKU{ - Name: to.Ptr(armnotificationhubs.SKUNameStandard), - Tier: to.Ptr("Standard"), - }, - 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) - } - // 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.NamespaceResource = armnotificationhubs.NamespaceResource{ - // Name: to.Ptr("sdk-Namespace-2924"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/ArunMonocle/providers/Microsoft.NotificationHubs/namespaces/sdk-Namespace-2924"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-25T22:26:36.76Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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.76Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceUpdate.json -func ExampleNamespacesClient_Patch() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnotificationhubs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNamespacesClient().Patch(ctx, "5ktrial", "nh-sdk-ns", armnotificationhubs.NamespacePatchParameters{ - SKU: &armnotificationhubs.SKU{ - Name: to.Ptr(armnotificationhubs.SKUNameStandard), - Tier: to.Ptr("Standard"), - }, - 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) - } - // 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.NamespaceResource = armnotificationhubs.NamespaceResource{ - // Name: to.Ptr("sdk-Namespace-3285"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/ArunMonocle/providers/Microsoft.NotificationHubs/namespaces/sdk-Namespace-3285"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // "tag3": to.Ptr("value3"), - // "tag4": to.Ptr("value4"), - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-25T23:07:58.17Z"); return t}()), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceBusEndpoint: to.Ptr("https://sdk-Namespace-3285.servicebus.windows-int.net:443/"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceDelete.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 := armnotificationhubs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNamespacesClient().BeginDelete(ctx, "5ktrial", "nh-sdk-ns", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceGet.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 := armnotificationhubs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNamespacesClient().Get(ctx, "5ktrial", "nh-sdk-ns", 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.NamespaceResource = armnotificationhubs.NamespaceResource{ - // Name: to.Ptr("nh-sdk-ns"), - // Type: to.Ptr("Microsoft.NotificationHubs/namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/5ktrial/providers/Microsoft.NotificationHubs/namespaces/nh-sdk-ns"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameBasic), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-02T00:44:56.58Z"); return t}()), - // Critical: to.Ptr(false), - // DataCenter: to.Ptr("SN1"), - // Enabled: to.Ptr(true), - // NamespaceType: to.Ptr(armnotificationhubs.NamespaceTypeNotificationHub), - // ProvisioningState: to.Ptr("Succeeded"), - // ScaleUnit: to.Ptr("SN1-001"), - // ServiceBusEndpoint: to.Ptr("https://nh-sdk-ns.servicebus.windows.net:443/"), - // Status: to.Ptr("Active"), - // UpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-02T01:02:19.79Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleCreate.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 := armnotificationhubs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNamespacesClient().CreateOrUpdateAuthorizationRule(ctx, "5ktrial", "nh-sdk-ns", "sdk-AuthRules-1788", armnotificationhubs.SharedAccessAuthorizationRuleCreateOrUpdateParameters{ - Properties: &armnotificationhubs.SharedAccessAuthorizationRuleProperties{ - Rights: []*armnotificationhubs.AccessRights{ - to.Ptr(armnotificationhubs.AccessRightsListen), - to.Ptr(armnotificationhubs.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.SharedAccessAuthorizationRuleResource = armnotificationhubs.SharedAccessAuthorizationRuleResource{ - // Name: to.Ptr("sdk-AuthRules-1788"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces/AuthorizationRules"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/ArunMonocle/providers/Microsoft.NotificationHubs/namespaces/sdk-Namespace-6914/AuthorizationRules/sdk-AuthRules-1788"), - // Properties: &armnotificationhubs.SharedAccessAuthorizationRuleProperties{ - // Rights: []*armnotificationhubs.AccessRights{ - // to.Ptr(armnotificationhubs.AccessRightsListen), - // to.Ptr(armnotificationhubs.AccessRightsSend)}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleDelete.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 := armnotificationhubs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewNamespacesClient().DeleteAuthorizationRule(ctx, "5ktrial", "nh-sdk-ns", "RootManageSharedAccessKey", 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/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleGet.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 := armnotificationhubs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNamespacesClient().GetAuthorizationRule(ctx, "5ktrial", "nh-sdk-ns", "RootManageSharedAccessKey", 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.SharedAccessAuthorizationRuleResource = armnotificationhubs.SharedAccessAuthorizationRuleResource{ - // Name: to.Ptr("RootManageSharedAccessKey"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces/AuthorizationRules"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/5ktrial/providers/Microsoft.NotificationHubs/namespaces/nh-sdk-ns/AuthorizationRules/RootManageSharedAccessKey"), - // Location: to.Ptr("South Central US"), - // Properties: &armnotificationhubs.SharedAccessAuthorizationRuleProperties{ - // ClaimType: to.Ptr("SharedAccessKey"), - // ClaimValue: to.Ptr("None"), - // CreatedTime: to.Ptr("2018-05-02T18:24:51.0690674Z"), - // KeyName: to.Ptr("RootManageSharedAccessKey"), - // ModifiedTime: to.Ptr("2018-05-02T18:24:51.0690674Z"), - // PrimaryKey: to.Ptr("############################################"), - // Rights: []*armnotificationhubs.AccessRights{ - // to.Ptr(armnotificationhubs.AccessRightsListen), - // to.Ptr(armnotificationhubs.AccessRightsManage), - // to.Ptr(armnotificationhubs.AccessRightsSend)}, - // SecondaryKey: to.Ptr("############################################"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceListByResourceGroup.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 := armnotificationhubs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNamespacesClient().NewListPager("5ktrial", 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.NamespaceListResult = armnotificationhubs.NamespaceListResult{ - // Value: []*armnotificationhubs.NamespaceResource{ - // { - // Name: to.Ptr("sdk-Namespace-2924"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/ArunMonocle/providers/Microsoft.NotificationHubs/namespaces/sdk-Namespace-2924"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-25T22:26:36.76Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceList.json -func ExampleNamespacesClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnotificationhubs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNamespacesClient().NewListAllPager(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.NamespaceListResult = armnotificationhubs.NamespaceListResult{ - // Value: []*armnotificationhubs.NamespaceResource{ - // { - // Name: to.Ptr("NS-91f08e47-2b04-4943-b0cd-a5fb02b88f20"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-91f08e47-2b04-4943-b0cd-a5fb02b88f20"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-23T02:40:17.27Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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.78Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("NS-41dc63f4-0b08-4029-b3ef-535a131bfa65"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-41dc63f4-0b08-4029-b3ef-535a131bfa65"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-23T03:50:38.98Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("NS-df52cf51-e831-4bf2-bd92-e9885f68a996"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-df52cf51-e831-4bf2-bd92-e9885f68a996"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-16T01:17:54.997Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("rrama-ns2"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/sadfsadfsadf/providers/Microsoft.NotificationHubs/namespaces/rrama-ns2"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-23T04:14:00.013Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("NS-20e57600-29d0-4035-ac85-74f4c54dcda1"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-20e57600-29d0-4035-ac85-74f4c54dcda1"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-23T03:30:49.16Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("NS-3e538a1a-58fb-4315-b2ce-76f5c944114c"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-3e538a1a-58fb-4315-b2ce-76f5c944114c"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-16T18:07:30.05Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("NS-4e1bfdf1-0cff-4e86-ae80-cdcac4873039"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-4e1bfdf1-0cff-4e86-ae80-cdcac4873039"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-16T01:01:58.73Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("NS-6b90b7f3-7aa0-48c9-bc30-b299dcb66c03"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-6b90b7f3-7aa0-48c9-bc30-b299dcb66c03"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-23T03:22:45.327Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("NS-c05e9df3-7737-44ee-a321-15f6e0545b97"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-c05e9df3-7737-44ee-a321-15f6e0545b97"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-05T03:29:19.75Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("NS-dcb4152c-231b-4c16-a683-07cc6b38fa46"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-dcb4152c-231b-4c16-a683-07cc6b38fa46"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-05T03:34:35.363Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("NS-f501f5e6-1f24-439b-8982-9af665156d40"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-f501f5e6-1f24-439b-8982-9af665156d40"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-16T01:25:55.707Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("NS-fe2ed660-2cd6-46f2-a9c3-7e11551a1f30"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-fe2ed660-2cd6-46f2-a9c3-7e11551a1f30"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-23T02:32:08.227Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("NS-8a5e3b4e-4e97-4d85-9083-cd33536c9d71"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-8a5e3b4e-4e97-4d85-9083-cd33536c9d71"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-16T00:54:05.103Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("NS-6520cc09-01ac-40a3-bc09-c5c431116e92"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-6520cc09-01ac-40a3-bc09-c5c431116e92"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-16T01:49:59.243Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("NS-bfba6d5c-a425-42d9-85db-0f4da770e29a"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-bfba6d5c-a425-42d9-85db-0f4da770e29a"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-05T03:23:32.083Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("NS-43b136b4-8716-40b2-97c5-0d77cac0062c"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-43b136b4-8716-40b2-97c5-0d77cac0062c"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-23T03:14:50.577Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("NS-7c0443de-5f88-450c-b574-83f60a097dd1"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-7c0443de-5f88-450c-b574-83f60a097dd1"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-23T04:07:15.397Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("NS-62dd7753-a5f9-42fd-a354-ca38a4505d69"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-62dd7753-a5f9-42fd-a354-ca38a4505d69"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-16T01:33:50.45Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("NS-ae18a18c-97ab-4089-965d-8acbf4794091"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-ae18a18c-97ab-4089-965d-8acbf4794091"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-23T02:43:36.517Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("NS-8e3b56c1-0ee8-4e13-ae88-5cadf6e2ce11"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-8e3b56c1-0ee8-4e13-ae88-5cadf6e2ce11"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-16T00:46:03.773Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("NS-7ffca4b4-4728-4fb0-b2d0-1e7c016e3a44"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-7ffca4b4-4728-4fb0-b2d0-1e7c016e3a44"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-23T03:59:12.1Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("NS-d9337efd-9b27-454c-b2a5-dcfea56920d9"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-d9337efd-9b27-454c-b2a5-dcfea56920d9"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-05T03:45:09.27Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("NS-ad5ae732-abea-4e62-9de0-c90de0ddec0a"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-ad5ae732-abea-4e62-9de0-c90de0ddec0a"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-23T02:34:36.447Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("NS-d447fb03-c7da-40fe-b5eb-14f36888837b"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-d447fb03-c7da-40fe-b5eb-14f36888837b"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-05T00:53:46.697Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("ReproSB"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/RapscallionResources/providers/Microsoft.NotificationHubs/namespaces/ReproSB"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-27T19:29:34.523Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("NS-4c90097f-19a8-42e7-bb3c-4ac088994719"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-4c90097f-19a8-42e7-bb3c-4ac088994719"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-16T17:35:32.61Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("rrama-1-23-17"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/rrama-1-23-17"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-01-23T22:54:40.907Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("NS-5191e541-8e4e-4229-9fdc-b89f6c3e7f12"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-5191e541-8e4e-4229-9fdc-b89f6c3e7f12"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-16T17:43:25.71Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("NS-be903820-3533-46e8-90e4-72c132411848"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-be903820-3533-46e8-90e4-72c132411848"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-05T03:24:01.923Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("rrama-namespace1"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/rrama-namespace1"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-05T00:47:22.963Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("NS-a3c38e9b-32a3-4c51-85d7-263150a8dda9"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-a3c38e9b-32a3-4c51-85d7-263150a8dda9"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-16T00:38:02.517Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("NS-70d3fa25-6bbe-4a6b-a381-a52cf0d539e6"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-70d3fa25-6bbe-4a6b-a381-a52cf0d539e6"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-23T03:42:40.01Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("NS-e6536f77-0d1b-4a6b-8f42-29cc15b2930a"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-e6536f77-0d1b-4a6b-8f42-29cc15b2930a"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-05T04:28:10.71Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("sdk-Namespace-2924"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/ArunMonocle/providers/Microsoft.NotificationHubs/namespaces/sdk-Namespace-2924"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-25T22:26:36.76Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("rrama-sb1"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/rrama-sb1"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-01T21:47:34.903Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("WhackWhack"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/RapscallionResources/providers/Microsoft.NotificationHubs/namespaces/WhackWhack"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-10-10T23:39:01.347Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("NS-66ed32d6-611e-4bb0-8e1a-a6d0fc65427c"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-66ed32d6-611e-4bb0-8e1a-a6d0fc65427c"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-16T17:51:27.73Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("NS-e0cab401-6df8-465d-8d4a-da9a9e55cf0e"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/NS-e0cab401-6df8-465d-8d4a-da9a9e55cf0e"), - // Location: to.Ptr("South Central US"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-05T01:14:25.613Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("bn3-rrama-foo1"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/bn3-rrama-foo1"), - // Location: to.Ptr("East US 2"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-28T23:54:26.927Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("bn3-rrama-foo3"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/bn3-rrama-foo3"), - // Location: to.Ptr("East US 2"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-29T00:24:09.907Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }, - // { - // Name: to.Ptr("bn3-rrama-foo2"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/bn3-rrama-foo2"), - // Location: to.Ptr("East US 2"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-28T23:57:40.82Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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.82Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("db3-rrama-foo2"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/Default-ServiceBus-SouthCentralUS/providers/Microsoft.NotificationHubs/namespaces/db3-rrama-foo2"), - // Location: to.Ptr("North Europe"), - // SKU: &armnotificationhubs.SKU{ - // Name: to.Ptr(armnotificationhubs.SKUNameStandard), - // Tier: to.Ptr("Standard"), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armnotificationhubs.NamespaceProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-29T00:10:43.463Z"); return t}()), - // MetricID: to.Ptr("29cfa613-cbbc-4512-b1d6-1b3a92c7fa40: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}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleListAll.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 := armnotificationhubs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNamespacesClient().NewListAuthorizationRulesPager("5ktrial", "nh-sdk-ns", 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.SharedAccessAuthorizationRuleListResult = armnotificationhubs.SharedAccessAuthorizationRuleListResult{ - // Value: []*armnotificationhubs.SharedAccessAuthorizationRuleResource{ - // { - // Name: to.Ptr("RootManageSharedAccessKey"), - // Type: to.Ptr("Microsoft.NotificationHubs/Namespaces/AuthorizationRules"), - // ID: to.Ptr("/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/5ktrial/providers/Microsoft.NotificationHubs/namespaces/nh-sdk-ns/AuthorizationRules/RootManageSharedAccessKey"), - // Properties: &armnotificationhubs.SharedAccessAuthorizationRuleProperties{ - // ClaimType: to.Ptr("SharedAccessKey"), - // ClaimValue: to.Ptr("None"), - // CreatedTime: to.Ptr("2018-05-02T18:24:51.0690674Z"), - // KeyName: to.Ptr("RootManageSharedAccessKey"), - // ModifiedTime: to.Ptr("2018-05-02T18:31:28.5201555Z"), - // PrimaryKey: to.Ptr(""), - // Revision: to.Ptr[int32](1), - // Rights: []*armnotificationhubs.AccessRights{ - // to.Ptr(armnotificationhubs.AccessRightsListen), - // to.Ptr(armnotificationhubs.AccessRightsManage), - // to.Ptr(armnotificationhubs.AccessRightsSend)}, - // SecondaryKey: to.Ptr(""), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleListKey.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 := armnotificationhubs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNamespacesClient().ListKeys(ctx, "5ktrial", "nh-sdk-ns", "RootManageSharedAccessKey", 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.ResourceListKeys = armnotificationhubs.ResourceListKeys{ - // KeyName: to.Ptr("RootManageSharedAccessKey"), - // PrimaryConnectionString: to.Ptr("Endpoint=sb://nh-sdk-ns.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=############################################"), - // PrimaryKey: to.Ptr("############################################"), - // SecondaryConnectionString: to.Ptr("Endpoint=sb://nh-sdk-ns.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=############################################"), - // SecondaryKey: to.Ptr("############################################"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/Namespaces/NHNameSpaceAuthorizationRuleRegenrateKey.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 := armnotificationhubs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNamespacesClient().RegenerateKeys(ctx, "5ktrial", "nh-sdk-ns", "RootManageSharedAccessKey", armnotificationhubs.PolicykeyResource{ - PolicyKey: to.Ptr("PrimaryKey"), - }, 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.ResourceListKeys = armnotificationhubs.ResourceListKeys{ - // KeyName: to.Ptr("RootManageSharedAccessKey"), - // PrimaryConnectionString: to.Ptr("Endpoint=sb://nh-sdk-ns.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=############################################"), - // PrimaryKey: to.Ptr("############################################"), - // SecondaryConnectionString: to.Ptr("Endpoint=sb://nh-sdk-ns.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=############################################"), - // SecondaryKey: to.Ptr("############################################"), - // } -} diff --git a/sdk/resourcemanager/notificationhubs/armnotificationhubs/operations_client.go b/sdk/resourcemanager/notificationhubs/armnotificationhubs/operations_client.go index de9a957f9077..fe87d6024829 100644 --- a/sdk/resourcemanager/notificationhubs/armnotificationhubs/operations_client.go +++ b/sdk/resourcemanager/notificationhubs/armnotificationhubs/operations_client.go @@ -38,9 +38,9 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO return client, nil } -// NewListPager - Lists all of the available NotificationHubs REST API operations. +// NewListPager - Lists all available Notification Hubs operations. // -// Generated from API version 2017-04-01 +// Generated from API version 2023-01-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]{ @@ -78,7 +78,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/notificationhubs/armnotificationhubs/operations_client_example_test.go b/sdk/resourcemanager/notificationhubs/armnotificationhubs/operations_client_example_test.go deleted file mode 100644 index 6ae021d27a4e..000000000000 --- a/sdk/resourcemanager/notificationhubs/armnotificationhubs/operations_client_example_test.go +++ /dev/null @@ -1,254 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnotificationhubs_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/notificationhubs/armnotificationhubs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/NHOperationsList.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 := armnotificationhubs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armnotificationhubs.OperationListResult{ - // Value: []*armnotificationhubs.Operation{ - // { - // Name: to.Ptr("Microsoft.NotificationHubs/register/action"), - // Display: &armnotificationhubs.OperationDisplay{ - // Operation: to.Ptr("Registers the NotificationHubs Provider"), - // Provider: to.Ptr("Microsoft Azure Notification Hub"), - // Resource: to.Ptr("Microsoft Azure Notification Hub"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.NotificationHubs/unregister/action"), - // Display: &armnotificationhubs.OperationDisplay{ - // Operation: to.Ptr("Unregisters the NotificationHubs Provider"), - // Provider: to.Ptr("Microsoft Azure Notification Hub"), - // Resource: to.Ptr("Microsoft Azure Notification Hub"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.NotificationHubs/operationResults/read"), - // Display: &armnotificationhubs.OperationDisplay{ - // Operation: to.Ptr("Operation results for Notification Hubs provider"), - // Provider: to.Ptr("Microsoft Azure Notification Hub"), - // Resource: to.Ptr("Microsoft Azure Notification Hub"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.NotificationHubs/CheckNamespaceAvailability/action"), - // Display: &armnotificationhubs.OperationDisplay{ - // Operation: to.Ptr("Get namespace availability."), - // Provider: to.Ptr("Microsoft Azure Notification Hub"), - // Resource: to.Ptr("Microsoft Azure Notification Hub"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.NotificationHubs/namespaces/write"), - // Display: &armnotificationhubs.OperationDisplay{ - // Operation: to.Ptr("Create Or Update Namespace "), - // Provider: to.Ptr("Microsoft Azure Notification Hub"), - // Resource: to.Ptr("Namespace"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.NotificationHubs/namespaces/read"), - // Display: &armnotificationhubs.OperationDisplay{ - // Operation: to.Ptr("Get Namespace Resource"), - // Provider: to.Ptr("Microsoft Azure NotificationHubs"), - // Resource: to.Ptr("Namespace"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.NotificationHubs/namespaces/Delete"), - // Display: &armnotificationhubs.OperationDisplay{ - // Operation: to.Ptr("Delete Namespace"), - // Provider: to.Ptr("Microsoft Azure NotificationHubs"), - // Resource: to.Ptr("Namespace"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.NotificationHubs/namespaces/authorizationRules/write"), - // Display: &armnotificationhubs.OperationDisplay{ - // Operation: to.Ptr("Create or Update Namespace Authorization Rules"), - // Provider: to.Ptr("Microsoft Azure NotificationHubs"), - // Resource: to.Ptr("AuthorizationRules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.NotificationHubs/namespaces/authorizationRules/action"), - // Display: &armnotificationhubs.OperationDisplay{ - // Operation: to.Ptr("Get Namespace Authorization Rules"), - // Provider: to.Ptr("Microsoft Azure NotificationHubs"), - // Resource: to.Ptr("AuthorizationRules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.NotificationHubs/namespaces/authorizationRules/read"), - // Display: &armnotificationhubs.OperationDisplay{ - // Operation: to.Ptr("Get Namespace Authorization Rules"), - // Provider: to.Ptr("Microsoft Azure NotificationHubs"), - // Resource: to.Ptr("AuthorizationRules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.NotificationHubs/namespaces/authorizationRules/delete"), - // Display: &armnotificationhubs.OperationDisplay{ - // Operation: to.Ptr("Delete Namespace Authorization Rule"), - // Provider: to.Ptr("Microsoft Azure NotificationHubs"), - // Resource: to.Ptr("AuthorizationRules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.NotificationHubs/namespaces/authorizationRules/listkeys/action"), - // Display: &armnotificationhubs.OperationDisplay{ - // Operation: to.Ptr("Get Namespace Listkeys"), - // Provider: to.Ptr("Microsoft Azure NotificationHubs"), - // Resource: to.Ptr("AuthorizationRules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.NotificationHubs/namespaces/authorizationRules/regenerateKeys/action"), - // Display: &armnotificationhubs.OperationDisplay{ - // Operation: to.Ptr("Resource Regeneratekeys"), - // Provider: to.Ptr("Microsoft Azure NotificationHubs"), - // Resource: to.Ptr("AuthorizationRules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.NotificationHubs/Namespaces/CheckNotificationHubAvailability/action"), - // Display: &armnotificationhubs.OperationDisplay{ - // Operation: to.Ptr("CheckNotificationHubAvailability"), - // Provider: to.Ptr("Microsoft Azure NotificationHubs"), - // Resource: to.Ptr("AuthorizationRules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.NotificationHubs/namespaces/notificationHubs/write"), - // Display: &armnotificationhubs.OperationDisplay{ - // Operation: to.Ptr("Create or Update notification hub"), - // Provider: to.Ptr("Microsoft Azure NotificationHubs"), - // Resource: to.Ptr("NotificationHub"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.NotificationHubs/namespaces/notificationHubs/read"), - // Display: &armnotificationhubs.OperationDisplay{ - // Operation: to.Ptr("Get notification hub"), - // Provider: to.Ptr("Microsoft Azure NotificationHubs"), - // Resource: to.Ptr("NotificationHub"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.NotificationHubs/namespaces/notificationHubs/Delete"), - // Display: &armnotificationhubs.OperationDisplay{ - // Operation: to.Ptr("Delete notification hub"), - // Provider: to.Ptr("Microsoft Azure NotificationHubs"), - // Resource: to.Ptr("NotificationHub"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules/write"), - // Display: &armnotificationhubs.OperationDisplay{ - // Operation: to.Ptr("Create or Update NotificationHub Authorization Rule"), - // Provider: to.Ptr("Microsoft Azure NotificationHubs"), - // Resource: to.Ptr("NotificationHub Authorization Rule"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules/action"), - // Display: &armnotificationhubs.OperationDisplay{ - // Operation: to.Ptr(" Get NotificationHub Authorization Rules"), - // Provider: to.Ptr("Microsoft Azure NotificationHubs"), - // Resource: to.Ptr("NotificationHub AuthorizationRules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules/read"), - // Display: &armnotificationhubs.OperationDisplay{ - // Operation: to.Ptr(" Get NotificationHub Authorization Rules"), - // Provider: to.Ptr("Microsoft Azure NotificationHubs"), - // Resource: to.Ptr("NotificationHub AuthorizationRules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules/delete"), - // Display: &armnotificationhubs.OperationDisplay{ - // Operation: to.Ptr("Delete NotificationHub Authorization Rules"), - // Provider: to.Ptr("Microsoft Azure NotificationHubs"), - // Resource: to.Ptr("NotificationHub AuthorizationRules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules/listkeys/action"), - // Display: &armnotificationhubs.OperationDisplay{ - // Operation: to.Ptr("List NotificationHub keys"), - // Provider: to.Ptr("Microsoft Azure NotificationHubs"), - // Resource: to.Ptr("NotificationHub AuthorizationRules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules/regenerateKeys/action"), - // Display: &armnotificationhubs.OperationDisplay{ - // Operation: to.Ptr("Resource Regeneratekeys"), - // Provider: to.Ptr("Microsoft Azure NotificationHubs"), - // Resource: to.Ptr("NotificationHub AuthorizationRules"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.NotificationHubs/Namespaces/NotificationHubs/pnsCredentials/action"), - // Display: &armnotificationhubs.OperationDisplay{ - // Operation: to.Ptr("Resource Get Notification Hub PNS Credentials"), - // Provider: to.Ptr("Microsoft Azure NotificationHubs"), - // Resource: to.Ptr("NotificationHub PnsCredential"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.NotificationHubs/Namespaces/NotificationHubs/debugSend/action"), - // Display: &armnotificationhubs.OperationDisplay{ - // Operation: to.Ptr("Send a test push notification"), - // Provider: to.Ptr("Microsoft Azure NotificationHubs"), - // Resource: to.Ptr("NotificationHub resource"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.NotificationHubs/Namespaces/NotificationHubs/metricDefinitions/read"), - // Display: &armnotificationhubs.OperationDisplay{ - // Operation: to.Ptr("Get NotificationHub metrics"), - // Provider: to.Ptr("Microsoft Azure NotificationHubs"), - // Resource: to.Ptr("NotificationHub metrics"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/notificationhubs/armnotificationhubs/privateendpointconnections_client.go b/sdk/resourcemanager/notificationhubs/armnotificationhubs/privateendpointconnections_client.go new file mode 100644 index 000000000000..7ad703839704 --- /dev/null +++ b/sdk/resourcemanager/notificationhubs/armnotificationhubs/privateendpointconnections_client.go @@ -0,0 +1,436 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnotificationhubs + +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" +) + +// PrivateEndpointConnectionsClient contains the methods for the PrivateEndpointConnections group. +// Don't use this type directly, use NewPrivateEndpointConnectionsClient() instead. +type PrivateEndpointConnectionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient 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 - pass nil to accept the default values. +func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error) { + cl, err := arm.NewClient(moduleName+".PrivateEndpointConnectionsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &PrivateEndpointConnectionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginDelete - Deletes the Private Endpoint Connection. This is a public API that can be called directly by Notification +// Hubs users. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name +// - privateEndpointConnectionName - Private Endpoint Connection Name +// - options - PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete +// method. +func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, namespaceName, privateEndpointConnectionName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateEndpointConnectionsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[PrivateEndpointConnectionsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the Private Endpoint Connection. This is a public API that can be called directly by Notification Hubs +// users. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01-preview +func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, namespaceName, privateEndpointConnectionName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}" + 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 privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + 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", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Returns a Private Endpoint Connection with a given name. This is a public API that can be called directly by Notification +// Hubs users. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name +// - privateEndpointConnectionName - Private Endpoint Connection Name +// - options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get +// method. +func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, namespaceName, privateEndpointConnectionName, options) + if err != nil { + return PrivateEndpointConnectionsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrivateEndpointConnectionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateEndpointConnectionsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}" + 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 privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + 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", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientGetResponse, error) { + result := PrivateEndpointConnectionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionResource); err != nil { + return PrivateEndpointConnectionsClientGetResponse{}, err + } + return result, nil +} + +// GetGroupID - Even though this namespace requires subscription id, resource group and namespace name, it returns a constant +// payload (for a given namespacE) every time it's called. That's why we don't send it to the +// sibling RP, but process it directly in the scale unit that received the request. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name +// - subResourceName - Name of the Private Link sub-resource. The only supported sub-resource is "namespace" +// - options - PrivateEndpointConnectionsClientGetGroupIDOptions contains the optional parameters for the PrivateEndpointConnectionsClient.GetGroupID +// method. +func (client *PrivateEndpointConnectionsClient) GetGroupID(ctx context.Context, resourceGroupName string, namespaceName string, subResourceName string, options *PrivateEndpointConnectionsClientGetGroupIDOptions) (PrivateEndpointConnectionsClientGetGroupIDResponse, error) { + req, err := client.getGroupIDCreateRequest(ctx, resourceGroupName, namespaceName, subResourceName, options) + if err != nil { + return PrivateEndpointConnectionsClientGetGroupIDResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrivateEndpointConnectionsClientGetGroupIDResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateEndpointConnectionsClientGetGroupIDResponse{}, runtime.NewResponseError(resp) + } + return client.getGroupIDHandleResponse(resp) +} + +// getGroupIDCreateRequest creates the GetGroupID request. +func (client *PrivateEndpointConnectionsClient) getGroupIDCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, subResourceName string, options *PrivateEndpointConnectionsClientGetGroupIDOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/privateLinkResources/{subResourceName}" + 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 subResourceName == "" { + return nil, errors.New("parameter subResourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subResourceName}", url.PathEscape(subResourceName)) + 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", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getGroupIDHandleResponse handles the GetGroupID response. +func (client *PrivateEndpointConnectionsClient) getGroupIDHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientGetGroupIDResponse, error) { + result := PrivateEndpointConnectionsClientGetGroupIDResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResource); err != nil { + return PrivateEndpointConnectionsClientGetGroupIDResponse{}, err + } + return result, nil +} + +// NewListPager - Returns all Private Endpoint Connections that belong to the given Notification Hubs namespace. This is a +// public API that can be called directly by Notification Hubs users. +// +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name +// - options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListPager +// method. +func (client *PrivateEndpointConnectionsClient) NewListPager(resourceGroupName string, namespaceName string, options *PrivateEndpointConnectionsClientListOptions) *runtime.Pager[PrivateEndpointConnectionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[PrivateEndpointConnectionsClientListResponse]{ + More: func(page PrivateEndpointConnectionsClientListResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *PrivateEndpointConnectionsClientListResponse) (PrivateEndpointConnectionsClientListResponse, error) { + req, err := client.listCreateRequest(ctx, resourceGroupName, namespaceName, options) + if err != nil { + return PrivateEndpointConnectionsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrivateEndpointConnectionsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateEndpointConnectionsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, options *PrivateEndpointConnectionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/privateEndpointConnections" + 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", "2023-01-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 *PrivateEndpointConnectionsClient) listHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientListResponse, error) { + result := PrivateEndpointConnectionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionResourceListResult); err != nil { + return PrivateEndpointConnectionsClientListResponse{}, err + } + return result, nil +} + +// NewListGroupIDsPager - Even though this namespace requires subscription id, resource group and namespace name, it returns +// a constant payload (for a given namespacE) every time it's called. That's why we don't send it to the +// sibling RP, but process it directly in the scale unit that received the request. +// +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name +// - options - PrivateEndpointConnectionsClientListGroupIDsOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListGroupIDsPager +// method. +func (client *PrivateEndpointConnectionsClient) NewListGroupIDsPager(resourceGroupName string, namespaceName string, options *PrivateEndpointConnectionsClientListGroupIDsOptions) *runtime.Pager[PrivateEndpointConnectionsClientListGroupIDsResponse] { + return runtime.NewPager(runtime.PagingHandler[PrivateEndpointConnectionsClientListGroupIDsResponse]{ + More: func(page PrivateEndpointConnectionsClientListGroupIDsResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *PrivateEndpointConnectionsClientListGroupIDsResponse) (PrivateEndpointConnectionsClientListGroupIDsResponse, error) { + req, err := client.listGroupIDsCreateRequest(ctx, resourceGroupName, namespaceName, options) + if err != nil { + return PrivateEndpointConnectionsClientListGroupIDsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrivateEndpointConnectionsClientListGroupIDsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateEndpointConnectionsClientListGroupIDsResponse{}, runtime.NewResponseError(resp) + } + return client.listGroupIDsHandleResponse(resp) + }, + }) +} + +// listGroupIDsCreateRequest creates the ListGroupIDs request. +func (client *PrivateEndpointConnectionsClient) listGroupIDsCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, options *PrivateEndpointConnectionsClientListGroupIDsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/privateLinkResources" + 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", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listGroupIDsHandleResponse handles the ListGroupIDs response. +func (client *PrivateEndpointConnectionsClient) listGroupIDsHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientListGroupIDsResponse, error) { + result := PrivateEndpointConnectionsClientListGroupIDsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResourceListResult); err != nil { + return PrivateEndpointConnectionsClientListGroupIDsResponse{}, err + } + return result, nil +} + +// BeginUpdate - Approves or rejects Private Endpoint Connection. This is a public API that can be called directly by Notification +// Hubs users. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - namespaceName - Namespace name +// - privateEndpointConnectionName - Private Endpoint Connection Name +// - parameters - Description of the Private Endpoint Connection resource. +// - options - PrivateEndpointConnectionsClientBeginUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginUpdate +// method. +func (client *PrivateEndpointConnectionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string, parameters PrivateEndpointConnectionResource, options *PrivateEndpointConnectionsClientBeginUpdateOptions) (*runtime.Poller[PrivateEndpointConnectionsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, namespaceName, privateEndpointConnectionName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateEndpointConnectionsClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[PrivateEndpointConnectionsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Update - Approves or rejects Private Endpoint Connection. This is a public API that can be called directly by Notification +// Hubs users. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01-preview +func (client *PrivateEndpointConnectionsClient) update(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string, parameters PrivateEndpointConnectionResource, options *PrivateEndpointConnectionsClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, namespaceName, privateEndpointConnectionName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *PrivateEndpointConnectionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string, parameters PrivateEndpointConnectionResource, options *PrivateEndpointConnectionsClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}" + 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 privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + 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", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} diff --git a/sdk/resourcemanager/notificationhubs/armnotificationhubs/response_types.go b/sdk/resourcemanager/notificationhubs/armnotificationhubs/response_types.go index 9d453d98158d..b1520bbebf25 100644 --- a/sdk/resourcemanager/notificationhubs/armnotificationhubs/response_types.go +++ b/sdk/resourcemanager/notificationhubs/armnotificationhubs/response_types.go @@ -69,16 +69,16 @@ type ClientListResponse struct { NotificationHubListResult } -// ClientPatchResponse contains the response from method Client.Patch. -type ClientPatchResponse struct { - NotificationHubResource -} - // ClientRegenerateKeysResponse contains the response from method Client.RegenerateKeys. type ClientRegenerateKeysResponse struct { ResourceListKeys } +// ClientUpdateResponse contains the response from method Client.Update. +type ClientUpdateResponse struct { + NotificationHubResource +} + // NamespacesClientCheckAvailabilityResponse contains the response from method NamespacesClient.CheckAvailability. type NamespacesClientCheckAvailabilityResponse struct { CheckAvailabilityResult @@ -89,7 +89,7 @@ type NamespacesClientCreateOrUpdateAuthorizationRuleResponse struct { SharedAccessAuthorizationRuleResource } -// NamespacesClientCreateOrUpdateResponse contains the response from method NamespacesClient.CreateOrUpdate. +// NamespacesClientCreateOrUpdateResponse contains the response from method NamespacesClient.BeginCreateOrUpdate. type NamespacesClientCreateOrUpdateResponse struct { NamespaceResource } @@ -99,7 +99,7 @@ type NamespacesClientDeleteAuthorizationRuleResponse struct { // placeholder for future response values } -// NamespacesClientDeleteResponse contains the response from method NamespacesClient.BeginDelete. +// NamespacesClientDeleteResponse contains the response from method NamespacesClient.Delete. type NamespacesClientDeleteResponse struct { // placeholder for future response values } @@ -109,6 +109,11 @@ type NamespacesClientGetAuthorizationRuleResponse struct { SharedAccessAuthorizationRuleResource } +// NamespacesClientGetPnsCredentialsResponse contains the response from method NamespacesClient.GetPnsCredentials. +type NamespacesClientGetPnsCredentialsResponse struct { + PnsCredentialsResource +} + // NamespacesClientGetResponse contains the response from method NamespacesClient.Get. type NamespacesClientGetResponse struct { NamespaceResource @@ -134,17 +139,47 @@ type NamespacesClientListResponse struct { NamespaceListResult } -// NamespacesClientPatchResponse contains the response from method NamespacesClient.Patch. -type NamespacesClientPatchResponse struct { - NamespaceResource -} - // NamespacesClientRegenerateKeysResponse contains the response from method NamespacesClient.RegenerateKeys. type NamespacesClientRegenerateKeysResponse struct { ResourceListKeys } +// NamespacesClientUpdateResponse contains the response from method NamespacesClient.Update. +type NamespacesClientUpdateResponse struct { + NamespaceResource +} + // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { OperationListResult } + +// PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.BeginDelete. +type PrivateEndpointConnectionsClientDeleteResponse struct { + // placeholder for future response values +} + +// PrivateEndpointConnectionsClientGetGroupIDResponse contains the response from method PrivateEndpointConnectionsClient.GetGroupID. +type PrivateEndpointConnectionsClientGetGroupIDResponse struct { + PrivateLinkResource +} + +// PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get. +type PrivateEndpointConnectionsClientGetResponse struct { + PrivateEndpointConnectionResource +} + +// PrivateEndpointConnectionsClientListGroupIDsResponse contains the response from method PrivateEndpointConnectionsClient.NewListGroupIDsPager. +type PrivateEndpointConnectionsClientListGroupIDsResponse struct { + PrivateLinkResourceListResult +} + +// PrivateEndpointConnectionsClientListResponse contains the response from method PrivateEndpointConnectionsClient.NewListPager. +type PrivateEndpointConnectionsClientListResponse struct { + PrivateEndpointConnectionResourceListResult +} + +// PrivateEndpointConnectionsClientUpdateResponse contains the response from method PrivateEndpointConnectionsClient.BeginUpdate. +type PrivateEndpointConnectionsClientUpdateResponse struct { + PrivateEndpointConnectionResource +}