From e4bc5d5e5c13ad437eb9df00ade7a291065befcc Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 23 May 2024 02:39:32 +0000 Subject: [PATCH] CodeGen from PR 29086 in Azure/azure-rest-api-specs Merge bcd6b6d50466b2ff9ec8d499ad52afaf28ff9657 into f2b603440c0c890cbaf6ddb1e6976bfcf14aa495 --- .../signalr/armsignalr/CHANGELOG.md | 26 + .../signalr/armsignalr/autorest.md | 7 +- .../signalr/armsignalr/client.go | 58 +- .../signalr/armsignalr/client_example_test.go | 1390 ----------------- .../signalr/armsignalr/client_factory.go | 70 +- .../signalr/armsignalr/constants.go | 2 +- .../armsignalr/customcertificates_client.go | 18 +- .../customcertificates_client_example_test.go | 147 -- .../armsignalr/customdomains_client.go | 20 +- .../customdomains_client_example_test.go | 138 -- ...eplicasharedprivatelinkresources_server.go | 228 +++ .../signalr/armsignalr/fake/server_factory.go | 47 +- .../signalr/armsignalr/fake/time_rfc3339.go | 42 +- sdk/resourcemanager/signalr/armsignalr/go.mod | 2 +- .../signalr/armsignalr/models.go | 9 +- .../signalr/armsignalr/models_serde.go | 2 +- .../signalr/armsignalr/operations_client.go | 4 +- .../operations_client_example_test.go | 58 - .../signalr/armsignalr/options.go | 19 + .../privateendpointconnections_client.go | 18 +- ...endpointconnections_client_example_test.go | 191 --- .../armsignalr/privatelinkresources_client.go | 4 +- ...rivatelinkresources_client_example_test.go | 83 - .../signalr/armsignalr/replicas_client.go | 30 +- .../replicas_client_example_test.go | 291 ---- ...eplicasharedprivatelinkresources_client.go | 280 ++++ .../{response_types.go => responses.go} | 18 + .../sharedprivatelinkresources_client.go | 26 +- ...rivatelinkresources_client_example_test.go | 154 -- .../signalr/armsignalr/time_rfc3339.go | 42 +- .../signalr/armsignalr/usages_client.go | 4 +- .../armsignalr/usages_client_example_test.go | 66 - .../webpubsub/armwebpubsub/CHANGELOG.md | 30 + .../webpubsub/armwebpubsub/autorest.md | 7 +- .../webpubsub/armwebpubsub/client.go | 58 +- .../armwebpubsub/client_example_test.go | 1107 ------------- .../webpubsub/armwebpubsub/client_factory.go | 76 +- .../webpubsub/armwebpubsub/constants.go | 2 +- .../armwebpubsub/customcertificates_client.go | 18 +- .../customcertificates_client_example_test.go | 147 -- .../armwebpubsub/customdomains_client.go | 20 +- .../customdomains_client_example_test.go | 138 -- ...eplicasharedprivatelinkresources_server.go | 228 +++ .../armwebpubsub/fake/server_factory.go | 51 +- .../armwebpubsub/fake/time_rfc3339.go | 42 +- .../webpubsub/armwebpubsub/go.mod | 2 +- .../webpubsub/armwebpubsub/hubs_client.go | 20 +- .../armwebpubsub/hubs_client_example_test.go | 256 --- .../webpubsub/armwebpubsub/models.go | 25 +- .../webpubsub/armwebpubsub/models_serde.go | 37 +- .../armwebpubsub/operations_client.go | 4 +- .../operations_client_example_test.go | 58 - .../webpubsub/armwebpubsub/options.go | 19 + .../armwebpubsub/polymorphic_helpers.go | 4 +- .../privateendpointconnections_client.go | 18 +- ...endpointconnections_client_example_test.go | 191 --- .../privatelinkresources_client.go | 4 +- ...rivatelinkresources_client_example_test.go | 83 - .../webpubsub/armwebpubsub/replicas_client.go | 30 +- .../replicas_client_example_test.go | 291 ---- ...eplicasharedprivatelinkresources_client.go | 280 ++++ .../{response_types.go => responses.go} | 18 + .../sharedprivatelinkresources_client.go | 26 +- ...rivatelinkresources_client_example_test.go | 154 -- .../webpubsub/armwebpubsub/time_rfc3339.go | 42 +- .../webpubsub/armwebpubsub/usages_client.go | 4 +- .../usages_client_example_test.go | 66 - 67 files changed, 1698 insertions(+), 5352 deletions(-) delete mode 100644 sdk/resourcemanager/signalr/armsignalr/client_example_test.go delete mode 100644 sdk/resourcemanager/signalr/armsignalr/customcertificates_client_example_test.go delete mode 100644 sdk/resourcemanager/signalr/armsignalr/customdomains_client_example_test.go create mode 100644 sdk/resourcemanager/signalr/armsignalr/fake/replicasharedprivatelinkresources_server.go delete mode 100644 sdk/resourcemanager/signalr/armsignalr/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/signalr/armsignalr/privateendpointconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/signalr/armsignalr/privatelinkresources_client_example_test.go delete mode 100644 sdk/resourcemanager/signalr/armsignalr/replicas_client_example_test.go create mode 100644 sdk/resourcemanager/signalr/armsignalr/replicasharedprivatelinkresources_client.go rename sdk/resourcemanager/signalr/armsignalr/{response_types.go => responses.go} (90%) delete mode 100644 sdk/resourcemanager/signalr/armsignalr/sharedprivatelinkresources_client_example_test.go delete mode 100644 sdk/resourcemanager/signalr/armsignalr/usages_client_example_test.go delete mode 100644 sdk/resourcemanager/webpubsub/armwebpubsub/client_example_test.go delete mode 100644 sdk/resourcemanager/webpubsub/armwebpubsub/customcertificates_client_example_test.go delete mode 100644 sdk/resourcemanager/webpubsub/armwebpubsub/customdomains_client_example_test.go create mode 100644 sdk/resourcemanager/webpubsub/armwebpubsub/fake/replicasharedprivatelinkresources_server.go delete mode 100644 sdk/resourcemanager/webpubsub/armwebpubsub/hubs_client_example_test.go delete mode 100644 sdk/resourcemanager/webpubsub/armwebpubsub/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/webpubsub/armwebpubsub/privateendpointconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/webpubsub/armwebpubsub/privatelinkresources_client_example_test.go delete mode 100644 sdk/resourcemanager/webpubsub/armwebpubsub/replicas_client_example_test.go create mode 100644 sdk/resourcemanager/webpubsub/armwebpubsub/replicasharedprivatelinkresources_client.go rename sdk/resourcemanager/webpubsub/armwebpubsub/{response_types.go => responses.go} (91%) delete mode 100644 sdk/resourcemanager/webpubsub/armwebpubsub/sharedprivatelinkresources_client_example_test.go delete mode 100644 sdk/resourcemanager/webpubsub/armwebpubsub/usages_client_example_test.go diff --git a/sdk/resourcemanager/signalr/armsignalr/CHANGELOG.md b/sdk/resourcemanager/signalr/armsignalr/CHANGELOG.md index dc25bd6df532..20676e59f8e3 100644 --- a/sdk/resourcemanager/signalr/armsignalr/CHANGELOG.md +++ b/sdk/resourcemanager/signalr/armsignalr/CHANGELOG.md @@ -1,5 +1,31 @@ # Release History +## 1.3.0 (2024-05-23) +### Features Added + +- New function `*Client.ListReplicaSKUs(context.Context, string, string, string, *ClientListReplicaSKUsOptions) (ClientListReplicaSKUsResponse, error)` +- New function `*ClientFactory.NewReplicaSharedPrivateLinkResourcesClient() *ReplicaSharedPrivateLinkResourcesClient` +- New function `*ClientFactory.NewReplicasClient() *ReplicasClient` +- New function `NewReplicaSharedPrivateLinkResourcesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ReplicaSharedPrivateLinkResourcesClient, error)` +- New function `*ReplicaSharedPrivateLinkResourcesClient.BeginCreateOrUpdate(context.Context, string, string, string, string, SharedPrivateLinkResource, *ReplicaSharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ReplicaSharedPrivateLinkResourcesClientCreateOrUpdateResponse], error)` +- New function `*ReplicaSharedPrivateLinkResourcesClient.Get(context.Context, string, string, string, string, *ReplicaSharedPrivateLinkResourcesClientGetOptions) (ReplicaSharedPrivateLinkResourcesClientGetResponse, error)` +- New function `*ReplicaSharedPrivateLinkResourcesClient.NewListPager(string, string, string, *ReplicaSharedPrivateLinkResourcesClientListOptions) *runtime.Pager[ReplicaSharedPrivateLinkResourcesClientListResponse]` +- 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 `IPRule` +- New struct `Replica` +- New struct `ReplicaList` +- New struct `ReplicaProperties` +- New field `IPRules` in struct `NetworkACLs` +- New field `SystemData` in struct `PrivateLinkResource` +- New field `RegionEndpointEnabled`, `ResourceStopped` in struct `Properties` + + ## 1.3.0-beta.1 (2023-11-30) ### Features Added diff --git a/sdk/resourcemanager/signalr/armsignalr/autorest.md b/sdk/resourcemanager/signalr/armsignalr/autorest.md index 2a410e780917..5f6f3866b8bc 100644 --- a/sdk/resourcemanager/signalr/armsignalr/autorest.md +++ b/sdk/resourcemanager/signalr/armsignalr/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/signalr/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/signalr/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.3.0-beta.1 -tag: package-2023-08-01-preview +module-version: 1.3.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/signalr/armsignalr/client.go b/sdk/resourcemanager/signalr/armsignalr/client.go index fb247abc6fc7..30d94813abea 100644 --- a/sdk/resourcemanager/signalr/armsignalr/client.go +++ b/sdk/resourcemanager/signalr/armsignalr/client.go @@ -46,7 +46,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-08-01-preview +// Generated from API version 2024-03-01 // - location - the region // - parameters - Parameters supplied to the operation. // - options - ClientCheckNameAvailabilityOptions contains the optional parameters for the Client.CheckNameAvailability method. @@ -88,7 +88,7 @@ func (client *Client) checkNameAvailabilityCreateRequest(ctx context.Context, lo return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -109,7 +109,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - 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 @@ -135,7 +135,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-08-01-preview +// Generated from API version 2024-03-01 func (client *Client) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters ResourceInfo, options *ClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "Client.BeginCreateOrUpdate" @@ -177,7 +177,7 @@ func (client *Client) createOrUpdateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -189,7 +189,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - 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. @@ -214,7 +214,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-08-01-preview +// Generated from API version 2024-03-01 func (client *Client) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, options *ClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "Client.BeginDelete" @@ -256,7 +256,7 @@ func (client *Client) deleteCreateRequest(ctx context.Context, resourceGroupName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -265,7 +265,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - 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. @@ -311,7 +311,7 @@ func (client *Client) getCreateRequest(ctx context.Context, resourceGroupName st return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -328,7 +328,7 @@ func (client *Client) getHandleResponse(resp *http.Response) (ClientGetResponse, // NewListByResourceGroupPager - Handles requests to list all resources in a resource group. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ClientListByResourceGroupOptions contains the optional parameters for the Client.NewListByResourceGroupPager // method. @@ -371,7 +371,7 @@ func (client *Client) listByResourceGroupCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -388,7 +388,7 @@ func (client *Client) listByResourceGroupHandleResponse(resp *http.Response) (Cl // NewListBySubscriptionPager - Handles requests to list all resources in a subscription. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - 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]{ @@ -425,7 +425,7 @@ func (client *Client) listBySubscriptionCreateRequest(ctx context.Context, optio return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -443,7 +443,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - 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. @@ -489,7 +489,7 @@ func (client *Client) listKeysCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -507,7 +507,7 @@ func (client *Client) listKeysHandleResponse(resp *http.Response) (ClientListKey // ListReplicaSKUs - List all available skus of the replica resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - replicaName - The name of the replica. @@ -558,7 +558,7 @@ func (client *Client) listReplicaSKUsCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -576,7 +576,7 @@ func (client *Client) listReplicaSKUsHandleResponse(resp *http.Response) (Client // ListSKUs - List all available skus of the resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - 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. @@ -622,7 +622,7 @@ func (client *Client) listSKUsCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -641,7 +641,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - 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. @@ -668,7 +668,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-08-01-preview +// Generated from API version 2024-03-01 func (client *Client) regenerateKey(ctx context.Context, resourceGroupName string, resourceName string, parameters RegenerateKeyParameters, options *ClientBeginRegenerateKeyOptions) (*http.Response, error) { var err error const operationName = "Client.BeginRegenerateKey" @@ -710,7 +710,7 @@ func (client *Client) regenerateKeyCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -722,7 +722,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - 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. @@ -747,7 +747,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-08-01-preview +// Generated from API version 2024-03-01 func (client *Client) restart(ctx context.Context, resourceGroupName string, resourceName string, options *ClientBeginRestartOptions) (*http.Response, error) { var err error const operationName = "Client.BeginRestart" @@ -789,7 +789,7 @@ func (client *Client) restartCreateRequest(ctx context.Context, resourceGroupNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -798,7 +798,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - parameters - Parameters for the update operation @@ -824,7 +824,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-08-01-preview +// Generated from API version 2024-03-01 func (client *Client) update(ctx context.Context, resourceGroupName string, resourceName string, parameters ResourceInfo, options *ClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "Client.BeginUpdate" @@ -866,7 +866,7 @@ func (client *Client) updateCreateRequest(ctx context.Context, resourceGroupName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/signalr/armsignalr/client_example_test.go b/sdk/resourcemanager/signalr/armsignalr/client_example_test.go deleted file mode 100644 index 78b7c59f76e0..000000000000 --- a/sdk/resourcemanager/signalr/armsignalr/client_example_test.go +++ /dev/null @@ -1,1390 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsignalr_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/signalr/armsignalr" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalR_CheckNameAvailability.json -func ExampleClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().CheckNameAvailability(ctx, "eastus", armsignalr.NameAvailabilityParameters{ - Name: to.Ptr("mySignalRService"), - Type: to.Ptr("Microsoft.SignalRService/SignalR"), - }, 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.NameAvailability = armsignalr.NameAvailability{ - // Message: to.Ptr("The name is already taken. Please try a different name."), - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr("AlreadyExists"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalR_ListBySubscription.json -func ExampleClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClient().NewListBySubscriptionPager(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.ResourceInfoList = armsignalr.ResourceInfoList{ - // Value: []*armsignalr.ResourceInfo{ - // { - // Name: to.Ptr("mySignalRService"), - // Type: to.Ptr("Microsoft.SignalRService/SignalR"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService"), - // SystemData: &armsignalr.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Identity: &armsignalr.ManagedIdentity{ - // Type: to.Ptr(armsignalr.ManagedIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // Kind: to.Ptr(armsignalr.ServiceKindSignalR), - // Properties: &armsignalr.Properties{ - // Cors: &armsignalr.CorsSettings{ - // AllowedOrigins: []*string{ - // to.Ptr("https://foo.com"), - // to.Ptr("https://bar.com")}, - // }, - // DisableAADAuth: to.Ptr(false), - // DisableLocalAuth: to.Ptr(false), - // ExternalIP: to.Ptr("10.0.0.1"), - // Features: []*armsignalr.Feature{ - // { - // Flag: to.Ptr(armsignalr.FeatureFlagsServiceMode), - // Properties: map[string]*string{ - // }, - // Value: to.Ptr("Serverless"), - // }, - // { - // Flag: to.Ptr(armsignalr.FeatureFlagsEnableConnectivityLogs), - // Properties: map[string]*string{ - // }, - // Value: to.Ptr("True"), - // }, - // { - // Flag: to.Ptr(armsignalr.FeatureFlagsEnableMessagingLogs), - // Properties: map[string]*string{ - // }, - // Value: to.Ptr("False"), - // }, - // { - // Flag: to.Ptr(armsignalr.FeatureFlagsEnableLiveTrace), - // Properties: map[string]*string{ - // }, - // Value: to.Ptr("False"), - // }}, - // HostName: to.Ptr("mysignalrservice.service.signalr.net"), - // LiveTraceConfiguration: &armsignalr.LiveTraceConfiguration{ - // Categories: []*armsignalr.LiveTraceCategory{ - // { - // Name: to.Ptr("ConnectivityLogs"), - // Enabled: to.Ptr("true"), - // }}, - // Enabled: to.Ptr("false"), - // }, - // NetworkACLs: &armsignalr.NetworkACLs{ - // DefaultAction: to.Ptr(armsignalr.ACLActionDeny), - // IPRules: []*armsignalr.IPRule{ - // { - // Action: to.Ptr(armsignalr.ACLActionAllow), - // Value: to.Ptr("123.456.789.123/24"), - // }, - // { - // Action: to.Ptr(armsignalr.ACLActionAllow), - // Value: to.Ptr("123.456.789.123"), - // }, - // { - // Action: to.Ptr(armsignalr.ACLActionAllow), - // Value: to.Ptr("AppService"), - // }}, - // PrivateEndpoints: []*armsignalr.PrivateEndpointACL{ - // { - // Allow: []*armsignalr.SignalRRequestType{ - // to.Ptr(armsignalr.SignalRRequestTypeServerConnection)}, - // Name: to.Ptr("mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // }}, - // PublicNetwork: &armsignalr.NetworkACL{ - // Allow: []*armsignalr.SignalRRequestType{ - // to.Ptr(armsignalr.SignalRRequestTypeClientConnection)}, - // }, - // }, - // PrivateEndpointConnections: []*armsignalr.PrivateEndpointConnection{ - // { - // Name: to.Ptr("mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // Type: to.Ptr("Microsoft.SignalRService/SignalR/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService/privateEndpointConnections/mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // SystemData: &armsignalr.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // }, - // Properties: &armsignalr.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsignalr.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armsignalr.PrivateLinkServiceConnectionState{ - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armsignalr.PrivateLinkServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armsignalr.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr(armsignalr.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr("Enabled"), - // PublicPort: to.Ptr[int32](443), - // RegionEndpointEnabled: to.Ptr("Enabled"), - // ResourceLogConfiguration: &armsignalr.ResourceLogConfiguration{ - // Categories: []*armsignalr.ResourceLogCategory{ - // { - // Name: to.Ptr("ConnectivityLogs"), - // Enabled: to.Ptr("true"), - // }}, - // }, - // ResourceStopped: to.Ptr("false"), - // ServerPort: to.Ptr[int32](443), - // Serverless: &armsignalr.ServerlessSettings{ - // ConnectionTimeoutInSeconds: to.Ptr[int32](5), - // }, - // TLS: &armsignalr.TLSSettings{ - // ClientCertEnabled: to.Ptr(true), - // }, - // Upstream: &armsignalr.ServerlessUpstreamSettings{ - // Templates: []*armsignalr.UpstreamTemplate{ - // { - // URLTemplate: to.Ptr("http://foo.com"), - // }}, - // }, - // Version: to.Ptr("1.0"), - // }, - // SKU: &armsignalr.ResourceSKU{ - // Name: to.Ptr("Premium_P1"), - // Capacity: to.Ptr[int32](1), - // Size: to.Ptr("P1"), - // Tier: to.Ptr(armsignalr.SignalRSKUTierPremium), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalR_ListByResourceGroup.json -func ExampleClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClient().NewListByResourceGroupPager("myResourceGroup", 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.ResourceInfoList = armsignalr.ResourceInfoList{ - // Value: []*armsignalr.ResourceInfo{ - // { - // Name: to.Ptr("mySignalRService"), - // Type: to.Ptr("Microsoft.SignalRService/SignalR"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService"), - // SystemData: &armsignalr.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Identity: &armsignalr.ManagedIdentity{ - // Type: to.Ptr(armsignalr.ManagedIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // Kind: to.Ptr(armsignalr.ServiceKindSignalR), - // Properties: &armsignalr.Properties{ - // Cors: &armsignalr.CorsSettings{ - // AllowedOrigins: []*string{ - // to.Ptr("https://foo.com"), - // to.Ptr("https://bar.com")}, - // }, - // DisableAADAuth: to.Ptr(false), - // DisableLocalAuth: to.Ptr(false), - // ExternalIP: to.Ptr("10.0.0.1"), - // Features: []*armsignalr.Feature{ - // { - // Flag: to.Ptr(armsignalr.FeatureFlagsServiceMode), - // Properties: map[string]*string{ - // }, - // Value: to.Ptr("Serverless"), - // }, - // { - // Flag: to.Ptr(armsignalr.FeatureFlagsEnableConnectivityLogs), - // Properties: map[string]*string{ - // }, - // Value: to.Ptr("True"), - // }, - // { - // Flag: to.Ptr(armsignalr.FeatureFlagsEnableMessagingLogs), - // Properties: map[string]*string{ - // }, - // Value: to.Ptr("False"), - // }, - // { - // Flag: to.Ptr(armsignalr.FeatureFlagsEnableLiveTrace), - // Properties: map[string]*string{ - // }, - // Value: to.Ptr("False"), - // }}, - // HostName: to.Ptr("mysignalrservice.service.signalr.net"), - // LiveTraceConfiguration: &armsignalr.LiveTraceConfiguration{ - // Categories: []*armsignalr.LiveTraceCategory{ - // { - // Name: to.Ptr("ConnectivityLogs"), - // Enabled: to.Ptr("true"), - // }}, - // Enabled: to.Ptr("false"), - // }, - // NetworkACLs: &armsignalr.NetworkACLs{ - // DefaultAction: to.Ptr(armsignalr.ACLActionDeny), - // IPRules: []*armsignalr.IPRule{ - // { - // Action: to.Ptr(armsignalr.ACLActionAllow), - // Value: to.Ptr("123.456.789.123/24"), - // }, - // { - // Action: to.Ptr(armsignalr.ACLActionAllow), - // Value: to.Ptr("123.456.789.123"), - // }, - // { - // Action: to.Ptr(armsignalr.ACLActionAllow), - // Value: to.Ptr("AppService"), - // }}, - // PrivateEndpoints: []*armsignalr.PrivateEndpointACL{ - // { - // Allow: []*armsignalr.SignalRRequestType{ - // to.Ptr(armsignalr.SignalRRequestTypeServerConnection)}, - // Name: to.Ptr("mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // }}, - // PublicNetwork: &armsignalr.NetworkACL{ - // Allow: []*armsignalr.SignalRRequestType{ - // to.Ptr(armsignalr.SignalRRequestTypeClientConnection)}, - // }, - // }, - // PrivateEndpointConnections: []*armsignalr.PrivateEndpointConnection{ - // { - // Name: to.Ptr("mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // Type: to.Ptr("Microsoft.SignalRService/SignalR/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService/privateEndpointConnections/mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // SystemData: &armsignalr.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // }, - // Properties: &armsignalr.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsignalr.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armsignalr.PrivateLinkServiceConnectionState{ - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armsignalr.PrivateLinkServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armsignalr.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr(armsignalr.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr("Enabled"), - // PublicPort: to.Ptr[int32](443), - // RegionEndpointEnabled: to.Ptr("Enabled"), - // ResourceLogConfiguration: &armsignalr.ResourceLogConfiguration{ - // Categories: []*armsignalr.ResourceLogCategory{ - // { - // Name: to.Ptr("ConnectivityLogs"), - // Enabled: to.Ptr("true"), - // }}, - // }, - // ResourceStopped: to.Ptr("false"), - // ServerPort: to.Ptr[int32](443), - // Serverless: &armsignalr.ServerlessSettings{ - // ConnectionTimeoutInSeconds: to.Ptr[int32](5), - // }, - // TLS: &armsignalr.TLSSettings{ - // ClientCertEnabled: to.Ptr(true), - // }, - // Upstream: &armsignalr.ServerlessUpstreamSettings{ - // Templates: []*armsignalr.UpstreamTemplate{ - // { - // URLTemplate: to.Ptr("http://foo.com"), - // }}, - // }, - // Version: to.Ptr("1.0"), - // }, - // SKU: &armsignalr.ResourceSKU{ - // Name: to.Ptr("Premium_P1"), - // Capacity: to.Ptr[int32](1), - // Size: to.Ptr("P1"), - // Tier: to.Ptr(armsignalr.SignalRSKUTierPremium), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalR_Get.json -func ExampleClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().Get(ctx, "myResourceGroup", "mySignalRService", 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.ResourceInfo = armsignalr.ResourceInfo{ - // Name: to.Ptr("mySignalRService"), - // Type: to.Ptr("Microsoft.SignalRService/SignalR"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService"), - // SystemData: &armsignalr.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Identity: &armsignalr.ManagedIdentity{ - // Type: to.Ptr(armsignalr.ManagedIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // Kind: to.Ptr(armsignalr.ServiceKindSignalR), - // Properties: &armsignalr.Properties{ - // Cors: &armsignalr.CorsSettings{ - // AllowedOrigins: []*string{ - // to.Ptr("https://foo.com"), - // to.Ptr("https://bar.com")}, - // }, - // DisableAADAuth: to.Ptr(false), - // DisableLocalAuth: to.Ptr(false), - // ExternalIP: to.Ptr("10.0.0.1"), - // Features: []*armsignalr.Feature{ - // { - // Flag: to.Ptr(armsignalr.FeatureFlagsServiceMode), - // Properties: map[string]*string{ - // }, - // Value: to.Ptr("Serverless"), - // }, - // { - // Flag: to.Ptr(armsignalr.FeatureFlagsEnableConnectivityLogs), - // Properties: map[string]*string{ - // }, - // Value: to.Ptr("True"), - // }, - // { - // Flag: to.Ptr(armsignalr.FeatureFlagsEnableMessagingLogs), - // Properties: map[string]*string{ - // }, - // Value: to.Ptr("False"), - // }, - // { - // Flag: to.Ptr(armsignalr.FeatureFlagsEnableLiveTrace), - // Properties: map[string]*string{ - // }, - // Value: to.Ptr("False"), - // }}, - // HostName: to.Ptr("mysignalrservice.service.signalr.net"), - // LiveTraceConfiguration: &armsignalr.LiveTraceConfiguration{ - // Categories: []*armsignalr.LiveTraceCategory{ - // { - // Name: to.Ptr("ConnectivityLogs"), - // Enabled: to.Ptr("true"), - // }}, - // Enabled: to.Ptr("false"), - // }, - // NetworkACLs: &armsignalr.NetworkACLs{ - // DefaultAction: to.Ptr(armsignalr.ACLActionDeny), - // IPRules: []*armsignalr.IPRule{ - // { - // Action: to.Ptr(armsignalr.ACLActionAllow), - // Value: to.Ptr("123.456.789.123/24"), - // }, - // { - // Action: to.Ptr(armsignalr.ACLActionAllow), - // Value: to.Ptr("123.456.789.123"), - // }, - // { - // Action: to.Ptr(armsignalr.ACLActionAllow), - // Value: to.Ptr("AppService"), - // }}, - // PrivateEndpoints: []*armsignalr.PrivateEndpointACL{ - // { - // Allow: []*armsignalr.SignalRRequestType{ - // to.Ptr(armsignalr.SignalRRequestTypeServerConnection)}, - // Name: to.Ptr("mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // }}, - // PublicNetwork: &armsignalr.NetworkACL{ - // Allow: []*armsignalr.SignalRRequestType{ - // to.Ptr(armsignalr.SignalRRequestTypeClientConnection)}, - // }, - // }, - // PrivateEndpointConnections: []*armsignalr.PrivateEndpointConnection{ - // { - // Name: to.Ptr("mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // Type: to.Ptr("Microsoft.SignalRService/SignalR/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService/privateEndpointConnections/mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // SystemData: &armsignalr.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // }, - // Properties: &armsignalr.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsignalr.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armsignalr.PrivateLinkServiceConnectionState{ - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armsignalr.PrivateLinkServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armsignalr.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr(armsignalr.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr("Enabled"), - // PublicPort: to.Ptr[int32](443), - // RegionEndpointEnabled: to.Ptr("Enabled"), - // ResourceLogConfiguration: &armsignalr.ResourceLogConfiguration{ - // Categories: []*armsignalr.ResourceLogCategory{ - // { - // Name: to.Ptr("ConnectivityLogs"), - // Enabled: to.Ptr("true"), - // }}, - // }, - // ResourceStopped: to.Ptr("false"), - // ServerPort: to.Ptr[int32](443), - // Serverless: &armsignalr.ServerlessSettings{ - // ConnectionTimeoutInSeconds: to.Ptr[int32](5), - // }, - // TLS: &armsignalr.TLSSettings{ - // ClientCertEnabled: to.Ptr(true), - // }, - // Upstream: &armsignalr.ServerlessUpstreamSettings{ - // Templates: []*armsignalr.UpstreamTemplate{ - // { - // URLTemplate: to.Ptr("http://foo.com"), - // }}, - // }, - // Version: to.Ptr("1.0"), - // }, - // SKU: &armsignalr.ResourceSKU{ - // Name: to.Ptr("Premium_P1"), - // Capacity: to.Ptr[int32](1), - // Size: to.Ptr("P1"), - // Tier: to.Ptr(armsignalr.SignalRSKUTierPremium), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalR_CreateOrUpdate.json -func ExampleClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "mySignalRService", armsignalr.ResourceInfo{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Identity: &armsignalr.ManagedIdentity{ - Type: to.Ptr(armsignalr.ManagedIdentityTypeSystemAssigned), - }, - Kind: to.Ptr(armsignalr.ServiceKindSignalR), - Properties: &armsignalr.Properties{ - Cors: &armsignalr.CorsSettings{ - AllowedOrigins: []*string{ - to.Ptr("https://foo.com"), - to.Ptr("https://bar.com")}, - }, - DisableAADAuth: to.Ptr(false), - DisableLocalAuth: to.Ptr(false), - Features: []*armsignalr.Feature{ - { - Flag: to.Ptr(armsignalr.FeatureFlagsServiceMode), - Properties: map[string]*string{}, - Value: to.Ptr("Serverless"), - }, - { - Flag: to.Ptr(armsignalr.FeatureFlagsEnableConnectivityLogs), - Properties: map[string]*string{}, - Value: to.Ptr("True"), - }, - { - Flag: to.Ptr(armsignalr.FeatureFlagsEnableMessagingLogs), - Properties: map[string]*string{}, - Value: to.Ptr("False"), - }, - { - Flag: to.Ptr(armsignalr.FeatureFlagsEnableLiveTrace), - Properties: map[string]*string{}, - Value: to.Ptr("False"), - }}, - LiveTraceConfiguration: &armsignalr.LiveTraceConfiguration{ - Categories: []*armsignalr.LiveTraceCategory{ - { - Name: to.Ptr("ConnectivityLogs"), - Enabled: to.Ptr("true"), - }}, - Enabled: to.Ptr("false"), - }, - NetworkACLs: &armsignalr.NetworkACLs{ - DefaultAction: to.Ptr(armsignalr.ACLActionDeny), - PrivateEndpoints: []*armsignalr.PrivateEndpointACL{ - { - Allow: []*armsignalr.SignalRRequestType{ - to.Ptr(armsignalr.SignalRRequestTypeServerConnection)}, - Name: to.Ptr("mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - }}, - PublicNetwork: &armsignalr.NetworkACL{ - Allow: []*armsignalr.SignalRRequestType{ - to.Ptr(armsignalr.SignalRRequestTypeClientConnection)}, - }, - }, - PublicNetworkAccess: to.Ptr("Enabled"), - Serverless: &armsignalr.ServerlessSettings{ - ConnectionTimeoutInSeconds: to.Ptr[int32](5), - }, - TLS: &armsignalr.TLSSettings{ - ClientCertEnabled: to.Ptr(false), - }, - Upstream: &armsignalr.ServerlessUpstreamSettings{ - Templates: []*armsignalr.UpstreamTemplate{ - { - Auth: &armsignalr.UpstreamAuthSettings{ - Type: to.Ptr(armsignalr.UpstreamAuthTypeManagedIdentity), - ManagedIdentity: &armsignalr.ManagedIdentitySettings{ - Resource: to.Ptr("api://example"), - }, - }, - CategoryPattern: to.Ptr("*"), - EventPattern: to.Ptr("connect,disconnect"), - HubPattern: to.Ptr("*"), - URLTemplate: to.Ptr("https://example.com/chat/api/connect"), - }}, - }, - }, - SKU: &armsignalr.ResourceSKU{ - Name: to.Ptr("Premium_P1"), - Capacity: to.Ptr[int32](1), - Tier: to.Ptr(armsignalr.SignalRSKUTierPremium), - }, - }, 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.ResourceInfo = armsignalr.ResourceInfo{ - // Name: to.Ptr("mySignalRService"), - // Type: to.Ptr("Microsoft.SignalRService/SignalR"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService"), - // SystemData: &armsignalr.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Identity: &armsignalr.ManagedIdentity{ - // Type: to.Ptr(armsignalr.ManagedIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // Kind: to.Ptr(armsignalr.ServiceKindSignalR), - // Properties: &armsignalr.Properties{ - // Cors: &armsignalr.CorsSettings{ - // AllowedOrigins: []*string{ - // to.Ptr("https://foo.com"), - // to.Ptr("https://bar.com")}, - // }, - // DisableAADAuth: to.Ptr(false), - // DisableLocalAuth: to.Ptr(false), - // ExternalIP: to.Ptr("10.0.0.1"), - // Features: []*armsignalr.Feature{ - // { - // Flag: to.Ptr(armsignalr.FeatureFlagsServiceMode), - // Properties: map[string]*string{ - // }, - // Value: to.Ptr("Serverless"), - // }, - // { - // Flag: to.Ptr(armsignalr.FeatureFlagsEnableConnectivityLogs), - // Properties: map[string]*string{ - // }, - // Value: to.Ptr("True"), - // }, - // { - // Flag: to.Ptr(armsignalr.FeatureFlagsEnableMessagingLogs), - // Properties: map[string]*string{ - // }, - // Value: to.Ptr("False"), - // }, - // { - // Flag: to.Ptr(armsignalr.FeatureFlagsEnableLiveTrace), - // Properties: map[string]*string{ - // }, - // Value: to.Ptr("False"), - // }}, - // HostName: to.Ptr("mysignalrservice.service.signalr.net"), - // LiveTraceConfiguration: &armsignalr.LiveTraceConfiguration{ - // Categories: []*armsignalr.LiveTraceCategory{ - // { - // Name: to.Ptr("ConnectivityLogs"), - // Enabled: to.Ptr("true"), - // }}, - // Enabled: to.Ptr("false"), - // }, - // NetworkACLs: &armsignalr.NetworkACLs{ - // DefaultAction: to.Ptr(armsignalr.ACLActionDeny), - // IPRules: []*armsignalr.IPRule{ - // { - // Action: to.Ptr(armsignalr.ACLActionAllow), - // Value: to.Ptr("123.456.789.123/24"), - // }, - // { - // Action: to.Ptr(armsignalr.ACLActionAllow), - // Value: to.Ptr("123.456.789.123"), - // }, - // { - // Action: to.Ptr(armsignalr.ACLActionAllow), - // Value: to.Ptr("AppService"), - // }}, - // PrivateEndpoints: []*armsignalr.PrivateEndpointACL{ - // { - // Allow: []*armsignalr.SignalRRequestType{ - // to.Ptr(armsignalr.SignalRRequestTypeServerConnection)}, - // Name: to.Ptr("mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // }}, - // PublicNetwork: &armsignalr.NetworkACL{ - // Allow: []*armsignalr.SignalRRequestType{ - // to.Ptr(armsignalr.SignalRRequestTypeClientConnection)}, - // }, - // }, - // PrivateEndpointConnections: []*armsignalr.PrivateEndpointConnection{ - // { - // Name: to.Ptr("mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // Type: to.Ptr("Microsoft.SignalRService/SignalR/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService/privateEndpointConnections/mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // SystemData: &armsignalr.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // }, - // Properties: &armsignalr.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsignalr.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armsignalr.PrivateLinkServiceConnectionState{ - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armsignalr.PrivateLinkServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armsignalr.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr(armsignalr.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr("Enabled"), - // PublicPort: to.Ptr[int32](443), - // RegionEndpointEnabled: to.Ptr("Enabled"), - // ResourceLogConfiguration: &armsignalr.ResourceLogConfiguration{ - // Categories: []*armsignalr.ResourceLogCategory{ - // { - // Name: to.Ptr("ConnectivityLogs"), - // Enabled: to.Ptr("true"), - // }}, - // }, - // ResourceStopped: to.Ptr("false"), - // ServerPort: to.Ptr[int32](443), - // Serverless: &armsignalr.ServerlessSettings{ - // ConnectionTimeoutInSeconds: to.Ptr[int32](5), - // }, - // TLS: &armsignalr.TLSSettings{ - // ClientCertEnabled: to.Ptr(true), - // }, - // Upstream: &armsignalr.ServerlessUpstreamSettings{ - // Templates: []*armsignalr.UpstreamTemplate{ - // { - // URLTemplate: to.Ptr("http://foo.com"), - // }}, - // }, - // Version: to.Ptr("1.0"), - // }, - // SKU: &armsignalr.ResourceSKU{ - // Name: to.Ptr("Premium_P1"), - // Capacity: to.Ptr[int32](1), - // Size: to.Ptr("P1"), - // Tier: to.Ptr(armsignalr.SignalRSKUTierPremium), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalR_Delete.json -func ExampleClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClient().BeginDelete(ctx, "myResourceGroup", "mySignalRService", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalR_Update.json -func ExampleClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClient().BeginUpdate(ctx, "myResourceGroup", "mySignalRService", armsignalr.ResourceInfo{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Identity: &armsignalr.ManagedIdentity{ - Type: to.Ptr(armsignalr.ManagedIdentityTypeSystemAssigned), - }, - Kind: to.Ptr(armsignalr.ServiceKindSignalR), - Properties: &armsignalr.Properties{ - Cors: &armsignalr.CorsSettings{ - AllowedOrigins: []*string{ - to.Ptr("https://foo.com"), - to.Ptr("https://bar.com")}, - }, - DisableAADAuth: to.Ptr(false), - DisableLocalAuth: to.Ptr(false), - Features: []*armsignalr.Feature{ - { - Flag: to.Ptr(armsignalr.FeatureFlagsServiceMode), - Properties: map[string]*string{}, - Value: to.Ptr("Serverless"), - }, - { - Flag: to.Ptr(armsignalr.FeatureFlagsEnableConnectivityLogs), - Properties: map[string]*string{}, - Value: to.Ptr("True"), - }, - { - Flag: to.Ptr(armsignalr.FeatureFlagsEnableMessagingLogs), - Properties: map[string]*string{}, - Value: to.Ptr("False"), - }, - { - Flag: to.Ptr(armsignalr.FeatureFlagsEnableLiveTrace), - Properties: map[string]*string{}, - Value: to.Ptr("False"), - }}, - LiveTraceConfiguration: &armsignalr.LiveTraceConfiguration{ - Categories: []*armsignalr.LiveTraceCategory{ - { - Name: to.Ptr("ConnectivityLogs"), - Enabled: to.Ptr("true"), - }}, - Enabled: to.Ptr("false"), - }, - NetworkACLs: &armsignalr.NetworkACLs{ - DefaultAction: to.Ptr(armsignalr.ACLActionDeny), - PrivateEndpoints: []*armsignalr.PrivateEndpointACL{ - { - Allow: []*armsignalr.SignalRRequestType{ - to.Ptr(armsignalr.SignalRRequestTypeServerConnection)}, - Name: to.Ptr("mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - }}, - PublicNetwork: &armsignalr.NetworkACL{ - Allow: []*armsignalr.SignalRRequestType{ - to.Ptr(armsignalr.SignalRRequestTypeClientConnection)}, - }, - }, - PublicNetworkAccess: to.Ptr("Enabled"), - Serverless: &armsignalr.ServerlessSettings{ - ConnectionTimeoutInSeconds: to.Ptr[int32](5), - }, - TLS: &armsignalr.TLSSettings{ - ClientCertEnabled: to.Ptr(false), - }, - Upstream: &armsignalr.ServerlessUpstreamSettings{ - Templates: []*armsignalr.UpstreamTemplate{ - { - Auth: &armsignalr.UpstreamAuthSettings{ - Type: to.Ptr(armsignalr.UpstreamAuthTypeManagedIdentity), - ManagedIdentity: &armsignalr.ManagedIdentitySettings{ - Resource: to.Ptr("api://example"), - }, - }, - CategoryPattern: to.Ptr("*"), - EventPattern: to.Ptr("connect,disconnect"), - HubPattern: to.Ptr("*"), - URLTemplate: to.Ptr("https://example.com/chat/api/connect"), - }}, - }, - }, - SKU: &armsignalr.ResourceSKU{ - Name: to.Ptr("Premium_P1"), - Capacity: to.Ptr[int32](1), - Tier: to.Ptr(armsignalr.SignalRSKUTierPremium), - }, - }, 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.ResourceInfo = armsignalr.ResourceInfo{ - // Name: to.Ptr("mySignalRService"), - // Type: to.Ptr("Microsoft.SignalRService/SignalR"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService"), - // SystemData: &armsignalr.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Identity: &armsignalr.ManagedIdentity{ - // Type: to.Ptr(armsignalr.ManagedIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // Kind: to.Ptr(armsignalr.ServiceKindSignalR), - // Properties: &armsignalr.Properties{ - // Cors: &armsignalr.CorsSettings{ - // AllowedOrigins: []*string{ - // to.Ptr("https://foo.com"), - // to.Ptr("https://bar.com")}, - // }, - // DisableAADAuth: to.Ptr(false), - // DisableLocalAuth: to.Ptr(false), - // ExternalIP: to.Ptr("10.0.0.1"), - // Features: []*armsignalr.Feature{ - // { - // Flag: to.Ptr(armsignalr.FeatureFlagsServiceMode), - // Properties: map[string]*string{ - // }, - // Value: to.Ptr("Serverless"), - // }, - // { - // Flag: to.Ptr(armsignalr.FeatureFlagsEnableConnectivityLogs), - // Properties: map[string]*string{ - // }, - // Value: to.Ptr("True"), - // }, - // { - // Flag: to.Ptr(armsignalr.FeatureFlagsEnableMessagingLogs), - // Properties: map[string]*string{ - // }, - // Value: to.Ptr("False"), - // }, - // { - // Flag: to.Ptr(armsignalr.FeatureFlagsEnableLiveTrace), - // Properties: map[string]*string{ - // }, - // Value: to.Ptr("False"), - // }}, - // HostName: to.Ptr("mysignalrservice.service.signalr.net"), - // LiveTraceConfiguration: &armsignalr.LiveTraceConfiguration{ - // Categories: []*armsignalr.LiveTraceCategory{ - // { - // Name: to.Ptr("ConnectivityLogs"), - // Enabled: to.Ptr("true"), - // }}, - // Enabled: to.Ptr("false"), - // }, - // NetworkACLs: &armsignalr.NetworkACLs{ - // DefaultAction: to.Ptr(armsignalr.ACLActionDeny), - // IPRules: []*armsignalr.IPRule{ - // { - // Action: to.Ptr(armsignalr.ACLActionAllow), - // Value: to.Ptr("123.456.789.123/24"), - // }, - // { - // Action: to.Ptr(armsignalr.ACLActionAllow), - // Value: to.Ptr("123.456.789.123"), - // }, - // { - // Action: to.Ptr(armsignalr.ACLActionAllow), - // Value: to.Ptr("AppService"), - // }}, - // PrivateEndpoints: []*armsignalr.PrivateEndpointACL{ - // { - // Allow: []*armsignalr.SignalRRequestType{ - // to.Ptr(armsignalr.SignalRRequestTypeServerConnection)}, - // Name: to.Ptr("mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // }}, - // PublicNetwork: &armsignalr.NetworkACL{ - // Allow: []*armsignalr.SignalRRequestType{ - // to.Ptr(armsignalr.SignalRRequestTypeClientConnection)}, - // }, - // }, - // PrivateEndpointConnections: []*armsignalr.PrivateEndpointConnection{ - // { - // Name: to.Ptr("mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // Type: to.Ptr("Microsoft.SignalRService/SignalR/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService/privateEndpointConnections/mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // SystemData: &armsignalr.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // }, - // Properties: &armsignalr.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsignalr.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armsignalr.PrivateLinkServiceConnectionState{ - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armsignalr.PrivateLinkServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armsignalr.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr(armsignalr.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr("Enabled"), - // PublicPort: to.Ptr[int32](443), - // RegionEndpointEnabled: to.Ptr("Enabled"), - // ResourceLogConfiguration: &armsignalr.ResourceLogConfiguration{ - // Categories: []*armsignalr.ResourceLogCategory{ - // { - // Name: to.Ptr("ConnectivityLogs"), - // Enabled: to.Ptr("true"), - // }}, - // }, - // ResourceStopped: to.Ptr("false"), - // ServerPort: to.Ptr[int32](443), - // Serverless: &armsignalr.ServerlessSettings{ - // ConnectionTimeoutInSeconds: to.Ptr[int32](5), - // }, - // TLS: &armsignalr.TLSSettings{ - // ClientCertEnabled: to.Ptr(true), - // }, - // Upstream: &armsignalr.ServerlessUpstreamSettings{ - // Templates: []*armsignalr.UpstreamTemplate{ - // { - // URLTemplate: to.Ptr("http://foo.com"), - // }}, - // }, - // Version: to.Ptr("1.0"), - // }, - // SKU: &armsignalr.ResourceSKU{ - // Name: to.Ptr("Premium_P1"), - // Capacity: to.Ptr[int32](1), - // Size: to.Ptr("P1"), - // Tier: to.Ptr(armsignalr.SignalRSKUTierPremium), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalR_ListKeys.json -func ExampleClient_ListKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().ListKeys(ctx, "myResourceGroup", "mySignalRService", 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.Keys = armsignalr.Keys{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalR_RegenerateKey.json -func ExampleClient_BeginRegenerateKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClient().BeginRegenerateKey(ctx, "myResourceGroup", "mySignalRService", armsignalr.RegenerateKeyParameters{ - KeyType: to.Ptr(armsignalr.KeyTypePrimary), - }, 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.Keys = armsignalr.Keys{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalR_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 := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().ListReplicaSKUs(ctx, "myResourceGroup", "mySignalRService", "mySignalRService-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 = armsignalr.SKUList{ - // Value: []*armsignalr.SKU{ - // { - // Capacity: &armsignalr.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(armsignalr.ScaleTypeManual), - // }, - // ResourceType: to.Ptr("Microsoft.SignalRService/SignalR/replicas"), - // SKU: &armsignalr.ResourceSKU{ - // Name: to.Ptr("Free_F1"), - // Tier: to.Ptr(armsignalr.SignalRSKUTierFree), - // }, - // }, - // { - // Capacity: &armsignalr.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(armsignalr.ScaleTypeManual), - // }, - // ResourceType: to.Ptr("Microsoft.SignalRService/SignalR/replicas"), - // SKU: &armsignalr.ResourceSKU{ - // Name: to.Ptr("Standard_S1"), - // Tier: to.Ptr(armsignalr.SignalRSKUTierStandard), - // }, - // }, - // { - // Capacity: &armsignalr.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(armsignalr.ScaleTypeAutomatic), - // }, - // ResourceType: to.Ptr("Microsoft.SignalRService/SignalR/replicas"), - // SKU: &armsignalr.ResourceSKU{ - // Name: to.Ptr("Premium_P1"), - // Tier: to.Ptr(armsignalr.SignalRSKUTierStandard), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalR_Restart.json -func ExampleClient_BeginRestart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClient().BeginRestart(ctx, "myResourceGroup", "mySignalRService", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalR_ListSkus.json -func ExampleClient_ListSKUs() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().ListSKUs(ctx, "myResourceGroup", "mySignalRService", 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 = armsignalr.SKUList{ - // Value: []*armsignalr.SKU{ - // { - // Capacity: &armsignalr.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(armsignalr.ScaleTypeManual), - // }, - // ResourceType: to.Ptr("Microsoft.SignalRService/SignalR"), - // SKU: &armsignalr.ResourceSKU{ - // Name: to.Ptr("Free_F1"), - // Tier: to.Ptr(armsignalr.SignalRSKUTierFree), - // }, - // }, - // { - // Capacity: &armsignalr.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(armsignalr.ScaleTypeManual), - // }, - // ResourceType: to.Ptr("Microsoft.SignalRService/SignalR"), - // SKU: &armsignalr.ResourceSKU{ - // Name: to.Ptr("Standard_S1"), - // Tier: to.Ptr(armsignalr.SignalRSKUTierStandard), - // }, - // }, - // { - // Capacity: &armsignalr.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(armsignalr.ScaleTypeAutomatic), - // }, - // ResourceType: to.Ptr("Microsoft.SignalRService/SignalR/replicas"), - // SKU: &armsignalr.ResourceSKU{ - // Name: to.Ptr("Premium_P1"), - // Tier: to.Ptr(armsignalr.SignalRSKUTierStandard), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/signalr/armsignalr/client_factory.go b/sdk/resourcemanager/signalr/armsignalr/client_factory.go index ba8d712211ba..109f35290eda 100644 --- a/sdk/resourcemanager/signalr/armsignalr/client_factory.go +++ b/sdk/resourcemanager/signalr/armsignalr/client_factory.go @@ -17,8 +17,7 @@ import ( // Don't use this type directly, use NewClientFactory instead. type ClientFactory struct { subscriptionID string - credential azcore.TokenCredential - options *arm.ClientOptions + internal *arm.Client } // NewClientFactory creates a new instance of ClientFactory with the specified values. @@ -27,66 +26,91 @@ type ClientFactory struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { - _, err := arm.NewClient(moduleName, moduleVersion, credential, options) + internal, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } return &ClientFactory{ - subscriptionID: subscriptionID, credential: credential, - options: options.Clone(), + subscriptionID: subscriptionID, + internal: internal, }, nil } // NewClient creates a new instance of Client. func (c *ClientFactory) NewClient() *Client { - subClient, _ := NewClient(c.subscriptionID, c.credential, c.options) - return subClient + return &Client{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewCustomCertificatesClient creates a new instance of CustomCertificatesClient. func (c *ClientFactory) NewCustomCertificatesClient() *CustomCertificatesClient { - subClient, _ := NewCustomCertificatesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &CustomCertificatesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewCustomDomainsClient creates a new instance of CustomDomainsClient. func (c *ClientFactory) NewCustomDomainsClient() *CustomDomainsClient { - subClient, _ := NewCustomDomainsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &CustomDomainsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewOperationsClient creates a new instance of OperationsClient. func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) - return subClient + return &OperationsClient{ + internal: c.internal, + } } // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient. func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient { - subClient, _ := NewPrivateEndpointConnectionsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &PrivateEndpointConnectionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient. func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient { - subClient, _ := NewPrivateLinkResourcesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &PrivateLinkResourcesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewReplicaSharedPrivateLinkResourcesClient creates a new instance of ReplicaSharedPrivateLinkResourcesClient. +func (c *ClientFactory) NewReplicaSharedPrivateLinkResourcesClient() *ReplicaSharedPrivateLinkResourcesClient { + return &ReplicaSharedPrivateLinkResourcesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewReplicasClient creates a new instance of ReplicasClient. func (c *ClientFactory) NewReplicasClient() *ReplicasClient { - subClient, _ := NewReplicasClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ReplicasClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewSharedPrivateLinkResourcesClient creates a new instance of SharedPrivateLinkResourcesClient. func (c *ClientFactory) NewSharedPrivateLinkResourcesClient() *SharedPrivateLinkResourcesClient { - subClient, _ := NewSharedPrivateLinkResourcesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &SharedPrivateLinkResourcesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewUsagesClient creates a new instance of UsagesClient. func (c *ClientFactory) NewUsagesClient() *UsagesClient { - subClient, _ := NewUsagesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &UsagesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } diff --git a/sdk/resourcemanager/signalr/armsignalr/constants.go b/sdk/resourcemanager/signalr/armsignalr/constants.go index 5a19134545a1..5f58cb29bf39 100644 --- a/sdk/resourcemanager/signalr/armsignalr/constants.go +++ b/sdk/resourcemanager/signalr/armsignalr/constants.go @@ -10,7 +10,7 @@ package armsignalr const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/signalr/armsignalr" - moduleVersion = "v1.3.0-beta.1" + moduleVersion = "v1.3.0" ) // ACLAction - Azure Networking ACL Action. diff --git a/sdk/resourcemanager/signalr/armsignalr/customcertificates_client.go b/sdk/resourcemanager/signalr/armsignalr/customcertificates_client.go index cb07f0248f3c..f15e8ffdaac4 100644 --- a/sdk/resourcemanager/signalr/armsignalr/customcertificates_client.go +++ b/sdk/resourcemanager/signalr/armsignalr/customcertificates_client.go @@ -46,7 +46,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - certificateName - Custom certificate name @@ -73,7 +73,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-08-01-preview +// Generated from API version 2024-03-01 func (client *CustomCertificatesClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, certificateName string, parameters CustomCertificate, options *CustomCertificatesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "CustomCertificatesClient.BeginCreateOrUpdate" @@ -119,7 +119,7 @@ func (client *CustomCertificatesClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -131,7 +131,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - certificateName - Custom certificate name @@ -182,7 +182,7 @@ func (client *CustomCertificatesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,7 +191,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - certificateName - Custom certificate name @@ -242,7 +242,7 @@ func (client *CustomCertificatesClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -259,7 +259,7 @@ func (client *CustomCertificatesClient) getHandleResponse(resp *http.Response) ( // NewListPager - List all custom certificates. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - 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 @@ -307,7 +307,7 @@ func (client *CustomCertificatesClient) listCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/signalr/armsignalr/customcertificates_client_example_test.go b/sdk/resourcemanager/signalr/armsignalr/customcertificates_client_example_test.go deleted file mode 100644 index d323bded677b..000000000000 --- a/sdk/resourcemanager/signalr/armsignalr/customcertificates_client_example_test.go +++ /dev/null @@ -1,147 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsignalr_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/signalr/armsignalr" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalRCustomCertificates_List.json -func ExampleCustomCertificatesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCustomCertificatesClient().NewListPager("myResourceGroup", "mySignalRService", 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.CustomCertificateList = armsignalr.CustomCertificateList{ - // Value: []*armsignalr.CustomCertificate{ - // { - // Name: to.Ptr("myCert"), - // Type: to.Ptr("Microsoft.SignalRService/SignalR/customCertificates"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService/customCertificates/myCert"), - // Properties: &armsignalr.CustomCertificateProperties{ - // KeyVaultBaseURI: to.Ptr("https://myvault.keyvault.azure.net/"), - // KeyVaultSecretName: to.Ptr("mycert"), - // KeyVaultSecretVersion: to.Ptr("bb6a44b2743f47f68dad0d6cc9756432"), - // ProvisioningState: to.Ptr(armsignalr.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalRCustomCertificates_Get.json -func ExampleCustomCertificatesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCustomCertificatesClient().Get(ctx, "myResourceGroup", "mySignalRService", "myCert", 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.CustomCertificate = armsignalr.CustomCertificate{ - // Name: to.Ptr("myCert"), - // Type: to.Ptr("Microsoft.SignalRService/SignalR/customCertificates"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService/customCertificates/myCert"), - // Properties: &armsignalr.CustomCertificateProperties{ - // KeyVaultBaseURI: to.Ptr("https://myvault.keyvault.azure.net/"), - // KeyVaultSecretName: to.Ptr("mycert"), - // KeyVaultSecretVersion: to.Ptr("bb6a44b2743f47f68dad0d6cc9756432"), - // ProvisioningState: to.Ptr(armsignalr.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalRCustomCertificates_CreateOrUpdate.json -func ExampleCustomCertificatesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCustomCertificatesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "mySignalRService", "myCert", armsignalr.CustomCertificate{ - Properties: &armsignalr.CustomCertificateProperties{ - KeyVaultBaseURI: to.Ptr("https://myvault.keyvault.azure.net/"), - KeyVaultSecretName: to.Ptr("mycert"), - KeyVaultSecretVersion: to.Ptr("bb6a44b2743f47f68dad0d6cc9756432"), - }, - }, 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.CustomCertificate = armsignalr.CustomCertificate{ - // Name: to.Ptr("myCert"), - // Type: to.Ptr("Microsoft.SignalRService/SignalR/customCertificates"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService/customCertificates/myCert"), - // Properties: &armsignalr.CustomCertificateProperties{ - // KeyVaultBaseURI: to.Ptr("https://myvault.keyvault.azure.net/"), - // KeyVaultSecretName: to.Ptr("mycert"), - // KeyVaultSecretVersion: to.Ptr("bb6a44b2743f47f68dad0d6cc9756432"), - // ProvisioningState: to.Ptr(armsignalr.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalRCustomCertificates_Delete.json -func ExampleCustomCertificatesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewCustomCertificatesClient().Delete(ctx, "myResourceGroup", "mySignalRService", "myCert", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/signalr/armsignalr/customdomains_client.go b/sdk/resourcemanager/signalr/armsignalr/customdomains_client.go index 2a9857868f30..9eb2f4a72028 100644 --- a/sdk/resourcemanager/signalr/armsignalr/customdomains_client.go +++ b/sdk/resourcemanager/signalr/armsignalr/customdomains_client.go @@ -46,7 +46,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - name - Custom domain name. @@ -73,7 +73,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-08-01-preview +// Generated from API version 2024-03-01 func (client *CustomDomainsClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, name string, parameters CustomDomain, options *CustomDomainsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "CustomDomainsClient.BeginCreateOrUpdate" @@ -119,7 +119,7 @@ func (client *CustomDomainsClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -131,7 +131,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - name - Custom domain name. @@ -158,7 +158,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-08-01-preview +// Generated from API version 2024-03-01 func (client *CustomDomainsClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, name string, options *CustomDomainsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "CustomDomainsClient.BeginDelete" @@ -204,7 +204,7 @@ func (client *CustomDomainsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -213,7 +213,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - name - Custom domain name. @@ -264,7 +264,7 @@ func (client *CustomDomainsClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,7 +281,7 @@ func (client *CustomDomainsClient) getHandleResponse(resp *http.Response) (Custo // NewListPager - List all custom domains. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - 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. @@ -328,7 +328,7 @@ func (client *CustomDomainsClient) listCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/signalr/armsignalr/customdomains_client_example_test.go b/sdk/resourcemanager/signalr/armsignalr/customdomains_client_example_test.go deleted file mode 100644 index 57742a4d0fd4..000000000000 --- a/sdk/resourcemanager/signalr/armsignalr/customdomains_client_example_test.go +++ /dev/null @@ -1,138 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsignalr_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/signalr/armsignalr" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalRCustomDomains_List.json -func ExampleCustomDomainsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCustomDomainsClient().NewListPager("myResourceGroup", "mySignalRService", 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.CustomDomainList = armsignalr.CustomDomainList{ - // Value: []*armsignalr.CustomDomain{ - // { - // Name: to.Ptr("myDomain"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService/customDomains/myDomain"), - // Properties: &armsignalr.CustomDomainProperties{ - // CustomCertificate: &armsignalr.ResourceReference{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService/customCertificates/myCert"), - // }, - // DomainName: to.Ptr("example.com"), - // ProvisioningState: to.Ptr(armsignalr.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalRCustomDomains_Get.json -func ExampleCustomDomainsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCustomDomainsClient().Get(ctx, "myResourceGroup", "mySignalRService", "example", 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.CustomDomain = armsignalr.CustomDomain{ - // Name: to.Ptr("myDomain"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService/customDomains/myDomain"), - // Properties: &armsignalr.CustomDomainProperties{ - // CustomCertificate: &armsignalr.ResourceReference{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService/customCertificates/myCert"), - // }, - // DomainName: to.Ptr("example.com"), - // ProvisioningState: to.Ptr(armsignalr.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalRCustomDomains_CreateOrUpdate.json -func ExampleCustomDomainsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCustomDomainsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "mySignalRService", "myDomain", armsignalr.CustomDomain{ - Properties: &armsignalr.CustomDomainProperties{ - CustomCertificate: &armsignalr.ResourceReference{ - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService/customCertificates/myCert"), - }, - DomainName: to.Ptr("example.com"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalRCustomDomains_Delete.json -func ExampleCustomDomainsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCustomDomainsClient().BeginDelete(ctx, "myResourceGroup", "mySignalRService", "example", 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/signalr/armsignalr/fake/replicasharedprivatelinkresources_server.go b/sdk/resourcemanager/signalr/armsignalr/fake/replicasharedprivatelinkresources_server.go new file mode 100644 index 000000000000..73ea2dfef029 --- /dev/null +++ b/sdk/resourcemanager/signalr/armsignalr/fake/replicasharedprivatelinkresources_server.go @@ -0,0 +1,228 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/signalr/armsignalr" + "net/http" + "net/url" + "regexp" +) + +// ReplicaSharedPrivateLinkResourcesServer is a fake server for instances of the armsignalr.ReplicaSharedPrivateLinkResourcesClient type. +type ReplicaSharedPrivateLinkResourcesServer struct { + // BeginCreateOrUpdate is the fake for method ReplicaSharedPrivateLinkResourcesClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, sharedPrivateLinkResourceName string, parameters armsignalr.SharedPrivateLinkResource, options *armsignalr.ReplicaSharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armsignalr.ReplicaSharedPrivateLinkResourcesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method ReplicaSharedPrivateLinkResourcesClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, sharedPrivateLinkResourceName string, options *armsignalr.ReplicaSharedPrivateLinkResourcesClientGetOptions) (resp azfake.Responder[armsignalr.ReplicaSharedPrivateLinkResourcesClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method ReplicaSharedPrivateLinkResourcesClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, resourceName string, replicaName string, options *armsignalr.ReplicaSharedPrivateLinkResourcesClientListOptions) (resp azfake.PagerResponder[armsignalr.ReplicaSharedPrivateLinkResourcesClientListResponse]) +} + +// NewReplicaSharedPrivateLinkResourcesServerTransport creates a new instance of ReplicaSharedPrivateLinkResourcesServerTransport with the provided implementation. +// The returned ReplicaSharedPrivateLinkResourcesServerTransport instance is connected to an instance of armsignalr.ReplicaSharedPrivateLinkResourcesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewReplicaSharedPrivateLinkResourcesServerTransport(srv *ReplicaSharedPrivateLinkResourcesServer) *ReplicaSharedPrivateLinkResourcesServerTransport { + return &ReplicaSharedPrivateLinkResourcesServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armsignalr.ReplicaSharedPrivateLinkResourcesClientCreateOrUpdateResponse]](), + newListPager: newTracker[azfake.PagerResponder[armsignalr.ReplicaSharedPrivateLinkResourcesClientListResponse]](), + } +} + +// ReplicaSharedPrivateLinkResourcesServerTransport connects instances of armsignalr.ReplicaSharedPrivateLinkResourcesClient to instances of ReplicaSharedPrivateLinkResourcesServer. +// Don't use this type directly, use NewReplicaSharedPrivateLinkResourcesServerTransport instead. +type ReplicaSharedPrivateLinkResourcesServerTransport struct { + srv *ReplicaSharedPrivateLinkResourcesServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armsignalr.ReplicaSharedPrivateLinkResourcesClientCreateOrUpdateResponse]] + newListPager *tracker[azfake.PagerResponder[armsignalr.ReplicaSharedPrivateLinkResourcesClientListResponse]] +} + +// Do implements the policy.Transporter interface for ReplicaSharedPrivateLinkResourcesServerTransport. +func (r *ReplicaSharedPrivateLinkResourcesServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "ReplicaSharedPrivateLinkResourcesClient.BeginCreateOrUpdate": + resp, err = r.dispatchBeginCreateOrUpdate(req) + case "ReplicaSharedPrivateLinkResourcesClient.Get": + resp, err = r.dispatchGet(req) + case "ReplicaSharedPrivateLinkResourcesClient.NewListPager": + resp, err = r.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (r *ReplicaSharedPrivateLinkResourcesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if r.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := r.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.SignalRService/signalR/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicas/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sharedPrivateLinkResources/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armsignalr.SharedPrivateLinkResource](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + replicaNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("replicaName")]) + if err != nil { + return nil, err + } + sharedPrivateLinkResourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("sharedPrivateLinkResourceName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, resourceNameParam, replicaNameParam, sharedPrivateLinkResourceNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + r.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + r.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + r.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (r *ReplicaSharedPrivateLinkResourcesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if r.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.SignalRService/signalR/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicas/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sharedPrivateLinkResources/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + replicaNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("replicaName")]) + if err != nil { + return nil, err + } + sharedPrivateLinkResourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("sharedPrivateLinkResourceName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, replicaNameParam, sharedPrivateLinkResourceNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SharedPrivateLinkResource, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (r *ReplicaSharedPrivateLinkResourcesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if r.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := r.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.SignalRService/signalR/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicas/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sharedPrivateLinkResources` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + replicaNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("replicaName")]) + if err != nil { + return nil, err + } + resp := r.srv.NewListPager(resourceGroupNameParam, resourceNameParam, replicaNameParam, nil) + newListPager = &resp + r.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armsignalr.ReplicaSharedPrivateLinkResourcesClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + r.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + r.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/signalr/armsignalr/fake/server_factory.go b/sdk/resourcemanager/signalr/armsignalr/fake/server_factory.go index 1e7c73b07ce2..f56a112c49a9 100644 --- a/sdk/resourcemanager/signalr/armsignalr/fake/server_factory.go +++ b/sdk/resourcemanager/signalr/armsignalr/fake/server_factory.go @@ -19,15 +19,16 @@ import ( // ServerFactory is a fake server for instances of the armsignalr.ClientFactory type. type ServerFactory struct { - Server Server - CustomCertificatesServer CustomCertificatesServer - CustomDomainsServer CustomDomainsServer - OperationsServer OperationsServer - PrivateEndpointConnectionsServer PrivateEndpointConnectionsServer - PrivateLinkResourcesServer PrivateLinkResourcesServer - ReplicasServer ReplicasServer - SharedPrivateLinkResourcesServer SharedPrivateLinkResourcesServer - UsagesServer UsagesServer + Server Server + CustomCertificatesServer CustomCertificatesServer + CustomDomainsServer CustomDomainsServer + OperationsServer OperationsServer + PrivateEndpointConnectionsServer PrivateEndpointConnectionsServer + PrivateLinkResourcesServer PrivateLinkResourcesServer + ReplicaSharedPrivateLinkResourcesServer ReplicaSharedPrivateLinkResourcesServer + ReplicasServer ReplicasServer + SharedPrivateLinkResourcesServer SharedPrivateLinkResourcesServer + UsagesServer UsagesServer } // NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. @@ -42,17 +43,18 @@ func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport { // ServerFactoryTransport connects instances of armsignalr.ClientFactory to instances of ServerFactory. // Don't use this type directly, use NewServerFactoryTransport instead. type ServerFactoryTransport struct { - srv *ServerFactory - trMu sync.Mutex - trServer *ServerTransport - trCustomCertificatesServer *CustomCertificatesServerTransport - trCustomDomainsServer *CustomDomainsServerTransport - trOperationsServer *OperationsServerTransport - trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport - trPrivateLinkResourcesServer *PrivateLinkResourcesServerTransport - trReplicasServer *ReplicasServerTransport - trSharedPrivateLinkResourcesServer *SharedPrivateLinkResourcesServerTransport - trUsagesServer *UsagesServerTransport + srv *ServerFactory + trMu sync.Mutex + trServer *ServerTransport + trCustomCertificatesServer *CustomCertificatesServerTransport + trCustomDomainsServer *CustomDomainsServerTransport + trOperationsServer *OperationsServerTransport + trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport + trPrivateLinkResourcesServer *PrivateLinkResourcesServerTransport + trReplicaSharedPrivateLinkResourcesServer *ReplicaSharedPrivateLinkResourcesServerTransport + trReplicasServer *ReplicasServerTransport + trSharedPrivateLinkResourcesServer *SharedPrivateLinkResourcesServerTransport + trUsagesServer *UsagesServerTransport } // Do implements the policy.Transporter interface for ServerFactoryTransport. @@ -94,6 +96,11 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewPrivateLinkResourcesServerTransport(&s.srv.PrivateLinkResourcesServer) }) resp, err = s.trPrivateLinkResourcesServer.Do(req) + case "ReplicaSharedPrivateLinkResourcesClient": + initServer(s, &s.trReplicaSharedPrivateLinkResourcesServer, func() *ReplicaSharedPrivateLinkResourcesServerTransport { + return NewReplicaSharedPrivateLinkResourcesServerTransport(&s.srv.ReplicaSharedPrivateLinkResourcesServer) + }) + resp, err = s.trReplicaSharedPrivateLinkResourcesServer.Do(req) case "ReplicasClient": initServer(s, &s.trReplicasServer, func() *ReplicasServerTransport { return NewReplicasServerTransport(&s.srv.ReplicasServer) }) resp, err = s.trReplicasServer.Do(req) diff --git a/sdk/resourcemanager/signalr/armsignalr/fake/time_rfc3339.go b/sdk/resourcemanager/signalr/armsignalr/fake/time_rfc3339.go index b0535a7b63e6..81f308b0d343 100644 --- a/sdk/resourcemanager/signalr/armsignalr/fake/time_rfc3339.go +++ b/sdk/resourcemanager/signalr/armsignalr/fake/time_rfc3339.go @@ -19,12 +19,16 @@ import ( ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -40,17 +44,33 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +81,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -74,7 +98,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339 diff --git a/sdk/resourcemanager/signalr/armsignalr/go.mod b/sdk/resourcemanager/signalr/armsignalr/go.mod index 8b866e7f0aa7..e86c6cd61086 100644 --- a/sdk/resourcemanager/signalr/armsignalr/go.mod +++ b/sdk/resourcemanager/signalr/armsignalr/go.mod @@ -4,7 +4,6 @@ go 1.18 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2 github.com/Azure/azure-sdk-for-go/sdk/internal v1.7.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 @@ -12,6 +11,7 @@ require ( ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/golang-jwt/jwt/v5 v5.2.1 // indirect diff --git a/sdk/resourcemanager/signalr/armsignalr/models.go b/sdk/resourcemanager/signalr/armsignalr/models.go index 1769ee7076d5..d05d3fa76e91 100644 --- a/sdk/resourcemanager/signalr/armsignalr/models.go +++ b/sdk/resourcemanager/signalr/armsignalr/models.go @@ -647,12 +647,13 @@ type ResourceReference struct { // ResourceSKU - The billing information of the resource. type ResourceSKU struct { // REQUIRED; The name of the SKU. Required. - // Allowed values: StandardS1, FreeF1, Premium_P1 + // Allowed values: StandardS1, FreeF1, PremiumP1, PremiumP2 Name *string - // Optional, integer. The unit count of the resource. 1 by default. - // If present, following values are allowed: Free: 1; Standard: 1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100; Premium: - // 1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100; + // Optional, integer. The unit count of the resource. 1 for FreeF1/StandardS1/PremiumP1, 100 for PremiumP2 by default. + // If present, following values are allowed: FreeF1: 1; StandardS1: 1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100; PremiumP1: + // 1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100; PremiumP2: + // 100,200,300,400,500,600,700,800,900,1000; Capacity *int32 // Optional tier of this particular SKU. 'Standard' or 'Free'. diff --git a/sdk/resourcemanager/signalr/armsignalr/models_serde.go b/sdk/resourcemanager/signalr/armsignalr/models_serde.go index f0ee3e4eb801..2432aeb122b2 100644 --- a/sdk/resourcemanager/signalr/armsignalr/models_serde.go +++ b/sdk/resourcemanager/signalr/armsignalr/models_serde.go @@ -2374,7 +2374,7 @@ func populate(m map[string]any, k string, v any) { } func unpopulate(data json.RawMessage, fn string, v any) error { - if data == nil { + if data == nil || string(data) == "null" { return nil } if err := json.Unmarshal(data, v); err != nil { diff --git a/sdk/resourcemanager/signalr/armsignalr/operations_client.go b/sdk/resourcemanager/signalr/armsignalr/operations_client.go index 24176b969039..7938b22797f7 100644 --- a/sdk/resourcemanager/signalr/armsignalr/operations_client.go +++ b/sdk/resourcemanager/signalr/armsignalr/operations_client.go @@ -39,7 +39,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-08-01-preview +// Generated from API version 2024-03-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -72,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/signalr/armsignalr/operations_client_example_test.go b/sdk/resourcemanager/signalr/armsignalr/operations_client_example_test.go deleted file mode 100644 index 16a1964ea81e..000000000000 --- a/sdk/resourcemanager/signalr/armsignalr/operations_client_example_test.go +++ /dev/null @@ -1,58 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsignalr_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/signalr/armsignalr" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/Operations_List.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationList = armsignalr.OperationList{ - // Value: []*armsignalr.Operation{ - // { - // Name: to.Ptr("Microsoft.SignalRService/SignalR/read"), - // Display: &armsignalr.OperationDisplay{ - // Description: to.Ptr("View the resource settings and configurations in the management portal or through API"), - // Operation: to.Ptr("Manage SignalR (read-only)"), - // Provider: to.Ptr("Microsoft.SignalRService"), - // Resource: to.Ptr("SignalR"), - // }, - // IsDataAction: to.Ptr(false), - // Properties: &armsignalr.OperationProperties{ - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/signalr/armsignalr/options.go b/sdk/resourcemanager/signalr/armsignalr/options.go index dd5236936463..9c4f8fe5a26f 100644 --- a/sdk/resourcemanager/signalr/armsignalr/options.go +++ b/sdk/resourcemanager/signalr/armsignalr/options.go @@ -154,6 +154,25 @@ type PrivateLinkResourcesClientListOptions struct { // placeholder for future optional parameters } +// ReplicaSharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions contains the optional parameters for the ReplicaSharedPrivateLinkResourcesClient.BeginCreateOrUpdate +// method. +type ReplicaSharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicaSharedPrivateLinkResourcesClientGetOptions contains the optional parameters for the ReplicaSharedPrivateLinkResourcesClient.Get +// method. +type ReplicaSharedPrivateLinkResourcesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ReplicaSharedPrivateLinkResourcesClientListOptions contains the optional parameters for the ReplicaSharedPrivateLinkResourcesClient.NewListPager +// method. +type ReplicaSharedPrivateLinkResourcesClientListOptions struct { + // placeholder for future optional parameters +} + // ReplicasClientBeginCreateOrUpdateOptions contains the optional parameters for the ReplicasClient.BeginCreateOrUpdate method. type ReplicasClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. diff --git a/sdk/resourcemanager/signalr/armsignalr/privateendpointconnections_client.go b/sdk/resourcemanager/signalr/armsignalr/privateendpointconnections_client.go index a339096ee576..0568b7dcfb3f 100644 --- a/sdk/resourcemanager/signalr/armsignalr/privateendpointconnections_client.go +++ b/sdk/resourcemanager/signalr/armsignalr/privateendpointconnections_client.go @@ -46,7 +46,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - 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. @@ -73,7 +73,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-08-01-preview +// Generated from API version 2024-03-01 func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, privateEndpointConnectionName string, resourceGroupName string, resourceName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PrivateEndpointConnectionsClient.BeginDelete" @@ -119,7 +119,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -128,7 +128,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - 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. @@ -180,7 +180,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -197,7 +197,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListPager - List private endpoint connections // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - 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 @@ -245,7 +245,7 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -263,7 +263,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - 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. @@ -316,7 +316,7 @@ func (client *PrivateEndpointConnectionsClient) updateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/signalr/armsignalr/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/signalr/armsignalr/privateendpointconnections_client_example_test.go deleted file mode 100644 index d28ac6905229..000000000000 --- a/sdk/resourcemanager/signalr/armsignalr/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,191 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsignalr_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/signalr/armsignalr" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalRPrivateEndpointConnections_List.json -func ExamplePrivateEndpointConnectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListPager("myResourceGroup", "mySignalRService", 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.PrivateEndpointConnectionList = armsignalr.PrivateEndpointConnectionList{ - // Value: []*armsignalr.PrivateEndpointConnection{ - // { - // Name: to.Ptr("mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // Type: to.Ptr("Microsoft.SignalRService/SignalR/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService/privateEndpointConnections/mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // SystemData: &armsignalr.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // }, - // Properties: &armsignalr.PrivateEndpointConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("signalr")}, - // PrivateEndpoint: &armsignalr.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armsignalr.PrivateLinkServiceConnectionState{ - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armsignalr.PrivateLinkServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armsignalr.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalRPrivateEndpointConnections_Get.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", "myResourceGroup", "mySignalRService", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armsignalr.PrivateEndpointConnection{ - // Name: to.Ptr("mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // Type: to.Ptr("Microsoft.SignalRService/SignalR/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService/privateEndpointConnections/mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // SystemData: &armsignalr.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // }, - // Properties: &armsignalr.PrivateEndpointConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("signalr")}, - // PrivateEndpoint: &armsignalr.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armsignalr.PrivateLinkServiceConnectionState{ - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armsignalr.PrivateLinkServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armsignalr.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalRPrivateEndpointConnections_Update.json -func ExamplePrivateEndpointConnectionsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().Update(ctx, "mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", "myResourceGroup", "mySignalRService", armsignalr.PrivateEndpointConnection{ - Properties: &armsignalr.PrivateEndpointConnectionProperties{ - PrivateEndpoint: &armsignalr.PrivateEndpoint{}, - PrivateLinkServiceConnectionState: &armsignalr.PrivateLinkServiceConnectionState{ - ActionsRequired: to.Ptr("None"), - Status: to.Ptr(armsignalr.PrivateLinkServiceConnectionStatusApproved), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armsignalr.PrivateEndpointConnection{ - // Name: to.Ptr("mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // Type: to.Ptr("Microsoft.SignalRService/SignalR/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService/privateEndpointConnections/mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // SystemData: &armsignalr.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // }, - // Properties: &armsignalr.PrivateEndpointConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("signalr")}, - // PrivateEndpoint: &armsignalr.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armsignalr.PrivateLinkServiceConnectionState{ - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armsignalr.PrivateLinkServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armsignalr.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalRPrivateEndpointConnections_Delete.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", "myResourceGroup", "mySignalRService", 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/signalr/armsignalr/privatelinkresources_client.go b/sdk/resourcemanager/signalr/armsignalr/privatelinkresources_client.go index d456e8fd4c10..65f50f58a96a 100644 --- a/sdk/resourcemanager/signalr/armsignalr/privatelinkresources_client.go +++ b/sdk/resourcemanager/signalr/armsignalr/privatelinkresources_client.go @@ -45,7 +45,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - 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 @@ -93,7 +93,7 @@ func (client *PrivateLinkResourcesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/signalr/armsignalr/privatelinkresources_client_example_test.go b/sdk/resourcemanager/signalr/armsignalr/privatelinkresources_client_example_test.go deleted file mode 100644 index 8484259461c1..000000000000 --- a/sdk/resourcemanager/signalr/armsignalr/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,83 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsignalr_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/signalr/armsignalr" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalRPrivateLinkResources_List.json -func ExamplePrivateLinkResourcesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateLinkResourcesClient().NewListPager("myResourceGroup", "mySignalRService", 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.PrivateLinkResourceList = armsignalr.PrivateLinkResourceList{ - // Value: []*armsignalr.PrivateLinkResource{ - // { - // Name: to.Ptr("myPrivateLink"), - // Type: to.Ptr("privateLinkResources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService/privateLinkResources/myPrivateLink"), - // Properties: &armsignalr.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("signalr"), - // RequiredMembers: []*string{ - // to.Ptr("signalr")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.service.signalr.net")}, - // ShareablePrivateLinkResourceTypes: []*armsignalr.ShareablePrivateLinkResourceType{ - // { - // Name: to.Ptr("site"), - // Properties: &armsignalr.ShareablePrivateLinkResourceProperties{ - // Type: to.Ptr("Microsoft.Web/sites"), - // Description: to.Ptr("Azure App Service can be used as an upstream"), - // GroupID: to.Ptr("sites"), - // }, - // }, - // { - // Name: to.Ptr("vault"), - // Properties: &armsignalr.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: &armsignalr.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/signalr/armsignalr/replicas_client.go b/sdk/resourcemanager/signalr/armsignalr/replicas_client.go index 8bea58845f38..8c0b6e1710c3 100644 --- a/sdk/resourcemanager/signalr/armsignalr/replicas_client.go +++ b/sdk/resourcemanager/signalr/armsignalr/replicas_client.go @@ -46,7 +46,7 @@ func NewReplicasClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Create or update a replica. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - replicaName - The name of the replica. @@ -74,7 +74,7 @@ func (client *ReplicasClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create or update a replica. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 func (client *ReplicasClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, parameters Replica, options *ReplicasClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ReplicasClient.BeginCreateOrUpdate" @@ -120,7 +120,7 @@ func (client *ReplicasClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -132,7 +132,7 @@ func (client *ReplicasClient) createOrUpdateCreateRequest(ctx context.Context, r // Delete - Operation to delete a replica. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - replicaName - The name of the replica. @@ -182,7 +182,7 @@ func (client *ReplicasClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,7 +191,7 @@ func (client *ReplicasClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get the replica and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - replicaName - The name of the replica. @@ -242,7 +242,7 @@ func (client *ReplicasClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -259,7 +259,7 @@ func (client *ReplicasClient) getHandleResponse(resp *http.Response) (ReplicasCl // NewListPager - List all replicas belong to this resource // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - 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. @@ -306,7 +306,7 @@ func (client *ReplicasClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -324,7 +324,7 @@ func (client *ReplicasClient) listHandleResponse(resp *http.Response) (ReplicasC // BeginRestart - Operation to restart a replica. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - replicaName - The name of the replica. @@ -350,7 +350,7 @@ func (client *ReplicasClient) BeginRestart(ctx context.Context, resourceGroupNam // Restart - Operation to restart a replica. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 func (client *ReplicasClient) restart(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, options *ReplicasClientBeginRestartOptions) (*http.Response, error) { var err error const operationName = "ReplicasClient.BeginRestart" @@ -396,7 +396,7 @@ func (client *ReplicasClient) restartCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -405,7 +405,7 @@ func (client *ReplicasClient) restartCreateRequest(ctx context.Context, resource // BeginUpdate - Operation to update an exiting replica. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - replicaName - The name of the replica. @@ -432,7 +432,7 @@ func (client *ReplicasClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Operation to update an exiting replica. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 func (client *ReplicasClient) update(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, parameters Replica, options *ReplicasClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ReplicasClient.BeginUpdate" @@ -478,7 +478,7 @@ func (client *ReplicasClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/signalr/armsignalr/replicas_client_example_test.go b/sdk/resourcemanager/signalr/armsignalr/replicas_client_example_test.go deleted file mode 100644 index 65bd2cccec33..000000000000 --- a/sdk/resourcemanager/signalr/armsignalr/replicas_client_example_test.go +++ /dev/null @@ -1,291 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsignalr_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/signalr/armsignalr" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalRReplicas_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 := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicasClient().NewListPager("myResourceGroup", "mySignalRService", 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 = armsignalr.ReplicaList{ - // Value: []*armsignalr.Replica{ - // { - // Name: to.Ptr("mySignalRService-eastus"), - // Type: to.Ptr("Microsoft.SignalRService/SignalR"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService/replicas/mySignalRService-eastus"), - // SystemData: &armsignalr.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Properties: &armsignalr.ReplicaProperties{ - // ProvisioningState: to.Ptr(armsignalr.ProvisioningStateSucceeded), - // RegionEndpointEnabled: to.Ptr("Enabled"), - // ResourceStopped: to.Ptr("false"), - // }, - // SKU: &armsignalr.ResourceSKU{ - // Name: to.Ptr("Premium_P1"), - // Capacity: to.Ptr[int32](1), - // Size: to.Ptr("P1"), - // Tier: to.Ptr(armsignalr.SignalRSKUTierPremium), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalRReplicas_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 := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReplicasClient().Get(ctx, "myResourceGroup", "mySignalRService", "mySignalRService-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 = armsignalr.Replica{ - // Name: to.Ptr("mySignalRService-eastus"), - // Type: to.Ptr("Microsoft.SignalRService/SignalR"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService/replicas/mySignalRService-eastus"), - // SystemData: &armsignalr.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Properties: &armsignalr.ReplicaProperties{ - // ProvisioningState: to.Ptr(armsignalr.ProvisioningStateSucceeded), - // RegionEndpointEnabled: to.Ptr("Enabled"), - // ResourceStopped: to.Ptr("false"), - // }, - // SKU: &armsignalr.ResourceSKU{ - // Name: to.Ptr("Premium_P1"), - // Capacity: to.Ptr[int32](1), - // Size: to.Ptr("P1"), - // Tier: to.Ptr(armsignalr.SignalRSKUTierPremium), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalRReplicas_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 := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicasClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "mySignalRService", "mySignalRService-eastus", armsignalr.Replica{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armsignalr.ReplicaProperties{ - ResourceStopped: to.Ptr("false"), - }, - SKU: &armsignalr.ResourceSKU{ - Name: to.Ptr("Premium_P1"), - Capacity: to.Ptr[int32](1), - Tier: to.Ptr(armsignalr.SignalRSKUTierPremium), - }, - }, 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 = armsignalr.Replica{ - // Name: to.Ptr("mySignalRService-eastus"), - // Type: to.Ptr("Microsoft.SignalRService/SignalR"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService/replicas/mySignalRService-eastus"), - // SystemData: &armsignalr.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Properties: &armsignalr.ReplicaProperties{ - // ProvisioningState: to.Ptr(armsignalr.ProvisioningStateSucceeded), - // RegionEndpointEnabled: to.Ptr("Enabled"), - // ResourceStopped: to.Ptr("false"), - // }, - // SKU: &armsignalr.ResourceSKU{ - // Name: to.Ptr("Premium_P1"), - // Capacity: to.Ptr[int32](1), - // Size: to.Ptr("P1"), - // Tier: to.Ptr(armsignalr.SignalRSKUTierPremium), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalRReplicas_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 := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewReplicasClient().Delete(ctx, "myResourceGroup", "mySignalRService", "mySignalRService-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/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalRReplicas_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 := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicasClient().BeginUpdate(ctx, "myResourceGroup", "mySignalRService", "mySignalRService-eastus", armsignalr.Replica{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armsignalr.ReplicaProperties{ - ResourceStopped: to.Ptr("false"), - }, - SKU: &armsignalr.ResourceSKU{ - Name: to.Ptr("Premium_P1"), - Capacity: to.Ptr[int32](1), - Tier: to.Ptr(armsignalr.SignalRSKUTierPremium), - }, - }, 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 = armsignalr.Replica{ - // Name: to.Ptr("mySignalRService-eastus"), - // Type: to.Ptr("Microsoft.SignalRService/SignalR"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService/replicas/mySignalRService-eastus"), - // SystemData: &armsignalr.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-02-03T04:05:06.000Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsignalr.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Properties: &armsignalr.ReplicaProperties{ - // ProvisioningState: to.Ptr(armsignalr.ProvisioningStateSucceeded), - // RegionEndpointEnabled: to.Ptr("Enabled"), - // ResourceStopped: to.Ptr("false"), - // }, - // SKU: &armsignalr.ResourceSKU{ - // Name: to.Ptr("Premium_P1"), - // Capacity: to.Ptr[int32](1), - // Size: to.Ptr("P1"), - // Tier: to.Ptr(armsignalr.SignalRSKUTierPremium), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalRReplicas_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 := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicasClient().BeginRestart(ctx, "myResourceGroup", "mySignalRService", "mySignalRService-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/signalr/armsignalr/replicasharedprivatelinkresources_client.go b/sdk/resourcemanager/signalr/armsignalr/replicasharedprivatelinkresources_client.go new file mode 100644 index 000000000000..1bc4cca8fd4f --- /dev/null +++ b/sdk/resourcemanager/signalr/armsignalr/replicasharedprivatelinkresources_client.go @@ -0,0 +1,280 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsignalr + +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" +) + +// ReplicaSharedPrivateLinkResourcesClient contains the methods for the SignalRReplicaSharedPrivateLinkResources group. +// Don't use this type directly, use NewReplicaSharedPrivateLinkResourcesClient() instead. +type ReplicaSharedPrivateLinkResourcesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewReplicaSharedPrivateLinkResourcesClient creates a new instance of ReplicaSharedPrivateLinkResourcesClient 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 NewReplicaSharedPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ReplicaSharedPrivateLinkResourcesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ReplicaSharedPrivateLinkResourcesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update a shared private link resource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-03-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the resource. +// - replicaName - The name of the replica. +// - sharedPrivateLinkResourceName - The name of the shared private link resource. +// - parameters - The shared private link resource +// - options - ReplicaSharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions contains the optional parameters for the ReplicaSharedPrivateLinkResourcesClient.BeginCreateOrUpdate +// method. +func (client *ReplicaSharedPrivateLinkResourcesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, sharedPrivateLinkResourceName string, parameters SharedPrivateLinkResource, options *ReplicaSharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ReplicaSharedPrivateLinkResourcesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, resourceName, replicaName, sharedPrivateLinkResourceName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ReplicaSharedPrivateLinkResourcesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ReplicaSharedPrivateLinkResourcesClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create or update a shared private link resource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-03-01 +func (client *ReplicaSharedPrivateLinkResourcesClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, sharedPrivateLinkResourceName string, parameters SharedPrivateLinkResource, options *ReplicaSharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "ReplicaSharedPrivateLinkResourcesClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, replicaName, sharedPrivateLinkResourceName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ReplicaSharedPrivateLinkResourcesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, sharedPrivateLinkResourceName string, parameters SharedPrivateLinkResource, options *ReplicaSharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName}/sharedPrivateLinkResources/{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") + } + 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)) + if sharedPrivateLinkResourceName == "" { + return nil, errors.New("parameter sharedPrivateLinkResourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sharedPrivateLinkResourceName}", url.PathEscape(sharedPrivateLinkResourceName)) + 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", "2024-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// Get - Get the specified shared private link resource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-03-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the resource. +// - replicaName - The name of the replica. +// - sharedPrivateLinkResourceName - The name of the shared private link resource. +// - options - ReplicaSharedPrivateLinkResourcesClientGetOptions contains the optional parameters for the ReplicaSharedPrivateLinkResourcesClient.Get +// method. +func (client *ReplicaSharedPrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, sharedPrivateLinkResourceName string, options *ReplicaSharedPrivateLinkResourcesClientGetOptions) (ReplicaSharedPrivateLinkResourcesClientGetResponse, error) { + var err error + const operationName = "ReplicaSharedPrivateLinkResourcesClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, replicaName, sharedPrivateLinkResourceName, options) + if err != nil { + return ReplicaSharedPrivateLinkResourcesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ReplicaSharedPrivateLinkResourcesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ReplicaSharedPrivateLinkResourcesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ReplicaSharedPrivateLinkResourcesClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, sharedPrivateLinkResourceName string, options *ReplicaSharedPrivateLinkResourcesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName}/sharedPrivateLinkResources/{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") + } + 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)) + if sharedPrivateLinkResourceName == "" { + return nil, errors.New("parameter sharedPrivateLinkResourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sharedPrivateLinkResourceName}", url.PathEscape(sharedPrivateLinkResourceName)) + 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", "2024-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ReplicaSharedPrivateLinkResourcesClient) getHandleResponse(resp *http.Response) (ReplicaSharedPrivateLinkResourcesClientGetResponse, error) { + result := ReplicaSharedPrivateLinkResourcesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SharedPrivateLinkResource); err != nil { + return ReplicaSharedPrivateLinkResourcesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List shared private link resources +// +// Generated from API version 2024-03-01 +// - 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 - ReplicaSharedPrivateLinkResourcesClientListOptions contains the optional parameters for the ReplicaSharedPrivateLinkResourcesClient.NewListPager +// method. +func (client *ReplicaSharedPrivateLinkResourcesClient) NewListPager(resourceGroupName string, resourceName string, replicaName string, options *ReplicaSharedPrivateLinkResourcesClientListOptions) *runtime.Pager[ReplicaSharedPrivateLinkResourcesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ReplicaSharedPrivateLinkResourcesClientListResponse]{ + More: func(page ReplicaSharedPrivateLinkResourcesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ReplicaSharedPrivateLinkResourcesClientListResponse) (ReplicaSharedPrivateLinkResourcesClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ReplicaSharedPrivateLinkResourcesClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, resourceName, replicaName, options) + }, nil) + if err != nil { + return ReplicaSharedPrivateLinkResourcesClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *ReplicaSharedPrivateLinkResourcesClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, options *ReplicaSharedPrivateLinkResourcesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName}/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") + } + 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", "2024-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ReplicaSharedPrivateLinkResourcesClient) listHandleResponse(resp *http.Response) (ReplicaSharedPrivateLinkResourcesClientListResponse, error) { + result := ReplicaSharedPrivateLinkResourcesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SharedPrivateLinkResourceList); err != nil { + return ReplicaSharedPrivateLinkResourcesClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/signalr/armsignalr/response_types.go b/sdk/resourcemanager/signalr/armsignalr/responses.go similarity index 90% rename from sdk/resourcemanager/signalr/armsignalr/response_types.go rename to sdk/resourcemanager/signalr/armsignalr/responses.go index 4076cc5243a5..da6ba056f2f1 100644 --- a/sdk/resourcemanager/signalr/armsignalr/response_types.go +++ b/sdk/resourcemanager/signalr/armsignalr/responses.go @@ -159,6 +159,24 @@ type PrivateLinkResourcesClientListResponse struct { PrivateLinkResourceList } +// ReplicaSharedPrivateLinkResourcesClientCreateOrUpdateResponse contains the response from method ReplicaSharedPrivateLinkResourcesClient.BeginCreateOrUpdate. +type ReplicaSharedPrivateLinkResourcesClientCreateOrUpdateResponse struct { + // Describes a Shared Private Link Resource + SharedPrivateLinkResource +} + +// ReplicaSharedPrivateLinkResourcesClientGetResponse contains the response from method ReplicaSharedPrivateLinkResourcesClient.Get. +type ReplicaSharedPrivateLinkResourcesClientGetResponse struct { + // Describes a Shared Private Link Resource + SharedPrivateLinkResource +} + +// ReplicaSharedPrivateLinkResourcesClientListResponse contains the response from method ReplicaSharedPrivateLinkResourcesClient.NewListPager. +type ReplicaSharedPrivateLinkResourcesClientListResponse struct { + // A list of shared private link resources + SharedPrivateLinkResourceList +} + // ReplicasClientCreateOrUpdateResponse contains the response from method ReplicasClient.BeginCreateOrUpdate. type ReplicasClientCreateOrUpdateResponse struct { // A class represent a replica resource. diff --git a/sdk/resourcemanager/signalr/armsignalr/sharedprivatelinkresources_client.go b/sdk/resourcemanager/signalr/armsignalr/sharedprivatelinkresources_client.go index 6eee0447fc86..cba86f52cf7d 100644 --- a/sdk/resourcemanager/signalr/armsignalr/sharedprivatelinkresources_client.go +++ b/sdk/resourcemanager/signalr/armsignalr/sharedprivatelinkresources_client.go @@ -46,8 +46,8 @@ 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-08-01-preview -// - sharedPrivateLinkResourceName - The name of the shared private link resource +// Generated from API version 2024-03-01 +// - sharedPrivateLinkResourceName - The name of the shared private link resource. // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - parameters - The shared private link resource @@ -74,7 +74,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-08-01-preview +// Generated from API version 2024-03-01 func (client *SharedPrivateLinkResourcesClient) createOrUpdate(ctx context.Context, sharedPrivateLinkResourceName string, resourceGroupName string, resourceName string, parameters SharedPrivateLinkResource, options *SharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "SharedPrivateLinkResourcesClient.BeginCreateOrUpdate" @@ -120,7 +120,7 @@ func (client *SharedPrivateLinkResourcesClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -132,8 +132,8 @@ 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-08-01-preview -// - sharedPrivateLinkResourceName - The name of the shared private link resource +// Generated from API version 2024-03-01 +// - sharedPrivateLinkResourceName - The name of the shared private link resource. // - 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 @@ -159,7 +159,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-08-01-preview +// Generated from API version 2024-03-01 func (client *SharedPrivateLinkResourcesClient) deleteOperation(ctx context.Context, sharedPrivateLinkResourceName string, resourceGroupName string, resourceName string, options *SharedPrivateLinkResourcesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SharedPrivateLinkResourcesClient.BeginDelete" @@ -205,7 +205,7 @@ func (client *SharedPrivateLinkResourcesClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,8 +214,8 @@ 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-08-01-preview -// - sharedPrivateLinkResourceName - The name of the shared private link resource +// Generated from API version 2024-03-01 +// - sharedPrivateLinkResourceName - The name of the shared private link resource. // - 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 @@ -266,7 +266,7 @@ func (client *SharedPrivateLinkResourcesClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +283,7 @@ func (client *SharedPrivateLinkResourcesClient) getHandleResponse(resp *http.Res // NewListPager - List shared private link resources // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - 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 @@ -331,7 +331,7 @@ func (client *SharedPrivateLinkResourcesClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/signalr/armsignalr/sharedprivatelinkresources_client_example_test.go b/sdk/resourcemanager/signalr/armsignalr/sharedprivatelinkresources_client_example_test.go deleted file mode 100644 index e329bbea54d6..000000000000 --- a/sdk/resourcemanager/signalr/armsignalr/sharedprivatelinkresources_client_example_test.go +++ /dev/null @@ -1,154 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsignalr_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/signalr/armsignalr" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalRSharedPrivateLinkResources_List.json -func ExampleSharedPrivateLinkResourcesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSharedPrivateLinkResourcesClient().NewListPager("myResourceGroup", "mySignalRService", 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.SharedPrivateLinkResourceList = armsignalr.SharedPrivateLinkResourceList{ - // Value: []*armsignalr.SharedPrivateLinkResource{ - // { - // Name: to.Ptr("upstream"), - // Type: to.Ptr("Microsoft.SignalRService/SignalR/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService/privateEndpointConnections/upstream"), - // Properties: &armsignalr.SharedPrivateLinkResourceProperties{ - // GroupID: to.Ptr("sites"), - // PrivateLinkResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Web/sites/myWebApp"), - // ProvisioningState: to.Ptr(armsignalr.ProvisioningStateSucceeded), - // RequestMessage: to.Ptr("Please approve"), - // Status: to.Ptr(armsignalr.SharedPrivateLinkResourceStatusApproved), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalRSharedPrivateLinkResources_Get.json -func ExampleSharedPrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSharedPrivateLinkResourcesClient().Get(ctx, "upstream", "myResourceGroup", "mySignalRService", 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.SharedPrivateLinkResource = armsignalr.SharedPrivateLinkResource{ - // Name: to.Ptr("upstream"), - // Type: to.Ptr("Microsoft.SignalRService/SignalR/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService/privateEndpointConnections/upstream"), - // Properties: &armsignalr.SharedPrivateLinkResourceProperties{ - // GroupID: to.Ptr("sites"), - // PrivateLinkResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Web/sites/myWebApp"), - // ProvisioningState: to.Ptr(armsignalr.ProvisioningStateSucceeded), - // RequestMessage: to.Ptr("Please approve"), - // Status: to.Ptr(armsignalr.SharedPrivateLinkResourceStatusApproved), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalRSharedPrivateLinkResources_CreateOrUpdate.json -func ExampleSharedPrivateLinkResourcesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSharedPrivateLinkResourcesClient().BeginCreateOrUpdate(ctx, "upstream", "myResourceGroup", "mySignalRService", armsignalr.SharedPrivateLinkResource{ - Properties: &armsignalr.SharedPrivateLinkResourceProperties{ - GroupID: to.Ptr("sites"), - PrivateLinkResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Web/sites/myWebApp"), - RequestMessage: to.Ptr("Please approve"), - }, - }, 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.SharedPrivateLinkResource = armsignalr.SharedPrivateLinkResource{ - // Name: to.Ptr("upstream"), - // Type: to.Ptr("Microsoft.SignalRService/SignalR/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService/privateEndpointConnections/upstream"), - // Properties: &armsignalr.SharedPrivateLinkResourceProperties{ - // GroupID: to.Ptr("sites"), - // PrivateLinkResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Web/sites/myWebApp"), - // ProvisioningState: to.Ptr(armsignalr.ProvisioningStateSucceeded), - // RequestMessage: to.Ptr("Please approve"), - // Status: to.Ptr(armsignalr.SharedPrivateLinkResourceStatusApproved), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/SignalRSharedPrivateLinkResources_Delete.json -func ExampleSharedPrivateLinkResourcesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSharedPrivateLinkResourcesClient().BeginDelete(ctx, "upstream", "myResourceGroup", "mySignalRService", 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/signalr/armsignalr/time_rfc3339.go b/sdk/resourcemanager/signalr/armsignalr/time_rfc3339.go index e2de6af4d0f5..15ec78418feb 100644 --- a/sdk/resourcemanager/signalr/armsignalr/time_rfc3339.go +++ b/sdk/resourcemanager/signalr/armsignalr/time_rfc3339.go @@ -19,12 +19,16 @@ import ( ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -40,17 +44,33 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +81,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -74,7 +98,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339 diff --git a/sdk/resourcemanager/signalr/armsignalr/usages_client.go b/sdk/resourcemanager/signalr/armsignalr/usages_client.go index f9eb5ece59fa..5855932eac69 100644 --- a/sdk/resourcemanager/signalr/armsignalr/usages_client.go +++ b/sdk/resourcemanager/signalr/armsignalr/usages_client.go @@ -45,7 +45,7 @@ func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, o // NewListPager - List resource usage quotas by location. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - 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] { @@ -87,7 +87,7 @@ func (client *UsagesClient) listCreateRequest(ctx context.Context, location stri return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/signalr/armsignalr/usages_client_example_test.go b/sdk/resourcemanager/signalr/armsignalr/usages_client_example_test.go deleted file mode 100644 index 9eaf8d8b88dd..000000000000 --- a/sdk/resourcemanager/signalr/armsignalr/usages_client_example_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsignalr_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/signalr/armsignalr" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/Usages_List.json -func ExampleUsagesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsignalr.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewUsagesClient().NewListPager("eastus", 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.UsageList = armsignalr.UsageList{ - // Value: []*armsignalr.Usage{ - // { - // Name: &armsignalr.UsageName{ - // LocalizedValue: to.Ptr("Usage1"), - // Value: to.Ptr("Usage1"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.SignalRService/locations/eastus/usages/Usage1"), - // Limit: to.Ptr[int64](100), - // Unit: to.Ptr("Count"), - // }, - // { - // Name: &armsignalr.UsageName{ - // LocalizedValue: to.Ptr("Usage2"), - // Value: to.Ptr("Usage2"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.SignalRService/locations/eastus/usages/Usage2"), - // Limit: to.Ptr[int64](100), - // Unit: to.Ptr("Count"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/CHANGELOG.md b/sdk/resourcemanager/webpubsub/armwebpubsub/CHANGELOG.md index 6f83c76516ab..45fd35efc813 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/CHANGELOG.md +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/CHANGELOG.md @@ -1,5 +1,35 @@ # Release History +## 1.3.0 (2024-05-23) +### 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.NewReplicaSharedPrivateLinkResourcesClient() *ReplicaSharedPrivateLinkResourcesClient` +- New function `*ClientFactory.NewReplicasClient() *ReplicasClient` +- New function `NewReplicaSharedPrivateLinkResourcesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ReplicaSharedPrivateLinkResourcesClient, error)` +- New function `*ReplicaSharedPrivateLinkResourcesClient.BeginCreateOrUpdate(context.Context, string, string, string, string, SharedPrivateLinkResource, *ReplicaSharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ReplicaSharedPrivateLinkResourcesClientCreateOrUpdateResponse], error)` +- New function `*ReplicaSharedPrivateLinkResourcesClient.Get(context.Context, string, string, string, string, *ReplicaSharedPrivateLinkResourcesClientGetOptions) (ReplicaSharedPrivateLinkResourcesClientGetResponse, error)` +- New function `*ReplicaSharedPrivateLinkResourcesClient.NewListPager(string, string, string, *ReplicaSharedPrivateLinkResourcesClientListOptions) *runtime.Pager[ReplicaSharedPrivateLinkResourcesClientListResponse]` +- 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 `IPRule` +- New struct `Replica` +- New struct `ReplicaList` +- New struct `ReplicaProperties` +- New struct `SocketIOSettings` +- New field `WebSocketKeepAliveIntervalInSeconds` in struct `HubProperties` +- New field `IPRules` in struct `NetworkACLs` +- New field `SystemData` in struct `PrivateLinkResource` +- New field `RegionEndpointEnabled`, `ResourceStopped`, `SocketIO` in struct `Properties` +- New field `Kind` in struct `ResourceInfo` + + ## 1.3.0-beta.1 (2023-11-30) ### Features Added diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/autorest.md b/sdk/resourcemanager/webpubsub/armwebpubsub/autorest.md index f09f9a303265..c33067195017 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/autorest.md +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/webpubsub/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/webpubsub/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.3.0-beta.1 -tag: package-2023-08-01-preview +module-version: 1.3.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/client.go b/sdk/resourcemanager/webpubsub/armwebpubsub/client.go index 98d448631e70..ae0114dedc34 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/client.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/client.go @@ -46,7 +46,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-08-01-preview +// Generated from API version 2024-03-01 // - location - the region // - parameters - Parameters supplied to the operation. // - options - ClientCheckNameAvailabilityOptions contains the optional parameters for the Client.CheckNameAvailability method. @@ -88,7 +88,7 @@ func (client *Client) checkNameAvailabilityCreateRequest(ctx context.Context, lo return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -109,7 +109,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - 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 @@ -135,7 +135,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-08-01-preview +// Generated from API version 2024-03-01 func (client *Client) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters ResourceInfo, options *ClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "Client.BeginCreateOrUpdate" @@ -177,7 +177,7 @@ func (client *Client) createOrUpdateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -189,7 +189,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - 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. @@ -214,7 +214,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-08-01-preview +// Generated from API version 2024-03-01 func (client *Client) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, options *ClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "Client.BeginDelete" @@ -256,7 +256,7 @@ func (client *Client) deleteCreateRequest(ctx context.Context, resourceGroupName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -265,7 +265,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - 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. @@ -311,7 +311,7 @@ func (client *Client) getCreateRequest(ctx context.Context, resourceGroupName st return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -328,7 +328,7 @@ func (client *Client) getHandleResponse(resp *http.Response) (ClientGetResponse, // NewListByResourceGroupPager - Handles requests to list all resources in a resource group. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ClientListByResourceGroupOptions contains the optional parameters for the Client.NewListByResourceGroupPager // method. @@ -371,7 +371,7 @@ func (client *Client) listByResourceGroupCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -388,7 +388,7 @@ func (client *Client) listByResourceGroupHandleResponse(resp *http.Response) (Cl // NewListBySubscriptionPager - Handles requests to list all resources in a subscription. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - 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]{ @@ -425,7 +425,7 @@ func (client *Client) listBySubscriptionCreateRequest(ctx context.Context, optio return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -443,7 +443,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - 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. @@ -489,7 +489,7 @@ func (client *Client) listKeysCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -507,7 +507,7 @@ func (client *Client) listKeysHandleResponse(resp *http.Response) (ClientListKey // ListReplicaSKUs - List all available skus of the replica resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - replicaName - The name of the replica. @@ -558,7 +558,7 @@ func (client *Client) listReplicaSKUsCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -576,7 +576,7 @@ func (client *Client) listReplicaSKUsHandleResponse(resp *http.Response) (Client // ListSKUs - List all available skus of the resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - 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. @@ -622,7 +622,7 @@ func (client *Client) listSKUsCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -641,7 +641,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - 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. @@ -668,7 +668,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-08-01-preview +// Generated from API version 2024-03-01 func (client *Client) regenerateKey(ctx context.Context, resourceGroupName string, resourceName string, parameters RegenerateKeyParameters, options *ClientBeginRegenerateKeyOptions) (*http.Response, error) { var err error const operationName = "Client.BeginRegenerateKey" @@ -710,7 +710,7 @@ func (client *Client) regenerateKeyCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -722,7 +722,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - 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. @@ -747,7 +747,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-08-01-preview +// Generated from API version 2024-03-01 func (client *Client) restart(ctx context.Context, resourceGroupName string, resourceName string, options *ClientBeginRestartOptions) (*http.Response, error) { var err error const operationName = "Client.BeginRestart" @@ -789,7 +789,7 @@ func (client *Client) restartCreateRequest(ctx context.Context, resourceGroupNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -798,7 +798,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - parameters - Parameters for the update operation @@ -824,7 +824,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-08-01-preview +// Generated from API version 2024-03-01 func (client *Client) update(ctx context.Context, resourceGroupName string, resourceName string, parameters ResourceInfo, options *ClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "Client.BeginUpdate" @@ -866,7 +866,7 @@ func (client *Client) updateCreateRequest(ctx context.Context, resourceGroupName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/client_example_test.go b/sdk/resourcemanager/webpubsub/armwebpubsub/client_example_test.go deleted file mode 100644 index f90c38fb8810..000000000000 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/client_example_test.go +++ /dev/null @@ -1,1107 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSub_CheckNameAvailability.json -func ExampleClient_CheckNameAvailability() { - 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().CheckNameAvailability(ctx, "eastus", armwebpubsub.NameAvailabilityParameters{ - Name: to.Ptr("myWebPubSubService"), - Type: to.Ptr("Microsoft.SignalRService/WebPubSub"), - }, 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.NameAvailability = armwebpubsub.NameAvailability{ - // Message: to.Ptr("The name is already taken. Please try a different name."), - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr("AlreadyExists"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSub_ListBySubscription.json -func ExampleClient_NewListBySubscriptionPager() { - 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.NewClient().NewListBySubscriptionPager(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.ResourceInfoList = armwebpubsub.ResourceInfoList{ - // Value: []*armwebpubsub.ResourceInfo{ - // { - // 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:06.000Z"); 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:06.000Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Identity: &armwebpubsub.ManagedIdentity{ - // Type: to.Ptr(armwebpubsub.ManagedIdentityTypeSystemAssigned), - // 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), - // ExternalIP: to.Ptr("10.0.0.1"), - // HostName: to.Ptr("mywebpubsubservice.webpubsub.azure.com"), - // LiveTraceConfiguration: &armwebpubsub.LiveTraceConfiguration{ - // Categories: []*armwebpubsub.LiveTraceCategory{ - // { - // Name: to.Ptr("ConnectivityLogs"), - // Enabled: to.Ptr("true"), - // }}, - // Enabled: to.Ptr("false"), - // }, - // NetworkACLs: &armwebpubsub.NetworkACLs{ - // DefaultAction: to.Ptr(armwebpubsub.ACLActionDeny), - // IPRules: []*armwebpubsub.IPRule{ - // { - // Action: to.Ptr(armwebpubsub.ACLActionAllow), - // Value: to.Ptr("123.456.789.123/24"), - // }, - // { - // Action: to.Ptr(armwebpubsub.ACLActionAllow), - // Value: to.Ptr("123.456.789.123"), - // }, - // { - // Action: to.Ptr(armwebpubsub.ACLActionAllow), - // Value: to.Ptr("AppService"), - // }}, - // PrivateEndpoints: []*armwebpubsub.PrivateEndpointACL{ - // { - // Allow: []*armwebpubsub.WebPubSubRequestType{ - // to.Ptr(armwebpubsub.WebPubSubRequestTypeServerConnection)}, - // Name: to.Ptr("mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // }}, - // PublicNetwork: &armwebpubsub.NetworkACL{ - // Allow: []*armwebpubsub.WebPubSubRequestType{ - // to.Ptr(armwebpubsub.WebPubSubRequestTypeClientConnection)}, - // }, - // }, - // PrivateEndpointConnections: []*armwebpubsub.PrivateEndpointConnection{ - // { - // 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:06.000Z"); 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:06.000Z"); 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"), - // }, - // PrivateLinkServiceConnectionState: &armwebpubsub.PrivateLinkServiceConnectionState{ - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armwebpubsub.PrivateLinkServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr("Enabled"), - // PublicPort: to.Ptr[int32](443), - // RegionEndpointEnabled: to.Ptr("Enabled"), - // ResourceLogConfiguration: &armwebpubsub.ResourceLogConfiguration{ - // Categories: []*armwebpubsub.ResourceLogCategory{ - // { - // Name: to.Ptr("ConnectivityLogs"), - // Enabled: to.Ptr("true"), - // }}, - // }, - // ResourceStopped: to.Ptr("false"), - // ServerPort: to.Ptr[int32](443), - // TLS: &armwebpubsub.TLSSettings{ - // ClientCertEnabled: to.Ptr(true), - // }, - // Version: to.Ptr("1.0"), - // }, - // 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/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSub_ListByResourceGroup.json -func ExampleClient_NewListByResourceGroupPager() { - 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.NewClient().NewListByResourceGroupPager("myResourceGroup", 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.ResourceInfoList = armwebpubsub.ResourceInfoList{ - // Value: []*armwebpubsub.ResourceInfo{ - // { - // 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:06.000Z"); 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:06.000Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Identity: &armwebpubsub.ManagedIdentity{ - // Type: to.Ptr(armwebpubsub.ManagedIdentityTypeSystemAssigned), - // 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), - // ExternalIP: to.Ptr("10.0.0.1"), - // HostName: to.Ptr("mywebpubsubservice.webpubsub.azure.com"), - // LiveTraceConfiguration: &armwebpubsub.LiveTraceConfiguration{ - // Categories: []*armwebpubsub.LiveTraceCategory{ - // { - // Name: to.Ptr("ConnectivityLogs"), - // Enabled: to.Ptr("true"), - // }}, - // Enabled: to.Ptr("false"), - // }, - // NetworkACLs: &armwebpubsub.NetworkACLs{ - // DefaultAction: to.Ptr(armwebpubsub.ACLActionDeny), - // IPRules: []*armwebpubsub.IPRule{ - // { - // Action: to.Ptr(armwebpubsub.ACLActionAllow), - // Value: to.Ptr("123.456.789.123/24"), - // }, - // { - // Action: to.Ptr(armwebpubsub.ACLActionAllow), - // Value: to.Ptr("123.456.789.123"), - // }, - // { - // Action: to.Ptr(armwebpubsub.ACLActionAllow), - // Value: to.Ptr("AppService"), - // }}, - // PrivateEndpoints: []*armwebpubsub.PrivateEndpointACL{ - // { - // Allow: []*armwebpubsub.WebPubSubRequestType{ - // to.Ptr(armwebpubsub.WebPubSubRequestTypeServerConnection)}, - // Name: to.Ptr("mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // }}, - // PublicNetwork: &armwebpubsub.NetworkACL{ - // Allow: []*armwebpubsub.WebPubSubRequestType{ - // to.Ptr(armwebpubsub.WebPubSubRequestTypeClientConnection)}, - // }, - // }, - // PrivateEndpointConnections: []*armwebpubsub.PrivateEndpointConnection{ - // { - // 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:06.000Z"); 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:06.000Z"); 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"), - // }, - // PrivateLinkServiceConnectionState: &armwebpubsub.PrivateLinkServiceConnectionState{ - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armwebpubsub.PrivateLinkServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr("Enabled"), - // PublicPort: to.Ptr[int32](443), - // RegionEndpointEnabled: to.Ptr("Enabled"), - // ResourceLogConfiguration: &armwebpubsub.ResourceLogConfiguration{ - // Categories: []*armwebpubsub.ResourceLogCategory{ - // { - // Name: to.Ptr("ConnectivityLogs"), - // Enabled: to.Ptr("true"), - // }}, - // }, - // ResourceStopped: to.Ptr("false"), - // ServerPort: to.Ptr[int32](443), - // TLS: &armwebpubsub.TLSSettings{ - // ClientCertEnabled: to.Ptr(true), - // }, - // Version: to.Ptr("1.0"), - // }, - // 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/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSub_Get.json -func ExampleClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armwebpubsub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().Get(ctx, "myResourceGroup", "myWebPubSubService", 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.ResourceInfo = armwebpubsub.ResourceInfo{ - // 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:06.000Z"); 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:06.000Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Identity: &armwebpubsub.ManagedIdentity{ - // Type: to.Ptr(armwebpubsub.ManagedIdentityTypeSystemAssigned), - // 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), - // ExternalIP: to.Ptr("10.0.0.1"), - // HostName: to.Ptr("mywebpubsubservice.webpubsub.azure.com"), - // LiveTraceConfiguration: &armwebpubsub.LiveTraceConfiguration{ - // Categories: []*armwebpubsub.LiveTraceCategory{ - // { - // Name: to.Ptr("ConnectivityLogs"), - // Enabled: to.Ptr("true"), - // }}, - // Enabled: to.Ptr("false"), - // }, - // NetworkACLs: &armwebpubsub.NetworkACLs{ - // DefaultAction: to.Ptr(armwebpubsub.ACLActionDeny), - // IPRules: []*armwebpubsub.IPRule{ - // { - // Action: to.Ptr(armwebpubsub.ACLActionAllow), - // Value: to.Ptr("123.456.789.123/24"), - // }, - // { - // Action: to.Ptr(armwebpubsub.ACLActionAllow), - // Value: to.Ptr("123.456.789.123"), - // }, - // { - // Action: to.Ptr(armwebpubsub.ACLActionAllow), - // Value: to.Ptr("AppService"), - // }}, - // PrivateEndpoints: []*armwebpubsub.PrivateEndpointACL{ - // { - // Allow: []*armwebpubsub.WebPubSubRequestType{ - // to.Ptr(armwebpubsub.WebPubSubRequestTypeServerConnection)}, - // Name: to.Ptr("mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // }}, - // PublicNetwork: &armwebpubsub.NetworkACL{ - // Allow: []*armwebpubsub.WebPubSubRequestType{ - // to.Ptr(armwebpubsub.WebPubSubRequestTypeClientConnection)}, - // }, - // }, - // PrivateEndpointConnections: []*armwebpubsub.PrivateEndpointConnection{ - // { - // 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:06.000Z"); 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:06.000Z"); 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"), - // }, - // PrivateLinkServiceConnectionState: &armwebpubsub.PrivateLinkServiceConnectionState{ - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armwebpubsub.PrivateLinkServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr("Enabled"), - // PublicPort: to.Ptr[int32](443), - // RegionEndpointEnabled: to.Ptr("Enabled"), - // ResourceLogConfiguration: &armwebpubsub.ResourceLogConfiguration{ - // Categories: []*armwebpubsub.ResourceLogCategory{ - // { - // Name: to.Ptr("ConnectivityLogs"), - // Enabled: to.Ptr("true"), - // }}, - // }, - // ResourceStopped: to.Ptr("false"), - // ServerPort: to.Ptr[int32](443), - // TLS: &armwebpubsub.TLSSettings{ - // ClientCertEnabled: to.Ptr(true), - // }, - // Version: to.Ptr("1.0"), - // }, - // 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/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSub_CreateOrUpdate.json -func ExampleClient_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.NewClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myWebPubSubService", armwebpubsub.ResourceInfo{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Identity: &armwebpubsub.ManagedIdentity{ - Type: to.Ptr(armwebpubsub.ManagedIdentityTypeSystemAssigned), - }, - Kind: to.Ptr(armwebpubsub.ServiceKindWebPubSub), - Properties: &armwebpubsub.Properties{ - DisableAADAuth: to.Ptr(false), - DisableLocalAuth: to.Ptr(false), - LiveTraceConfiguration: &armwebpubsub.LiveTraceConfiguration{ - Categories: []*armwebpubsub.LiveTraceCategory{ - { - Name: to.Ptr("ConnectivityLogs"), - Enabled: to.Ptr("true"), - }}, - Enabled: to.Ptr("false"), - }, - NetworkACLs: &armwebpubsub.NetworkACLs{ - DefaultAction: to.Ptr(armwebpubsub.ACLActionDeny), - PrivateEndpoints: []*armwebpubsub.PrivateEndpointACL{ - { - Allow: []*armwebpubsub.WebPubSubRequestType{ - to.Ptr(armwebpubsub.WebPubSubRequestTypeServerConnection)}, - Name: to.Ptr("mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - }}, - PublicNetwork: &armwebpubsub.NetworkACL{ - Allow: []*armwebpubsub.WebPubSubRequestType{ - to.Ptr(armwebpubsub.WebPubSubRequestTypeClientConnection)}, - }, - }, - PublicNetworkAccess: to.Ptr("Enabled"), - TLS: &armwebpubsub.TLSSettings{ - ClientCertEnabled: to.Ptr(false), - }, - }, - 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.ResourceInfo = armwebpubsub.ResourceInfo{ - // 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:06.000Z"); 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:06.000Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Identity: &armwebpubsub.ManagedIdentity{ - // Type: to.Ptr(armwebpubsub.ManagedIdentityTypeSystemAssigned), - // 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), - // ExternalIP: to.Ptr("10.0.0.1"), - // HostName: to.Ptr("mywebpubsubservice.webpubsub.azure.com"), - // LiveTraceConfiguration: &armwebpubsub.LiveTraceConfiguration{ - // Categories: []*armwebpubsub.LiveTraceCategory{ - // { - // Name: to.Ptr("ConnectivityLogs"), - // Enabled: to.Ptr("true"), - // }}, - // Enabled: to.Ptr("false"), - // }, - // NetworkACLs: &armwebpubsub.NetworkACLs{ - // DefaultAction: to.Ptr(armwebpubsub.ACLActionDeny), - // IPRules: []*armwebpubsub.IPRule{ - // { - // Action: to.Ptr(armwebpubsub.ACLActionAllow), - // Value: to.Ptr("123.456.789.123/24"), - // }, - // { - // Action: to.Ptr(armwebpubsub.ACLActionAllow), - // Value: to.Ptr("123.456.789.123"), - // }, - // { - // Action: to.Ptr(armwebpubsub.ACLActionAllow), - // Value: to.Ptr("AppService"), - // }}, - // PrivateEndpoints: []*armwebpubsub.PrivateEndpointACL{ - // { - // Allow: []*armwebpubsub.WebPubSubRequestType{ - // to.Ptr(armwebpubsub.WebPubSubRequestTypeServerConnection)}, - // Name: to.Ptr("mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // }}, - // PublicNetwork: &armwebpubsub.NetworkACL{ - // Allow: []*armwebpubsub.WebPubSubRequestType{ - // to.Ptr(armwebpubsub.WebPubSubRequestTypeClientConnection)}, - // }, - // }, - // PrivateEndpointConnections: []*armwebpubsub.PrivateEndpointConnection{ - // { - // 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:06.000Z"); 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:06.000Z"); 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"), - // }, - // PrivateLinkServiceConnectionState: &armwebpubsub.PrivateLinkServiceConnectionState{ - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armwebpubsub.PrivateLinkServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr("Enabled"), - // PublicPort: to.Ptr[int32](443), - // RegionEndpointEnabled: to.Ptr("Enabled"), - // ResourceLogConfiguration: &armwebpubsub.ResourceLogConfiguration{ - // Categories: []*armwebpubsub.ResourceLogCategory{ - // { - // Name: to.Ptr("ConnectivityLogs"), - // Enabled: to.Ptr("true"), - // }}, - // }, - // ResourceStopped: to.Ptr("false"), - // ServerPort: to.Ptr[int32](443), - // TLS: &armwebpubsub.TLSSettings{ - // ClientCertEnabled: to.Ptr(true), - // }, - // Version: to.Ptr("1.0"), - // }, - // 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/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSub_Delete.json -func ExampleClient_BeginDelete() { - 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.NewClient().BeginDelete(ctx, "myResourceGroup", "myWebPubSubService", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSub_Update.json -func ExampleClient_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.NewClient().BeginUpdate(ctx, "myResourceGroup", "myWebPubSubService", armwebpubsub.ResourceInfo{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Identity: &armwebpubsub.ManagedIdentity{ - Type: to.Ptr(armwebpubsub.ManagedIdentityTypeSystemAssigned), - }, - Kind: to.Ptr(armwebpubsub.ServiceKindWebPubSub), - Properties: &armwebpubsub.Properties{ - DisableAADAuth: to.Ptr(false), - DisableLocalAuth: to.Ptr(false), - LiveTraceConfiguration: &armwebpubsub.LiveTraceConfiguration{ - Categories: []*armwebpubsub.LiveTraceCategory{ - { - Name: to.Ptr("ConnectivityLogs"), - Enabled: to.Ptr("true"), - }}, - Enabled: to.Ptr("false"), - }, - NetworkACLs: &armwebpubsub.NetworkACLs{ - DefaultAction: to.Ptr(armwebpubsub.ACLActionDeny), - PrivateEndpoints: []*armwebpubsub.PrivateEndpointACL{ - { - Allow: []*armwebpubsub.WebPubSubRequestType{ - to.Ptr(armwebpubsub.WebPubSubRequestTypeServerConnection)}, - Name: to.Ptr("mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - }}, - PublicNetwork: &armwebpubsub.NetworkACL{ - Allow: []*armwebpubsub.WebPubSubRequestType{ - to.Ptr(armwebpubsub.WebPubSubRequestTypeClientConnection)}, - }, - }, - PublicNetworkAccess: to.Ptr("Enabled"), - TLS: &armwebpubsub.TLSSettings{ - ClientCertEnabled: to.Ptr(false), - }, - }, - 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.ResourceInfo = armwebpubsub.ResourceInfo{ - // 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:06.000Z"); 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:06.000Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Identity: &armwebpubsub.ManagedIdentity{ - // Type: to.Ptr(armwebpubsub.ManagedIdentityTypeSystemAssigned), - // 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), - // ExternalIP: to.Ptr("10.0.0.1"), - // HostName: to.Ptr("mywebpubsubservice.webpubsub.azure.com"), - // LiveTraceConfiguration: &armwebpubsub.LiveTraceConfiguration{ - // Categories: []*armwebpubsub.LiveTraceCategory{ - // { - // Name: to.Ptr("ConnectivityLogs"), - // Enabled: to.Ptr("true"), - // }}, - // Enabled: to.Ptr("false"), - // }, - // NetworkACLs: &armwebpubsub.NetworkACLs{ - // DefaultAction: to.Ptr(armwebpubsub.ACLActionDeny), - // IPRules: []*armwebpubsub.IPRule{ - // { - // Action: to.Ptr(armwebpubsub.ACLActionAllow), - // Value: to.Ptr("123.456.789.123/24"), - // }, - // { - // Action: to.Ptr(armwebpubsub.ACLActionAllow), - // Value: to.Ptr("123.456.789.123"), - // }, - // { - // Action: to.Ptr(armwebpubsub.ACLActionAllow), - // Value: to.Ptr("AppService"), - // }}, - // PrivateEndpoints: []*armwebpubsub.PrivateEndpointACL{ - // { - // Allow: []*armwebpubsub.WebPubSubRequestType{ - // to.Ptr(armwebpubsub.WebPubSubRequestTypeServerConnection)}, - // Name: to.Ptr("mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e"), - // }}, - // PublicNetwork: &armwebpubsub.NetworkACL{ - // Allow: []*armwebpubsub.WebPubSubRequestType{ - // to.Ptr(armwebpubsub.WebPubSubRequestTypeClientConnection)}, - // }, - // }, - // PrivateEndpointConnections: []*armwebpubsub.PrivateEndpointConnection{ - // { - // 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:06.000Z"); 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:06.000Z"); 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"), - // }, - // PrivateLinkServiceConnectionState: &armwebpubsub.PrivateLinkServiceConnectionState{ - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armwebpubsub.PrivateLinkServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr("Enabled"), - // PublicPort: to.Ptr[int32](443), - // RegionEndpointEnabled: to.Ptr("Enabled"), - // ResourceLogConfiguration: &armwebpubsub.ResourceLogConfiguration{ - // Categories: []*armwebpubsub.ResourceLogCategory{ - // { - // Name: to.Ptr("ConnectivityLogs"), - // Enabled: to.Ptr("true"), - // }}, - // }, - // ResourceStopped: to.Ptr("false"), - // ServerPort: to.Ptr[int32](443), - // TLS: &armwebpubsub.TLSSettings{ - // ClientCertEnabled: to.Ptr(true), - // }, - // Version: to.Ptr("1.0"), - // }, - // 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/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSub_ListKeys.json -func ExampleClient_ListKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armwebpubsub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().ListKeys(ctx, "myResourceGroup", "myWebPubSubService", 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.Keys = armwebpubsub.Keys{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSub_RegenerateKey.json -func ExampleClient_BeginRegenerateKey() { - 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.NewClient().BeginRegenerateKey(ctx, "myResourceGroup", "myWebPubSubService", armwebpubsub.RegenerateKeyParameters{ - KeyType: to.Ptr(armwebpubsub.KeyTypePrimary), - }, 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.Keys = armwebpubsub.Keys{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-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/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSub_Restart.json -func ExampleClient_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.NewClient().BeginRestart(ctx, "myResourceGroup", "myWebPubSubService", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSub_ListSkus.json -func ExampleClient_ListSKUs() { - 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().ListSKUs(ctx, "myResourceGroup", "myWebPubSubService", 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"), - // 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"), - // 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 c4a9c7117c83..663b190c2b39 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/client_factory.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/client_factory.go @@ -17,8 +17,7 @@ import ( // Don't use this type directly, use NewClientFactory instead. type ClientFactory struct { subscriptionID string - credential azcore.TokenCredential - options *arm.ClientOptions + internal *arm.Client } // NewClientFactory creates a new instance of ClientFactory with the specified values. @@ -27,72 +26,99 @@ type ClientFactory struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { - _, err := arm.NewClient(moduleName, moduleVersion, credential, options) + internal, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } return &ClientFactory{ - subscriptionID: subscriptionID, credential: credential, - options: options.Clone(), + subscriptionID: subscriptionID, + internal: internal, }, nil } // NewClient creates a new instance of Client. func (c *ClientFactory) NewClient() *Client { - subClient, _ := NewClient(c.subscriptionID, c.credential, c.options) - return subClient + return &Client{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewCustomCertificatesClient creates a new instance of CustomCertificatesClient. func (c *ClientFactory) NewCustomCertificatesClient() *CustomCertificatesClient { - subClient, _ := NewCustomCertificatesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &CustomCertificatesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewCustomDomainsClient creates a new instance of CustomDomainsClient. func (c *ClientFactory) NewCustomDomainsClient() *CustomDomainsClient { - subClient, _ := NewCustomDomainsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &CustomDomainsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewHubsClient creates a new instance of HubsClient. func (c *ClientFactory) NewHubsClient() *HubsClient { - subClient, _ := NewHubsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &HubsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewOperationsClient creates a new instance of OperationsClient. func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) - return subClient + return &OperationsClient{ + internal: c.internal, + } } // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient. func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient { - subClient, _ := NewPrivateEndpointConnectionsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &PrivateEndpointConnectionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient. func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient { - subClient, _ := NewPrivateLinkResourcesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &PrivateLinkResourcesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewReplicaSharedPrivateLinkResourcesClient creates a new instance of ReplicaSharedPrivateLinkResourcesClient. +func (c *ClientFactory) NewReplicaSharedPrivateLinkResourcesClient() *ReplicaSharedPrivateLinkResourcesClient { + return &ReplicaSharedPrivateLinkResourcesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewReplicasClient creates a new instance of ReplicasClient. func (c *ClientFactory) NewReplicasClient() *ReplicasClient { - subClient, _ := NewReplicasClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ReplicasClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewSharedPrivateLinkResourcesClient creates a new instance of SharedPrivateLinkResourcesClient. func (c *ClientFactory) NewSharedPrivateLinkResourcesClient() *SharedPrivateLinkResourcesClient { - subClient, _ := NewSharedPrivateLinkResourcesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &SharedPrivateLinkResourcesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewUsagesClient creates a new instance of UsagesClient. func (c *ClientFactory) NewUsagesClient() *UsagesClient { - subClient, _ := NewUsagesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &UsagesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/constants.go b/sdk/resourcemanager/webpubsub/armwebpubsub/constants.go index 2d3e2a43ec0e..0a6165d56ea3 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/constants.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/constants.go @@ -10,7 +10,7 @@ package armwebpubsub const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/webpubsub/armwebpubsub" - moduleVersion = "v1.3.0-beta.1" + moduleVersion = "v1.3.0" ) // ACLAction - Azure Networking ACL Action. diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/customcertificates_client.go b/sdk/resourcemanager/webpubsub/armwebpubsub/customcertificates_client.go index fe1954564d12..7d08d21b531b 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/customcertificates_client.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/customcertificates_client.go @@ -46,7 +46,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - certificateName - Custom certificate name @@ -73,7 +73,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-08-01-preview +// Generated from API version 2024-03-01 func (client *CustomCertificatesClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, certificateName string, parameters CustomCertificate, options *CustomCertificatesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "CustomCertificatesClient.BeginCreateOrUpdate" @@ -119,7 +119,7 @@ func (client *CustomCertificatesClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -131,7 +131,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - certificateName - Custom certificate name @@ -182,7 +182,7 @@ func (client *CustomCertificatesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,7 +191,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - certificateName - Custom certificate name @@ -242,7 +242,7 @@ func (client *CustomCertificatesClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -259,7 +259,7 @@ func (client *CustomCertificatesClient) getHandleResponse(resp *http.Response) ( // NewListPager - List all custom certificates. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - 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 @@ -307,7 +307,7 @@ func (client *CustomCertificatesClient) listCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") 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 deleted file mode 100644 index 270fd9ed9e81..000000000000 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/customcertificates_client_example_test.go +++ /dev/null @@ -1,147 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSubCustomCertificates_List.json -func ExampleCustomCertificatesClient_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.NewCustomCertificatesClient().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.CustomCertificateList = armwebpubsub.CustomCertificateList{ - // Value: []*armwebpubsub.CustomCertificate{ - // { - // Name: to.Ptr("myCert"), - // Type: to.Ptr("Microsoft.SignalRService/WebPubSub/customCertificates"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/customCertificates/myCert"), - // Properties: &armwebpubsub.CustomCertificateProperties{ - // KeyVaultBaseURI: to.Ptr("https://myvault.keyvault.azure.net/"), - // KeyVaultSecretName: to.Ptr("mycert"), - // KeyVaultSecretVersion: to.Ptr("bb6a44b2743f47f68dad0d6cc9756432"), - // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSubCustomCertificates_Get.json -func ExampleCustomCertificatesClient_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.NewCustomCertificatesClient().Get(ctx, "myResourceGroup", "myWebPubSubService", "myCert", 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.CustomCertificate = armwebpubsub.CustomCertificate{ - // Name: to.Ptr("myCert"), - // Type: to.Ptr("Microsoft.SignalRService/WebPubSub/customCertificates"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/customCertificates/myCert"), - // Properties: &armwebpubsub.CustomCertificateProperties{ - // KeyVaultBaseURI: to.Ptr("https://myvault.keyvault.azure.net/"), - // KeyVaultSecretName: to.Ptr("mycert"), - // KeyVaultSecretVersion: to.Ptr("bb6a44b2743f47f68dad0d6cc9756432"), - // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSubCustomCertificates_CreateOrUpdate.json -func ExampleCustomCertificatesClient_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.NewCustomCertificatesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myWebPubSubService", "myCert", armwebpubsub.CustomCertificate{ - Properties: &armwebpubsub.CustomCertificateProperties{ - KeyVaultBaseURI: to.Ptr("https://myvault.keyvault.azure.net/"), - KeyVaultSecretName: to.Ptr("mycert"), - KeyVaultSecretVersion: to.Ptr("bb6a44b2743f47f68dad0d6cc9756432"), - }, - }, 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.CustomCertificate = armwebpubsub.CustomCertificate{ - // Name: to.Ptr("myCert"), - // Type: to.Ptr("Microsoft.SignalRService/WebPubSub/customCertificates"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/customCertificates/myCert"), - // Properties: &armwebpubsub.CustomCertificateProperties{ - // KeyVaultBaseURI: to.Ptr("https://myvault.keyvault.azure.net/"), - // KeyVaultSecretName: to.Ptr("mycert"), - // KeyVaultSecretVersion: to.Ptr("bb6a44b2743f47f68dad0d6cc9756432"), - // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSubCustomCertificates_Delete.json -func ExampleCustomCertificatesClient_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.NewCustomCertificatesClient().Delete(ctx, "myResourceGroup", "myWebPubSubService", "myCert", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/customdomains_client.go b/sdk/resourcemanager/webpubsub/armwebpubsub/customdomains_client.go index 0da420194967..ec03454f02f1 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/customdomains_client.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/customdomains_client.go @@ -46,7 +46,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - name - Custom domain name. @@ -73,7 +73,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-08-01-preview +// Generated from API version 2024-03-01 func (client *CustomDomainsClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, name string, parameters CustomDomain, options *CustomDomainsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "CustomDomainsClient.BeginCreateOrUpdate" @@ -119,7 +119,7 @@ func (client *CustomDomainsClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -131,7 +131,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - name - Custom domain name. @@ -158,7 +158,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-08-01-preview +// Generated from API version 2024-03-01 func (client *CustomDomainsClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, name string, options *CustomDomainsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "CustomDomainsClient.BeginDelete" @@ -204,7 +204,7 @@ func (client *CustomDomainsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -213,7 +213,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - name - Custom domain name. @@ -264,7 +264,7 @@ func (client *CustomDomainsClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,7 +281,7 @@ func (client *CustomDomainsClient) getHandleResponse(resp *http.Response) (Custo // NewListPager - List all custom domains. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - 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. @@ -328,7 +328,7 @@ func (client *CustomDomainsClient) listCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") 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 deleted file mode 100644 index 32106f13bb94..000000000000 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/customdomains_client_example_test.go +++ /dev/null @@ -1,138 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSubCustomDomains_List.json -func ExampleCustomDomainsClient_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.NewCustomDomainsClient().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.CustomDomainList = armwebpubsub.CustomDomainList{ - // Value: []*armwebpubsub.CustomDomain{ - // { - // Name: to.Ptr("myDomain"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/customDomains/myDomain"), - // Properties: &armwebpubsub.CustomDomainProperties{ - // CustomCertificate: &armwebpubsub.ResourceReference{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/customCertificates/myCert"), - // }, - // DomainName: to.Ptr("example.com"), - // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSubCustomDomains_Get.json -func ExampleCustomDomainsClient_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.NewCustomDomainsClient().Get(ctx, "myResourceGroup", "myWebPubSubService", "example", 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.CustomDomain = armwebpubsub.CustomDomain{ - // Name: to.Ptr("myDomain"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/customDomains/myDomain"), - // Properties: &armwebpubsub.CustomDomainProperties{ - // CustomCertificate: &armwebpubsub.ResourceReference{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/customCertificates/myCert"), - // }, - // DomainName: to.Ptr("example.com"), - // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSubCustomDomains_CreateOrUpdate.json -func ExampleCustomDomainsClient_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.NewCustomDomainsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myWebPubSubService", "myDomain", armwebpubsub.CustomDomain{ - Properties: &armwebpubsub.CustomDomainProperties{ - CustomCertificate: &armwebpubsub.ResourceReference{ - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/customCertificates/myCert"), - }, - DomainName: to.Ptr("example.com"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSubCustomDomains_Delete.json -func ExampleCustomDomainsClient_BeginDelete() { - 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.NewCustomDomainsClient().BeginDelete(ctx, "myResourceGroup", "myWebPubSubService", "example", 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/fake/replicasharedprivatelinkresources_server.go b/sdk/resourcemanager/webpubsub/armwebpubsub/fake/replicasharedprivatelinkresources_server.go new file mode 100644 index 000000000000..bbdcbe84935e --- /dev/null +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/fake/replicasharedprivatelinkresources_server.go @@ -0,0 +1,228 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/webpubsub/armwebpubsub" + "net/http" + "net/url" + "regexp" +) + +// ReplicaSharedPrivateLinkResourcesServer is a fake server for instances of the armwebpubsub.ReplicaSharedPrivateLinkResourcesClient type. +type ReplicaSharedPrivateLinkResourcesServer struct { + // BeginCreateOrUpdate is the fake for method ReplicaSharedPrivateLinkResourcesClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, sharedPrivateLinkResourceName string, parameters armwebpubsub.SharedPrivateLinkResource, options *armwebpubsub.ReplicaSharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armwebpubsub.ReplicaSharedPrivateLinkResourcesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method ReplicaSharedPrivateLinkResourcesClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, sharedPrivateLinkResourceName string, options *armwebpubsub.ReplicaSharedPrivateLinkResourcesClientGetOptions) (resp azfake.Responder[armwebpubsub.ReplicaSharedPrivateLinkResourcesClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method ReplicaSharedPrivateLinkResourcesClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, resourceName string, replicaName string, options *armwebpubsub.ReplicaSharedPrivateLinkResourcesClientListOptions) (resp azfake.PagerResponder[armwebpubsub.ReplicaSharedPrivateLinkResourcesClientListResponse]) +} + +// NewReplicaSharedPrivateLinkResourcesServerTransport creates a new instance of ReplicaSharedPrivateLinkResourcesServerTransport with the provided implementation. +// The returned ReplicaSharedPrivateLinkResourcesServerTransport instance is connected to an instance of armwebpubsub.ReplicaSharedPrivateLinkResourcesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewReplicaSharedPrivateLinkResourcesServerTransport(srv *ReplicaSharedPrivateLinkResourcesServer) *ReplicaSharedPrivateLinkResourcesServerTransport { + return &ReplicaSharedPrivateLinkResourcesServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armwebpubsub.ReplicaSharedPrivateLinkResourcesClientCreateOrUpdateResponse]](), + newListPager: newTracker[azfake.PagerResponder[armwebpubsub.ReplicaSharedPrivateLinkResourcesClientListResponse]](), + } +} + +// ReplicaSharedPrivateLinkResourcesServerTransport connects instances of armwebpubsub.ReplicaSharedPrivateLinkResourcesClient to instances of ReplicaSharedPrivateLinkResourcesServer. +// Don't use this type directly, use NewReplicaSharedPrivateLinkResourcesServerTransport instead. +type ReplicaSharedPrivateLinkResourcesServerTransport struct { + srv *ReplicaSharedPrivateLinkResourcesServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armwebpubsub.ReplicaSharedPrivateLinkResourcesClientCreateOrUpdateResponse]] + newListPager *tracker[azfake.PagerResponder[armwebpubsub.ReplicaSharedPrivateLinkResourcesClientListResponse]] +} + +// Do implements the policy.Transporter interface for ReplicaSharedPrivateLinkResourcesServerTransport. +func (r *ReplicaSharedPrivateLinkResourcesServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "ReplicaSharedPrivateLinkResourcesClient.BeginCreateOrUpdate": + resp, err = r.dispatchBeginCreateOrUpdate(req) + case "ReplicaSharedPrivateLinkResourcesClient.Get": + resp, err = r.dispatchGet(req) + case "ReplicaSharedPrivateLinkResourcesClient.NewListPager": + resp, err = r.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (r *ReplicaSharedPrivateLinkResourcesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if r.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := r.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.SignalRService/webPubSub/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicas/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sharedPrivateLinkResources/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armwebpubsub.SharedPrivateLinkResource](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + replicaNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("replicaName")]) + if err != nil { + return nil, err + } + sharedPrivateLinkResourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("sharedPrivateLinkResourceName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, resourceNameParam, replicaNameParam, sharedPrivateLinkResourceNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + r.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + r.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + r.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (r *ReplicaSharedPrivateLinkResourcesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if r.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.SignalRService/webPubSub/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicas/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sharedPrivateLinkResources/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + replicaNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("replicaName")]) + if err != nil { + return nil, err + } + sharedPrivateLinkResourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("sharedPrivateLinkResourceName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, replicaNameParam, sharedPrivateLinkResourceNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SharedPrivateLinkResource, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (r *ReplicaSharedPrivateLinkResourcesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if r.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := r.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.SignalRService/webPubSub/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicas/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sharedPrivateLinkResources` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + replicaNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("replicaName")]) + if err != nil { + return nil, err + } + resp := r.srv.NewListPager(resourceGroupNameParam, resourceNameParam, replicaNameParam, nil) + newListPager = &resp + r.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armwebpubsub.ReplicaSharedPrivateLinkResourcesClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + r.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + r.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/fake/server_factory.go b/sdk/resourcemanager/webpubsub/armwebpubsub/fake/server_factory.go index a4d983504f7d..2bf0ed51f3ea 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/fake/server_factory.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/fake/server_factory.go @@ -19,16 +19,17 @@ import ( // ServerFactory is a fake server for instances of the armwebpubsub.ClientFactory type. type ServerFactory struct { - Server Server - CustomCertificatesServer CustomCertificatesServer - CustomDomainsServer CustomDomainsServer - HubsServer HubsServer - OperationsServer OperationsServer - PrivateEndpointConnectionsServer PrivateEndpointConnectionsServer - PrivateLinkResourcesServer PrivateLinkResourcesServer - ReplicasServer ReplicasServer - SharedPrivateLinkResourcesServer SharedPrivateLinkResourcesServer - UsagesServer UsagesServer + Server Server + CustomCertificatesServer CustomCertificatesServer + CustomDomainsServer CustomDomainsServer + HubsServer HubsServer + OperationsServer OperationsServer + PrivateEndpointConnectionsServer PrivateEndpointConnectionsServer + PrivateLinkResourcesServer PrivateLinkResourcesServer + ReplicaSharedPrivateLinkResourcesServer ReplicaSharedPrivateLinkResourcesServer + ReplicasServer ReplicasServer + SharedPrivateLinkResourcesServer SharedPrivateLinkResourcesServer + UsagesServer UsagesServer } // NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. @@ -43,18 +44,19 @@ func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport { // ServerFactoryTransport connects instances of armwebpubsub.ClientFactory to instances of ServerFactory. // Don't use this type directly, use NewServerFactoryTransport instead. type ServerFactoryTransport struct { - srv *ServerFactory - trMu sync.Mutex - trServer *ServerTransport - trCustomCertificatesServer *CustomCertificatesServerTransport - trCustomDomainsServer *CustomDomainsServerTransport - trHubsServer *HubsServerTransport - trOperationsServer *OperationsServerTransport - trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport - trPrivateLinkResourcesServer *PrivateLinkResourcesServerTransport - trReplicasServer *ReplicasServerTransport - trSharedPrivateLinkResourcesServer *SharedPrivateLinkResourcesServerTransport - trUsagesServer *UsagesServerTransport + srv *ServerFactory + trMu sync.Mutex + trServer *ServerTransport + trCustomCertificatesServer *CustomCertificatesServerTransport + trCustomDomainsServer *CustomDomainsServerTransport + trHubsServer *HubsServerTransport + trOperationsServer *OperationsServerTransport + trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport + trPrivateLinkResourcesServer *PrivateLinkResourcesServerTransport + trReplicaSharedPrivateLinkResourcesServer *ReplicaSharedPrivateLinkResourcesServerTransport + trReplicasServer *ReplicasServerTransport + trSharedPrivateLinkResourcesServer *SharedPrivateLinkResourcesServerTransport + trUsagesServer *UsagesServerTransport } // Do implements the policy.Transporter interface for ServerFactoryTransport. @@ -99,6 +101,11 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewPrivateLinkResourcesServerTransport(&s.srv.PrivateLinkResourcesServer) }) resp, err = s.trPrivateLinkResourcesServer.Do(req) + case "ReplicaSharedPrivateLinkResourcesClient": + initServer(s, &s.trReplicaSharedPrivateLinkResourcesServer, func() *ReplicaSharedPrivateLinkResourcesServerTransport { + return NewReplicaSharedPrivateLinkResourcesServerTransport(&s.srv.ReplicaSharedPrivateLinkResourcesServer) + }) + resp, err = s.trReplicaSharedPrivateLinkResourcesServer.Do(req) case "ReplicasClient": initServer(s, &s.trReplicasServer, func() *ReplicasServerTransport { return NewReplicasServerTransport(&s.srv.ReplicasServer) }) resp, err = s.trReplicasServer.Do(req) diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/fake/time_rfc3339.go b/sdk/resourcemanager/webpubsub/armwebpubsub/fake/time_rfc3339.go index b0535a7b63e6..81f308b0d343 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/fake/time_rfc3339.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/fake/time_rfc3339.go @@ -19,12 +19,16 @@ import ( ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -40,17 +44,33 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +81,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -74,7 +98,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339 diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/go.mod b/sdk/resourcemanager/webpubsub/armwebpubsub/go.mod index d47a00ac6b1e..e4bb33210611 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/go.mod +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/go.mod @@ -4,7 +4,6 @@ go 1.18 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2 github.com/Azure/azure-sdk-for-go/sdk/internal v1.7.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 @@ -12,6 +11,7 @@ require ( ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/golang-jwt/jwt/v5 v5.2.1 // indirect diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/hubs_client.go b/sdk/resourcemanager/webpubsub/armwebpubsub/hubs_client.go index cc0d32e15bee..ce5054e4770d 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/hubs_client.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/hubs_client.go @@ -46,7 +46,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - hubName - The hub name. // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. @@ -74,7 +74,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-08-01-preview +// Generated from API version 2024-03-01 func (client *HubsClient) createOrUpdate(ctx context.Context, hubName string, resourceGroupName string, resourceName string, parameters Hub, options *HubsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "HubsClient.BeginCreateOrUpdate" @@ -120,7 +120,7 @@ func (client *HubsClient) createOrUpdateCreateRequest(ctx context.Context, hubNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -132,7 +132,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - hubName - The hub name. // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. @@ -158,7 +158,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-08-01-preview +// Generated from API version 2024-03-01 func (client *HubsClient) deleteOperation(ctx context.Context, hubName string, resourceGroupName string, resourceName string, options *HubsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "HubsClient.BeginDelete" @@ -204,7 +204,7 @@ func (client *HubsClient) deleteCreateRequest(ctx context.Context, hubName strin return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -213,7 +213,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - hubName - The hub name. // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. @@ -264,7 +264,7 @@ func (client *HubsClient) getCreateRequest(ctx context.Context, hubName string, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,7 +281,7 @@ func (client *HubsClient) getHandleResponse(resp *http.Response) (HubsClientGetR // NewListPager - List hub settings. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - 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. @@ -328,7 +328,7 @@ func (client *HubsClient) listCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") 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 deleted file mode 100644 index 40cd291ecd4a..000000000000 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/hubs_client_example_test.go +++ /dev/null @@ -1,256 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSubHubs_List.json -func ExampleHubsClient_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.NewHubsClient().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.HubList = armwebpubsub.HubList{ - // Value: []*armwebpubsub.Hub{ - // { - // Name: to.Ptr("exampleHub"), - // Type: to.Ptr("Microsoft.SignalRService/WebPubSub/hubs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/hubs/exampleHub"), - // Properties: &armwebpubsub.HubProperties{ - // AnonymousConnectPolicy: to.Ptr("allow"), - // EventHandlers: []*armwebpubsub.EventHandler{ - // { - // Auth: &armwebpubsub.UpstreamAuthSettings{ - // Type: to.Ptr(armwebpubsub.UpstreamAuthTypeManagedIdentity), - // ManagedIdentity: &armwebpubsub.ManagedIdentitySettings{ - // Resource: to.Ptr("abc"), - // }, - // }, - // SystemEvents: []*string{ - // to.Ptr("connect"), - // to.Ptr("connected")}, - // URLTemplate: to.Ptr("http://host.com"), - // UserEventPattern: to.Ptr("*"), - // }}, - // EventListeners: []*armwebpubsub.EventListener{ - // { - // Endpoint: &armwebpubsub.EventHubEndpoint{ - // Type: to.Ptr(armwebpubsub.EventListenerEndpointDiscriminatorEventHub), - // EventHubName: to.Ptr("eventHubName1"), - // FullyQualifiedNamespace: to.Ptr("example.servicebus.windows.net"), - // }, - // Filter: &armwebpubsub.EventNameFilter{ - // Type: to.Ptr(armwebpubsub.EventListenerFilterDiscriminatorEventName), - // SystemEvents: []*string{ - // to.Ptr("connected"), - // to.Ptr("disconnected")}, - // UserEventPattern: to.Ptr("*"), - // }, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSubHubs_Get.json -func ExampleHubsClient_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.NewHubsClient().Get(ctx, "exampleHub", "myResourceGroup", "myWebPubSubService", 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.Hub = armwebpubsub.Hub{ - // Name: to.Ptr("exampleHub"), - // Type: to.Ptr("Microsoft.SignalRService/WebPubSub/hubs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/hubs/exampleHub"), - // Properties: &armwebpubsub.HubProperties{ - // AnonymousConnectPolicy: to.Ptr("allow"), - // EventHandlers: []*armwebpubsub.EventHandler{ - // { - // Auth: &armwebpubsub.UpstreamAuthSettings{ - // Type: to.Ptr(armwebpubsub.UpstreamAuthTypeManagedIdentity), - // ManagedIdentity: &armwebpubsub.ManagedIdentitySettings{ - // Resource: to.Ptr("abc"), - // }, - // }, - // SystemEvents: []*string{ - // to.Ptr("connect"), - // to.Ptr("connected")}, - // URLTemplate: to.Ptr("http://host.com"), - // UserEventPattern: to.Ptr("*"), - // }}, - // EventListeners: []*armwebpubsub.EventListener{ - // { - // Endpoint: &armwebpubsub.EventHubEndpoint{ - // Type: to.Ptr(armwebpubsub.EventListenerEndpointDiscriminatorEventHub), - // EventHubName: to.Ptr("eventHubName1"), - // FullyQualifiedNamespace: to.Ptr("example.servicebus.windows.net"), - // }, - // Filter: &armwebpubsub.EventNameFilter{ - // Type: to.Ptr(armwebpubsub.EventListenerFilterDiscriminatorEventName), - // SystemEvents: []*string{ - // to.Ptr("connected"), - // to.Ptr("disconnected")}, - // UserEventPattern: to.Ptr("*"), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSubHubs_CreateOrUpdate.json -func ExampleHubsClient_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.NewHubsClient().BeginCreateOrUpdate(ctx, "exampleHub", "myResourceGroup", "myWebPubSubService", armwebpubsub.Hub{ - Properties: &armwebpubsub.HubProperties{ - AnonymousConnectPolicy: to.Ptr("allow"), - EventHandlers: []*armwebpubsub.EventHandler{ - { - Auth: &armwebpubsub.UpstreamAuthSettings{ - Type: to.Ptr(armwebpubsub.UpstreamAuthTypeManagedIdentity), - ManagedIdentity: &armwebpubsub.ManagedIdentitySettings{ - Resource: to.Ptr("abc"), - }, - }, - SystemEvents: []*string{ - to.Ptr("connect"), - to.Ptr("connected")}, - URLTemplate: to.Ptr("http://host.com"), - UserEventPattern: to.Ptr("*"), - }}, - EventListeners: []*armwebpubsub.EventListener{ - { - Endpoint: &armwebpubsub.EventHubEndpoint{ - Type: to.Ptr(armwebpubsub.EventListenerEndpointDiscriminatorEventHub), - EventHubName: to.Ptr("eventHubName1"), - FullyQualifiedNamespace: to.Ptr("example.servicebus.windows.net"), - }, - Filter: &armwebpubsub.EventNameFilter{ - Type: to.Ptr(armwebpubsub.EventListenerFilterDiscriminatorEventName), - SystemEvents: []*string{ - to.Ptr("connected"), - to.Ptr("disconnected")}, - UserEventPattern: to.Ptr("*"), - }, - }}, - }, - }, 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.Hub = armwebpubsub.Hub{ - // Name: to.Ptr("exampleHub"), - // Type: to.Ptr("Microsoft.SignalRService/WebPubSub/hubs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/hubs/exampleHub"), - // Properties: &armwebpubsub.HubProperties{ - // AnonymousConnectPolicy: to.Ptr("allow"), - // EventHandlers: []*armwebpubsub.EventHandler{ - // { - // Auth: &armwebpubsub.UpstreamAuthSettings{ - // Type: to.Ptr(armwebpubsub.UpstreamAuthTypeManagedIdentity), - // ManagedIdentity: &armwebpubsub.ManagedIdentitySettings{ - // Resource: to.Ptr("abc"), - // }, - // }, - // SystemEvents: []*string{ - // to.Ptr("connect"), - // to.Ptr("connected")}, - // URLTemplate: to.Ptr("http://host.com"), - // UserEventPattern: to.Ptr("*"), - // }}, - // EventListeners: []*armwebpubsub.EventListener{ - // { - // Endpoint: &armwebpubsub.EventHubEndpoint{ - // Type: to.Ptr(armwebpubsub.EventListenerEndpointDiscriminatorEventHub), - // EventHubName: to.Ptr("eventHubName1"), - // FullyQualifiedNamespace: to.Ptr("example.servicebus.windows.net"), - // }, - // Filter: &armwebpubsub.EventNameFilter{ - // Type: to.Ptr(armwebpubsub.EventListenerFilterDiscriminatorEventName), - // SystemEvents: []*string{ - // to.Ptr("connected"), - // to.Ptr("disconnected")}, - // UserEventPattern: to.Ptr("*"), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSubHubs_Delete.json -func ExampleHubsClient_BeginDelete() { - 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.NewHubsClient().BeginDelete(ctx, "exampleHub", "myResourceGroup", "myWebPubSubService", 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/models.go b/sdk/resourcemanager/webpubsub/armwebpubsub/models.go index ba4a5ea91789..feaa324ac461 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/models.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/models.go @@ -236,6 +236,10 @@ type HubProperties struct { // the array elements doesn't matter. Maximum count of event listeners among all // hubs is 10. EventListeners []*EventListener + + // The settings for configuring the WebSocket ping-pong interval in seconds for all clients in the hub. Valid range: 1 to + // 120. Default to 20 seconds. + WebSocketKeepAliveIntervalInSeconds *int32 } // IPRule - An IP rule @@ -580,10 +584,13 @@ type Properties struct { // Resource log configuration of a Microsoft.SignalRService resource. ResourceLogConfiguration *ResourceLogConfiguration - // Stop or start the resource. Default to "false". When it's true, the data plane of the resource is shutdown. When it's false, + // Stop or start the resource. Default to "False". When it's true, the data plane of the resource is shutdown. When it's false, // the data plane of the resource is started. ResourceStopped *string + // SocketIO settings for the resource + SocketIO *SocketIOSettings + // TLS settings for the resource TLS *TLSSettings @@ -733,12 +740,13 @@ type ResourceReference struct { // ResourceSKU - The billing information of the resource. type ResourceSKU struct { // REQUIRED; The name of the SKU. Required. - // Allowed values: StandardS1, FreeF1, Premium_P1 + // Allowed values: StandardS1, FreeF1, PremiumP1, PremiumP2 Name *string - // Optional, integer. The unit count of the resource. 1 by default. - // If present, following values are allowed: Free: 1; Standard: 1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100; Premium: - // 1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100; + // Optional, integer. The unit count of the resource. 1 for FreeF1/StandardS1/PremiumP1, 100 for PremiumP2 by default. + // If present, following values are allowed: FreeF1: 1; StandardS1: 1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100; PremiumP1: + // 1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100; PremiumP2: + // 100,200,300,400,500,600,700,800,900,1000; Capacity *int32 // Optional tier of this particular SKU. 'Standard' or 'Free'. @@ -905,6 +913,13 @@ type SignalRServiceUsageName struct { Value *string } +// SocketIOSettings - SocketIO settings for the resource +type SocketIOSettings struct { + // The service mode of Web PubSub for Socket.IO. Values allowed: "Default": have your own backend Socket.IO server "Serverless": + // your application doesn't have a backend server + ServiceMode *string +} + // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/models_serde.go b/sdk/resourcemanager/webpubsub/armwebpubsub/models_serde.go index d84b2b6b6d10..539abca6dc1c 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/models_serde.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/models_serde.go @@ -550,6 +550,7 @@ func (h HubProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "anonymousConnectPolicy", h.AnonymousConnectPolicy) populate(objectMap, "eventHandlers", h.EventHandlers) populate(objectMap, "eventListeners", h.EventListeners) + populate(objectMap, "webSocketKeepAliveIntervalInSeconds", h.WebSocketKeepAliveIntervalInSeconds) return json.Marshal(objectMap) } @@ -571,6 +572,9 @@ func (h *HubProperties) UnmarshalJSON(data []byte) error { case "eventListeners": err = unpopulate(val, "EventListeners", &h.EventListeners) delete(rawMsg, key) + case "webSocketKeepAliveIntervalInSeconds": + err = unpopulate(val, "WebSocketKeepAliveIntervalInSeconds", &h.WebSocketKeepAliveIntervalInSeconds) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", h, err) @@ -1481,6 +1485,7 @@ func (p Properties) MarshalJSON() ([]byte, error) { populate(objectMap, "resourceStopped", p.ResourceStopped) populate(objectMap, "serverPort", p.ServerPort) populate(objectMap, "sharedPrivateLinkResources", p.SharedPrivateLinkResources) + populate(objectMap, "socketIO", p.SocketIO) populate(objectMap, "tls", p.TLS) populate(objectMap, "version", p.Version) return json.Marshal(objectMap) @@ -1543,6 +1548,9 @@ func (p *Properties) UnmarshalJSON(data []byte) error { case "sharedPrivateLinkResources": err = unpopulate(val, "SharedPrivateLinkResources", &p.SharedPrivateLinkResources) delete(rawMsg, key) + case "socketIO": + err = unpopulate(val, "SocketIO", &p.SocketIO) + delete(rawMsg, key) case "tls": err = unpopulate(val, "TLS", &p.TLS) delete(rawMsg, key) @@ -2355,6 +2363,33 @@ func (s *SignalRServiceUsageName) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SocketIOSettings. +func (s SocketIOSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "serviceMode", s.ServiceMode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SocketIOSettings. +func (s *SocketIOSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "serviceMode": + err = unpopulate(val, "ServiceMode", &s.ServiceMode) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2502,7 +2537,7 @@ func populate(m map[string]any, k string, v any) { } func unpopulate(data json.RawMessage, fn string, v any) error { - if data == nil { + if data == nil || string(data) == "null" { return nil } if err := json.Unmarshal(data, v); err != nil { diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/operations_client.go b/sdk/resourcemanager/webpubsub/armwebpubsub/operations_client.go index acf165c13863..95cf97443b5c 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/operations_client.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/operations_client.go @@ -39,7 +39,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-08-01-preview +// Generated from API version 2024-03-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -72,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") 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 deleted file mode 100644 index b854869dfded..000000000000 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/operations_client_example_test.go +++ /dev/null @@ -1,58 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armwebpubsub_test - -import ( - "context" - "log" - - "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/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/Operations_List.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armwebpubsub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationList = armwebpubsub.OperationList{ - // Value: []*armwebpubsub.Operation{ - // { - // Name: to.Ptr("Microsoft.SignalRService/WebPubSub/read"), - // Display: &armwebpubsub.OperationDisplay{ - // Description: to.Ptr("View the resource settings and configurations in the management portal or through API"), - // Operation: to.Ptr("Manage WebPubSub (read-only)"), - // Provider: to.Ptr("Microsoft.SignalRService"), - // Resource: to.Ptr("WebPubSub"), - // }, - // IsDataAction: to.Ptr(false), - // Properties: &armwebpubsub.OperationProperties{ - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/options.go b/sdk/resourcemanager/webpubsub/armwebpubsub/options.go index e789b76f6b82..fea26f99fce9 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/options.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/options.go @@ -176,6 +176,25 @@ type PrivateLinkResourcesClientListOptions struct { // placeholder for future optional parameters } +// ReplicaSharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions contains the optional parameters for the ReplicaSharedPrivateLinkResourcesClient.BeginCreateOrUpdate +// method. +type ReplicaSharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicaSharedPrivateLinkResourcesClientGetOptions contains the optional parameters for the ReplicaSharedPrivateLinkResourcesClient.Get +// method. +type ReplicaSharedPrivateLinkResourcesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ReplicaSharedPrivateLinkResourcesClientListOptions contains the optional parameters for the ReplicaSharedPrivateLinkResourcesClient.NewListPager +// method. +type ReplicaSharedPrivateLinkResourcesClientListOptions struct { + // placeholder for future optional parameters +} + // ReplicasClientBeginCreateOrUpdateOptions contains the optional parameters for the ReplicasClient.BeginCreateOrUpdate method. type ReplicasClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/polymorphic_helpers.go b/sdk/resourcemanager/webpubsub/armwebpubsub/polymorphic_helpers.go index fcc60c7417bc..f1ad6dfa5ade 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/polymorphic_helpers.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/polymorphic_helpers.go @@ -11,7 +11,7 @@ package armwebpubsub import "encoding/json" func unmarshalEventListenerEndpointClassification(rawMsg json.RawMessage) (EventListenerEndpointClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -32,7 +32,7 @@ func unmarshalEventListenerEndpointClassification(rawMsg json.RawMessage) (Event } func unmarshalEventListenerFilterClassification(rawMsg json.RawMessage) (EventListenerFilterClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/privateendpointconnections_client.go b/sdk/resourcemanager/webpubsub/armwebpubsub/privateendpointconnections_client.go index 60bfa08fa12d..e1eed0f6ae75 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/privateendpointconnections_client.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/privateendpointconnections_client.go @@ -46,7 +46,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - 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. @@ -73,7 +73,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-08-01-preview +// Generated from API version 2024-03-01 func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, privateEndpointConnectionName string, resourceGroupName string, resourceName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PrivateEndpointConnectionsClient.BeginDelete" @@ -119,7 +119,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -128,7 +128,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - 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. @@ -180,7 +180,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -197,7 +197,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListPager - List private endpoint connections // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - 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 @@ -245,7 +245,7 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -263,7 +263,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - 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. @@ -316,7 +316,7 @@ func (client *PrivateEndpointConnectionsClient) updateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/webpubsub/armwebpubsub/privateendpointconnections_client_example_test.go deleted file mode 100644 index d3d6876bb40d..000000000000 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,191 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSubPrivateEndpointConnections_List.json -func ExamplePrivateEndpointConnectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armwebpubsub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateEndpointConnectionsClient().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.PrivateEndpointConnectionList = armwebpubsub.PrivateEndpointConnectionList{ - // Value: []*armwebpubsub.PrivateEndpointConnection{ - // { - // 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:06.000Z"); 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:06.000Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // }, - // Properties: &armwebpubsub.PrivateEndpointConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("webpubsub")}, - // PrivateEndpoint: &armwebpubsub.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armwebpubsub.PrivateLinkServiceConnectionState{ - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armwebpubsub.PrivateLinkServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSubPrivateEndpointConnections_Get.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armwebpubsub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", "myResourceGroup", "myWebPubSubService", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armwebpubsub.PrivateEndpointConnection{ - // 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:06.000Z"); 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:06.000Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // }, - // Properties: &armwebpubsub.PrivateEndpointConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("webpubsub")}, - // PrivateEndpoint: &armwebpubsub.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armwebpubsub.PrivateLinkServiceConnectionState{ - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armwebpubsub.PrivateLinkServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSubPrivateEndpointConnections_Update.json -func ExamplePrivateEndpointConnectionsClient_Update() { - 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.NewPrivateEndpointConnectionsClient().Update(ctx, "mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", "myResourceGroup", "myWebPubSubService", armwebpubsub.PrivateEndpointConnection{ - Properties: &armwebpubsub.PrivateEndpointConnectionProperties{ - PrivateEndpoint: &armwebpubsub.PrivateEndpoint{}, - PrivateLinkServiceConnectionState: &armwebpubsub.PrivateLinkServiceConnectionState{ - ActionsRequired: to.Ptr("None"), - Status: to.Ptr(armwebpubsub.PrivateLinkServiceConnectionStatusApproved), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armwebpubsub.PrivateEndpointConnection{ - // 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:06.000Z"); 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:06.000Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armwebpubsub.CreatedByTypeUser), - // }, - // Properties: &armwebpubsub.PrivateEndpointConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("webpubsub")}, - // PrivateEndpoint: &armwebpubsub.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armwebpubsub.PrivateLinkServiceConnectionState{ - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armwebpubsub.PrivateLinkServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSubPrivateEndpointConnections_Delete.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armwebpubsub.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", "myResourceGroup", "myWebPubSubService", 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/privatelinkresources_client.go b/sdk/resourcemanager/webpubsub/armwebpubsub/privatelinkresources_client.go index edd567bb495c..2d5553dfab70 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/privatelinkresources_client.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/privatelinkresources_client.go @@ -45,7 +45,7 @@ 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-08-01-preview +// Generated from API version 2024-03-01 // - 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 @@ -93,7 +93,7 @@ func (client *PrivateLinkResourcesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") 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 deleted file mode 100644 index e90fbab0b076..000000000000 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,83 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armwebpubsub_test - -import ( - "context" - "log" - - "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/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSubPrivateLinkResources_List.json -func ExamplePrivateLinkResourcesClient_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.NewPrivateLinkResourcesClient().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.PrivateLinkResourceList = armwebpubsub.PrivateLinkResourceList{ - // Value: []*armwebpubsub.PrivateLinkResource{ - // { - // Name: to.Ptr("myPrivateLink"), - // Type: to.Ptr("privateLinkResources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/privateLinkResources/myPrivateLink"), - // Properties: &armwebpubsub.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("webpubsub"), - // RequiredMembers: []*string{ - // to.Ptr("webpubsub")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.webpubsub.azure.com")}, - // ShareablePrivateLinkResourceTypes: []*armwebpubsub.ShareablePrivateLinkResourceType{ - // { - // Name: to.Ptr("site"), - // Properties: &armwebpubsub.ShareablePrivateLinkResourceProperties{ - // Type: to.Ptr("Microsoft.Web/sites"), - // 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 index 814fc9094237..4a83af7e08e0 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/replicas_client.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/replicas_client.go @@ -46,7 +46,7 @@ func NewReplicasClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Create or update a replica. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - replicaName - The name of the replica. @@ -74,7 +74,7 @@ func (client *ReplicasClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create or update a replica. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 func (client *ReplicasClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, parameters Replica, options *ReplicasClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ReplicasClient.BeginCreateOrUpdate" @@ -120,7 +120,7 @@ func (client *ReplicasClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -132,7 +132,7 @@ func (client *ReplicasClient) createOrUpdateCreateRequest(ctx context.Context, r // Delete - Operation to delete a replica. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - replicaName - The name of the replica. @@ -182,7 +182,7 @@ func (client *ReplicasClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,7 +191,7 @@ func (client *ReplicasClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get the replica and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - replicaName - The name of the replica. @@ -242,7 +242,7 @@ func (client *ReplicasClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -259,7 +259,7 @@ func (client *ReplicasClient) getHandleResponse(resp *http.Response) (ReplicasCl // NewListPager - List all replicas belong to this resource // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - 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. @@ -306,7 +306,7 @@ func (client *ReplicasClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -324,7 +324,7 @@ func (client *ReplicasClient) listHandleResponse(resp *http.Response) (ReplicasC // BeginRestart - Operation to restart a replica. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - replicaName - The name of the replica. @@ -350,7 +350,7 @@ func (client *ReplicasClient) BeginRestart(ctx context.Context, resourceGroupNam // Restart - Operation to restart a replica. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 func (client *ReplicasClient) restart(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, options *ReplicasClientBeginRestartOptions) (*http.Response, error) { var err error const operationName = "ReplicasClient.BeginRestart" @@ -396,7 +396,7 @@ func (client *ReplicasClient) restartCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -405,7 +405,7 @@ func (client *ReplicasClient) restartCreateRequest(ctx context.Context, resource // BeginUpdate - Operation to update an exiting replica. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - replicaName - The name of the replica. @@ -432,7 +432,7 @@ func (client *ReplicasClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Operation to update an exiting replica. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 func (client *ReplicasClient) update(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, parameters Replica, options *ReplicasClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ReplicasClient.BeginUpdate" @@ -478,7 +478,7 @@ func (client *ReplicasClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/replicas_client_example_test.go b/sdk/resourcemanager/webpubsub/armwebpubsub/replicas_client_example_test.go deleted file mode 100644 index 946baebb13bd..000000000000 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/replicas_client_example_test.go +++ /dev/null @@ -1,291 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-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:06.000Z"); 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:06.000Z"); 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), - // RegionEndpointEnabled: to.Ptr("Enabled"), - // ResourceStopped: to.Ptr("false"), - // }, - // 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/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-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:06.000Z"); 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:06.000Z"); 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), - // RegionEndpointEnabled: to.Ptr("Enabled"), - // ResourceStopped: to.Ptr("false"), - // }, - // 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/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-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{ - ResourceStopped: to.Ptr("false"), - }, - 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:06.000Z"); 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:06.000Z"); 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), - // RegionEndpointEnabled: to.Ptr("Enabled"), - // ResourceStopped: to.Ptr("false"), - // }, - // 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/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-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/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-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{ - ResourceStopped: to.Ptr("false"), - }, - 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:06.000Z"); 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:06.000Z"); 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), - // RegionEndpointEnabled: to.Ptr("Enabled"), - // ResourceStopped: to.Ptr("false"), - // }, - // 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/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-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/replicasharedprivatelinkresources_client.go b/sdk/resourcemanager/webpubsub/armwebpubsub/replicasharedprivatelinkresources_client.go new file mode 100644 index 000000000000..491b538172fe --- /dev/null +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/replicasharedprivatelinkresources_client.go @@ -0,0 +1,280 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package 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" +) + +// ReplicaSharedPrivateLinkResourcesClient contains the methods for the WebPubSubReplicaSharedPrivateLinkResources group. +// Don't use this type directly, use NewReplicaSharedPrivateLinkResourcesClient() instead. +type ReplicaSharedPrivateLinkResourcesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewReplicaSharedPrivateLinkResourcesClient creates a new instance of ReplicaSharedPrivateLinkResourcesClient 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 NewReplicaSharedPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ReplicaSharedPrivateLinkResourcesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ReplicaSharedPrivateLinkResourcesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update a shared private link resource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-03-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the resource. +// - replicaName - The name of the replica. +// - sharedPrivateLinkResourceName - The name of the shared private link resource. +// - parameters - The shared private link resource +// - options - ReplicaSharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions contains the optional parameters for the ReplicaSharedPrivateLinkResourcesClient.BeginCreateOrUpdate +// method. +func (client *ReplicaSharedPrivateLinkResourcesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, sharedPrivateLinkResourceName string, parameters SharedPrivateLinkResource, options *ReplicaSharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ReplicaSharedPrivateLinkResourcesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, resourceName, replicaName, sharedPrivateLinkResourceName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ReplicaSharedPrivateLinkResourcesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ReplicaSharedPrivateLinkResourcesClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create or update a shared private link resource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-03-01 +func (client *ReplicaSharedPrivateLinkResourcesClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, sharedPrivateLinkResourceName string, parameters SharedPrivateLinkResource, options *ReplicaSharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "ReplicaSharedPrivateLinkResourcesClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, replicaName, sharedPrivateLinkResourceName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ReplicaSharedPrivateLinkResourcesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, sharedPrivateLinkResourceName string, parameters SharedPrivateLinkResource, options *ReplicaSharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas/{replicaName}/sharedPrivateLinkResources/{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") + } + 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)) + if sharedPrivateLinkResourceName == "" { + return nil, errors.New("parameter sharedPrivateLinkResourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sharedPrivateLinkResourceName}", url.PathEscape(sharedPrivateLinkResourceName)) + 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", "2024-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// Get - Get the specified shared private link resource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-03-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the resource. +// - replicaName - The name of the replica. +// - sharedPrivateLinkResourceName - The name of the shared private link resource. +// - options - ReplicaSharedPrivateLinkResourcesClientGetOptions contains the optional parameters for the ReplicaSharedPrivateLinkResourcesClient.Get +// method. +func (client *ReplicaSharedPrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, sharedPrivateLinkResourceName string, options *ReplicaSharedPrivateLinkResourcesClientGetOptions) (ReplicaSharedPrivateLinkResourcesClientGetResponse, error) { + var err error + const operationName = "ReplicaSharedPrivateLinkResourcesClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, replicaName, sharedPrivateLinkResourceName, options) + if err != nil { + return ReplicaSharedPrivateLinkResourcesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ReplicaSharedPrivateLinkResourcesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ReplicaSharedPrivateLinkResourcesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ReplicaSharedPrivateLinkResourcesClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, sharedPrivateLinkResourceName string, options *ReplicaSharedPrivateLinkResourcesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas/{replicaName}/sharedPrivateLinkResources/{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") + } + 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)) + if sharedPrivateLinkResourceName == "" { + return nil, errors.New("parameter sharedPrivateLinkResourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sharedPrivateLinkResourceName}", url.PathEscape(sharedPrivateLinkResourceName)) + 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", "2024-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ReplicaSharedPrivateLinkResourcesClient) getHandleResponse(resp *http.Response) (ReplicaSharedPrivateLinkResourcesClientGetResponse, error) { + result := ReplicaSharedPrivateLinkResourcesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SharedPrivateLinkResource); err != nil { + return ReplicaSharedPrivateLinkResourcesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List shared private link resources +// +// Generated from API version 2024-03-01 +// - 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 - ReplicaSharedPrivateLinkResourcesClientListOptions contains the optional parameters for the ReplicaSharedPrivateLinkResourcesClient.NewListPager +// method. +func (client *ReplicaSharedPrivateLinkResourcesClient) NewListPager(resourceGroupName string, resourceName string, replicaName string, options *ReplicaSharedPrivateLinkResourcesClientListOptions) *runtime.Pager[ReplicaSharedPrivateLinkResourcesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ReplicaSharedPrivateLinkResourcesClientListResponse]{ + More: func(page ReplicaSharedPrivateLinkResourcesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ReplicaSharedPrivateLinkResourcesClientListResponse) (ReplicaSharedPrivateLinkResourcesClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ReplicaSharedPrivateLinkResourcesClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, resourceName, replicaName, options) + }, nil) + if err != nil { + return ReplicaSharedPrivateLinkResourcesClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *ReplicaSharedPrivateLinkResourcesClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, replicaName string, options *ReplicaSharedPrivateLinkResourcesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas/{replicaName}/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") + } + 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", "2024-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ReplicaSharedPrivateLinkResourcesClient) listHandleResponse(resp *http.Response) (ReplicaSharedPrivateLinkResourcesClientListResponse, error) { + result := ReplicaSharedPrivateLinkResourcesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SharedPrivateLinkResourceList); err != nil { + return ReplicaSharedPrivateLinkResourcesClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/response_types.go b/sdk/resourcemanager/webpubsub/armwebpubsub/responses.go similarity index 91% rename from sdk/resourcemanager/webpubsub/armwebpubsub/response_types.go rename to sdk/resourcemanager/webpubsub/armwebpubsub/responses.go index 349cd83b310b..ffd89bd3d2cf 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/response_types.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/responses.go @@ -182,6 +182,24 @@ type PrivateLinkResourcesClientListResponse struct { PrivateLinkResourceList } +// ReplicaSharedPrivateLinkResourcesClientCreateOrUpdateResponse contains the response from method ReplicaSharedPrivateLinkResourcesClient.BeginCreateOrUpdate. +type ReplicaSharedPrivateLinkResourcesClientCreateOrUpdateResponse struct { + // Describes a Shared Private Link Resource + SharedPrivateLinkResource +} + +// ReplicaSharedPrivateLinkResourcesClientGetResponse contains the response from method ReplicaSharedPrivateLinkResourcesClient.Get. +type ReplicaSharedPrivateLinkResourcesClientGetResponse struct { + // Describes a Shared Private Link Resource + SharedPrivateLinkResource +} + +// ReplicaSharedPrivateLinkResourcesClientListResponse contains the response from method ReplicaSharedPrivateLinkResourcesClient.NewListPager. +type ReplicaSharedPrivateLinkResourcesClientListResponse struct { + // A list of shared private link resources + SharedPrivateLinkResourceList +} + // ReplicasClientCreateOrUpdateResponse contains the response from method ReplicasClient.BeginCreateOrUpdate. type ReplicasClientCreateOrUpdateResponse struct { // A class represent a replica resource. diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/sharedprivatelinkresources_client.go b/sdk/resourcemanager/webpubsub/armwebpubsub/sharedprivatelinkresources_client.go index b0bdf2eefe0a..0881b84018bd 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/sharedprivatelinkresources_client.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/sharedprivatelinkresources_client.go @@ -46,8 +46,8 @@ 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-08-01-preview -// - sharedPrivateLinkResourceName - The name of the shared private link resource +// Generated from API version 2024-03-01 +// - sharedPrivateLinkResourceName - The name of the shared private link resource. // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the resource. // - parameters - The shared private link resource @@ -74,7 +74,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-08-01-preview +// Generated from API version 2024-03-01 func (client *SharedPrivateLinkResourcesClient) createOrUpdate(ctx context.Context, sharedPrivateLinkResourceName string, resourceGroupName string, resourceName string, parameters SharedPrivateLinkResource, options *SharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "SharedPrivateLinkResourcesClient.BeginCreateOrUpdate" @@ -120,7 +120,7 @@ func (client *SharedPrivateLinkResourcesClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -132,8 +132,8 @@ 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-08-01-preview -// - sharedPrivateLinkResourceName - The name of the shared private link resource +// Generated from API version 2024-03-01 +// - sharedPrivateLinkResourceName - The name of the shared private link resource. // - 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 @@ -159,7 +159,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-08-01-preview +// Generated from API version 2024-03-01 func (client *SharedPrivateLinkResourcesClient) deleteOperation(ctx context.Context, sharedPrivateLinkResourceName string, resourceGroupName string, resourceName string, options *SharedPrivateLinkResourcesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SharedPrivateLinkResourcesClient.BeginDelete" @@ -205,7 +205,7 @@ func (client *SharedPrivateLinkResourcesClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,8 +214,8 @@ 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-08-01-preview -// - sharedPrivateLinkResourceName - The name of the shared private link resource +// Generated from API version 2024-03-01 +// - sharedPrivateLinkResourceName - The name of the shared private link resource. // - 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 @@ -266,7 +266,7 @@ func (client *SharedPrivateLinkResourcesClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +283,7 @@ func (client *SharedPrivateLinkResourcesClient) getHandleResponse(resp *http.Res // NewListPager - List shared private link resources // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - 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 @@ -331,7 +331,7 @@ func (client *SharedPrivateLinkResourcesClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") 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 deleted file mode 100644 index 971feb70880b..000000000000 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/sharedprivatelinkresources_client_example_test.go +++ /dev/null @@ -1,154 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSubSharedPrivateLinkResources_List.json -func ExampleSharedPrivateLinkResourcesClient_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.NewSharedPrivateLinkResourcesClient().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.SharedPrivateLinkResourceList = armwebpubsub.SharedPrivateLinkResourceList{ - // Value: []*armwebpubsub.SharedPrivateLinkResource{ - // { - // Name: to.Ptr("upstream"), - // Type: to.Ptr("Microsoft.SignalRService/WebPubSub/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/privateEndpointConnections/upstream"), - // Properties: &armwebpubsub.SharedPrivateLinkResourceProperties{ - // GroupID: to.Ptr("sites"), - // PrivateLinkResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Web/sites/myWebApp"), - // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), - // RequestMessage: to.Ptr("Please approve"), - // Status: to.Ptr(armwebpubsub.SharedPrivateLinkResourceStatusApproved), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSubSharedPrivateLinkResources_Get.json -func ExampleSharedPrivateLinkResourcesClient_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.NewSharedPrivateLinkResourcesClient().Get(ctx, "upstream", "myResourceGroup", "myWebPubSubService", 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.SharedPrivateLinkResource = armwebpubsub.SharedPrivateLinkResource{ - // Name: to.Ptr("upstream"), - // Type: to.Ptr("Microsoft.SignalRService/WebPubSub/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/privateEndpointConnections/upstream"), - // Properties: &armwebpubsub.SharedPrivateLinkResourceProperties{ - // GroupID: to.Ptr("sites"), - // PrivateLinkResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Web/sites/myWebApp"), - // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), - // RequestMessage: to.Ptr("Please approve"), - // Status: to.Ptr(armwebpubsub.SharedPrivateLinkResourceStatusApproved), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSubSharedPrivateLinkResources_CreateOrUpdate.json -func ExampleSharedPrivateLinkResourcesClient_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.NewSharedPrivateLinkResourcesClient().BeginCreateOrUpdate(ctx, "upstream", "myResourceGroup", "myWebPubSubService", armwebpubsub.SharedPrivateLinkResource{ - Properties: &armwebpubsub.SharedPrivateLinkResourceProperties{ - GroupID: to.Ptr("sites"), - PrivateLinkResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Web/sites/myWebApp"), - RequestMessage: to.Ptr("Please approve"), - }, - }, 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.SharedPrivateLinkResource = armwebpubsub.SharedPrivateLinkResource{ - // Name: to.Ptr("upstream"), - // Type: to.Ptr("Microsoft.SignalRService/WebPubSub/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/privateEndpointConnections/upstream"), - // Properties: &armwebpubsub.SharedPrivateLinkResourceProperties{ - // GroupID: to.Ptr("sites"), - // PrivateLinkResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Web/sites/myWebApp"), - // ProvisioningState: to.Ptr(armwebpubsub.ProvisioningStateSucceeded), - // RequestMessage: to.Ptr("Please approve"), - // Status: to.Ptr(armwebpubsub.SharedPrivateLinkResourceStatusApproved), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/WebPubSubSharedPrivateLinkResources_Delete.json -func ExampleSharedPrivateLinkResourcesClient_BeginDelete() { - 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.NewSharedPrivateLinkResourcesClient().BeginDelete(ctx, "upstream", "myResourceGroup", "myWebPubSubService", 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/time_rfc3339.go b/sdk/resourcemanager/webpubsub/armwebpubsub/time_rfc3339.go index 3798d3585c99..bc2cc7e4f9e3 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/time_rfc3339.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/time_rfc3339.go @@ -19,12 +19,16 @@ import ( ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -40,17 +44,33 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +81,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -74,7 +98,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339 diff --git a/sdk/resourcemanager/webpubsub/armwebpubsub/usages_client.go b/sdk/resourcemanager/webpubsub/armwebpubsub/usages_client.go index be44390702f8..a9b58c086309 100644 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/usages_client.go +++ b/sdk/resourcemanager/webpubsub/armwebpubsub/usages_client.go @@ -45,7 +45,7 @@ func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, o // NewListPager - List resource usage quotas by location. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2024-03-01 // - 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] { @@ -87,7 +87,7 @@ func (client *UsagesClient) listCreateRequest(ctx context.Context, location stri return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2024-03-01") 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 deleted file mode 100644 index 718c679e51d2..000000000000 --- a/sdk/resourcemanager/webpubsub/armwebpubsub/usages_client_example_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armwebpubsub_test - -import ( - "context" - "log" - - "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/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2023-08-01-preview/examples/Usages_List.json -func ExampleUsagesClient_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.NewUsagesClient().NewListPager("eastus", 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.SignalRServiceUsageList = armwebpubsub.SignalRServiceUsageList{ - // Value: []*armwebpubsub.SignalRServiceUsage{ - // { - // Name: &armwebpubsub.SignalRServiceUsageName{ - // LocalizedValue: to.Ptr("Usage1"), - // Value: to.Ptr("Usage1"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.SignalRService/locations/eastus/usages/Usage1"), - // Limit: to.Ptr[int64](100), - // Unit: to.Ptr("Count"), - // }, - // { - // Name: &armwebpubsub.SignalRServiceUsageName{ - // LocalizedValue: to.Ptr("Usage2"), - // Value: to.Ptr("Usage2"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.SignalRService/locations/eastus/usages/Usage2"), - // Limit: to.Ptr[int64](100), - // Unit: to.Ptr("Count"), - // }}, - // } - } -}