From 08c3d180664924e631225819df59ce30694cd15e Mon Sep 17 00:00:00 2001 From: Peng Jiahui <46921893+Alancere@users.noreply.github.com> Date: Mon, 24 Jul 2023 16:38:01 +0800 Subject: [PATCH] [Release] sdk/resourcemanager/webpubsub/armwebpubsub/1.2.0-beta.1 generation from spec commit: c53808ba54beef57059371708f1fa6949a11a280 (#21139) --- .../webpubsub/armwebpubsub/CHANGELOG.md | 23 + .../webpubsub/armwebpubsub/autorest.md | 8 +- .../webpubsub/armwebpubsub/client.go | 190 ++++---- .../armwebpubsub/client_example_test.go | 353 +++++++++++---- .../webpubsub/armwebpubsub/client_factory.go | 8 +- .../webpubsub/armwebpubsub/constants.go | 18 +- .../armwebpubsub/customcertificates_client.go | 49 +- .../customcertificates_client_example_test.go | 8 +- .../armwebpubsub/customdomains_client.go | 51 +-- .../customdomains_client_example_test.go | 8 +- .../webpubsub/armwebpubsub/go.mod | 16 +- .../webpubsub/armwebpubsub/go.sum | 36 +- .../webpubsub/armwebpubsub/hubs_client.go | 51 +-- .../armwebpubsub/hubs_client_example_test.go | 8 +- .../webpubsub/armwebpubsub/models.go | 188 ++++++-- .../webpubsub/armwebpubsub/models_serde.go | 133 ++++++ .../armwebpubsub/operations_client.go | 4 +- .../operations_client_example_test.go | 2 +- .../privateendpointconnections_client.go | 51 +-- ...endpointconnections_client_example_test.go | 60 ++- .../privatelinkresources_client.go | 13 +- ...rivatelinkresources_client_example_test.go | 18 +- .../webpubsub/armwebpubsub/replicas_client.go | 427 ++++++++++++++++++ .../replicas_client_example_test.go | 279 ++++++++++++ .../webpubsub/armwebpubsub/response_types.go | 35 ++ .../sharedprivatelinkresources_client.go | 51 +-- ...rivatelinkresources_client_example_test.go | 8 +- .../webpubsub/armwebpubsub/usages_client.go | 10 +- .../usages_client_example_test.go | 2 +- 29 files changed, 1613 insertions(+), 495 deletions(-) create mode 100644 sdk/resourcemanager/webpubsub/armwebpubsub/replicas_client.go create mode 100644 sdk/resourcemanager/webpubsub/armwebpubsub/replicas_client_example_test.go diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/CHANGELOG.md b/sdk/resourcemanager/webpubsub/armwebpubsub/CHANGELOG.md index 3d918569c7df..ec9384ecaf5f 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/CHANGELOG.md +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/CHANGELOG.md @@ -1,5 +1,28 @@ # Release History +## 1.2.0-beta.1 (2023-07-28) +### Features Added + +- New enum type `ServiceKind` with values `ServiceKindSocketIO`, `ServiceKindWebPubSub` +- New function `*Client.ListReplicaSKUs(context.Context, string, string, string, *ClientListReplicaSKUsOptions) (ClientListReplicaSKUsResponse, error)` +- New function `*ClientFactory.NewReplicasClient() *ReplicasClient` +- New function `NewReplicasClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ReplicasClient, error)` +- New function `*ReplicasClient.BeginCreateOrUpdate(context.Context, string, string, string, Replica, *ReplicasClientBeginCreateOrUpdateOptions) (*runtime.Poller[ReplicasClientCreateOrUpdateResponse], error)` +- New function `*ReplicasClient.Delete(context.Context, string, string, string, *ReplicasClientDeleteOptions) (ReplicasClientDeleteResponse, error)` +- New function `*ReplicasClient.Get(context.Context, string, string, string, *ReplicasClientGetOptions) (ReplicasClientGetResponse, error)` +- New function `*ReplicasClient.NewListPager(string, string, *ReplicasClientListOptions) *runtime.Pager[ReplicasClientListResponse]` +- New function `*ReplicasClient.BeginRestart(context.Context, string, string, string, *ReplicasClientBeginRestartOptions) (*runtime.Poller[ReplicasClientRestartResponse], error)` +- New function `*ReplicasClient.BeginUpdate(context.Context, string, string, string, Replica, *ReplicasClientBeginUpdateOptions) (*runtime.Poller[ReplicasClientUpdateResponse], error)` +- New struct `Replica` +- New struct `ReplicaList` +- New struct `ReplicaProperties` +- New field `SystemData` in struct `PrivateLinkResource` +- New field `SystemData` in struct `ProxyResource` +- New field `SystemData` in struct `Resource` +- New field `Kind` in struct `ResourceInfo` +- New field `SystemData` in struct `TrackedResource` + + ## 1.1.1 (2023-04-14) ### Bug Fixes diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/autorest.md b/sdk/resourcemanager/webpubsub/armwebpubsub/autorest.md index 83f87673d463..e9a6d3ff0f48 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/autorest.md +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.1.1 - +module-version: 1.2.0-beta.1 +tag: package-2023-06-01-preview ``` \ No newline at end of file diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/client.go b/sdk/resourcemanager/webpubsub/armwebpubsub/client.go index a47b818492bc..d500f97fe446 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/client.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/client.go @@ -29,8 +29,7 @@ type Client struct { } // NewClient creates a new instance of Client with the specified values. -// - subscriptionID - Gets subscription Id which uniquely identify the 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,7 +47,7 @@ func NewClient(subscriptionID string, credential azcore.TokenCredential, options // CheckNameAvailability - Checks that the resource name is valid and is not already in use. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-06-01-preview // - location - the region // - parameters - Parameters supplied to the operation. // - options - ClientCheckNameAvailabilityOptions contains the optional parameters for the Client.CheckNameAvailability method. @@ -74,16 +73,13 @@ func (client *Client) checkNameAvailabilityCreateRequest(ctx context.Context, lo return nil, errors.New("parameter location cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - 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", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -101,9 +97,8 @@ func (client *Client) checkNameAvailabilityHandleResponse(resp *http.Response) ( // BeginCreateOrUpdate - Create or update a resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - parameters - Parameters for the create or update operation // - options - ClientBeginCreateOrUpdateOptions contains the optional parameters for the Client.BeginCreateOrUpdate method. @@ -113,7 +108,9 @@ func (client *Client) BeginCreateOrUpdate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[ClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) } else { return runtime.NewPollerFromResumeToken[ClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -122,7 +119,7 @@ func (client *Client) BeginCreateOrUpdate(ctx context.Context, resourceGroupName // CreateOrUpdate - Create or update a resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-06-01-preview func (client *Client) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters ResourceInfo, options *ClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { @@ -141,9 +138,6 @@ func (client *Client) createOrUpdate(ctx context.Context, resourceGroupName stri // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *Client) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, parameters ResourceInfo, options *ClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -158,7 +152,7 @@ func (client *Client) createOrUpdateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -167,9 +161,8 @@ func (client *Client) createOrUpdateCreateRequest(ctx context.Context, resourceG // BeginDelete - Operation to delete a resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - options - ClientBeginDeleteOptions contains the optional parameters for the Client.BeginDelete method. func (client *Client) BeginDelete(ctx context.Context, resourceGroupName string, resourceName string, options *ClientBeginDeleteOptions) (*runtime.Poller[ClientDeleteResponse], error) { @@ -189,7 +182,7 @@ func (client *Client) BeginDelete(ctx context.Context, resourceGroupName string, // Delete - Operation to delete a resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-06-01-preview func (client *Client) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, options *ClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { @@ -208,9 +201,6 @@ func (client *Client) deleteOperation(ctx context.Context, resourceGroupName str // deleteCreateRequest creates the Delete request. func (client *Client) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -225,7 +215,7 @@ func (client *Client) deleteCreateRequest(ctx context.Context, resourceGroupName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,9 +224,8 @@ func (client *Client) deleteCreateRequest(ctx context.Context, resourceGroupName // Get - Get the resource and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - options - ClientGetOptions contains the optional parameters for the Client.Get method. func (client *Client) Get(ctx context.Context, resourceGroupName string, resourceName string, options *ClientGetOptions) (ClientGetResponse, error) { @@ -257,9 +246,6 @@ func (client *Client) Get(ctx context.Context, resourceGroupName string, resourc // getCreateRequest creates the Get request. func (client *Client) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -274,7 +260,7 @@ func (client *Client) getCreateRequest(ctx context.Context, resourceGroupName st return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -291,9 +277,8 @@ func (client *Client) getHandleResponse(resp *http.Response) (ClientGetResponse, // NewListByResourceGroupPager - Handles requests to list all resources in a resource group. // -// Generated from API version 2023-02-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ClientListByResourceGroupOptions contains the optional parameters for the Client.NewListByResourceGroupPager // method. func (client *Client) NewListByResourceGroupPager(resourceGroupName string, options *ClientListByResourceGroupOptions) *runtime.Pager[ClientListByResourceGroupResponse] { @@ -327,9 +312,6 @@ func (client *Client) NewListByResourceGroupPager(resourceGroupName string, opti // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *Client) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -340,7 +322,7 @@ func (client *Client) listByResourceGroupCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -357,7 +339,7 @@ func (client *Client) listByResourceGroupHandleResponse(resp *http.Response) (Cl // NewListBySubscriptionPager - Handles requests to list all resources in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-06-01-preview // - options - ClientListBySubscriptionOptions contains the optional parameters for the Client.NewListBySubscriptionPager method. func (client *Client) NewListBySubscriptionPager(options *ClientListBySubscriptionOptions) *runtime.Pager[ClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[ClientListBySubscriptionResponse]{ @@ -390,16 +372,13 @@ func (client *Client) NewListBySubscriptionPager(options *ClientListBySubscripti // listBySubscriptionCreateRequest creates the ListBySubscription request. func (client *Client) listBySubscriptionCreateRequest(ctx context.Context, options *ClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/webPubSub" - 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", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -417,9 +396,8 @@ func (client *Client) listBySubscriptionHandleResponse(resp *http.Response) (Cli // ListKeys - Get the access keys of the resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - options - ClientListKeysOptions contains the optional parameters for the Client.ListKeys method. func (client *Client) ListKeys(ctx context.Context, resourceGroupName string, resourceName string, options *ClientListKeysOptions) (ClientListKeysResponse, error) { @@ -440,9 +418,6 @@ func (client *Client) ListKeys(ctx context.Context, resourceGroupName string, re // listKeysCreateRequest creates the ListKeys request. func (client *Client) listKeysCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ClientListKeysOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/listKeys" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -457,7 +432,7 @@ func (client *Client) listKeysCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -472,12 +447,70 @@ func (client *Client) listKeysHandleResponse(resp *http.Response) (ClientListKey return result, nil } +// ListReplicaSKUs - List all available skus of the replica resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the resource. +// - replicaName - The name of the replica. +// - options - ClientListReplicaSKUsOptions contains the optional parameters for the Client.ListReplicaSKUs method. +func (client *Client) ListReplicaSKUs(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, options *ClientListReplicaSKUsOptions) (ClientListReplicaSKUsResponse, error) { + req, err := client.listReplicaSKUsCreateRequest(ctx, resourceGroupName, resourceName, replicaName, options) + if err != nil { + return ClientListReplicaSKUsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ClientListReplicaSKUsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ClientListReplicaSKUsResponse{}, runtime.NewResponseError(resp) + } + return client.listReplicaSKUsHandleResponse(resp) +} + +// listReplicaSKUsCreateRequest creates the ListReplicaSKUs request. +func (client *Client) listReplicaSKUsCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, options *ClientListReplicaSKUsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas/{replicaName}/skus" + 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 resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if replicaName == "" { + return nil, errors.New("parameter replicaName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{replicaName}", url.PathEscape(replicaName)) + 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-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listReplicaSKUsHandleResponse handles the ListReplicaSKUs response. +func (client *Client) listReplicaSKUsHandleResponse(resp *http.Response) (ClientListReplicaSKUsResponse, error) { + result := ClientListReplicaSKUsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SKUList); err != nil { + return ClientListReplicaSKUsResponse{}, err + } + return result, nil +} + // ListSKUs - List all available skus of the resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - options - ClientListSKUsOptions contains the optional parameters for the Client.ListSKUs method. func (client *Client) ListSKUs(ctx context.Context, resourceGroupName string, resourceName string, options *ClientListSKUsOptions) (ClientListSKUsResponse, error) { @@ -498,9 +531,6 @@ func (client *Client) ListSKUs(ctx context.Context, resourceGroupName string, re // listSKUsCreateRequest creates the ListSKUs request. func (client *Client) listSKUsCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ClientListSKUsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/skus" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -515,7 +545,7 @@ func (client *Client) listSKUsCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -534,9 +564,8 @@ func (client *Client) listSKUsHandleResponse(resp *http.Response) (ClientListSKU // same time. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - parameters - Parameter that describes the Regenerate Key Operation. // - options - ClientBeginRegenerateKeyOptions contains the optional parameters for the Client.BeginRegenerateKey method. @@ -547,7 +576,7 @@ func (client *Client) BeginRegenerateKey(ctx context.Context, resourceGroupName return nil, err } return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClientRegenerateKeyResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + FinalStateVia: runtime.FinalStateViaLocation, }) } else { return runtime.NewPollerFromResumeToken[ClientRegenerateKeyResponse](options.ResumeToken, client.internal.Pipeline(), nil) @@ -558,7 +587,7 @@ func (client *Client) BeginRegenerateKey(ctx context.Context, resourceGroupName // time. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-06-01-preview func (client *Client) regenerateKey(ctx context.Context, resourceGroupName string, resourceName string, parameters RegenerateKeyParameters, options *ClientBeginRegenerateKeyOptions) (*http.Response, error) { req, err := client.regenerateKeyCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { @@ -568,7 +597,7 @@ func (client *Client) regenerateKey(ctx context.Context, resourceGroupName strin if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -577,9 +606,6 @@ func (client *Client) regenerateKey(ctx context.Context, resourceGroupName strin // regenerateKeyCreateRequest creates the RegenerateKey request. func (client *Client) regenerateKeyCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, parameters RegenerateKeyParameters, options *ClientBeginRegenerateKeyOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/regenerateKey" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -594,7 +620,7 @@ func (client *Client) regenerateKeyCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -603,9 +629,8 @@ func (client *Client) regenerateKeyCreateRequest(ctx context.Context, resourceGr // BeginRestart - Operation to restart a resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - options - ClientBeginRestartOptions contains the optional parameters for the Client.BeginRestart method. func (client *Client) BeginRestart(ctx context.Context, resourceGroupName string, resourceName string, options *ClientBeginRestartOptions) (*runtime.Poller[ClientRestartResponse], error) { @@ -615,7 +640,7 @@ func (client *Client) BeginRestart(ctx context.Context, resourceGroupName string return nil, err } return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClientRestartResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + FinalStateVia: runtime.FinalStateViaLocation, }) } else { return runtime.NewPollerFromResumeToken[ClientRestartResponse](options.ResumeToken, client.internal.Pipeline(), nil) @@ -625,7 +650,7 @@ func (client *Client) BeginRestart(ctx context.Context, resourceGroupName string // Restart - Operation to restart a resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-06-01-preview func (client *Client) restart(ctx context.Context, resourceGroupName string, resourceName string, options *ClientBeginRestartOptions) (*http.Response, error) { req, err := client.restartCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { @@ -644,9 +669,6 @@ func (client *Client) restart(ctx context.Context, resourceGroupName string, res // restartCreateRequest creates the Restart request. func (client *Client) restartCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ClientBeginRestartOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/restart" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -661,7 +683,7 @@ func (client *Client) restartCreateRequest(ctx context.Context, resourceGroupNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -670,9 +692,8 @@ func (client *Client) restartCreateRequest(ctx context.Context, resourceGroupNam // BeginUpdate - Operation to update an exiting resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - parameters - Parameters for the update operation // - options - ClientBeginUpdateOptions contains the optional parameters for the Client.BeginUpdate method. @@ -682,7 +703,9 @@ func (client *Client) BeginUpdate(ctx context.Context, resourceGroupName string, if err != nil { return nil, err } - return runtime.NewPoller[ClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) } else { return runtime.NewPollerFromResumeToken[ClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -691,7 +714,7 @@ func (client *Client) BeginUpdate(ctx context.Context, resourceGroupName string, // Update - Operation to update an exiting resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-06-01-preview func (client *Client) update(ctx context.Context, resourceGroupName string, resourceName string, parameters ResourceInfo, options *ClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { @@ -710,9 +733,6 @@ func (client *Client) update(ctx context.Context, resourceGroupName string, reso // updateCreateRequest creates the Update request. func (client *Client) updateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, parameters ResourceInfo, options *ClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -727,7 +747,7 @@ func (client *Client) updateCreateRequest(ctx context.Context, resourceGroupName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-06-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/webpubsub/armwebpubsub/client_example_test.go b/sdk/resourcemanager/webpubsub/armwebpubsub/client_example_test.go index 5d77468c32b9..faa6a28ce2d0 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/client_example_test.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/webpubsub/armwebpubsub" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSub_CheckNameAvailability.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSub_CheckNameAvailability.json func ExampleClient_CheckNameAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -46,7 +46,7 @@ func ExampleClient_CheckNameAvailability() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSub_ListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSub_ListBySubscription.json func ExampleClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -74,6 +74,14 @@ func ExampleClient_NewListBySubscriptionPager() { // Name: to.Ptr("myWebPubSubService"), // Type: to.Ptr("Microsoft.SignalRService/WebPubSub"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService"), + // SystemData: &armwebpubsub.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // }, // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), @@ -83,6 +91,7 @@ func ExampleClient_NewListBySubscriptionPager() { // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), // }, + // Kind: to.Ptr(armwebpubsub.ServiceKindWebPubSub), // Properties: &armwebpubsub.Properties{ // DisableAADAuth: to.Ptr(false), // DisableLocalAuth: to.Ptr(false), @@ -114,6 +123,14 @@ func ExampleClient_NewListBySubscriptionPager() { // Name: to.Ptr("mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), // Type: to.Ptr("Microsoft.SignalRService/WebPubSub/privateEndpointConnections"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/privateEndpointConnections/mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), + // SystemData: &armwebpubsub.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // }, // Properties: &armwebpubsub.PrivateEndpointConnectionProperties{ // PrivateEndpoint: &armwebpubsub.PrivateEndpoint{ // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"), @@ -124,14 +141,6 @@ func ExampleClient_NewListBySubscriptionPager() { // }, // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), // }, - // SystemData: &armwebpubsub.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // }, // }}, // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), // PublicNetworkAccess: to.Ptr("Enabled"), @@ -155,20 +164,12 @@ func ExampleClient_NewListBySubscriptionPager() { // Size: to.Ptr("P1"), // Tier: to.Ptr(armwebpubsub.WebPubSubSKUTierPremium), // }, - // SystemData: &armwebpubsub.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // }, // }}, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSub_ListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSub_ListByResourceGroup.json func ExampleClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -196,6 +197,14 @@ func ExampleClient_NewListByResourceGroupPager() { // Name: to.Ptr("myWebPubSubService"), // Type: to.Ptr("Microsoft.SignalRService/WebPubSub"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService"), + // SystemData: &armwebpubsub.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // }, // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), @@ -205,6 +214,7 @@ func ExampleClient_NewListByResourceGroupPager() { // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), // }, + // Kind: to.Ptr(armwebpubsub.ServiceKindWebPubSub), // Properties: &armwebpubsub.Properties{ // DisableAADAuth: to.Ptr(false), // DisableLocalAuth: to.Ptr(false), @@ -236,6 +246,14 @@ func ExampleClient_NewListByResourceGroupPager() { // Name: to.Ptr("mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), // Type: to.Ptr("Microsoft.SignalRService/WebPubSub/privateEndpointConnections"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/privateEndpointConnections/mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), + // SystemData: &armwebpubsub.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // }, // Properties: &armwebpubsub.PrivateEndpointConnectionProperties{ // PrivateEndpoint: &armwebpubsub.PrivateEndpoint{ // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"), @@ -246,14 +264,6 @@ func ExampleClient_NewListByResourceGroupPager() { // }, // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), // }, - // SystemData: &armwebpubsub.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // }, // }}, // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), // PublicNetworkAccess: to.Ptr("Enabled"), @@ -277,20 +287,12 @@ func ExampleClient_NewListByResourceGroupPager() { // Size: to.Ptr("P1"), // Tier: to.Ptr(armwebpubsub.WebPubSubSKUTierPremium), // }, - // SystemData: &armwebpubsub.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // }, // }}, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSub_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSub_Get.json func ExampleClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -312,6 +314,14 @@ func ExampleClient_Get() { // Name: to.Ptr("myWebPubSubService"), // Type: to.Ptr("Microsoft.SignalRService/WebPubSub"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService"), + // SystemData: &armwebpubsub.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // }, // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), @@ -321,6 +331,7 @@ func ExampleClient_Get() { // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), // }, + // Kind: to.Ptr(armwebpubsub.ServiceKindWebPubSub), // Properties: &armwebpubsub.Properties{ // DisableAADAuth: to.Ptr(false), // DisableLocalAuth: to.Ptr(false), @@ -352,6 +363,14 @@ func ExampleClient_Get() { // Name: to.Ptr("mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), // Type: to.Ptr("Microsoft.SignalRService/WebPubSub/privateEndpointConnections"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/privateEndpointConnections/mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), + // SystemData: &armwebpubsub.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // }, // Properties: &armwebpubsub.PrivateEndpointConnectionProperties{ // PrivateEndpoint: &armwebpubsub.PrivateEndpoint{ // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"), @@ -362,14 +381,6 @@ func ExampleClient_Get() { // }, // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), // }, - // SystemData: &armwebpubsub.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // }, // }}, // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), // PublicNetworkAccess: to.Ptr("Enabled"), @@ -393,18 +404,10 @@ func ExampleClient_Get() { // Size: to.Ptr("P1"), // Tier: to.Ptr(armwebpubsub.WebPubSubSKUTierPremium), // }, - // SystemData: &armwebpubsub.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSub_CreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSub_CreateOrUpdate.json func ExampleClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -423,6 +426,7 @@ func ExampleClient_BeginCreateOrUpdate() { Identity: &armwebpubsub.ManagedIdentity{ Type: to.Ptr(armwebpubsub.ManagedIdentityTypeSystemAssigned), }, + Kind: to.Ptr(armwebpubsub.ServiceKindWebPubSub), Properties: &armwebpubsub.Properties{ DisableAADAuth: to.Ptr(false), DisableLocalAuth: to.Ptr(false), @@ -472,6 +476,14 @@ func ExampleClient_BeginCreateOrUpdate() { // Name: to.Ptr("myWebPubSubService"), // Type: to.Ptr("Microsoft.SignalRService/WebPubSub"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService"), + // SystemData: &armwebpubsub.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // }, // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), @@ -481,6 +493,7 @@ func ExampleClient_BeginCreateOrUpdate() { // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), // }, + // Kind: to.Ptr(armwebpubsub.ServiceKindWebPubSub), // Properties: &armwebpubsub.Properties{ // DisableAADAuth: to.Ptr(false), // DisableLocalAuth: to.Ptr(false), @@ -512,6 +525,14 @@ func ExampleClient_BeginCreateOrUpdate() { // Name: to.Ptr("mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), // Type: to.Ptr("Microsoft.SignalRService/WebPubSub/privateEndpointConnections"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/privateEndpointConnections/mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), + // SystemData: &armwebpubsub.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // }, // Properties: &armwebpubsub.PrivateEndpointConnectionProperties{ // PrivateEndpoint: &armwebpubsub.PrivateEndpoint{ // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"), @@ -522,14 +543,6 @@ func ExampleClient_BeginCreateOrUpdate() { // }, // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), // }, - // SystemData: &armwebpubsub.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // }, // }}, // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), // PublicNetworkAccess: to.Ptr("Enabled"), @@ -553,18 +566,10 @@ func ExampleClient_BeginCreateOrUpdate() { // Size: to.Ptr("P1"), // Tier: to.Ptr(armwebpubsub.WebPubSubSKUTierPremium), // }, - // SystemData: &armwebpubsub.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSub_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSub_Delete.json func ExampleClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -585,7 +590,7 @@ func ExampleClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSub_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSub_Update.json func ExampleClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -604,6 +609,7 @@ func ExampleClient_BeginUpdate() { Identity: &armwebpubsub.ManagedIdentity{ Type: to.Ptr(armwebpubsub.ManagedIdentityTypeSystemAssigned), }, + Kind: to.Ptr(armwebpubsub.ServiceKindWebPubSub), Properties: &armwebpubsub.Properties{ DisableAADAuth: to.Ptr(false), DisableLocalAuth: to.Ptr(false), @@ -653,6 +659,14 @@ func ExampleClient_BeginUpdate() { // Name: to.Ptr("myWebPubSubService"), // Type: to.Ptr("Microsoft.SignalRService/WebPubSub"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService"), + // SystemData: &armwebpubsub.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // }, // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), @@ -662,6 +676,7 @@ func ExampleClient_BeginUpdate() { // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), // }, + // Kind: to.Ptr(armwebpubsub.ServiceKindWebPubSub), // Properties: &armwebpubsub.Properties{ // DisableAADAuth: to.Ptr(false), // DisableLocalAuth: to.Ptr(false), @@ -693,6 +708,14 @@ func ExampleClient_BeginUpdate() { // Name: to.Ptr("mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), // Type: to.Ptr("Microsoft.SignalRService/WebPubSub/privateEndpointConnections"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/privateEndpointConnections/mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), + // SystemData: &armwebpubsub.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // }, // Properties: &armwebpubsub.PrivateEndpointConnectionProperties{ // PrivateEndpoint: &armwebpubsub.PrivateEndpoint{ // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"), @@ -703,14 +726,6 @@ func ExampleClient_BeginUpdate() { // }, // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), // }, - // SystemData: &armwebpubsub.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // }, // }}, // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), // PublicNetworkAccess: to.Ptr("Enabled"), @@ -734,18 +749,10 @@ func ExampleClient_BeginUpdate() { // Size: to.Ptr("P1"), // Tier: to.Ptr(armwebpubsub.WebPubSubSKUTierPremium), // }, - // SystemData: &armwebpubsub.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSub_ListKeys.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSub_ListKeys.json func ExampleClient_ListKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -767,7 +774,7 @@ func ExampleClient_ListKeys() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSub_RegenerateKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSub_RegenerateKey.json func ExampleClient_BeginRegenerateKey() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -784,13 +791,122 @@ func ExampleClient_BeginRegenerateKey() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.Keys = armwebpubsub.Keys{ + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSub_ListReplicaSkus.json +func ExampleClient_ListReplicaSKUs() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armwebpubsub.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewClient().ListReplicaSKUs(ctx, "myResourceGroup", "myWebPubSubService", "myWebPubSubService-eastus", 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.SKUList = armwebpubsub.SKUList{ + // Value: []*armwebpubsub.SKU{ + // { + // Capacity: &armwebpubsub.SKUCapacity{ + // Default: to.Ptr[int32](1), + // AllowedValues: []*int32{ + // to.Ptr[int32](1)}, + // Maximum: to.Ptr[int32](1), + // Minimum: to.Ptr[int32](0), + // ScaleType: to.Ptr(armwebpubsub.ScaleTypeManual), + // }, + // ResourceType: to.Ptr("Microsoft.SignalRService/WebPubSub/replicas"), + // SKU: &armwebpubsub.ResourceSKU{ + // Name: to.Ptr("Free_F1"), + // Tier: to.Ptr(armwebpubsub.WebPubSubSKUTierFree), + // }, + // }, + // { + // Capacity: &armwebpubsub.SKUCapacity{ + // Default: to.Ptr[int32](1), + // AllowedValues: []*int32{ + // to.Ptr[int32](1), + // to.Ptr[int32](2), + // to.Ptr[int32](3), + // to.Ptr[int32](4), + // to.Ptr[int32](5), + // to.Ptr[int32](6), + // to.Ptr[int32](7), + // to.Ptr[int32](8), + // to.Ptr[int32](9), + // to.Ptr[int32](10), + // to.Ptr[int32](20), + // to.Ptr[int32](30), + // to.Ptr[int32](40), + // to.Ptr[int32](50), + // to.Ptr[int32](60), + // to.Ptr[int32](70), + // to.Ptr[int32](80), + // to.Ptr[int32](90), + // to.Ptr[int32](100)}, + // Maximum: to.Ptr[int32](100), + // Minimum: to.Ptr[int32](0), + // ScaleType: to.Ptr(armwebpubsub.ScaleTypeManual), + // }, + // ResourceType: to.Ptr("Microsoft.SignalRService/WebPubSub/replicas"), + // SKU: &armwebpubsub.ResourceSKU{ + // Name: to.Ptr("Standard_S1"), + // Tier: to.Ptr(armwebpubsub.WebPubSubSKUTierStandard), + // }, + // }, + // { + // Capacity: &armwebpubsub.SKUCapacity{ + // Default: to.Ptr[int32](1), + // AllowedValues: []*int32{ + // to.Ptr[int32](1), + // to.Ptr[int32](2), + // to.Ptr[int32](3), + // to.Ptr[int32](4), + // to.Ptr[int32](5), + // to.Ptr[int32](6), + // to.Ptr[int32](7), + // to.Ptr[int32](8), + // to.Ptr[int32](9), + // to.Ptr[int32](10), + // to.Ptr[int32](20), + // to.Ptr[int32](30), + // to.Ptr[int32](40), + // to.Ptr[int32](50), + // to.Ptr[int32](60), + // to.Ptr[int32](70), + // to.Ptr[int32](80), + // to.Ptr[int32](90), + // to.Ptr[int32](100)}, + // Maximum: to.Ptr[int32](100), + // Minimum: to.Ptr[int32](0), + // ScaleType: to.Ptr(armwebpubsub.ScaleTypeAutomatic), + // }, + // ResourceType: to.Ptr("Microsoft.SignalRService/WebPubSub/replicas"), + // SKU: &armwebpubsub.ResourceSKU{ + // Name: to.Ptr("Premium_P1"), + // Tier: to.Ptr(armwebpubsub.WebPubSubSKUTierStandard), + // }, + // }}, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSub_Restart.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSub_Restart.json func ExampleClient_BeginRestart() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -811,7 +927,7 @@ func ExampleClient_BeginRestart() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSub_ListSkus.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSub_ListSkus.json func ExampleClient_ListSKUs() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -835,7 +951,6 @@ func ExampleClient_ListSKUs() { // Capacity: &armwebpubsub.SKUCapacity{ // Default: to.Ptr[int32](1), // AllowedValues: []*int32{ - // to.Ptr[int32](0), // to.Ptr[int32](1)}, // Maximum: to.Ptr[int32](1), // Minimum: to.Ptr[int32](0), @@ -851,23 +966,67 @@ func ExampleClient_ListSKUs() { // Capacity: &armwebpubsub.SKUCapacity{ // Default: to.Ptr[int32](1), // AllowedValues: []*int32{ - // to.Ptr[int32](0), // to.Ptr[int32](1), // to.Ptr[int32](2), + // to.Ptr[int32](3), + // to.Ptr[int32](4), // to.Ptr[int32](5), + // to.Ptr[int32](6), + // to.Ptr[int32](7), + // to.Ptr[int32](8), + // to.Ptr[int32](9), // to.Ptr[int32](10), // to.Ptr[int32](20), + // to.Ptr[int32](30), + // to.Ptr[int32](40), // to.Ptr[int32](50), + // to.Ptr[int32](60), + // to.Ptr[int32](70), + // to.Ptr[int32](80), + // to.Ptr[int32](90), // to.Ptr[int32](100)}, // Maximum: to.Ptr[int32](100), // Minimum: to.Ptr[int32](0), - // ScaleType: to.Ptr(armwebpubsub.ScaleTypeAutomatic), + // ScaleType: to.Ptr(armwebpubsub.ScaleTypeManual), // }, // ResourceType: to.Ptr("Microsoft.SignalRService/WebPubSub"), // SKU: &armwebpubsub.ResourceSKU{ // Name: to.Ptr("Standard_S1"), // Tier: to.Ptr(armwebpubsub.WebPubSubSKUTierStandard), // }, - // }}, - // } + // }, + // { + // Capacity: &armwebpubsub.SKUCapacity{ + // Default: to.Ptr[int32](1), + // AllowedValues: []*int32{ + // to.Ptr[int32](1), + // to.Ptr[int32](2), + // to.Ptr[int32](3), + // to.Ptr[int32](4), + // to.Ptr[int32](5), + // to.Ptr[int32](6), + // to.Ptr[int32](7), + // to.Ptr[int32](8), + // to.Ptr[int32](9), + // to.Ptr[int32](10), + // to.Ptr[int32](20), + // to.Ptr[int32](30), + // to.Ptr[int32](40), + // to.Ptr[int32](50), + // to.Ptr[int32](60), + // to.Ptr[int32](70), + // to.Ptr[int32](80), + // to.Ptr[int32](90), + // to.Ptr[int32](100)}, + // Maximum: to.Ptr[int32](100), + // Minimum: to.Ptr[int32](0), + // ScaleType: to.Ptr(armwebpubsub.ScaleTypeAutomatic), + // }, + // ResourceType: to.Ptr("Microsoft.SignalRService/WebPubSub/replicas"), + // SKU: &armwebpubsub.ResourceSKU{ + // Name: to.Ptr("Premium_P1"), + // Tier: to.Ptr(armwebpubsub.WebPubSubSKUTierStandard), + // }, + // }}, + // } } diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/client_factory.go b/sdk/resourcemanager/webpubsub/armwebpubsub/client_factory.go index 1c9df9824c9e..4149d7a8600c 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/client_factory.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/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 Id which uniquely identify the 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) { @@ -79,6 +78,11 @@ func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesCli return subClient } +func (c *ClientFactory) NewReplicasClient() *ReplicasClient { + subClient, _ := NewReplicasClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewSharedPrivateLinkResourcesClient() *SharedPrivateLinkResourcesClient { subClient, _ := NewSharedPrivateLinkResourcesClient(c.subscriptionID, c.credential, c.options) return subClient diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/constants.go b/sdk/resourcemanager/webpubsub/armwebpubsub/constants.go index 085f31f73feb..443f20922b3f 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/constants.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/constants.go @@ -11,7 +11,7 @@ package armwebpubsub const ( moduleName = "armwebpubsub" - moduleVersion = "v1.1.1" + moduleVersion = "v1.2.0-beta.1" ) // ACLAction - Azure Networking ACL Action. @@ -181,6 +181,22 @@ func PossibleScaleTypeValues() []ScaleType { } } +// ServiceKind - The kind of the service +type ServiceKind string + +const ( + ServiceKindSocketIO ServiceKind = "SocketIO" + ServiceKindWebPubSub ServiceKind = "WebPubSub" +) + +// PossibleServiceKindValues returns the possible values for the ServiceKind const type. +func PossibleServiceKindValues() []ServiceKind { + return []ServiceKind{ + ServiceKindSocketIO, + ServiceKindWebPubSub, + } +} + // SharedPrivateLinkResourceStatus - Status of the shared private link resource type SharedPrivateLinkResourceStatus string diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/customcertificates_client.go b/sdk/resourcemanager/webpubsub/armwebpubsub/customcertificates_client.go index 52ab61ab1223..833560eadb33 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/customcertificates_client.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/customcertificates_client.go @@ -29,8 +29,7 @@ type CustomCertificatesClient struct { } // NewCustomCertificatesClient creates a new instance of CustomCertificatesClient with the specified values. -// - subscriptionID - Gets subscription Id which uniquely identify the 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 NewCustomCertificatesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CustomCertificatesClient, error) { @@ -48,9 +47,8 @@ func NewCustomCertificatesClient(subscriptionID string, credential azcore.TokenC // BeginCreateOrUpdate - Create or update a custom certificate. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - certificateName - Custom certificate name // - options - CustomCertificatesClientBeginCreateOrUpdateOptions contains the optional parameters for the CustomCertificatesClient.BeginCreateOrUpdate @@ -61,7 +59,9 @@ func (client *CustomCertificatesClient) BeginCreateOrUpdate(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller[CustomCertificatesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CustomCertificatesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) } else { return runtime.NewPollerFromResumeToken[CustomCertificatesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -70,7 +70,7 @@ func (client *CustomCertificatesClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Create or update a custom certificate. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-06-01-preview func (client *CustomCertificatesClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, certificateName string, parameters CustomCertificate, options *CustomCertificatesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, certificateName, parameters, options) if err != nil { @@ -89,9 +89,6 @@ func (client *CustomCertificatesClient) createOrUpdate(ctx context.Context, reso // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *CustomCertificatesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, certificateName string, parameters CustomCertificate, options *CustomCertificatesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/customCertificates/{certificateName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -110,7 +107,7 @@ func (client *CustomCertificatesClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -119,9 +116,8 @@ func (client *CustomCertificatesClient) createOrUpdateCreateRequest(ctx context. // Delete - Delete a custom certificate. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - certificateName - Custom certificate name // - options - CustomCertificatesClientDeleteOptions contains the optional parameters for the CustomCertificatesClient.Delete @@ -144,9 +140,6 @@ func (client *CustomCertificatesClient) Delete(ctx context.Context, resourceGrou // deleteCreateRequest creates the Delete request. func (client *CustomCertificatesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, certificateName string, options *CustomCertificatesClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/customCertificates/{certificateName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -165,7 +158,7 @@ func (client *CustomCertificatesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -174,9 +167,8 @@ func (client *CustomCertificatesClient) deleteCreateRequest(ctx context.Context, // Get - Get a custom certificate. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - certificateName - Custom certificate name // - options - CustomCertificatesClientGetOptions contains the optional parameters for the CustomCertificatesClient.Get method. @@ -198,9 +190,6 @@ func (client *CustomCertificatesClient) Get(ctx context.Context, resourceGroupNa // getCreateRequest creates the Get request. func (client *CustomCertificatesClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, certificateName string, options *CustomCertificatesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/customCertificates/{certificateName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -219,7 +208,7 @@ func (client *CustomCertificatesClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -236,9 +225,8 @@ func (client *CustomCertificatesClient) getHandleResponse(resp *http.Response) ( // NewListPager - List all custom certificates. // -// Generated from API version 2023-02-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - options - CustomCertificatesClientListOptions contains the optional parameters for the CustomCertificatesClient.NewListPager // method. @@ -273,9 +261,6 @@ func (client *CustomCertificatesClient) NewListPager(resourceGroupName string, r // listCreateRequest creates the List request. func (client *CustomCertificatesClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *CustomCertificatesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/customCertificates" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -290,7 +275,7 @@ func (client *CustomCertificatesClient) listCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/customcertificates_client_example_test.go b/sdk/resourcemanager/webpubsub/armwebpubsub/customcertificates_client_example_test.go index f96c659bdd17..35377dd2e9d6 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/customcertificates_client_example_test.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/customcertificates_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/webpubsub/armwebpubsub" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSubCustomCertificates_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSubCustomCertificates_List.json func ExampleCustomCertificatesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -57,7 +57,7 @@ func ExampleCustomCertificatesClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSubCustomCertificates_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSubCustomCertificates_Get.json func ExampleCustomCertificatesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -88,7 +88,7 @@ func ExampleCustomCertificatesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSubCustomCertificates_CreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSubCustomCertificates_CreateOrUpdate.json func ExampleCustomCertificatesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -129,7 +129,7 @@ func ExampleCustomCertificatesClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSubCustomCertificates_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSubCustomCertificates_Delete.json func ExampleCustomCertificatesClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/customdomains_client.go b/sdk/resourcemanager/webpubsub/armwebpubsub/customdomains_client.go index f7c764f53026..257a8ebd786e 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/customdomains_client.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/customdomains_client.go @@ -29,8 +29,7 @@ type CustomDomainsClient struct { } // NewCustomDomainsClient creates a new instance of CustomDomainsClient with the specified values. -// - subscriptionID - Gets subscription Id which uniquely identify the 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 NewCustomDomainsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CustomDomainsClient, error) { @@ -48,9 +47,8 @@ func NewCustomDomainsClient(subscriptionID string, credential azcore.TokenCreden // BeginCreateOrUpdate - Create or update a custom domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - name - Custom domain name. // - options - CustomDomainsClientBeginCreateOrUpdateOptions contains the optional parameters for the CustomDomainsClient.BeginCreateOrUpdate @@ -61,7 +59,9 @@ func (client *CustomDomainsClient) BeginCreateOrUpdate(ctx context.Context, reso if err != nil { return nil, err } - return runtime.NewPoller[CustomDomainsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CustomDomainsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) } else { return runtime.NewPollerFromResumeToken[CustomDomainsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -70,7 +70,7 @@ func (client *CustomDomainsClient) BeginCreateOrUpdate(ctx context.Context, reso // CreateOrUpdate - Create or update a custom domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-06-01-preview func (client *CustomDomainsClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, name string, parameters CustomDomain, options *CustomDomainsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, name, parameters, options) if err != nil { @@ -89,9 +89,6 @@ func (client *CustomDomainsClient) createOrUpdate(ctx context.Context, resourceG // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *CustomDomainsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, name string, parameters CustomDomain, options *CustomDomainsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/customDomains/{name}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -110,7 +107,7 @@ func (client *CustomDomainsClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -119,9 +116,8 @@ func (client *CustomDomainsClient) createOrUpdateCreateRequest(ctx context.Conte // BeginDelete - Delete a custom domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - name - Custom domain name. // - options - CustomDomainsClientBeginDeleteOptions contains the optional parameters for the CustomDomainsClient.BeginDelete @@ -143,7 +139,7 @@ func (client *CustomDomainsClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Delete a custom domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-06-01-preview func (client *CustomDomainsClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, name string, options *CustomDomainsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, name, options) if err != nil { @@ -162,9 +158,6 @@ func (client *CustomDomainsClient) deleteOperation(ctx context.Context, resource // deleteCreateRequest creates the Delete request. func (client *CustomDomainsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, name string, options *CustomDomainsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/customDomains/{name}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -183,7 +176,7 @@ func (client *CustomDomainsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -192,9 +185,8 @@ func (client *CustomDomainsClient) deleteCreateRequest(ctx context.Context, reso // Get - Get a custom domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - name - Custom domain name. // - options - CustomDomainsClientGetOptions contains the optional parameters for the CustomDomainsClient.Get method. @@ -216,9 +208,6 @@ func (client *CustomDomainsClient) Get(ctx context.Context, resourceGroupName st // getCreateRequest creates the Get request. func (client *CustomDomainsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, name string, options *CustomDomainsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/customDomains/{name}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -237,7 +226,7 @@ func (client *CustomDomainsClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,9 +243,8 @@ func (client *CustomDomainsClient) getHandleResponse(resp *http.Response) (Custo // NewListPager - List all custom domains. // -// Generated from API version 2023-02-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - options - CustomDomainsClientListOptions contains the optional parameters for the CustomDomainsClient.NewListPager method. func (client *CustomDomainsClient) NewListPager(resourceGroupName string, resourceName string, options *CustomDomainsClientListOptions) *runtime.Pager[CustomDomainsClientListResponse] { @@ -290,9 +278,6 @@ func (client *CustomDomainsClient) NewListPager(resourceGroupName string, resour // listCreateRequest creates the List request. func (client *CustomDomainsClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *CustomDomainsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/customDomains" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -307,7 +292,7 @@ func (client *CustomDomainsClient) listCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/customdomains_client_example_test.go b/sdk/resourcemanager/webpubsub/armwebpubsub/customdomains_client_example_test.go index 4287bb9ec3b6..f9ac37f789b8 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/customdomains_client_example_test.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/customdomains_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/webpubsub/armwebpubsub" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSubCustomDomains_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSubCustomDomains_List.json func ExampleCustomDomainsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -57,7 +57,7 @@ func ExampleCustomDomainsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSubCustomDomains_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSubCustomDomains_Get.json func ExampleCustomDomainsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -88,7 +88,7 @@ func ExampleCustomDomainsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSubCustomDomains_CreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSubCustomDomains_CreateOrUpdate.json func ExampleCustomDomainsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -116,7 +116,7 @@ func ExampleCustomDomainsClient_BeginCreateOrUpdate() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSubCustomDomains_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSubCustomDomains_Delete.json func ExampleCustomDomainsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/go.mod b/sdk/resourcemanager/webpubsub/armwebpubsub/go.mod index 9d320503e19c..0edeec57abd8 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/go.mod +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/go.mod @@ -3,19 +3,19 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/webpubsub/armwebpub 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/azcore v1.6.0 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 ) require ( - github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 // indirect github.com/golang-jwt/jwt/v4 v4.5.0 // indirect github.com/google/uuid v1.3.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.6.0 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + golang.org/x/crypto v0.7.0 // indirect + golang.org/x/net v0.8.0 // indirect + golang.org/x/sys v0.6.0 // indirect + golang.org/x/text v0.8.0 // indirect ) diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/go.sum b/sdk/resourcemanager/webpubsub/armwebpubsub/go.sum index 8ba445a8c4da..21718b486698 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/go.sum +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/go.sum @@ -1,13 +1,13 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0 h1:8kDqDngH+DmVBiCtIjCFTGa7MBnsIOkF9IccInFEbjk= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 h1:vcYCAze6p19qBW7MhZybIsqD8sMV8js0NyQM8JDnVtg= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0/go.mod h1:OQeznEEkTZ9OrhHJoDD8ZDq51FHgXjqtP9z6bEwBq9U= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= +github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 h1:OBhqkivkhkMqLPymWEppkm7vgPQY2XsHoEkaMQ0AdZY= +github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= +github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= @@ -18,14 +18,14 @@ github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9 github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/hubs_client.go b/sdk/resourcemanager/webpubsub/armwebpubsub/hubs_client.go index f9a7dca9add2..649571e20679 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/hubs_client.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/hubs_client.go @@ -29,8 +29,7 @@ type HubsClient struct { } // NewHubsClient creates a new instance of HubsClient with the specified values. -// - subscriptionID - Gets subscription Id which uniquely identify the 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 NewHubsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*HubsClient, error) { @@ -48,10 +47,9 @@ func NewHubsClient(subscriptionID string, credential azcore.TokenCredential, opt // BeginCreateOrUpdate - Create or update a hub setting. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-06-01-preview // - hubName - The hub name. -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - parameters - The resource of WebPubSubHub and its properties // - options - HubsClientBeginCreateOrUpdateOptions contains the optional parameters for the HubsClient.BeginCreateOrUpdate @@ -62,7 +60,9 @@ func (client *HubsClient) BeginCreateOrUpdate(ctx context.Context, hubName strin if err != nil { return nil, err } - return runtime.NewPoller[HubsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[HubsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) } else { return runtime.NewPollerFromResumeToken[HubsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,7 +71,7 @@ func (client *HubsClient) BeginCreateOrUpdate(ctx context.Context, hubName strin // CreateOrUpdate - Create or update a hub setting. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-06-01-preview func (client *HubsClient) createOrUpdate(ctx context.Context, hubName string, resourceGroupName string, resourceName string, parameters Hub, options *HubsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, hubName, resourceGroupName, resourceName, parameters, options) if err != nil { @@ -94,9 +94,6 @@ func (client *HubsClient) createOrUpdateCreateRequest(ctx context.Context, hubNa return nil, errors.New("parameter hubName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{hubName}", url.PathEscape(hubName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -111,7 +108,7 @@ func (client *HubsClient) createOrUpdateCreateRequest(ctx context.Context, hubNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -120,10 +117,9 @@ func (client *HubsClient) createOrUpdateCreateRequest(ctx context.Context, hubNa // BeginDelete - Delete a hub setting. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-06-01-preview // - hubName - The hub name. -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - options - HubsClientBeginDeleteOptions contains the optional parameters for the HubsClient.BeginDelete method. func (client *HubsClient) BeginDelete(ctx context.Context, hubName string, resourceGroupName string, resourceName string, options *HubsClientBeginDeleteOptions) (*runtime.Poller[HubsClientDeleteResponse], error) { @@ -143,7 +139,7 @@ func (client *HubsClient) BeginDelete(ctx context.Context, hubName string, resou // Delete - Delete a hub setting. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-06-01-preview func (client *HubsClient) deleteOperation(ctx context.Context, hubName string, resourceGroupName string, resourceName string, options *HubsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, hubName, resourceGroupName, resourceName, options) if err != nil { @@ -166,9 +162,6 @@ func (client *HubsClient) deleteCreateRequest(ctx context.Context, hubName strin return nil, errors.New("parameter hubName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{hubName}", url.PathEscape(hubName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -183,7 +176,7 @@ func (client *HubsClient) deleteCreateRequest(ctx context.Context, hubName strin return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -192,10 +185,9 @@ func (client *HubsClient) deleteCreateRequest(ctx context.Context, hubName strin // Get - Get a hub setting. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-06-01-preview // - hubName - The hub name. -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - options - HubsClientGetOptions contains the optional parameters for the HubsClient.Get method. func (client *HubsClient) Get(ctx context.Context, hubName string, resourceGroupName string, resourceName string, options *HubsClientGetOptions) (HubsClientGetResponse, error) { @@ -220,9 +212,6 @@ func (client *HubsClient) getCreateRequest(ctx context.Context, hubName string, return nil, errors.New("parameter hubName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{hubName}", url.PathEscape(hubName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -237,7 +226,7 @@ func (client *HubsClient) getCreateRequest(ctx context.Context, hubName string, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,9 +243,8 @@ func (client *HubsClient) getHandleResponse(resp *http.Response) (HubsClientGetR // NewListPager - List hub settings. // -// Generated from API version 2023-02-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - options - HubsClientListOptions contains the optional parameters for the HubsClient.NewListPager method. func (client *HubsClient) NewListPager(resourceGroupName string, resourceName string, options *HubsClientListOptions) *runtime.Pager[HubsClientListResponse] { @@ -290,9 +278,6 @@ func (client *HubsClient) NewListPager(resourceGroupName string, resourceName st // listCreateRequest creates the List request. func (client *HubsClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *HubsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/hubs" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -307,7 +292,7 @@ func (client *HubsClient) listCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/hubs_client_example_test.go b/sdk/resourcemanager/webpubsub/armwebpubsub/hubs_client_example_test.go index db142b617b0a..0fdd347e1509 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/hubs_client_example_test.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/hubs_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/webpubsub/armwebpubsub" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSubHubs_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSubHubs_List.json func ExampleHubsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -83,7 +83,7 @@ func ExampleHubsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSubHubs_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSubHubs_Get.json func ExampleHubsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -140,7 +140,7 @@ func ExampleHubsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSubHubs_CreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSubHubs_CreateOrUpdate.json func ExampleHubsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -234,7 +234,7 @@ func ExampleHubsClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSubHubs_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSubHubs_Delete.json func ExampleHubsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/models.go b/sdk/resourcemanager/webpubsub/armwebpubsub/models.go index af38f752c70d..68ea3b8f0052 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/models.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/models.go @@ -66,6 +66,11 @@ type ClientListKeysOptions struct { // placeholder for future optional parameters } +// ClientListReplicaSKUsOptions contains the optional parameters for the Client.ListReplicaSKUs method. +type ClientListReplicaSKUsOptions struct { + // placeholder for future optional parameters +} + // ClientListSKUsOptions contains the optional parameters for the Client.ListSKUs method. type ClientListSKUsOptions struct { // placeholder for future optional parameters @@ -76,16 +81,16 @@ type CustomCertificate struct { // REQUIRED; Custom certificate properties. Properties *CustomCertificateProperties - // READ-ONLY; Fully qualified resource Id for the resource. + // 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. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData - // READ-ONLY; The type of the resource - e.g. "Microsoft.SignalRService/SignalR" + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -140,16 +145,16 @@ type CustomDomain struct { // REQUIRED; Properties of a custom domain. Properties *CustomDomainProperties - // READ-ONLY; Fully qualified resource Id for the resource. + // 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. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData - // READ-ONLY; The type of the resource - e.g. "Microsoft.SignalRService/SignalR" + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -357,16 +362,16 @@ type Hub struct { // REQUIRED; Properties of a hub. Properties *HubProperties - // READ-ONLY; Fully qualified resource Id for the resource. + // 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. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData - // READ-ONLY; The type of the resource - e.g. "Microsoft.SignalRService/SignalR" + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -531,7 +536,8 @@ type NameAvailabilityParameters struct { // REQUIRED; The resource name to validate. e.g."my-resource-name" Name *string - // REQUIRED; The resource type. Can be "Microsoft.SignalRService/SignalR" or "Microsoft.SignalRService/webPubSub" + // REQUIRED; The resource type. Can be "Microsoft.SignalRService/SignalR", "Microsoft.SignalRService/WebPubSub", "Microsoft.SignalRService/SignalR/replicas" + // or "Microsoft.SignalRService/WebPubSub/replicas" Type *string } @@ -633,16 +639,16 @@ type PrivateEndpointConnection struct { // Private endpoint connection properties Properties *PrivateEndpointConnectionProperties - // READ-ONLY; Fully qualified resource Id for the resource. + // 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. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData - // READ-ONLY; The type of the resource - e.g. "Microsoft.SignalRService/SignalR" + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -701,13 +707,16 @@ type PrivateLinkResource struct { // Private link resource properties Properties *PrivateLinkResourceProperties - // READ-ONLY; Fully qualified resource Id for the resource. + // 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. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; The type of the resource - e.g. "Microsoft.SignalRService/SignalR" + // 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 } @@ -806,16 +815,19 @@ type Properties struct { Version *string } -// ProxyResource - The resource model definition for a ARM proxy resource. It will have everything other than required location -// and tags +// 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. + // 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. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; The type of the resource - e.g. "Microsoft.SignalRService/SignalR" + // 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 } @@ -825,25 +837,102 @@ type RegenerateKeyParameters struct { KeyType *KeyType } -// Resource - The core properties of ARM resources. +// Replica - A class represent a replica resource. +type Replica struct { + // REQUIRED; The geo-location where the resource lives + Location *string + Properties *ReplicaProperties + + // The billing information of the resource. + SKU *ResourceSKU + + // 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 +} + +type ReplicaList struct { + // The URL the client should use to fetch the next page (per server side paging). It's null for now, added for future use. + NextLink *string + + // List of the replica + Value []*Replica +} + +type ReplicaProperties struct { + // READ-ONLY; Provisioning state of the resource. + ProvisioningState *ProvisioningState +} + +// ReplicasClientBeginCreateOrUpdateOptions contains the optional parameters for the ReplicasClient.BeginCreateOrUpdate method. +type ReplicasClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicasClientBeginRestartOptions contains the optional parameters for the ReplicasClient.BeginRestart method. +type ReplicasClientBeginRestartOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicasClientBeginUpdateOptions contains the optional parameters for the ReplicasClient.BeginUpdate method. +type ReplicasClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicasClientDeleteOptions contains the optional parameters for the ReplicasClient.Delete method. +type ReplicasClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ReplicasClientGetOptions contains the optional parameters for the ReplicasClient.Get method. +type ReplicasClientGetOptions struct { + // placeholder for future optional parameters +} + +// ReplicasClientListOptions contains the optional parameters for the ReplicasClient.NewListPager method. +type ReplicasClientListOptions struct { + // placeholder for future optional parameters +} + +// 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. + // 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. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; The type of the resource - e.g. "Microsoft.SignalRService/SignalR" + // 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 } // ResourceInfo - A class represent a resource. type ResourceInfo struct { + // REQUIRED; The geo-location where the resource lives + Location *string + // A class represent managed identities used for request and response Identity *ManagedIdentity - // The GEO location of the resource. e.g. West US | East US | North Central US | South Central US. - Location *string + // The kind of the service + Kind *ServiceKind // A class that describes the properties of the resource Properties *Properties @@ -851,19 +940,19 @@ type ResourceInfo struct { // The billing information of the resource. SKU *ResourceSKU - // Tags of the service which is a list of key value pairs that describe the resource. + // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource Id for the resource. + // 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. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData - // READ-ONLY; The type of the resource - e.g. "Microsoft.SignalRService/SignalR" + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -995,16 +1084,16 @@ type SharedPrivateLinkResource struct { // Describes the properties of an existing Shared Private Link Resource Properties *SharedPrivateLinkResourceProperties - // READ-ONLY; Fully qualified resource Id for the resource. + // 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. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData - // READ-ONLY; The type of the resource - e.g. "Microsoft.SignalRService/SignalR" + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -1121,25 +1210,30 @@ type SystemData struct { // TLSSettings - TLS settings for the resource type TLSSettings struct { - // Request client certificate during TLS handshake if enabled + // Request client certificate during TLS handshake if enabled. Not supported for free tier. Any input will be ignored for + // free tier. ClientCertEnabled *bool } -// TrackedResource - The resource model definition for a ARM tracked top level resource. +// TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' +// and a 'location' type TrackedResource struct { - // The GEO location of the resource. e.g. West US | East US | North Central US | South Central US. + // REQUIRED; The geo-location where the resource lives Location *string - // Tags of the service which is a list of key value pairs that describe the resource. + // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource Id for the resource. + // 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. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; The type of the resource - e.g. "Microsoft.SignalRService/SignalR" + // 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 } diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/models_serde.go b/sdk/resourcemanager/webpubsub/armwebpubsub/models_serde.go index 0c2a7f2e2035..e670ea75535e 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/models_serde.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/models_serde.go @@ -1387,6 +1387,7 @@ func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { 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) } @@ -1409,6 +1410,9 @@ func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { 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) @@ -1617,6 +1621,7 @@ func (p ProxyResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) + populate(objectMap, "systemData", p.SystemData) populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } @@ -1636,6 +1641,9 @@ func (p *ProxyResource) UnmarshalJSON(data []byte) error { case "name": err = unpopulate(val, "Name", &p.Name) 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) @@ -1674,11 +1682,125 @@ func (r *RegenerateKeyParameters) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type Replica. +func (r Replica) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "sku", r.SKU) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "tags", r.Tags) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Replica. +func (r *Replica) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &r.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ReplicaList. +func (r ReplicaList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicaList. +func (r *ReplicaList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ReplicaProperties. +func (r ReplicaProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", r.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicaProperties. +func (r *ReplicaProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Resource. func (r Resource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) + populate(objectMap, "systemData", r.SystemData) populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } @@ -1698,6 +1820,9 @@ func (r *Resource) UnmarshalJSON(data []byte) error { case "name": err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) @@ -1714,6 +1839,7 @@ func (r ResourceInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "identity", r.Identity) + populate(objectMap, "kind", r.Kind) populate(objectMap, "location", r.Location) populate(objectMap, "name", r.Name) populate(objectMap, "properties", r.Properties) @@ -1739,6 +1865,9 @@ func (r *ResourceInfo) UnmarshalJSON(data []byte) error { case "identity": err = unpopulate(val, "Identity", &r.Identity) delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &r.Kind) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &r.Location) delete(rawMsg, key) @@ -2435,6 +2564,7 @@ func (t TrackedResource) MarshalJSON() ([]byte, error) { 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) @@ -2458,6 +2588,9 @@ func (t *TrackedResource) UnmarshalJSON(data []byte) error { 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) diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/operations_client.go b/sdk/resourcemanager/webpubsub/armwebpubsub/operations_client.go index 92db9321af72..99cdadde2fb6 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/operations_client.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/operations_client.go @@ -40,7 +40,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available REST API operations of the Microsoft.SignalRService provider. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-06-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", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/operations_client_example_test.go b/sdk/resourcemanager/webpubsub/armwebpubsub/operations_client_example_test.go index 6bc26a3e64b6..e92b04b1672c 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/operations_client_example_test.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/operations_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/webpubsub/armwebpubsub" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/Operations_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/Operations_List.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/privateendpointconnections_client.go b/sdk/resourcemanager/webpubsub/armwebpubsub/privateendpointconnections_client.go index b33ef64c9ffc..434a8155fa64 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/privateendpointconnections_client.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/privateendpointconnections_client.go @@ -29,8 +29,7 @@ type PrivateEndpointConnectionsClient struct { } // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values. -// - subscriptionID - Gets subscription Id which uniquely identify the 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 NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error) { @@ -48,10 +47,9 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // BeginDelete - Delete the specified private endpoint connection // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 -// - privateEndpointConnectionName - The name of the private endpoint connection -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. +// Generated from API version 2023-06-01-preview +// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - options - PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete // method. @@ -72,7 +70,7 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, // Delete - Delete the specified private endpoint connection // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-06-01-preview func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, privateEndpointConnectionName string, resourceGroupName string, resourceName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, privateEndpointConnectionName, resourceGroupName, resourceName, options) if err != nil { @@ -95,9 +93,6 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -112,7 +107,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -121,10 +116,9 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - Get the specified private endpoint connection // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 -// - privateEndpointConnectionName - The name of the private endpoint connection -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. +// Generated from API version 2023-06-01-preview +// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get // method. @@ -150,9 +144,6 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -167,7 +158,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -184,9 +175,8 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListPager - List private endpoint connections // -// Generated from API version 2023-02-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListPager // method. @@ -221,9 +211,6 @@ func (client *PrivateEndpointConnectionsClient) NewListPager(resourceGroupName s // listCreateRequest creates the List request. func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *PrivateEndpointConnectionsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/privateEndpointConnections" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -238,7 +225,7 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -256,10 +243,9 @@ func (client *PrivateEndpointConnectionsClient) listHandleResponse(resp *http.Re // Update - Update the state of specified private endpoint connection // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 -// - privateEndpointConnectionName - The name of the private endpoint connection -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. +// Generated from API version 2023-06-01-preview +// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - parameters - The resource of private endpoint and its properties // - options - PrivateEndpointConnectionsClientUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Update @@ -286,9 +272,6 @@ func (client *PrivateEndpointConnectionsClient) updateCreateRequest(ctx context. return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -303,7 +286,7 @@ func (client *PrivateEndpointConnectionsClient) updateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-06-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/webpubsub/armwebpubsub/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/webpubsub/armwebpubsub/privateendpointconnections_client_example_test.go index 6c66c0cea627..fa6501de75da 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/privateendpointconnections_client_example_test.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/privateendpointconnections_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/webpubsub/armwebpubsub" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSubPrivateEndpointConnections_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSubPrivateEndpointConnections_List.json func ExamplePrivateEndpointConnectionsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -46,6 +46,14 @@ func ExamplePrivateEndpointConnectionsClient_NewListPager() { // Name: to.Ptr("mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), // Type: to.Ptr("Microsoft.SignalRService/WebPubSub/privateEndpointConnections"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/privateEndpointConnections/mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), + // SystemData: &armwebpubsub.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // }, // Properties: &armwebpubsub.PrivateEndpointConnectionProperties{ // GroupIDs: []*string{ // to.Ptr("webpubsub")}, @@ -58,20 +66,12 @@ func ExamplePrivateEndpointConnectionsClient_NewListPager() { // }, // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), // }, - // SystemData: &armwebpubsub.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // }, // }}, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSubPrivateEndpointConnections_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSubPrivateEndpointConnections_Get.json func ExamplePrivateEndpointConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -93,6 +93,14 @@ func ExamplePrivateEndpointConnectionsClient_Get() { // Name: to.Ptr("mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), // Type: to.Ptr("Microsoft.SignalRService/WebPubSub/privateEndpointConnections"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/privateEndpointConnections/mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), + // SystemData: &armwebpubsub.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // }, // Properties: &armwebpubsub.PrivateEndpointConnectionProperties{ // GroupIDs: []*string{ // to.Ptr("webpubsub")}, @@ -105,18 +113,10 @@ func ExamplePrivateEndpointConnectionsClient_Get() { // }, // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), // }, - // SystemData: &armwebpubsub.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSubPrivateEndpointConnections_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSubPrivateEndpointConnections_Update.json func ExamplePrivateEndpointConnectionsClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -129,9 +129,7 @@ func ExamplePrivateEndpointConnectionsClient_Update() { } res, err := clientFactory.NewPrivateEndpointConnectionsClient().Update(ctx, "mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", "myResourceGroup", "myWebPubSubService", armwebpubsub.PrivateEndpointConnection{ Properties: &armwebpubsub.PrivateEndpointConnectionProperties{ - PrivateEndpoint: &armwebpubsub.PrivateEndpoint{ - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"), - }, + PrivateEndpoint: &armwebpubsub.PrivateEndpoint{}, PrivateLinkServiceConnectionState: &armwebpubsub.PrivateLinkServiceConnectionState{ ActionsRequired: to.Ptr("None"), Status: to.Ptr(armwebpubsub.PrivateLinkServiceConnectionStatusApproved), @@ -148,6 +146,14 @@ func ExamplePrivateEndpointConnectionsClient_Update() { // Name: to.Ptr("mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), // Type: to.Ptr("Microsoft.SignalRService/WebPubSub/privateEndpointConnections"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/privateEndpointConnections/mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), + // SystemData: &armwebpubsub.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // }, // Properties: &armwebpubsub.PrivateEndpointConnectionProperties{ // GroupIDs: []*string{ // to.Ptr("webpubsub")}, @@ -160,18 +166,10 @@ func ExamplePrivateEndpointConnectionsClient_Update() { // }, // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), // }, - // SystemData: &armwebpubsub.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSubPrivateEndpointConnections_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSubPrivateEndpointConnections_Delete.json func ExamplePrivateEndpointConnectionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/privatelinkresources_client.go b/sdk/resourcemanager/webpubsub/armwebpubsub/privatelinkresources_client.go index 2860348dc01d..53cb475ed9f6 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/privatelinkresources_client.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/privatelinkresources_client.go @@ -29,8 +29,7 @@ type PrivateLinkResourcesClient struct { } // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values. -// - subscriptionID - Gets subscription Id which uniquely identify the 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 NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error) { @@ -47,9 +46,8 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // NewListPager - Get the private link resources that need to be created for a resource. // -// Generated from API version 2023-02-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - options - PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListPager // method. @@ -84,9 +82,6 @@ func (client *PrivateLinkResourcesClient) NewListPager(resourceGroupName string, // listCreateRequest creates the List request. func (client *PrivateLinkResourcesClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *PrivateLinkResourcesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/privateLinkResources" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -101,7 +96,7 @@ func (client *PrivateLinkResourcesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/privatelinkresources_client_example_test.go b/sdk/resourcemanager/webpubsub/armwebpubsub/privatelinkresources_client_example_test.go index f65a3c71ca78..6bfba6ed7bf0 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/privatelinkresources_client_example_test.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/privatelinkresources_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/webpubsub/armwebpubsub" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSubPrivateLinkResources_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSubPrivateLinkResources_List.json func ExamplePrivateLinkResourcesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -59,6 +59,22 @@ func ExamplePrivateLinkResourcesClient_NewListPager() { // Description: to.Ptr("Azure App Service can be used as an upstream"), // GroupID: to.Ptr("sites"), // }, + // }, + // { + // Name: to.Ptr("vault"), + // Properties: &armwebpubsub.ShareablePrivateLinkResourceProperties{ + // Type: to.Ptr("Microsoft.KeyVault/vaults"), + // Description: to.Ptr("Azure Key Vault can be used as credentials store"), + // GroupID: to.Ptr("vault"), + // }, + // }, + // { + // Name: to.Ptr("table"), + // Properties: &armwebpubsub.ShareablePrivateLinkResourceProperties{ + // Type: to.Ptr("Microsoft.Storage/storageAccounts"), + // Description: to.Ptr("Azure Storage Table can be used as message store"), + // GroupID: to.Ptr("table"), + // }, // }}, // }, // }}, diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/replicas_client.go b/sdk/resourcemanager/webpubsub/armwebpubsub/replicas_client.go new file mode 100644 index 000000000000..02ddca4cdcf1 --- /dev/null +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/replicas_client.go @@ -0,0 +1,427 @@ +//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 armwebpubsub + +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" +) + +// ReplicasClient contains the methods for the WebPubSubReplicas group. +// Don't use this type directly, use NewReplicasClient() instead. +type ReplicasClient struct { + internal *arm.Client + subscriptionID string +} + +// NewReplicasClient creates a new instance of ReplicasClient 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 NewReplicasClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ReplicasClient, error) { + cl, err := arm.NewClient(moduleName+".ReplicasClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ReplicasClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update a replica. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the resource. +// - replicaName - The name of the replica. +// - parameters - Parameters for the create or update operation +// - options - ReplicasClientBeginCreateOrUpdateOptions contains the optional parameters for the ReplicasClient.BeginCreateOrUpdate +// method. +func (client *ReplicasClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, parameters Replica, options *ReplicasClientBeginCreateOrUpdateOptions) (*runtime.Poller[ReplicasClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, resourceName, replicaName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ReplicasClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[ReplicasClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Create or update a replica. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +func (client *ReplicasClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, parameters Replica, options *ReplicasClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, replicaName, 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 +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ReplicasClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, parameters Replica, options *ReplicasClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas/{replicaName}" + 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 resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if replicaName == "" { + return nil, errors.New("parameter replicaName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{replicaName}", url.PathEscape(replicaName)) + 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-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// Delete - Operation to delete a replica. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the resource. +// - replicaName - The name of the replica. +// - options - ReplicasClientDeleteOptions contains the optional parameters for the ReplicasClient.Delete method. +func (client *ReplicasClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, options *ReplicasClientDeleteOptions) (ReplicasClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, replicaName, options) + if err != nil { + return ReplicasClientDeleteResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ReplicasClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return ReplicasClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return ReplicasClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ReplicasClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, options *ReplicasClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas/{replicaName}" + 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 resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if replicaName == "" { + return nil, errors.New("parameter replicaName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{replicaName}", url.PathEscape(replicaName)) + 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-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get the replica and its properties. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the resource. +// - replicaName - The name of the replica. +// - options - ReplicasClientGetOptions contains the optional parameters for the ReplicasClient.Get method. +func (client *ReplicasClient) Get(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, options *ReplicasClientGetOptions) (ReplicasClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, replicaName, options) + if err != nil { + return ReplicasClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ReplicasClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ReplicasClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ReplicasClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, options *ReplicasClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas/{replicaName}" + 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 resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if replicaName == "" { + return nil, errors.New("parameter replicaName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{replicaName}", url.PathEscape(replicaName)) + 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-06-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 *ReplicasClient) getHandleResponse(resp *http.Response) (ReplicasClientGetResponse, error) { + result := ReplicasClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Replica); err != nil { + return ReplicasClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List all replicas belong to this resource +// +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the resource. +// - options - ReplicasClientListOptions contains the optional parameters for the ReplicasClient.NewListPager method. +func (client *ReplicasClient) NewListPager(resourceGroupName string, resourceName string, options *ReplicasClientListOptions) *runtime.Pager[ReplicasClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ReplicasClientListResponse]{ + More: func(page ReplicasClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ReplicasClientListResponse) (ReplicasClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, resourceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ReplicasClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ReplicasClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ReplicasClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ReplicasClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ReplicasClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas" + 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 resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + 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-06-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 *ReplicasClient) listHandleResponse(resp *http.Response) (ReplicasClientListResponse, error) { + result := ReplicasClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ReplicaList); err != nil { + return ReplicasClientListResponse{}, err + } + return result, nil +} + +// BeginRestart - Operation to restart a replica. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the resource. +// - replicaName - The name of the replica. +// - options - ReplicasClientBeginRestartOptions contains the optional parameters for the ReplicasClient.BeginRestart method. +func (client *ReplicasClient) BeginRestart(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, options *ReplicasClientBeginRestartOptions) (*runtime.Poller[ReplicasClientRestartResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.restart(ctx, resourceGroupName, resourceName, replicaName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ReplicasClientRestartResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ReplicasClientRestartResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Restart - Operation to restart a replica. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +func (client *ReplicasClient) restart(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, options *ReplicasClientBeginRestartOptions) (*http.Response, error) { + req, err := client.restartCreateRequest(ctx, resourceGroupName, resourceName, replicaName, 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 +} + +// restartCreateRequest creates the Restart request. +func (client *ReplicasClient) restartCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, options *ReplicasClientBeginRestartOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas/{replicaName}/restart" + 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 resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if replicaName == "" { + return nil, errors.New("parameter replicaName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{replicaName}", url.PathEscape(replicaName)) + 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-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginUpdate - Operation to update an exiting replica. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the resource. +// - replicaName - The name of the replica. +// - parameters - Parameters for the update operation +// - options - ReplicasClientBeginUpdateOptions contains the optional parameters for the ReplicasClient.BeginUpdate method. +func (client *ReplicasClient) BeginUpdate(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, parameters Replica, options *ReplicasClientBeginUpdateOptions) (*runtime.Poller[ReplicasClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, resourceName, replicaName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ReplicasClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ReplicasClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Update - Operation to update an exiting replica. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +func (client *ReplicasClient) update(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, parameters Replica, options *ReplicasClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, resourceName, replicaName, 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.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *ReplicasClient) updateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, parameters Replica, options *ReplicasClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas/{replicaName}" + 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 resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if replicaName == "" { + return nil, errors.New("parameter replicaName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{replicaName}", url.PathEscape(replicaName)) + 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", "2023-06-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/webpubsub/armwebpubsub/replicas_client_example_test.go b/sdk/resourcemanager/webpubsub/armwebpubsub/replicas_client_example_test.go new file mode 100644 index 000000000000..4b4e0999d42b --- /dev/null +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/replicas_client_example_test.go @@ -0,0 +1,279 @@ +//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 armwebpubsub_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/webpubsub/armwebpubsub" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSubReplicas_List.json +func ExampleReplicasClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armwebpubsub.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewReplicasClient().NewListPager("myResourceGroup", "myWebPubSubService", 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.ReplicaList = armwebpubsub.ReplicaList{ + // Value: []*armwebpubsub.Replica{ + // { + // Name: to.Ptr("myWebPubSubService-eastus"), + // Type: to.Ptr("Microsoft.SignalRService/WebPubSub"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/replicas/myWebPubSubService-eastus"), + // SystemData: &armwebpubsub.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // Properties: &armwebpubsub.ReplicaProperties{ + // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), + // }, + // SKU: &armwebpubsub.ResourceSKU{ + // Name: to.Ptr("Premium_P1"), + // Capacity: to.Ptr[int32](1), + // Size: to.Ptr("P1"), + // Tier: to.Ptr(armwebpubsub.WebPubSubSKUTierPremium), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSubReplicas_Get.json +func ExampleReplicasClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armwebpubsub.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewReplicasClient().Get(ctx, "myResourceGroup", "myWebPubSubService", "myWebPubSubService-eastus", 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.Replica = armwebpubsub.Replica{ + // Name: to.Ptr("myWebPubSubService-eastus"), + // Type: to.Ptr("Microsoft.SignalRService/WebPubSub"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/replicas/myWebPubSubService-eastus"), + // SystemData: &armwebpubsub.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // Properties: &armwebpubsub.ReplicaProperties{ + // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), + // }, + // SKU: &armwebpubsub.ResourceSKU{ + // Name: to.Ptr("Premium_P1"), + // Capacity: to.Ptr[int32](1), + // Size: to.Ptr("P1"), + // Tier: to.Ptr(armwebpubsub.WebPubSubSKUTierPremium), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSubReplicas_CreateOrUpdate.json +func ExampleReplicasClient_BeginCreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armwebpubsub.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewReplicasClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myWebPubSubService", "myWebPubSubService-eastus", armwebpubsub.Replica{ + Location: to.Ptr("eastus"), + Tags: map[string]*string{ + "key1": to.Ptr("value1"), + }, + Properties: &armwebpubsub.ReplicaProperties{}, + SKU: &armwebpubsub.ResourceSKU{ + Name: to.Ptr("Premium_P1"), + Capacity: to.Ptr[int32](1), + Tier: to.Ptr(armwebpubsub.WebPubSubSKUTierPremium), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.Replica = armwebpubsub.Replica{ + // Name: to.Ptr("myWebPubSubService-eastus"), + // Type: to.Ptr("Microsoft.SignalRService/WebPubSub"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/replicas/myWebPubSubService-eastus"), + // SystemData: &armwebpubsub.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // Properties: &armwebpubsub.ReplicaProperties{ + // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), + // }, + // SKU: &armwebpubsub.ResourceSKU{ + // Name: to.Ptr("Premium_P1"), + // Capacity: to.Ptr[int32](1), + // Size: to.Ptr("P1"), + // Tier: to.Ptr(armwebpubsub.WebPubSubSKUTierPremium), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSubReplicas_Delete.json +func ExampleReplicasClient_Delete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armwebpubsub.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewReplicasClient().Delete(ctx, "myResourceGroup", "myWebPubSubService", "myWebPubSubService-eastus", 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/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSubReplicas_Update.json +func ExampleReplicasClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armwebpubsub.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewReplicasClient().BeginUpdate(ctx, "myResourceGroup", "myWebPubSubService", "myWebPubSubService-eastus", armwebpubsub.Replica{ + Location: to.Ptr("eastus"), + Tags: map[string]*string{ + "key1": to.Ptr("value1"), + }, + Properties: &armwebpubsub.ReplicaProperties{}, + SKU: &armwebpubsub.ResourceSKU{ + Name: to.Ptr("Premium_P1"), + Capacity: to.Ptr[int32](1), + Tier: to.Ptr(armwebpubsub.WebPubSubSKUTierPremium), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.Replica = armwebpubsub.Replica{ + // Name: to.Ptr("myWebPubSubService-eastus"), + // Type: to.Ptr("Microsoft.SignalRService/WebPubSub"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/replicas/myWebPubSubService-eastus"), + // SystemData: &armwebpubsub.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // Properties: &armwebpubsub.ReplicaProperties{ + // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), + // }, + // SKU: &armwebpubsub.ResourceSKU{ + // Name: to.Ptr("Premium_P1"), + // Capacity: to.Ptr[int32](1), + // Size: to.Ptr("P1"), + // Tier: to.Ptr(armwebpubsub.WebPubSubSKUTierPremium), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSubReplicas_Restart.json +func ExampleReplicasClient_BeginRestart() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armwebpubsub.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewReplicasClient().BeginRestart(ctx, "myResourceGroup", "myWebPubSubService", "myWebPubSubService-eastus", 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) + } +} diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/response_types.go b/sdk/resourcemanager/webpubsub/armwebpubsub/response_types.go index ddae452e3679..f4c963b40b40 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/response_types.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/response_types.go @@ -44,6 +44,11 @@ type ClientListKeysResponse struct { Keys } +// ClientListReplicaSKUsResponse contains the response from method Client.ListReplicaSKUs. +type ClientListReplicaSKUsResponse struct { + SKUList +} + // ClientListSKUsResponse contains the response from method Client.ListSKUs. type ClientListSKUsResponse struct { SKUList @@ -154,6 +159,36 @@ type PrivateLinkResourcesClientListResponse struct { PrivateLinkResourceList } +// ReplicasClientCreateOrUpdateResponse contains the response from method ReplicasClient.BeginCreateOrUpdate. +type ReplicasClientCreateOrUpdateResponse struct { + Replica +} + +// ReplicasClientDeleteResponse contains the response from method ReplicasClient.Delete. +type ReplicasClientDeleteResponse struct { + // placeholder for future response values +} + +// ReplicasClientGetResponse contains the response from method ReplicasClient.Get. +type ReplicasClientGetResponse struct { + Replica +} + +// ReplicasClientListResponse contains the response from method ReplicasClient.NewListPager. +type ReplicasClientListResponse struct { + ReplicaList +} + +// ReplicasClientRestartResponse contains the response from method ReplicasClient.BeginRestart. +type ReplicasClientRestartResponse struct { + // placeholder for future response values +} + +// ReplicasClientUpdateResponse contains the response from method ReplicasClient.BeginUpdate. +type ReplicasClientUpdateResponse struct { + Replica +} + // SharedPrivateLinkResourcesClientCreateOrUpdateResponse contains the response from method SharedPrivateLinkResourcesClient.BeginCreateOrUpdate. type SharedPrivateLinkResourcesClientCreateOrUpdateResponse struct { SharedPrivateLinkResource diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/sharedprivatelinkresources_client.go b/sdk/resourcemanager/webpubsub/armwebpubsub/sharedprivatelinkresources_client.go index 1d27bd5cbbd2..01eb95f82ad0 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/sharedprivatelinkresources_client.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/sharedprivatelinkresources_client.go @@ -29,8 +29,7 @@ type SharedPrivateLinkResourcesClient struct { } // NewSharedPrivateLinkResourcesClient creates a new instance of SharedPrivateLinkResourcesClient with the specified values. -// - subscriptionID - Gets subscription Id which uniquely identify the 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 NewSharedPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SharedPrivateLinkResourcesClient, error) { @@ -48,10 +47,9 @@ func NewSharedPrivateLinkResourcesClient(subscriptionID string, credential azcor // BeginCreateOrUpdate - Create or update a shared private link resource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-06-01-preview // - sharedPrivateLinkResourceName - The name of the shared private link resource -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - parameters - The shared private link resource // - options - SharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.BeginCreateOrUpdate @@ -62,7 +60,9 @@ func (client *SharedPrivateLinkResourcesClient) BeginCreateOrUpdate(ctx context. if err != nil { return nil, err } - return runtime.NewPoller[SharedPrivateLinkResourcesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SharedPrivateLinkResourcesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) } else { return runtime.NewPollerFromResumeToken[SharedPrivateLinkResourcesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,7 +71,7 @@ func (client *SharedPrivateLinkResourcesClient) BeginCreateOrUpdate(ctx context. // CreateOrUpdate - Create or update a shared private link resource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-06-01-preview func (client *SharedPrivateLinkResourcesClient) createOrUpdate(ctx context.Context, sharedPrivateLinkResourceName string, resourceGroupName string, resourceName string, parameters SharedPrivateLinkResource, options *SharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, sharedPrivateLinkResourceName, resourceGroupName, resourceName, parameters, options) if err != nil { @@ -94,9 +94,6 @@ func (client *SharedPrivateLinkResourcesClient) createOrUpdateCreateRequest(ctx return nil, errors.New("parameter sharedPrivateLinkResourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{sharedPrivateLinkResourceName}", url.PathEscape(sharedPrivateLinkResourceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -111,7 +108,7 @@ func (client *SharedPrivateLinkResourcesClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -120,10 +117,9 @@ func (client *SharedPrivateLinkResourcesClient) createOrUpdateCreateRequest(ctx // BeginDelete - Delete the specified shared private link resource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-06-01-preview // - sharedPrivateLinkResourceName - The name of the shared private link resource -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - options - SharedPrivateLinkResourcesClientBeginDeleteOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.BeginDelete // method. @@ -144,7 +140,7 @@ func (client *SharedPrivateLinkResourcesClient) BeginDelete(ctx context.Context, // Delete - Delete the specified shared private link resource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-06-01-preview func (client *SharedPrivateLinkResourcesClient) deleteOperation(ctx context.Context, sharedPrivateLinkResourceName string, resourceGroupName string, resourceName string, options *SharedPrivateLinkResourcesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, sharedPrivateLinkResourceName, resourceGroupName, resourceName, options) if err != nil { @@ -167,9 +163,6 @@ func (client *SharedPrivateLinkResourcesClient) deleteCreateRequest(ctx context. return nil, errors.New("parameter sharedPrivateLinkResourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{sharedPrivateLinkResourceName}", url.PathEscape(sharedPrivateLinkResourceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -184,7 +177,7 @@ func (client *SharedPrivateLinkResourcesClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,10 +186,9 @@ func (client *SharedPrivateLinkResourcesClient) deleteCreateRequest(ctx context. // Get - Get the specified shared private link resource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-06-01-preview // - sharedPrivateLinkResourceName - The name of the shared private link resource -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - options - SharedPrivateLinkResourcesClientGetOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.Get // method. @@ -222,9 +214,6 @@ func (client *SharedPrivateLinkResourcesClient) getCreateRequest(ctx context.Con return nil, errors.New("parameter sharedPrivateLinkResourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{sharedPrivateLinkResourceName}", url.PathEscape(sharedPrivateLinkResourceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -239,7 +228,7 @@ func (client *SharedPrivateLinkResourcesClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -256,9 +245,8 @@ func (client *SharedPrivateLinkResourcesClient) getHandleResponse(resp *http.Res // NewListPager - List shared private link resources // -// Generated from API version 2023-02-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - options - SharedPrivateLinkResourcesClientListOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.NewListPager // method. @@ -293,9 +281,6 @@ func (client *SharedPrivateLinkResourcesClient) NewListPager(resourceGroupName s // listCreateRequest creates the List request. func (client *SharedPrivateLinkResourcesClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *SharedPrivateLinkResourcesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/sharedPrivateLinkResources" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -310,7 +295,7 @@ func (client *SharedPrivateLinkResourcesClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/sharedprivatelinkresources_client_example_test.go b/sdk/resourcemanager/webpubsub/armwebpubsub/sharedprivatelinkresources_client_example_test.go index 27fd50f69825..87408a494250 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/sharedprivatelinkresources_client_example_test.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/sharedprivatelinkresources_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/webpubsub/armwebpubsub" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSubSharedPrivateLinkResources_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSubSharedPrivateLinkResources_List.json func ExampleSharedPrivateLinkResourcesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -58,7 +58,7 @@ func ExampleSharedPrivateLinkResourcesClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSubSharedPrivateLinkResources_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSubSharedPrivateLinkResources_Get.json func ExampleSharedPrivateLinkResourcesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -90,7 +90,7 @@ func ExampleSharedPrivateLinkResourcesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSubSharedPrivateLinkResources_CreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSubSharedPrivateLinkResources_CreateOrUpdate.json func ExampleSharedPrivateLinkResourcesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -132,7 +132,7 @@ func ExampleSharedPrivateLinkResourcesClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/WebPubSubSharedPrivateLinkResources_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/WebPubSubSharedPrivateLinkResources_Delete.json func ExampleSharedPrivateLinkResourcesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/usages_client.go b/sdk/resourcemanager/webpubsub/armwebpubsub/usages_client.go index dbcd0135aca2..2e65b3c9c2ee 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/usages_client.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/usages_client.go @@ -29,8 +29,7 @@ type UsagesClient struct { } // NewUsagesClient creates a new instance of UsagesClient with the specified values. -// - subscriptionID - Gets subscription Id which uniquely identify the 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 NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UsagesClient, error) { @@ -47,7 +46,7 @@ func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, o // NewListPager - List resource usage quotas by location. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-06-01-preview // - location - the location like "eastus" // - options - UsagesClientListOptions contains the optional parameters for the UsagesClient.NewListPager method. func (client *UsagesClient) NewListPager(location string, options *UsagesClientListOptions) *runtime.Pager[UsagesClientListResponse] { @@ -85,16 +84,13 @@ func (client *UsagesClient) listCreateRequest(ctx context.Context, location stri return nil, errors.New("parameter location cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - 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", "2023-02-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/usages_client_example_test.go b/sdk/resourcemanager/webpubsub/armwebpubsub/usages_client_example_test.go index 6f131d6e1944..a591854d156f 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/usages_client_example_test.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/usages_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/webpubsub/armwebpubsub" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/Usages_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-06-01-preview/examples/Usages_List.json func ExampleUsagesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil {