diff --git a/sdk/resourcemanager/botservice/armbotservice/CHANGELOG.md b/sdk/resourcemanager/botservice/armbotservice/CHANGELOG.md index 6ad7813be2c5..95a2d05344d7 100644 --- a/sdk/resourcemanager/botservice/armbotservice/CHANGELOG.md +++ b/sdk/resourcemanager/botservice/armbotservice/CHANGELOG.md @@ -1,5 +1,52 @@ # Release History +## 2.0.0-beta.1 (2025-08-22) +### Breaking Changes + +- Type alias `EmailChannelAuthMethod` type has been changed from `float32` to `int32` +- Struct `ConnectionItemName` has been removed +- Struct `Error` has been removed +- Struct `ErrorBody` has been removed +- Struct `PrivateLinkResourceBase` has been removed +- Struct `Resource` has been removed + +### Features Added + +- New value `PublicNetworkAccessSecuredByPerimeter` added to enum type `PublicNetworkAccess` +- New enum type `AccessMode` with values `AccessModeAudit`, `AccessModeEnforced`, `AccessModeLearning` +- New enum type `CreatedByType` with values `CreatedByTypeApplication`, `CreatedByTypeKey`, `CreatedByTypeManagedIdentity`, `CreatedByTypeUser` +- New enum type `NspAccessRuleDirection` with values `NspAccessRuleDirectionInbound`, `NspAccessRuleDirectionOutbound` +- New enum type `ProvisioningState` with values `ProvisioningStateAccepted`, `ProvisioningStateCreating`, `ProvisioningStateDeleting`, `ProvisioningStateFailed`, `ProvisioningStateSucceeded`, `ProvisioningStateUpdating` +- New enum type `Severity` with values `SeverityError`, `SeverityWarning` +- New function `*ClientFactory.NewNetworkSecurityPerimeterConfigurationsClient() *NetworkSecurityPerimeterConfigurationsClient` +- New function `*TestChatChannel.GetChannel() *Channel` +- New function `NewNetworkSecurityPerimeterConfigurationsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*NetworkSecurityPerimeterConfigurationsClient, error)` +- New function `*NetworkSecurityPerimeterConfigurationsClient.Get(context.Context, string, string, string, *NetworkSecurityPerimeterConfigurationsClientGetOptions) (NetworkSecurityPerimeterConfigurationsClientGetResponse, error)` +- New function `*NetworkSecurityPerimeterConfigurationsClient.NewListPager(string, string, *NetworkSecurityPerimeterConfigurationsClientListOptions) *runtime.Pager[NetworkSecurityPerimeterConfigurationsClientListResponse]` +- New function `*NetworkSecurityPerimeterConfigurationsClient.BeginReconcile(context.Context, string, string, string, *NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions) (*runtime.Poller[NetworkSecurityPerimeterConfigurationsClientReconcileResponse], error)` +- New struct `NetworkSecurityPerimeter` +- New struct `NetworkSecurityPerimeterConfiguration` +- New struct `NetworkSecurityPerimeterConfigurationList` +- New struct `NetworkSecurityPerimeterConfigurationProperties` +- New struct `NspAccessRule` +- New struct `NspAccessRuleProperties` +- New struct `NspAccessRulePropertiesSubscriptionsItem` +- New struct `Profile` +- New struct `ProvisioningIssue` +- New struct `ProvisioningIssueProperties` +- New struct `ResourceAssociation` +- New struct `SystemData` +- New struct `TestChatChannel` +- New field `SystemData` in struct `Bot` +- New field `SystemData` in struct `BotChannel` +- New field `NetworkSecurityPerimeterConfigurations` in struct `BotProperties` +- New field `SystemData` in struct `ConnectionSetting` +- New field `ID`, `Name` in struct `ConnectionSettingProperties` +- New field `SystemData` in struct `ListChannelWithKeysResponse` +- New field `SystemData` in struct `PrivateEndpointConnection` +- New field `NextLink` in struct `PrivateEndpointConnectionListResult` + + ## 1.2.0 (2023-11-24) ### Features Added diff --git a/sdk/resourcemanager/botservice/armbotservice/README.md b/sdk/resourcemanager/botservice/armbotservice/README.md index 41d718db6781..5567abf5cbf7 100644 --- a/sdk/resourcemanager/botservice/armbotservice/README.md +++ b/sdk/resourcemanager/botservice/armbotservice/README.md @@ -18,7 +18,7 @@ This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for ve Install the Azure Bot Service module: ```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice/v2 ``` ## Authorization @@ -55,7 +55,7 @@ clientFactory, err := armbotservice.NewClientFactory(, cred, &o A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory. ```go -client := clientFactory.NewBotsClient() +client := clientFactory.NewBotConnectionClient() ``` ## Fakes diff --git a/sdk/resourcemanager/botservice/armbotservice/autorest.md b/sdk/resourcemanager/botservice/armbotservice/autorest.md deleted file mode 100644 index 6fc18ed9fd2b..000000000000 --- a/sdk/resourcemanager/botservice/armbotservice/autorest.md +++ /dev/null @@ -1,12 +0,0 @@ -### AutoRest Configuration - -> see https://aka.ms/autorest - -``` yaml -azure-arm: true -require: -- https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/readme.go.md -license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.2.0 -``` \ No newline at end of file diff --git a/sdk/resourcemanager/botservice/armbotservice/botconnection_client.go b/sdk/resourcemanager/botservice/armbotservice/botconnection_client.go index faa0b848c06e..8ae0ed4c26a4 100644 --- a/sdk/resourcemanager/botservice/armbotservice/botconnection_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/botconnection_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice @@ -28,7 +24,7 @@ type BotConnectionClient struct { } // NewBotConnectionClient creates a new instance of BotConnectionClient with the specified values. -// - subscriptionID - Azure Subscription ID. +// - 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 NewBotConnectionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BotConnectionClient, error) { @@ -46,8 +42,8 @@ func NewBotConnectionClient(subscriptionID string, credential azcore.TokenCreden // Create - Register a new Auth Connection for a Bot Service // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-09-15 -// - resourceGroupName - The name of the Bot resource group in the user subscription. +// Generated from API version 2023-09-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the Bot resource. // - connectionName - The name of the Bot Service Connection Setting resource. // - parameters - The parameters to provide for creating the Connection Setting. @@ -75,8 +71,12 @@ func (client *BotConnectionClient) Create(ctx context.Context, resourceGroupName } // createCreateRequest creates the Create request. -func (client *BotConnectionClient) createCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, connectionName string, parameters ConnectionSetting, options *BotConnectionClientCreateOptions) (*policy.Request, error) { +func (client *BotConnectionClient) createCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, connectionName string, parameters ConnectionSetting, _ *BotConnectionClientCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}" + 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") } @@ -89,18 +89,15 @@ func (client *BotConnectionClient) createCreateRequest(ctx context.Context, reso return nil, errors.New("parameter connectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -119,8 +116,8 @@ func (client *BotConnectionClient) createHandleResponse(resp *http.Response) (Bo // Delete - Deletes a Connection Setting registration for a Bot Service // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-09-15 -// - resourceGroupName - The name of the Bot resource group in the user subscription. +// Generated from API version 2023-09-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the Bot resource. // - connectionName - The name of the Bot Service Connection Setting resource. // - options - BotConnectionClientDeleteOptions contains the optional parameters for the BotConnectionClient.Delete method. @@ -146,8 +143,12 @@ func (client *BotConnectionClient) Delete(ctx context.Context, resourceGroupName } // deleteCreateRequest creates the Delete request. -func (client *BotConnectionClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, connectionName string, options *BotConnectionClientDeleteOptions) (*policy.Request, error) { +func (client *BotConnectionClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, connectionName string, _ *BotConnectionClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}" + 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") } @@ -160,26 +161,21 @@ func (client *BotConnectionClient) deleteCreateRequest(ctx context.Context, reso return nil, errors.New("parameter connectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Get a Connection Setting registration for a Bot Service // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-09-15 -// - resourceGroupName - The name of the Bot resource group in the user subscription. +// Generated from API version 2023-09-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the Bot resource. // - connectionName - The name of the Bot Service Connection Setting resource. // - options - BotConnectionClientGetOptions contains the optional parameters for the BotConnectionClient.Get method. @@ -206,8 +202,12 @@ func (client *BotConnectionClient) Get(ctx context.Context, resourceGroupName st } // getCreateRequest creates the Get request. -func (client *BotConnectionClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, connectionName string, options *BotConnectionClientGetOptions) (*policy.Request, error) { +func (client *BotConnectionClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, connectionName string, _ *BotConnectionClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}" + 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") } @@ -220,16 +220,12 @@ func (client *BotConnectionClient) getCreateRequest(ctx context.Context, resourc return nil, errors.New("parameter connectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -246,8 +242,8 @@ func (client *BotConnectionClient) getHandleResponse(resp *http.Response) (BotCo // NewListByBotServicePager - Returns all the Connection Settings registered to a particular BotService resource // -// Generated from API version 2022-09-15 -// - resourceGroupName - The name of the Bot resource group in the user subscription. +// Generated from API version 2023-09-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the Bot resource. // - options - BotConnectionClientListByBotServiceOptions contains the optional parameters for the BotConnectionClient.NewListByBotServicePager // method. @@ -275,8 +271,12 @@ func (client *BotConnectionClient) NewListByBotServicePager(resourceGroupName st } // listByBotServiceCreateRequest creates the ListByBotService request. -func (client *BotConnectionClient) listByBotServiceCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *BotConnectionClientListByBotServiceOptions) (*policy.Request, error) { +func (client *BotConnectionClient) listByBotServiceCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, _ *BotConnectionClientListByBotServiceOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections" + 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") } @@ -285,16 +285,12 @@ func (client *BotConnectionClient) listByBotServiceCreateRequest(ctx context.Con return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -312,7 +308,7 @@ func (client *BotConnectionClient) listByBotServiceHandleResponse(resp *http.Res // ListServiceProviders - Lists the available Service Providers for creating Connection Settings // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-09-15 +// Generated from API version 2023-09-15-preview // - options - BotConnectionClientListServiceProvidersOptions contains the optional parameters for the BotConnectionClient.ListServiceProviders // method. func (client *BotConnectionClient) ListServiceProviders(ctx context.Context, options *BotConnectionClientListServiceProvidersOptions) (BotConnectionClientListServiceProvidersResponse, error) { @@ -338,7 +334,7 @@ func (client *BotConnectionClient) ListServiceProviders(ctx context.Context, opt } // listServiceProvidersCreateRequest creates the ListServiceProviders request. -func (client *BotConnectionClient) listServiceProvidersCreateRequest(ctx context.Context, options *BotConnectionClientListServiceProvidersOptions) (*policy.Request, error) { +func (client *BotConnectionClient) listServiceProvidersCreateRequest(ctx context.Context, _ *BotConnectionClientListServiceProvidersOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.BotService/listAuthServiceProviders" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -349,7 +345,7 @@ func (client *BotConnectionClient) listServiceProvidersCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -367,8 +363,8 @@ func (client *BotConnectionClient) listServiceProvidersHandleResponse(resp *http // ListWithSecrets - Get a Connection Setting registration for a Bot Service // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-09-15 -// - resourceGroupName - The name of the Bot resource group in the user subscription. +// Generated from API version 2023-09-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the Bot resource. // - connectionName - The name of the Bot Service Connection Setting resource. // - options - BotConnectionClientListWithSecretsOptions contains the optional parameters for the BotConnectionClient.ListWithSecrets @@ -396,8 +392,12 @@ func (client *BotConnectionClient) ListWithSecrets(ctx context.Context, resource } // listWithSecretsCreateRequest creates the ListWithSecrets request. -func (client *BotConnectionClient) listWithSecretsCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, connectionName string, options *BotConnectionClientListWithSecretsOptions) (*policy.Request, error) { +func (client *BotConnectionClient) listWithSecretsCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, connectionName string, _ *BotConnectionClientListWithSecretsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}/listWithSecrets" + 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") } @@ -410,16 +410,12 @@ func (client *BotConnectionClient) listWithSecretsCreateRequest(ctx context.Cont return nil, errors.New("parameter connectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -437,8 +433,8 @@ func (client *BotConnectionClient) listWithSecretsHandleResponse(resp *http.Resp // Update - Updates a Connection Setting registration for a Bot Service // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-09-15 -// - resourceGroupName - The name of the Bot resource group in the user subscription. +// Generated from API version 2023-09-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the Bot resource. // - connectionName - The name of the Bot Service Connection Setting resource. // - parameters - The parameters to provide for updating the Connection Setting. @@ -466,8 +462,12 @@ func (client *BotConnectionClient) Update(ctx context.Context, resourceGroupName } // updateCreateRequest creates the Update request. -func (client *BotConnectionClient) updateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, connectionName string, parameters ConnectionSetting, options *BotConnectionClientUpdateOptions) (*policy.Request, error) { +func (client *BotConnectionClient) updateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, connectionName string, parameters ConnectionSetting, _ *BotConnectionClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}" + 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") } @@ -480,18 +480,15 @@ func (client *BotConnectionClient) updateCreateRequest(ctx context.Context, reso return nil, errors.New("parameter connectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/botservice/armbotservice/botconnection_client_example_test.go b/sdk/resourcemanager/botservice/armbotservice/botconnection_client_example_test.go index 9d00e11ef482..07a6060a909d 100644 --- a/sdk/resourcemanager/botservice/armbotservice/botconnection_client_example_test.go +++ b/sdk/resourcemanager/botservice/armbotservice/botconnection_client_example_test.go @@ -1,282 +1,356 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice_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/botservice/armbotservice" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListServiceProviders.json -func ExampleBotConnectionClient_ListServiceProviders() { +// Generated from example definition: 2023-09-15-preview/PutConnection.json +func ExampleBotConnectionClient_Create() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewBotConnectionClient().ListServiceProviders(ctx, nil) + res, err := clientFactory.NewBotConnectionClient().Create(ctx, "OneResourceGroupName", "samplebotname", "sampleConnection", armbotservice.ConnectionSetting{ + Etag: to.Ptr("etag1"), + Location: to.Ptr("West US"), + Properties: &armbotservice.ConnectionSettingProperties{ + ClientID: to.Ptr("sampleclientid"), + ClientSecret: to.Ptr("samplesecret"), + Parameters: []*armbotservice.ConnectionSettingParameter{ + { + Key: to.Ptr("key1"), + Value: to.Ptr("value1"), + }, + { + Key: to.Ptr("key2"), + Value: to.Ptr("value2"), + }, + }, + Scopes: to.Ptr("samplescope"), + ServiceProviderID: to.Ptr("serviceproviderid"), + }, + }, 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.ServiceProviderResponseList = armbotservice.ServiceProviderResponseList{ - // Value: []*armbotservice.ServiceProvider{ - // { - // Properties: &armbotservice.ServiceProviderProperties{ - // DevPortalURL: to.Ptr("sampleDevPortalUrl"), - // DisplayName: to.Ptr("sample service provider display name"), - // IconURL: to.Ptr("sampleIconUrl"), - // ID: to.Ptr("sampleServiceProviderId"), - // Parameters: []*armbotservice.ServiceProviderParameter{ - // { - // Name: to.Ptr("sampleParameterName"), - // Type: to.Ptr("sampleParameterType"), - // Description: to.Ptr("sampleDescription"), - // Default: to.Ptr("sampleDefaultValue"), - // DisplayName: to.Ptr("sampleDisplayName"), - // HelpURL: to.Ptr("sampleHelpUrl"), - // }}, - // ServiceProviderName: to.Ptr("sampleServiceProvider"), + // res = armbotservice.BotConnectionClientCreateResponse{ + // ConnectionSetting: &armbotservice.ConnectionSetting{ + // Name: to.Ptr("sampleConnection"), + // Etag: to.Ptr("etag1"), + // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.BotService/botServices/samplebotname/connections/sampleConnection"), + // Location: to.Ptr("global"), + // Properties: &armbotservice.ConnectionSettingProperties{ + // Name: to.Ptr("sampleConnection"), + // ClientID: to.Ptr("sampleclientid"), + // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.BotService/botServices/samplebotname/connections/sampleConnection"), + // Parameters: []*armbotservice.ConnectionSettingParameter{ + // { + // Key: to.Ptr("key1"), + // Value: to.Ptr("value1"), + // }, + // { + // Key: to.Ptr("key2"), + // Value: to.Ptr("value2"), + // }, // }, - // }}, + // Scopes: to.Ptr("samplescope"), + // ServiceProviderDisplayName: to.Ptr("serviceProviderDisplayName"), + // ServiceProviderID: to.Ptr("serviceproviderid"), + // }, + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetConnection.json -func ExampleBotConnectionClient_ListWithSecrets() { +// Generated from example definition: 2023-09-15-preview/DeleteConnection.json +func ExampleBotConnectionClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewBotConnectionClient().ListWithSecrets(ctx, "OneResourceGroupName", "samplebotname", "sampleConnection", nil) + res, err := clientFactory.NewBotConnectionClient().Delete(ctx, "OneResourceGroupName", "samplebotname", "sampleConnection", 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.ConnectionSetting = armbotservice.ConnectionSetting{ - // Name: to.Ptr("sampleConnection"), - // Etag: to.Ptr("etag1"), - // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.BotService/botServices/samplebotname/connections/sampleConnection"), - // Location: to.Ptr("global"), - // Properties: &armbotservice.ConnectionSettingProperties{ - // ClientID: to.Ptr("sampleclientid"), - // Parameters: []*armbotservice.ConnectionSettingParameter{ - // { - // Key: to.Ptr("key1"), - // Value: to.Ptr("value1"), - // }, - // { - // Key: to.Ptr("key2"), - // Value: to.Ptr("value2"), - // }}, - // Scopes: to.Ptr("samplescope"), - // ServiceProviderDisplayName: to.Ptr("serviceProviderDisplayName"), - // ServiceProviderID: to.Ptr("serviceproviderid"), - // }, + // res = armbotservice.BotConnectionClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutConnection.json -func ExampleBotConnectionClient_Create() { +// Generated from example definition: 2023-09-15-preview/GetConnection.json +func ExampleBotConnectionClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewBotConnectionClient().Create(ctx, "OneResourceGroupName", "samplebotname", "sampleConnection", armbotservice.ConnectionSetting{ - Etag: to.Ptr("etag1"), - Location: to.Ptr("West US"), - Properties: &armbotservice.ConnectionSettingProperties{ - ClientID: to.Ptr("sampleclientid"), - ClientSecret: to.Ptr("samplesecret"), - Parameters: []*armbotservice.ConnectionSettingParameter{ - { - Key: to.Ptr("key1"), - Value: to.Ptr("value1"), - }, - { - Key: to.Ptr("key2"), - Value: to.Ptr("value2"), - }}, - Scopes: to.Ptr("samplescope"), - ServiceProviderID: to.Ptr("serviceproviderid"), - }, - }, nil) + res, err := clientFactory.NewBotConnectionClient().Get(ctx, "OneResourceGroupName", "samplebotname", "sampleConnection", 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.ConnectionSetting = armbotservice.ConnectionSetting{ - // Name: to.Ptr("sampleConnection"), - // Etag: to.Ptr("etag1"), - // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.BotService/botServices/samplebotname/connections/sampleConnection"), - // Location: to.Ptr("global"), - // Properties: &armbotservice.ConnectionSettingProperties{ - // ClientID: to.Ptr("sampleclientid"), - // Parameters: []*armbotservice.ConnectionSettingParameter{ - // { - // Key: to.Ptr("key1"), - // Value: to.Ptr("value1"), + // res = armbotservice.BotConnectionClientGetResponse{ + // ConnectionSetting: &armbotservice.ConnectionSetting{ + // Name: to.Ptr("sampleConnection"), + // Etag: to.Ptr("etag1"), + // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.BotService/botServices/samplebotname/connections/sampleConnection"), + // Location: to.Ptr("global"), + // Properties: &armbotservice.ConnectionSettingProperties{ + // Name: to.Ptr("sampleConnection"), + // ClientID: to.Ptr("sampleclientid"), + // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.BotService/botServices/samplebotname/connections/sampleConnection"), + // Parameters: []*armbotservice.ConnectionSettingParameter{ + // { + // Key: to.Ptr("key1"), + // Value: to.Ptr("value1"), + // }, + // { + // Key: to.Ptr("key2"), + // Value: to.Ptr("value2"), + // }, // }, - // { - // Key: to.Ptr("key2"), - // Value: to.Ptr("value2"), - // }}, - // Scopes: to.Ptr("samplescope"), - // ServiceProviderDisplayName: to.Ptr("serviceProviderDisplayName"), - // ServiceProviderID: to.Ptr("serviceproviderid"), + // Scopes: to.Ptr("samplescope"), + // ServiceProviderDisplayName: to.Ptr("serviceProviderDisplayName"), + // ServiceProviderID: to.Ptr("serviceproviderid"), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateConnection.json -func ExampleBotConnectionClient_Update() { +// Generated from example definition: 2023-09-15-preview/ListConnectionsByBotService.json +func ExampleBotConnectionClient_NewListByBotServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewBotConnectionClient().Update(ctx, "OneResourceGroupName", "samplebotname", "sampleConnection", armbotservice.ConnectionSetting{ - Etag: to.Ptr("etag1"), - Location: to.Ptr("global"), - Properties: &armbotservice.ConnectionSettingProperties{ - ClientID: to.Ptr("sampleclientid"), - ClientSecret: to.Ptr("samplesecret"), - Parameters: []*armbotservice.ConnectionSettingParameter{ - { - Key: to.Ptr("key1"), - Value: to.Ptr("value1"), - }, - { - Key: to.Ptr("key2"), - Value: to.Ptr("value2"), - }}, - Scopes: to.Ptr("samplescope"), - ServiceProviderDisplayName: to.Ptr("serviceProviderDisplayName"), - ServiceProviderID: to.Ptr("serviceproviderid"), - }, - }, nil) + pager := clientFactory.NewBotConnectionClient().NewListByBotServicePager("OneResourceGroupName", "samplebotname", 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 = armbotservice.BotConnectionClientListByBotServiceResponse{ + // ConnectionSettingResponseList: armbotservice.ConnectionSettingResponseList{ + // Value: []*armbotservice.ConnectionSetting{ + // { + // Name: to.Ptr("sampleConnection"), + // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), + // Properties: &armbotservice.ConnectionSettingProperties{ + // Name: to.Ptr("sampleConnection"), + // ClientID: to.Ptr("sampleclientid"), + // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), + // Parameters: []*armbotservice.ConnectionSettingParameter{ + // { + // Key: to.Ptr("key1"), + // Value: to.Ptr("value1"), + // }, + // { + // Key: to.Ptr("key2"), + // Value: to.Ptr("value2"), + // }, + // }, + // Scopes: to.Ptr("samplescope"), + // ServiceProviderID: to.Ptr("serviceproviderid"), + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2023-09-15-preview/ListServiceProviders.json +func ExampleBotConnectionClient_ListServiceProviders() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewBotConnectionClient().ListServiceProviders(ctx, 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.ConnectionSetting = armbotservice.ConnectionSetting{ - // Name: to.Ptr("sampleConnection"), - // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.BotService/botServices/samplebotname/connections/sampleConnection"), - // Location: to.Ptr("global"), - // Properties: &armbotservice.ConnectionSettingProperties{ - // ClientID: to.Ptr("sampleclientid"), - // Parameters: []*armbotservice.ConnectionSettingParameter{ + // res = armbotservice.BotConnectionClientListServiceProvidersResponse{ + // ServiceProviderResponseList: &armbotservice.ServiceProviderResponseList{ + // Value: []*armbotservice.ServiceProvider{ // { - // Key: to.Ptr("key1"), - // Value: to.Ptr("value1"), + // Properties: &armbotservice.ServiceProviderProperties{ + // DevPortalURL: to.Ptr("sampleDevPortalUrl"), + // DisplayName: to.Ptr("sample service provider display name"), + // IconURL: to.Ptr("sampleIconUrl"), + // ID: to.Ptr("sampleServiceProviderId"), + // Parameters: []*armbotservice.ServiceProviderParameter{ + // { + // Name: to.Ptr("sampleParameterName"), + // Type: to.Ptr("sampleParameterType"), + // Description: to.Ptr("sampleDescription"), + // Default: to.Ptr("sampleDefaultValue"), + // DisplayName: to.Ptr("sampleDisplayName"), + // HelpURL: to.Ptr("sampleHelpUrl"), + // }, + // }, + // ServiceProviderName: to.Ptr("sampleServiceProvider"), + // }, // }, - // { - // Key: to.Ptr("key2"), - // Value: to.Ptr("value2"), - // }}, - // Scopes: to.Ptr("samplescope"), - // ServiceProviderDisplayName: to.Ptr("serviceProviderDisplayName"), - // ServiceProviderID: to.Ptr("serviceproviderid"), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeleteConnection.json -func ExampleBotConnectionClient_Delete() { +// Generated from example definition: 2023-09-15-preview/GetConnectionListWithSecrets.json +func ExampleBotConnectionClient_ListWithSecrets() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = clientFactory.NewBotConnectionClient().Delete(ctx, "OneResourceGroupName", "samplebotname", "sampleConnection", nil) + res, err := clientFactory.NewBotConnectionClient().ListWithSecrets(ctx, "OneResourceGroupName", "samplebotname", "sampleConnection", 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 = armbotservice.BotConnectionClientListWithSecretsResponse{ + // ConnectionSetting: &armbotservice.ConnectionSetting{ + // Name: to.Ptr("sampleConnection"), + // Etag: to.Ptr("etag1"), + // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.BotService/botServices/samplebotname/connections/sampleConnection"), + // Location: to.Ptr("global"), + // Properties: &armbotservice.ConnectionSettingProperties{ + // Name: to.Ptr("sampleConnection"), + // ClientID: to.Ptr("sampleclientid"), + // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.BotService/botServices/samplebotname/connections/sampleConnection"), + // Parameters: []*armbotservice.ConnectionSettingParameter{ + // { + // Key: to.Ptr("key1"), + // Value: to.Ptr("value1"), + // }, + // { + // Key: to.Ptr("key2"), + // Value: to.Ptr("value2"), + // }, + // }, + // Scopes: to.Ptr("samplescope"), + // ServiceProviderDisplayName: to.Ptr("serviceProviderDisplayName"), + // ServiceProviderID: to.Ptr("serviceproviderid"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListConnectionsByBotService.json -func ExampleBotConnectionClient_NewListByBotServicePager() { +// Generated from example definition: 2023-09-15-preview/UpdateConnection.json +func ExampleBotConnectionClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewBotConnectionClient().NewListByBotServicePager("OneResourceGroupName", "samplebotname", 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.ConnectionSettingResponseList = armbotservice.ConnectionSettingResponseList{ - // Value: []*armbotservice.ConnectionSetting{ - // { - // Name: to.Ptr("sampleConnection"), - // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), - // Properties: &armbotservice.ConnectionSettingProperties{ - // ClientID: to.Ptr("sampleclientid"), - // Parameters: []*armbotservice.ConnectionSettingParameter{ - // { - // Key: to.Ptr("key1"), - // Value: to.Ptr("value1"), - // }, - // { - // Key: to.Ptr("key2"), - // Value: to.Ptr("value2"), - // }}, - // Scopes: to.Ptr("samplescope"), - // ServiceProviderID: to.Ptr("serviceproviderid"), - // }, - // }}, - // } + res, err := clientFactory.NewBotConnectionClient().Update(ctx, "OneResourceGroupName", "samplebotname", "sampleConnection", armbotservice.ConnectionSetting{ + Etag: to.Ptr("etag1"), + Location: to.Ptr("global"), + Properties: &armbotservice.ConnectionSettingProperties{ + Name: to.Ptr("sampleName"), + ClientID: to.Ptr("sampleclientid"), + ClientSecret: to.Ptr("samplesecret"), + ID: to.Ptr("sampleId"), + Parameters: []*armbotservice.ConnectionSettingParameter{ + { + Key: to.Ptr("key1"), + Value: to.Ptr("value1"), + }, + { + Key: to.Ptr("key2"), + Value: to.Ptr("value2"), + }, + }, + Scopes: to.Ptr("samplescope"), + ServiceProviderDisplayName: to.Ptr("serviceProviderDisplayName"), + ServiceProviderID: to.Ptr("serviceproviderid"), + }, + }, 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 = armbotservice.BotConnectionClientUpdateResponse{ + // ConnectionSetting: &armbotservice.ConnectionSetting{ + // Name: to.Ptr("sampleConnection"), + // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.BotService/botServices/samplebotname/connections/sampleConnection"), + // Location: to.Ptr("global"), + // Properties: &armbotservice.ConnectionSettingProperties{ + // Name: to.Ptr("sampleConnection"), + // ClientID: to.Ptr("sampleclientid"), + // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.BotService/botServices/samplebotname/connections/sampleConnection"), + // Parameters: []*armbotservice.ConnectionSettingParameter{ + // { + // Key: to.Ptr("key1"), + // Value: to.Ptr("value1"), + // }, + // { + // Key: to.Ptr("key2"), + // Value: to.Ptr("value2"), + // }, + // }, + // Scopes: to.Ptr("samplescope"), + // ServiceProviderDisplayName: to.Ptr("serviceProviderDisplayName"), + // ServiceProviderID: to.Ptr("serviceproviderid"), + // }, + // }, + // } } diff --git a/sdk/resourcemanager/botservice/armbotservice/bots_client.go b/sdk/resourcemanager/botservice/armbotservice/bots_client.go index cb61b5f3ebe3..29036e9b2a84 100644 --- a/sdk/resourcemanager/botservice/armbotservice/bots_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/bots_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice @@ -28,7 +24,7 @@ type BotsClient struct { } // NewBotsClient creates a new instance of BotsClient with the specified values. -// - subscriptionID - Azure Subscription ID. +// - 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 NewBotsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BotsClient, error) { @@ -46,8 +42,8 @@ func NewBotsClient(subscriptionID string, credential azcore.TokenCredential, opt // Create - Creates a Bot Service. Bot Service is a resource group wide resource type. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-09-15 -// - resourceGroupName - The name of the Bot resource group in the user subscription. +// Generated from API version 2023-09-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the Bot resource. // - parameters - The parameters to provide for the created bot. // - options - BotsClientCreateOptions contains the optional parameters for the BotsClient.Create method. @@ -74,8 +70,12 @@ func (client *BotsClient) Create(ctx context.Context, resourceGroupName string, } // createCreateRequest creates the Create request. -func (client *BotsClient) createCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, parameters Bot, options *BotsClientCreateOptions) (*policy.Request, error) { +func (client *BotsClient) createCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, parameters Bot, _ *BotsClientCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -84,18 +84,15 @@ func (client *BotsClient) createCreateRequest(ctx context.Context, resourceGroup return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -114,8 +111,8 @@ func (client *BotsClient) createHandleResponse(resp *http.Response) (BotsClientC // Delete - Deletes a Bot Service from the resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-09-15 -// - resourceGroupName - The name of the Bot resource group in the user subscription. +// Generated from API version 2023-09-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the Bot resource. // - options - BotsClientDeleteOptions contains the optional parameters for the BotsClient.Delete method. func (client *BotsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, options *BotsClientDeleteOptions) (BotsClientDeleteResponse, error) { @@ -140,8 +137,12 @@ func (client *BotsClient) Delete(ctx context.Context, resourceGroupName string, } // deleteCreateRequest creates the Delete request. -func (client *BotsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *BotsClientDeleteOptions) (*policy.Request, error) { +func (client *BotsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, _ *BotsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -150,26 +151,21 @@ func (client *BotsClient) deleteCreateRequest(ctx context.Context, resourceGroup return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Returns a BotService specified by the parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-09-15 -// - resourceGroupName - The name of the Bot resource group in the user subscription. +// Generated from API version 2023-09-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the Bot resource. // - options - BotsClientGetOptions contains the optional parameters for the BotsClient.Get method. func (client *BotsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, options *BotsClientGetOptions) (BotsClientGetResponse, error) { @@ -195,8 +191,12 @@ func (client *BotsClient) Get(ctx context.Context, resourceGroupName string, res } // getCreateRequest creates the Get request. -func (client *BotsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *BotsClientGetOptions) (*policy.Request, error) { +func (client *BotsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, _ *BotsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -205,16 +205,12 @@ func (client *BotsClient) getCreateRequest(ctx context.Context, resourceGroupNam return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -232,8 +228,8 @@ func (client *BotsClient) getHandleResponse(resp *http.Response) (BotsClientGetR // GetCheckNameAvailability - Check whether a bot name is available. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-09-15 -// - parameters - The request body parameters to provide for the check name availability request +// Generated from API version 2023-09-15-preview +// - parameters - The request body // - options - BotsClientGetCheckNameAvailabilityOptions contains the optional parameters for the BotsClient.GetCheckNameAvailability // method. func (client *BotsClient) GetCheckNameAvailability(ctx context.Context, parameters CheckNameAvailabilityRequestBody, options *BotsClientGetCheckNameAvailabilityOptions) (BotsClientGetCheckNameAvailabilityResponse, error) { @@ -259,16 +255,17 @@ func (client *BotsClient) GetCheckNameAvailability(ctx context.Context, paramete } // getCheckNameAvailabilityCreateRequest creates the GetCheckNameAvailability request. -func (client *BotsClient) getCheckNameAvailabilityCreateRequest(ctx context.Context, parameters CheckNameAvailabilityRequestBody, options *BotsClientGetCheckNameAvailabilityOptions) (*policy.Request, error) { +func (client *BotsClient) getCheckNameAvailabilityCreateRequest(ctx context.Context, parameters CheckNameAvailabilityRequestBody, _ *BotsClientGetCheckNameAvailabilityOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.BotService/checkNameAvailability" req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -286,7 +283,7 @@ func (client *BotsClient) getCheckNameAvailabilityHandleResponse(resp *http.Resp // NewListPager - Returns all the resources of a particular type belonging to a subscription. // -// Generated from API version 2022-09-15 +// Generated from API version 2023-09-15-preview // - options - BotsClientListOptions contains the optional parameters for the BotsClient.NewListPager method. func (client *BotsClient) NewListPager(options *BotsClientListOptions) *runtime.Pager[BotsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[BotsClientListResponse]{ @@ -312,7 +309,7 @@ func (client *BotsClient) NewListPager(options *BotsClientListOptions) *runtime. } // listCreateRequest creates the List request. -func (client *BotsClient) listCreateRequest(ctx context.Context, options *BotsClientListOptions) (*policy.Request, error) { +func (client *BotsClient) listCreateRequest(ctx context.Context, _ *BotsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.BotService/botServices" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -323,7 +320,7 @@ func (client *BotsClient) listCreateRequest(ctx context.Context, options *BotsCl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -340,8 +337,8 @@ func (client *BotsClient) listHandleResponse(resp *http.Response) (BotsClientLis // NewListByResourceGroupPager - Returns all the resources of a particular type belonging to a resource group // -// Generated from API version 2022-09-15 -// - resourceGroupName - The name of the Bot resource group in the user subscription. +// Generated from API version 2023-09-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - BotsClientListByResourceGroupOptions contains the optional parameters for the BotsClient.NewListByResourceGroupPager // method. func (client *BotsClient) NewListByResourceGroupPager(resourceGroupName string, options *BotsClientListByResourceGroupOptions) *runtime.Pager[BotsClientListByResourceGroupResponse] { @@ -368,22 +365,22 @@ func (client *BotsClient) NewListByResourceGroupPager(resourceGroupName string, } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *BotsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *BotsClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *BotsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *BotsClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -401,8 +398,8 @@ func (client *BotsClient) listByResourceGroupHandleResponse(resp *http.Response) // Update - Updates a Bot Service // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-09-15 -// - resourceGroupName - The name of the Bot resource group in the user subscription. +// Generated from API version 2023-09-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the Bot resource. // - parameters - The parameters to provide for the created bot. // - options - BotsClientUpdateOptions contains the optional parameters for the BotsClient.Update method. @@ -429,8 +426,12 @@ func (client *BotsClient) Update(ctx context.Context, resourceGroupName string, } // updateCreateRequest creates the Update request. -func (client *BotsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, parameters Bot, options *BotsClientUpdateOptions) (*policy.Request, error) { +func (client *BotsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, parameters Bot, _ *BotsClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -439,18 +440,15 @@ func (client *BotsClient) updateCreateRequest(ctx context.Context, resourceGroup return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/botservice/armbotservice/bots_client_example_test.go b/sdk/resourcemanager/botservice/armbotservice/bots_client_example_test.go index 24b92a0207bc..07302f31ab2b 100644 --- a/sdk/resourcemanager/botservice/armbotservice/bots_client_example_test.go +++ b/sdk/resourcemanager/botservice/armbotservice/bots_client_example_test.go @@ -1,31 +1,25 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice_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/botservice/armbotservice" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/CreateBot.json +// Generated from example definition: 2023-09-15-preview/CreateBot.json func ExampleBotsClient_Create() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -33,13 +27,6 @@ func ExampleBotsClient_Create() { Etag: to.Ptr("etag1"), Kind: to.Ptr(armbotservice.KindSdk), Location: to.Ptr("West US"), - SKU: &armbotservice.SKU{ - Name: to.Ptr(armbotservice.SKUNameS1), - }, - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, Properties: &armbotservice.BotProperties{ Description: to.Ptr("The description of the bot"), CmekKeyVaultURL: to.Ptr("https://myCmekKey"), @@ -53,7 +40,8 @@ func ExampleBotsClient_Create() { IsCmekEnabled: to.Ptr(true), LuisAppIDs: []*string{ to.Ptr("luisappid1"), - to.Ptr("luisappid2")}, + to.Ptr("luisappid2"), + }, LuisKey: to.Ptr("luiskey"), MsaAppID: to.Ptr("exampleappid"), MsaAppMSIResourceID: to.Ptr("/subscriptions/foo/resourcegroups/bar/providers/microsoft.managedidentity/userassignedidentities/sampleId"), @@ -62,6 +50,13 @@ func ExampleBotsClient_Create() { PublicNetworkAccess: to.Ptr(armbotservice.PublicNetworkAccessEnabled), SchemaTransformationVersion: to.Ptr("1.0"), }, + SKU: &armbotservice.SKU{ + Name: to.Ptr(armbotservice.SKUNameS1), + }, + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -69,239 +64,195 @@ func ExampleBotsClient_Create() { // 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.Bot = armbotservice.Bot{ - // Name: to.Ptr("samplebotname"), - // Type: to.Ptr("Microsoft.BotService/botServices"), - // Etag: to.Ptr("etag1"), - // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.BotService/botServices/samplebotname"), - // Kind: to.Ptr(armbotservice.KindSdk), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armbotservice.BotProperties{ - // Description: to.Ptr("The description of the bot"), - // CmekKeyVaultURL: to.Ptr("https://myCmekKey"), - // ConfiguredChannels: []*string{ - // to.Ptr("facebook"), - // to.Ptr("groupme")}, + // res = armbotservice.BotsClientCreateResponse{ + // Bot: &armbotservice.Bot{ + // Name: to.Ptr("samplebotname"), + // Type: to.Ptr("Microsoft.BotService/botServices"), + // Etag: to.Ptr("etag1"), + // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.BotService/botServices/samplebotname"), + // Kind: to.Ptr(armbotservice.KindSdk), + // Location: to.Ptr("West US"), + // Properties: &armbotservice.BotProperties{ + // Description: to.Ptr("The description of the bot"), + // CmekKeyVaultURL: to.Ptr("https://myCmekKey"), + // ConfiguredChannels: []*string{ + // to.Ptr("facebook"), + // to.Ptr("groupme"), + // }, // DeveloperAppInsightKey: to.Ptr("appinsightskey"), // DeveloperAppInsightsApplicationID: to.Ptr("appinsightsappid"), // DisableLocalAuth: to.Ptr(true), // DisplayName: to.Ptr("The Name of the bot"), // EnabledChannels: []*string{ - // to.Ptr("facebook")}, - // Endpoint: to.Ptr("http://mybot.coffee"), - // EndpointVersion: to.Ptr("version"), - // IconURL: to.Ptr("http://myicon"), - // IsCmekEnabled: to.Ptr(true), - // LuisAppIDs: []*string{ - // to.Ptr("luisappid1"), - // to.Ptr("luisappid2")}, - // MsaAppID: to.Ptr("msaappid"), - // MsaAppMSIResourceID: to.Ptr("/subscriptions/foo/resourcegroups/bar/providers/microsoft.managedidentity/userassignedidentities/sampleId"), - // MsaAppTenantID: to.Ptr("msaapptenantid"), - // MsaAppType: to.Ptr(armbotservice.MsaAppTypeUserAssignedMSI), - // PublicNetworkAccess: to.Ptr(armbotservice.PublicNetworkAccessEnabled), - // SchemaTransformationVersion: to.Ptr("1.0"), - // }, - // } + // to.Ptr("facebook"), + // }, + // Endpoint: to.Ptr("http://mybot.coffee"), + // EndpointVersion: to.Ptr("version"), + // IconURL: to.Ptr("http://myicon"), + // IsCmekEnabled: to.Ptr(true), + // LuisAppIDs: []*string{ + // to.Ptr("luisappid1"), + // to.Ptr("luisappid2"), + // }, + // MsaAppID: to.Ptr("msaappid"), + // MsaAppMSIResourceID: to.Ptr("/subscriptions/foo/resourcegroups/bar/providers/microsoft.managedidentity/userassignedidentities/sampleId"), + // MsaAppTenantID: to.Ptr("msaapptenantid"), + // MsaAppType: to.Ptr(armbotservice.MsaAppTypeUserAssignedMSI), + // PublicNetworkAccess: to.Ptr(armbotservice.PublicNetworkAccessEnabled), + // SchemaTransformationVersion: to.Ptr("1.0"), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateBot.json -func ExampleBotsClient_Update() { +// Generated from example definition: 2023-09-15-preview/DeleteBot.json +func ExampleBotsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewBotsClient().Update(ctx, "OneResourceGroupName", "samplebotname", armbotservice.Bot{ - Etag: to.Ptr("etag1"), - Kind: to.Ptr(armbotservice.KindSdk), - Location: to.Ptr("West US"), - SKU: &armbotservice.SKU{ - Name: to.Ptr(armbotservice.SKUNameS1), - }, - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - Properties: &armbotservice.BotProperties{ - Description: to.Ptr("The description of the bot"), - CmekKeyVaultURL: to.Ptr("https://myCmekKey"), - DeveloperAppInsightKey: to.Ptr("appinsightskey"), - DeveloperAppInsightsAPIKey: to.Ptr("appinsightsapikey"), - DeveloperAppInsightsApplicationID: to.Ptr("appinsightsappid"), - DisableLocalAuth: to.Ptr(true), - DisplayName: to.Ptr("The Name of the bot"), - Endpoint: to.Ptr("http://mybot.coffee"), - IconURL: to.Ptr("http://myicon"), - IsCmekEnabled: to.Ptr(true), - LuisAppIDs: []*string{ - to.Ptr("luisappid1"), - to.Ptr("luisappid2")}, - LuisKey: to.Ptr("luiskey"), - MsaAppID: to.Ptr("msaappid"), - MsaAppMSIResourceID: to.Ptr("/subscriptions/foo/resourcegroups/bar/providers/microsoft.managedidentity/userassignedidentities/sampleId"), - MsaAppTenantID: to.Ptr("msaapptenantid"), - MsaAppType: to.Ptr(armbotservice.MsaAppTypeUserAssignedMSI), - PublicNetworkAccess: to.Ptr(armbotservice.PublicNetworkAccessEnabled), - SchemaTransformationVersion: to.Ptr("1.0"), - }, - }, nil) + res, err := clientFactory.NewBotsClient().Delete(ctx, "OneResourceGroupName", "samplebotname", 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.Bot = armbotservice.Bot{ - // Name: to.Ptr("samplebotname"), - // Type: to.Ptr("Microsoft.BotService/botServices"), - // Etag: to.Ptr("etag1"), - // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.BotService/botServices/samplebotname"), - // Kind: to.Ptr(armbotservice.KindSdk), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armbotservice.BotProperties{ - // Description: to.Ptr("The description of the bot"), - // CmekKeyVaultURL: to.Ptr("https://myCmekKey"), - // ConfiguredChannels: []*string{ - // to.Ptr("facebook"), - // to.Ptr("groupme")}, - // DeveloperAppInsightKey: to.Ptr("appinsightskey"), - // DeveloperAppInsightsApplicationID: to.Ptr("appinsightsappid"), - // DisableLocalAuth: to.Ptr(true), - // DisplayName: to.Ptr("The Name of the bot"), - // EnabledChannels: []*string{ - // to.Ptr("facebook")}, - // Endpoint: to.Ptr("http://mybot.coffee"), - // EndpointVersion: to.Ptr("version"), - // IconURL: to.Ptr("http://myicon"), - // IsCmekEnabled: to.Ptr(true), - // LuisAppIDs: []*string{ - // to.Ptr("luisappid1"), - // to.Ptr("luisappid2")}, - // MsaAppID: to.Ptr("msaappid"), - // MsaAppMSIResourceID: to.Ptr("/subscriptions/foo/resourcegroups/bar/providers/microsoft.managedidentity/userassignedidentities/sampleId"), - // MsaAppTenantID: to.Ptr("msaapptenantid"), - // MsaAppType: to.Ptr(armbotservice.MsaAppTypeUserAssignedMSI), - // PublicNetworkAccess: to.Ptr(armbotservice.PublicNetworkAccessEnabled), - // SchemaTransformationVersion: to.Ptr("1.0"), - // }, - // } + // res = armbotservice.BotsClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeleteBot.json -func ExampleBotsClient_Delete() { +// Generated from example definition: 2023-09-15-preview/GetBot.json +func ExampleBotsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = clientFactory.NewBotsClient().Delete(ctx, "OneResourceGroupName", "samplebotname", nil) + res, err := clientFactory.NewBotsClient().Get(ctx, "OneResourceGroupName", "samplebotname", 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 = armbotservice.BotsClientGetResponse{ + // Bot: &armbotservice.Bot{ + // Name: to.Ptr("samplebotname"), + // Type: to.Ptr("Microsoft.BotService/botServices"), + // Etag: to.Ptr("etag1"), + // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.BotService/botServices/samplebotname"), + // Kind: to.Ptr(armbotservice.KindSdk), + // Location: to.Ptr("West US"), + // Properties: &armbotservice.BotProperties{ + // Description: to.Ptr("The description of the bot"), + // CmekKeyVaultURL: to.Ptr("https://myCmekKey"), + // ConfiguredChannels: []*string{ + // to.Ptr("facebook"), + // to.Ptr("groupme"), + // }, + // DeveloperAppInsightKey: to.Ptr("appinsightskey"), + // DeveloperAppInsightsApplicationID: to.Ptr("appinsightsappid"), + // DisableLocalAuth: to.Ptr(true), + // DisplayName: to.Ptr("The Name of the bot"), + // EnabledChannels: []*string{ + // to.Ptr("facebook"), + // }, + // Endpoint: to.Ptr("http://mybot.coffee"), + // EndpointVersion: to.Ptr("version"), + // IconURL: to.Ptr("http://myicon"), + // IsCmekEnabled: to.Ptr(true), + // LuisAppIDs: []*string{ + // to.Ptr("luisappid1"), + // to.Ptr("luisappid2"), + // }, + // MsaAppID: to.Ptr("msaappid"), + // MsaAppMSIResourceID: to.Ptr("/subscriptions/foo/resourcegroups/bar/providers/microsoft.managedidentity/userassignedidentities/sampleId"), + // MsaAppTenantID: to.Ptr("msaapptenantid"), + // MsaAppType: to.Ptr(armbotservice.MsaAppTypeUserAssignedMSI), + // NetworkSecurityPerimeterConfigurations: []*armbotservice.NetworkSecurityPerimeterConfiguration{ + // }, + // PrivateEndpointConnections: []*armbotservice.PrivateEndpointConnection{ + // { + // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.BotService/botServices/samplebotname/privateEndpointConnections/privatelink"), + // Properties: &armbotservice.PrivateEndpointConnectionProperties{ + // PrivateEndpoint: &armbotservice.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.Network/privateEndpoints/privatelink"), + // }, + // PrivateLinkServiceConnectionState: &armbotservice.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Auto-Approved"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr(armbotservice.PrivateEndpointServiceConnectionStatusApproved), + // }, + // ProvisioningState: to.Ptr(armbotservice.PrivateEndpointConnectionProvisioningStateSucceeded), + // }, + // }, + // }, + // PublicNetworkAccess: to.Ptr(armbotservice.PublicNetworkAccessEnabled), + // SchemaTransformationVersion: to.Ptr("1.0"), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetBot.json -func ExampleBotsClient_Get() { +// Generated from example definition: 2023-09-15-preview/CheckNameAvailability.json +func ExampleBotsClient_GetCheckNameAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewBotsClient().Get(ctx, "OneResourceGroupName", "samplebotname", nil) + res, err := clientFactory.NewBotsClient().GetCheckNameAvailability(ctx, armbotservice.CheckNameAvailabilityRequestBody{ + Name: to.Ptr("testbotname"), + Type: to.Ptr("string"), + }, 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.Bot = armbotservice.Bot{ - // Name: to.Ptr("samplebotname"), - // Type: to.Ptr("Microsoft.BotService/botServices"), - // Etag: to.Ptr("etag1"), - // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.BotService/botServices/samplebotname"), - // Kind: to.Ptr(armbotservice.KindSdk), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), + // res = armbotservice.BotsClientGetCheckNameAvailabilityResponse{ + // CheckNameAvailabilityResponseBody: &armbotservice.CheckNameAvailabilityResponseBody{ + // Message: to.Ptr("custom message from server"), + // Valid: to.Ptr(true), // }, - // Properties: &armbotservice.BotProperties{ - // Description: to.Ptr("The description of the bot"), - // CmekKeyVaultURL: to.Ptr("https://myCmekKey"), - // ConfiguredChannels: []*string{ - // to.Ptr("facebook"), - // to.Ptr("groupme")}, - // DeveloperAppInsightKey: to.Ptr("appinsightskey"), - // DeveloperAppInsightsApplicationID: to.Ptr("appinsightsappid"), - // DisableLocalAuth: to.Ptr(true), - // DisplayName: to.Ptr("The Name of the bot"), - // EnabledChannels: []*string{ - // to.Ptr("facebook")}, - // Endpoint: to.Ptr("http://mybot.coffee"), - // EndpointVersion: to.Ptr("version"), - // IconURL: to.Ptr("http://myicon"), - // IsCmekEnabled: to.Ptr(true), - // LuisAppIDs: []*string{ - // to.Ptr("luisappid1"), - // to.Ptr("luisappid2")}, - // MsaAppID: to.Ptr("msaappid"), - // MsaAppMSIResourceID: to.Ptr("/subscriptions/foo/resourcegroups/bar/providers/microsoft.managedidentity/userassignedidentities/sampleId"), - // MsaAppTenantID: to.Ptr("msaapptenantid"), - // MsaAppType: to.Ptr(armbotservice.MsaAppTypeUserAssignedMSI), - // PrivateEndpointConnections: []*armbotservice.PrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.BotService/botServices/samplebotname/privateEndpointConnections/privatelink"), - // Properties: &armbotservice.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armbotservice.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.Network/privateEndpoints/privatelink"), - // }, - // PrivateLinkServiceConnectionState: &armbotservice.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armbotservice.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armbotservice.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // }}, - // PublicNetworkAccess: to.Ptr(armbotservice.PublicNetworkAccessEnabled), - // SchemaTransformationVersion: to.Ptr("1.0"), - // }, - // } + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListBotsByResourceGroup.json -func ExampleBotsClient_NewListByResourceGroupPager() { +// Generated from example definition: 2023-09-15-preview/ListBotsBySubscription.json +func ExampleBotsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewBotsClient().NewListByResourceGroupPager("OneResourceGroupName", nil) + pager := clientFactory.NewBotsClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -312,62 +263,68 @@ func ExampleBotsClient_NewListByResourceGroupPager() { _ = 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.BotResponseList = armbotservice.BotResponseList{ - // Value: []*armbotservice.Bot{ - // { - // Name: to.Ptr("samplebotname"), - // Type: to.Ptr("Microsoft.BotService/botServices"), - // Etag: to.Ptr("etag1"), - // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.BotService/botServices"), - // Kind: to.Ptr(armbotservice.KindSdk), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armbotservice.BotProperties{ - // Description: to.Ptr("The description of the bot"), - // CmekKeyVaultURL: to.Ptr("https://myCmekKey"), - // ConfiguredChannels: []*string{ - // to.Ptr("facebook"), - // to.Ptr("groupme")}, + // page = armbotservice.BotsClientListResponse{ + // BotResponseList: armbotservice.BotResponseList{ + // Value: []*armbotservice.Bot{ + // { + // Name: to.Ptr("samplebotname"), + // Type: to.Ptr("Microsoft.BotService/botServices"), + // Etag: to.Ptr("etag1"), + // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), + // Kind: to.Ptr(armbotservice.KindSdk), + // Location: to.Ptr("West US"), + // Properties: &armbotservice.BotProperties{ + // Description: to.Ptr("The description of the bot"), + // CmekKeyVaultURL: to.Ptr("https://myCmekKey"), + // ConfiguredChannels: []*string{ + // to.Ptr("facebook"), + // to.Ptr("groupme"), + // }, // DeveloperAppInsightKey: to.Ptr("appinsightskey"), // DeveloperAppInsightsApplicationID: to.Ptr("appinsightsappid"), // DisableLocalAuth: to.Ptr(true), // DisplayName: to.Ptr("The Name of the bot"), // EnabledChannels: []*string{ - // to.Ptr("facebook")}, - // Endpoint: to.Ptr("http://mybot.coffee"), - // EndpointVersion: to.Ptr("version"), - // IconURL: to.Ptr("http://myicon"), - // IsCmekEnabled: to.Ptr(true), - // LuisAppIDs: []*string{ - // to.Ptr("luisappid1"), - // to.Ptr("luisappid2")}, - // MsaAppID: to.Ptr("msaappid"), - // MsaAppMSIResourceID: to.Ptr("/subscriptions/foo/resourcegroups/bar/providers/microsoft.managedidentity/userassignedidentities/sampleId"), - // MsaAppTenantID: to.Ptr("msaapptenantid"), - // MsaAppType: to.Ptr(armbotservice.MsaAppTypeUserAssignedMSI), - // PublicNetworkAccess: to.Ptr(armbotservice.PublicNetworkAccessEnabled), - // SchemaTransformationVersion: to.Ptr("1.0"), - // }, - // }}, - // } + // to.Ptr("facebook"), + // }, + // Endpoint: to.Ptr("http://mybot.coffee"), + // EndpointVersion: to.Ptr("version"), + // IconURL: to.Ptr("http://myicon"), + // IsCmekEnabled: to.Ptr(true), + // LuisAppIDs: []*string{ + // to.Ptr("luisappid1"), + // to.Ptr("luisappid2"), + // }, + // MsaAppID: to.Ptr("msaappid"), + // MsaAppMSIResourceID: to.Ptr("/subscriptions/foo/resourcegroups/bar/providers/microsoft.managedidentity/userassignedidentities/sampleId"), + // MsaAppTenantID: to.Ptr("msaapptenantid"), + // MsaAppType: to.Ptr(armbotservice.MsaAppTypeUserAssignedMSI), + // PublicNetworkAccess: to.Ptr(armbotservice.PublicNetworkAccessEnabled), + // SchemaTransformationVersion: to.Ptr("1.0"), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListBotsBySubscription.json -func ExampleBotsClient_NewListPager() { +// Generated from example definition: 2023-09-15-preview/ListBotsByResourceGroup.json +func ExampleBotsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewBotsClient().NewListPager(nil) + pager := clientFactory.NewBotsClient().NewListByResourceGroupPager("OneResourceGroupName", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -378,64 +335,101 @@ func ExampleBotsClient_NewListPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.BotResponseList = armbotservice.BotResponseList{ - // Value: []*armbotservice.Bot{ - // { - // Name: to.Ptr("samplebotname"), - // Type: to.Ptr("Microsoft.BotService/botServices"), - // Etag: to.Ptr("etag1"), - // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), - // Kind: to.Ptr(armbotservice.KindSdk), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armbotservice.BotProperties{ - // Description: to.Ptr("The description of the bot"), - // CmekKeyVaultURL: to.Ptr("https://myCmekKey"), - // ConfiguredChannels: []*string{ - // to.Ptr("facebook"), - // to.Ptr("groupme")}, + // page = armbotservice.BotsClientListByResourceGroupResponse{ + // BotResponseList: armbotservice.BotResponseList{ + // Value: []*armbotservice.Bot{ + // { + // Name: to.Ptr("samplebotname"), + // Type: to.Ptr("Microsoft.BotService/botServices"), + // Etag: to.Ptr("etag1"), + // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.BotService/botServices"), + // Kind: to.Ptr(armbotservice.KindSdk), + // Location: to.Ptr("West US"), + // Properties: &armbotservice.BotProperties{ + // Description: to.Ptr("The description of the bot"), + // CmekKeyVaultURL: to.Ptr("https://myCmekKey"), + // ConfiguredChannels: []*string{ + // to.Ptr("facebook"), + // to.Ptr("groupme"), + // }, // DeveloperAppInsightKey: to.Ptr("appinsightskey"), // DeveloperAppInsightsApplicationID: to.Ptr("appinsightsappid"), // DisableLocalAuth: to.Ptr(true), // DisplayName: to.Ptr("The Name of the bot"), // EnabledChannels: []*string{ - // to.Ptr("facebook")}, - // Endpoint: to.Ptr("http://mybot.coffee"), - // EndpointVersion: to.Ptr("version"), - // IconURL: to.Ptr("http://myicon"), - // IsCmekEnabled: to.Ptr(true), - // LuisAppIDs: []*string{ - // to.Ptr("luisappid1"), - // to.Ptr("luisappid2")}, - // MsaAppID: to.Ptr("msaappid"), - // MsaAppMSIResourceID: to.Ptr("/subscriptions/foo/resourcegroups/bar/providers/microsoft.managedidentity/userassignedidentities/sampleId"), - // MsaAppTenantID: to.Ptr("msaapptenantid"), - // MsaAppType: to.Ptr(armbotservice.MsaAppTypeUserAssignedMSI), - // PublicNetworkAccess: to.Ptr(armbotservice.PublicNetworkAccessEnabled), - // SchemaTransformationVersion: to.Ptr("1.0"), - // }, - // }}, - // } + // to.Ptr("facebook"), + // }, + // Endpoint: to.Ptr("http://mybot.coffee"), + // EndpointVersion: to.Ptr("version"), + // IconURL: to.Ptr("http://myicon"), + // IsCmekEnabled: to.Ptr(true), + // LuisAppIDs: []*string{ + // to.Ptr("luisappid1"), + // to.Ptr("luisappid2"), + // }, + // MsaAppID: to.Ptr("msaappid"), + // MsaAppMSIResourceID: to.Ptr("/subscriptions/foo/resourcegroups/bar/providers/microsoft.managedidentity/userassignedidentities/sampleId"), + // MsaAppTenantID: to.Ptr("msaapptenantid"), + // MsaAppType: to.Ptr(armbotservice.MsaAppTypeUserAssignedMSI), + // PublicNetworkAccess: to.Ptr(armbotservice.PublicNetworkAccessEnabled), + // SchemaTransformationVersion: to.Ptr("1.0"), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/CheckNameAvailability.json -func ExampleBotsClient_GetCheckNameAvailability() { +// Generated from example definition: 2023-09-15-preview/UpdateBot.json +func ExampleBotsClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewBotsClient().GetCheckNameAvailability(ctx, armbotservice.CheckNameAvailabilityRequestBody{ - Name: to.Ptr("testbotname"), - Type: to.Ptr("string"), + res, err := clientFactory.NewBotsClient().Update(ctx, "OneResourceGroupName", "samplebotname", armbotservice.Bot{ + Etag: to.Ptr("etag1"), + Kind: to.Ptr(armbotservice.KindSdk), + Location: to.Ptr("West US"), + Properties: &armbotservice.BotProperties{ + Description: to.Ptr("The description of the bot"), + CmekKeyVaultURL: to.Ptr("https://myCmekKey"), + DeveloperAppInsightKey: to.Ptr("appinsightskey"), + DeveloperAppInsightsAPIKey: to.Ptr("appinsightsapikey"), + DeveloperAppInsightsApplicationID: to.Ptr("appinsightsappid"), + DisableLocalAuth: to.Ptr(true), + DisplayName: to.Ptr("The Name of the bot"), + Endpoint: to.Ptr("http://mybot.coffee"), + IconURL: to.Ptr("http://myicon"), + IsCmekEnabled: to.Ptr(true), + LuisAppIDs: []*string{ + to.Ptr("luisappid1"), + to.Ptr("luisappid2"), + }, + LuisKey: to.Ptr("luiskey"), + MsaAppID: to.Ptr("msaappid"), + MsaAppMSIResourceID: to.Ptr("/subscriptions/foo/resourcegroups/bar/providers/microsoft.managedidentity/userassignedidentities/sampleId"), + MsaAppTenantID: to.Ptr("msaapptenantid"), + MsaAppType: to.Ptr(armbotservice.MsaAppTypeUserAssignedMSI), + PublicNetworkAccess: to.Ptr(armbotservice.PublicNetworkAccessEnabled), + SchemaTransformationVersion: to.Ptr("1.0"), + }, + SKU: &armbotservice.SKU{ + Name: to.Ptr(armbotservice.SKUNameS1), + }, + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -443,8 +437,47 @@ func ExampleBotsClient_GetCheckNameAvailability() { // 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.CheckNameAvailabilityResponseBody = armbotservice.CheckNameAvailabilityResponseBody{ - // Message: to.Ptr("custom message from server"), - // Valid: to.Ptr(true), + // res = armbotservice.BotsClientUpdateResponse{ + // Bot: &armbotservice.Bot{ + // Name: to.Ptr("samplebotname"), + // Type: to.Ptr("Microsoft.BotService/botServices"), + // Etag: to.Ptr("etag1"), + // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.BotService/botServices/samplebotname"), + // Kind: to.Ptr(armbotservice.KindSdk), + // Location: to.Ptr("West US"), + // Properties: &armbotservice.BotProperties{ + // Description: to.Ptr("The description of the bot"), + // CmekKeyVaultURL: to.Ptr("https://myCmekKey"), + // ConfiguredChannels: []*string{ + // to.Ptr("facebook"), + // to.Ptr("groupme"), + // }, + // DeveloperAppInsightKey: to.Ptr("appinsightskey"), + // DeveloperAppInsightsApplicationID: to.Ptr("appinsightsappid"), + // DisableLocalAuth: to.Ptr(true), + // DisplayName: to.Ptr("The Name of the bot"), + // EnabledChannels: []*string{ + // to.Ptr("facebook"), + // }, + // Endpoint: to.Ptr("http://mybot.coffee"), + // EndpointVersion: to.Ptr("version"), + // IconURL: to.Ptr("http://myicon"), + // IsCmekEnabled: to.Ptr(true), + // LuisAppIDs: []*string{ + // to.Ptr("luisappid1"), + // to.Ptr("luisappid2"), + // }, + // MsaAppID: to.Ptr("msaappid"), + // MsaAppMSIResourceID: to.Ptr("/subscriptions/foo/resourcegroups/bar/providers/microsoft.managedidentity/userassignedidentities/sampleId"), + // MsaAppTenantID: to.Ptr("msaapptenantid"), + // MsaAppType: to.Ptr(armbotservice.MsaAppTypeUserAssignedMSI), + // PublicNetworkAccess: to.Ptr(armbotservice.PublicNetworkAccessEnabled), + // SchemaTransformationVersion: to.Ptr("1.0"), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // "tag2": to.Ptr("value2"), + // }, + // }, // } } diff --git a/sdk/resourcemanager/botservice/armbotservice/botservice_live_test.go b/sdk/resourcemanager/botservice/armbotservice/botservice_live_test.go index 6ded9ffa990b..ba8fa3902b30 100644 --- a/sdk/resourcemanager/botservice/armbotservice/botservice_live_test.go +++ b/sdk/resourcemanager/botservice/armbotservice/botservice_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice/v2" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" "github.com/stretchr/testify/suite" diff --git a/sdk/resourcemanager/botservice/armbotservice/build.go b/sdk/resourcemanager/botservice/armbotservice/build.go deleted file mode 100644 index 015036fbe89a..000000000000 --- a/sdk/resourcemanager/botservice/armbotservice/build.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. - -// This file enables 'go generate' to regenerate this specific SDK -//go:generate pwsh ../../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate resourcemanager/botservice/armbotservice - -package armbotservice diff --git a/sdk/resourcemanager/botservice/armbotservice/channels_client.go b/sdk/resourcemanager/botservice/armbotservice/channels_client.go index 47e9ee6fb5be..f0dc0de9a745 100644 --- a/sdk/resourcemanager/botservice/armbotservice/channels_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/channels_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice @@ -28,7 +24,7 @@ type ChannelsClient struct { } // NewChannelsClient creates a new instance of ChannelsClient with the specified values. -// - subscriptionID - Azure Subscription ID. +// - 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 NewChannelsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ChannelsClient, error) { @@ -46,11 +42,11 @@ func NewChannelsClient(subscriptionID string, credential azcore.TokenCredential, // Create - Creates a Channel registration for a Bot Service // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-09-15 -// - resourceGroupName - The name of the Bot resource group in the user subscription. +// Generated from API version 2023-09-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the Bot resource. // - channelName - The name of the Channel resource. -// - parameters - The parameters to provide for the created bot. +// - parameters - Resource create parameters. // - options - ChannelsClientCreateOptions contains the optional parameters for the ChannelsClient.Create method. func (client *ChannelsClient) Create(ctx context.Context, resourceGroupName string, resourceName string, channelName ChannelName, parameters BotChannel, options *ChannelsClientCreateOptions) (ChannelsClientCreateResponse, error) { var err error @@ -75,8 +71,12 @@ func (client *ChannelsClient) Create(ctx context.Context, resourceGroupName stri } // createCreateRequest creates the Create request. -func (client *ChannelsClient) createCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, channelName ChannelName, parameters BotChannel, options *ChannelsClientCreateOptions) (*policy.Request, error) { +func (client *ChannelsClient) createCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, channelName ChannelName, parameters BotChannel, _ *ChannelsClientCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}" + 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") } @@ -89,18 +89,15 @@ func (client *ChannelsClient) createCreateRequest(ctx context.Context, resourceG return nil, errors.New("parameter channelName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{channelName}", url.PathEscape(string(channelName))) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -119,8 +116,8 @@ func (client *ChannelsClient) createHandleResponse(resp *http.Response) (Channel // Delete - Deletes a Channel registration from a Bot Service // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-09-15 -// - resourceGroupName - The name of the Bot resource group in the user subscription. +// Generated from API version 2023-09-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the Bot resource. // - channelName - The name of the Bot resource. // - options - ChannelsClientDeleteOptions contains the optional parameters for the ChannelsClient.Delete method. @@ -146,8 +143,12 @@ func (client *ChannelsClient) Delete(ctx context.Context, resourceGroupName stri } // deleteCreateRequest creates the Delete request. -func (client *ChannelsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, channelName string, options *ChannelsClientDeleteOptions) (*policy.Request, error) { +func (client *ChannelsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, channelName string, _ *ChannelsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}" + 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") } @@ -160,26 +161,21 @@ func (client *ChannelsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, errors.New("parameter channelName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{channelName}", url.PathEscape(channelName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Returns a BotService Channel registration specified by the parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-09-15 -// - resourceGroupName - The name of the Bot resource group in the user subscription. +// Generated from API version 2023-09-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the Bot resource. // - channelName - The name of the Bot resource. // - options - ChannelsClientGetOptions contains the optional parameters for the ChannelsClient.Get method. @@ -206,8 +202,12 @@ func (client *ChannelsClient) Get(ctx context.Context, resourceGroupName string, } // getCreateRequest creates the Get request. -func (client *ChannelsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, channelName string, options *ChannelsClientGetOptions) (*policy.Request, error) { +func (client *ChannelsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, channelName string, _ *ChannelsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}" + 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") } @@ -220,16 +220,12 @@ func (client *ChannelsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, errors.New("parameter channelName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{channelName}", url.PathEscape(channelName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -246,8 +242,8 @@ func (client *ChannelsClient) getHandleResponse(resp *http.Response) (ChannelsCl // NewListByResourceGroupPager - Returns all the Channel registrations of a particular BotService resource // -// Generated from API version 2022-09-15 -// - resourceGroupName - The name of the Bot resource group in the user subscription. +// Generated from API version 2023-09-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the Bot resource. // - options - ChannelsClientListByResourceGroupOptions contains the optional parameters for the ChannelsClient.NewListByResourceGroupPager // method. @@ -275,8 +271,12 @@ func (client *ChannelsClient) NewListByResourceGroupPager(resourceGroupName stri } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ChannelsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ChannelsClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *ChannelsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, _ *ChannelsClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels" + 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") } @@ -285,16 +285,12 @@ func (client *ChannelsClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -312,8 +308,8 @@ func (client *ChannelsClient) listByResourceGroupHandleResponse(resp *http.Respo // ListWithKeys - Lists a Channel registration for a Bot Service including secrets // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-09-15 -// - resourceGroupName - The name of the Bot resource group in the user subscription. +// Generated from API version 2023-09-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the Bot resource. // - channelName - The name of the Channel resource. // - options - ChannelsClientListWithKeysOptions contains the optional parameters for the ChannelsClient.ListWithKeys method. @@ -340,8 +336,12 @@ func (client *ChannelsClient) ListWithKeys(ctx context.Context, resourceGroupNam } // listWithKeysCreateRequest creates the ListWithKeys request. -func (client *ChannelsClient) listWithKeysCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, channelName ChannelName, options *ChannelsClientListWithKeysOptions) (*policy.Request, error) { +func (client *ChannelsClient) listWithKeysCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, channelName ChannelName, _ *ChannelsClientListWithKeysOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}/listChannelWithKeys" + 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") } @@ -354,16 +354,12 @@ func (client *ChannelsClient) listWithKeysCreateRequest(ctx context.Context, res return nil, errors.New("parameter channelName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{channelName}", url.PathEscape(string(channelName))) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -381,8 +377,8 @@ func (client *ChannelsClient) listWithKeysHandleResponse(resp *http.Response) (C // Update - Updates a Channel registration for a Bot Service // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-09-15 -// - resourceGroupName - The name of the Bot resource group in the user subscription. +// Generated from API version 2023-09-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the Bot resource. // - channelName - The name of the Channel resource. // - parameters - The parameters to provide for the created bot. @@ -410,8 +406,12 @@ func (client *ChannelsClient) Update(ctx context.Context, resourceGroupName stri } // updateCreateRequest creates the Update request. -func (client *ChannelsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, channelName ChannelName, parameters BotChannel, options *ChannelsClientUpdateOptions) (*policy.Request, error) { +func (client *ChannelsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, channelName ChannelName, parameters BotChannel, _ *ChannelsClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}" + 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") } @@ -424,18 +424,15 @@ func (client *ChannelsClient) updateCreateRequest(ctx context.Context, resourceG return nil, errors.New("parameter channelName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{channelName}", url.PathEscape(string(channelName))) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/botservice/armbotservice/channels_client_example_test.go b/sdk/resourcemanager/botservice/armbotservice/channels_client_example_test.go index aafa11d4684c..b6fce366fca3 100644 --- a/sdk/resourcemanager/botservice/armbotservice/channels_client_example_test.go +++ b/sdk/resourcemanager/botservice/armbotservice/channels_client_example_test.go @@ -1,31 +1,25 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice_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/botservice/armbotservice" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutAlexaChannel.json +// Generated from example definition: 2023-09-15-preview/PutAlexaChannel.json func ExampleChannelsClient_Create_createAlexaChannel() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -45,29 +39,31 @@ func ExampleChannelsClient_Create_createAlexaChannel() { // 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.BotChannel = armbotservice.BotChannel{ - // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), - // Location: to.Ptr("global"), - // Properties: &armbotservice.AlexaChannel{ - // ChannelName: to.Ptr("AlexaChannel"), - // Properties: &armbotservice.AlexaChannelProperties{ - // AlexaSkillID: to.Ptr("alexa skill id"), - // IsEnabled: to.Ptr(true), - // ServiceEndpointURI: to.Ptr("https://domain/XUrlFragmentX/botId"), - // URLFragment: to.Ptr("XUrlFragmentX"), + // res = armbotservice.ChannelsClientCreateResponse{ + // BotChannel: &armbotservice.BotChannel{ + // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), + // Location: to.Ptr("global"), + // Properties: &armbotservice.AlexaChannel{ + // ChannelName: to.Ptr("AlexaChannel"), + // Properties: &armbotservice.AlexaChannelProperties{ + // AlexaSkillID: to.Ptr("alexa skill id"), + // IsEnabled: to.Ptr(true), + // ServiceEndpointURI: to.Ptr("https://domain/XUrlFragmentX/botId"), + // URLFragment: to.Ptr("XUrlFragmentX"), + // }, // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutChannel.json +// Generated from example definition: 2023-09-15-preview/PutChannel.json func ExampleChannelsClient_Create_createChannel() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -88,28 +84,30 @@ func ExampleChannelsClient_Create_createChannel() { // 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.BotChannel = armbotservice.BotChannel{ - // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), - // Location: to.Ptr("global"), - // Properties: &armbotservice.EmailChannel{ - // ChannelName: to.Ptr("EmailChannel"), - // Properties: &armbotservice.EmailChannelProperties{ - // EmailAddress: to.Ptr("a@b.com"), - // IsEnabled: to.Ptr(true), - // Password: to.Ptr("pwd"), + // res = armbotservice.ChannelsClientCreateResponse{ + // BotChannel: &armbotservice.BotChannel{ + // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), + // Location: to.Ptr("global"), + // Properties: &armbotservice.EmailChannel{ + // ChannelName: to.Ptr("EmailChannel"), + // Properties: &armbotservice.EmailChannelProperties{ + // EmailAddress: to.Ptr("a@b.com"), + // IsEnabled: to.Ptr(true), + // Password: to.Ptr("pwd"), + // }, // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutDirectLineSpeechChannel.json +// Generated from example definition: 2023-09-15-preview/PutDirectLineSpeechChannel.json func ExampleChannelsClient_Create_createDirectLineSpeechChannel() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -130,27 +128,29 @@ func ExampleChannelsClient_Create_createDirectLineSpeechChannel() { // 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.BotChannel = armbotservice.BotChannel{ - // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), - // Location: to.Ptr("global"), - // Properties: &armbotservice.DirectLineSpeechChannel{ - // ChannelName: to.Ptr("DirectLineSpeechChannel"), - // Properties: &armbotservice.DirectLineSpeechChannelProperties{ - // CognitiveServiceRegion: to.Ptr("XcognitiveServiceRegionX"), - // IsEnabled: to.Ptr(true), + // res = armbotservice.ChannelsClientCreateResponse{ + // BotChannel: &armbotservice.BotChannel{ + // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), + // Location: to.Ptr("global"), + // Properties: &armbotservice.DirectLineSpeechChannel{ + // ChannelName: to.Ptr("DirectLineSpeechChannel"), + // Properties: &armbotservice.DirectLineSpeechChannelProperties{ + // CognitiveServiceRegion: to.Ptr("XcognitiveServiceRegionX"), + // IsEnabled: to.Ptr(true), + // }, // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutEmailChannel.json +// Generated from example definition: 2023-09-15-preview/PutEmailChannel.json func ExampleChannelsClient_Create_createEmailChannel() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -172,28 +172,30 @@ func ExampleChannelsClient_Create_createEmailChannel() { // 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.BotChannel = armbotservice.BotChannel{ - // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), - // Location: to.Ptr("global"), - // Properties: &armbotservice.EmailChannel{ - // ChannelName: to.Ptr("EmailChannel"), - // Properties: &armbotservice.EmailChannelProperties{ - // AuthMethod: to.Ptr(armbotservice.EmailChannelAuthMethodGraph), - // EmailAddress: to.Ptr("a@b.com"), - // IsEnabled: to.Ptr(true), + // res = armbotservice.ChannelsClientCreateResponse{ + // BotChannel: &armbotservice.BotChannel{ + // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), + // Location: to.Ptr("global"), + // Properties: &armbotservice.EmailChannel{ + // ChannelName: to.Ptr("EmailChannel"), + // Properties: &armbotservice.EmailChannelProperties{ + // AuthMethod: to.Ptr( armbotservice.EmailChannelAuthMethodGraph), + // EmailAddress: to.Ptr("a@b.com"), + // IsEnabled: to.Ptr(true), + // }, // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutLineChannel.json +// Generated from example definition: 2023-09-15-preview/PutLineChannel.json func ExampleChannelsClient_Create_createLineChannel() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -206,7 +208,8 @@ func ExampleChannelsClient_Create_createLineChannel() { { ChannelAccessToken: to.Ptr("channelAccessToken"), ChannelSecret: to.Ptr("channelSecret"), - }}, + }, + }, }, }, }, nil) @@ -216,494 +219,536 @@ func ExampleChannelsClient_Create_createLineChannel() { // 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.BotChannel = armbotservice.BotChannel{ - // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), - // Location: to.Ptr("global"), - // Properties: &armbotservice.LineChannel{ - // ChannelName: to.Ptr("LineChannel"), - // Properties: &armbotservice.LineChannelProperties{ - // CallbackURL: to.Ptr("http://callbackUrl"), - // IsValidated: to.Ptr(true), - // LineRegistrations: []*armbotservice.LineRegistration{ - // { - // GeneratedID: to.Ptr("id"), - // }}, + // res = armbotservice.ChannelsClientCreateResponse{ + // BotChannel: &armbotservice.BotChannel{ + // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), + // Location: to.Ptr("global"), + // Properties: &armbotservice.LineChannel{ + // ChannelName: to.Ptr("LineChannel"), + // Properties: &armbotservice.LineChannelProperties{ + // CallbackURL: to.Ptr("http://callbackUrl"), + // IsValidated: to.Ptr(true), + // LineRegistrations: []*armbotservice.LineRegistration{ + // { + // GeneratedID: to.Ptr("id"), + // }, + // }, + // }, // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateAlexaChannel.json -func ExampleChannelsClient_Update_updateAlexaChannel() { +// Generated from example definition: 2023-09-15-preview/DeleteChannel.json +func ExampleChannelsClient_Delete_deleteChannel() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewChannelsClient().Update(ctx, "OneResourceGroupName", "samplebotname", armbotservice.ChannelNameAlexaChannel, armbotservice.BotChannel{ - Location: to.Ptr("global"), - Properties: &armbotservice.AlexaChannel{ - ChannelName: to.Ptr("AlexaChannel"), - Properties: &armbotservice.AlexaChannelProperties{ - AlexaSkillID: to.Ptr("XAlexaSkillIdX"), - IsEnabled: to.Ptr(true), - }, - }, - }, nil) + res, err := clientFactory.NewChannelsClient().Delete(ctx, "OneResourceGroupName", "samplebotname", "EmailChannel", 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.BotChannel = armbotservice.BotChannel{ - // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), - // Location: to.Ptr("global"), - // Properties: &armbotservice.AlexaChannel{ - // ChannelName: to.Ptr("AlexaChannel"), - // Properties: &armbotservice.AlexaChannelProperties{ - // AlexaSkillID: to.Ptr("XAlexaSkillIdX"), - // IsEnabled: to.Ptr(true), - // ServiceEndpointURI: to.Ptr("https://domain/XUrlFragmentX/botId"), - // URLFragment: to.Ptr("XUrlFragmentX"), - // }, - // }, + // res = armbotservice.ChannelsClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateChannel.json -func ExampleChannelsClient_Update_updateChannel() { +// Generated from example definition: 2023-09-15-preview/DeleteDirectLineSpeechChannel.json +func ExampleChannelsClient_Delete_deleteDirectLineSpeechChannel() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewChannelsClient().Update(ctx, "OneResourceGroupName", "samplebotname", armbotservice.ChannelNameEmailChannel, armbotservice.BotChannel{ - Location: to.Ptr("global"), - Properties: &armbotservice.EmailChannel{ - ChannelName: to.Ptr("EmailChannel"), - Properties: &armbotservice.EmailChannelProperties{ - EmailAddress: to.Ptr("a@b.com"), - IsEnabled: to.Ptr(true), - Password: to.Ptr("pwd"), - }, - }, - }, nil) + res, err := clientFactory.NewChannelsClient().Delete(ctx, "OneResourceGroupName", "samplebotname", "DirectLineSpeechChannel", 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.BotChannel = armbotservice.BotChannel{ - // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), - // Location: to.Ptr("global"), - // Properties: &armbotservice.EmailChannel{ - // ChannelName: to.Ptr("EmailChannel"), - // Properties: &armbotservice.EmailChannelProperties{ - // EmailAddress: to.Ptr("a@b.com"), - // IsEnabled: to.Ptr(true), - // Password: to.Ptr("pwd"), - // }, - // }, + // res = armbotservice.ChannelsClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateDirectLineSpeechChannel.json -func ExampleChannelsClient_Update_updateDirectLineSpeechChannel() { +// Generated from example definition: 2023-09-15-preview/GetAlexaChannel.json +func ExampleChannelsClient_Get_getAlexaChannel() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewChannelsClient().Update(ctx, "OneResourceGroupName", "samplebotname", armbotservice.ChannelNameDirectLineSpeechChannel, armbotservice.BotChannel{ - Location: to.Ptr("global"), - Properties: &armbotservice.DirectLineSpeechChannel{ - ChannelName: to.Ptr("DirectLineSpeechChannel"), - Properties: &armbotservice.DirectLineSpeechChannelProperties{ - CognitiveServiceRegion: to.Ptr("XcognitiveServiceRegionX"), - CognitiveServiceSubscriptionKey: to.Ptr("XcognitiveServiceSubscriptionKeyX"), - IsEnabled: to.Ptr(true), - }, - }, - }, nil) + res, err := clientFactory.NewChannelsClient().Get(ctx, "OneResourceGroupName", "samplebotname", "AlexaChannel", 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.BotChannel = armbotservice.BotChannel{ - // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), - // Location: to.Ptr("global"), - // Properties: &armbotservice.DirectLineSpeechChannel{ - // ChannelName: to.Ptr("DirectLineSpeechChannel"), - // Properties: &armbotservice.DirectLineSpeechChannelProperties{ - // CognitiveServiceRegion: to.Ptr("XcognitiveServiceRegionX"), - // IsEnabled: to.Ptr(true), + // res = armbotservice.ChannelsClientGetResponse{ + // BotChannel: &armbotservice.BotChannel{ + // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), + // Location: to.Ptr("global"), + // Properties: &armbotservice.AlexaChannel{ + // ChannelName: to.Ptr("AlexaChannel"), + // Properties: &armbotservice.AlexaChannelProperties{ + // AlexaSkillID: to.Ptr("alexa skill id"), + // IsEnabled: to.Ptr(true), + // ServiceEndpointURI: to.Ptr("https://domain/XUrlFragmentX/botId"), + // URLFragment: to.Ptr("XUrlFragmentX"), + // }, // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateLineChannel.json -func ExampleChannelsClient_Update_updateLineChannel() { +// Generated from example definition: 2023-09-15-preview/GetChannel.json +func ExampleChannelsClient_Get_getChannel() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewChannelsClient().Update(ctx, "OneResourceGroupName", "samplebotname", armbotservice.ChannelNameLineChannel, armbotservice.BotChannel{ - Location: to.Ptr("global"), - Properties: &armbotservice.LineChannel{ - ChannelName: to.Ptr("LineChannel"), - Properties: &armbotservice.LineChannelProperties{ - LineRegistrations: []*armbotservice.LineRegistration{ - { - ChannelAccessToken: to.Ptr("channelAccessToken"), - ChannelSecret: to.Ptr("channelSecret"), - }}, - }, - }, - }, nil) + res, err := clientFactory.NewChannelsClient().Get(ctx, "OneResourceGroupName", "samplebotname", "EmailChannel", 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.BotChannel = armbotservice.BotChannel{ - // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), - // Location: to.Ptr("global"), - // Properties: &armbotservice.LineChannel{ - // ChannelName: to.Ptr("LineChannel"), - // Properties: &armbotservice.LineChannelProperties{ - // CallbackURL: to.Ptr("http://callbackUrl"), - // IsValidated: to.Ptr(true), - // LineRegistrations: []*armbotservice.LineRegistration{ - // { - // GeneratedID: to.Ptr("id"), - // }}, + // res = armbotservice.ChannelsClientGetResponse{ + // BotChannel: &armbotservice.BotChannel{ + // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), + // Location: to.Ptr("global"), + // Properties: &armbotservice.EmailChannel{ + // ChannelName: to.Ptr("EmailChannel"), + // Properties: &armbotservice.EmailChannelProperties{ + // EmailAddress: to.Ptr("a@b.com"), + // IsEnabled: to.Ptr(true), + // Password: to.Ptr("pwd"), + // }, // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeleteChannel.json -func ExampleChannelsClient_Delete_deleteChannel() { +// Generated from example definition: 2023-09-15-preview/GetDirectLineSpeechChannel.json +func ExampleChannelsClient_Get_getDirectLineSpeechChannel() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = clientFactory.NewChannelsClient().Delete(ctx, "OneResourceGroupName", "samplebotname", "EmailChannel", nil) + res, err := clientFactory.NewChannelsClient().Get(ctx, "OneResourceGroupName", "samplebotname", "DirectLineSpeechChannel", 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 = armbotservice.ChannelsClientGetResponse{ + // BotChannel: &armbotservice.BotChannel{ + // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), + // Location: to.Ptr("global"), + // Properties: &armbotservice.DirectLineSpeechChannel{ + // ChannelName: to.Ptr("DirectLineSpeechChannel"), + // Properties: &armbotservice.DirectLineSpeechChannelProperties{ + // CognitiveServiceRegion: to.Ptr("Cognitive service region"), + // CustomSpeechModelID: to.Ptr("Custom speech model ID"), + // CustomVoiceDeploymentID: to.Ptr("Custom voice deployment ID"), + // IsDefaultBotForCogSvcAccount: to.Ptr(true), + // IsEnabled: to.Ptr(true), + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeleteDirectLineSpeechChannel.json -func ExampleChannelsClient_Delete_deleteDirectLineSpeechChannel() { +// Generated from example definition: 2023-09-15-preview/GetLineChannel.json +func ExampleChannelsClient_Get_getLineChannel() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = clientFactory.NewChannelsClient().Delete(ctx, "OneResourceGroupName", "samplebotname", "DirectLineSpeechChannel", nil) + res, err := clientFactory.NewChannelsClient().Get(ctx, "OneResourceGroupName", "samplebotname", "LineChannel", 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 = armbotservice.ChannelsClientGetResponse{ + // BotChannel: &armbotservice.BotChannel{ + // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), + // Location: to.Ptr("global"), + // Properties: &armbotservice.LineChannel{ + // ChannelName: to.Ptr("LineChannel"), + // Properties: &armbotservice.LineChannelProperties{ + // CallbackURL: to.Ptr("http://callbackUrl"), + // IsValidated: to.Ptr(true), + // LineRegistrations: []*armbotservice.LineRegistration{ + // { + // GeneratedID: to.Ptr("id"), + // }, + // }, + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetAlexaChannel.json -func ExampleChannelsClient_Get_getAlexaChannel() { +// Generated from example definition: 2023-09-15-preview/ListChannelsByBotService.json +func ExampleChannelsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewChannelsClient().Get(ctx, "OneResourceGroupName", "samplebotname", "AlexaChannel", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) + pager := clientFactory.NewChannelsClient().NewListByResourceGroupPager("OneResourceGroupName", "samplebotname", 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 = armbotservice.ChannelsClientListByResourceGroupResponse{ + // ChannelResponseList: armbotservice.ChannelResponseList{ + // Value: []*armbotservice.BotChannel{ + // { + // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), + // Location: to.Ptr("global"), + // Properties: &armbotservice.EmailChannel{ + // ChannelName: to.Ptr("EmailChannel"), + // Properties: &armbotservice.EmailChannelProperties{ + // EmailAddress: to.Ptr("a@b.com"), + // IsEnabled: to.Ptr(true), + // Password: to.Ptr("pwd"), + // }, + // }, + // }, + // { + // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), + // Location: to.Ptr("global"), + // Properties: &armbotservice.FacebookChannel{ + // ChannelName: to.Ptr("FacebookChannel"), + // Properties: &armbotservice.FacebookChannelProperties{ + // AppID: to.Ptr("id"), + // CallbackURL: to.Ptr("appid"), + // IsEnabled: to.Ptr(true), + // Pages: []*armbotservice.FacebookPage{ + // { + // ID: to.Ptr("id"), + // }, + // }, + // }, + // }, + // }, + // }, + // }, + // } } - // 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.BotChannel = armbotservice.BotChannel{ - // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), - // Location: to.Ptr("global"), - // Properties: &armbotservice.AlexaChannel{ - // ChannelName: to.Ptr("AlexaChannel"), - // Properties: &armbotservice.AlexaChannelProperties{ - // AlexaSkillID: to.Ptr("alexa skill id"), - // IsEnabled: to.Ptr(true), - // ServiceEndpointURI: to.Ptr("https://domain/XUrlFragmentX/botId"), - // URLFragment: to.Ptr("XUrlFragmentX"), - // }, - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetChannel.json -func ExampleChannelsClient_Get_getChannel() { +// Generated from example definition: 2023-09-15-preview/ListChannel.json +func ExampleChannelsClient_ListWithKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewChannelsClient().Get(ctx, "OneResourceGroupName", "samplebotname", "EmailChannel", nil) + res, err := clientFactory.NewChannelsClient().ListWithKeys(ctx, "OneResourceGroupName", "samplebotname", armbotservice.ChannelNameEmailChannel, 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.BotChannel = armbotservice.BotChannel{ - // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), - // Location: to.Ptr("global"), - // Properties: &armbotservice.EmailChannel{ - // ChannelName: to.Ptr("EmailChannel"), - // Properties: &armbotservice.EmailChannelProperties{ - // EmailAddress: to.Ptr("a@b.com"), + // res = armbotservice.ChannelsClientListWithKeysResponse{ + // ListChannelWithKeysResponse: &armbotservice.ListChannelWithKeysResponse{ + // Location: to.Ptr("global"), + // Properties: &armbotservice.EmailChannel{ + // ChannelName: to.Ptr("EmailChannel"), + // Properties: &armbotservice.EmailChannelProperties{ + // EmailAddress: to.Ptr("a@b.com"), + // IsEnabled: to.Ptr(true), + // Password: to.Ptr("pwd"), + // }, + // }, + // Resource: &armbotservice.DirectLineChannel{ + // ChannelName: to.Ptr("DirectLineChannel"), + // Etag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), + // Location: to.Ptr("aaaaaa"), + // Properties: &armbotservice.DirectLineChannelProperties{ + // Sites: []*armbotservice.DirectLineSite{ + // { + // IsBlockUserUploadEnabled: to.Ptr(false), + // IsEnabled: to.Ptr(true), + // IsSecureSiteEnabled: to.Ptr(false), + // IsV1Enabled: to.Ptr(true), + // IsV3Enabled: to.Ptr(true), + // Key: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), + // Key2: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), + // SiteID: to.Ptr("aaaaaaaaaaa"), + // SiteName: to.Ptr("aaaaaaaaaaaa"), + // TrustedOrigins: []*string{ + // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), + // }, + // }, + // }, + // }, + // }, + // Setting: &armbotservice.ChannelSettings{ + // BotIconURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), + // BotID: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), + // ChannelDisplayName: to.Ptr("aaaaaaaaaaa"), + // ChannelID: to.Ptr("aaaaaaaaaa"), + // DisableLocalAuth: to.Ptr(false), + // ExtensionKey1: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), + // ExtensionKey2: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // IsEnabled: to.Ptr(true), - // Password: to.Ptr("pwd"), + // Sites: []*armbotservice.Site{ + // { + // ETag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), + // IsBlockUserUploadEnabled: to.Ptr(false), + // IsEnabled: to.Ptr(true), + // IsSecureSiteEnabled: to.Ptr(false), + // IsTokenEnabled: to.Ptr(false), + // IsV1Enabled: to.Ptr(true), + // IsV3Enabled: to.Ptr(true), + // IsWebchatPreviewEnabled: to.Ptr(false), + // Key: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), + // Key2: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), + // SiteID: to.Ptr("aaaaaaaaaaa"), + // SiteName: to.Ptr("aaaaaaaaaaaa"), + // TrustedOrigins: []*string{ + // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), + // }, + // }, + // }, // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetDirectLineSpeechChannel.json -func ExampleChannelsClient_Get_getDirectLineSpeechChannel() { +// Generated from example definition: 2023-09-15-preview/UpdateAlexaChannel.json +func ExampleChannelsClient_Update_updateAlexaChannel() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewChannelsClient().Get(ctx, "OneResourceGroupName", "samplebotname", "DirectLineSpeechChannel", nil) + res, err := clientFactory.NewChannelsClient().Update(ctx, "OneResourceGroupName", "samplebotname", armbotservice.ChannelNameAlexaChannel, armbotservice.BotChannel{ + Location: to.Ptr("global"), + Properties: &armbotservice.AlexaChannel{ + ChannelName: to.Ptr("AlexaChannel"), + Properties: &armbotservice.AlexaChannelProperties{ + AlexaSkillID: to.Ptr("XAlexaSkillIdX"), + IsEnabled: to.Ptr(true), + }, + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BotChannel = armbotservice.BotChannel{ - // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), - // Location: to.Ptr("global"), - // Properties: &armbotservice.DirectLineSpeechChannel{ - // ChannelName: to.Ptr("DirectLineSpeechChannel"), - // Properties: &armbotservice.DirectLineSpeechChannelProperties{ - // CognitiveServiceRegion: to.Ptr("Cognitive service region"), - // CustomSpeechModelID: to.Ptr("Custom speech model ID"), - // CustomVoiceDeploymentID: to.Ptr("Custom voice deployment ID"), - // IsDefaultBotForCogSvcAccount: to.Ptr(true), - // IsEnabled: to.Ptr(true), + // res = armbotservice.ChannelsClientUpdateResponse{ + // BotChannel: &armbotservice.BotChannel{ + // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), + // Location: to.Ptr("global"), + // Properties: &armbotservice.AlexaChannel{ + // ChannelName: to.Ptr("AlexaChannel"), + // Properties: &armbotservice.AlexaChannelProperties{ + // AlexaSkillID: to.Ptr("XAlexaSkillIdX"), + // IsEnabled: to.Ptr(true), + // ServiceEndpointURI: to.Ptr("https://domain/XUrlFragmentX/botId"), + // URLFragment: to.Ptr("XUrlFragmentX"), + // }, // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetLineChannel.json -func ExampleChannelsClient_Get_getLineChannel() { +// Generated from example definition: 2023-09-15-preview/UpdateChannel.json +func ExampleChannelsClient_Update_updateChannel() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewChannelsClient().Get(ctx, "OneResourceGroupName", "samplebotname", "LineChannel", nil) + res, err := clientFactory.NewChannelsClient().Update(ctx, "OneResourceGroupName", "samplebotname", armbotservice.ChannelNameEmailChannel, armbotservice.BotChannel{ + Location: to.Ptr("global"), + Properties: &armbotservice.EmailChannel{ + ChannelName: to.Ptr("EmailChannel"), + Properties: &armbotservice.EmailChannelProperties{ + EmailAddress: to.Ptr("a@b.com"), + IsEnabled: to.Ptr(true), + Password: to.Ptr("pwd"), + }, + }, + }, 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.BotChannel = armbotservice.BotChannel{ - // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), - // Location: to.Ptr("global"), - // Properties: &armbotservice.LineChannel{ - // ChannelName: to.Ptr("LineChannel"), - // Properties: &armbotservice.LineChannelProperties{ - // CallbackURL: to.Ptr("http://callbackUrl"), - // IsValidated: to.Ptr(true), - // LineRegistrations: []*armbotservice.LineRegistration{ - // { - // GeneratedID: to.Ptr("id"), - // }}, + // res = armbotservice.ChannelsClientUpdateResponse{ + // BotChannel: &armbotservice.BotChannel{ + // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), + // Location: to.Ptr("global"), + // Properties: &armbotservice.EmailChannel{ + // ChannelName: to.Ptr("EmailChannel"), + // Properties: &armbotservice.EmailChannelProperties{ + // EmailAddress: to.Ptr("a@b.com"), + // IsEnabled: to.Ptr(true), + // Password: to.Ptr("pwd"), + // }, // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListChannel.json -func ExampleChannelsClient_ListWithKeys() { +// Generated from example definition: 2023-09-15-preview/UpdateDirectLineSpeechChannel.json +func ExampleChannelsClient_Update_updateDirectLineSpeechChannel() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewChannelsClient().ListWithKeys(ctx, "OneResourceGroupName", "samplebotname", armbotservice.ChannelNameEmailChannel, nil) + res, err := clientFactory.NewChannelsClient().Update(ctx, "OneResourceGroupName", "samplebotname", armbotservice.ChannelNameDirectLineSpeechChannel, armbotservice.BotChannel{ + Location: to.Ptr("global"), + Properties: &armbotservice.DirectLineSpeechChannel{ + ChannelName: to.Ptr("DirectLineSpeechChannel"), + Properties: &armbotservice.DirectLineSpeechChannelProperties{ + CognitiveServiceRegion: to.Ptr("XcognitiveServiceRegionX"), + CognitiveServiceSubscriptionKey: to.Ptr("XcognitiveServiceSubscriptionKeyX"), + IsEnabled: to.Ptr(true), + }, + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ListChannelWithKeysResponse = armbotservice.ListChannelWithKeysResponse{ - // Location: to.Ptr("global"), - // Properties: &armbotservice.EmailChannel{ - // ChannelName: to.Ptr("EmailChannel"), - // Properties: &armbotservice.EmailChannelProperties{ - // EmailAddress: to.Ptr("a@b.com"), - // IsEnabled: to.Ptr(true), - // Password: to.Ptr("pwd"), - // }, - // }, - // Resource: &armbotservice.DirectLineChannel{ - // ChannelName: to.Ptr("DirectLineChannel"), - // Etag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Location: to.Ptr("aaaaaa"), - // Properties: &armbotservice.DirectLineChannelProperties{ - // Sites: []*armbotservice.DirectLineSite{ - // { - // IsBlockUserUploadEnabled: to.Ptr(false), - // IsEnabled: to.Ptr(true), - // IsSecureSiteEnabled: to.Ptr(false), - // IsV1Enabled: to.Ptr(true), - // IsV3Enabled: to.Ptr(true), - // Key: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Key2: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // SiteID: to.Ptr("aaaaaaaaaaa"), - // SiteName: to.Ptr("aaaaaaaaaaaa"), - // TrustedOrigins: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // }}, + // res = armbotservice.ChannelsClientUpdateResponse{ + // BotChannel: &armbotservice.BotChannel{ + // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), + // Location: to.Ptr("global"), + // Properties: &armbotservice.DirectLineSpeechChannel{ + // ChannelName: to.Ptr("DirectLineSpeechChannel"), + // Properties: &armbotservice.DirectLineSpeechChannelProperties{ + // CognitiveServiceRegion: to.Ptr("XcognitiveServiceRegionX"), + // IsEnabled: to.Ptr(true), // }, // }, - // Setting: &armbotservice.ChannelSettings{ - // BotIconURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // BotID: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - // ChannelDisplayName: to.Ptr("aaaaaaaaaaa"), - // ChannelID: to.Ptr("aaaaaaaaaa"), - // DisableLocalAuth: to.Ptr(false), - // ExtensionKey1: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // ExtensionKey2: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // IsEnabled: to.Ptr(true), - // Sites: []*armbotservice.Site{ - // { - // ETag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // IsBlockUserUploadEnabled: to.Ptr(false), - // IsEnabled: to.Ptr(true), - // IsSecureSiteEnabled: to.Ptr(false), - // IsTokenEnabled: to.Ptr(false), - // IsV1Enabled: to.Ptr(true), - // IsV3Enabled: to.Ptr(true), - // IsWebchatPreviewEnabled: to.Ptr(false), - // Key: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Key2: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // SiteID: to.Ptr("aaaaaaaaaaa"), - // SiteName: to.Ptr("aaaaaaaaaaaa"), - // TrustedOrigins: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // }}, - // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListChannelsByBotService.json -func ExampleChannelsClient_NewListByResourceGroupPager() { +// Generated from example definition: 2023-09-15-preview/UpdateLineChannel.json +func ExampleChannelsClient_Update_updateLineChannel() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewChannelsClient().NewListByResourceGroupPager("OneResourceGroupName", "samplebotname", 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.ChannelResponseList = armbotservice.ChannelResponseList{ - // Value: []*armbotservice.BotChannel{ - // { - // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), - // Location: to.Ptr("global"), - // Properties: &armbotservice.EmailChannel{ - // ChannelName: to.Ptr("EmailChannel"), - // Properties: &armbotservice.EmailChannelProperties{ - // EmailAddress: to.Ptr("a@b.com"), - // IsEnabled: to.Ptr(true), - // Password: to.Ptr("pwd"), - // }, - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), - // Location: to.Ptr("global"), - // Properties: &armbotservice.FacebookChannel{ - // ChannelName: to.Ptr("FacebookChannel"), - // Properties: &armbotservice.FacebookChannelProperties{ - // AppID: to.Ptr("id"), - // CallbackURL: to.Ptr("appid"), - // IsEnabled: to.Ptr(true), - // Pages: []*armbotservice.FacebookPage{ - // { - // ID: to.Ptr("id"), - // }}, - // }, - // }, - // }}, - // } + res, err := clientFactory.NewChannelsClient().Update(ctx, "OneResourceGroupName", "samplebotname", armbotservice.ChannelNameLineChannel, armbotservice.BotChannel{ + Location: to.Ptr("global"), + Properties: &armbotservice.LineChannel{ + ChannelName: to.Ptr("LineChannel"), + Properties: &armbotservice.LineChannelProperties{ + LineRegistrations: []*armbotservice.LineRegistration{ + { + ChannelAccessToken: to.Ptr("channelAccessToken"), + ChannelSecret: to.Ptr("channelSecret"), + }, + }, + }, + }, + }, 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 = armbotservice.ChannelsClientUpdateResponse{ + // BotChannel: &armbotservice.BotChannel{ + // ID: to.Ptr("/subscriptions/subscription-id/providers/Microsoft.BotService/botServices"), + // Location: to.Ptr("global"), + // Properties: &armbotservice.LineChannel{ + // ChannelName: to.Ptr("LineChannel"), + // Properties: &armbotservice.LineChannelProperties{ + // CallbackURL: to.Ptr("http://callbackUrl"), + // IsValidated: to.Ptr(true), + // LineRegistrations: []*armbotservice.LineRegistration{ + // { + // GeneratedID: to.Ptr("id"), + // }, + // }, + // }, + // }, + // }, + // } } diff --git a/sdk/resourcemanager/botservice/armbotservice/client_factory.go b/sdk/resourcemanager/botservice/armbotservice/client_factory.go index 3ba9cf6f6eb0..5565b0933119 100644 --- a/sdk/resourcemanager/botservice/armbotservice/client_factory.go +++ b/sdk/resourcemanager/botservice/armbotservice/client_factory.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice @@ -17,88 +13,116 @@ import ( // Don't use this type directly, use NewClientFactory instead. type ClientFactory struct { subscriptionID string - credential azcore.TokenCredential - options *arm.ClientOptions + internal *arm.Client } // NewClientFactory creates a new instance of ClientFactory with the specified values. // The parameter values will be propagated to any client created from this factory. -// - subscriptionID - Azure Subscription ID. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { - _, err := arm.NewClient(moduleName, moduleVersion, credential, options) + internal, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } return &ClientFactory{ - subscriptionID: subscriptionID, credential: credential, - options: options.Clone(), + subscriptionID: subscriptionID, + internal: internal, }, nil } // NewBotConnectionClient creates a new instance of BotConnectionClient. func (c *ClientFactory) NewBotConnectionClient() *BotConnectionClient { - subClient, _ := NewBotConnectionClient(c.subscriptionID, c.credential, c.options) - return subClient + return &BotConnectionClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewBotsClient creates a new instance of BotsClient. func (c *ClientFactory) NewBotsClient() *BotsClient { - subClient, _ := NewBotsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &BotsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewChannelsClient creates a new instance of ChannelsClient. func (c *ClientFactory) NewChannelsClient() *ChannelsClient { - subClient, _ := NewChannelsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ChannelsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewDirectLineClient creates a new instance of DirectLineClient. func (c *ClientFactory) NewDirectLineClient() *DirectLineClient { - subClient, _ := NewDirectLineClient(c.subscriptionID, c.credential, c.options) - return subClient + return &DirectLineClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewEmailClient creates a new instance of EmailClient. func (c *ClientFactory) NewEmailClient() *EmailClient { - subClient, _ := NewEmailClient(c.subscriptionID, c.credential, c.options) - return subClient + return &EmailClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewHostSettingsClient creates a new instance of HostSettingsClient. func (c *ClientFactory) NewHostSettingsClient() *HostSettingsClient { - subClient, _ := NewHostSettingsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &HostSettingsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewNetworkSecurityPerimeterConfigurationsClient creates a new instance of NetworkSecurityPerimeterConfigurationsClient. +func (c *ClientFactory) NewNetworkSecurityPerimeterConfigurationsClient() *NetworkSecurityPerimeterConfigurationsClient { + return &NetworkSecurityPerimeterConfigurationsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewOperationResultsClient creates a new instance of OperationResultsClient. func (c *ClientFactory) NewOperationResultsClient() *OperationResultsClient { - subClient, _ := NewOperationResultsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &OperationResultsClient{ + 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, + } } // NewQnAMakerEndpointKeysClient creates a new instance of QnAMakerEndpointKeysClient. func (c *ClientFactory) NewQnAMakerEndpointKeysClient() *QnAMakerEndpointKeysClient { - subClient, _ := NewQnAMakerEndpointKeysClient(c.subscriptionID, c.credential, c.options) - return subClient + return &QnAMakerEndpointKeysClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } diff --git a/sdk/resourcemanager/botservice/armbotservice/constants.go b/sdk/resourcemanager/botservice/armbotservice/constants.go index 149e38bcbfc3..1ca23fc4d6f3 100644 --- a/sdk/resourcemanager/botservice/armbotservice/constants.go +++ b/sdk/resourcemanager/botservice/armbotservice/constants.go @@ -1,18 +1,27 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice +// AccessMode - Access Mode of the resource association +type AccessMode string + const ( - moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice" - moduleVersion = "v1.2.0" + AccessModeAudit AccessMode = "Audit" + AccessModeEnforced AccessMode = "Enforced" + AccessModeLearning AccessMode = "Learning" ) +// PossibleAccessModeValues returns the possible values for the AccessMode const type. +func PossibleAccessModeValues() []AccessMode { + return []AccessMode{ + AccessModeAudit, + AccessModeEnforced, + AccessModeLearning, + } +} + type ChannelName string const ( @@ -62,8 +71,32 @@ func PossibleChannelNameValues() []ChannelName { } } +// CreatedByType - The kind of entity that created the resource. +type CreatedByType string + +const ( + // CreatedByTypeApplication - The entity was created by an application. + CreatedByTypeApplication CreatedByType = "Application" + // CreatedByTypeKey - The entity was created by a key. + CreatedByTypeKey CreatedByType = "Key" + // CreatedByTypeManagedIdentity - The entity was created by a managed identity. + CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" + // CreatedByTypeUser - The entity was created by a user. + CreatedByTypeUser CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{ + CreatedByTypeApplication, + CreatedByTypeKey, + CreatedByTypeManagedIdentity, + CreatedByTypeUser, + } +} + // EmailChannelAuthMethod - Email channel auth method. 0 Password (Default); 1 Graph. -type EmailChannelAuthMethod float32 +type EmailChannelAuthMethod int32 const ( // EmailChannelAuthMethodGraph - Modern authentication. @@ -136,6 +169,22 @@ func PossibleMsaAppTypeValues() []MsaAppType { } } +// NspAccessRuleDirection - Direction of Access Rule +type NspAccessRuleDirection string + +const ( + NspAccessRuleDirectionInbound NspAccessRuleDirection = "Inbound" + NspAccessRuleDirectionOutbound NspAccessRuleDirection = "Outbound" +) + +// PossibleNspAccessRuleDirectionValues returns the possible values for the NspAccessRuleDirection const type. +func PossibleNspAccessRuleDirectionValues() []NspAccessRuleDirection { + return []NspAccessRuleDirection{ + NspAccessRuleDirectionInbound, + NspAccessRuleDirectionOutbound, + } +} + // OperationResultStatus - The status of the operation being performed. type OperationResultStatus string @@ -196,12 +245,36 @@ func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointSer } } +type ProvisioningState string + +const ( + ProvisioningStateAccepted ProvisioningState = "Accepted" + ProvisioningStateCreating ProvisioningState = "Creating" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +// PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ + ProvisioningStateAccepted, + ProvisioningStateCreating, + ProvisioningStateDeleting, + ProvisioningStateFailed, + ProvisioningStateSucceeded, + ProvisioningStateUpdating, + } +} + // PublicNetworkAccess - Whether the bot is in an isolated network type PublicNetworkAccess string const ( - PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" - PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" + PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" + PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" + PublicNetworkAccessSecuredByPerimeter PublicNetworkAccess = "SecuredByPerimeter" ) // PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type. @@ -209,6 +282,7 @@ func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { return []PublicNetworkAccess{ PublicNetworkAccessDisabled, PublicNetworkAccessEnabled, + PublicNetworkAccessSecuredByPerimeter, } } @@ -258,3 +332,19 @@ func PossibleSKUTierValues() []SKUTier { SKUTierStandard, } } + +// Severity - Provisioning state of Network Security Perimeter configuration propagation +type Severity string + +const ( + SeverityError Severity = "Error" + SeverityWarning Severity = "Warning" +) + +// PossibleSeverityValues returns the possible values for the Severity const type. +func PossibleSeverityValues() []Severity { + return []Severity{ + SeverityError, + SeverityWarning, + } +} diff --git a/sdk/resourcemanager/botservice/armbotservice/directline_client.go b/sdk/resourcemanager/botservice/armbotservice/directline_client.go index 78469527b158..06ec24dc3174 100644 --- a/sdk/resourcemanager/botservice/armbotservice/directline_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/directline_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice @@ -28,7 +24,7 @@ type DirectLineClient struct { } // NewDirectLineClient creates a new instance of DirectLineClient with the specified values. -// - subscriptionID - Azure Subscription ID. +// - 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 NewDirectLineClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DirectLineClient, error) { @@ -46,8 +42,8 @@ func NewDirectLineClient(subscriptionID string, credential azcore.TokenCredentia // RegenerateKeys - Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-09-15 -// - resourceGroupName - The name of the Bot resource group in the user subscription. +// Generated from API version 2023-09-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the Bot resource. // - channelName - The name of the Channel resource for which keys are to be regenerated. // - parameters - The parameters to provide for the created bot. @@ -76,8 +72,12 @@ func (client *DirectLineClient) RegenerateKeys(ctx context.Context, resourceGrou } // regenerateKeysCreateRequest creates the RegenerateKeys request. -func (client *DirectLineClient) regenerateKeysCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, channelName RegenerateKeysChannelName, parameters SiteInfo, options *DirectLineClientRegenerateKeysOptions) (*policy.Request, error) { +func (client *DirectLineClient) regenerateKeysCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, channelName RegenerateKeysChannelName, parameters SiteInfo, _ *DirectLineClientRegenerateKeysOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}/regeneratekeys" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -86,10 +86,6 @@ func (client *DirectLineClient) regenerateKeysCreateRequest(ctx context.Context, return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if channelName == "" { return nil, errors.New("parameter channelName cannot be empty") } @@ -99,9 +95,10 @@ func (client *DirectLineClient) regenerateKeysCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/botservice/armbotservice/directline_client_example_test.go b/sdk/resourcemanager/botservice/armbotservice/directline_client_example_test.go index c7c230411c8d..3cb64a73f10f 100644 --- a/sdk/resourcemanager/botservice/armbotservice/directline_client_example_test.go +++ b/sdk/resourcemanager/botservice/armbotservice/directline_client_example_test.go @@ -1,31 +1,25 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice_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/botservice/armbotservice" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DirectlineRegenerateKeys.json +// Generated from example definition: 2023-09-15-preview/DirectlineRegenerateKeys.json func ExampleDirectLineClient_RegenerateKeys_regenerateKeysForDirectLineChannelSite() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -39,34 +33,37 @@ func ExampleDirectLineClient_RegenerateKeys_regenerateKeysForDirectLineChannelSi // 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.BotChannel = armbotservice.BotChannel{ - // Location: to.Ptr("global"), - // Properties: &armbotservice.DirectLineChannel{ - // ChannelName: to.Ptr("DirectLineChannel"), - // Properties: &armbotservice.DirectLineChannelProperties{ - // Sites: []*armbotservice.DirectLineSite{ - // { - // IsEnabled: to.Ptr(true), - // IsV1Enabled: to.Ptr(true), - // IsV3Enabled: to.Ptr(true), - // Key: to.Ptr("key1"), - // Key2: to.Ptr("key2"), - // SiteID: to.Ptr("abcd"), - // SiteName: to.Ptr("Default Site"), - // }}, + // res = armbotservice.DirectLineClientRegenerateKeysResponse{ + // BotChannel: &armbotservice.BotChannel{ + // Location: to.Ptr("global"), + // Properties: &armbotservice.DirectLineChannel{ + // ChannelName: to.Ptr("DirectLineChannel"), + // Properties: &armbotservice.DirectLineChannelProperties{ + // Sites: []*armbotservice.DirectLineSite{ + // { + // IsEnabled: to.Ptr(true), + // IsV1Enabled: to.Ptr(true), + // IsV3Enabled: to.Ptr(true), + // Key: to.Ptr("key1"), + // Key2: to.Ptr("key2"), + // SiteID: to.Ptr("abcd"), + // SiteName: to.Ptr("Default Site"), + // }, + // }, + // }, // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/WebChatRegenerateKeys.json +// Generated from example definition: 2023-09-15-preview/WebChatRegenerateKeys.json func ExampleDirectLineClient_RegenerateKeys_regenerateKeysForWebChatChannelSite() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -80,20 +77,23 @@ func ExampleDirectLineClient_RegenerateKeys_regenerateKeysForWebChatChannelSite( // 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.BotChannel = armbotservice.BotChannel{ - // Location: to.Ptr("global"), - // Properties: &armbotservice.WebChatChannel{ - // ChannelName: to.Ptr("WebChatChannel"), - // Properties: &armbotservice.WebChatChannelProperties{ - // Sites: []*armbotservice.WebChatSite{ - // { - // IsEnabled: to.Ptr(true), - // IsWebchatPreviewEnabled: to.Ptr(true), - // Key: to.Ptr("key1"), - // Key2: to.Ptr("key2"), - // SiteID: to.Ptr("abcd"), - // SiteName: to.Ptr("Default Site"), - // }}, + // res = armbotservice.DirectLineClientRegenerateKeysResponse{ + // BotChannel: &armbotservice.BotChannel{ + // Location: to.Ptr("global"), + // Properties: &armbotservice.WebChatChannel{ + // ChannelName: to.Ptr("WebChatChannel"), + // Properties: &armbotservice.WebChatChannelProperties{ + // Sites: []*armbotservice.WebChatSite{ + // { + // IsEnabled: to.Ptr(true), + // IsWebchatPreviewEnabled: to.Ptr(true), + // Key: to.Ptr("key1"), + // Key2: to.Ptr("key2"), + // SiteID: to.Ptr("abcd"), + // SiteName: to.Ptr("Default Site"), + // }, + // }, + // }, // }, // }, // } diff --git a/sdk/resourcemanager/botservice/armbotservice/email_client.go b/sdk/resourcemanager/botservice/armbotservice/email_client.go index 6e96e20bd8e6..2c9da3cf7e9d 100644 --- a/sdk/resourcemanager/botservice/armbotservice/email_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/email_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice @@ -28,7 +24,7 @@ type EmailClient struct { } // NewEmailClient creates a new instance of EmailClient with the specified values. -// - subscriptionID - Azure Subscription ID. +// - 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 NewEmailClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*EmailClient, error) { @@ -46,8 +42,8 @@ func NewEmailClient(subscriptionID string, credential azcore.TokenCredential, op // CreateSignInURL - Creates an email channel sign in url for a Bot Service // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-09-15 -// - resourceGroupName - The name of the Bot resource group in the user subscription. +// Generated from API version 2023-09-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the Bot resource. // - options - EmailClientCreateSignInURLOptions contains the optional parameters for the EmailClient.CreateSignInURL method. func (client *EmailClient) CreateSignInURL(ctx context.Context, resourceGroupName string, resourceName string, options *EmailClientCreateSignInURLOptions) (EmailClientCreateSignInURLResponse, error) { @@ -73,8 +69,12 @@ func (client *EmailClient) CreateSignInURL(ctx context.Context, resourceGroupNam } // createSignInURLCreateRequest creates the CreateSignInURL request. -func (client *EmailClient) createSignInURLCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *EmailClientCreateSignInURLOptions) (*policy.Request, error) { +func (client *EmailClient) createSignInURLCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, _ *EmailClientCreateSignInURLOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/createEmailSignInUrl" + 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") } @@ -83,16 +83,12 @@ func (client *EmailClient) createSignInURLCreateRequest(ctx context.Context, res return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/botservice/armbotservice/email_client_example_test.go b/sdk/resourcemanager/botservice/armbotservice/email_client_example_test.go index eefe5a663e05..b504382ed180 100644 --- a/sdk/resourcemanager/botservice/armbotservice/email_client_example_test.go +++ b/sdk/resourcemanager/botservice/armbotservice/email_client_example_test.go @@ -1,30 +1,24 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/CreateEmailSignInUrl.json +// Generated from example definition: 2023-09-15-preview/CreateEmailSignInUrl.json func ExampleEmailClient_CreateSignInURL() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -35,11 +29,13 @@ func ExampleEmailClient_CreateSignInURL() { // 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.CreateEmailSignInURLResponse = armbotservice.CreateEmailSignInURLResponse{ - // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.BotService/botServices/samplebotname"), - // Location: to.Ptr("global"), - // Properties: &armbotservice.CreateEmailSignInURLResponseProperties{ - // URL: to.Ptr("https://token.botframework.com/api/oauth/signin?signin=XXX"), + // res = armbotservice.EmailClientCreateSignInURLResponse{ + // CreateEmailSignInURLResponse: &armbotservice.CreateEmailSignInURLResponse{ + // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.BotService/botServices/samplebotname"), + // Location: to.Ptr("global"), + // Properties: &armbotservice.CreateEmailSignInURLResponseProperties{ + // URL: to.Ptr("https://token.botframework.com/api/oauth/signin?signin=XXX"), + // }, // }, // } } diff --git a/sdk/resourcemanager/botservice/armbotservice/fake/botconnection_server.go b/sdk/resourcemanager/botservice/armbotservice/fake/botconnection_server.go index bb83a5d26d82..d43d1a7b0b6d 100644 --- a/sdk/resourcemanager/botservice/armbotservice/fake/botconnection_server.go +++ b/sdk/resourcemanager/botservice/armbotservice/fake/botconnection_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -16,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice/v2" "net/http" "net/url" "regexp" @@ -78,33 +74,52 @@ func (b *BotConnectionServerTransport) Do(req *http.Request) (*http.Response, er return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return b.dispatchToMethodFake(req, method) +} - switch method { - case "BotConnectionClient.Create": - resp, err = b.dispatchCreate(req) - case "BotConnectionClient.Delete": - resp, err = b.dispatchDelete(req) - case "BotConnectionClient.Get": - resp, err = b.dispatchGet(req) - case "BotConnectionClient.NewListByBotServicePager": - resp, err = b.dispatchNewListByBotServicePager(req) - case "BotConnectionClient.ListServiceProviders": - resp, err = b.dispatchListServiceProviders(req) - case "BotConnectionClient.ListWithSecrets": - resp, err = b.dispatchListWithSecrets(req) - case "BotConnectionClient.Update": - resp, err = b.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (b *BotConnectionServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if botConnectionServerTransportInterceptor != nil { + res.resp, res.err, intercepted = botConnectionServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "BotConnectionClient.Create": + res.resp, res.err = b.dispatchCreate(req) + case "BotConnectionClient.Delete": + res.resp, res.err = b.dispatchDelete(req) + case "BotConnectionClient.Get": + res.resp, res.err = b.dispatchGet(req) + case "BotConnectionClient.NewListByBotServicePager": + res.resp, res.err = b.dispatchNewListByBotServicePager(req) + case "BotConnectionClient.ListServiceProviders": + res.resp, res.err = b.dispatchListServiceProviders(req) + case "BotConnectionClient.ListWithSecrets": + res.resp, res.err = b.dispatchListWithSecrets(req) + case "BotConnectionClient.Update": + res.resp, res.err = b.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (b *BotConnectionServerTransport) dispatchCreate(req *http.Request) (*http.Response, error) { @@ -114,7 +129,7 @@ func (b *BotConnectionServerTransport) dispatchCreate(req *http.Request) (*http. const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/botServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/connections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armbotservice.ConnectionSetting](req) @@ -155,7 +170,7 @@ func (b *BotConnectionServerTransport) dispatchDelete(req *http.Request) (*http. const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/botServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/connections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -192,7 +207,7 @@ func (b *BotConnectionServerTransport) dispatchGet(req *http.Request) (*http.Res const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/botServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/connections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -231,7 +246,7 @@ func (b *BotConnectionServerTransport) dispatchNewListByBotServicePager(req *htt const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/botServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/connections` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -270,7 +285,7 @@ func (b *BotConnectionServerTransport) dispatchListServiceProviders(req *http.Re const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/listAuthServiceProviders` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { + if len(matches) < 2 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } respr, errRespr := b.srv.ListServiceProviders(req.Context(), nil) @@ -295,7 +310,7 @@ func (b *BotConnectionServerTransport) dispatchListWithSecrets(req *http.Request const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/botServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/connections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listWithSecrets` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -332,7 +347,7 @@ func (b *BotConnectionServerTransport) dispatchUpdate(req *http.Request) (*http. const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/botServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/connections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armbotservice.ConnectionSetting](req) @@ -365,3 +380,9 @@ func (b *BotConnectionServerTransport) dispatchUpdate(req *http.Request) (*http. } return resp, nil } + +// set this to conditionally intercept incoming requests to BotConnectionServerTransport +var botConnectionServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/botservice/armbotservice/fake/bots_server.go b/sdk/resourcemanager/botservice/armbotservice/fake/bots_server.go index 7ad8c6f200ab..a479286351dc 100644 --- a/sdk/resourcemanager/botservice/armbotservice/fake/bots_server.go +++ b/sdk/resourcemanager/botservice/armbotservice/fake/bots_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -16,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice/v2" "net/http" "net/url" "regexp" @@ -80,33 +76,52 @@ func (b *BotsServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return b.dispatchToMethodFake(req, method) +} - switch method { - case "BotsClient.Create": - resp, err = b.dispatchCreate(req) - case "BotsClient.Delete": - resp, err = b.dispatchDelete(req) - case "BotsClient.Get": - resp, err = b.dispatchGet(req) - case "BotsClient.GetCheckNameAvailability": - resp, err = b.dispatchGetCheckNameAvailability(req) - case "BotsClient.NewListPager": - resp, err = b.dispatchNewListPager(req) - case "BotsClient.NewListByResourceGroupPager": - resp, err = b.dispatchNewListByResourceGroupPager(req) - case "BotsClient.Update": - resp, err = b.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (b *BotsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if botsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = botsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "BotsClient.Create": + res.resp, res.err = b.dispatchCreate(req) + case "BotsClient.Delete": + res.resp, res.err = b.dispatchDelete(req) + case "BotsClient.Get": + res.resp, res.err = b.dispatchGet(req) + case "BotsClient.GetCheckNameAvailability": + res.resp, res.err = b.dispatchGetCheckNameAvailability(req) + case "BotsClient.NewListPager": + res.resp, res.err = b.dispatchNewListPager(req) + case "BotsClient.NewListByResourceGroupPager": + res.resp, res.err = b.dispatchNewListByResourceGroupPager(req) + case "BotsClient.Update": + res.resp, res.err = b.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (b *BotsServerTransport) dispatchCreate(req *http.Request) (*http.Response, error) { @@ -116,7 +131,7 @@ func (b *BotsServerTransport) dispatchCreate(req *http.Request) (*http.Response, const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/botServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armbotservice.Bot](req) @@ -153,7 +168,7 @@ func (b *BotsServerTransport) dispatchDelete(req *http.Request) (*http.Response, const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/botServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -186,7 +201,7 @@ func (b *BotsServerTransport) dispatchGet(req *http.Request) (*http.Response, er const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/botServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -244,7 +259,7 @@ func (b *BotsServerTransport) dispatchNewListPager(req *http.Request) (*http.Res const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/botServices` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { + if len(matches) < 2 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := b.srv.NewListPager(nil) @@ -277,7 +292,7 @@ func (b *BotsServerTransport) dispatchNewListByResourceGroupPager(req *http.Requ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/botServices` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -312,7 +327,7 @@ func (b *BotsServerTransport) dispatchUpdate(req *http.Request) (*http.Response, const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/botServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armbotservice.Bot](req) @@ -341,3 +356,9 @@ func (b *BotsServerTransport) dispatchUpdate(req *http.Request) (*http.Response, } return resp, nil } + +// set this to conditionally intercept incoming requests to BotsServerTransport +var botsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/botservice/armbotservice/fake/channels_server.go b/sdk/resourcemanager/botservice/armbotservice/fake/channels_server.go index dde4d08c2161..287f4e6efe54 100644 --- a/sdk/resourcemanager/botservice/armbotservice/fake/channels_server.go +++ b/sdk/resourcemanager/botservice/armbotservice/fake/channels_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -16,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice/v2" "net/http" "net/url" "regexp" @@ -74,31 +70,50 @@ func (c *ChannelsServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - switch method { - case "ChannelsClient.Create": - resp, err = c.dispatchCreate(req) - case "ChannelsClient.Delete": - resp, err = c.dispatchDelete(req) - case "ChannelsClient.Get": - resp, err = c.dispatchGet(req) - case "ChannelsClient.NewListByResourceGroupPager": - resp, err = c.dispatchNewListByResourceGroupPager(req) - case "ChannelsClient.ListWithKeys": - resp, err = c.dispatchListWithKeys(req) - case "ChannelsClient.Update": - resp, err = c.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (c *ChannelsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if channelsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = channelsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ChannelsClient.Create": + res.resp, res.err = c.dispatchCreate(req) + case "ChannelsClient.Delete": + res.resp, res.err = c.dispatchDelete(req) + case "ChannelsClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "ChannelsClient.NewListByResourceGroupPager": + res.resp, res.err = c.dispatchNewListByResourceGroupPager(req) + case "ChannelsClient.ListWithKeys": + res.resp, res.err = c.dispatchListWithKeys(req) + case "ChannelsClient.Update": + res.resp, res.err = c.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *ChannelsServerTransport) dispatchCreate(req *http.Request) (*http.Response, error) { @@ -108,7 +123,7 @@ func (c *ChannelsServerTransport) dispatchCreate(req *http.Request) (*http.Respo const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/botServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/channels/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armbotservice.BotChannel](req) @@ -155,7 +170,7 @@ func (c *ChannelsServerTransport) dispatchDelete(req *http.Request) (*http.Respo const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/botServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/channels/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -192,7 +207,7 @@ func (c *ChannelsServerTransport) dispatchGet(req *http.Request) (*http.Response const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/botServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/channels/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -231,7 +246,7 @@ func (c *ChannelsServerTransport) dispatchNewListByResourceGroupPager(req *http. const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/botServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/channels` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -270,7 +285,7 @@ func (c *ChannelsServerTransport) dispatchListWithKeys(req *http.Request) (*http const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/botServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/channels/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listChannelWithKeys` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -313,7 +328,7 @@ func (c *ChannelsServerTransport) dispatchUpdate(req *http.Request) (*http.Respo const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/botServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/channels/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armbotservice.BotChannel](req) @@ -352,3 +367,9 @@ func (c *ChannelsServerTransport) dispatchUpdate(req *http.Request) (*http.Respo } return resp, nil } + +// set this to conditionally intercept incoming requests to ChannelsServerTransport +var channelsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/botservice/armbotservice/fake/directline_server.go b/sdk/resourcemanager/botservice/armbotservice/fake/directline_server.go index d3d8a0683ff5..bf2a90016dc0 100644 --- a/sdk/resourcemanager/botservice/armbotservice/fake/directline_server.go +++ b/sdk/resourcemanager/botservice/armbotservice/fake/directline_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -15,7 +11,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice/v2" "net/http" "net/url" "regexp" @@ -49,21 +45,40 @@ func (d *DirectLineServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return d.dispatchToMethodFake(req, method) +} - switch method { - case "DirectLineClient.RegenerateKeys": - resp, err = d.dispatchRegenerateKeys(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (d *DirectLineServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if directLineServerTransportInterceptor != nil { + res.resp, res.err, intercepted = directLineServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "DirectLineClient.RegenerateKeys": + res.resp, res.err = d.dispatchRegenerateKeys(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (d *DirectLineServerTransport) dispatchRegenerateKeys(req *http.Request) (*http.Response, error) { @@ -73,7 +88,7 @@ func (d *DirectLineServerTransport) dispatchRegenerateKeys(req *http.Request) (* const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/botServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/channels/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/regeneratekeys` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armbotservice.SiteInfo](req) @@ -112,3 +127,9 @@ func (d *DirectLineServerTransport) dispatchRegenerateKeys(req *http.Request) (* } return resp, nil } + +// set this to conditionally intercept incoming requests to DirectLineServerTransport +var directLineServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/botservice/armbotservice/fake/email_server.go b/sdk/resourcemanager/botservice/armbotservice/fake/email_server.go index 3557d7c80a7f..c20b0fbb29bf 100644 --- a/sdk/resourcemanager/botservice/armbotservice/fake/email_server.go +++ b/sdk/resourcemanager/botservice/armbotservice/fake/email_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -15,7 +11,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice/v2" "net/http" "net/url" "regexp" @@ -49,21 +45,40 @@ func (e *EmailServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return e.dispatchToMethodFake(req, method) +} - switch method { - case "EmailClient.CreateSignInURL": - resp, err = e.dispatchCreateSignInURL(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (e *EmailServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if emailServerTransportInterceptor != nil { + res.resp, res.err, intercepted = emailServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "EmailClient.CreateSignInURL": + res.resp, res.err = e.dispatchCreateSignInURL(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (e *EmailServerTransport) dispatchCreateSignInURL(req *http.Request) (*http.Response, error) { @@ -73,7 +88,7 @@ func (e *EmailServerTransport) dispatchCreateSignInURL(req *http.Request) (*http const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/botServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/createEmailSignInUrl` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -98,3 +113,9 @@ func (e *EmailServerTransport) dispatchCreateSignInURL(req *http.Request) (*http } return resp, nil } + +// set this to conditionally intercept incoming requests to EmailServerTransport +var emailServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/botservice/armbotservice/fake/hostsettings_server.go b/sdk/resourcemanager/botservice/armbotservice/fake/hostsettings_server.go index 4364c6b06d18..b193dc1c653f 100644 --- a/sdk/resourcemanager/botservice/armbotservice/fake/hostsettings_server.go +++ b/sdk/resourcemanager/botservice/armbotservice/fake/hostsettings_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -15,7 +11,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice/v2" "net/http" "regexp" ) @@ -48,21 +44,40 @@ func (h *HostSettingsServerTransport) Do(req *http.Request) (*http.Response, err return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return h.dispatchToMethodFake(req, method) +} - switch method { - case "HostSettingsClient.Get": - resp, err = h.dispatchGet(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (h *HostSettingsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if hostSettingsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = hostSettingsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "HostSettingsClient.Get": + res.resp, res.err = h.dispatchGet(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (h *HostSettingsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -72,7 +87,7 @@ func (h *HostSettingsServerTransport) dispatchGet(req *http.Request) (*http.Resp const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/hostSettings` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { + if len(matches) < 2 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } respr, errRespr := h.srv.Get(req.Context(), nil) @@ -89,3 +104,9 @@ func (h *HostSettingsServerTransport) dispatchGet(req *http.Request) (*http.Resp } return resp, nil } + +// set this to conditionally intercept incoming requests to HostSettingsServerTransport +var hostSettingsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/botservice/armbotservice/fake/internal.go b/sdk/resourcemanager/botservice/armbotservice/fake/internal.go index be04ff43d678..d9c359c154c2 100644 --- a/sdk/resourcemanager/botservice/armbotservice/fake/internal.go +++ b/sdk/resourcemanager/botservice/armbotservice/fake/internal.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -14,6 +10,11 @@ import ( "sync" ) +type result struct { + resp *http.Response + err error +} + type nonRetriableError struct { error } diff --git a/sdk/resourcemanager/botservice/armbotservice/fake/networksecurityperimeterconfigurations_server.go b/sdk/resourcemanager/botservice/armbotservice/fake/networksecurityperimeterconfigurations_server.go new file mode 100644 index 000000000000..405120120106 --- /dev/null +++ b/sdk/resourcemanager/botservice/armbotservice/fake/networksecurityperimeterconfigurations_server.go @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice/v2" + "net/http" + "net/url" + "regexp" +) + +// NetworkSecurityPerimeterConfigurationsServer is a fake server for instances of the armbotservice.NetworkSecurityPerimeterConfigurationsClient type. +type NetworkSecurityPerimeterConfigurationsServer struct { + // Get is the fake for method NetworkSecurityPerimeterConfigurationsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, resourceName string, networkSecurityPerimeterConfigurationName string, options *armbotservice.NetworkSecurityPerimeterConfigurationsClientGetOptions) (resp azfake.Responder[armbotservice.NetworkSecurityPerimeterConfigurationsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method NetworkSecurityPerimeterConfigurationsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, resourceName string, options *armbotservice.NetworkSecurityPerimeterConfigurationsClientListOptions) (resp azfake.PagerResponder[armbotservice.NetworkSecurityPerimeterConfigurationsClientListResponse]) + + // BeginReconcile is the fake for method NetworkSecurityPerimeterConfigurationsClient.BeginReconcile + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginReconcile func(ctx context.Context, resourceGroupName string, resourceName string, networkSecurityPerimeterConfigurationName string, options *armbotservice.NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions) (resp azfake.PollerResponder[armbotservice.NetworkSecurityPerimeterConfigurationsClientReconcileResponse], errResp azfake.ErrorResponder) +} + +// NewNetworkSecurityPerimeterConfigurationsServerTransport creates a new instance of NetworkSecurityPerimeterConfigurationsServerTransport with the provided implementation. +// The returned NetworkSecurityPerimeterConfigurationsServerTransport instance is connected to an instance of armbotservice.NetworkSecurityPerimeterConfigurationsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewNetworkSecurityPerimeterConfigurationsServerTransport(srv *NetworkSecurityPerimeterConfigurationsServer) *NetworkSecurityPerimeterConfigurationsServerTransport { + return &NetworkSecurityPerimeterConfigurationsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armbotservice.NetworkSecurityPerimeterConfigurationsClientListResponse]](), + beginReconcile: newTracker[azfake.PollerResponder[armbotservice.NetworkSecurityPerimeterConfigurationsClientReconcileResponse]](), + } +} + +// NetworkSecurityPerimeterConfigurationsServerTransport connects instances of armbotservice.NetworkSecurityPerimeterConfigurationsClient to instances of NetworkSecurityPerimeterConfigurationsServer. +// Don't use this type directly, use NewNetworkSecurityPerimeterConfigurationsServerTransport instead. +type NetworkSecurityPerimeterConfigurationsServerTransport struct { + srv *NetworkSecurityPerimeterConfigurationsServer + newListPager *tracker[azfake.PagerResponder[armbotservice.NetworkSecurityPerimeterConfigurationsClientListResponse]] + beginReconcile *tracker[azfake.PollerResponder[armbotservice.NetworkSecurityPerimeterConfigurationsClientReconcileResponse]] +} + +// Do implements the policy.Transporter interface for NetworkSecurityPerimeterConfigurationsServerTransport. +func (n *NetworkSecurityPerimeterConfigurationsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return n.dispatchToMethodFake(req, method) +} + +func (n *NetworkSecurityPerimeterConfigurationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if networkSecurityPerimeterConfigurationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = networkSecurityPerimeterConfigurationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "NetworkSecurityPerimeterConfigurationsClient.Get": + res.resp, res.err = n.dispatchGet(req) + case "NetworkSecurityPerimeterConfigurationsClient.NewListPager": + res.resp, res.err = n.dispatchNewListPager(req) + case "NetworkSecurityPerimeterConfigurationsClient.BeginReconcile": + res.resp, res.err = n.dispatchBeginReconcile(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (n *NetworkSecurityPerimeterConfigurationsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if n.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\.BotService/botServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkSecurityPerimeterConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + networkSecurityPerimeterConfigurationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterConfigurationName")]) + if err != nil { + return nil, err + } + respr, errRespr := n.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, networkSecurityPerimeterConfigurationNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).NetworkSecurityPerimeterConfiguration, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (n *NetworkSecurityPerimeterConfigurationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if n.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := n.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/botServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkSecurityPerimeterConfigurations` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + resp := n.srv.NewListPager(resourceGroupNameParam, resourceNameParam, nil) + newListPager = &resp + n.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armbotservice.NetworkSecurityPerimeterConfigurationsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + n.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + n.newListPager.remove(req) + } + return resp, nil +} + +func (n *NetworkSecurityPerimeterConfigurationsServerTransport) dispatchBeginReconcile(req *http.Request) (*http.Response, error) { + if n.srv.BeginReconcile == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginReconcile not implemented")} + } + beginReconcile := n.beginReconcile.get(req) + if beginReconcile == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/botServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkSecurityPerimeterConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/reconcile` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + networkSecurityPerimeterConfigurationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterConfigurationName")]) + if err != nil { + return nil, err + } + respr, errRespr := n.srv.BeginReconcile(req.Context(), resourceGroupNameParam, resourceNameParam, networkSecurityPerimeterConfigurationNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginReconcile = &respr + n.beginReconcile.add(req, beginReconcile) + } + + resp, err := server.PollerResponderNext(beginReconcile, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + n.beginReconcile.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginReconcile) { + n.beginReconcile.remove(req) + } + + return resp, nil +} + +// set this to conditionally intercept incoming requests to NetworkSecurityPerimeterConfigurationsServerTransport +var networkSecurityPerimeterConfigurationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/botservice/armbotservice/fake/operationresults_server.go b/sdk/resourcemanager/botservice/armbotservice/fake/operationresults_server.go index 06dd5c325606..11024658ba70 100644 --- a/sdk/resourcemanager/botservice/armbotservice/fake/operationresults_server.go +++ b/sdk/resourcemanager/botservice/armbotservice/fake/operationresults_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -15,7 +11,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice/v2" "net/http" "net/url" "regexp" @@ -53,21 +49,40 @@ func (o *OperationResultsServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return o.dispatchToMethodFake(req, method) +} - switch method { - case "OperationResultsClient.BeginGet": - resp, err = o.dispatchBeginGet(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (o *OperationResultsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if operationResultsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = operationResultsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "OperationResultsClient.BeginGet": + res.resp, res.err = o.dispatchBeginGet(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (o *OperationResultsServerTransport) dispatchBeginGet(req *http.Request) (*http.Response, error) { @@ -79,7 +94,7 @@ func (o *OperationResultsServerTransport) dispatchBeginGet(req *http.Request) (* const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/operationresults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } operationResultIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("operationResultId")]) @@ -109,3 +124,9 @@ func (o *OperationResultsServerTransport) dispatchBeginGet(req *http.Request) (* return resp, nil } + +// set this to conditionally intercept incoming requests to OperationResultsServerTransport +var operationResultsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/botservice/armbotservice/fake/operations_server.go b/sdk/resourcemanager/botservice/armbotservice/fake/operations_server.go index a467dd6e6eab..3935037de88d 100644 --- a/sdk/resourcemanager/botservice/armbotservice/fake/operations_server.go +++ b/sdk/resourcemanager/botservice/armbotservice/fake/operations_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -15,7 +11,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice/v2" "net/http" ) @@ -51,21 +47,40 @@ func (o *OperationsServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return o.dispatchToMethodFake(req, method) +} - switch method { - case "OperationsClient.NewListPager": - resp, err = o.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (o *OperationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if operationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = operationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "OperationsClient.NewListPager": + res.resp, res.err = o.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -94,3 +109,9 @@ func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*ht } return resp, nil } + +// set this to conditionally intercept incoming requests to OperationsServerTransport +var operationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/botservice/armbotservice/fake/privateendpointconnections_server.go b/sdk/resourcemanager/botservice/armbotservice/fake/privateendpointconnections_server.go index 17115bf5a29c..12aaf2cadeac 100644 --- a/sdk/resourcemanager/botservice/armbotservice/fake/privateendpointconnections_server.go +++ b/sdk/resourcemanager/botservice/armbotservice/fake/privateendpointconnections_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -15,7 +11,8 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice/v2" "net/http" "net/url" "regexp" @@ -65,27 +62,46 @@ func (p *PrivateEndpointConnectionsServerTransport) Do(req *http.Request) (*http return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return p.dispatchToMethodFake(req, method) +} - switch method { - case "PrivateEndpointConnectionsClient.Create": - resp, err = p.dispatchCreate(req) - case "PrivateEndpointConnectionsClient.Delete": - resp, err = p.dispatchDelete(req) - case "PrivateEndpointConnectionsClient.Get": - resp, err = p.dispatchGet(req) - case "PrivateEndpointConnectionsClient.NewListPager": - resp, err = p.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (p *PrivateEndpointConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if privateEndpointConnectionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = privateEndpointConnectionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "PrivateEndpointConnectionsClient.Create": + res.resp, res.err = p.dispatchCreate(req) + case "PrivateEndpointConnectionsClient.Delete": + res.resp, res.err = p.dispatchDelete(req) + case "PrivateEndpointConnectionsClient.Get": + res.resp, res.err = p.dispatchGet(req) + case "PrivateEndpointConnectionsClient.NewListPager": + res.resp, res.err = p.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (p *PrivateEndpointConnectionsServerTransport) dispatchCreate(req *http.Request) (*http.Response, error) { @@ -95,7 +111,7 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchCreate(req *http.Req const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/botServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armbotservice.PrivateEndpointConnection](req) @@ -136,7 +152,7 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchDelete(req *http.Req const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/botServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -173,7 +189,7 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchGet(req *http.Reques const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/botServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -212,7 +228,7 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchNewListPager(req *ht const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/botServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -226,6 +242,9 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchNewListPager(req *ht resp := p.srv.NewListPager(resourceGroupNameParam, resourceNameParam, nil) newListPager = &resp p.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armbotservice.PrivateEndpointConnectionsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) } resp, err := server.PagerResponderNext(newListPager, req) if err != nil { @@ -240,3 +259,9 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchNewListPager(req *ht } return resp, nil } + +// set this to conditionally intercept incoming requests to PrivateEndpointConnectionsServerTransport +var privateEndpointConnectionsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/botservice/armbotservice/fake/privatelinkresources_server.go b/sdk/resourcemanager/botservice/armbotservice/fake/privatelinkresources_server.go index c34ec64a9952..91c4b12e09df 100644 --- a/sdk/resourcemanager/botservice/armbotservice/fake/privatelinkresources_server.go +++ b/sdk/resourcemanager/botservice/armbotservice/fake/privatelinkresources_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -15,7 +11,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice/v2" "net/http" "net/url" "regexp" @@ -49,21 +45,40 @@ func (p *PrivateLinkResourcesServerTransport) Do(req *http.Request) (*http.Respo return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return p.dispatchToMethodFake(req, method) +} - switch method { - case "PrivateLinkResourcesClient.ListByBotResource": - resp, err = p.dispatchListByBotResource(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (p *PrivateLinkResourcesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if privateLinkResourcesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = privateLinkResourcesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "PrivateLinkResourcesClient.ListByBotResource": + res.resp, res.err = p.dispatchListByBotResource(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (p *PrivateLinkResourcesServerTransport) dispatchListByBotResource(req *http.Request) (*http.Response, error) { @@ -73,7 +88,7 @@ func (p *PrivateLinkResourcesServerTransport) dispatchListByBotResource(req *htt const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/botServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateLinkResources` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -98,3 +113,9 @@ func (p *PrivateLinkResourcesServerTransport) dispatchListByBotResource(req *htt } return resp, nil } + +// set this to conditionally intercept incoming requests to PrivateLinkResourcesServerTransport +var privateLinkResourcesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/botservice/armbotservice/fake/qnamakerendpointkeys_server.go b/sdk/resourcemanager/botservice/armbotservice/fake/qnamakerendpointkeys_server.go index b38f932fcb7b..da3bc7c492f6 100644 --- a/sdk/resourcemanager/botservice/armbotservice/fake/qnamakerendpointkeys_server.go +++ b/sdk/resourcemanager/botservice/armbotservice/fake/qnamakerendpointkeys_server.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -15,7 +11,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice/v2" "net/http" "regexp" ) @@ -48,21 +44,40 @@ func (q *QnAMakerEndpointKeysServerTransport) Do(req *http.Request) (*http.Respo return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return q.dispatchToMethodFake(req, method) +} - switch method { - case "QnAMakerEndpointKeysClient.Get": - resp, err = q.dispatchGet(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (q *QnAMakerEndpointKeysServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if qnAMakerEndpointKeysServerTransportInterceptor != nil { + res.resp, res.err, intercepted = qnAMakerEndpointKeysServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "QnAMakerEndpointKeysClient.Get": + res.resp, res.err = q.dispatchGet(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (q *QnAMakerEndpointKeysServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -72,7 +87,7 @@ func (q *QnAMakerEndpointKeysServerTransport) dispatchGet(req *http.Request) (*h const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.BotService/listQnAMakerEndpointKeys` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { + if len(matches) < 2 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armbotservice.QnAMakerEndpointKeysRequestBody](req) @@ -93,3 +108,9 @@ func (q *QnAMakerEndpointKeysServerTransport) dispatchGet(req *http.Request) (*h } return resp, nil } + +// set this to conditionally intercept incoming requests to QnAMakerEndpointKeysServerTransport +var qnAMakerEndpointKeysServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/botservice/armbotservice/fake/server_factory.go b/sdk/resourcemanager/botservice/armbotservice/fake/server_factory.go index c98ddb569262..82fa0dd2122c 100644 --- a/sdk/resourcemanager/botservice/armbotservice/fake/server_factory.go +++ b/sdk/resourcemanager/botservice/armbotservice/fake/server_factory.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -19,17 +15,41 @@ import ( // ServerFactory is a fake server for instances of the armbotservice.ClientFactory type. type ServerFactory struct { - BotConnectionServer BotConnectionServer - BotsServer BotsServer - ChannelsServer ChannelsServer - DirectLineServer DirectLineServer - EmailServer EmailServer - HostSettingsServer HostSettingsServer - OperationResultsServer OperationResultsServer - OperationsServer OperationsServer + // BotConnectionServer contains the fakes for client BotConnectionClient + BotConnectionServer BotConnectionServer + + // BotsServer contains the fakes for client BotsClient + BotsServer BotsServer + + // ChannelsServer contains the fakes for client ChannelsClient + ChannelsServer ChannelsServer + + // DirectLineServer contains the fakes for client DirectLineClient + DirectLineServer DirectLineServer + + // EmailServer contains the fakes for client EmailClient + EmailServer EmailServer + + // HostSettingsServer contains the fakes for client HostSettingsClient + HostSettingsServer HostSettingsServer + + // NetworkSecurityPerimeterConfigurationsServer contains the fakes for client NetworkSecurityPerimeterConfigurationsClient + NetworkSecurityPerimeterConfigurationsServer NetworkSecurityPerimeterConfigurationsServer + + // OperationResultsServer contains the fakes for client OperationResultsClient + OperationResultsServer OperationResultsServer + + // OperationsServer contains the fakes for client OperationsClient + OperationsServer OperationsServer + + // PrivateEndpointConnectionsServer contains the fakes for client PrivateEndpointConnectionsClient PrivateEndpointConnectionsServer PrivateEndpointConnectionsServer - PrivateLinkResourcesServer PrivateLinkResourcesServer - QnAMakerEndpointKeysServer QnAMakerEndpointKeysServer + + // PrivateLinkResourcesServer contains the fakes for client PrivateLinkResourcesClient + PrivateLinkResourcesServer PrivateLinkResourcesServer + + // QnAMakerEndpointKeysServer contains the fakes for client QnAMakerEndpointKeysClient + QnAMakerEndpointKeysServer QnAMakerEndpointKeysServer } // NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. @@ -44,19 +64,20 @@ func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport { // ServerFactoryTransport connects instances of armbotservice.ClientFactory to instances of ServerFactory. // Don't use this type directly, use NewServerFactoryTransport instead. type ServerFactoryTransport struct { - srv *ServerFactory - trMu sync.Mutex - trBotConnectionServer *BotConnectionServerTransport - trBotsServer *BotsServerTransport - trChannelsServer *ChannelsServerTransport - trDirectLineServer *DirectLineServerTransport - trEmailServer *EmailServerTransport - trHostSettingsServer *HostSettingsServerTransport - trOperationResultsServer *OperationResultsServerTransport - trOperationsServer *OperationsServerTransport - trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport - trPrivateLinkResourcesServer *PrivateLinkResourcesServerTransport - trQnAMakerEndpointKeysServer *QnAMakerEndpointKeysServerTransport + srv *ServerFactory + trMu sync.Mutex + trBotConnectionServer *BotConnectionServerTransport + trBotsServer *BotsServerTransport + trChannelsServer *ChannelsServerTransport + trDirectLineServer *DirectLineServerTransport + trEmailServer *EmailServerTransport + trHostSettingsServer *HostSettingsServerTransport + trNetworkSecurityPerimeterConfigurationsServer *NetworkSecurityPerimeterConfigurationsServerTransport + trOperationResultsServer *OperationResultsServerTransport + trOperationsServer *OperationsServerTransport + trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport + trPrivateLinkResourcesServer *PrivateLinkResourcesServerTransport + trQnAMakerEndpointKeysServer *QnAMakerEndpointKeysServerTransport } // Do implements the policy.Transporter interface for ServerFactoryTransport. @@ -92,6 +113,11 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { case "HostSettingsClient": initServer(s, &s.trHostSettingsServer, func() *HostSettingsServerTransport { return NewHostSettingsServerTransport(&s.srv.HostSettingsServer) }) resp, err = s.trHostSettingsServer.Do(req) + case "NetworkSecurityPerimeterConfigurationsClient": + initServer(s, &s.trNetworkSecurityPerimeterConfigurationsServer, func() *NetworkSecurityPerimeterConfigurationsServerTransport { + return NewNetworkSecurityPerimeterConfigurationsServerTransport(&s.srv.NetworkSecurityPerimeterConfigurationsServer) + }) + resp, err = s.trNetworkSecurityPerimeterConfigurationsServer.Do(req) case "OperationResultsClient": initServer(s, &s.trOperationResultsServer, func() *OperationResultsServerTransport { return NewOperationResultsServerTransport(&s.srv.OperationResultsServer) diff --git a/sdk/resourcemanager/botservice/armbotservice/fake/time_rfc3339.go b/sdk/resourcemanager/botservice/armbotservice/fake/time_rfc3339.go deleted file mode 100644 index b0535a7b63e6..000000000000 --- a/sdk/resourcemanager/botservice/armbotservice/fake/time_rfc3339.go +++ /dev/null @@ -1,86 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) - -const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` -) - -type dateTimeRFC3339 time.Time - -func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t dateTimeRFC3339) MarshalText() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { - layout = dateTimeJSON - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { - layout = time.RFC3339Nano - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = dateTimeRFC3339(p) - return err -} - -func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*dateTimeRFC3339)(t) -} - -func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { - return nil - } - var aux dateTimeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/sdk/resourcemanager/botservice/armbotservice/go.mod b/sdk/resourcemanager/botservice/armbotservice/go.mod index f1c545a9a95b..c6bc7f4182a2 100644 --- a/sdk/resourcemanager/botservice/armbotservice/go.mod +++ b/sdk/resourcemanager/botservice/armbotservice/go.mod @@ -1,11 +1,11 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice/v2 go 1.23.0 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.1 - github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.19.0 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.11.0 + github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 github.com/stretchr/testify v1.10.0 @@ -14,14 +14,14 @@ require ( require ( github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/golang-jwt/jwt/v5 v5.2.2 // indirect + github.com/golang-jwt/jwt/v5 v5.3.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/crypto v0.40.0 // indirect - golang.org/x/net v0.42.0 // indirect - golang.org/x/sys v0.34.0 // indirect - golang.org/x/text v0.27.0 // indirect + golang.org/x/crypto v0.41.0 // indirect + golang.org/x/net v0.43.0 // indirect + golang.org/x/sys v0.35.0 // indirect + golang.org/x/text v0.28.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/sdk/resourcemanager/botservice/armbotservice/go.sum b/sdk/resourcemanager/botservice/armbotservice/go.sum index 2bf8ec4cf7b1..890355825756 100644 --- a/sdk/resourcemanager/botservice/armbotservice/go.sum +++ b/sdk/resourcemanager/botservice/armbotservice/go.sum @@ -1,11 +1,11 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.1 h1:Wc1ml6QlJs2BHQ/9Bqu1jiyggbsSjramq2oUmp5WeIo= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.1/go.mod h1:Ot/6aikWnKWi4l9QB7qVSwa8iMphQNqkWALMoNT3rzM= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.1 h1:B+blDbyVIG3WaikNxPnhPiJ1MThR03b3vKGtER95TP4= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.1/go.mod h1:JdM5psgjfBf5fo2uWOZhflPWyDBZ/O/CNAH9CtsuZE4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.19.0 h1:ci6Yd6nysBRLEodoziB6ah1+YOzZbZk+NYneoA6q+6E= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.19.0/go.mod h1:QyVsSSN64v5TGltphKLQ2sQxe4OBQg0J1eKRcVBnfgE= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.11.0 h1:MhRfI58HblXzCtWEZCO0feHs8LweePB3s90r7WaR1KU= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.11.0/go.mod h1:okZ+ZURbArNdlJ+ptXoyHNuOETzOl1Oww19rm8I2WLA= github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2 h1:yz1bePFlP5Vws5+8ez6T3HWXPmwOK7Yvq8QxDBD3SKY= github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2/go.mod h1:Pa9ZNPuoNu/GztvBSKk9J1cDJW6vk/n0zLtV4mgd8N8= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 h1:FPKJS1T+clwv+OLGt13a8UjqeRuh0O4SJ3lUriThc+4= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1/go.mod h1:j2chePtV91HrC22tGoRX3sGY42uF13WzmmV80/OdVAA= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 h1:9iefClla7iYpfYWdzPCRDozdmndjTm8DXdpCzPajMgA= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2/go.mod h1:XtLgD3ZD34DAaVIIAyG3objl5DynM3CQ/vMcbBNJZGI= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 h1:PTFGRSlMKCQelWwxUyYVEUqseBJVemLyqWJjvMyt0do= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0/go.mod h1:LRr2FzBTQlONPPa5HREE5+RjSCTXl7BwOvYOaWTqCaI= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0 h1:2qsIIvxVT+uE6yrNldntJKlLRgxGbZ85kgtz5SNBhMw= @@ -18,14 +18,10 @@ github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJ github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE= github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 h1:oygO0locgZJe7PpYPXT5A29ZkwJaPqcva7BVeemZOZs= github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8= -github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo= +github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/keybase/go-keychain v0.0.1 h1:way+bWYa6lDppZoZcgMbYsvC7GxljxrskdNInRtuthU= @@ -40,21 +36,19 @@ github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmd github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/redis/go-redis/v9 v9.8.0 h1:q3nRvjrlge/6UD7eTu/DSg2uYiU2mCL0G/uzBWqhicI= -github.com/redis/go-redis/v9 v9.8.0/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM= -golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY= -golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs= -golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8= +golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4= +golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc= +golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= +golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA= -golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4= -golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU= +golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= +golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= +golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/sdk/resourcemanager/botservice/armbotservice/hostsettings_client.go b/sdk/resourcemanager/botservice/armbotservice/hostsettings_client.go index 6252608282e2..8c8d386a3570 100644 --- a/sdk/resourcemanager/botservice/armbotservice/hostsettings_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/hostsettings_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice @@ -28,7 +24,7 @@ type HostSettingsClient struct { } // NewHostSettingsClient creates a new instance of HostSettingsClient with the specified values. -// - subscriptionID - Azure Subscription ID. +// - 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 NewHostSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*HostSettingsClient, error) { @@ -46,7 +42,7 @@ func NewHostSettingsClient(subscriptionID string, credential azcore.TokenCredent // Get - Get per subscription settings needed to host bot in compute resource such as Azure App Service // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-09-15 +// Generated from API version 2023-09-15-preview // - options - HostSettingsClientGetOptions contains the optional parameters for the HostSettingsClient.Get method. func (client *HostSettingsClient) Get(ctx context.Context, options *HostSettingsClientGetOptions) (HostSettingsClientGetResponse, error) { var err error @@ -71,7 +67,7 @@ func (client *HostSettingsClient) Get(ctx context.Context, options *HostSettings } // getCreateRequest creates the Get request. -func (client *HostSettingsClient) getCreateRequest(ctx context.Context, options *HostSettingsClientGetOptions) (*policy.Request, error) { +func (client *HostSettingsClient) getCreateRequest(ctx context.Context, _ *HostSettingsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.BotService/hostSettings" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -82,7 +78,7 @@ func (client *HostSettingsClient) getCreateRequest(ctx context.Context, options return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/botservice/armbotservice/hostsettings_client_example_test.go b/sdk/resourcemanager/botservice/armbotservice/hostsettings_client_example_test.go index fb4ef845c7e7..9aa381a4a631 100644 --- a/sdk/resourcemanager/botservice/armbotservice/hostsettings_client_example_test.go +++ b/sdk/resourcemanager/botservice/armbotservice/hostsettings_client_example_test.go @@ -1,30 +1,24 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetHostSettings.json +// Generated from example definition: 2023-09-15-preview/GetHostSettings.json func ExampleHostSettingsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -35,14 +29,16 @@ func ExampleHostSettingsClient_Get() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.HostSettingsResponse = armbotservice.HostSettingsResponse{ - // BotOpenIDMetadata: to.Ptr("https://login.botframework.com/v1/.well-known/openidconfiguration"), - // OAuthURL: to.Ptr("https://token.botframework.com/"), - // ToBotFromChannelOpenIDMetadataURL: to.Ptr("https://login.botframework.com/v1/.well-known/openidconfiguration"), - // ToBotFromChannelTokenIssuer: to.Ptr("https://api.botframework.com"), - // ToBotFromEmulatorOpenIDMetadataURL: to.Ptr("https://login.microsoftonline.com/botframework.com/v2.0/.well-known/openid-configuration"), - // ToChannelFromBotLoginURL: to.Ptr("https://login.microsoftonline.com/botframework.com"), - // ToChannelFromBotOAuthScope: to.Ptr("https://api.botframework.com"), - // ValidateAuthority: to.Ptr(true), + // res = armbotservice.HostSettingsClientGetResponse{ + // HostSettingsResponse: &armbotservice.HostSettingsResponse{ + // BotOpenIDMetadata: to.Ptr("https://login.botframework.com/v1/.well-known/openidconfiguration"), + // OAuthURL: to.Ptr("https://token.botframework.com/"), + // ToBotFromChannelOpenIDMetadataURL: to.Ptr("https://login.botframework.com/v1/.well-known/openidconfiguration"), + // ToBotFromChannelTokenIssuer: to.Ptr("https://api.botframework.com"), + // ToBotFromEmulatorOpenIDMetadataURL: to.Ptr("https://login.microsoftonline.com/botframework.com/v2.0/.well-known/openid-configuration"), + // ToChannelFromBotLoginURL: to.Ptr("https://login.microsoftonline.com/botframework.com"), + // ToChannelFromBotOAuthScope: to.Ptr("https://api.botframework.com"), + // ValidateAuthority: to.Ptr(true), + // }, // } } diff --git a/sdk/resourcemanager/botservice/armbotservice/interfaces.go b/sdk/resourcemanager/botservice/armbotservice/interfaces.go index 42a17dcbe22f..6ff8c25153ba 100644 --- a/sdk/resourcemanager/botservice/armbotservice/interfaces.go +++ b/sdk/resourcemanager/botservice/armbotservice/interfaces.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice @@ -13,7 +9,7 @@ package armbotservice // Use a type switch to determine the concrete type. The possible types are: // - *AcsChatChannel, *AlexaChannel, *Channel, *DirectLineChannel, *DirectLineSpeechChannel, *EmailChannel, *FacebookChannel, // - *KikChannel, *LineChannel, *M365Extensions, *MsTeamsChannel, *Omnichannel, *OutlookChannel, *SearchAssistant, *SkypeChannel, -// - *SlackChannel, *SmsChannel, *TelegramChannel, *TelephonyChannel, *WebChatChannel +// - *SlackChannel, *SmsChannel, *TelegramChannel, *TelephonyChannel, *TestChatChannel, *WebChatChannel type ChannelClassification interface { // GetChannel returns the Channel content of the underlying type. GetChannel() *Channel diff --git a/sdk/resourcemanager/botservice/armbotservice/models.go b/sdk/resourcemanager/botservice/armbotservice/models.go index 4d85c45a3d8f..0e78e71a84d8 100644 --- a/sdk/resourcemanager/botservice/armbotservice/models.go +++ b/sdk/resourcemanager/botservice/armbotservice/models.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice @@ -12,7 +8,8 @@ import "time" // AcsChatChannel - AcsChat channel definition type AcsChatChannel struct { - // REQUIRED; The channel name + // CONSTANT; The channel name + // Field has constant value "AcsChatChannel", any specified value is ignored. ChannelName *string // Entity Tag of the resource @@ -37,7 +34,8 @@ func (a *AcsChatChannel) GetChannel() *Channel { // AlexaChannel - Alexa channel definition type AlexaChannel struct { - // REQUIRED; The channel name + // CONSTANT; The channel name + // Field has constant value "AlexaChannel", any specified value is ignored. ChannelName *string // Entity Tag of the resource @@ -80,7 +78,7 @@ type AlexaChannelProperties struct { // Bot resource definition type Bot struct { - // Entity Tag + // Entity Tag. Etag *string // Required. Gets or sets the Kind of the resource. @@ -98,13 +96,16 @@ type Bot struct { // Contains resource tags defined as key/value pairs. Tags map[string]*string - // READ-ONLY; Specifies the resource ID. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Specifies the name of the resource. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Specifies the type of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string // READ-ONLY; Entity zones @@ -113,7 +114,7 @@ type Bot struct { // BotChannel - Bot channel resource definition type BotChannel struct { - // Entity Tag + // Entity Tag. Etag *string // Required. Gets or sets the Kind of the resource. @@ -131,13 +132,16 @@ type BotChannel struct { // Contains resource tags defined as key/value pairs. Tags map[string]*string - // READ-ONLY; Specifies the resource ID. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Specifies the name of the resource. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Specifies the type of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string // READ-ONLY; Entity zones @@ -245,6 +249,9 @@ type BotProperties struct { // READ-ONLY; Token used to migrate non Azure bot to azure subscription MigrationToken *string + // READ-ONLY; List of Network Security Perimeter configurations for the bot + NetworkSecurityPerimeterConfigurations []*NetworkSecurityPerimeterConfiguration + // READ-ONLY; List of Private Endpoint Connections configured for the bot PrivateEndpointConnections []*PrivateEndpointConnection @@ -254,11 +261,11 @@ type BotProperties struct { // BotResponseList - The list of bot service operation response. type BotResponseList struct { - // The link used to get the next page of bot service resources. - NextLink *string - - // READ-ONLY; Gets the list of bot service results and their properties. + // READ-ONLY; The Bot items on this page Value []*Bot + + // The link to the next page of items + NextLink *string } // Channel definition @@ -281,11 +288,11 @@ func (c *Channel) GetChannel() *Channel { return c } // ChannelResponseList - The list of bot service channel operation response. type ChannelResponseList struct { - // The link used to get the next page of bot service channel resources. - NextLink *string - - // READ-ONLY; Gets the list of bot service channel results and their properties. + // READ-ONLY; The BotChannel items on this page Value []*BotChannel + + // The link to the next page of items + NextLink *string } // ChannelSettings - Channel settings definition @@ -344,15 +351,9 @@ type CheckNameAvailabilityResponseBody struct { Valid *bool } -// ConnectionItemName - The display name of a connection Item Setting registered with the Bot -type ConnectionItemName struct { - // READ-ONLY; Connection Item name that has been added in the API - Name *string -} - // ConnectionSetting - Bot channel resource definition type ConnectionSetting struct { - // Entity Tag + // Entity Tag. Etag *string // Required. Gets or sets the Kind of the resource. @@ -370,13 +371,16 @@ type ConnectionSetting struct { // Contains resource tags defined as key/value pairs. Tags map[string]*string - // READ-ONLY; Specifies the resource ID. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Specifies the name of the resource. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Specifies the type of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string // READ-ONLY; Entity zones @@ -400,6 +404,12 @@ type ConnectionSettingProperties struct { // Client Secret associated with the Connection Setting ClientSecret *string + // Id of the Connection Setting. + ID *string + + // Name of the Connection Setting. + Name *string + // Service Provider Parameters associated with the Connection Setting Parameters []*ConnectionSettingParameter @@ -421,11 +431,11 @@ type ConnectionSettingProperties struct { // ConnectionSettingResponseList - The list of bot service connection settings response. type ConnectionSettingResponseList struct { - // The link used to get the next page of bot service connection setting resources. - NextLink *string - - // READ-ONLY; Gets the list of bot service connection settings and their properties. + // READ-ONLY; The ConnectionSetting items on this page Value []*ConnectionSetting + + // The link to the next page of items + NextLink *string } // CreateEmailSignInURLResponse - The ARM create email sign in url operation response. @@ -448,7 +458,8 @@ type CreateEmailSignInURLResponseProperties struct { // DirectLineChannel - Direct Line channel definition type DirectLineChannel struct { - // REQUIRED; The channel name + // CONSTANT; The channel name + // Field has constant value "DirectLineChannel", any specified value is ignored. ChannelName *string // Entity Tag of the resource @@ -551,7 +562,8 @@ type DirectLineSite struct { // DirectLineSpeechChannel - DirectLine Speech channel definition type DirectLineSpeechChannel struct { - // REQUIRED; The channel name + // CONSTANT; The channel name + // Field has constant value "DirectLineSpeechChannel", any specified value is ignored. ChannelName *string // Entity Tag of the resource @@ -603,7 +615,8 @@ type DirectLineSpeechChannelProperties struct { // EmailChannel - Email channel definition type EmailChannel struct { - // REQUIRED; The channel name + // CONSTANT; The channel name + // Field has constant value "EmailChannel", any specified value is ignored. ChannelName *string // Entity Tag of the resource @@ -647,24 +660,10 @@ type EmailChannelProperties struct { Password *string } -// Error - Bot Service error object. -type Error struct { - // The error body. - Error *ErrorBody -} - -// ErrorBody - Bot Service error body. -type ErrorBody struct { - // REQUIRED; error code - Code *string - - // REQUIRED; error message - Message *string -} - // FacebookChannel - Facebook channel definition type FacebookChannel struct { - // REQUIRED; The channel name + // CONSTANT; The channel name + // Field has constant value "FacebookChannel", any specified value is ignored. ChannelName *string // Entity Tag of the resource @@ -749,7 +748,8 @@ type HostSettingsResponse struct { // KikChannel - Kik channel definition type KikChannel struct { - // REQUIRED; The channel name + // CONSTANT; The channel name + // Field has constant value "KikChannel", any specified value is ignored. ChannelName *string // Entity Tag of the resource @@ -792,7 +792,8 @@ type KikChannelProperties struct { // LineChannel - Line channel definition type LineChannel struct { - // REQUIRED; The channel name + // CONSTANT; The channel name + // Field has constant value "LineChannel", any specified value is ignored. ChannelName *string // Entity Tag of the resource @@ -850,7 +851,7 @@ type ListChannelWithKeysResponse struct { // Entity tag of the resource EntityTag *string - // Entity Tag + // Entity Tag. Etag *string // Required. Gets or sets the Kind of the resource. @@ -877,13 +878,16 @@ type ListChannelWithKeysResponse struct { // Contains resource tags defined as key/value pairs. Tags map[string]*string - // READ-ONLY; Specifies the resource ID. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Specifies the name of the resource. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Specifies the type of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string // READ-ONLY; Entity zones @@ -892,7 +896,8 @@ type ListChannelWithKeysResponse struct { // M365Extensions - M365 Extensions definition type M365Extensions struct { - // REQUIRED; The channel name + // CONSTANT; The channel name + // Field has constant value "M365Extensions", any specified value is ignored. ChannelName *string // Entity Tag of the resource @@ -917,7 +922,8 @@ func (m *M365Extensions) GetChannel() *Channel { // MsTeamsChannel - Microsoft Teams channel definition type MsTeamsChannel struct { - // REQUIRED; The channel name + // CONSTANT; The channel name + // Field has constant value "MsTeamsChannel", any specified value is ignored. ChannelName *string // Entity Tag of the resource @@ -964,9 +970,104 @@ type MsTeamsChannelProperties struct { IncomingCallRoute *string } +// NetworkSecurityPerimeter - Information about Network Security Perimeter +type NetworkSecurityPerimeter struct { + // Location of the Network Security Perimeter + Location *string + + // Guid of the Network Security Perimeter + PerimeterGUID *string + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string +} + +// NetworkSecurityPerimeterConfiguration - Network Security Perimeter configuration +type NetworkSecurityPerimeterConfiguration struct { + // Properties of the Network Security Perimeter configuration + Properties *NetworkSecurityPerimeterConfigurationProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// NetworkSecurityPerimeterConfigurationList - Result of the List NetworkSecurityPerimeterConfiguration operation. +type NetworkSecurityPerimeterConfigurationList struct { + // READ-ONLY; The NetworkSecurityPerimeterConfiguration items on this page + Value []*NetworkSecurityPerimeterConfiguration + + // The link to the next page of items + NextLink *string +} + +// NetworkSecurityPerimeterConfigurationProperties - Properties of Network Security Perimeter configuration +type NetworkSecurityPerimeterConfigurationProperties struct { + // List of Provisioning Issues if any + ProvisioningIssues []*ProvisioningIssue + ProvisioningState *ProvisioningState + + // READ-ONLY; Information about Network Security Perimeter + NetworkSecurityPerimeter *NetworkSecurityPerimeter + + // READ-ONLY; Information about profile + Profile *Profile + + // READ-ONLY; Information about resource association + ResourceAssociation *ResourceAssociation +} + +// NspAccessRule - Information of Access Rule in a profile +type NspAccessRule struct { + // Name of the access rule + Name *string + + // READ-ONLY; Properties of Access Rule + Properties *NspAccessRuleProperties +} + +// NspAccessRuleProperties - Properties of Access Rule +type NspAccessRuleProperties struct { + // Address prefixes in the CIDR format for inbound rules + AddressPrefixes []*string + + // Direction of Access Rule + Direction *NspAccessRuleDirection + + // Subscriptions for inbound rules + Subscriptions []*NspAccessRulePropertiesSubscriptionsItem + + // READ-ONLY; Email addresses for outbound rules + EmailAddresses []*string + + // READ-ONLY; FQDN for outbound rules + FullyQualifiedDomainNames []*string + + // READ-ONLY; NetworkSecurityPerimeters for inbound rules + NetworkSecurityPerimeters []*NetworkSecurityPerimeter + + // READ-ONLY; Phone numbers for outbound rules + PhoneNumbers []*string +} + +// NspAccessRulePropertiesSubscriptionsItem - Subscription for inbound rule +type NspAccessRulePropertiesSubscriptionsItem struct { + // Fully qualified identifier of subscription + ID *string +} + // Omnichannel channel definition type Omnichannel struct { - // REQUIRED; The channel name + // CONSTANT; The channel name + // Field has constant value "Omnichannel", any specified value is ignored. ChannelName *string // Entity Tag of the resource @@ -1021,11 +1122,11 @@ type OperationEntity struct { // OperationEntityListResult - The list of bot service operation response. type OperationEntityListResult struct { + // REQUIRED; The list of operations. + Value []*OperationEntity + // The link used to get the next page of operations. NextLink *string - - // The list of operations. - Value []*OperationEntity } // OperationResultsDescription - The properties indicating the operation result of an operation on a service. @@ -1045,7 +1146,8 @@ type OperationResultsDescription struct { // OutlookChannel - Outlook channel definition type OutlookChannel struct { - // REQUIRED; The channel name + // CONSTANT; The channel name + // Field has constant value "OutlookChannel", any specified value is ignored. ChannelName *string // Entity Tag of the resource @@ -1085,12 +1187,18 @@ type PrivateEndpointConnection struct { // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } // PrivateEndpointConnectionListResult - List of private endpoint connection associated with the specified storage account type PrivateEndpointConnectionListResult struct { + // The link used to get the next page of private endpoint connections. + NextLink *string + // Array of private endpoint connections Value []*PrivateEndpointConnection } @@ -1125,18 +1233,6 @@ type PrivateLinkResource struct { Type *string } -// PrivateLinkResourceBase - Common fields that are returned in the response for all BotService Private Link Resources -type PrivateLinkResourceBase struct { - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - // PrivateLinkResourceListResult - A list of private link resources type PrivateLinkResourceListResult struct { // Array of private link resources @@ -1168,6 +1264,51 @@ type PrivateLinkServiceConnectionState struct { Status *PrivateEndpointServiceConnectionStatus } +// Profile - Information about profile +type Profile struct { + // List of Access Rules + AccessRules []*NspAccessRule + + // Current access rules version + AccessRulesVersion *int64 + + // Current diagnostic settings version + DiagnosticSettingsVersion *int64 + + // Name of the profile + Name *string + + // READ-ONLY; List of log categories + EnabledLogCategories []*string +} + +// ProvisioningIssue - Describes Provisioning issue for given Network Security Perimeter configuration +type ProvisioningIssue struct { + // Name of the issue + Name *string + + // READ-ONLY; Properties of Provisioning Issue + Properties *ProvisioningIssueProperties +} + +// ProvisioningIssueProperties - Properties of Provisioning Issue +type ProvisioningIssueProperties struct { + // Description of the issue + Description *string + + // Type of Issue + IssueType *string + + // Provisioning state of Network Security Perimeter configuration propagation + Severity *Severity + + // Access rules that can be added to the same profile to remediate the issue. + SuggestedAccessRules []*NspAccessRule + + // READ-ONLY; ARM IDs of resources that can be associated to the same perimeter to remediate the issue. + SuggestedResourceIDs []*string +} + // QnAMakerEndpointKeysRequestBody - The request body for a request to Bot Service Management to list QnA Maker endpoint keys. type QnAMakerEndpointKeysRequestBody struct { // Subscription key which provides access to this API. @@ -1192,34 +1333,13 @@ type QnAMakerEndpointKeysResponse struct { SecondaryEndpointKey *string } -// Resource - Azure resource -type Resource struct { - // Entity Tag - Etag *string - - // Required. Gets or sets the Kind of the resource. - Kind *Kind - - // Specifies the location of the resource. - Location *string - - // Gets or sets the SKU of the resource. - SKU *SKU - - // Contains resource tags defined as key/value pairs. - Tags map[string]*string +// ResourceAssociation - Information about resource association +type ResourceAssociation struct { + // Access Mode of the resource association + AccessMode *AccessMode - // READ-ONLY; Specifies the resource ID. - ID *string - - // READ-ONLY; Specifies the name of the resource. + // Name of the resource association Name *string - - // READ-ONLY; Specifies the type of the resource. - Type *string - - // READ-ONLY; Entity zones - Zones []*string } // SKU - The SKU of the cognitive services account. @@ -1233,7 +1353,8 @@ type SKU struct { // SearchAssistant definition type SearchAssistant struct { - // REQUIRED; The channel name + // CONSTANT; The channel name + // Field has constant value "SearchAssistant", any specified value is ignored. ChannelName *string // Entity Tag of the resource @@ -1399,7 +1520,8 @@ type SiteInfo struct { // SkypeChannel - Skype channel definition type SkypeChannel struct { - // REQUIRED; The channel name + // CONSTANT; The channel name + // Field has constant value "SkypeChannel", any specified value is ignored. ChannelName *string // Entity Tag of the resource @@ -1460,7 +1582,8 @@ type SkypeChannelProperties struct { // SlackChannel - Slack channel definition type SlackChannel struct { - // REQUIRED; The channel name + // CONSTANT; The channel name + // Field has constant value "SlackChannel", any specified value is ignored. ChannelName *string // Entity Tag of the resource @@ -1524,7 +1647,8 @@ type SlackChannelProperties struct { // SmsChannel - Sms channel definition type SmsChannel struct { - // REQUIRED; The channel name + // CONSTANT; The channel name + // Field has constant value "SmsChannel", any specified value is ignored. ChannelName *string // Entity Tag of the resource @@ -1568,9 +1692,31 @@ type SmsChannelProperties struct { IsValidated *bool } +// SystemData - Metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // The timestamp of resource creation (UTC). + CreatedAt *time.Time + + // The identity that created the resource. + CreatedBy *string + + // The type of identity that created the resource. + CreatedByType *CreatedByType + + // The timestamp of resource last modification (UTC) + LastModifiedAt *time.Time + + // The identity that last modified the resource. + LastModifiedBy *string + + // The type of identity that last modified the resource. + LastModifiedByType *CreatedByType +} + // TelegramChannel - Telegram channel definition type TelegramChannel struct { - // REQUIRED; The channel name + // CONSTANT; The channel name + // Field has constant value "TelegramChannel", any specified value is ignored. ChannelName *string // Entity Tag of the resource @@ -1610,7 +1756,8 @@ type TelegramChannelProperties struct { // TelephonyChannel - Telephony channel definition type TelephonyChannel struct { - // REQUIRED; The channel name + // CONSTANT; The channel name + // Field has constant value "TelephonyChannel", any specified value is ignored. ChannelName *string // Entity Tag of the resource @@ -1714,9 +1861,36 @@ type TelephonyPhoneNumbers struct { PhoneNumber *string } +// TestChatChannel - AcsChat channel definition +type TestChatChannel struct { + // CONSTANT; The channel name + // Field has constant value "TestChatChannel", any specified value is ignored. + ChannelName *string + + // Entity Tag of the resource + Etag *string + + // Specifies the location of the resource. + Location *string + + // READ-ONLY; Provisioning state of the resource + ProvisioningState *string +} + +// GetChannel implements the ChannelClassification interface for type TestChatChannel. +func (t *TestChatChannel) GetChannel() *Channel { + return &Channel{ + ChannelName: t.ChannelName, + Etag: t.Etag, + Location: t.Location, + ProvisioningState: t.ProvisioningState, + } +} + // WebChatChannel - Web Chat channel definition type WebChatChannel struct { - // REQUIRED; The channel name + // CONSTANT; The channel name + // Field has constant value "WebChatChannel", any specified value is ignored. ChannelName *string // Entity Tag of the resource diff --git a/sdk/resourcemanager/botservice/armbotservice/models_serde.go b/sdk/resourcemanager/botservice/armbotservice/models_serde.go index f8b6f5b49f83..37559be2124b 100644 --- a/sdk/resourcemanager/botservice/armbotservice/models_serde.go +++ b/sdk/resourcemanager/botservice/armbotservice/models_serde.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice @@ -146,6 +142,7 @@ func (b Bot) MarshalJSON() ([]byte, error) { populate(objectMap, "name", b.Name) populate(objectMap, "properties", b.Properties) populate(objectMap, "sku", b.SKU) + populate(objectMap, "systemData", b.SystemData) populate(objectMap, "tags", b.Tags) populate(objectMap, "type", b.Type) populate(objectMap, "zones", b.Zones) @@ -182,6 +179,9 @@ func (b *Bot) UnmarshalJSON(data []byte) error { case "sku": err = unpopulate(val, "SKU", &b.SKU) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &b.SystemData) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &b.Tags) delete(rawMsg, key) @@ -209,6 +209,7 @@ func (b BotChannel) MarshalJSON() ([]byte, error) { populate(objectMap, "name", b.Name) populate(objectMap, "properties", b.Properties) populate(objectMap, "sku", b.SKU) + populate(objectMap, "systemData", b.SystemData) populate(objectMap, "tags", b.Tags) populate(objectMap, "type", b.Type) populate(objectMap, "zones", b.Zones) @@ -245,6 +246,9 @@ func (b *BotChannel) UnmarshalJSON(data []byte) error { case "sku": err = unpopulate(val, "SKU", &b.SKU) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &b.SystemData) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &b.Tags) delete(rawMsg, key) @@ -291,6 +295,7 @@ func (b BotProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "msaAppMSIResourceId", b.MsaAppMSIResourceID) populate(objectMap, "msaAppTenantId", b.MsaAppTenantID) populate(objectMap, "msaAppType", b.MsaAppType) + populate(objectMap, "networkSecurityPerimeterConfigurations", b.NetworkSecurityPerimeterConfigurations) populate(objectMap, "openWithHint", b.OpenWithHint) populate(objectMap, "parameters", b.Parameters) populate(objectMap, "privateEndpointConnections", b.PrivateEndpointConnections) @@ -390,6 +395,9 @@ func (b *BotProperties) UnmarshalJSON(data []byte) error { case "msaAppType": err = unpopulate(val, "MsaAppType", &b.MsaAppType) delete(rawMsg, key) + case "networkSecurityPerimeterConfigurations": + err = unpopulate(val, "NetworkSecurityPerimeterConfigurations", &b.NetworkSecurityPerimeterConfigurations) + delete(rawMsg, key) case "openWithHint": err = unpopulate(val, "OpenWithHint", &b.OpenWithHint) delete(rawMsg, key) @@ -459,7 +467,7 @@ func (b *BotResponseList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Channel. func (c Channel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["channelName"] = c.ChannelName + populate(objectMap, "channelName", c.ChannelName) populate(objectMap, "etag", c.Etag) populate(objectMap, "location", c.Location) populate(objectMap, "provisioningState", c.ProvisioningState) @@ -655,33 +663,6 @@ func (c *CheckNameAvailabilityResponseBody) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectionItemName. -func (c ConnectionItemName) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", c.Name) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionItemName. -func (c *ConnectionItemName) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type ConnectionSetting. func (c ConnectionSetting) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -692,6 +673,7 @@ func (c ConnectionSetting) MarshalJSON() ([]byte, error) { populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) populate(objectMap, "sku", c.SKU) + populate(objectMap, "systemData", c.SystemData) populate(objectMap, "tags", c.Tags) populate(objectMap, "type", c.Type) populate(objectMap, "zones", c.Zones) @@ -728,6 +710,9 @@ func (c *ConnectionSetting) UnmarshalJSON(data []byte) error { case "sku": err = unpopulate(val, "SKU", &c.SKU) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &c.Tags) delete(rawMsg, key) @@ -781,6 +766,8 @@ func (c ConnectionSettingProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "clientId", c.ClientID) populate(objectMap, "clientSecret", c.ClientSecret) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) populate(objectMap, "parameters", c.Parameters) populate(objectMap, "provisioningState", c.ProvisioningState) populate(objectMap, "scopes", c.Scopes) @@ -805,6 +792,12 @@ func (c *ConnectionSettingProperties) UnmarshalJSON(data []byte) error { case "clientSecret": err = unpopulate(val, "ClientSecret", &c.ClientSecret) delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) case "parameters": err = unpopulate(val, "Parameters", &c.Parameters) delete(rawMsg, key) @@ -1285,64 +1278,6 @@ func (e *EmailChannelProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Error. -func (e Error) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "error", e.Error) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Error. -func (e *Error) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "error": - err = unpopulate(val, "Error", &e.Error) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ErrorBody. -func (e ErrorBody) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "code", e.Code) - populate(objectMap, "message", e.Message) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorBody. -func (e *ErrorBody) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &e.Code) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &e.Message) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type FacebookChannel. func (f FacebookChannel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1729,6 +1664,7 @@ func (l ListChannelWithKeysResponse) MarshalJSON() ([]byte, error) { populate(objectMap, "resource", l.Resource) populate(objectMap, "sku", l.SKU) populate(objectMap, "setting", l.Setting) + populate(objectMap, "systemData", l.SystemData) populate(objectMap, "tags", l.Tags) populate(objectMap, "type", l.Type) populate(objectMap, "zones", l.Zones) @@ -1780,6 +1716,9 @@ func (l *ListChannelWithKeysResponse) UnmarshalJSON(data []byte) error { case "setting": err = unpopulate(val, "Setting", &l.Setting) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &l.SystemData) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &l.Tags) delete(rawMsg, key) @@ -1926,6 +1865,267 @@ func (m *MsTeamsChannelProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeter. +func (n NetworkSecurityPerimeter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) + populate(objectMap, "perimeterGuid", n.PerimeterGUID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeter. +func (n *NetworkSecurityPerimeter) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &n.Location) + delete(rawMsg, key) + case "perimeterGuid": + err = unpopulate(val, "PerimeterGUID", &n.PerimeterGUID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfiguration. +func (n NetworkSecurityPerimeterConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "systemData", n.SystemData) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfiguration. +func (n *NetworkSecurityPerimeterConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &n.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationList. +func (n NetworkSecurityPerimeterConfigurationList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationList. +func (n *NetworkSecurityPerimeterConfigurationList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &n.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationProperties. +func (n NetworkSecurityPerimeterConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "networkSecurityPerimeter", n.NetworkSecurityPerimeter) + populate(objectMap, "profile", n.Profile) + populate(objectMap, "provisioningIssues", n.ProvisioningIssues) + populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "resourceAssociation", n.ResourceAssociation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationProperties. +func (n *NetworkSecurityPerimeterConfigurationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "networkSecurityPerimeter": + err = unpopulate(val, "NetworkSecurityPerimeter", &n.NetworkSecurityPerimeter) + delete(rawMsg, key) + case "profile": + err = unpopulate(val, "Profile", &n.Profile) + delete(rawMsg, key) + case "provisioningIssues": + err = unpopulate(val, "ProvisioningIssues", &n.ProvisioningIssues) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + case "resourceAssociation": + err = unpopulate(val, "ResourceAssociation", &n.ResourceAssociation) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NspAccessRule. +func (n NspAccessRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NspAccessRule. +func (n *NspAccessRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NspAccessRuleProperties. +func (n NspAccessRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addressPrefixes", n.AddressPrefixes) + populate(objectMap, "direction", n.Direction) + populate(objectMap, "emailAddresses", n.EmailAddresses) + populate(objectMap, "fullyQualifiedDomainNames", n.FullyQualifiedDomainNames) + populate(objectMap, "networkSecurityPerimeters", n.NetworkSecurityPerimeters) + populate(objectMap, "phoneNumbers", n.PhoneNumbers) + populate(objectMap, "subscriptions", n.Subscriptions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NspAccessRuleProperties. +func (n *NspAccessRuleProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "addressPrefixes": + err = unpopulate(val, "AddressPrefixes", &n.AddressPrefixes) + delete(rawMsg, key) + case "direction": + err = unpopulate(val, "Direction", &n.Direction) + delete(rawMsg, key) + case "emailAddresses": + err = unpopulate(val, "EmailAddresses", &n.EmailAddresses) + delete(rawMsg, key) + case "fullyQualifiedDomainNames": + err = unpopulate(val, "FullyQualifiedDomainNames", &n.FullyQualifiedDomainNames) + delete(rawMsg, key) + case "networkSecurityPerimeters": + err = unpopulate(val, "NetworkSecurityPerimeters", &n.NetworkSecurityPerimeters) + delete(rawMsg, key) + case "phoneNumbers": + err = unpopulate(val, "PhoneNumbers", &n.PhoneNumbers) + delete(rawMsg, key) + case "subscriptions": + err = unpopulate(val, "Subscriptions", &n.Subscriptions) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NspAccessRulePropertiesSubscriptionsItem. +func (n NspAccessRulePropertiesSubscriptionsItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NspAccessRulePropertiesSubscriptionsItem. +func (n *NspAccessRulePropertiesSubscriptionsItem) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Omnichannel. func (o Omnichannel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2185,6 +2385,7 @@ func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } @@ -2207,6 +2408,9 @@ func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) @@ -2221,6 +2425,7 @@ func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "nextLink", p.NextLink) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } @@ -2234,6 +2439,9 @@ func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) @@ -2323,41 +2531,6 @@ func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceBase. -func (p PrivateLinkResourceBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceBase. -func (p *PrivateLinkResourceBase) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2455,6 +2628,123 @@ func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type Profile. +func (p Profile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accessRules", p.AccessRules) + populate(objectMap, "accessRulesVersion", p.AccessRulesVersion) + populate(objectMap, "diagnosticSettingsVersion", p.DiagnosticSettingsVersion) + populate(objectMap, "enabledLogCategories", p.EnabledLogCategories) + populate(objectMap, "name", p.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Profile. +func (p *Profile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accessRules": + err = unpopulate(val, "AccessRules", &p.AccessRules) + delete(rawMsg, key) + case "accessRulesVersion": + err = unpopulate(val, "AccessRulesVersion", &p.AccessRulesVersion) + delete(rawMsg, key) + case "diagnosticSettingsVersion": + err = unpopulate(val, "DiagnosticSettingsVersion", &p.DiagnosticSettingsVersion) + delete(rawMsg, key) + case "enabledLogCategories": + err = unpopulate(val, "EnabledLogCategories", &p.EnabledLogCategories) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProvisioningIssue. +func (p ProvisioningIssue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProvisioningIssue. +func (p *ProvisioningIssue) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProvisioningIssueProperties. +func (p ProvisioningIssueProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", p.Description) + populate(objectMap, "issueType", p.IssueType) + populate(objectMap, "severity", p.Severity) + populate(objectMap, "suggestedAccessRules", p.SuggestedAccessRules) + populate(objectMap, "suggestedResourceIds", p.SuggestedResourceIDs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProvisioningIssueProperties. +func (p *ProvisioningIssueProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "issueType": + err = unpopulate(val, "IssueType", &p.IssueType) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, "Severity", &p.Severity) + delete(rawMsg, key) + case "suggestedAccessRules": + err = unpopulate(val, "SuggestedAccessRules", &p.SuggestedAccessRules) + delete(rawMsg, key) + case "suggestedResourceIds": + err = unpopulate(val, "SuggestedResourceIDs", &p.SuggestedResourceIDs) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type QnAMakerEndpointKeysRequestBody. func (q QnAMakerEndpointKeysRequestBody) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2525,23 +2815,16 @@ func (q *QnAMakerEndpointKeysResponse) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Resource. -func (r Resource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceAssociation. +func (r ResourceAssociation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "etag", r.Etag) - populate(objectMap, "id", r.ID) - populate(objectMap, "kind", r.Kind) - populate(objectMap, "location", r.Location) + populate(objectMap, "accessMode", r.AccessMode) populate(objectMap, "name", r.Name) - populate(objectMap, "sku", r.SKU) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - populate(objectMap, "zones", r.Zones) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. -func (r *Resource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceAssociation. +func (r *ResourceAssociation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -2549,33 +2832,12 @@ func (r *Resource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "etag": - err = unpopulate(val, "Etag", &r.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &r.Kind) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) + case "accessMode": + err = unpopulate(val, "AccessMode", &r.AccessMode) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &r.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &r.Zones) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -3296,6 +3558,53 @@ func (s *SmsChannelProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateDateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateDateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type TelegramChannel. func (t TelegramChannel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3578,6 +3887,45 @@ func (t *TelephonyPhoneNumbers) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type TestChatChannel. +func (t TestChatChannel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["channelName"] = "TestChatChannel" + populate(objectMap, "etag", t.Etag) + populate(objectMap, "location", t.Location) + populate(objectMap, "provisioningState", t.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TestChatChannel. +func (t *TestChatChannel) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "channelName": + err = unpopulate(val, "ChannelName", &t.ChannelName) + delete(rawMsg, key) + case "etag": + err = unpopulate(val, "Etag", &t.Etag) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &t.Location) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &t.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type WebChatChannel. func (w WebChatChannel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3772,7 +4120,7 @@ func populateAny(m map[string]any, k string, v any) { } func unpopulate(data json.RawMessage, fn string, v any) error { - if data == nil { + if data == nil || string(data) == "null" { return nil } if err := json.Unmarshal(data, v); err != nil { diff --git a/sdk/resourcemanager/botservice/armbotservice/networksecurityperimeterconfigurations_client.go b/sdk/resourcemanager/botservice/armbotservice/networksecurityperimeterconfigurations_client.go new file mode 100644 index 000000000000..33a57cf66326 --- /dev/null +++ b/sdk/resourcemanager/botservice/armbotservice/networksecurityperimeterconfigurations_client.go @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. + +package armbotservice + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// NetworkSecurityPerimeterConfigurationsClient contains the methods for the NetworkSecurityPerimeterConfigurations group. +// Don't use this type directly, use NewNetworkSecurityPerimeterConfigurationsClient() instead. +type NetworkSecurityPerimeterConfigurationsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewNetworkSecurityPerimeterConfigurationsClient creates a new instance of NetworkSecurityPerimeterConfigurationsClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewNetworkSecurityPerimeterConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkSecurityPerimeterConfigurationsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &NetworkSecurityPerimeterConfigurationsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Gets the specified Network Security Perimeter configuration associated with the Bot. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the Bot resource. +// - networkSecurityPerimeterConfigurationName - The resource association Name. Composed of parameter guid and association name. +// - options - NetworkSecurityPerimeterConfigurationsClientGetOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.Get +// method. +func (client *NetworkSecurityPerimeterConfigurationsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, networkSecurityPerimeterConfigurationName string, options *NetworkSecurityPerimeterConfigurationsClientGetOptions) (NetworkSecurityPerimeterConfigurationsClientGetResponse, error) { + var err error + const operationName = "NetworkSecurityPerimeterConfigurationsClient.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, networkSecurityPerimeterConfigurationName, options) + if err != nil { + return NetworkSecurityPerimeterConfigurationsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkSecurityPerimeterConfigurationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkSecurityPerimeterConfigurationsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *NetworkSecurityPerimeterConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, networkSecurityPerimeterConfigurationName string, _ *NetworkSecurityPerimeterConfigurationsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}" + 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 networkSecurityPerimeterConfigurationName == "" { + return nil, errors.New("parameter networkSecurityPerimeterConfigurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterConfigurationName}", url.PathEscape(networkSecurityPerimeterConfigurationName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *NetworkSecurityPerimeterConfigurationsClient) getHandleResponse(resp *http.Response) (NetworkSecurityPerimeterConfigurationsClientGetResponse, error) { + result := NetworkSecurityPerimeterConfigurationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkSecurityPerimeterConfiguration); err != nil { + return NetworkSecurityPerimeterConfigurationsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List Network Security Perimeter configurations associated with the Bot. +// +// Generated from API version 2023-09-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the Bot resource. +// - options - NetworkSecurityPerimeterConfigurationsClientListOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.NewListPager +// method. +func (client *NetworkSecurityPerimeterConfigurationsClient) NewListPager(resourceGroupName string, resourceName string, options *NetworkSecurityPerimeterConfigurationsClientListOptions) *runtime.Pager[NetworkSecurityPerimeterConfigurationsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[NetworkSecurityPerimeterConfigurationsClientListResponse]{ + More: func(page NetworkSecurityPerimeterConfigurationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *NetworkSecurityPerimeterConfigurationsClientListResponse) (NetworkSecurityPerimeterConfigurationsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "NetworkSecurityPerimeterConfigurationsClient.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, options) + }, nil) + if err != nil { + return NetworkSecurityPerimeterConfigurationsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *NetworkSecurityPerimeterConfigurationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, _ *NetworkSecurityPerimeterConfigurationsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/networkSecurityPerimeterConfigurations" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *NetworkSecurityPerimeterConfigurationsClient) listHandleResponse(resp *http.Response) (NetworkSecurityPerimeterConfigurationsClientListResponse, error) { + result := NetworkSecurityPerimeterConfigurationsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkSecurityPerimeterConfigurationList); err != nil { + return NetworkSecurityPerimeterConfigurationsClientListResponse{}, err + } + return result, nil +} + +// BeginReconcile - Reconcile the specified Network Security Perimeter configuration associated with the Bot. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the Bot resource. +// - networkSecurityPerimeterConfigurationName - The resource association Name. Composed of parameter guid and association name. +// - options - NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.BeginReconcile +// method. +func (client *NetworkSecurityPerimeterConfigurationsClient) BeginReconcile(ctx context.Context, resourceGroupName string, resourceName string, networkSecurityPerimeterConfigurationName string, options *NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions) (*runtime.Poller[NetworkSecurityPerimeterConfigurationsClientReconcileResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.reconcile(ctx, resourceGroupName, resourceName, networkSecurityPerimeterConfigurationName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkSecurityPerimeterConfigurationsClientReconcileResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[NetworkSecurityPerimeterConfigurationsClientReconcileResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Reconcile - Reconcile the specified Network Security Perimeter configuration associated with the Bot. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-15-preview +func (client *NetworkSecurityPerimeterConfigurationsClient) reconcile(ctx context.Context, resourceGroupName string, resourceName string, networkSecurityPerimeterConfigurationName string, options *NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions) (*http.Response, error) { + var err error + const operationName = "NetworkSecurityPerimeterConfigurationsClient.BeginReconcile" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.reconcileCreateRequest(ctx, resourceGroupName, resourceName, networkSecurityPerimeterConfigurationName, 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.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// reconcileCreateRequest creates the Reconcile request. +func (client *NetworkSecurityPerimeterConfigurationsClient) reconcileCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, networkSecurityPerimeterConfigurationName string, _ *NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if networkSecurityPerimeterConfigurationName == "" { + return nil, errors.New("parameter networkSecurityPerimeterConfigurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterConfigurationName}", url.PathEscape(networkSecurityPerimeterConfigurationName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} diff --git a/sdk/resourcemanager/botservice/armbotservice/networksecurityperimeterconfigurations_client_example_test.go b/sdk/resourcemanager/botservice/armbotservice/networksecurityperimeterconfigurations_client_example_test.go new file mode 100644 index 000000000000..221b039e5bbf --- /dev/null +++ b/sdk/resourcemanager/botservice/armbotservice/networksecurityperimeterconfigurations_client_example_test.go @@ -0,0 +1,289 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. + +package armbotservice_test + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice/v2" + "log" +) + +// Generated from example definition: 2023-09-15-preview/GetNetworkSecurityPerimeterConfiguration.json +func ExampleNetworkSecurityPerimeterConfigurationsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armbotservice.NewClientFactory("subId", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewNetworkSecurityPerimeterConfigurationsClient().Get(ctx, "rgName", "botId", "00000000-0000-0000-0000-000000000000.associationName", 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 = armbotservice.NetworkSecurityPerimeterConfigurationsClientGetResponse{ + // NetworkSecurityPerimeterConfiguration: &armbotservice.NetworkSecurityPerimeterConfiguration{ + // Name: to.Ptr("00000000-0000-0000-0000-000000000000.associationName"), + // Type: to.Ptr("Microsoft.BotService/botServices/networkSecurityPerimeterConfigurations"), + // ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.BotService/botServices/botId/networkSecurityPerimeterConfigurations/00000000-0000-0000-0000-000000000000.associationName"), + // Properties: &armbotservice.NetworkSecurityPerimeterConfigurationProperties{ + // NetworkSecurityPerimeter: &armbotservice.NetworkSecurityPerimeter{ + // ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Network/networkSecurityPerimeters/nspName"), + // Location: to.Ptr("westcentralus"), + // PerimeterGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // Profile: &armbotservice.Profile{ + // Name: to.Ptr("defaultProfile"), + // AccessRules: []*armbotservice.NspAccessRule{ + // { + // Name: to.Ptr("Inbound1"), + // Properties: &armbotservice.NspAccessRuleProperties{ + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/16"), + // }, + // Direction: to.Ptr(armbotservice.NspAccessRuleDirectionInbound), + // EmailAddresses: []*string{ + // }, + // FullyQualifiedDomainNames: []*string{ + // }, + // NetworkSecurityPerimeters: []*armbotservice.NetworkSecurityPerimeter{ + // }, + // PhoneNumbers: []*string{ + // }, + // Subscriptions: []*armbotservice.NspAccessRulePropertiesSubscriptionsItem{ + // }, + // }, + // }, + // { + // Name: to.Ptr("Outbound1"), + // Properties: &armbotservice.NspAccessRuleProperties{ + // AddressPrefixes: []*string{ + // }, + // Direction: to.Ptr(armbotservice.NspAccessRuleDirectionOutbound), + // EmailAddresses: []*string{ + // }, + // FullyQualifiedDomainNames: []*string{ + // to.Ptr("*"), + // }, + // NetworkSecurityPerimeters: []*armbotservice.NetworkSecurityPerimeter{ + // }, + // PhoneNumbers: []*string{ + // }, + // Subscriptions: []*armbotservice.NspAccessRulePropertiesSubscriptionsItem{ + // }, + // }, + // }, + // }, + // AccessRulesVersion: to.Ptr[int64](2), + // DiagnosticSettingsVersion: to.Ptr[int64](0), + // EnabledLogCategories: []*string{ + // }, + // }, + // ProvisioningIssues: []*armbotservice.ProvisioningIssue{ + // }, + // ProvisioningState: to.Ptr(armbotservice.ProvisioningStateSucceeded), + // ResourceAssociation: &armbotservice.ResourceAssociation{ + // Name: to.Ptr("associationName"), + // AccessMode: to.Ptr(armbotservice.AccessModeLearning), + // }, + // }, + // }, + // } +} + +// Generated from example definition: 2023-09-15-preview/ListNetworkSecurityPerimeterConfigurations.json +func ExampleNetworkSecurityPerimeterConfigurationsClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armbotservice.NewClientFactory("subId", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewNetworkSecurityPerimeterConfigurationsClient().NewListPager("rgName", "botId", 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 = armbotservice.NetworkSecurityPerimeterConfigurationsClientListResponse{ + // NetworkSecurityPerimeterConfigurationList: armbotservice.NetworkSecurityPerimeterConfigurationList{ + // Value: []*armbotservice.NetworkSecurityPerimeterConfiguration{ + // { + // Name: to.Ptr("00000000-0000-0000-0000-000000000000.associationName"), + // Type: to.Ptr("Microsoft.BotService/botServices/networkSecurityPerimeterConfigurations"), + // ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.BotService/botServices/botId/networkSecurityPerimeterConfigurations/00000000-0000-0000-0000-000000000000.associationName"), + // Properties: &armbotservice.NetworkSecurityPerimeterConfigurationProperties{ + // NetworkSecurityPerimeter: &armbotservice.NetworkSecurityPerimeter{ + // ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Network/networkSecurityPerimeters/nspName"), + // Location: to.Ptr("westcentralus"), + // PerimeterGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // Profile: &armbotservice.Profile{ + // Name: to.Ptr("defaultProfile"), + // AccessRules: []*armbotservice.NspAccessRule{ + // { + // Name: to.Ptr("Inbound1"), + // Properties: &armbotservice.NspAccessRuleProperties{ + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/16"), + // }, + // Direction: to.Ptr(armbotservice.NspAccessRuleDirectionInbound), + // EmailAddresses: []*string{ + // }, + // FullyQualifiedDomainNames: []*string{ + // }, + // NetworkSecurityPerimeters: []*armbotservice.NetworkSecurityPerimeter{ + // }, + // PhoneNumbers: []*string{ + // }, + // Subscriptions: []*armbotservice.NspAccessRulePropertiesSubscriptionsItem{ + // }, + // }, + // }, + // { + // Name: to.Ptr("Outbound1"), + // Properties: &armbotservice.NspAccessRuleProperties{ + // AddressPrefixes: []*string{ + // }, + // Direction: to.Ptr(armbotservice.NspAccessRuleDirectionOutbound), + // EmailAddresses: []*string{ + // }, + // FullyQualifiedDomainNames: []*string{ + // to.Ptr("*"), + // }, + // NetworkSecurityPerimeters: []*armbotservice.NetworkSecurityPerimeter{ + // }, + // PhoneNumbers: []*string{ + // }, + // Subscriptions: []*armbotservice.NspAccessRulePropertiesSubscriptionsItem{ + // }, + // }, + // }, + // }, + // AccessRulesVersion: to.Ptr[int64](2), + // DiagnosticSettingsVersion: to.Ptr[int64](0), + // EnabledLogCategories: []*string{ + // }, + // }, + // ProvisioningIssues: []*armbotservice.ProvisioningIssue{ + // }, + // ProvisioningState: to.Ptr(armbotservice.ProvisioningStateSucceeded), + // ResourceAssociation: &armbotservice.ResourceAssociation{ + // Name: to.Ptr("associationName"), + // AccessMode: to.Ptr(armbotservice.AccessModeLearning), + // }, + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2023-09-15-preview/ReconcileNetworkSecurityPerimeterConfiguration.json +func ExampleNetworkSecurityPerimeterConfigurationsClient_BeginReconcile() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armbotservice.NewClientFactory("subId", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNetworkSecurityPerimeterConfigurationsClient().BeginReconcile(ctx, "rgName", "botId", "00000000-0000-0000-0000-000000000000.associationName", 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 = armbotservice.NetworkSecurityPerimeterConfigurationsClientReconcileResponse{ + // NetworkSecurityPerimeterConfiguration: &armbotservice.NetworkSecurityPerimeterConfiguration{ + // Name: to.Ptr("00000000-0000-0000-0000-000000000000.associationName"), + // Type: to.Ptr("Microsoft.BotService/botServices/networkSecurityPerimeterConfigurations"), + // ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.BotService/botServices/botId/networkSecurityPerimeterConfigurations/00000000-0000-0000-0000-000000000000.associationName"), + // Properties: &armbotservice.NetworkSecurityPerimeterConfigurationProperties{ + // NetworkSecurityPerimeter: &armbotservice.NetworkSecurityPerimeter{ + // ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Network/networkSecurityPerimeters/nspName"), + // Location: to.Ptr("westcentralus"), + // PerimeterGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // Profile: &armbotservice.Profile{ + // Name: to.Ptr("defaultProfile"), + // AccessRules: []*armbotservice.NspAccessRule{ + // { + // Name: to.Ptr("Inbound1"), + // Properties: &armbotservice.NspAccessRuleProperties{ + // AddressPrefixes: []*string{ + // to.Ptr("10.0.0.0/16"), + // }, + // Direction: to.Ptr(armbotservice.NspAccessRuleDirectionInbound), + // EmailAddresses: []*string{ + // }, + // FullyQualifiedDomainNames: []*string{ + // }, + // NetworkSecurityPerimeters: []*armbotservice.NetworkSecurityPerimeter{ + // }, + // PhoneNumbers: []*string{ + // }, + // Subscriptions: []*armbotservice.NspAccessRulePropertiesSubscriptionsItem{ + // }, + // }, + // }, + // { + // Name: to.Ptr("Outbound1"), + // Properties: &armbotservice.NspAccessRuleProperties{ + // AddressPrefixes: []*string{ + // }, + // Direction: to.Ptr(armbotservice.NspAccessRuleDirectionOutbound), + // EmailAddresses: []*string{ + // }, + // FullyQualifiedDomainNames: []*string{ + // to.Ptr("*"), + // }, + // NetworkSecurityPerimeters: []*armbotservice.NetworkSecurityPerimeter{ + // }, + // PhoneNumbers: []*string{ + // }, + // Subscriptions: []*armbotservice.NspAccessRulePropertiesSubscriptionsItem{ + // }, + // }, + // }, + // }, + // AccessRulesVersion: to.Ptr[int64](2), + // DiagnosticSettingsVersion: to.Ptr[int64](0), + // EnabledLogCategories: []*string{ + // }, + // }, + // ProvisioningIssues: []*armbotservice.ProvisioningIssue{ + // }, + // ProvisioningState: to.Ptr(armbotservice.ProvisioningStateSucceeded), + // ResourceAssociation: &armbotservice.ResourceAssociation{ + // Name: to.Ptr("associationName"), + // AccessMode: to.Ptr(armbotservice.AccessModeLearning), + // }, + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/botservice/armbotservice/operationresults_client.go b/sdk/resourcemanager/botservice/armbotservice/operationresults_client.go index 9530d65da7e9..aae5dc48e441 100644 --- a/sdk/resourcemanager/botservice/armbotservice/operationresults_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/operationresults_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice @@ -28,7 +24,7 @@ type OperationResultsClient struct { } // NewOperationResultsClient creates a new instance of OperationResultsClient with the specified values. -// - subscriptionID - Azure Subscription ID. +// - 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 NewOperationResultsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationResultsClient, error) { @@ -46,7 +42,7 @@ func NewOperationResultsClient(subscriptionID string, credential azcore.TokenCre // BeginGet - Get the operation result for a long running operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-09-15 +// Generated from API version 2023-09-15-preview // - operationResultID - The ID of the operation result to get. // - options - OperationResultsClientBeginGetOptions contains the optional parameters for the OperationResultsClient.BeginGet // method. @@ -70,7 +66,7 @@ func (client *OperationResultsClient) BeginGet(ctx context.Context, operationRes // Get - Get the operation result for a long running operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-09-15 +// Generated from API version 2023-09-15-preview func (client *OperationResultsClient) get(ctx context.Context, operationResultID string, options *OperationResultsClientBeginGetOptions) (*http.Response, error) { var err error const operationName = "OperationResultsClient.BeginGet" @@ -93,7 +89,7 @@ func (client *OperationResultsClient) get(ctx context.Context, operationResultID } // getCreateRequest creates the Get request. -func (client *OperationResultsClient) getCreateRequest(ctx context.Context, operationResultID string, options *OperationResultsClientBeginGetOptions) (*policy.Request, error) { +func (client *OperationResultsClient) getCreateRequest(ctx context.Context, operationResultID string, _ *OperationResultsClientBeginGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.BotService/operationresults/{operationResultId}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -108,7 +104,7 @@ func (client *OperationResultsClient) getCreateRequest(ctx context.Context, oper return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/botservice/armbotservice/operationresults_client_example_test.go b/sdk/resourcemanager/botservice/armbotservice/operationresults_client_example_test.go index de33e353c27a..8e7985f5cdfd 100644 --- a/sdk/resourcemanager/botservice/armbotservice/operationresults_client_example_test.go +++ b/sdk/resourcemanager/botservice/armbotservice/operationresults_client_example_test.go @@ -1,30 +1,24 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/OperationResultsGet.json +// Generated from example definition: 2023-09-15-preview/OperationResultsGet.json func ExampleOperationResultsClient_BeginGet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subid", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -39,10 +33,12 @@ func ExampleOperationResultsClient_BeginGet() { // 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.OperationResultsDescription = armbotservice.OperationResultsDescription{ - // Name: to.Ptr("servicename"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.BotService/locations/westus/operationresults/exampleid"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-01-21T06:03:30.271Z"); return t}()), - // Status: to.Ptr(armbotservice.OperationResultStatusRequested), + // res = armbotservice.OperationResultsClientGetResponse{ + // OperationResultsDescription: &armbotservice.OperationResultsDescription{ + // Name: to.Ptr("servicename"), + // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.BotService/locations/westus/operationresults/exampleid"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-01-21T06:03:30.2716301Z"); return t}()), + // Status: to.Ptr(armbotservice.OperationResultStatusRequested), + // }, // } } diff --git a/sdk/resourcemanager/botservice/armbotservice/operations_client.go b/sdk/resourcemanager/botservice/armbotservice/operations_client.go index c6e42780575e..2d8e436d2cf2 100644 --- a/sdk/resourcemanager/botservice/armbotservice/operations_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/operations_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice @@ -37,9 +33,9 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO return client, nil } -// NewListPager - Lists all the available BotService operations. +// NewListPager - List the operations for the provider // -// Generated from API version 2022-09-15 +// Generated from API version 2023-09-15-preview // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -65,14 +61,14 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption } // listCreateRequest creates the List request. -func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { +func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *OperationsClientListOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.BotService/operations" req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/botservice/armbotservice/operations_client_example_test.go b/sdk/resourcemanager/botservice/armbotservice/operations_client_example_test.go index 0118d988c3f6..cc2941dd1737 100644 --- a/sdk/resourcemanager/botservice/armbotservice/operations_client_example_test.go +++ b/sdk/resourcemanager/botservice/armbotservice/operations_client_example_test.go @@ -1,30 +1,24 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetOperations.json +// Generated from example definition: 2023-09-15-preview/GetOperations.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 := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -39,48 +33,51 @@ func ExampleOperationsClient_NewListPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationEntityListResult = armbotservice.OperationEntityListResult{ - // Value: []*armbotservice.OperationEntity{ - // { - // Name: to.Ptr("Microsoft.BotService/botService/read"), - // Display: &armbotservice.OperationDisplayInfo{ - // Description: to.Ptr("Read Bot Service"), - // Operation: to.Ptr("Read Bot Service"), - // Provider: to.Ptr("Microsoft Bot Service"), - // Resource: to.Ptr("Bot Service"), + // page = armbotservice.OperationsClientListResponse{ + // OperationEntityListResult: armbotservice.OperationEntityListResult{ + // Value: []*armbotservice.OperationEntity{ + // { + // Name: to.Ptr("Microsoft.BotService/botService/read"), + // Display: &armbotservice.OperationDisplayInfo{ + // Description: to.Ptr("Read Bot Service"), + // Operation: to.Ptr("Read Bot Service"), + // Provider: to.Ptr("Microsoft Bot Service"), + // Resource: to.Ptr("Bot Service"), + // }, + // Origin: to.Ptr("user,system"), // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.BotService/botService/write"), - // Display: &armbotservice.OperationDisplayInfo{ - // Description: to.Ptr("Writes Bot Service"), - // Operation: to.Ptr("Write Bot Service"), - // Provider: to.Ptr("Microsoft Bot Service"), - // Resource: to.Ptr("Bot Service"), + // { + // Name: to.Ptr("Microsoft.BotService/botService/write"), + // Display: &armbotservice.OperationDisplayInfo{ + // Description: to.Ptr("Writes Bot Service"), + // Operation: to.Ptr("Write Bot Service"), + // Provider: to.Ptr("Microsoft Bot Service"), + // Resource: to.Ptr("Bot Service"), + // }, + // Origin: to.Ptr("user,system"), // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.BotService/botService/delete"), - // Display: &armbotservice.OperationDisplayInfo{ - // Description: to.Ptr("Deletes Bot Service"), - // Operation: to.Ptr("Delete Bot Service"), - // Provider: to.Ptr("Microsoft Bot Service"), - // Resource: to.Ptr("Bot Service"), + // { + // Name: to.Ptr("Microsoft.BotService/botService/delete"), + // Display: &armbotservice.OperationDisplayInfo{ + // Description: to.Ptr("Deletes Bot Service"), + // Operation: to.Ptr("Delete Bot Service"), + // Provider: to.Ptr("Microsoft Bot Service"), + // Resource: to.Ptr("Bot Service"), + // }, + // Origin: to.Ptr("user,system"), // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.BotService/botService/botName/read"), - // Display: &armbotservice.OperationDisplayInfo{ - // Description: to.Ptr("Check bot name availability"), - // Operation: to.Ptr("Check bot name availability"), - // Provider: to.Ptr("Microsoft Bot Service"), - // Resource: to.Ptr("Bot Service name availability"), + // { + // Name: to.Ptr("Microsoft.BotService/botService/botName/read"), + // Display: &armbotservice.OperationDisplayInfo{ + // Description: to.Ptr("Check bot name availability"), + // Operation: to.Ptr("Check bot name availability"), + // Provider: to.Ptr("Microsoft Bot Service"), + // Resource: to.Ptr("Bot Service name availability"), + // }, + // Origin: to.Ptr("user,system"), // }, - // Origin: to.Ptr("user,system"), - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/botservice/armbotservice/options.go b/sdk/resourcemanager/botservice/armbotservice/options.go index 6763df9e8bf0..9faf9a1099ad 100644 --- a/sdk/resourcemanager/botservice/armbotservice/options.go +++ b/sdk/resourcemanager/botservice/armbotservice/options.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice @@ -128,9 +124,28 @@ type HostSettingsClientGetOptions struct { // placeholder for future optional parameters } +// NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.BeginReconcile +// method. +type NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// NetworkSecurityPerimeterConfigurationsClientGetOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.Get +// method. +type NetworkSecurityPerimeterConfigurationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// NetworkSecurityPerimeterConfigurationsClientListOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.NewListPager +// method. +type NetworkSecurityPerimeterConfigurationsClientListOptions struct { + // placeholder for future optional parameters +} + // OperationResultsClientBeginGetOptions contains the optional parameters for the OperationResultsClient.BeginGet method. type OperationResultsClientBeginGetOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } diff --git a/sdk/resourcemanager/botservice/armbotservice/polymorphic_helpers.go b/sdk/resourcemanager/botservice/armbotservice/polymorphic_helpers.go index 6a816aaf5410..1ff9ebee963c 100644 --- a/sdk/resourcemanager/botservice/armbotservice/polymorphic_helpers.go +++ b/sdk/resourcemanager/botservice/armbotservice/polymorphic_helpers.go @@ -1,17 +1,13 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice import "encoding/json" func unmarshalChannelClassification(rawMsg json.RawMessage) (ChannelClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -56,6 +52,8 @@ func unmarshalChannelClassification(rawMsg json.RawMessage) (ChannelClassificati b = &TelegramChannel{} case "TelephonyChannel": b = &TelephonyChannel{} + case "TestChatChannel": + b = &TestChatChannel{} case "WebChatChannel": b = &WebChatChannel{} default: diff --git a/sdk/resourcemanager/botservice/armbotservice/privateendpointconnections_client.go b/sdk/resourcemanager/botservice/armbotservice/privateendpointconnections_client.go index c56cb9f676a0..2eaf75797e48 100644 --- a/sdk/resourcemanager/botservice/armbotservice/privateendpointconnections_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/privateendpointconnections_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice @@ -28,7 +24,7 @@ type PrivateEndpointConnectionsClient struct { } // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values. -// - subscriptionID - Azure Subscription ID. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error) { @@ -46,8 +42,8 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // Create - Update the state of specified private endpoint connection associated with the Bot. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-09-15 -// - resourceGroupName - The name of the Bot resource group in the user subscription. +// Generated from API version 2023-09-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the Bot resource. // - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource // - properties - The private endpoint connection properties. @@ -76,8 +72,12 @@ func (client *PrivateEndpointConnectionsClient) Create(ctx context.Context, reso } // createCreateRequest creates the Create request. -func (client *PrivateEndpointConnectionsClient) createCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, properties PrivateEndpointConnection, options *PrivateEndpointConnectionsClientCreateOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) createCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, properties PrivateEndpointConnection, _ *PrivateEndpointConnectionsClientCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -86,10 +86,6 @@ func (client *PrivateEndpointConnectionsClient) createCreateRequest(ctx context. return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if privateEndpointConnectionName == "" { return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") } @@ -99,9 +95,10 @@ func (client *PrivateEndpointConnectionsClient) createCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { return nil, err } @@ -120,8 +117,8 @@ func (client *PrivateEndpointConnectionsClient) createHandleResponse(resp *http. // Delete - Deletes the specified private endpoint connection associated with the Bot. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-09-15 -// - resourceGroupName - The name of the Bot resource group in the user subscription. +// Generated from API version 2023-09-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the Bot resource. // - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource // - options - PrivateEndpointConnectionsClientDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Delete @@ -148,8 +145,12 @@ func (client *PrivateEndpointConnectionsClient) Delete(ctx context.Context, reso } // deleteCreateRequest creates the Delete request. -func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientDeleteOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, _ *PrivateEndpointConnectionsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -158,10 +159,6 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if privateEndpointConnectionName == "" { return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") } @@ -171,17 +168,16 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Gets the specified private endpoint connection associated with the Bot. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-09-15 -// - resourceGroupName - The name of the Bot resource group in the user subscription. +// Generated from API version 2023-09-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the Bot resource. // - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource // - options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get @@ -209,8 +205,12 @@ func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourc } // getCreateRequest creates the Get request. -func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, _ *PrivateEndpointConnectionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -219,10 +219,6 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if privateEndpointConnectionName == "" { return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") } @@ -232,7 +228,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,29 +245,28 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListPager - List all the private endpoint connections associated with the Bot. // -// Generated from API version 2022-09-15 -// - resourceGroupName - The name of the Bot resource group in the user subscription. +// Generated from API version 2023-09-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the Bot resource. // - options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListPager // method. func (client *PrivateEndpointConnectionsClient) NewListPager(resourceGroupName string, resourceName string, options *PrivateEndpointConnectionsClientListOptions) *runtime.Pager[PrivateEndpointConnectionsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[PrivateEndpointConnectionsClientListResponse]{ More: func(page PrivateEndpointConnectionsClientListResponse) bool { - return false + return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *PrivateEndpointConnectionsClientListResponse) (PrivateEndpointConnectionsClientListResponse, error) { ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "PrivateEndpointConnectionsClient.NewListPager") - req, err := client.listCreateRequest(ctx, resourceGroupName, resourceName, options) - if err != nil { - return PrivateEndpointConnectionsClientListResponse{}, err + nextLink := "" + if page != nil { + nextLink = *page.NextLink } - resp, err := client.internal.Pipeline().Do(req) + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, resourceName, options) + }, nil) if err != nil { return PrivateEndpointConnectionsClientListResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateEndpointConnectionsClientListResponse{}, runtime.NewResponseError(resp) - } return client.listHandleResponse(resp) }, Tracer: client.internal.Tracer(), @@ -279,8 +274,12 @@ func (client *PrivateEndpointConnectionsClient) NewListPager(resourceGroupName s } // listCreateRequest creates the List request. -func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *PrivateEndpointConnectionsClientListOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, _ *PrivateEndpointConnectionsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -289,16 +288,12 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/botservice/armbotservice/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/botservice/armbotservice/privateendpointconnections_client_example_test.go index 458d69ebacd2..1b553a239324 100644 --- a/sdk/resourcemanager/botservice/armbotservice/privateendpointconnections_client_example_test.go +++ b/sdk/resourcemanager/botservice/armbotservice/privateendpointconnections_client_example_test.go @@ -1,175 +1,181 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice_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/botservice/armbotservice" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListPrivateEndpointConnections.json -func ExamplePrivateEndpointConnectionsClient_NewListPager() { +// Generated from example definition: 2023-09-15-preview/PutPrivateEndpointConnection.json +func ExamplePrivateEndpointConnectionsClient_Create() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("{subscription-id}", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListPager("res6977", "sto2527", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateEndpointConnectionListResult = armbotservice.PrivateEndpointConnectionListResult{ - // Value: []*armbotservice.PrivateEndpointConnection{ - // { - // Name: to.Ptr("{privateEndpointConnectionName}"), - // Type: to.Ptr("Microsoft.BotService/botServices/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res7231/providers/Microsoft.BotService/botServices/sto288/privateEndpointConnections/{privateEndpointConnectionName}"), - // Properties: &armbotservice.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armbotservice.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res7231/providers/Microsoft.Network/privateEndpoints/petest01"), - // }, - // PrivateLinkServiceConnectionState: &armbotservice.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armbotservice.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armbotservice.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("{privateEndpointConnectionName}"), - // Type: to.Ptr("Microsoft.BotService/botServices/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res7231/providers/Microsoft.BotService/botServices/sto288/privateEndpointConnections/{privateEndpointConnectionName}"), - // Properties: &armbotservice.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armbotservice.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res7231/providers/Microsoft.Network/privateEndpoints/petest02"), - // }, - // PrivateLinkServiceConnectionState: &armbotservice.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armbotservice.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armbotservice.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // }}, - // } + res, err := clientFactory.NewPrivateEndpointConnectionsClient().Create(ctx, "res7687", "sto9699", "{privateEndpointConnectionName}", armbotservice.PrivateEndpointConnection{ + Properties: &armbotservice.PrivateEndpointConnectionProperties{ + PrivateLinkServiceConnectionState: &armbotservice.PrivateLinkServiceConnectionState{ + Description: to.Ptr("Auto-Approved"), + Status: to.Ptr(armbotservice.PrivateEndpointServiceConnectionStatusApproved), + }, + }, + }, 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 = armbotservice.PrivateEndpointConnectionsClientCreateResponse{ + // PrivateEndpointConnection: &armbotservice.PrivateEndpointConnection{ + // Name: to.Ptr("{privateEndpointConnectionName}"), + // Type: to.Ptr("Microsoft.BotService/botServices/privateEndpointConnections"), + // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res7231/providers/Microsoft.BotService/botServices/sto288/privateEndpointConnections/{privateEndpointConnectionName}"), + // Properties: &armbotservice.PrivateEndpointConnectionProperties{ + // PrivateEndpoint: &armbotservice.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res7231/providers/Microsoft.Network/privateEndpoints/petest01"), + // }, + // PrivateLinkServiceConnectionState: &armbotservice.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Auto-Approved"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr(armbotservice.PrivateEndpointServiceConnectionStatusApproved), + // }, + // ProvisioningState: to.Ptr(armbotservice.PrivateEndpointConnectionProvisioningStateSucceeded), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetPrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionsClient_Get() { +// Generated from example definition: 2023-09-15-preview/DeletePrivateEndpointConnection.json +func ExamplePrivateEndpointConnectionsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("{subscription-id}", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "res6977", "sto2527", "{privateEndpointConnectionName}", nil) + res, err := clientFactory.NewPrivateEndpointConnectionsClient().Delete(ctx, "res6977", "sto2527", "{privateEndpointConnectionName}", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armbotservice.PrivateEndpointConnection{ - // Name: to.Ptr("{privateEndpointConnectionName}"), - // Type: to.Ptr("Microsoft.BotService/botServices/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res7231/providers/Microsoft.BotService/botServices/sto288/privateEndpointConnections/{privateEndpointConnectionName}"), - // Properties: &armbotservice.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armbotservice.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res7231/providers/Microsoft.Network/privateEndpoints/petest01"), - // }, - // PrivateLinkServiceConnectionState: &armbotservice.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armbotservice.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armbotservice.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, + // res = armbotservice.PrivateEndpointConnectionsClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutPrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionsClient_Create() { +// Generated from example definition: 2023-09-15-preview/GetPrivateEndpointConnection.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 := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("{subscription-id}", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().Create(ctx, "res7687", "sto9699", "{privateEndpointConnectionName}", armbotservice.PrivateEndpointConnection{ - Properties: &armbotservice.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armbotservice.PrivateLinkServiceConnectionState{ - Description: to.Ptr("Auto-Approved"), - Status: to.Ptr(armbotservice.PrivateEndpointServiceConnectionStatusApproved), - }, - }, - }, nil) + res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "res6977", "sto2527", "{privateEndpointConnectionName}", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armbotservice.PrivateEndpointConnection{ - // Name: to.Ptr("{privateEndpointConnectionName}"), - // Type: to.Ptr("Microsoft.BotService/botServices/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res7231/providers/Microsoft.BotService/botServices/sto288/privateEndpointConnections/{privateEndpointConnectionName}"), - // Properties: &armbotservice.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armbotservice.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res7231/providers/Microsoft.Network/privateEndpoints/petest01"), + // res = armbotservice.PrivateEndpointConnectionsClientGetResponse{ + // PrivateEndpointConnection: &armbotservice.PrivateEndpointConnection{ + // Name: to.Ptr("{privateEndpointConnectionName}"), + // Type: to.Ptr("Microsoft.BotService/botServices/privateEndpointConnections"), + // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res7231/providers/Microsoft.BotService/botServices/sto288/privateEndpointConnections/{privateEndpointConnectionName}"), + // Properties: &armbotservice.PrivateEndpointConnectionProperties{ + // PrivateEndpoint: &armbotservice.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res7231/providers/Microsoft.Network/privateEndpoints/petest01"), + // }, + // PrivateLinkServiceConnectionState: &armbotservice.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Auto-Approved"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr(armbotservice.PrivateEndpointServiceConnectionStatusApproved), + // }, + // ProvisioningState: to.Ptr(armbotservice.PrivateEndpointConnectionProvisioningStateSucceeded), // }, - // PrivateLinkServiceConnectionState: &armbotservice.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armbotservice.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armbotservice.PrivateEndpointConnectionProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeletePrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionsClient_Delete() { +// Generated from example definition: 2023-09-15-preview/ListPrivateEndpointConnections.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 := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("{subscription-id}", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = clientFactory.NewPrivateEndpointConnectionsClient().Delete(ctx, "res6977", "sto2527", "{privateEndpointConnectionName}", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) + pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListPager("res6977", "sto2527", 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 = armbotservice.PrivateEndpointConnectionsClientListResponse{ + // PrivateEndpointConnectionListResult: armbotservice.PrivateEndpointConnectionListResult{ + // Value: []*armbotservice.PrivateEndpointConnection{ + // { + // Name: to.Ptr("{privateEndpointConnectionName}"), + // Type: to.Ptr("Microsoft.BotService/botServices/privateEndpointConnections"), + // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res7231/providers/Microsoft.BotService/botServices/sto288/privateEndpointConnections/{privateEndpointConnectionName}"), + // Properties: &armbotservice.PrivateEndpointConnectionProperties{ + // PrivateEndpoint: &armbotservice.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res7231/providers/Microsoft.Network/privateEndpoints/petest01"), + // }, + // PrivateLinkServiceConnectionState: &armbotservice.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Auto-Approved"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr(armbotservice.PrivateEndpointServiceConnectionStatusApproved), + // }, + // ProvisioningState: to.Ptr(armbotservice.PrivateEndpointConnectionProvisioningStateSucceeded), + // }, + // }, + // { + // Name: to.Ptr("{privateEndpointConnectionName}"), + // Type: to.Ptr("Microsoft.BotService/botServices/privateEndpointConnections"), + // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res7231/providers/Microsoft.BotService/botServices/sto288/privateEndpointConnections/{privateEndpointConnectionName}"), + // Properties: &armbotservice.PrivateEndpointConnectionProperties{ + // PrivateEndpoint: &armbotservice.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res7231/providers/Microsoft.Network/privateEndpoints/petest02"), + // }, + // PrivateLinkServiceConnectionState: &armbotservice.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Auto-Approved"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr(armbotservice.PrivateEndpointServiceConnectionStatusApproved), + // }, + // ProvisioningState: to.Ptr(armbotservice.PrivateEndpointConnectionProvisioningStateSucceeded), + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/botservice/armbotservice/privatelinkresources_client.go b/sdk/resourcemanager/botservice/armbotservice/privatelinkresources_client.go index 445c18c18c53..8733004de686 100644 --- a/sdk/resourcemanager/botservice/armbotservice/privatelinkresources_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/privatelinkresources_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice @@ -28,7 +24,7 @@ type PrivateLinkResourcesClient struct { } // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values. -// - subscriptionID - Azure Subscription ID. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error) { @@ -46,8 +42,8 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // ListByBotResource - Gets the private link resources that need to be created for a Bot. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-09-15 -// - resourceGroupName - The name of the Bot resource group in the user subscription. +// Generated from API version 2023-09-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the Bot resource. // - options - PrivateLinkResourcesClientListByBotResourceOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByBotResource // method. @@ -74,8 +70,12 @@ func (client *PrivateLinkResourcesClient) ListByBotResource(ctx context.Context, } // listByBotResourceCreateRequest creates the ListByBotResource request. -func (client *PrivateLinkResourcesClient) listByBotResourceCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *PrivateLinkResourcesClientListByBotResourceOptions) (*policy.Request, error) { +func (client *PrivateLinkResourcesClient) listByBotResourceCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, _ *PrivateLinkResourcesClientListByBotResourceOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateLinkResources" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -84,16 +84,12 @@ func (client *PrivateLinkResourcesClient) listByBotResourceCreateRequest(ctx con return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/botservice/armbotservice/privatelinkresources_client_example_test.go b/sdk/resourcemanager/botservice/armbotservice/privatelinkresources_client_example_test.go index 2ae0504011df..b82225cc88c6 100644 --- a/sdk/resourcemanager/botservice/armbotservice/privatelinkresources_client_example_test.go +++ b/sdk/resourcemanager/botservice/armbotservice/privatelinkresources_client_example_test.go @@ -1,30 +1,24 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListPrivateLinkResources.json +// Generated from example definition: 2023-09-15-preview/ListPrivateLinkResources.json func ExamplePrivateLinkResourcesClient_ListByBotResource() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("{subscription-id}", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -35,19 +29,24 @@ func ExamplePrivateLinkResourcesClient_ListByBotResource() { // 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.PrivateLinkResourceListResult = armbotservice.PrivateLinkResourceListResult{ - // Value: []*armbotservice.PrivateLinkResource{ - // { - // Name: to.Ptr("resource1"), - // Type: to.Ptr("Microsoft.BotService/botServices/privateLinkResources"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res6977/providers/Microsoft.BotService/botServices/sto2527/privateLinkResources/resource1"), - // Properties: &armbotservice.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("bot"), - // RequiredMembers: []*string{ - // to.Ptr("bot")}, + // res = armbotservice.PrivateLinkResourcesClientListByBotResourceResponse{ + // PrivateLinkResourceListResult: &armbotservice.PrivateLinkResourceListResult{ + // Value: []*armbotservice.PrivateLinkResource{ + // { + // Name: to.Ptr("resource1"), + // Type: to.Ptr("Microsoft.BotService/botServices/privateLinkResources"), + // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res6977/providers/Microsoft.BotService/botServices/sto2527/privateLinkResources/resource1"), + // Properties: &armbotservice.PrivateLinkResourceProperties{ + // GroupID: to.Ptr("bot"), + // RequiredMembers: []*string{ + // to.Ptr("bot"), + // }, // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.botframework.com")}, + // to.Ptr("privatelink.botframework.com"), // }, - // }}, - // } + // }, + // }, + // }, + // }, + // } } diff --git a/sdk/resourcemanager/botservice/armbotservice/qnamakerendpointkeys_client.go b/sdk/resourcemanager/botservice/armbotservice/qnamakerendpointkeys_client.go index aabf21bbba6e..d268d644873c 100644 --- a/sdk/resourcemanager/botservice/armbotservice/qnamakerendpointkeys_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/qnamakerendpointkeys_client.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice @@ -28,7 +24,7 @@ type QnAMakerEndpointKeysClient struct { } // NewQnAMakerEndpointKeysClient creates a new instance of QnAMakerEndpointKeysClient with the specified values. -// - subscriptionID - Azure Subscription ID. +// - 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 NewQnAMakerEndpointKeysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*QnAMakerEndpointKeysClient, error) { @@ -46,8 +42,8 @@ func NewQnAMakerEndpointKeysClient(subscriptionID string, credential azcore.Toke // Get - Lists the QnA Maker endpoint keys // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-09-15 -// - parameters - The request body parameters to provide for the check name availability request +// Generated from API version 2023-09-15-preview +// - parameters - The request body // - options - QnAMakerEndpointKeysClientGetOptions contains the optional parameters for the QnAMakerEndpointKeysClient.Get // method. func (client *QnAMakerEndpointKeysClient) Get(ctx context.Context, parameters QnAMakerEndpointKeysRequestBody, options *QnAMakerEndpointKeysClientGetOptions) (QnAMakerEndpointKeysClientGetResponse, error) { @@ -73,7 +69,7 @@ func (client *QnAMakerEndpointKeysClient) Get(ctx context.Context, parameters Qn } // getCreateRequest creates the Get request. -func (client *QnAMakerEndpointKeysClient) getCreateRequest(ctx context.Context, parameters QnAMakerEndpointKeysRequestBody, options *QnAMakerEndpointKeysClientGetOptions) (*policy.Request, error) { +func (client *QnAMakerEndpointKeysClient) getCreateRequest(ctx context.Context, parameters QnAMakerEndpointKeysRequestBody, _ *QnAMakerEndpointKeysClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.BotService/listQnAMakerEndpointKeys" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -84,9 +80,10 @@ func (client *QnAMakerEndpointKeysClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/botservice/armbotservice/qnamakerendpointkeys_client_example_test.go b/sdk/resourcemanager/botservice/armbotservice/qnamakerendpointkeys_client_example_test.go index 3837e13fea78..b32ed7390855 100644 --- a/sdk/resourcemanager/botservice/armbotservice/qnamakerendpointkeys_client_example_test.go +++ b/sdk/resourcemanager/botservice/armbotservice/qnamakerendpointkeys_client_example_test.go @@ -1,31 +1,25 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice_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/botservice/armbotservice" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice/v2" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListQnAMakerEndpointKeys.json +// Generated from example definition: 2023-09-15-preview/ListQnAMakerEndpointKeys.json func ExampleQnAMakerEndpointKeysClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armbotservice.NewClientFactory("", cred, nil) + clientFactory, err := armbotservice.NewClientFactory("subscription-id", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -39,10 +33,12 @@ func ExampleQnAMakerEndpointKeysClient_Get() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.QnAMakerEndpointKeysResponse = armbotservice.QnAMakerEndpointKeysResponse{ - // InstalledVersion: to.Ptr("4.1.0"), - // LastStableVersion: to.Ptr("4.2.0"), - // PrimaryEndpointKey: to.Ptr("sample_primaryEndpointKey"), - // SecondaryEndpointKey: to.Ptr("sample_secondaryEndpointKey"), + // res = armbotservice.QnAMakerEndpointKeysClientGetResponse{ + // QnAMakerEndpointKeysResponse: &armbotservice.QnAMakerEndpointKeysResponse{ + // InstalledVersion: to.Ptr("4.1.0"), + // LastStableVersion: to.Ptr("4.2.0"), + // PrimaryEndpointKey: to.Ptr("sample_primaryEndpointKey"), + // SecondaryEndpointKey: to.Ptr("sample_secondaryEndpointKey"), + // }, // } } diff --git a/sdk/resourcemanager/botservice/armbotservice/response_types.go b/sdk/resourcemanager/botservice/armbotservice/responses.go similarity index 87% rename from sdk/resourcemanager/botservice/armbotservice/response_types.go rename to sdk/resourcemanager/botservice/armbotservice/responses.go index 12d611860406..cc92ab7c504c 100644 --- a/sdk/resourcemanager/botservice/armbotservice/response_types.go +++ b/sdk/resourcemanager/botservice/armbotservice/responses.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice @@ -143,6 +139,24 @@ type HostSettingsClientGetResponse struct { HostSettingsResponse } +// NetworkSecurityPerimeterConfigurationsClientGetResponse contains the response from method NetworkSecurityPerimeterConfigurationsClient.Get. +type NetworkSecurityPerimeterConfigurationsClientGetResponse struct { + // Network Security Perimeter configuration + NetworkSecurityPerimeterConfiguration +} + +// NetworkSecurityPerimeterConfigurationsClientListResponse contains the response from method NetworkSecurityPerimeterConfigurationsClient.NewListPager. +type NetworkSecurityPerimeterConfigurationsClientListResponse struct { + // Result of the List NetworkSecurityPerimeterConfiguration operation. + NetworkSecurityPerimeterConfigurationList +} + +// NetworkSecurityPerimeterConfigurationsClientReconcileResponse contains the response from method NetworkSecurityPerimeterConfigurationsClient.BeginReconcile. +type NetworkSecurityPerimeterConfigurationsClientReconcileResponse struct { + // Network Security Perimeter configuration + NetworkSecurityPerimeterConfiguration +} + // OperationResultsClientGetResponse contains the response from method OperationResultsClient.BeginGet. type OperationResultsClientGetResponse struct { // The properties indicating the operation result of an operation on a service. diff --git a/sdk/resourcemanager/botservice/armbotservice/testdata/_metadata.json b/sdk/resourcemanager/botservice/armbotservice/testdata/_metadata.json new file mode 100644 index 000000000000..0dcae450bf67 --- /dev/null +++ b/sdk/resourcemanager/botservice/armbotservice/testdata/_metadata.json @@ -0,0 +1,4 @@ +{ + "apiVersion": "2023-09-15-preview", + "emitterVersion": "0.8.0" +} \ No newline at end of file diff --git a/sdk/resourcemanager/botservice/armbotservice/time_rfc3339.go b/sdk/resourcemanager/botservice/armbotservice/time_rfc3339.go index c10212015fb2..3483a6cf5f81 100644 --- a/sdk/resourcemanager/botservice/armbotservice/time_rfc3339.go +++ b/sdk/resourcemanager/botservice/armbotservice/time_rfc3339.go @@ -1,10 +1,6 @@ -//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. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armbotservice @@ -19,12 +15,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 +40,36 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + if len(data) == 0 { + return nil + } + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +80,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 +97,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/botservice/armbotservice/tsp-location.yaml b/sdk/resourcemanager/botservice/armbotservice/tsp-location.yaml new file mode 100644 index 000000000000..522f96d5bcf2 --- /dev/null +++ b/sdk/resourcemanager/botservice/armbotservice/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/botservice/BotService.Management +commit: 00bbde5b6cafd82f39ad72c2a5129b33c0211054 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/resourcemanager/botservice/armbotservice/version.go b/sdk/resourcemanager/botservice/armbotservice/version.go new file mode 100644 index 000000000000..17ec39bedea4 --- /dev/null +++ b/sdk/resourcemanager/botservice/armbotservice/version.go @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Go Code Generator. + +package armbotservice + +const ( + moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice" + moduleVersion = "v2.0.0-beta.1" +) diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/CHANGELOG.md b/sdk/resourcemanager/computefleet/armcomputefleet/CHANGELOG.md index d91bbac6cf58..cad0ccf42838 100644 --- a/sdk/resourcemanager/computefleet/armcomputefleet/CHANGELOG.md +++ b/sdk/resourcemanager/computefleet/armcomputefleet/CHANGELOG.md @@ -1,5 +1,27 @@ # Release History +## 2.0.0 (2025-08-19) +### Breaking Changes + +- `ManagedServiceIdentityTypeSystemAndUserAssigned` from enum `ManagedServiceIdentityType` has been removed +- Field `Name` of struct `VirtualMachineScaleSet` has been removed + +### Features Added + +- New value `ManagedServiceIdentityTypeSystemAssignedUserAssigned` added to enum type `ManagedServiceIdentityType` +- New enum type `CapacityType` with values `CapacityTypeVCPU`, `CapacityTypeVM` +- New enum type `FleetMode` with values `FleetModeInstance`, `FleetModeManaged` +- New enum type `VMOperationStatus` with values `VMOperationStatusCancelFailedStatusUnknown`, `VMOperationStatusCanceled`, `VMOperationStatusCreating`, `VMOperationStatusFailed`, `VMOperationStatusSucceeded` +- New enum type `ZoneDistributionStrategy` with values `ZoneDistributionStrategyBestEffortSingleZone`, `ZoneDistributionStrategyPrioritized` +- New function `*FleetsClient.BeginCancel(context.Context, string, string, *FleetsClientBeginCancelOptions) (*runtime.Poller[FleetsClientCancelResponse], error)` +- New function `*FleetsClient.NewListVirtualMachinesPager(string, string, *FleetsClientListVirtualMachinesOptions) *runtime.Pager[FleetsClientListVirtualMachinesResponse]` +- New struct `VirtualMachine` +- New struct `VirtualMachineListResult` +- New struct `ZoneAllocationPolicy` +- New struct `ZonePreference` +- New field `CapacityType`, `DisplayName`, `Mode`, `UpdatedBy`, `ZoneAllocationPolicy` in struct `FleetProperties` + + ## 1.0.0 (2024-10-22) ### Breaking Changes diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/README.md b/sdk/resourcemanager/computefleet/armcomputefleet/README.md index 92d31274c769..6ee68315561b 100644 --- a/sdk/resourcemanager/computefleet/armcomputefleet/README.md +++ b/sdk/resourcemanager/computefleet/armcomputefleet/README.md @@ -18,7 +18,7 @@ This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for ve Install the Azure Compute Fleet module: ```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet/v2 ``` ## Authorization diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/constants.go b/sdk/resourcemanager/computefleet/armcomputefleet/constants.go index 9a5b1d23be3c..4a9e266aa0c3 100644 --- a/sdk/resourcemanager/computefleet/armcomputefleet/constants.go +++ b/sdk/resourcemanager/computefleet/armcomputefleet/constants.go @@ -4,11 +4,6 @@ package armcomputefleet -const ( - moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet" - moduleVersion = "v1.0.0" -) - // AcceleratorManufacturer - Accelerator manufacturers supported by Azure VMs. type AcceleratorManufacturer string @@ -126,6 +121,27 @@ func PossibleCachingTypesValues() []CachingTypes { } } +// CapacityType - Capacity types for Compute Fleet. +type CapacityType string + +const ( + // CapacityTypeVCPU - VCpu is the capacity type for Compute Fleet where Fleet capacity is provisioned in terms of VCpus. + // If VCpu capacity is not exactly divisible by VCpu count in VMSizes, Fleet capacity in VCpus will be overprovisioned by + // default. + CapacityTypeVCPU CapacityType = "VCpu" + // CapacityTypeVM - Default. VM is the default capacity type for Compute Fleet where Fleet capacity is provisioned in terms + // of VMs. + CapacityTypeVM CapacityType = "VM" +) + +// PossibleCapacityTypeValues returns the possible values for the CapacityType const type. +func PossibleCapacityTypeValues() []CapacityType { + return []CapacityType{ + CapacityTypeVCPU, + CapacityTypeVM, + } +} + // CreatedByType - The kind of entity that created the resource. type CreatedByType string @@ -188,9 +204,9 @@ func PossibleDiffDiskOptionsValues() []DiffDiskOptions { // resource disk space for Ephemeral OS disk provisioning. For more information on // Ephemeral OS disk size requirements, please refer Ephemeral OS disk size // requirements for Windows VM at -// https://docs.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements +// https://learn.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements // and Linux VM at -// https://docs.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements +// https://learn.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements // Minimum api-version for NvmeDisk: 2024-03-01. type DiffDiskPlacement string @@ -215,10 +231,10 @@ func PossibleDiffDiskPlacementValues() []DiffDiskPlacement { // DiskControllerTypes - Specifies the disk controller type configured for the VM and // VirtualMachineScaleSet. This property is only supported for virtual machines // whose operating system disk and VM sku supports Generation 2 -// (https://docs.microsoft.com/en-us/azure/virtual-machines/generation-2), please +// (https://learn.microsoft.com/en-us/azure/virtual-machines/generation-2), please // check the HyperVGenerations capability returned as part of VM sku capabilities // in the response of Microsoft.Compute SKUs api for the region contains V2 -// (https://docs.microsoft.com/rest/api/compute/resourceskus/list). For more +// (https://learn.microsoft.com/rest/api/compute/resourceskus/list). For more // information about Disk Controller Types supported please refer to // https://aka.ms/azure-diskcontrollertypes. type DiskControllerTypes string @@ -336,6 +352,24 @@ func PossibleEvictionPolicyValues() []EvictionPolicy { } } +// FleetMode - Modes for Compute Fleet. +type FleetMode string + +const ( + // FleetModeInstance - Instance mode for Compute Fleet will directly provision VM instances. + FleetModeInstance FleetMode = "Instance" + // FleetModeManaged - Default. Managed is the default mode for Compute Fleet where VMs are provisioned via VMSS. + FleetModeManaged FleetMode = "Managed" +) + +// PossibleFleetModeValues returns the possible values for the FleetMode const type. +func PossibleFleetModeValues() []FleetMode { + return []FleetMode{ + FleetModeInstance, + FleetModeManaged, + } +} + // IPVersion - Available from Api-Version 2017-03-30 onwards, it represents whether the // specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible // values are: 'IPv4' and 'IPv6'. @@ -449,10 +483,10 @@ type ManagedServiceIdentityType string const ( // ManagedServiceIdentityTypeNone - No managed identity. ManagedServiceIdentityTypeNone ManagedServiceIdentityType = "None" - // ManagedServiceIdentityTypeSystemAndUserAssigned - System and user assigned managed identity. - ManagedServiceIdentityTypeSystemAndUserAssigned ManagedServiceIdentityType = "SystemAssigned,UserAssigned" // ManagedServiceIdentityTypeSystemAssigned - System assigned managed identity. ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = "SystemAssigned" + // ManagedServiceIdentityTypeSystemAssignedUserAssigned - System and user assigned managed identity. + ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = "SystemAssigned,UserAssigned" // ManagedServiceIdentityTypeUserAssigned - User assigned managed identity. ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = "UserAssigned" ) @@ -461,8 +495,8 @@ const ( func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType { return []ManagedServiceIdentityType{ ManagedServiceIdentityTypeNone, - ManagedServiceIdentityTypeSystemAndUserAssigned, ManagedServiceIdentityTypeSystemAssigned, + ManagedServiceIdentityTypeSystemAssignedUserAssigned, ManagedServiceIdentityTypeUserAssigned, } } @@ -799,9 +833,9 @@ func PossibleSpotAllocationStrategyValues() []SpotAllocationStrategy { // zone redundant storage. StandardSSD_ZRS uses Standard SSD zone redundant // storage. For more information regarding disks supported for Windows Virtual // Machines, refer to -// https://docs.microsoft.com/azure/virtual-machines/windows/disks-types and, for +// https://learn.microsoft.com/azure/virtual-machines/windows/disks-types and, for // Linux Virtual Machines, refer to -// https://docs.microsoft.com/azure/virtual-machines/linux/disks-types +// https://learn.microsoft.com/azure/virtual-machines/linux/disks-types type StorageAccountTypes string const ( @@ -903,6 +937,36 @@ func PossibleVMCategoryValues() []VMCategory { } } +// VMOperationStatus - Virtual Machine operation status values. +type VMOperationStatus string + +const ( + // VMOperationStatusCancelFailedStatusUnknown - Indicates that the cancellation request could not be applied because the virtual + // machine had already been created. + VMOperationStatusCancelFailedStatusUnknown VMOperationStatus = "CancelFailedStatusUnknown" + // VMOperationStatusCanceled - Indicates that the cancellation request was successful because the virtual machine had not + // been created yet. + VMOperationStatusCanceled VMOperationStatus = "Canceled" + // VMOperationStatusCreating - Indicates that the virtual machine is either in the process of being created or is scheduled + // to be created. + VMOperationStatusCreating VMOperationStatus = "Creating" + // VMOperationStatusFailed - Indicates that the virtual machine operation failed. + VMOperationStatusFailed VMOperationStatus = "Failed" + // VMOperationStatusSucceeded - Indicates that the virtual machine operation completed successfully. + VMOperationStatusSucceeded VMOperationStatus = "Succeeded" +) + +// PossibleVMOperationStatusValues returns the possible values for the VMOperationStatus const type. +func PossibleVMOperationStatusValues() []VMOperationStatus { + return []VMOperationStatus{ + VMOperationStatusCancelFailedStatusUnknown, + VMOperationStatusCanceled, + VMOperationStatusCreating, + VMOperationStatusFailed, + VMOperationStatusSucceeded, + } +} + // WindowsPatchAssessmentMode - Specifies the mode of VM Guest patch assessment for the IaaS virtual machine. type WindowsPatchAssessmentMode string @@ -974,3 +1038,24 @@ func PossibleWindowsVMGuestPatchModeValues() []WindowsVMGuestPatchMode { WindowsVMGuestPatchModeManual, } } + +// ZoneDistributionStrategy - Distribution strategies for Compute Fleet zone allocation policy. +type ZoneDistributionStrategy string + +const ( + // ZoneDistributionStrategyBestEffortSingleZone - Default. Compute Fleet allocates all Fleet capacity within a single zone + // based on best effort. + // If capacity is not available, Compute Fleet can allocate capacity in different zones. + ZoneDistributionStrategyBestEffortSingleZone ZoneDistributionStrategy = "BestEffortSingleZone" + // ZoneDistributionStrategyPrioritized - Compute Fleet allocates capacity based on zone preferences. + // Higher priority zones are filled first before allocating to lower priority zones. + ZoneDistributionStrategyPrioritized ZoneDistributionStrategy = "Prioritized" +) + +// PossibleZoneDistributionStrategyValues returns the possible values for the ZoneDistributionStrategy const type. +func PossibleZoneDistributionStrategyValues() []ZoneDistributionStrategy { + return []ZoneDistributionStrategy{ + ZoneDistributionStrategyBestEffortSingleZone, + ZoneDistributionStrategyPrioritized, + } +} diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/fake/fleets_server.go b/sdk/resourcemanager/computefleet/armcomputefleet/fake/fleets_server.go index 50095603add1..297e81bb5245 100644 --- a/sdk/resourcemanager/computefleet/armcomputefleet/fake/fleets_server.go +++ b/sdk/resourcemanager/computefleet/armcomputefleet/fake/fleets_server.go @@ -12,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet/v2" "net/http" "net/url" "regexp" @@ -20,12 +20,16 @@ import ( // FleetsServer is a fake server for instances of the armcomputefleet.FleetsClient type. type FleetsServer struct { + // BeginCancel is the fake for method FleetsClient.BeginCancel + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginCancel func(ctx context.Context, resourceGroupName string, fleetName string, options *armcomputefleet.FleetsClientBeginCancelOptions) (resp azfake.PollerResponder[armcomputefleet.FleetsClientCancelResponse], errResp azfake.ErrorResponder) + // BeginCreateOrUpdate is the fake for method FleetsClient.BeginCreateOrUpdate // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, fleetName string, resource armcomputefleet.Fleet, options *armcomputefleet.FleetsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armcomputefleet.FleetsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method FleetsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, fleetName string, options *armcomputefleet.FleetsClientBeginDeleteOptions) (resp azfake.PollerResponder[armcomputefleet.FleetsClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method FleetsClient.Get @@ -44,6 +48,10 @@ type FleetsServer struct { // HTTP status codes to indicate success: http.StatusOK NewListVirtualMachineScaleSetsPager func(resourceGroupName string, name string, options *armcomputefleet.FleetsClientListVirtualMachineScaleSetsOptions) (resp azfake.PagerResponder[armcomputefleet.FleetsClientListVirtualMachineScaleSetsResponse]) + // NewListVirtualMachinesPager is the fake for method FleetsClient.NewListVirtualMachinesPager + // HTTP status codes to indicate success: http.StatusOK + NewListVirtualMachinesPager func(resourceGroupName string, name string, options *armcomputefleet.FleetsClientListVirtualMachinesOptions) (resp azfake.PagerResponder[armcomputefleet.FleetsClientListVirtualMachinesResponse]) + // BeginUpdate is the fake for method FleetsClient.BeginUpdate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginUpdate func(ctx context.Context, resourceGroupName string, fleetName string, properties armcomputefleet.FleetUpdate, options *armcomputefleet.FleetsClientBeginUpdateOptions) (resp azfake.PollerResponder[armcomputefleet.FleetsClientUpdateResponse], errResp azfake.ErrorResponder) @@ -55,11 +63,13 @@ type FleetsServer struct { func NewFleetsServerTransport(srv *FleetsServer) *FleetsServerTransport { return &FleetsServerTransport{ srv: srv, + beginCancel: newTracker[azfake.PollerResponder[armcomputefleet.FleetsClientCancelResponse]](), beginCreateOrUpdate: newTracker[azfake.PollerResponder[armcomputefleet.FleetsClientCreateOrUpdateResponse]](), beginDelete: newTracker[azfake.PollerResponder[armcomputefleet.FleetsClientDeleteResponse]](), newListByResourceGroupPager: newTracker[azfake.PagerResponder[armcomputefleet.FleetsClientListByResourceGroupResponse]](), newListBySubscriptionPager: newTracker[azfake.PagerResponder[armcomputefleet.FleetsClientListBySubscriptionResponse]](), newListVirtualMachineScaleSetsPager: newTracker[azfake.PagerResponder[armcomputefleet.FleetsClientListVirtualMachineScaleSetsResponse]](), + newListVirtualMachinesPager: newTracker[azfake.PagerResponder[armcomputefleet.FleetsClientListVirtualMachinesResponse]](), beginUpdate: newTracker[azfake.PollerResponder[armcomputefleet.FleetsClientUpdateResponse]](), } } @@ -68,11 +78,13 @@ func NewFleetsServerTransport(srv *FleetsServer) *FleetsServerTransport { // Don't use this type directly, use NewFleetsServerTransport instead. type FleetsServerTransport struct { srv *FleetsServer + beginCancel *tracker[azfake.PollerResponder[armcomputefleet.FleetsClientCancelResponse]] beginCreateOrUpdate *tracker[azfake.PollerResponder[armcomputefleet.FleetsClientCreateOrUpdateResponse]] beginDelete *tracker[azfake.PollerResponder[armcomputefleet.FleetsClientDeleteResponse]] newListByResourceGroupPager *tracker[azfake.PagerResponder[armcomputefleet.FleetsClientListByResourceGroupResponse]] newListBySubscriptionPager *tracker[azfake.PagerResponder[armcomputefleet.FleetsClientListBySubscriptionResponse]] newListVirtualMachineScaleSetsPager *tracker[azfake.PagerResponder[armcomputefleet.FleetsClientListVirtualMachineScaleSetsResponse]] + newListVirtualMachinesPager *tracker[azfake.PagerResponder[armcomputefleet.FleetsClientListVirtualMachinesResponse]] beginUpdate *tracker[azfake.PollerResponder[armcomputefleet.FleetsClientUpdateResponse]] } @@ -88,29 +100,96 @@ func (f *FleetsServerTransport) Do(req *http.Request) (*http.Response, error) { } func (f *FleetsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - var resp *http.Response - var err error - - switch method { - case "FleetsClient.BeginCreateOrUpdate": - resp, err = f.dispatchBeginCreateOrUpdate(req) - case "FleetsClient.BeginDelete": - resp, err = f.dispatchBeginDelete(req) - case "FleetsClient.Get": - resp, err = f.dispatchGet(req) - case "FleetsClient.NewListByResourceGroupPager": - resp, err = f.dispatchNewListByResourceGroupPager(req) - case "FleetsClient.NewListBySubscriptionPager": - resp, err = f.dispatchNewListBySubscriptionPager(req) - case "FleetsClient.NewListVirtualMachineScaleSetsPager": - resp, err = f.dispatchNewListVirtualMachineScaleSetsPager(req) - case "FleetsClient.BeginUpdate": - resp, err = f.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - return resp, err + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if fleetsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = fleetsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "FleetsClient.BeginCancel": + res.resp, res.err = f.dispatchBeginCancel(req) + case "FleetsClient.BeginCreateOrUpdate": + res.resp, res.err = f.dispatchBeginCreateOrUpdate(req) + case "FleetsClient.BeginDelete": + res.resp, res.err = f.dispatchBeginDelete(req) + case "FleetsClient.Get": + res.resp, res.err = f.dispatchGet(req) + case "FleetsClient.NewListByResourceGroupPager": + res.resp, res.err = f.dispatchNewListByResourceGroupPager(req) + case "FleetsClient.NewListBySubscriptionPager": + res.resp, res.err = f.dispatchNewListBySubscriptionPager(req) + case "FleetsClient.NewListVirtualMachineScaleSetsPager": + res.resp, res.err = f.dispatchNewListVirtualMachineScaleSetsPager(req) + case "FleetsClient.NewListVirtualMachinesPager": + res.resp, res.err = f.dispatchNewListVirtualMachinesPager(req) + case "FleetsClient.BeginUpdate": + res.resp, res.err = f.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (f *FleetsServerTransport) dispatchBeginCancel(req *http.Request) (*http.Response, error) { + if f.srv.BeginCancel == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCancel not implemented")} + } + beginCancel := f.beginCancel.get(req) + if beginCancel == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AzureFleet/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/cancel` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")]) + if err != nil { + return nil, err + } + respr, errRespr := f.srv.BeginCancel(req.Context(), resourceGroupNameParam, fleetNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCancel = &respr + f.beginCancel.add(req, beginCancel) + } + + resp, err := server.PollerResponderNext(beginCancel, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + f.beginCancel.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCancel) { + f.beginCancel.remove(req) + } + + return resp, nil } func (f *FleetsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -122,7 +201,7 @@ func (f *FleetsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) ( const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AzureFleet/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armcomputefleet.Fleet](req) @@ -170,7 +249,7 @@ func (f *FleetsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Re const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AzureFleet/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -194,9 +273,9 @@ func (f *FleetsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Re return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { f.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { f.beginDelete.remove(req) @@ -212,7 +291,7 @@ func (f *FleetsServerTransport) dispatchGet(req *http.Request) (*http.Response, const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AzureFleet/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -247,7 +326,7 @@ func (f *FleetsServerTransport) dispatchNewListByResourceGroupPager(req *http.Re const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AzureFleet/fleets` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -284,7 +363,7 @@ func (f *FleetsServerTransport) dispatchNewListBySubscriptionPager(req *http.Req const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AzureFleet/fleets` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { + if len(matches) < 2 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := f.srv.NewListBySubscriptionPager(nil) @@ -317,7 +396,7 @@ func (f *FleetsServerTransport) dispatchNewListVirtualMachineScaleSetsPager(req const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AzureFleet/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachineScaleSets` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -349,6 +428,65 @@ func (f *FleetsServerTransport) dispatchNewListVirtualMachineScaleSetsPager(req return resp, nil } +func (f *FleetsServerTransport) dispatchNewListVirtualMachinesPager(req *http.Request) (*http.Response, error) { + if f.srv.NewListVirtualMachinesPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListVirtualMachinesPager not implemented")} + } + newListVirtualMachinesPager := f.newListVirtualMachinesPager.get(req) + if newListVirtualMachinesPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AzureFleet/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachines` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + filterUnescaped, err := url.QueryUnescape(qp.Get("$filter")) + if err != nil { + return nil, err + } + filterParam := getOptional(filterUnescaped) + skiptokenUnescaped, err := url.QueryUnescape(qp.Get("$skiptoken")) + if err != nil { + return nil, err + } + skiptokenParam := getOptional(skiptokenUnescaped) + var options *armcomputefleet.FleetsClientListVirtualMachinesOptions + if filterParam != nil || skiptokenParam != nil { + options = &armcomputefleet.FleetsClientListVirtualMachinesOptions{ + Filter: filterParam, + Skiptoken: skiptokenParam, + } + } + resp := f.srv.NewListVirtualMachinesPager(resourceGroupNameParam, nameParam, options) + newListVirtualMachinesPager = &resp + f.newListVirtualMachinesPager.add(req, newListVirtualMachinesPager) + server.PagerResponderInjectNextLinks(newListVirtualMachinesPager, req, func(page *armcomputefleet.FleetsClientListVirtualMachinesResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListVirtualMachinesPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + f.newListVirtualMachinesPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListVirtualMachinesPager) { + f.newListVirtualMachinesPager.remove(req) + } + return resp, nil +} + func (f *FleetsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { if f.srv.BeginUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} @@ -358,7 +496,7 @@ func (f *FleetsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Re const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AzureFleet/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armcomputefleet.FleetUpdate](req) @@ -396,3 +534,9 @@ func (f *FleetsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Re return resp, nil } + +// set this to conditionally intercept incoming requests to FleetsServerTransport +var fleetsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/fake/internal.go b/sdk/resourcemanager/computefleet/armcomputefleet/fake/internal.go index 56a8f624f5f3..d768e4760998 100644 --- a/sdk/resourcemanager/computefleet/armcomputefleet/fake/internal.go +++ b/sdk/resourcemanager/computefleet/armcomputefleet/fake/internal.go @@ -7,9 +7,15 @@ package fake import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "net/http" + "reflect" "sync" ) +type result struct { + resp *http.Response + err error +} + type nonRetriableError struct { error } @@ -27,6 +33,13 @@ func contains[T comparable](s []T, v T) bool { return false } +func getOptional[T any](v T) *T { + if reflect.ValueOf(v).IsZero() { + return nil + } + return &v +} + func newTracker[T any]() *tracker[T] { return &tracker[T]{ items: map[string]*T{}, diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/fake/operations_server.go b/sdk/resourcemanager/computefleet/armcomputefleet/fake/operations_server.go index a86d89fb4a63..1ca70f29e52a 100644 --- a/sdk/resourcemanager/computefleet/armcomputefleet/fake/operations_server.go +++ b/sdk/resourcemanager/computefleet/armcomputefleet/fake/operations_server.go @@ -11,7 +11,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet/v2" "net/http" ) @@ -51,17 +51,36 @@ func (o *OperationsServerTransport) Do(req *http.Request) (*http.Response, error } func (o *OperationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - var resp *http.Response - var err error + resultChan := make(chan result) + defer close(resultChan) - switch method { - case "OperationsClient.NewListPager": - resp, err = o.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + go func() { + var intercepted bool + var res result + if operationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = operationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "OperationsClient.NewListPager": + res.resp, res.err = o.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() - return resp, err + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -90,3 +109,9 @@ func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*ht } return resp, nil } + +// set this to conditionally intercept incoming requests to OperationsServerTransport +var operationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/fake/time_rfc3339.go b/sdk/resourcemanager/computefleet/armcomputefleet/fake/time_rfc3339.go deleted file mode 100644 index 87ee11e83b32..000000000000 --- a/sdk/resourcemanager/computefleet/armcomputefleet/fake/time_rfc3339.go +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. - -package fake - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) - -const ( - 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 - -func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t dateTimeRFC3339) MarshalText() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - 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 { - if len(data) == 0 { - return nil - } - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = time.RFC3339Nano - } else if tzOffset { - layout = dateTimeNoT - } else if hasT { - layout = utcDateTime - } else { - layout = utcDateTimeNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = dateTimeRFC3339(p) - 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 - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*dateTimeRFC3339)(t) -} - -func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || string(data) == "null" { - return nil - } - var aux dateTimeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/fleets_client.go b/sdk/resourcemanager/computefleet/armcomputefleet/fleets_client.go index 2fd16b96db29..797071ce2125 100644 --- a/sdk/resourcemanager/computefleet/armcomputefleet/fleets_client.go +++ b/sdk/resourcemanager/computefleet/armcomputefleet/fleets_client.go @@ -39,10 +39,84 @@ func NewFleetsClient(subscriptionID string, credential azcore.TokenCredential, o return client, nil } +// BeginCancel - Cancels an instance Fleet creation that is in progress. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - fleetName - The name of the Compute Fleet +// - options - FleetsClientBeginCancelOptions contains the optional parameters for the FleetsClient.BeginCancel method. +func (client *FleetsClient) BeginCancel(ctx context.Context, resourceGroupName string, fleetName string, options *FleetsClientBeginCancelOptions) (*runtime.Poller[FleetsClientCancelResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.cancel(ctx, resourceGroupName, fleetName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FleetsClientCancelResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FleetsClientCancelResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Cancel - Cancels an instance Fleet creation that is in progress. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-08-01 +func (client *FleetsClient) cancel(ctx context.Context, resourceGroupName string, fleetName string, options *FleetsClientBeginCancelOptions) (*http.Response, error) { + var err error + const operationName = "FleetsClient.BeginCancel" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.cancelCreateRequest(ctx, resourceGroupName, fleetName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// cancelCreateRequest creates the Cancel request. +func (client *FleetsClient) cancelCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, _ *FleetsClientBeginCancelOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName}/cancel" + 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 fleetName == "" { + return nil, errors.New("parameter fleetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + // BeginCreateOrUpdate - Create a Fleet // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-01 +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Compute Fleet // - resource - Resource create parameters. @@ -69,7 +143,7 @@ func (client *FleetsClient) BeginCreateOrUpdate(ctx context.Context, resourceGro // CreateOrUpdate - Create a Fleet // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-01 +// Generated from API version 2025-08-01 func (client *FleetsClient) createOrUpdate(ctx context.Context, resourceGroupName string, fleetName string, resource Fleet, options *FleetsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "FleetsClient.BeginCreateOrUpdate" @@ -111,7 +185,7 @@ func (client *FleetsClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-01") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} req.Raw().Header["Content-Type"] = []string{"application/json"} @@ -124,7 +198,7 @@ func (client *FleetsClient) createOrUpdateCreateRequest(ctx context.Context, res // BeginDelete - Delete a Fleet // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-01 +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Compute Fleet // - options - FleetsClientBeginDeleteOptions contains the optional parameters for the FleetsClient.BeginDelete method. @@ -148,7 +222,7 @@ func (client *FleetsClient) BeginDelete(ctx context.Context, resourceGroupName s // Delete - Delete a Fleet // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-01 +// Generated from API version 2025-08-01 func (client *FleetsClient) deleteOperation(ctx context.Context, resourceGroupName string, fleetName string, options *FleetsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "FleetsClient.BeginDelete" @@ -190,16 +264,15 @@ func (client *FleetsClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-01") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Get a Fleet // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-01 +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Compute Fleet // - options - FleetsClientGetOptions contains the optional parameters for the FleetsClient.Get method. @@ -245,7 +318,7 @@ func (client *FleetsClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-01") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -262,7 +335,7 @@ func (client *FleetsClient) getHandleResponse(resp *http.Response) (FleetsClient // NewListByResourceGroupPager - List Fleet resources by resource group // -// Generated from API version 2024-11-01 +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - FleetsClientListByResourceGroupOptions contains the optional parameters for the FleetsClient.NewListByResourceGroupPager // method. @@ -305,7 +378,7 @@ func (client *FleetsClient) listByResourceGroupCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-01") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -322,7 +395,7 @@ func (client *FleetsClient) listByResourceGroupHandleResponse(resp *http.Respons // NewListBySubscriptionPager - List Fleet resources by subscription ID // -// Generated from API version 2024-11-01 +// Generated from API version 2025-08-01 // - options - FleetsClientListBySubscriptionOptions contains the optional parameters for the FleetsClient.NewListBySubscriptionPager // method. func (client *FleetsClient) NewListBySubscriptionPager(options *FleetsClientListBySubscriptionOptions) *runtime.Pager[FleetsClientListBySubscriptionResponse] { @@ -360,7 +433,7 @@ func (client *FleetsClient) listBySubscriptionCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-01") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -377,7 +450,7 @@ func (client *FleetsClient) listBySubscriptionHandleResponse(resp *http.Response // NewListVirtualMachineScaleSetsPager - List VirtualMachineScaleSet resources by Fleet // -// Generated from API version 2024-11-01 +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - name - The name of the Fleet // - options - FleetsClientListVirtualMachineScaleSetsOptions contains the optional parameters for the FleetsClient.NewListVirtualMachineScaleSetsPager @@ -425,7 +498,7 @@ func (client *FleetsClient) listVirtualMachineScaleSetsCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-01") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -440,10 +513,81 @@ func (client *FleetsClient) listVirtualMachineScaleSetsHandleResponse(resp *http return result, nil } +// NewListVirtualMachinesPager - List VirtualMachine resources of an instance Fleet. +// +// Generated from API version 2025-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - name - The name of the Fleet +// - options - FleetsClientListVirtualMachinesOptions contains the optional parameters for the FleetsClient.NewListVirtualMachinesPager +// method. +func (client *FleetsClient) NewListVirtualMachinesPager(resourceGroupName string, name string, options *FleetsClientListVirtualMachinesOptions) *runtime.Pager[FleetsClientListVirtualMachinesResponse] { + return runtime.NewPager(runtime.PagingHandler[FleetsClientListVirtualMachinesResponse]{ + More: func(page FleetsClientListVirtualMachinesResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *FleetsClientListVirtualMachinesResponse) (FleetsClientListVirtualMachinesResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "FleetsClient.NewListVirtualMachinesPager") + 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.listVirtualMachinesCreateRequest(ctx, resourceGroupName, name, options) + }, nil) + if err != nil { + return FleetsClientListVirtualMachinesResponse{}, err + } + return client.listVirtualMachinesHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listVirtualMachinesCreateRequest creates the ListVirtualMachines request. +func (client *FleetsClient) listVirtualMachinesCreateRequest(ctx context.Context, resourceGroupName string, name string, options *FleetsClientListVirtualMachinesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{name}/virtualMachines" + 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 name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Skiptoken != nil { + reqQP.Set("$skiptoken", *options.Skiptoken) + } + reqQP.Set("api-version", "2025-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listVirtualMachinesHandleResponse handles the ListVirtualMachines response. +func (client *FleetsClient) listVirtualMachinesHandleResponse(resp *http.Response) (FleetsClientListVirtualMachinesResponse, error) { + result := FleetsClientListVirtualMachinesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineListResult); err != nil { + return FleetsClientListVirtualMachinesResponse{}, err + } + return result, nil +} + // BeginUpdate - Update a Fleet // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-01 +// Generated from API version 2025-08-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Compute Fleet // - properties - The resource properties to be updated. @@ -468,7 +612,7 @@ func (client *FleetsClient) BeginUpdate(ctx context.Context, resourceGroupName s // Update - Update a Fleet // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-01 +// Generated from API version 2025-08-01 func (client *FleetsClient) update(ctx context.Context, resourceGroupName string, fleetName string, properties FleetUpdate, options *FleetsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "FleetsClient.BeginUpdate" @@ -510,7 +654,7 @@ func (client *FleetsClient) updateCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-01") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} req.Raw().Header["Content-Type"] = []string{"application/json"} diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/fleets_client_example_test.go b/sdk/resourcemanager/computefleet/armcomputefleet/fleets_client_example_test.go deleted file mode 100644 index 1499fe058820..000000000000 --- a/sdk/resourcemanager/computefleet/armcomputefleet/fleets_client_example_test.go +++ /dev/null @@ -1,3114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. - -package armcomputefleet_test - -import ( - "context" - "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/computefleet/armcomputefleet" - "log" -) - -// Generated from example definition: 2024-11-01/Fleets_CreateOrUpdate.json -func ExampleFleetsClient_BeginCreateOrUpdate_fleetsCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputefleet.NewClientFactory("1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFleetsClient().BeginCreateOrUpdate(ctx, "rgazurefleet", "testFleet", armcomputefleet.Fleet{ - Properties: &armcomputefleet.FleetProperties{ - SpotPriorityProfile: &armcomputefleet.SpotPriorityProfile{ - Capacity: to.Ptr[int32](20), - MinCapacity: to.Ptr[int32](10), - MaxPricePerVM: to.Ptr[float32](0.00865), - EvictionPolicy: to.Ptr(armcomputefleet.EvictionPolicyDelete), - AllocationStrategy: to.Ptr(armcomputefleet.SpotAllocationStrategyPriceCapacityOptimized), - Maintain: to.Ptr(true), - }, - RegularPriorityProfile: &armcomputefleet.RegularPriorityProfile{ - Capacity: to.Ptr[int32](20), - MinCapacity: to.Ptr[int32](10), - AllocationStrategy: to.Ptr(armcomputefleet.RegularPriorityAllocationStrategyLowestPrice), - }, - VMSizesProfile: []*armcomputefleet.VMSizeProfile{ - { - Name: to.Ptr("Standard_d1_v2"), - Rank: to.Ptr[int32](19225), - }, - }, - ComputeProfile: &armcomputefleet.ComputeProfile{ - BaseVirtualMachineProfile: &armcomputefleet.BaseVirtualMachineProfile{ - OSProfile: &armcomputefleet.VirtualMachineScaleSetOSProfile{ - ComputerNamePrefix: to.Ptr("o"), - AdminUsername: to.Ptr("nrgzqciiaaxjrqldbmjbqkyhntp"), - AdminPassword: to.Ptr("adfbrdxpv"), - CustomData: to.Ptr("xjjib"), - WindowsConfiguration: &armcomputefleet.WindowsConfiguration{ - ProvisionVMAgent: to.Ptr(true), - EnableAutomaticUpdates: to.Ptr(true), - TimeZone: to.Ptr("hlyjiqcfksgrpjrct"), - AdditionalUnattendContent: []*armcomputefleet.AdditionalUnattendContent{ - { - PassName: to.Ptr("OobeSystem"), - ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), - SettingName: to.Ptr(armcomputefleet.SettingNamesAutoLogon), - Content: to.Ptr("bubmqbxjkj"), - }, - }, - PatchSettings: &armcomputefleet.PatchSettings{ - PatchMode: to.Ptr(armcomputefleet.WindowsVMGuestPatchModeManual), - EnableHotpatching: to.Ptr(true), - AssessmentMode: to.Ptr(armcomputefleet.WindowsPatchAssessmentModeImageDefault), - AutomaticByPlatformSettings: &armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformSettings{ - RebootSetting: to.Ptr(armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown), - BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), - }, - }, - WinRM: &armcomputefleet.WinRMConfiguration{ - Listeners: []*armcomputefleet.WinRMListener{ - { - Protocol: to.Ptr(armcomputefleet.ProtocolTypesHTTPS), - CertificateURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/myCertName"), - }, - }, - }, - EnableVMAgentPlatformUpdates: to.Ptr(true), - }, - LinuxConfiguration: &armcomputefleet.LinuxConfiguration{ - DisablePasswordAuthentication: to.Ptr(true), - SSH: &armcomputefleet.SSHConfiguration{ - PublicKeys: []*armcomputefleet.SSHPublicKey{ - { - Path: to.Ptr("kmqz"), - KeyData: to.Ptr("kivgsubusvpprwqaqpjcmhsv"), - }, - }, - }, - ProvisionVMAgent: to.Ptr(true), - PatchSettings: &armcomputefleet.LinuxPatchSettings{ - PatchMode: to.Ptr(armcomputefleet.LinuxVMGuestPatchModeImageDefault), - AssessmentMode: to.Ptr(armcomputefleet.LinuxPatchAssessmentModeImageDefault), - AutomaticByPlatformSettings: &armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformSettings{ - RebootSetting: to.Ptr(armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown), - BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), - }, - }, - EnableVMAgentPlatformUpdates: to.Ptr(true), - }, - Secrets: []*armcomputefleet.VaultSecretGroup{ - { - SourceVault: &armcomputefleet.SubResource{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), - }, - VaultCertificates: []*armcomputefleet.VaultCertificate{ - { - CertificateURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/myCertName"), - CertificateStore: to.Ptr("nlxrwavpzhueffxsshlun"), - }, - }, - }, - }, - AllowExtensionOperations: to.Ptr(true), - RequireGuestProvisionSignal: to.Ptr(true), - }, - StorageProfile: &armcomputefleet.VirtualMachineScaleSetStorageProfile{ - ImageReference: &armcomputefleet.ImageReference{ - Publisher: to.Ptr("mqxgwbiyjzmxavhbkd"), - Offer: to.Ptr("isxgumkarlkomp"), - SKU: to.Ptr("eojmppqcrnpmxirtp"), - Version: to.Ptr("wvpcqefgtmqdgltiuz"), - SharedGalleryImageID: to.Ptr("kmkgihoxwlawuuhcinfirktdwkmx"), - CommunityGalleryImageID: to.Ptr("vlqe"), - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}"), - }, - OSDisk: &armcomputefleet.VirtualMachineScaleSetOSDisk{ - Name: to.Ptr("wfttw"), - Caching: to.Ptr(armcomputefleet.CachingTypesNone), - WriteAcceleratorEnabled: to.Ptr(true), - CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), - DiffDiskSettings: &armcomputefleet.DiffDiskSettings{ - Option: to.Ptr(armcomputefleet.DiffDiskOptionsLocal), - Placement: to.Ptr(armcomputefleet.DiffDiskPlacementCacheDisk), - }, - DiskSizeGB: to.Ptr[int32](14), - OSType: to.Ptr(armcomputefleet.OperatingSystemTypesWindows), - Image: &armcomputefleet.VirtualHardDisk{ - URI: to.Ptr("https://myStorageAccountName.blob.core.windows.net/myContainerName/myVhdName.vhd"), - }, - VhdContainers: []*string{ - to.Ptr("tkzcwddtinkfpnfklatw"), - }, - ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ - StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), - DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), - }, - SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ - SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), - DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), - }, - }, - }, - DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), - }, - DataDisks: []*armcomputefleet.VirtualMachineScaleSetDataDisk{ - { - Name: to.Ptr("eogiykmdmeikswxmigjws"), - Lun: to.Ptr[int32](14), - Caching: to.Ptr(armcomputefleet.CachingTypesNone), - WriteAcceleratorEnabled: to.Ptr(true), - CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), - DiskSizeGB: to.Ptr[int32](6), - ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ - StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), - DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), - }, - SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ - SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), - DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), - }, - }, - }, - DiskIOPSReadWrite: to.Ptr[int64](27), - DiskMBpsReadWrite: to.Ptr[int64](2), - DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), - }, - }, - }, - NetworkProfile: &armcomputefleet.VirtualMachineScaleSetNetworkProfile{ - HealthProbe: &armcomputefleet.APIEntityReference{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}"), - }, - NetworkInterfaceConfigurations: []*armcomputefleet.VirtualMachineScaleSetNetworkConfiguration{ - { - Name: to.Ptr("i"), - Properties: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationProperties{ - Primary: to.Ptr(true), - EnableAcceleratedNetworking: to.Ptr(true), - DisableTCPStateTracking: to.Ptr(true), - EnableFpga: to.Ptr(true), - NetworkSecurityGroup: &armcomputefleet.SubResource{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"), - }, - DNSSettings: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - DNSServers: []*string{ - to.Ptr("nxmmfolhclsesu"), - }, - }, - IPConfigurations: []*armcomputefleet.VirtualMachineScaleSetIPConfiguration{ - { - Name: to.Ptr("oezqhkidfhyywlfzwuotilrpbqnjg"), - Properties: &armcomputefleet.VirtualMachineScaleSetIPConfigurationProperties{ - Subnet: &armcomputefleet.APIEntityReference{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}"), - }, - Primary: to.Ptr(true), - PublicIPAddressConfiguration: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfiguration{ - Name: to.Ptr("fvpqf"), - Properties: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ - IdleTimeoutInMinutes: to.Ptr[int32](9), - DNSSettings: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ - DomainNameLabel: to.Ptr("ukrddzvmorpmfsczjwtbvp"), - DomainNameLabelScope: to.Ptr(armcomputefleet.DomainNameLabelScopeTypesTenantReuse), - }, - IPTags: []*armcomputefleet.VirtualMachineScaleSetIPTag{ - { - IPTagType: to.Ptr("sddgsoemnzgqizale"), - Tag: to.Ptr("wufmhrjsakbiaetyara"), - }, - }, - PublicIPPrefix: &armcomputefleet.SubResource{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}"), - }, - PublicIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), - DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), - }, - SKU: &armcomputefleet.PublicIPAddressSKU{ - Name: to.Ptr(armcomputefleet.PublicIPAddressSKUNameBasic), - Tier: to.Ptr(armcomputefleet.PublicIPAddressSKUTierRegional), - }, - }, - PrivateIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), - ApplicationGatewayBackendAddressPools: []*armcomputefleet.SubResource{ - { - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}"), - }, - }, - ApplicationSecurityGroups: []*armcomputefleet.SubResource{ - { - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}"), - }, - }, - LoadBalancerBackendAddressPools: []*armcomputefleet.SubResource{ - { - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}"), - }, - }, - LoadBalancerInboundNatPools: []*armcomputefleet.SubResource{ - { - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}"), - }, - }, - }, - }, - }, - EnableIPForwarding: to.Ptr(true), - DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), - AuxiliaryMode: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliaryModeNone), - AuxiliarySKU: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliarySKUNone), - }, - }, - }, - NetworkAPIVersion: to.Ptr(armcomputefleet.NetworkAPIVersionV20201101), - }, - SecurityProfile: &armcomputefleet.SecurityProfile{ - UefiSettings: &armcomputefleet.UefiSettings{ - SecureBootEnabled: to.Ptr(true), - VTpmEnabled: to.Ptr(true), - }, - EncryptionAtHost: to.Ptr(true), - SecurityType: to.Ptr(armcomputefleet.SecurityTypesTrustedLaunch), - EncryptionIdentity: &armcomputefleet.EncryptionIdentity{ - UserAssignedIdentityResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}"), - }, - ProxyAgentSettings: &armcomputefleet.ProxyAgentSettings{ - Enabled: to.Ptr(true), - Mode: to.Ptr(armcomputefleet.ModeAudit), - KeyIncarnationID: to.Ptr[int32](20), - }, - }, - DiagnosticsProfile: &armcomputefleet.DiagnosticsProfile{ - BootDiagnostics: &armcomputefleet.BootDiagnostics{ - Enabled: to.Ptr(true), - StorageURI: to.Ptr("http://myStorageAccountName.blob.core.windows.net"), - }, - }, - ExtensionProfile: &armcomputefleet.VirtualMachineScaleSetExtensionProfile{ - Extensions: []*armcomputefleet.VirtualMachineScaleSetExtension{ - { - Name: to.Ptr("bndxuxx"), - Properties: &armcomputefleet.VirtualMachineScaleSetExtensionProperties{ - ForceUpdateTag: to.Ptr("yhgxw"), - Publisher: to.Ptr("kpxtirxjfprhs"), - Type: to.Ptr("pgjilctjjwaa"), - TypeHandlerVersion: to.Ptr("zevivcoilxmbwlrihhhibq"), - AutoUpgradeMinorVersion: to.Ptr(true), - EnableAutomaticUpgrade: to.Ptr(true), - Settings: map[string]any{}, - ProtectedSettings: map[string]any{}, - ProvisionAfterExtensions: []*string{ - to.Ptr("nftzosroolbcwmpupujzqwqe"), - }, - SuppressFailures: to.Ptr(true), - ProtectedSettingsFromKeyVault: &armcomputefleet.KeyVaultSecretReference{ - SecretURL: to.Ptr("https://myvaultName.vault.azure.net/secrets/secret/mySecretName"), - SourceVault: &armcomputefleet.SubResource{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), - }, - }, - }, - }, - }, - ExtensionsTimeBudget: to.Ptr("mbhjahtdygwgyszdwjtvlvtgchdwil"), - }, - LicenseType: to.Ptr("v"), - ScheduledEventsProfile: &armcomputefleet.ScheduledEventsProfile{ - TerminateNotificationProfile: &armcomputefleet.TerminateNotificationProfile{ - NotBeforeTimeout: to.Ptr("iljppmmw"), - Enable: to.Ptr(true), - }, - OSImageNotificationProfile: &armcomputefleet.OSImageNotificationProfile{ - NotBeforeTimeout: to.Ptr("olbpadmevekyczfokodtfprxti"), - Enable: to.Ptr(true), - }, - }, - UserData: to.Ptr("s"), - CapacityReservation: &armcomputefleet.CapacityReservationProfile{ - CapacityReservationGroup: &armcomputefleet.SubResource{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"), - }, - }, - ApplicationProfile: &armcomputefleet.ApplicationProfile{ - GalleryApplications: []*armcomputefleet.VMGalleryApplication{ - { - Tags: to.Ptr("eyrqjbib"), - Order: to.Ptr[int32](5), - PackageReferenceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}"), - ConfigurationReference: to.Ptr("ulztmiavpojpbpbddgnuuiimxcpau"), - TreatFailureAsDeploymentFailure: to.Ptr(true), - EnableAutomaticUpgrade: to.Ptr(true), - }, - }, - }, - HardwareProfile: &armcomputefleet.VirtualMachineScaleSetHardwareProfile{ - VMSizeProperties: &armcomputefleet.VMSizeProperties{ - VCPUsAvailable: to.Ptr[int32](16), - VCPUsPerCore: to.Ptr[int32](23), - }, - }, - ServiceArtifactReference: &armcomputefleet.ServiceArtifactReference{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}"), - }, - SecurityPostureReference: &armcomputefleet.SecurityPostureReference{ - ID: to.Ptr("/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest"), - ExcludeExtensions: []*string{ - to.Ptr("{securityPostureVMExtensionName}"), - }, - IsOverridable: to.Ptr(true), - }, - }, - ComputeAPIVersion: to.Ptr("2023-07-01"), - PlatformFaultDomainCount: to.Ptr[int32](1), - }, - }, - Zones: []*string{ - to.Ptr("zone1"), - to.Ptr("zone2"), - }, - Identity: &armcomputefleet.ManagedServiceIdentity{ - Type: to.Ptr(armcomputefleet.ManagedServiceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armcomputefleet.UserAssignedIdentity{ - "key9851": {}, - }, - }, - Tags: map[string]*string{ - "key3518": to.Ptr("luvrnuvsgdpbuofdskkcoqhfh"), - }, - Location: to.Ptr("westus"), - Plan: &armcomputefleet.Plan{ - Name: to.Ptr("jwgrcrnrtfoxn"), - Publisher: to.Ptr("iozjbiqqckqm"), - Product: to.Ptr("cgopbyvdyqikahwyxfpzwaqk"), - PromotionCode: to.Ptr("naglezezplcaruqogtxnuizslqnnbr"), - Version: to.Ptr("wa"), - }, - }, 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 = armcomputefleet.FleetsClientCreateOrUpdateResponse{ - // Fleet: &armcomputefleet.Fleet{ - // Properties: &armcomputefleet.FleetProperties{ - // ProvisioningState: to.Ptr(armcomputefleet.ProvisioningStateSucceeded), - // SpotPriorityProfile: &armcomputefleet.SpotPriorityProfile{ - // Capacity: to.Ptr[int32](10), - // MinCapacity: to.Ptr[int32](20), - // MaxPricePerVM: to.Ptr[float32](0.00865), - // EvictionPolicy: to.Ptr(armcomputefleet.EvictionPolicyDelete), - // AllocationStrategy: to.Ptr(armcomputefleet.SpotAllocationStrategyPriceCapacityOptimized), - // Maintain: to.Ptr(true), - // }, - // RegularPriorityProfile: &armcomputefleet.RegularPriorityProfile{ - // Capacity: to.Ptr[int32](10), - // MinCapacity: to.Ptr[int32](10), - // AllocationStrategy: to.Ptr(armcomputefleet.RegularPriorityAllocationStrategyLowestPrice), - // }, - // VMSizesProfile: []*armcomputefleet.VMSizeProfile{ - // { - // Name: to.Ptr("Standard_d1_v2"), - // Rank: to.Ptr[int32](19225), - // }, - // }, - // ComputeProfile: &armcomputefleet.ComputeProfile{ - // BaseVirtualMachineProfile: &armcomputefleet.BaseVirtualMachineProfile{ - // OSProfile: &armcomputefleet.VirtualMachineScaleSetOSProfile{ - // ComputerNamePrefix: to.Ptr("o"), - // AdminUsername: to.Ptr("nrgzqciiaaxjrqldbmjbqkyhntp"), - // WindowsConfiguration: &armcomputefleet.WindowsConfiguration{ - // ProvisionVMAgent: to.Ptr(true), - // EnableAutomaticUpdates: to.Ptr(true), - // TimeZone: to.Ptr("hlyjiqcfksgrpjrct"), - // AdditionalUnattendContent: []*armcomputefleet.AdditionalUnattendContent{ - // { - // PassName: to.Ptr("OobeSystem"), - // ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), - // SettingName: to.Ptr(armcomputefleet.SettingNamesAutoLogon), - // }, - // }, - // PatchSettings: &armcomputefleet.PatchSettings{ - // PatchMode: to.Ptr(armcomputefleet.WindowsVMGuestPatchModeManual), - // EnableHotpatching: to.Ptr(true), - // AssessmentMode: to.Ptr(armcomputefleet.WindowsPatchAssessmentModeImageDefault), - // AutomaticByPlatformSettings: &armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformSettings{ - // RebootSetting: to.Ptr(armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown), - // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), - // }, - // }, - // WinRM: &armcomputefleet.WinRMConfiguration{ - // Listeners: []*armcomputefleet.WinRMListener{ - // { - // Protocol: to.Ptr(armcomputefleet.ProtocolTypesHTTPS), - // CertificateURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/myCertName"), - // }, - // }, - // }, - // EnableVMAgentPlatformUpdates: to.Ptr(true), - // }, - // LinuxConfiguration: &armcomputefleet.LinuxConfiguration{ - // DisablePasswordAuthentication: to.Ptr(true), - // SSH: &armcomputefleet.SSHConfiguration{ - // PublicKeys: []*armcomputefleet.SSHPublicKey{ - // { - // Path: to.Ptr("kmqz"), - // KeyData: to.Ptr("kivgsubusvpprwqaqpjcmhsv"), - // }, - // }, - // }, - // ProvisionVMAgent: to.Ptr(true), - // PatchSettings: &armcomputefleet.LinuxPatchSettings{ - // PatchMode: to.Ptr(armcomputefleet.LinuxVMGuestPatchModeImageDefault), - // AssessmentMode: to.Ptr(armcomputefleet.LinuxPatchAssessmentModeImageDefault), - // AutomaticByPlatformSettings: &armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformSettings{ - // RebootSetting: to.Ptr(armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown), - // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), - // }, - // }, - // EnableVMAgentPlatformUpdates: to.Ptr(true), - // }, - // Secrets: []*armcomputefleet.VaultSecretGroup{ - // { - // SourceVault: &armcomputefleet.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), - // }, - // VaultCertificates: []*armcomputefleet.VaultCertificate{ - // { - // CertificateURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/myCertName"), - // CertificateStore: to.Ptr("nlxrwavpzhueffxsshlun"), - // }, - // }, - // }, - // }, - // AllowExtensionOperations: to.Ptr(true), - // RequireGuestProvisionSignal: to.Ptr(true), - // }, - // StorageProfile: &armcomputefleet.VirtualMachineScaleSetStorageProfile{ - // ImageReference: &armcomputefleet.ImageReference{ - // Publisher: to.Ptr("mqxgwbiyjzmxavhbkd"), - // Offer: to.Ptr("isxgumkarlkomp"), - // SKU: to.Ptr("eojmppqcrnpmxirtp"), - // Version: to.Ptr("wvpcqefgtmqdgltiuz"), - // ExactVersion: to.Ptr("zjbntmiskjexlr"), - // SharedGalleryImageID: to.Ptr("kmkgihoxwlawuuhcinfirktdwkmx"), - // CommunityGalleryImageID: to.Ptr("vlqe"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}"), - // }, - // OSDisk: &armcomputefleet.VirtualMachineScaleSetOSDisk{ - // Name: to.Ptr("wfttw"), - // Caching: to.Ptr(armcomputefleet.CachingTypesNone), - // WriteAcceleratorEnabled: to.Ptr(true), - // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), - // DiffDiskSettings: &armcomputefleet.DiffDiskSettings{ - // Option: to.Ptr(armcomputefleet.DiffDiskOptionsLocal), - // Placement: to.Ptr(armcomputefleet.DiffDiskPlacementCacheDisk), - // }, - // DiskSizeGB: to.Ptr[int32](14), - // OSType: to.Ptr(armcomputefleet.OperatingSystemTypesWindows), - // Image: &armcomputefleet.VirtualHardDisk{ - // URI: to.Ptr("https://myStorageAccountName.blob.core.windows.net/myContainerName/myVhdName.vhd"), - // }, - // VhdContainers: []*string{ - // to.Ptr("tkzcwddtinkfpnfklatw"), - // }, - // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), - // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), - // }, - // SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ - // SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), - // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), - // }, - // }, - // }, - // DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), - // }, - // DataDisks: []*armcomputefleet.VirtualMachineScaleSetDataDisk{ - // { - // Name: to.Ptr("eogiykmdmeikswxmigjws"), - // Lun: to.Ptr[int32](14), - // Caching: to.Ptr(armcomputefleet.CachingTypesNone), - // WriteAcceleratorEnabled: to.Ptr(true), - // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), - // DiskSizeGB: to.Ptr[int32](6), - // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), - // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), - // }, - // SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ - // SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), - // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), - // }, - // }, - // }, - // DiskIOPSReadWrite: to.Ptr[int64](27), - // DiskMBpsReadWrite: to.Ptr[int64](2), - // DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), - // }, - // }, - // }, - // NetworkProfile: &armcomputefleet.VirtualMachineScaleSetNetworkProfile{ - // HealthProbe: &armcomputefleet.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}"), - // }, - // NetworkInterfaceConfigurations: []*armcomputefleet.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("i"), - // Properties: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationProperties{ - // Primary: to.Ptr(true), - // EnableAcceleratedNetworking: to.Ptr(true), - // DisableTCPStateTracking: to.Ptr(true), - // EnableFpga: to.Ptr(true), - // NetworkSecurityGroup: &armcomputefleet.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"), - // }, - // DNSSettings: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // to.Ptr("nxmmfolhclsesu"), - // }, - // }, - // IPConfigurations: []*armcomputefleet.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("oezqhkidfhyywlfzwuotilrpbqnjg"), - // Properties: &armcomputefleet.VirtualMachineScaleSetIPConfigurationProperties{ - // Subnet: &armcomputefleet.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}"), - // }, - // Primary: to.Ptr(true), - // PublicIPAddressConfiguration: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfiguration{ - // Name: to.Ptr("fvpqf"), - // Properties: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ - // IdleTimeoutInMinutes: to.Ptr[int32](9), - // DNSSettings: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ - // DomainNameLabel: to.Ptr("ukrddzvmorpmfsczjwtbvp"), - // DomainNameLabelScope: to.Ptr(armcomputefleet.DomainNameLabelScopeTypesTenantReuse), - // }, - // IPTags: []*armcomputefleet.VirtualMachineScaleSetIPTag{ - // { - // IPTagType: to.Ptr("sddgsoemnzgqizale"), - // Tag: to.Ptr("wufmhrjsakbiaetyara"), - // }, - // }, - // PublicIPPrefix: &armcomputefleet.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}"), - // }, - // PublicIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), - // DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), - // }, - // SKU: &armcomputefleet.PublicIPAddressSKU{ - // Name: to.Ptr(armcomputefleet.PublicIPAddressSKUNameBasic), - // Tier: to.Ptr(armcomputefleet.PublicIPAddressSKUTierRegional), - // }, - // }, - // PrivateIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), - // ApplicationGatewayBackendAddressPools: []*armcomputefleet.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}"), - // }, - // }, - // ApplicationSecurityGroups: []*armcomputefleet.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}"), - // }, - // }, - // LoadBalancerBackendAddressPools: []*armcomputefleet.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}"), - // }, - // }, - // LoadBalancerInboundNatPools: []*armcomputefleet.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}"), - // }, - // }, - // }, - // }, - // }, - // EnableIPForwarding: to.Ptr(true), - // DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), - // AuxiliaryMode: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliaryModeNone), - // AuxiliarySKU: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliarySKUNone), - // }, - // }, - // }, - // NetworkAPIVersion: to.Ptr(armcomputefleet.NetworkAPIVersionV20201101), - // }, - // SecurityProfile: &armcomputefleet.SecurityProfile{ - // UefiSettings: &armcomputefleet.UefiSettings{ - // SecureBootEnabled: to.Ptr(true), - // VTpmEnabled: to.Ptr(true), - // }, - // EncryptionAtHost: to.Ptr(true), - // SecurityType: to.Ptr(armcomputefleet.SecurityTypesTrustedLaunch), - // EncryptionIdentity: &armcomputefleet.EncryptionIdentity{ - // UserAssignedIdentityResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}"), - // }, - // ProxyAgentSettings: &armcomputefleet.ProxyAgentSettings{ - // Enabled: to.Ptr(true), - // Mode: to.Ptr(armcomputefleet.ModeAudit), - // KeyIncarnationID: to.Ptr[int32](20), - // }, - // }, - // DiagnosticsProfile: &armcomputefleet.DiagnosticsProfile{ - // BootDiagnostics: &armcomputefleet.BootDiagnostics{ - // Enabled: to.Ptr(true), - // StorageURI: to.Ptr("http://myStorageAccountName.blob.core.windows.net"), - // }, - // }, - // ExtensionProfile: &armcomputefleet.VirtualMachineScaleSetExtensionProfile{ - // Extensions: []*armcomputefleet.VirtualMachineScaleSetExtension{ - // { - // Name: to.Ptr("bndxuxx"), - // Type: to.Ptr("cmeam"), - // Properties: &armcomputefleet.VirtualMachineScaleSetExtensionProperties{ - // ForceUpdateTag: to.Ptr("yhgxw"), - // Publisher: to.Ptr("kpxtirxjfprhs"), - // Type: to.Ptr("pgjilctjjwaa"), - // TypeHandlerVersion: to.Ptr("zevivcoilxmbwlrihhhibq"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // EnableAutomaticUpgrade: to.Ptr(true), - // Settings: map[string]any{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // ProvisionAfterExtensions: []*string{ - // to.Ptr("nftzosroolbcwmpupujzqwqe"), - // }, - // SuppressFailures: to.Ptr(true), - // ProtectedSettingsFromKeyVault: &armcomputefleet.KeyVaultSecretReference{ - // SecretURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/secret/mySecretName"), - // SourceVault: &armcomputefleet.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), - // }, - // }, - // }, - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{extensionName}"), - // }, - // }, - // ExtensionsTimeBudget: to.Ptr("mbhjahtdygwgyszdwjtvlvtgchdwil"), - // }, - // LicenseType: to.Ptr("v"), - // ScheduledEventsProfile: &armcomputefleet.ScheduledEventsProfile{ - // TerminateNotificationProfile: &armcomputefleet.TerminateNotificationProfile{ - // NotBeforeTimeout: to.Ptr("iljppmmw"), - // Enable: to.Ptr(true), - // }, - // OSImageNotificationProfile: &armcomputefleet.OSImageNotificationProfile{ - // NotBeforeTimeout: to.Ptr("olbpadmevekyczfokodtfprxti"), - // Enable: to.Ptr(true), - // }, - // }, - // UserData: to.Ptr("s"), - // CapacityReservation: &armcomputefleet.CapacityReservationProfile{ - // CapacityReservationGroup: &armcomputefleet.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"), - // }, - // }, - // ApplicationProfile: &armcomputefleet.ApplicationProfile{ - // GalleryApplications: []*armcomputefleet.VMGalleryApplication{ - // { - // Tags: to.Ptr("eyrqjbib"), - // Order: to.Ptr[int32](5), - // PackageReferenceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}"), - // TreatFailureAsDeploymentFailure: to.Ptr(true), - // EnableAutomaticUpgrade: to.Ptr(true), - // }, - // }, - // }, - // HardwareProfile: &armcomputefleet.VirtualMachineScaleSetHardwareProfile{ - // VMSizeProperties: &armcomputefleet.VMSizeProperties{ - // VCPUsAvailable: to.Ptr[int32](16), - // VCPUsPerCore: to.Ptr[int32](23), - // }, - // }, - // ServiceArtifactReference: &armcomputefleet.ServiceArtifactReference{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}"), - // }, - // SecurityPostureReference: &armcomputefleet.SecurityPostureReference{ - // ID: to.Ptr("/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest"), - // ExcludeExtensions: []*string{ - // to.Ptr("{securityPostureVMExtensionName}"), - // }, - // IsOverridable: to.Ptr(true), - // }, - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), - // }, - // ComputeAPIVersion: to.Ptr("2023-07-01"), - // PlatformFaultDomainCount: to.Ptr[int32](1), - // }, - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-10T00:16:34.8590555+00:00"); return t}()), - // UniqueID: to.Ptr("a2f7fabd-bbc2-4a20-afe1-49fdb3885a28"), - // }, - // Zones: []*string{ - // to.Ptr("zone1"), - // to.Ptr("zone2"), - // }, - // Identity: &armcomputefleet.ManagedServiceIdentity{ - // PrincipalID: to.Ptr("4d508e5b-374b-4382-9a1c-01fb8b6cb37c"), - // TenantID: to.Ptr("5d508e5b-374b-4382-9a1c-01fb8b6cb37c"), - // Type: to.Ptr(armcomputefleet.ManagedServiceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armcomputefleet.UserAssignedIdentity{ - // "key9851": &armcomputefleet.UserAssignedIdentity{ - // PrincipalID: to.Ptr("6d508e5b-374b-4382-9a1c-01fb8b6cb37c"), - // ClientID: to.Ptr("7d508e5b-374b-4382-9a1c-01fb8b6cb37c"), - // }, - // }, - // }, - // Plan: &armcomputefleet.Plan{ - // Name: to.Ptr("jwgrcrnrtfoxn"), - // Publisher: to.Ptr("iozjbiqqckqm"), - // Product: to.Ptr("cgopbyvdyqikahwyxfpzwaqk"), - // PromotionCode: to.Ptr("naglezezplcaruqogtxnuizslqnnbr"), - // Version: to.Ptr("wa"), - // }, - // Tags: map[string]*string{ - // "key3518": to.Ptr("luvrnuvsgdpbuofdskkcoqhfh"), - // }, - // Location: to.Ptr("westus"), - // ID: to.Ptr("/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/testFleet"), - // Name: to.Ptr("testFleet"), - // Type: to.Ptr("Microsoft.AzureFleet/fleets"), - // SystemData: &armcomputefleet.SystemData{ - // CreatedBy: to.Ptr("rowegentrpoajsv"), - // CreatedByType: to.Ptr(armcomputefleet.CreatedByTypeUser), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), - // LastModifiedBy: to.Ptr("edwuayhhaoepxzisfaqjhmrxjq"), - // LastModifiedByType: to.Ptr(armcomputefleet.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), - // }, - // }, - // } -} - -// Generated from example definition: 2024-11-01/Fleets_CreateOrUpdate_MinimumSet.json -func ExampleFleetsClient_BeginCreateOrUpdate_fleetsCreateOrUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputefleet.NewClientFactory("1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFleetsClient().BeginCreateOrUpdate(ctx, "rgazurefleet", "testFleet", armcomputefleet.Fleet{ - Properties: &armcomputefleet.FleetProperties{ - SpotPriorityProfile: &armcomputefleet.SpotPriorityProfile{ - Capacity: to.Ptr[int32](2), - MinCapacity: to.Ptr[int32](1), - EvictionPolicy: to.Ptr(armcomputefleet.EvictionPolicyDelete), - AllocationStrategy: to.Ptr(armcomputefleet.SpotAllocationStrategyPriceCapacityOptimized), - Maintain: to.Ptr(true), - }, - RegularPriorityProfile: &armcomputefleet.RegularPriorityProfile{ - Capacity: to.Ptr[int32](2), - MinCapacity: to.Ptr[int32](1), - AllocationStrategy: to.Ptr(armcomputefleet.RegularPriorityAllocationStrategyLowestPrice), - }, - VMSizesProfile: []*armcomputefleet.VMSizeProfile{ - { - Name: to.Ptr("Standard_D2s_v3"), - }, - { - Name: to.Ptr("Standard_D4s_v3"), - }, - { - Name: to.Ptr("Standard_E2s_v3"), - }, - }, - ComputeProfile: &armcomputefleet.ComputeProfile{ - BaseVirtualMachineProfile: &armcomputefleet.BaseVirtualMachineProfile{ - StorageProfile: &armcomputefleet.VirtualMachineScaleSetStorageProfile{ - ImageReference: &armcomputefleet.ImageReference{ - Publisher: to.Ptr("canonical"), - Offer: to.Ptr("0001-com-ubuntu-server-focal"), - SKU: to.Ptr("20_04-lts-gen2"), - Version: to.Ptr("latest"), - }, - OSDisk: &armcomputefleet.VirtualMachineScaleSetOSDisk{ - Caching: to.Ptr(armcomputefleet.CachingTypesReadWrite), - CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), - OSType: to.Ptr(armcomputefleet.OperatingSystemTypesLinux), - ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ - StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), - }, - }, - }, - OSProfile: &armcomputefleet.VirtualMachineScaleSetOSProfile{ - ComputerNamePrefix: to.Ptr("prefix"), - AdminUsername: to.Ptr("azureuser"), - AdminPassword: to.Ptr("TestPassword$0"), - LinuxConfiguration: &armcomputefleet.LinuxConfiguration{ - DisablePasswordAuthentication: to.Ptr(false), - }, - }, - NetworkProfile: &armcomputefleet.VirtualMachineScaleSetNetworkProfile{ - NetworkInterfaceConfigurations: []*armcomputefleet.VirtualMachineScaleSetNetworkConfiguration{ - { - Name: to.Ptr("vmNameTest"), - Properties: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationProperties{ - Primary: to.Ptr(true), - EnableAcceleratedNetworking: to.Ptr(false), - IPConfigurations: []*armcomputefleet.VirtualMachineScaleSetIPConfiguration{ - { - Name: to.Ptr("vmNameTest"), - Properties: &armcomputefleet.VirtualMachineScaleSetIPConfigurationProperties{ - Subnet: &armcomputefleet.APIEntityReference{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}"), - }, - Primary: to.Ptr(true), - LoadBalancerBackendAddressPools: []*armcomputefleet.SubResource{ - { - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}"), - }, - }, - }, - }, - }, - EnableIPForwarding: to.Ptr(true), - }, - }, - }, - }, - }, - ComputeAPIVersion: to.Ptr("2023-09-01"), - PlatformFaultDomainCount: to.Ptr[int32](1), - }, - }, - Tags: map[string]*string{ - "key": to.Ptr("fleets-test"), - }, - Location: to.Ptr("eastus2euap"), - }, 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 = armcomputefleet.FleetsClientCreateOrUpdateResponse{ - // Fleet: &armcomputefleet.Fleet{ - // Properties: &armcomputefleet.FleetProperties{ - // ProvisioningState: to.Ptr(armcomputefleet.ProvisioningStateSucceeded), - // SpotPriorityProfile: &armcomputefleet.SpotPriorityProfile{ - // Capacity: to.Ptr[int32](2), - // MinCapacity: to.Ptr[int32](1), - // EvictionPolicy: to.Ptr(armcomputefleet.EvictionPolicyDelete), - // AllocationStrategy: to.Ptr(armcomputefleet.SpotAllocationStrategyPriceCapacityOptimized), - // Maintain: to.Ptr(true), - // }, - // RegularPriorityProfile: &armcomputefleet.RegularPriorityProfile{ - // Capacity: to.Ptr[int32](2), - // MinCapacity: to.Ptr[int32](1), - // AllocationStrategy: to.Ptr(armcomputefleet.RegularPriorityAllocationStrategyLowestPrice), - // }, - // VMSizesProfile: []*armcomputefleet.VMSizeProfile{ - // { - // Name: to.Ptr("Standard_D2s_v3"), - // }, - // { - // Name: to.Ptr("Standard_D4s_v3"), - // }, - // { - // Name: to.Ptr("Standard_E2s_v3"), - // }, - // }, - // ComputeProfile: &armcomputefleet.ComputeProfile{ - // BaseVirtualMachineProfile: &armcomputefleet.BaseVirtualMachineProfile{ - // StorageProfile: &armcomputefleet.VirtualMachineScaleSetStorageProfile{ - // ImageReference: &armcomputefleet.ImageReference{ - // Publisher: to.Ptr("canonical"), - // Offer: to.Ptr("0001-com-ubuntu-server-focal"), - // SKU: to.Ptr("20_04-lts-gen2"), - // Version: to.Ptr("latest"), - // }, - // OSDisk: &armcomputefleet.VirtualMachineScaleSetOSDisk{ - // Caching: to.Ptr(armcomputefleet.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), - // OSType: to.Ptr(armcomputefleet.OperatingSystemTypesLinux), - // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), - // }, - // }, - // }, - // OSProfile: &armcomputefleet.VirtualMachineScaleSetOSProfile{ - // ComputerNamePrefix: to.Ptr("prefix"), - // AdminUsername: to.Ptr("azureuser"), - // LinuxConfiguration: &armcomputefleet.LinuxConfiguration{ - // DisablePasswordAuthentication: to.Ptr(false), - // }, - // }, - // NetworkProfile: &armcomputefleet.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcomputefleet.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("vmNameTest"), - // Properties: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationProperties{ - // Primary: to.Ptr(true), - // EnableAcceleratedNetworking: to.Ptr(false), - // IPConfigurations: []*armcomputefleet.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("vmNameTest"), - // Properties: &armcomputefleet.VirtualMachineScaleSetIPConfigurationProperties{ - // Subnet: &armcomputefleet.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}"), - // }, - // Primary: to.Ptr(true), - // LoadBalancerBackendAddressPools: []*armcomputefleet.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}"), - // }, - // }, - // }, - // }, - // }, - // EnableIPForwarding: to.Ptr(true), - // }, - // }, - // }, - // }, - // }, - // ComputeAPIVersion: to.Ptr("2023-09-01"), - // PlatformFaultDomainCount: to.Ptr[int32](1), - // }, - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-10T00:16:34.8590555+00:00"); return t}()), - // UniqueID: to.Ptr("a2f7fabd-bbc2-4a20-afe1-49fdb3885a28"), - // }, - // Tags: map[string]*string{ - // "key": to.Ptr("fleets-test"), - // }, - // Location: to.Ptr("eastus2euap"), - // ID: to.Ptr("/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/testFleet"), - // Name: to.Ptr("testFleet"), - // Type: to.Ptr("Microsoft.AzureFleet/fleets"), - // }, - // } -} - -// Generated from example definition: 2024-11-01/Fleets_Delete.json -func ExampleFleetsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputefleet.NewClientFactory("1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFleetsClient().BeginDelete(ctx, "rgazurefleet", "testFleet", 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: 2024-11-01/Fleets_Get.json -func ExampleFleetsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputefleet.NewClientFactory("1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFleetsClient().Get(ctx, "rgazurefleet", "testFleet", 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 = armcomputefleet.FleetsClientGetResponse{ - // Fleet: &armcomputefleet.Fleet{ - // Properties: &armcomputefleet.FleetProperties{ - // ProvisioningState: to.Ptr(armcomputefleet.ProvisioningStateCreating), - // SpotPriorityProfile: &armcomputefleet.SpotPriorityProfile{ - // Capacity: to.Ptr[int32](20), - // MinCapacity: to.Ptr[int32](10), - // MaxPricePerVM: to.Ptr[float32](0.00865), - // EvictionPolicy: to.Ptr(armcomputefleet.EvictionPolicyDelete), - // AllocationStrategy: to.Ptr(armcomputefleet.SpotAllocationStrategyPriceCapacityOptimized), - // Maintain: to.Ptr(true), - // }, - // RegularPriorityProfile: &armcomputefleet.RegularPriorityProfile{ - // Capacity: to.Ptr[int32](20), - // MinCapacity: to.Ptr[int32](10), - // AllocationStrategy: to.Ptr(armcomputefleet.RegularPriorityAllocationStrategyLowestPrice), - // }, - // VMSizesProfile: []*armcomputefleet.VMSizeProfile{ - // { - // Name: to.Ptr("Standard_d1_v2"), - // Rank: to.Ptr[int32](19225), - // }, - // }, - // ComputeProfile: &armcomputefleet.ComputeProfile{ - // BaseVirtualMachineProfile: &armcomputefleet.BaseVirtualMachineProfile{ - // OSProfile: &armcomputefleet.VirtualMachineScaleSetOSProfile{ - // ComputerNamePrefix: to.Ptr("o"), - // AdminUsername: to.Ptr("nrgzqciiaaxjrqldbmjbqkyhntp"), - // WindowsConfiguration: &armcomputefleet.WindowsConfiguration{ - // ProvisionVMAgent: to.Ptr(true), - // EnableAutomaticUpdates: to.Ptr(true), - // TimeZone: to.Ptr("hlyjiqcfksgrpjrct"), - // AdditionalUnattendContent: []*armcomputefleet.AdditionalUnattendContent{ - // { - // PassName: to.Ptr("OobeSystem"), - // ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), - // SettingName: to.Ptr(armcomputefleet.SettingNamesAutoLogon), - // }, - // }, - // PatchSettings: &armcomputefleet.PatchSettings{ - // PatchMode: to.Ptr(armcomputefleet.WindowsVMGuestPatchModeManual), - // EnableHotpatching: to.Ptr(true), - // AssessmentMode: to.Ptr(armcomputefleet.WindowsPatchAssessmentModeImageDefault), - // AutomaticByPlatformSettings: &armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformSettings{ - // RebootSetting: to.Ptr(armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown), - // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), - // }, - // }, - // WinRM: &armcomputefleet.WinRMConfiguration{ - // Listeners: []*armcomputefleet.WinRMListener{ - // { - // Protocol: to.Ptr(armcomputefleet.ProtocolTypesHTTP), - // CertificateURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/myCertName"), - // }, - // }, - // }, - // EnableVMAgentPlatformUpdates: to.Ptr(true), - // }, - // LinuxConfiguration: &armcomputefleet.LinuxConfiguration{ - // DisablePasswordAuthentication: to.Ptr(true), - // SSH: &armcomputefleet.SSHConfiguration{ - // PublicKeys: []*armcomputefleet.SSHPublicKey{ - // { - // Path: to.Ptr("kmqz"), - // KeyData: to.Ptr("kivgsubusvpprwqaqpjcmhsv"), - // }, - // }, - // }, - // ProvisionVMAgent: to.Ptr(true), - // PatchSettings: &armcomputefleet.LinuxPatchSettings{ - // PatchMode: to.Ptr(armcomputefleet.LinuxVMGuestPatchModeImageDefault), - // AssessmentMode: to.Ptr(armcomputefleet.LinuxPatchAssessmentModeImageDefault), - // AutomaticByPlatformSettings: &armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformSettings{ - // RebootSetting: to.Ptr(armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown), - // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), - // }, - // }, - // EnableVMAgentPlatformUpdates: to.Ptr(true), - // }, - // Secrets: []*armcomputefleet.VaultSecretGroup{ - // { - // SourceVault: &armcomputefleet.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), - // }, - // VaultCertificates: []*armcomputefleet.VaultCertificate{ - // { - // CertificateURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/myCertName"), - // CertificateStore: to.Ptr("nlxrwavpzhueffxsshlun"), - // }, - // }, - // }, - // }, - // AllowExtensionOperations: to.Ptr(true), - // RequireGuestProvisionSignal: to.Ptr(true), - // }, - // StorageProfile: &armcomputefleet.VirtualMachineScaleSetStorageProfile{ - // ImageReference: &armcomputefleet.ImageReference{ - // Publisher: to.Ptr("mqxgwbiyjzmxavhbkd"), - // Offer: to.Ptr("isxgumkarlkomp"), - // SKU: to.Ptr("eojmppqcrnpmxirtp"), - // Version: to.Ptr("wvpcqefgtmqdgltiuz"), - // ExactVersion: to.Ptr("zjbntmiskjexlr"), - // SharedGalleryImageID: to.Ptr("kmkgihoxwlawuuhcinfirktdwkmx"), - // CommunityGalleryImageID: to.Ptr("vlqe"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}"), - // }, - // OSDisk: &armcomputefleet.VirtualMachineScaleSetOSDisk{ - // Name: to.Ptr("wfttw"), - // Caching: to.Ptr(armcomputefleet.CachingTypesNone), - // WriteAcceleratorEnabled: to.Ptr(true), - // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), - // DiffDiskSettings: &armcomputefleet.DiffDiskSettings{ - // Option: to.Ptr(armcomputefleet.DiffDiskOptionsLocal), - // Placement: to.Ptr(armcomputefleet.DiffDiskPlacementCacheDisk), - // }, - // DiskSizeGB: to.Ptr[int32](14), - // OSType: to.Ptr(armcomputefleet.OperatingSystemTypesWindows), - // Image: &armcomputefleet.VirtualHardDisk{ - // URI: to.Ptr("https://myStorageAccountName.blob.core.windows.net/myContainerName/myVhdName.vhd"), - // }, - // VhdContainers: []*string{ - // to.Ptr("tkzcwddtinkfpnfklatw"), - // }, - // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), - // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), - // }, - // SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ - // SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), - // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), - // }, - // }, - // }, - // DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), - // }, - // DataDisks: []*armcomputefleet.VirtualMachineScaleSetDataDisk{ - // { - // Name: to.Ptr("eogiykmdmeikswxmigjws"), - // Lun: to.Ptr[int32](14), - // Caching: to.Ptr(armcomputefleet.CachingTypesNone), - // WriteAcceleratorEnabled: to.Ptr(true), - // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), - // DiskSizeGB: to.Ptr[int32](6), - // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), - // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), - // }, - // SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ - // SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), - // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), - // }, - // }, - // }, - // DiskIOPSReadWrite: to.Ptr[int64](27), - // DiskMBpsReadWrite: to.Ptr[int64](2), - // DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), - // }, - // }, - // }, - // NetworkProfile: &armcomputefleet.VirtualMachineScaleSetNetworkProfile{ - // HealthProbe: &armcomputefleet.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}"), - // }, - // NetworkInterfaceConfigurations: []*armcomputefleet.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("i"), - // Properties: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationProperties{ - // Primary: to.Ptr(true), - // EnableAcceleratedNetworking: to.Ptr(true), - // DisableTCPStateTracking: to.Ptr(true), - // EnableFpga: to.Ptr(true), - // NetworkSecurityGroup: &armcomputefleet.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"), - // }, - // DNSSettings: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // to.Ptr("nxmmfolhclsesu"), - // }, - // }, - // IPConfigurations: []*armcomputefleet.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("oezqhkidfhyywlfzwuotilrpbqnjg"), - // Properties: &armcomputefleet.VirtualMachineScaleSetIPConfigurationProperties{ - // Subnet: &armcomputefleet.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}"), - // }, - // Primary: to.Ptr(true), - // PublicIPAddressConfiguration: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfiguration{ - // Name: to.Ptr("fvpqf"), - // Properties: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ - // IdleTimeoutInMinutes: to.Ptr[int32](9), - // DNSSettings: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ - // DomainNameLabel: to.Ptr("ukrddzvmorpmfsczjwtbvp"), - // DomainNameLabelScope: to.Ptr(armcomputefleet.DomainNameLabelScopeTypesTenantReuse), - // }, - // IPTags: []*armcomputefleet.VirtualMachineScaleSetIPTag{ - // { - // IPTagType: to.Ptr("sddgsoemnzgqizale"), - // Tag: to.Ptr("wufmhrjsakbiaetyara"), - // }, - // }, - // PublicIPPrefix: &armcomputefleet.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}"), - // }, - // PublicIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), - // DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), - // }, - // SKU: &armcomputefleet.PublicIPAddressSKU{ - // Name: to.Ptr(armcomputefleet.PublicIPAddressSKUNameBasic), - // Tier: to.Ptr(armcomputefleet.PublicIPAddressSKUTierRegional), - // }, - // }, - // PrivateIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), - // ApplicationGatewayBackendAddressPools: []*armcomputefleet.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}"), - // }, - // }, - // ApplicationSecurityGroups: []*armcomputefleet.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}"), - // }, - // }, - // LoadBalancerBackendAddressPools: []*armcomputefleet.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}"), - // }, - // }, - // LoadBalancerInboundNatPools: []*armcomputefleet.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}"), - // }, - // }, - // }, - // }, - // }, - // EnableIPForwarding: to.Ptr(true), - // DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), - // AuxiliaryMode: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliaryModeNone), - // AuxiliarySKU: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliarySKUNone), - // }, - // }, - // }, - // NetworkAPIVersion: to.Ptr(armcomputefleet.NetworkAPIVersionV20201101), - // }, - // SecurityProfile: &armcomputefleet.SecurityProfile{ - // UefiSettings: &armcomputefleet.UefiSettings{ - // SecureBootEnabled: to.Ptr(true), - // VTpmEnabled: to.Ptr(true), - // }, - // EncryptionAtHost: to.Ptr(true), - // SecurityType: to.Ptr(armcomputefleet.SecurityTypesTrustedLaunch), - // EncryptionIdentity: &armcomputefleet.EncryptionIdentity{ - // UserAssignedIdentityResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}"), - // }, - // ProxyAgentSettings: &armcomputefleet.ProxyAgentSettings{ - // Enabled: to.Ptr(true), - // Mode: to.Ptr(armcomputefleet.ModeAudit), - // KeyIncarnationID: to.Ptr[int32](20), - // }, - // }, - // DiagnosticsProfile: &armcomputefleet.DiagnosticsProfile{ - // BootDiagnostics: &armcomputefleet.BootDiagnostics{ - // Enabled: to.Ptr(true), - // StorageURI: to.Ptr("http://myStorageAccountName.blob.core.windows.net"), - // }, - // }, - // ExtensionProfile: &armcomputefleet.VirtualMachineScaleSetExtensionProfile{ - // Extensions: []*armcomputefleet.VirtualMachineScaleSetExtension{ - // { - // Name: to.Ptr("bndxuxx"), - // Type: to.Ptr("cmeam"), - // Properties: &armcomputefleet.VirtualMachineScaleSetExtensionProperties{ - // ForceUpdateTag: to.Ptr("yhgxw"), - // Publisher: to.Ptr("kpxtirxjfprhs"), - // Type: to.Ptr("pgjilctjjwaa"), - // TypeHandlerVersion: to.Ptr("zevivcoilxmbwlrihhhibq"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // EnableAutomaticUpgrade: to.Ptr(true), - // Settings: map[string]any{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // ProvisionAfterExtensions: []*string{ - // to.Ptr("nftzosroolbcwmpupujzqwqe"), - // }, - // SuppressFailures: to.Ptr(true), - // ProtectedSettingsFromKeyVault: &armcomputefleet.KeyVaultSecretReference{ - // SecretURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/secret/mySecretName"), - // SourceVault: &armcomputefleet.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), - // }, - // }, - // }, - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{extensionName}"), - // }, - // }, - // ExtensionsTimeBudget: to.Ptr("mbhjahtdygwgyszdwjtvlvtgchdwil"), - // }, - // LicenseType: to.Ptr("v"), - // ScheduledEventsProfile: &armcomputefleet.ScheduledEventsProfile{ - // TerminateNotificationProfile: &armcomputefleet.TerminateNotificationProfile{ - // NotBeforeTimeout: to.Ptr("iljppmmw"), - // Enable: to.Ptr(true), - // }, - // OSImageNotificationProfile: &armcomputefleet.OSImageNotificationProfile{ - // NotBeforeTimeout: to.Ptr("olbpadmevekyczfokodtfprxti"), - // Enable: to.Ptr(true), - // }, - // }, - // UserData: to.Ptr("s"), - // CapacityReservation: &armcomputefleet.CapacityReservationProfile{ - // CapacityReservationGroup: &armcomputefleet.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"), - // }, - // }, - // ApplicationProfile: &armcomputefleet.ApplicationProfile{ - // GalleryApplications: []*armcomputefleet.VMGalleryApplication{ - // { - // Tags: to.Ptr("eyrqjbib"), - // Order: to.Ptr[int32](5), - // PackageReferenceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}"), - // TreatFailureAsDeploymentFailure: to.Ptr(true), - // EnableAutomaticUpgrade: to.Ptr(true), - // }, - // }, - // }, - // HardwareProfile: &armcomputefleet.VirtualMachineScaleSetHardwareProfile{ - // VMSizeProperties: &armcomputefleet.VMSizeProperties{ - // VCPUsAvailable: to.Ptr[int32](16), - // VCPUsPerCore: to.Ptr[int32](23), - // }, - // }, - // ServiceArtifactReference: &armcomputefleet.ServiceArtifactReference{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}"), - // }, - // SecurityPostureReference: &armcomputefleet.SecurityPostureReference{ - // ID: to.Ptr("mubredelfbshboaxrsxiajihahaa"), - // ExcludeExtensions: []*string{ - // to.Ptr("{securityPostureVMExtensionName}"), - // }, - // IsOverridable: to.Ptr(true), - // }, - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), - // }, - // ComputeAPIVersion: to.Ptr("2023-07-01"), - // PlatformFaultDomainCount: to.Ptr[int32](1), - // }, - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-10T00:16:34.8590555+00:00"); return t}()), - // UniqueID: to.Ptr("a2f7fabd-bbc2-4a20-afe1-49fdb3885a28"), - // }, - // Zones: []*string{ - // to.Ptr("zone1"), - // to.Ptr("zone2"), - // }, - // Identity: &armcomputefleet.ManagedServiceIdentity{ - // PrincipalID: to.Ptr("4d508e5b-374b-4382-9a1c-01fb8b6cb37c"), - // TenantID: to.Ptr("5d508e5b-374b-4382-9a1c-01fb8b6cb37c"), - // Type: to.Ptr(armcomputefleet.ManagedServiceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armcomputefleet.UserAssignedIdentity{ - // "key9851": &armcomputefleet.UserAssignedIdentity{ - // PrincipalID: to.Ptr("6d508e5b-374b-4382-9a1c-01fb8b6cb37c"), - // ClientID: to.Ptr("7d508e5b-374b-4382-9a1c-01fb8b6cb37c"), - // }, - // }, - // }, - // Tags: map[string]*string{ - // "key3518": to.Ptr("luvrnuvsgdpbuofdskkcoqhfh"), - // }, - // Plan: &armcomputefleet.Plan{ - // Name: to.Ptr("jwgrcrnrtfoxn"), - // Publisher: to.Ptr("iozjbiqqckqm"), - // Product: to.Ptr("cgopbyvdyqikahwyxfpzwaqk"), - // PromotionCode: to.Ptr("naglezezplcaruqogtxnuizslqnnbr"), - // Version: to.Ptr("wa"), - // }, - // Location: to.Ptr("westus"), - // ID: to.Ptr("/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/testFleet"), - // Name: to.Ptr("testFleet"), - // Type: to.Ptr("Microsoft.AzureFleet/fleets"), - // SystemData: &armcomputefleet.SystemData{ - // CreatedBy: to.Ptr("rowegentrpoajsv"), - // CreatedByType: to.Ptr(armcomputefleet.CreatedByTypeUser), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), - // LastModifiedBy: to.Ptr("edwuayhhaoepxzisfaqjhmrxjq"), - // LastModifiedByType: to.Ptr(armcomputefleet.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), - // }, - // }, - // } -} - -// Generated from example definition: 2024-11-01/Fleets_ListByResourceGroup.json -func ExampleFleetsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputefleet.NewClientFactory("1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFleetsClient().NewListByResourceGroupPager("rgazurefleet", 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 = armcomputefleet.FleetsClientListByResourceGroupResponse{ - // FleetListResult: armcomputefleet.FleetListResult{ - // Value: []*armcomputefleet.Fleet{ - // { - // Properties: &armcomputefleet.FleetProperties{ - // ProvisioningState: to.Ptr(armcomputefleet.ProvisioningStateCreating), - // SpotPriorityProfile: &armcomputefleet.SpotPriorityProfile{ - // Capacity: to.Ptr[int32](20), - // MinCapacity: to.Ptr[int32](10), - // MaxPricePerVM: to.Ptr[float32](0.00865), - // EvictionPolicy: to.Ptr(armcomputefleet.EvictionPolicyDelete), - // AllocationStrategy: to.Ptr(armcomputefleet.SpotAllocationStrategyPriceCapacityOptimized), - // Maintain: to.Ptr(true), - // }, - // RegularPriorityProfile: &armcomputefleet.RegularPriorityProfile{ - // Capacity: to.Ptr[int32](20), - // MinCapacity: to.Ptr[int32](10), - // AllocationStrategy: to.Ptr(armcomputefleet.RegularPriorityAllocationStrategyLowestPrice), - // }, - // VMSizesProfile: []*armcomputefleet.VMSizeProfile{ - // { - // Name: to.Ptr("Standard_d1_v2"), - // Rank: to.Ptr[int32](19225), - // }, - // }, - // ComputeProfile: &armcomputefleet.ComputeProfile{ - // BaseVirtualMachineProfile: &armcomputefleet.BaseVirtualMachineProfile{ - // OSProfile: &armcomputefleet.VirtualMachineScaleSetOSProfile{ - // ComputerNamePrefix: to.Ptr("o"), - // AdminUsername: to.Ptr("nrgzqciiaaxjrqldbmjbqkyhntp"), - // WindowsConfiguration: &armcomputefleet.WindowsConfiguration{ - // ProvisionVMAgent: to.Ptr(true), - // EnableAutomaticUpdates: to.Ptr(true), - // TimeZone: to.Ptr("hlyjiqcfksgrpjrct"), - // AdditionalUnattendContent: []*armcomputefleet.AdditionalUnattendContent{ - // { - // PassName: to.Ptr("OobeSystem"), - // ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), - // SettingName: to.Ptr(armcomputefleet.SettingNamesAutoLogon), - // }, - // }, - // PatchSettings: &armcomputefleet.PatchSettings{ - // PatchMode: to.Ptr(armcomputefleet.WindowsVMGuestPatchModeManual), - // EnableHotpatching: to.Ptr(true), - // AssessmentMode: to.Ptr(armcomputefleet.WindowsPatchAssessmentModeImageDefault), - // AutomaticByPlatformSettings: &armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformSettings{ - // RebootSetting: to.Ptr(armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown), - // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), - // }, - // }, - // WinRM: &armcomputefleet.WinRMConfiguration{ - // Listeners: []*armcomputefleet.WinRMListener{ - // { - // Protocol: to.Ptr(armcomputefleet.ProtocolTypesHTTP), - // CertificateURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/myCertName"), - // }, - // }, - // }, - // EnableVMAgentPlatformUpdates: to.Ptr(true), - // }, - // LinuxConfiguration: &armcomputefleet.LinuxConfiguration{ - // DisablePasswordAuthentication: to.Ptr(true), - // SSH: &armcomputefleet.SSHConfiguration{ - // PublicKeys: []*armcomputefleet.SSHPublicKey{ - // { - // Path: to.Ptr("kmqz"), - // KeyData: to.Ptr("kivgsubusvpprwqaqpjcmhsv"), - // }, - // }, - // }, - // ProvisionVMAgent: to.Ptr(true), - // PatchSettings: &armcomputefleet.LinuxPatchSettings{ - // PatchMode: to.Ptr(armcomputefleet.LinuxVMGuestPatchModeImageDefault), - // AssessmentMode: to.Ptr(armcomputefleet.LinuxPatchAssessmentModeImageDefault), - // AutomaticByPlatformSettings: &armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformSettings{ - // RebootSetting: to.Ptr(armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown), - // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), - // }, - // }, - // EnableVMAgentPlatformUpdates: to.Ptr(true), - // }, - // Secrets: []*armcomputefleet.VaultSecretGroup{ - // { - // SourceVault: &armcomputefleet.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), - // }, - // VaultCertificates: []*armcomputefleet.VaultCertificate{ - // { - // CertificateURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/myCertName"), - // CertificateStore: to.Ptr("nlxrwavpzhueffxsshlun"), - // }, - // }, - // }, - // }, - // AllowExtensionOperations: to.Ptr(true), - // RequireGuestProvisionSignal: to.Ptr(true), - // }, - // StorageProfile: &armcomputefleet.VirtualMachineScaleSetStorageProfile{ - // ImageReference: &armcomputefleet.ImageReference{ - // Publisher: to.Ptr("mqxgwbiyjzmxavhbkd"), - // Offer: to.Ptr("isxgumkarlkomp"), - // SKU: to.Ptr("eojmppqcrnpmxirtp"), - // Version: to.Ptr("wvpcqefgtmqdgltiuz"), - // ExactVersion: to.Ptr("zjbntmiskjexlr"), - // SharedGalleryImageID: to.Ptr("kmkgihoxwlawuuhcinfirktdwkmx"), - // CommunityGalleryImageID: to.Ptr("vlqe"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}"), - // }, - // OSDisk: &armcomputefleet.VirtualMachineScaleSetOSDisk{ - // Name: to.Ptr("wfttw"), - // Caching: to.Ptr(armcomputefleet.CachingTypesNone), - // WriteAcceleratorEnabled: to.Ptr(true), - // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), - // DiffDiskSettings: &armcomputefleet.DiffDiskSettings{ - // Option: to.Ptr(armcomputefleet.DiffDiskOptionsLocal), - // Placement: to.Ptr(armcomputefleet.DiffDiskPlacementCacheDisk), - // }, - // DiskSizeGB: to.Ptr[int32](14), - // OSType: to.Ptr(armcomputefleet.OperatingSystemTypesWindows), - // Image: &armcomputefleet.VirtualHardDisk{ - // URI: to.Ptr("https://myStorageAccountName.blob.core.windows.net/myContainerName/myVhdName.vhd"), - // }, - // VhdContainers: []*string{ - // to.Ptr("tkzcwddtinkfpnfklatw"), - // }, - // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), - // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), - // }, - // SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ - // SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), - // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), - // }, - // }, - // }, - // DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), - // }, - // DataDisks: []*armcomputefleet.VirtualMachineScaleSetDataDisk{ - // { - // Name: to.Ptr("eogiykmdmeikswxmigjws"), - // Lun: to.Ptr[int32](14), - // Caching: to.Ptr(armcomputefleet.CachingTypesNone), - // WriteAcceleratorEnabled: to.Ptr(true), - // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), - // DiskSizeGB: to.Ptr[int32](6), - // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), - // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), - // }, - // SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ - // SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), - // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), - // }, - // }, - // }, - // DiskIOPSReadWrite: to.Ptr[int64](27), - // DiskMBpsReadWrite: to.Ptr[int64](2), - // DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), - // }, - // }, - // }, - // NetworkProfile: &armcomputefleet.VirtualMachineScaleSetNetworkProfile{ - // HealthProbe: &armcomputefleet.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}"), - // }, - // NetworkInterfaceConfigurations: []*armcomputefleet.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("i"), - // Properties: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationProperties{ - // Primary: to.Ptr(true), - // EnableAcceleratedNetworking: to.Ptr(true), - // DisableTCPStateTracking: to.Ptr(true), - // EnableFpga: to.Ptr(true), - // NetworkSecurityGroup: &armcomputefleet.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"), - // }, - // DNSSettings: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // to.Ptr("nxmmfolhclsesu"), - // }, - // }, - // IPConfigurations: []*armcomputefleet.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("oezqhkidfhyywlfzwuotilrpbqnjg"), - // Properties: &armcomputefleet.VirtualMachineScaleSetIPConfigurationProperties{ - // Subnet: &armcomputefleet.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}"), - // }, - // Primary: to.Ptr(true), - // PublicIPAddressConfiguration: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfiguration{ - // Name: to.Ptr("fvpqf"), - // Properties: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ - // IdleTimeoutInMinutes: to.Ptr[int32](9), - // DNSSettings: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ - // DomainNameLabel: to.Ptr("ukrddzvmorpmfsczjwtbvp"), - // DomainNameLabelScope: to.Ptr(armcomputefleet.DomainNameLabelScopeTypesTenantReuse), - // }, - // IPTags: []*armcomputefleet.VirtualMachineScaleSetIPTag{ - // { - // IPTagType: to.Ptr("sddgsoemnzgqizale"), - // Tag: to.Ptr("wufmhrjsakbiaetyara"), - // }, - // }, - // PublicIPPrefix: &armcomputefleet.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}"), - // }, - // PublicIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), - // DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), - // }, - // SKU: &armcomputefleet.PublicIPAddressSKU{ - // Name: to.Ptr(armcomputefleet.PublicIPAddressSKUNameBasic), - // Tier: to.Ptr(armcomputefleet.PublicIPAddressSKUTierRegional), - // }, - // }, - // PrivateIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), - // ApplicationGatewayBackendAddressPools: []*armcomputefleet.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}"), - // }, - // }, - // ApplicationSecurityGroups: []*armcomputefleet.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}"), - // }, - // }, - // LoadBalancerBackendAddressPools: []*armcomputefleet.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}"), - // }, - // }, - // LoadBalancerInboundNatPools: []*armcomputefleet.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}"), - // }, - // }, - // }, - // }, - // }, - // EnableIPForwarding: to.Ptr(true), - // DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), - // AuxiliaryMode: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliaryModeNone), - // AuxiliarySKU: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliarySKUNone), - // }, - // }, - // }, - // NetworkAPIVersion: to.Ptr(armcomputefleet.NetworkAPIVersionV20201101), - // }, - // SecurityProfile: &armcomputefleet.SecurityProfile{ - // UefiSettings: &armcomputefleet.UefiSettings{ - // SecureBootEnabled: to.Ptr(true), - // VTpmEnabled: to.Ptr(true), - // }, - // EncryptionAtHost: to.Ptr(true), - // SecurityType: to.Ptr(armcomputefleet.SecurityTypesTrustedLaunch), - // EncryptionIdentity: &armcomputefleet.EncryptionIdentity{ - // UserAssignedIdentityResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}"), - // }, - // ProxyAgentSettings: &armcomputefleet.ProxyAgentSettings{ - // Enabled: to.Ptr(true), - // Mode: to.Ptr(armcomputefleet.ModeAudit), - // KeyIncarnationID: to.Ptr[int32](20), - // }, - // }, - // DiagnosticsProfile: &armcomputefleet.DiagnosticsProfile{ - // BootDiagnostics: &armcomputefleet.BootDiagnostics{ - // Enabled: to.Ptr(true), - // StorageURI: to.Ptr("http://myStorageAccountName.blob.core.windows.net"), - // }, - // }, - // ExtensionProfile: &armcomputefleet.VirtualMachineScaleSetExtensionProfile{ - // Extensions: []*armcomputefleet.VirtualMachineScaleSetExtension{ - // { - // Name: to.Ptr("bndxuxx"), - // Type: to.Ptr("cmeam"), - // Properties: &armcomputefleet.VirtualMachineScaleSetExtensionProperties{ - // ForceUpdateTag: to.Ptr("yhgxw"), - // Publisher: to.Ptr("kpxtirxjfprhs"), - // Type: to.Ptr("pgjilctjjwaa"), - // TypeHandlerVersion: to.Ptr("zevivcoilxmbwlrihhhibq"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // EnableAutomaticUpgrade: to.Ptr(true), - // Settings: map[string]any{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // ProvisionAfterExtensions: []*string{ - // to.Ptr("nftzosroolbcwmpupujzqwqe"), - // }, - // SuppressFailures: to.Ptr(true), - // ProtectedSettingsFromKeyVault: &armcomputefleet.KeyVaultSecretReference{ - // SecretURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/secret/mySecretName"), - // SourceVault: &armcomputefleet.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), - // }, - // }, - // }, - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{extensionName}"), - // }, - // }, - // ExtensionsTimeBudget: to.Ptr("mbhjahtdygwgyszdwjtvlvtgchdwil"), - // }, - // LicenseType: to.Ptr("v"), - // ScheduledEventsProfile: &armcomputefleet.ScheduledEventsProfile{ - // TerminateNotificationProfile: &armcomputefleet.TerminateNotificationProfile{ - // NotBeforeTimeout: to.Ptr("iljppmmw"), - // Enable: to.Ptr(true), - // }, - // OSImageNotificationProfile: &armcomputefleet.OSImageNotificationProfile{ - // NotBeforeTimeout: to.Ptr("olbpadmevekyczfokodtfprxti"), - // Enable: to.Ptr(true), - // }, - // }, - // UserData: to.Ptr("s"), - // CapacityReservation: &armcomputefleet.CapacityReservationProfile{ - // CapacityReservationGroup: &armcomputefleet.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"), - // }, - // }, - // ApplicationProfile: &armcomputefleet.ApplicationProfile{ - // GalleryApplications: []*armcomputefleet.VMGalleryApplication{ - // { - // Tags: to.Ptr("eyrqjbib"), - // Order: to.Ptr[int32](5), - // PackageReferenceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}"), - // TreatFailureAsDeploymentFailure: to.Ptr(true), - // EnableAutomaticUpgrade: to.Ptr(true), - // }, - // }, - // }, - // HardwareProfile: &armcomputefleet.VirtualMachineScaleSetHardwareProfile{ - // VMSizeProperties: &armcomputefleet.VMSizeProperties{ - // VCPUsAvailable: to.Ptr[int32](16), - // VCPUsPerCore: to.Ptr[int32](23), - // }, - // }, - // ServiceArtifactReference: &armcomputefleet.ServiceArtifactReference{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}"), - // }, - // SecurityPostureReference: &armcomputefleet.SecurityPostureReference{ - // ID: to.Ptr("mubredelfbshboaxrsxiajihahaa"), - // ExcludeExtensions: []*string{ - // to.Ptr("{securityPostureVMExtensionName}"), - // }, - // IsOverridable: to.Ptr(true), - // }, - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), - // }, - // ComputeAPIVersion: to.Ptr("2023-07-01"), - // PlatformFaultDomainCount: to.Ptr[int32](1), - // }, - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-10T00:16:34.8590555+00:00"); return t}()), - // UniqueID: to.Ptr("a2f7fabd-bbc2-4a20-afe1-49fdb3885a28"), - // }, - // Zones: []*string{ - // to.Ptr("zone1"), - // to.Ptr("zone2"), - // }, - // Identity: &armcomputefleet.ManagedServiceIdentity{ - // PrincipalID: to.Ptr("4d508e5b-374b-4382-9a1c-01fb8b6cb37c"), - // TenantID: to.Ptr("5d508e5b-374b-4382-9a1c-01fb8b6cb37c"), - // Type: to.Ptr(armcomputefleet.ManagedServiceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armcomputefleet.UserAssignedIdentity{ - // "key9851": &armcomputefleet.UserAssignedIdentity{ - // PrincipalID: to.Ptr("6d508e5b-374b-4382-9a1c-01fb8b6cb37c"), - // ClientID: to.Ptr("7d508e5b-374b-4382-9a1c-01fb8b6cb37c"), - // }, - // }, - // }, - // Plan: &armcomputefleet.Plan{ - // Name: to.Ptr("jwgrcrnrtfoxn"), - // Publisher: to.Ptr("iozjbiqqckqm"), - // Product: to.Ptr("cgopbyvdyqikahwyxfpzwaqk"), - // PromotionCode: to.Ptr("naglezezplcaruqogtxnuizslqnnbr"), - // Version: to.Ptr("wa"), - // }, - // Tags: map[string]*string{ - // "key3518": to.Ptr("luvrnuvsgdpbuofdskkcoqhfh"), - // }, - // Location: to.Ptr("westus"), - // ID: to.Ptr("/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/testFleet"), - // Name: to.Ptr("testFleet"), - // Type: to.Ptr("Microsoft.AzureFleet/fleets"), - // SystemData: &armcomputefleet.SystemData{ - // CreatedBy: to.Ptr("rowegentrpoajsv"), - // CreatedByType: to.Ptr(armcomputefleet.CreatedByTypeUser), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), - // LastModifiedBy: to.Ptr("edwuayhhaoepxzisfaqjhmrxjq"), - // LastModifiedByType: to.Ptr(armcomputefleet.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), - // }, - // }, - // }, - // NextLink: to.Ptr("https://microsoft.com/a"), - // }, - // } - } -} - -// Generated from example definition: 2024-11-01/Fleets_ListBySubscription.json -func ExampleFleetsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputefleet.NewClientFactory("1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFleetsClient().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 = armcomputefleet.FleetsClientListBySubscriptionResponse{ - // FleetListResult: armcomputefleet.FleetListResult{ - // Value: []*armcomputefleet.Fleet{ - // { - // Properties: &armcomputefleet.FleetProperties{ - // ProvisioningState: to.Ptr(armcomputefleet.ProvisioningStateCreating), - // SpotPriorityProfile: &armcomputefleet.SpotPriorityProfile{ - // Capacity: to.Ptr[int32](20), - // MinCapacity: to.Ptr[int32](10), - // MaxPricePerVM: to.Ptr[float32](0.00865), - // EvictionPolicy: to.Ptr(armcomputefleet.EvictionPolicyDelete), - // AllocationStrategy: to.Ptr(armcomputefleet.SpotAllocationStrategyPriceCapacityOptimized), - // Maintain: to.Ptr(true), - // }, - // RegularPriorityProfile: &armcomputefleet.RegularPriorityProfile{ - // Capacity: to.Ptr[int32](20), - // MinCapacity: to.Ptr[int32](10), - // AllocationStrategy: to.Ptr(armcomputefleet.RegularPriorityAllocationStrategyLowestPrice), - // }, - // VMSizesProfile: []*armcomputefleet.VMSizeProfile{ - // { - // Name: to.Ptr("Standard_d1_v2"), - // Rank: to.Ptr[int32](19225), - // }, - // }, - // ComputeProfile: &armcomputefleet.ComputeProfile{ - // BaseVirtualMachineProfile: &armcomputefleet.BaseVirtualMachineProfile{ - // OSProfile: &armcomputefleet.VirtualMachineScaleSetOSProfile{ - // ComputerNamePrefix: to.Ptr("o"), - // AdminUsername: to.Ptr("nrgzqciiaaxjrqldbmjbqkyhntp"), - // WindowsConfiguration: &armcomputefleet.WindowsConfiguration{ - // ProvisionVMAgent: to.Ptr(true), - // EnableAutomaticUpdates: to.Ptr(true), - // TimeZone: to.Ptr("hlyjiqcfksgrpjrct"), - // AdditionalUnattendContent: []*armcomputefleet.AdditionalUnattendContent{ - // { - // PassName: to.Ptr("OobeSystem"), - // ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), - // SettingName: to.Ptr(armcomputefleet.SettingNamesAutoLogon), - // }, - // }, - // PatchSettings: &armcomputefleet.PatchSettings{ - // PatchMode: to.Ptr(armcomputefleet.WindowsVMGuestPatchModeManual), - // EnableHotpatching: to.Ptr(true), - // AssessmentMode: to.Ptr(armcomputefleet.WindowsPatchAssessmentModeImageDefault), - // AutomaticByPlatformSettings: &armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformSettings{ - // RebootSetting: to.Ptr(armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown), - // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), - // }, - // }, - // WinRM: &armcomputefleet.WinRMConfiguration{ - // Listeners: []*armcomputefleet.WinRMListener{ - // { - // Protocol: to.Ptr(armcomputefleet.ProtocolTypesHTTP), - // CertificateURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/myCertName"), - // }, - // }, - // }, - // EnableVMAgentPlatformUpdates: to.Ptr(true), - // }, - // LinuxConfiguration: &armcomputefleet.LinuxConfiguration{ - // DisablePasswordAuthentication: to.Ptr(true), - // SSH: &armcomputefleet.SSHConfiguration{ - // PublicKeys: []*armcomputefleet.SSHPublicKey{ - // { - // Path: to.Ptr("kmqz"), - // KeyData: to.Ptr("kivgsubusvpprwqaqpjcmhsv"), - // }, - // }, - // }, - // ProvisionVMAgent: to.Ptr(true), - // PatchSettings: &armcomputefleet.LinuxPatchSettings{ - // PatchMode: to.Ptr(armcomputefleet.LinuxVMGuestPatchModeImageDefault), - // AssessmentMode: to.Ptr(armcomputefleet.LinuxPatchAssessmentModeImageDefault), - // AutomaticByPlatformSettings: &armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformSettings{ - // RebootSetting: to.Ptr(armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown), - // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), - // }, - // }, - // EnableVMAgentPlatformUpdates: to.Ptr(true), - // }, - // Secrets: []*armcomputefleet.VaultSecretGroup{ - // { - // SourceVault: &armcomputefleet.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), - // }, - // VaultCertificates: []*armcomputefleet.VaultCertificate{ - // { - // CertificateURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/myCertName"), - // CertificateStore: to.Ptr("nlxrwavpzhueffxsshlun"), - // }, - // }, - // }, - // }, - // AllowExtensionOperations: to.Ptr(true), - // RequireGuestProvisionSignal: to.Ptr(true), - // }, - // StorageProfile: &armcomputefleet.VirtualMachineScaleSetStorageProfile{ - // ImageReference: &armcomputefleet.ImageReference{ - // Publisher: to.Ptr("mqxgwbiyjzmxavhbkd"), - // Offer: to.Ptr("isxgumkarlkomp"), - // SKU: to.Ptr("eojmppqcrnpmxirtp"), - // Version: to.Ptr("wvpcqefgtmqdgltiuz"), - // ExactVersion: to.Ptr("zjbntmiskjexlr"), - // SharedGalleryImageID: to.Ptr("kmkgihoxwlawuuhcinfirktdwkmx"), - // CommunityGalleryImageID: to.Ptr("vlqe"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}"), - // }, - // OSDisk: &armcomputefleet.VirtualMachineScaleSetOSDisk{ - // Name: to.Ptr("wfttw"), - // Caching: to.Ptr(armcomputefleet.CachingTypesNone), - // WriteAcceleratorEnabled: to.Ptr(true), - // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), - // DiffDiskSettings: &armcomputefleet.DiffDiskSettings{ - // Option: to.Ptr(armcomputefleet.DiffDiskOptionsLocal), - // Placement: to.Ptr(armcomputefleet.DiffDiskPlacementCacheDisk), - // }, - // DiskSizeGB: to.Ptr[int32](14), - // OSType: to.Ptr(armcomputefleet.OperatingSystemTypesWindows), - // Image: &armcomputefleet.VirtualHardDisk{ - // URI: to.Ptr("https://myStorageAccountName.blob.core.windows.net/myContainerName/myVhdName.vhd"), - // }, - // VhdContainers: []*string{ - // to.Ptr("tkzcwddtinkfpnfklatw"), - // }, - // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), - // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), - // }, - // SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ - // SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), - // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), - // }, - // }, - // }, - // DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), - // }, - // DataDisks: []*armcomputefleet.VirtualMachineScaleSetDataDisk{ - // { - // Name: to.Ptr("eogiykmdmeikswxmigjws"), - // Lun: to.Ptr[int32](14), - // Caching: to.Ptr(armcomputefleet.CachingTypesNone), - // WriteAcceleratorEnabled: to.Ptr(true), - // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), - // DiskSizeGB: to.Ptr[int32](6), - // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), - // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), - // }, - // SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ - // SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), - // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), - // }, - // }, - // }, - // DiskIOPSReadWrite: to.Ptr[int64](27), - // DiskMBpsReadWrite: to.Ptr[int64](2), - // DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), - // }, - // }, - // }, - // NetworkProfile: &armcomputefleet.VirtualMachineScaleSetNetworkProfile{ - // HealthProbe: &armcomputefleet.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}"), - // }, - // NetworkInterfaceConfigurations: []*armcomputefleet.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("i"), - // Properties: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationProperties{ - // Primary: to.Ptr(true), - // EnableAcceleratedNetworking: to.Ptr(true), - // DisableTCPStateTracking: to.Ptr(true), - // EnableFpga: to.Ptr(true), - // NetworkSecurityGroup: &armcomputefleet.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"), - // }, - // DNSSettings: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // to.Ptr("nxmmfolhclsesu"), - // }, - // }, - // IPConfigurations: []*armcomputefleet.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("oezqhkidfhyywlfzwuotilrpbqnjg"), - // Properties: &armcomputefleet.VirtualMachineScaleSetIPConfigurationProperties{ - // Subnet: &armcomputefleet.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}"), - // }, - // Primary: to.Ptr(true), - // PublicIPAddressConfiguration: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfiguration{ - // Name: to.Ptr("fvpqf"), - // Properties: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ - // IdleTimeoutInMinutes: to.Ptr[int32](9), - // DNSSettings: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ - // DomainNameLabel: to.Ptr("ukrddzvmorpmfsczjwtbvp"), - // DomainNameLabelScope: to.Ptr(armcomputefleet.DomainNameLabelScopeTypesTenantReuse), - // }, - // IPTags: []*armcomputefleet.VirtualMachineScaleSetIPTag{ - // { - // IPTagType: to.Ptr("sddgsoemnzgqizale"), - // Tag: to.Ptr("wufmhrjsakbiaetyara"), - // }, - // }, - // PublicIPPrefix: &armcomputefleet.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}"), - // }, - // PublicIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), - // DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), - // }, - // SKU: &armcomputefleet.PublicIPAddressSKU{ - // Name: to.Ptr(armcomputefleet.PublicIPAddressSKUNameBasic), - // Tier: to.Ptr(armcomputefleet.PublicIPAddressSKUTierRegional), - // }, - // }, - // PrivateIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), - // ApplicationGatewayBackendAddressPools: []*armcomputefleet.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}"), - // }, - // }, - // ApplicationSecurityGroups: []*armcomputefleet.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}"), - // }, - // }, - // LoadBalancerBackendAddressPools: []*armcomputefleet.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}"), - // }, - // }, - // LoadBalancerInboundNatPools: []*armcomputefleet.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}"), - // }, - // }, - // }, - // }, - // }, - // EnableIPForwarding: to.Ptr(true), - // DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), - // AuxiliaryMode: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliaryModeNone), - // AuxiliarySKU: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliarySKUNone), - // }, - // }, - // }, - // NetworkAPIVersion: to.Ptr(armcomputefleet.NetworkAPIVersionV20201101), - // }, - // SecurityProfile: &armcomputefleet.SecurityProfile{ - // UefiSettings: &armcomputefleet.UefiSettings{ - // SecureBootEnabled: to.Ptr(true), - // VTpmEnabled: to.Ptr(true), - // }, - // EncryptionAtHost: to.Ptr(true), - // SecurityType: to.Ptr(armcomputefleet.SecurityTypesTrustedLaunch), - // EncryptionIdentity: &armcomputefleet.EncryptionIdentity{ - // UserAssignedIdentityResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}"), - // }, - // ProxyAgentSettings: &armcomputefleet.ProxyAgentSettings{ - // Enabled: to.Ptr(true), - // Mode: to.Ptr(armcomputefleet.ModeAudit), - // KeyIncarnationID: to.Ptr[int32](20), - // }, - // }, - // DiagnosticsProfile: &armcomputefleet.DiagnosticsProfile{ - // BootDiagnostics: &armcomputefleet.BootDiagnostics{ - // Enabled: to.Ptr(true), - // StorageURI: to.Ptr("http://myStorageAccountName.blob.core.windows.net"), - // }, - // }, - // ExtensionProfile: &armcomputefleet.VirtualMachineScaleSetExtensionProfile{ - // Extensions: []*armcomputefleet.VirtualMachineScaleSetExtension{ - // { - // Name: to.Ptr("bndxuxx"), - // Type: to.Ptr("cmeam"), - // Properties: &armcomputefleet.VirtualMachineScaleSetExtensionProperties{ - // ForceUpdateTag: to.Ptr("yhgxw"), - // Publisher: to.Ptr("kpxtirxjfprhs"), - // Type: to.Ptr("pgjilctjjwaa"), - // TypeHandlerVersion: to.Ptr("zevivcoilxmbwlrihhhibq"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // EnableAutomaticUpgrade: to.Ptr(true), - // Settings: map[string]any{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // ProvisionAfterExtensions: []*string{ - // to.Ptr("nftzosroolbcwmpupujzqwqe"), - // }, - // SuppressFailures: to.Ptr(true), - // ProtectedSettingsFromKeyVault: &armcomputefleet.KeyVaultSecretReference{ - // SecretURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/secret/mySecretName"), - // SourceVault: &armcomputefleet.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), - // }, - // }, - // }, - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{extensionName}"), - // }, - // }, - // ExtensionsTimeBudget: to.Ptr("mbhjahtdygwgyszdwjtvlvtgchdwil"), - // }, - // LicenseType: to.Ptr("v"), - // ScheduledEventsProfile: &armcomputefleet.ScheduledEventsProfile{ - // TerminateNotificationProfile: &armcomputefleet.TerminateNotificationProfile{ - // NotBeforeTimeout: to.Ptr("iljppmmw"), - // Enable: to.Ptr(true), - // }, - // OSImageNotificationProfile: &armcomputefleet.OSImageNotificationProfile{ - // NotBeforeTimeout: to.Ptr("olbpadmevekyczfokodtfprxti"), - // Enable: to.Ptr(true), - // }, - // }, - // UserData: to.Ptr("s"), - // CapacityReservation: &armcomputefleet.CapacityReservationProfile{ - // CapacityReservationGroup: &armcomputefleet.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"), - // }, - // }, - // ApplicationProfile: &armcomputefleet.ApplicationProfile{ - // GalleryApplications: []*armcomputefleet.VMGalleryApplication{ - // { - // Tags: to.Ptr("eyrqjbib"), - // Order: to.Ptr[int32](5), - // PackageReferenceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}"), - // TreatFailureAsDeploymentFailure: to.Ptr(true), - // EnableAutomaticUpgrade: to.Ptr(true), - // }, - // }, - // }, - // HardwareProfile: &armcomputefleet.VirtualMachineScaleSetHardwareProfile{ - // VMSizeProperties: &armcomputefleet.VMSizeProperties{ - // VCPUsAvailable: to.Ptr[int32](16), - // VCPUsPerCore: to.Ptr[int32](23), - // }, - // }, - // ServiceArtifactReference: &armcomputefleet.ServiceArtifactReference{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}"), - // }, - // SecurityPostureReference: &armcomputefleet.SecurityPostureReference{ - // ID: to.Ptr("mubredelfbshboaxrsxiajihahaa"), - // ExcludeExtensions: []*string{ - // to.Ptr("{securityPostureVMExtensionName}"), - // }, - // IsOverridable: to.Ptr(true), - // }, - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), - // }, - // ComputeAPIVersion: to.Ptr("2023-07-01"), - // PlatformFaultDomainCount: to.Ptr[int32](1), - // }, - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-10T00:16:34.8590555+00:00"); return t}()), - // UniqueID: to.Ptr("a2f7fabd-bbc2-4a20-afe1-49fdb3885a28"), - // }, - // Zones: []*string{ - // to.Ptr("zone1"), - // to.Ptr("zone2"), - // }, - // Identity: &armcomputefleet.ManagedServiceIdentity{ - // PrincipalID: to.Ptr("4d508e5b-374b-4382-9a1c-01fb8b6cb37c"), - // TenantID: to.Ptr("5d508e5b-374b-4382-9a1c-01fb8b6cb37c"), - // Type: to.Ptr(armcomputefleet.ManagedServiceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armcomputefleet.UserAssignedIdentity{ - // "key9851": &armcomputefleet.UserAssignedIdentity{ - // PrincipalID: to.Ptr("6d508e5b-374b-4382-9a1c-01fb8b6cb37c"), - // ClientID: to.Ptr("7d508e5b-374b-4382-9a1c-01fb8b6cb37c"), - // }, - // }, - // }, - // Plan: &armcomputefleet.Plan{ - // Name: to.Ptr("jwgrcrnrtfoxn"), - // Publisher: to.Ptr("iozjbiqqckqm"), - // Product: to.Ptr("cgopbyvdyqikahwyxfpzwaqk"), - // PromotionCode: to.Ptr("naglezezplcaruqogtxnuizslqnnbr"), - // Version: to.Ptr("wa"), - // }, - // Tags: map[string]*string{ - // "key3518": to.Ptr("luvrnuvsgdpbuofdskkcoqhfh"), - // }, - // Location: to.Ptr("westus"), - // ID: to.Ptr("/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/testFleet"), - // Name: to.Ptr("testFleet"), - // Type: to.Ptr("Microsoft.AzureFleet/fleets"), - // SystemData: &armcomputefleet.SystemData{ - // CreatedBy: to.Ptr("rowegentrpoajsv"), - // CreatedByType: to.Ptr(armcomputefleet.CreatedByTypeUser), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), - // LastModifiedBy: to.Ptr("edwuayhhaoepxzisfaqjhmrxjq"), - // LastModifiedByType: to.Ptr(armcomputefleet.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), - // }, - // }, - // }, - // NextLink: to.Ptr("https://microsoft.com/a"), - // }, - // } - } -} - -// Generated from example definition: 2024-11-01/Fleets_ListVirtualMachineScaleSets.json -func ExampleFleetsClient_NewListVirtualMachineScaleSetsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputefleet.NewClientFactory("1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFleetsClient().NewListVirtualMachineScaleSetsPager("rgazurefleet", "myFleet", 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 = armcomputefleet.FleetsClientListVirtualMachineScaleSetsResponse{ - // VirtualMachineScaleSetListResult: armcomputefleet.VirtualMachineScaleSetListResult{ - // Value: []*armcomputefleet.VirtualMachineScaleSet{ - // { - // Name: to.Ptr("myVmss"), - // ID: to.Ptr("/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/myFleet/virtualMachineScaleSets/myVmss"), - // Type: to.Ptr("Microsoft.AzureFleet/fleets/virtualMachineScaleSets"), - // OperationStatus: to.Ptr(armcomputefleet.ProvisioningStateCreating), - // Error: &armcomputefleet.APIError{ - // Details: []*armcomputefleet.APIErrorBase{ - // { - // Code: to.Ptr("gzhtOverconstrainedAllocationRequestyosk"), - // Target: to.Ptr("qfthabhrmndhfizfnrwpgxvnokpy"), - // Message: to.Ptr("Allocation Failed"), - // }, - // }, - // Innererror: &armcomputefleet.InnerError{ - // ExceptionType: to.Ptr("sfaomfpoaptnbxchrfskm"), - // ErrorDetail: to.Ptr("ihjwbwykq"), - // }, - // Code: to.Ptr("OverconstrainedAllocationRequest"), - // Target: to.Ptr("nhaj"), - // Message: to.Ptr("Allocation Failed"), - // }, - // }, - // }, - // }, - // } - } -} - -// Generated from example definition: 2024-11-01/Fleets_Update.json -func ExampleFleetsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputefleet.NewClientFactory("1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFleetsClient().BeginUpdate(ctx, "rgazurefleet", "testFleet", armcomputefleet.FleetUpdate{ - Identity: &armcomputefleet.ManagedServiceIdentityUpdate{ - Type: to.Ptr(armcomputefleet.ManagedServiceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armcomputefleet.UserAssignedIdentity{}, - }, - Tags: map[string]*string{}, - Properties: &armcomputefleet.FleetProperties{ - SpotPriorityProfile: &armcomputefleet.SpotPriorityProfile{ - Capacity: to.Ptr[int32](20), - MinCapacity: to.Ptr[int32](10), - MaxPricePerVM: to.Ptr[float32](0.00865), - EvictionPolicy: to.Ptr(armcomputefleet.EvictionPolicyDelete), - AllocationStrategy: to.Ptr(armcomputefleet.SpotAllocationStrategyPriceCapacityOptimized), - Maintain: to.Ptr(true), - }, - RegularPriorityProfile: &armcomputefleet.RegularPriorityProfile{ - Capacity: to.Ptr[int32](20), - MinCapacity: to.Ptr[int32](10), - AllocationStrategy: to.Ptr(armcomputefleet.RegularPriorityAllocationStrategyLowestPrice), - }, - VMSizesProfile: []*armcomputefleet.VMSizeProfile{ - { - Name: to.Ptr("Standard_d1_v2"), - Rank: to.Ptr[int32](19225), - }, - }, - ComputeProfile: &armcomputefleet.ComputeProfile{ - BaseVirtualMachineProfile: &armcomputefleet.BaseVirtualMachineProfile{ - OSProfile: &armcomputefleet.VirtualMachineScaleSetOSProfile{ - ComputerNamePrefix: to.Ptr("o"), - AdminUsername: to.Ptr("nrgzqciiaaxjrqldbmjbqkyhntp"), - AdminPassword: to.Ptr("adfbrdxpv"), - CustomData: to.Ptr("xjjib"), - WindowsConfiguration: &armcomputefleet.WindowsConfiguration{ - ProvisionVMAgent: to.Ptr(true), - EnableAutomaticUpdates: to.Ptr(true), - TimeZone: to.Ptr("hlyjiqcfksgrpjrct"), - AdditionalUnattendContent: []*armcomputefleet.AdditionalUnattendContent{ - { - PassName: to.Ptr("OobeSystem"), - ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), - SettingName: to.Ptr(armcomputefleet.SettingNamesAutoLogon), - Content: to.Ptr("bubmqbxjkj"), - }, - }, - PatchSettings: &armcomputefleet.PatchSettings{ - PatchMode: to.Ptr(armcomputefleet.WindowsVMGuestPatchModeManual), - EnableHotpatching: to.Ptr(true), - AssessmentMode: to.Ptr(armcomputefleet.WindowsPatchAssessmentModeImageDefault), - AutomaticByPlatformSettings: &armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformSettings{ - RebootSetting: to.Ptr(armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown), - BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), - }, - }, - WinRM: &armcomputefleet.WinRMConfiguration{ - Listeners: []*armcomputefleet.WinRMListener{ - { - Protocol: to.Ptr(armcomputefleet.ProtocolTypesHTTP), - CertificateURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/myCertName"), - }, - }, - }, - EnableVMAgentPlatformUpdates: to.Ptr(true), - }, - LinuxConfiguration: &armcomputefleet.LinuxConfiguration{ - DisablePasswordAuthentication: to.Ptr(true), - SSH: &armcomputefleet.SSHConfiguration{ - PublicKeys: []*armcomputefleet.SSHPublicKey{ - { - Path: to.Ptr("kmqz"), - KeyData: to.Ptr("kivgsubusvpprwqaqpjcmhsv"), - }, - }, - }, - ProvisionVMAgent: to.Ptr(true), - PatchSettings: &armcomputefleet.LinuxPatchSettings{ - PatchMode: to.Ptr(armcomputefleet.LinuxVMGuestPatchModeImageDefault), - AssessmentMode: to.Ptr(armcomputefleet.LinuxPatchAssessmentModeImageDefault), - AutomaticByPlatformSettings: &armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformSettings{ - RebootSetting: to.Ptr(armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown), - BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), - }, - }, - EnableVMAgentPlatformUpdates: to.Ptr(true), - }, - Secrets: []*armcomputefleet.VaultSecretGroup{ - { - SourceVault: &armcomputefleet.SubResource{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), - }, - VaultCertificates: []*armcomputefleet.VaultCertificate{ - { - CertificateURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/myCertName"), - CertificateStore: to.Ptr("nlxrwavpzhueffxsshlun"), - }, - }, - }, - }, - AllowExtensionOperations: to.Ptr(true), - RequireGuestProvisionSignal: to.Ptr(true), - }, - StorageProfile: &armcomputefleet.VirtualMachineScaleSetStorageProfile{ - ImageReference: &armcomputefleet.ImageReference{ - Publisher: to.Ptr("mqxgwbiyjzmxavhbkd"), - Offer: to.Ptr("isxgumkarlkomp"), - SKU: to.Ptr("eojmppqcrnpmxirtp"), - Version: to.Ptr("wvpcqefgtmqdgltiuz"), - SharedGalleryImageID: to.Ptr("kmkgihoxwlawuuhcinfirktdwkmx"), - CommunityGalleryImageID: to.Ptr("vlqe"), - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}"), - }, - OSDisk: &armcomputefleet.VirtualMachineScaleSetOSDisk{ - Name: to.Ptr("wfttw"), - Caching: to.Ptr(armcomputefleet.CachingTypesNone), - WriteAcceleratorEnabled: to.Ptr(true), - CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), - DiffDiskSettings: &armcomputefleet.DiffDiskSettings{ - Option: to.Ptr(armcomputefleet.DiffDiskOptionsLocal), - Placement: to.Ptr(armcomputefleet.DiffDiskPlacementCacheDisk), - }, - DiskSizeGB: to.Ptr[int32](14), - OSType: to.Ptr(armcomputefleet.OperatingSystemTypesWindows), - Image: &armcomputefleet.VirtualHardDisk{ - URI: to.Ptr("https://myStorageAccountName.blob.core.windows.net/myContainerName/myVhdName.vhd"), - }, - VhdContainers: []*string{ - to.Ptr("tkzcwddtinkfpnfklatw"), - }, - ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ - StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), - DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), - }, - SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ - SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), - DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), - }, - }, - }, - DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), - }, - DataDisks: []*armcomputefleet.VirtualMachineScaleSetDataDisk{ - { - Name: to.Ptr("eogiykmdmeikswxmigjws"), - Lun: to.Ptr[int32](14), - Caching: to.Ptr(armcomputefleet.CachingTypesNone), - WriteAcceleratorEnabled: to.Ptr(true), - CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), - DiskSizeGB: to.Ptr[int32](6), - ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ - StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), - DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), - }, - SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ - SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), - DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), - }, - }, - }, - DiskIOPSReadWrite: to.Ptr[int64](27), - DiskMBpsReadWrite: to.Ptr[int64](2), - DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), - }, - }, - }, - NetworkProfile: &armcomputefleet.VirtualMachineScaleSetNetworkProfile{ - HealthProbe: &armcomputefleet.APIEntityReference{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}"), - }, - NetworkInterfaceConfigurations: []*armcomputefleet.VirtualMachineScaleSetNetworkConfiguration{ - { - Name: to.Ptr("i"), - Properties: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationProperties{ - Primary: to.Ptr(true), - EnableAcceleratedNetworking: to.Ptr(true), - DisableTCPStateTracking: to.Ptr(true), - EnableFpga: to.Ptr(true), - NetworkSecurityGroup: &armcomputefleet.SubResource{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"), - }, - DNSSettings: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - DNSServers: []*string{ - to.Ptr("nxmmfolhclsesu"), - }, - }, - IPConfigurations: []*armcomputefleet.VirtualMachineScaleSetIPConfiguration{ - { - Name: to.Ptr("oezqhkidfhyywlfzwuotilrpbqnjg"), - Properties: &armcomputefleet.VirtualMachineScaleSetIPConfigurationProperties{ - Subnet: &armcomputefleet.APIEntityReference{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}"), - }, - Primary: to.Ptr(true), - PublicIPAddressConfiguration: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfiguration{ - Name: to.Ptr("fvpqf"), - Properties: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ - IdleTimeoutInMinutes: to.Ptr[int32](9), - DNSSettings: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ - DomainNameLabel: to.Ptr("ukrddzvmorpmfsczjwtbvp"), - DomainNameLabelScope: to.Ptr(armcomputefleet.DomainNameLabelScopeTypesTenantReuse), - }, - IPTags: []*armcomputefleet.VirtualMachineScaleSetIPTag{ - { - IPTagType: to.Ptr("sddgsoemnzgqizale"), - Tag: to.Ptr("wufmhrjsakbiaetyara"), - }, - }, - PublicIPPrefix: &armcomputefleet.SubResource{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}"), - }, - PublicIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), - DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), - }, - SKU: &armcomputefleet.PublicIPAddressSKU{ - Name: to.Ptr(armcomputefleet.PublicIPAddressSKUNameBasic), - Tier: to.Ptr(armcomputefleet.PublicIPAddressSKUTierRegional), - }, - }, - PrivateIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), - ApplicationGatewayBackendAddressPools: []*armcomputefleet.SubResource{ - { - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}"), - }, - }, - ApplicationSecurityGroups: []*armcomputefleet.SubResource{ - { - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}"), - }, - }, - LoadBalancerBackendAddressPools: []*armcomputefleet.SubResource{ - { - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}"), - }, - }, - LoadBalancerInboundNatPools: []*armcomputefleet.SubResource{ - { - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}"), - }, - }, - }, - }, - }, - EnableIPForwarding: to.Ptr(true), - DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), - AuxiliaryMode: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliaryModeNone), - AuxiliarySKU: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliarySKUNone), - }, - }, - }, - NetworkAPIVersion: to.Ptr(armcomputefleet.NetworkAPIVersionV20201101), - }, - SecurityProfile: &armcomputefleet.SecurityProfile{ - UefiSettings: &armcomputefleet.UefiSettings{ - SecureBootEnabled: to.Ptr(true), - VTpmEnabled: to.Ptr(true), - }, - EncryptionAtHost: to.Ptr(true), - SecurityType: to.Ptr(armcomputefleet.SecurityTypesTrustedLaunch), - EncryptionIdentity: &armcomputefleet.EncryptionIdentity{ - UserAssignedIdentityResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}"), - }, - ProxyAgentSettings: &armcomputefleet.ProxyAgentSettings{ - Enabled: to.Ptr(true), - Mode: to.Ptr(armcomputefleet.ModeAudit), - KeyIncarnationID: to.Ptr[int32](20), - }, - }, - DiagnosticsProfile: &armcomputefleet.DiagnosticsProfile{ - BootDiagnostics: &armcomputefleet.BootDiagnostics{ - Enabled: to.Ptr(true), - StorageURI: to.Ptr("http://myStorageAccountName.blob.core.windows.net"), - }, - }, - ExtensionProfile: &armcomputefleet.VirtualMachineScaleSetExtensionProfile{ - Extensions: []*armcomputefleet.VirtualMachineScaleSetExtension{ - { - Name: to.Ptr("bndxuxx"), - Properties: &armcomputefleet.VirtualMachineScaleSetExtensionProperties{ - ForceUpdateTag: to.Ptr("yhgxw"), - Publisher: to.Ptr("kpxtirxjfprhs"), - Type: to.Ptr("pgjilctjjwaa"), - TypeHandlerVersion: to.Ptr("zevivcoilxmbwlrihhhibq"), - AutoUpgradeMinorVersion: to.Ptr(true), - EnableAutomaticUpgrade: to.Ptr(true), - Settings: map[string]any{}, - ProtectedSettings: map[string]any{}, - ProvisionAfterExtensions: []*string{ - to.Ptr("nftzosroolbcwmpupujzqwqe"), - }, - SuppressFailures: to.Ptr(true), - ProtectedSettingsFromKeyVault: &armcomputefleet.KeyVaultSecretReference{ - SecretURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/secret/mySecretName"), - SourceVault: &armcomputefleet.SubResource{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), - }, - }, - }, - }, - }, - ExtensionsTimeBudget: to.Ptr("mbhjahtdygwgyszdwjtvlvtgchdwil"), - }, - LicenseType: to.Ptr("v"), - ScheduledEventsProfile: &armcomputefleet.ScheduledEventsProfile{ - TerminateNotificationProfile: &armcomputefleet.TerminateNotificationProfile{ - NotBeforeTimeout: to.Ptr("iljppmmw"), - Enable: to.Ptr(true), - }, - OSImageNotificationProfile: &armcomputefleet.OSImageNotificationProfile{ - NotBeforeTimeout: to.Ptr("olbpadmevekyczfokodtfprxti"), - Enable: to.Ptr(true), - }, - }, - UserData: to.Ptr("s"), - CapacityReservation: &armcomputefleet.CapacityReservationProfile{ - CapacityReservationGroup: &armcomputefleet.SubResource{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"), - }, - }, - ApplicationProfile: &armcomputefleet.ApplicationProfile{ - GalleryApplications: []*armcomputefleet.VMGalleryApplication{ - { - Tags: to.Ptr("eyrqjbib"), - Order: to.Ptr[int32](5), - PackageReferenceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}"), - ConfigurationReference: to.Ptr("ulztmiavpojpbpbddgnuuiimxcpau"), - TreatFailureAsDeploymentFailure: to.Ptr(true), - EnableAutomaticUpgrade: to.Ptr(true), - }, - }, - }, - HardwareProfile: &armcomputefleet.VirtualMachineScaleSetHardwareProfile{ - VMSizeProperties: &armcomputefleet.VMSizeProperties{ - VCPUsAvailable: to.Ptr[int32](16), - VCPUsPerCore: to.Ptr[int32](23), - }, - }, - ServiceArtifactReference: &armcomputefleet.ServiceArtifactReference{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}"), - }, - SecurityPostureReference: &armcomputefleet.SecurityPostureReference{ - ID: to.Ptr("/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest"), - ExcludeExtensions: []*string{ - to.Ptr("{securityPostureVMExtensionName}"), - }, - IsOverridable: to.Ptr(true), - }, - }, - ComputeAPIVersion: to.Ptr("2023-07-01"), - PlatformFaultDomainCount: to.Ptr[int32](1), - }, - }, - Plan: &armcomputefleet.ResourcePlanUpdate{ - Name: to.Ptr("jwgrcrnrtfoxn"), - Publisher: to.Ptr("iozjbiqqckqm"), - Product: to.Ptr("cgopbyvdyqikahwyxfpzwaqk"), - PromotionCode: to.Ptr("naglezezplcaruqogtxnuizslqnnbr"), - Version: to.Ptr("wa"), - }, - }, 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 = armcomputefleet.FleetsClientUpdateResponse{ - // Fleet: &armcomputefleet.Fleet{ - // Properties: &armcomputefleet.FleetProperties{ - // SpotPriorityProfile: &armcomputefleet.SpotPriorityProfile{ - // Capacity: to.Ptr[int32](20), - // MinCapacity: to.Ptr[int32](10), - // MaxPricePerVM: to.Ptr[float32](0.00865), - // EvictionPolicy: to.Ptr(armcomputefleet.EvictionPolicyDelete), - // AllocationStrategy: to.Ptr(armcomputefleet.SpotAllocationStrategyPriceCapacityOptimized), - // Maintain: to.Ptr(true), - // }, - // RegularPriorityProfile: &armcomputefleet.RegularPriorityProfile{ - // Capacity: to.Ptr[int32](20), - // MinCapacity: to.Ptr[int32](10), - // AllocationStrategy: to.Ptr(armcomputefleet.RegularPriorityAllocationStrategyLowestPrice), - // }, - // VMSizesProfile: []*armcomputefleet.VMSizeProfile{ - // { - // Name: to.Ptr("Standard_d1_v2"), - // Rank: to.Ptr[int32](19225), - // }, - // }, - // ComputeProfile: &armcomputefleet.ComputeProfile{ - // BaseVirtualMachineProfile: &armcomputefleet.BaseVirtualMachineProfile{ - // OSProfile: &armcomputefleet.VirtualMachineScaleSetOSProfile{ - // ComputerNamePrefix: to.Ptr("o"), - // AdminUsername: to.Ptr("nrgzqciiaaxjrqldbmjbqkyhntp"), - // WindowsConfiguration: &armcomputefleet.WindowsConfiguration{ - // ProvisionVMAgent: to.Ptr(true), - // EnableAutomaticUpdates: to.Ptr(true), - // TimeZone: to.Ptr("hlyjiqcfksgrpjrct"), - // AdditionalUnattendContent: []*armcomputefleet.AdditionalUnattendContent{ - // { - // PassName: to.Ptr("OobeSystem"), - // ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), - // SettingName: to.Ptr(armcomputefleet.SettingNamesAutoLogon), - // }, - // }, - // PatchSettings: &armcomputefleet.PatchSettings{ - // PatchMode: to.Ptr(armcomputefleet.WindowsVMGuestPatchModeManual), - // EnableHotpatching: to.Ptr(true), - // AssessmentMode: to.Ptr(armcomputefleet.WindowsPatchAssessmentModeImageDefault), - // AutomaticByPlatformSettings: &armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformSettings{ - // RebootSetting: to.Ptr(armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown), - // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), - // }, - // }, - // WinRM: &armcomputefleet.WinRMConfiguration{ - // Listeners: []*armcomputefleet.WinRMListener{ - // { - // Protocol: to.Ptr(armcomputefleet.ProtocolTypesHTTP), - // CertificateURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/myCertName"), - // }, - // }, - // }, - // EnableVMAgentPlatformUpdates: to.Ptr(true), - // }, - // LinuxConfiguration: &armcomputefleet.LinuxConfiguration{ - // DisablePasswordAuthentication: to.Ptr(true), - // SSH: &armcomputefleet.SSHConfiguration{ - // PublicKeys: []*armcomputefleet.SSHPublicKey{ - // { - // Path: to.Ptr("kmqz"), - // KeyData: to.Ptr("kivgsubusvpprwqaqpjcmhsv"), - // }, - // }, - // }, - // ProvisionVMAgent: to.Ptr(true), - // PatchSettings: &armcomputefleet.LinuxPatchSettings{ - // PatchMode: to.Ptr(armcomputefleet.LinuxVMGuestPatchModeImageDefault), - // AssessmentMode: to.Ptr(armcomputefleet.LinuxPatchAssessmentModeImageDefault), - // AutomaticByPlatformSettings: &armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformSettings{ - // RebootSetting: to.Ptr(armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown), - // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), - // }, - // }, - // EnableVMAgentPlatformUpdates: to.Ptr(true), - // }, - // Secrets: []*armcomputefleet.VaultSecretGroup{ - // { - // SourceVault: &armcomputefleet.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), - // }, - // VaultCertificates: []*armcomputefleet.VaultCertificate{ - // { - // CertificateURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/myCertName"), - // CertificateStore: to.Ptr("nlxrwavpzhueffxsshlun"), - // }, - // }, - // }, - // }, - // AllowExtensionOperations: to.Ptr(true), - // RequireGuestProvisionSignal: to.Ptr(true), - // }, - // StorageProfile: &armcomputefleet.VirtualMachineScaleSetStorageProfile{ - // ImageReference: &armcomputefleet.ImageReference{ - // Publisher: to.Ptr("mqxgwbiyjzmxavhbkd"), - // Offer: to.Ptr("isxgumkarlkomp"), - // SKU: to.Ptr("eojmppqcrnpmxirtp"), - // Version: to.Ptr("wvpcqefgtmqdgltiuz"), - // SharedGalleryImageID: to.Ptr("kmkgihoxwlawuuhcinfirktdwkmx"), - // CommunityGalleryImageID: to.Ptr("vlqe"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}"), - // ExactVersion: to.Ptr("zjbntmiskjexlr"), - // }, - // OSDisk: &armcomputefleet.VirtualMachineScaleSetOSDisk{ - // Name: to.Ptr("wfttw"), - // Caching: to.Ptr(armcomputefleet.CachingTypesNone), - // WriteAcceleratorEnabled: to.Ptr(true), - // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), - // DiffDiskSettings: &armcomputefleet.DiffDiskSettings{ - // Option: to.Ptr(armcomputefleet.DiffDiskOptionsLocal), - // Placement: to.Ptr(armcomputefleet.DiffDiskPlacementCacheDisk), - // }, - // DiskSizeGB: to.Ptr[int32](14), - // OSType: to.Ptr(armcomputefleet.OperatingSystemTypesWindows), - // Image: &armcomputefleet.VirtualHardDisk{ - // URI: to.Ptr("https://myStorageAccountName.blob.core.windows.net/myContainerName/myVhdName.vhd"), - // }, - // VhdContainers: []*string{ - // to.Ptr("tkzcwddtinkfpnfklatw"), - // }, - // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), - // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), - // }, - // SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ - // SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), - // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), - // }, - // }, - // }, - // DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), - // }, - // DataDisks: []*armcomputefleet.VirtualMachineScaleSetDataDisk{ - // { - // Name: to.Ptr("eogiykmdmeikswxmigjws"), - // Lun: to.Ptr[int32](14), - // Caching: to.Ptr(armcomputefleet.CachingTypesNone), - // WriteAcceleratorEnabled: to.Ptr(true), - // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), - // DiskSizeGB: to.Ptr[int32](6), - // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), - // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), - // }, - // SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ - // SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), - // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), - // }, - // }, - // }, - // DiskIOPSReadWrite: to.Ptr[int64](27), - // DiskMBpsReadWrite: to.Ptr[int64](2), - // DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), - // }, - // }, - // }, - // NetworkProfile: &armcomputefleet.VirtualMachineScaleSetNetworkProfile{ - // HealthProbe: &armcomputefleet.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}"), - // }, - // NetworkInterfaceConfigurations: []*armcomputefleet.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("i"), - // Properties: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationProperties{ - // Primary: to.Ptr(true), - // EnableAcceleratedNetworking: to.Ptr(true), - // DisableTCPStateTracking: to.Ptr(true), - // EnableFpga: to.Ptr(true), - // NetworkSecurityGroup: &armcomputefleet.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"), - // }, - // DNSSettings: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // to.Ptr("nxmmfolhclsesu"), - // }, - // }, - // IPConfigurations: []*armcomputefleet.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("oezqhkidfhyywlfzwuotilrpbqnjg"), - // Properties: &armcomputefleet.VirtualMachineScaleSetIPConfigurationProperties{ - // Subnet: &armcomputefleet.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}"), - // }, - // Primary: to.Ptr(true), - // PublicIPAddressConfiguration: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfiguration{ - // Name: to.Ptr("fvpqf"), - // Properties: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ - // IdleTimeoutInMinutes: to.Ptr[int32](9), - // DNSSettings: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ - // DomainNameLabel: to.Ptr("ukrddzvmorpmfsczjwtbvp"), - // DomainNameLabelScope: to.Ptr(armcomputefleet.DomainNameLabelScopeTypesTenantReuse), - // }, - // IPTags: []*armcomputefleet.VirtualMachineScaleSetIPTag{ - // { - // IPTagType: to.Ptr("sddgsoemnzgqizale"), - // Tag: to.Ptr("wufmhrjsakbiaetyara"), - // }, - // }, - // PublicIPPrefix: &armcomputefleet.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}"), - // }, - // PublicIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), - // DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), - // }, - // SKU: &armcomputefleet.PublicIPAddressSKU{ - // Name: to.Ptr(armcomputefleet.PublicIPAddressSKUNameBasic), - // Tier: to.Ptr(armcomputefleet.PublicIPAddressSKUTierRegional), - // }, - // }, - // PrivateIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), - // ApplicationGatewayBackendAddressPools: []*armcomputefleet.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}"), - // }, - // }, - // ApplicationSecurityGroups: []*armcomputefleet.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}"), - // }, - // }, - // LoadBalancerBackendAddressPools: []*armcomputefleet.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}"), - // }, - // }, - // LoadBalancerInboundNatPools: []*armcomputefleet.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}"), - // }, - // }, - // }, - // }, - // }, - // EnableIPForwarding: to.Ptr(true), - // DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), - // AuxiliaryMode: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliaryModeNone), - // AuxiliarySKU: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliarySKUNone), - // }, - // }, - // }, - // NetworkAPIVersion: to.Ptr(armcomputefleet.NetworkAPIVersionV20201101), - // }, - // SecurityProfile: &armcomputefleet.SecurityProfile{ - // UefiSettings: &armcomputefleet.UefiSettings{ - // SecureBootEnabled: to.Ptr(true), - // VTpmEnabled: to.Ptr(true), - // }, - // EncryptionAtHost: to.Ptr(true), - // SecurityType: to.Ptr(armcomputefleet.SecurityTypesTrustedLaunch), - // EncryptionIdentity: &armcomputefleet.EncryptionIdentity{ - // UserAssignedIdentityResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}"), - // }, - // ProxyAgentSettings: &armcomputefleet.ProxyAgentSettings{ - // Enabled: to.Ptr(true), - // Mode: to.Ptr(armcomputefleet.ModeAudit), - // KeyIncarnationID: to.Ptr[int32](20), - // }, - // }, - // DiagnosticsProfile: &armcomputefleet.DiagnosticsProfile{ - // BootDiagnostics: &armcomputefleet.BootDiagnostics{ - // Enabled: to.Ptr(true), - // StorageURI: to.Ptr("http://myStorageAccountName.blob.core.windows.net"), - // }, - // }, - // ExtensionProfile: &armcomputefleet.VirtualMachineScaleSetExtensionProfile{ - // Extensions: []*armcomputefleet.VirtualMachineScaleSetExtension{ - // { - // Name: to.Ptr("bndxuxx"), - // Properties: &armcomputefleet.VirtualMachineScaleSetExtensionProperties{ - // ForceUpdateTag: to.Ptr("yhgxw"), - // Publisher: to.Ptr("kpxtirxjfprhs"), - // Type: to.Ptr("pgjilctjjwaa"), - // TypeHandlerVersion: to.Ptr("zevivcoilxmbwlrihhhibq"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // EnableAutomaticUpgrade: to.Ptr(true), - // ProvisionAfterExtensions: []*string{ - // to.Ptr("nftzosroolbcwmpupujzqwqe"), - // }, - // SuppressFailures: to.Ptr(true), - // ProtectedSettingsFromKeyVault: &armcomputefleet.KeyVaultSecretReference{ - // SecretURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/secret/mySecretName"), - // SourceVault: &armcomputefleet.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), - // }, - // }, - // Settings: map[string]any{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // Type: to.Ptr("cmeam"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{extensionName}"), - // }, - // }, - // ExtensionsTimeBudget: to.Ptr("mbhjahtdygwgyszdwjtvlvtgchdwil"), - // }, - // LicenseType: to.Ptr("v"), - // ScheduledEventsProfile: &armcomputefleet.ScheduledEventsProfile{ - // TerminateNotificationProfile: &armcomputefleet.TerminateNotificationProfile{ - // NotBeforeTimeout: to.Ptr("iljppmmw"), - // Enable: to.Ptr(true), - // }, - // OSImageNotificationProfile: &armcomputefleet.OSImageNotificationProfile{ - // NotBeforeTimeout: to.Ptr("olbpadmevekyczfokodtfprxti"), - // Enable: to.Ptr(true), - // }, - // }, - // UserData: to.Ptr("s"), - // CapacityReservation: &armcomputefleet.CapacityReservationProfile{ - // CapacityReservationGroup: &armcomputefleet.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"), - // }, - // }, - // ApplicationProfile: &armcomputefleet.ApplicationProfile{ - // GalleryApplications: []*armcomputefleet.VMGalleryApplication{ - // { - // Tags: to.Ptr("eyrqjbib"), - // Order: to.Ptr[int32](5), - // PackageReferenceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}"), - // TreatFailureAsDeploymentFailure: to.Ptr(true), - // EnableAutomaticUpgrade: to.Ptr(true), - // }, - // }, - // }, - // HardwareProfile: &armcomputefleet.VirtualMachineScaleSetHardwareProfile{ - // VMSizeProperties: &armcomputefleet.VMSizeProperties{ - // VCPUsAvailable: to.Ptr[int32](16), - // VCPUsPerCore: to.Ptr[int32](23), - // }, - // }, - // ServiceArtifactReference: &armcomputefleet.ServiceArtifactReference{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}"), - // }, - // SecurityPostureReference: &armcomputefleet.SecurityPostureReference{ - // ID: to.Ptr("/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest"), - // ExcludeExtensions: []*string{ - // to.Ptr("{securityPostureVMExtensionName}"), - // }, - // IsOverridable: to.Ptr(true), - // }, - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), - // }, - // ComputeAPIVersion: to.Ptr("2023-07-01"), - // PlatformFaultDomainCount: to.Ptr[int32](1), - // }, - // ProvisioningState: to.Ptr(armcomputefleet.ProvisioningStateCreating), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-10T00:16:34.8590555+00:00"); return t}()), - // UniqueID: to.Ptr("a2f7fabd-bbc2-4a20-afe1-49fdb3885a28"), - // }, - // Zones: []*string{ - // to.Ptr("zone1"), - // to.Ptr("zone2"), - // }, - // Identity: &armcomputefleet.ManagedServiceIdentity{ - // Type: to.Ptr(armcomputefleet.ManagedServiceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armcomputefleet.UserAssignedIdentity{ - // }, - // PrincipalID: to.Ptr("4d508e5b-374b-4382-9a1c-01fb8b6cb37c"), - // TenantID: to.Ptr("5d508e5b-374b-4382-9a1c-01fb8b6cb37c"), - // }, - // Tags: map[string]*string{ - // }, - // Location: to.Ptr("westus"), - // Plan: &armcomputefleet.Plan{ - // Name: to.Ptr("uapfngmdekvpgjhomthtpxjfdmmll"), - // Publisher: to.Ptr("aqhles"), - // Product: to.Ptr("bfzbkdnbexmedxdc"), - // PromotionCode: to.Ptr("gspehogwfjxirz"), - // Version: to.Ptr("yza"), - // }, - // ID: to.Ptr("/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/testFleet"), - // Name: to.Ptr("testFleet"), - // Type: to.Ptr("Microsoft.AzureFleet/fleets"), - // SystemData: &armcomputefleet.SystemData{ - // CreatedBy: to.Ptr("rowegentrpoajsv"), - // CreatedByType: to.Ptr(armcomputefleet.CreatedByTypeUser), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), - // LastModifiedBy: to.Ptr("edwuayhhaoepxzisfaqjhmrxjq"), - // LastModifiedByType: to.Ptr(armcomputefleet.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/go.mod b/sdk/resourcemanager/computefleet/armcomputefleet/go.mod index cb3bfffa9f94..9a8999a0da53 100644 --- a/sdk/resourcemanager/computefleet/armcomputefleet/go.mod +++ b/sdk/resourcemanager/computefleet/armcomputefleet/go.mod @@ -1,21 +1,11 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet/v2 go 1.23.0 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.1 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.2 require ( - github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.2 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.40.0 // indirect - golang.org/x/net v0.42.0 // indirect - golang.org/x/sys v0.34.0 // indirect - golang.org/x/text v0.27.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 // indirect + golang.org/x/net v0.43.0 // indirect + golang.org/x/text v0.28.0 // indirect ) diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/go.sum b/sdk/resourcemanager/computefleet/armcomputefleet/go.sum index 49e874cd7954..5ee719a8759b 100644 --- a/sdk/resourcemanager/computefleet/armcomputefleet/go.sum +++ b/sdk/resourcemanager/computefleet/armcomputefleet/go.sum @@ -1,45 +1,16 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.1 h1:Wc1ml6QlJs2BHQ/9Bqu1jiyggbsSjramq2oUmp5WeIo= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.1/go.mod h1:Ot/6aikWnKWi4l9QB7qVSwa8iMphQNqkWALMoNT3rzM= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.1 h1:B+blDbyVIG3WaikNxPnhPiJ1MThR03b3vKGtER95TP4= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.1/go.mod h1:JdM5psgjfBf5fo2uWOZhflPWyDBZ/O/CNAH9CtsuZE4= -github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2 h1:yz1bePFlP5Vws5+8ez6T3HWXPmwOK7Yvq8QxDBD3SKY= -github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2/go.mod h1:Pa9ZNPuoNu/GztvBSKk9J1cDJW6vk/n0zLtV4mgd8N8= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 h1:FPKJS1T+clwv+OLGt13a8UjqeRuh0O4SJ3lUriThc+4= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1/go.mod h1:j2chePtV91HrC22tGoRX3sGY42uF13WzmmV80/OdVAA= -github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM= -github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE= -github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 h1:oygO0locgZJe7PpYPXT5A29ZkwJaPqcva7BVeemZOZs= -github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.2 h1:Hr5FTipp7SL07o2FvoVOX9HRiRH3CR3Mj8pxqCcdD5A= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.2/go.mod h1:QyVsSSN64v5TGltphKLQ2sQxe4OBQg0J1eKRcVBnfgE= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 h1:9iefClla7iYpfYWdzPCRDozdmndjTm8DXdpCzPajMgA= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2/go.mod h1:XtLgD3ZD34DAaVIIAyG3objl5DynM3CQ/vMcbBNJZGI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8= -github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/keybase/go-keychain v0.0.1 h1:way+bWYa6lDppZoZcgMbYsvC7GxljxrskdNInRtuthU= -github.com/keybase/go-keychain v0.0.1/go.mod h1:PdEILRW3i9D8JcdM+FmY6RwkHGnhHxXwkPPMeUgOK1k= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/redis/go-redis/v9 v9.8.0 h1:q3nRvjrlge/6UD7eTu/DSg2uYiU2mCL0G/uzBWqhicI= -github.com/redis/go-redis/v9 v9.8.0/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM= -golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY= -golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs= -golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA= -golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4= -golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU= +golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= +golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= +golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= +golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/models.go b/sdk/resourcemanager/computefleet/armcomputefleet/models.go index caf2d6bf4392..736bd911bcbc 100644 --- a/sdk/resourcemanager/computefleet/armcomputefleet/models.go +++ b/sdk/resourcemanager/computefleet/armcomputefleet/models.go @@ -117,9 +117,9 @@ type BaseVirtualMachineProfile struct { // Server operating system are:

RHEL_BYOS (for RHEL)

SLES_BYOS // (for SUSE)

For more information, see [Azure Hybrid Use Benefit for // Windows - // Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + // Server](https://learn.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) //

[Azure Hybrid Use Benefit for Linux - // Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + // Server](https://learn.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) //

Minimum api-version: 2015-06-15 LicenseType *string @@ -229,8 +229,8 @@ type DiffDiskSettings struct { // values are: **CacheDisk,** **ResourceDisk.** The defaulting behavior is: // **CacheDisk** if one is configured for the VM size otherwise **ResourceDisk** // is used. Refer to the VM size documentation for Windows VM at - // https://docs.microsoft.com/azure/virtual-machines/windows/sizes and Linux VM at - // https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM + // https://learn.microsoft.com/azure/virtual-machines/windows/sizes and Linux VM at + // https://learn.microsoft.com/azure/virtual-machines/linux/sizes to check which VM // sizes exposes a cache disk. Placement *DiffDiskPlacement } @@ -256,9 +256,6 @@ type Fleet struct { // REQUIRED; The geo-location where the resource lives Location *string - // READ-ONLY; The name of the Compute Fleet - Name *string - // The managed service identities assigned to this resource. Identity *ManagedServiceIdentity @@ -277,6 +274,9 @@ type Fleet struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string + // READ-ONLY; The name of the resource + Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData @@ -304,15 +304,32 @@ type FleetProperties struct { // Represents the configuration for additional locations where Fleet resources may be deployed. AdditionalLocationsProfile *AdditionalLocationsProfile + // Specifies capacity type for Fleet Regular and Spot priority profiles. + // capacityType is an immutable property. Once set during Fleet creation, it cannot be updated. + // Specifying different capacity type for Fleet Regular and Spot priority profiles is not allowed. + CapacityType *CapacityType + + // Specifies the display name a Compute Fleet test v2. + DisplayName *string + + // Mode of the Fleet. + Mode *FleetMode + // Configuration Options for Regular instances in Compute Fleet. RegularPriorityProfile *RegularPriorityProfile // Configuration Options for Spot instances in Compute Fleet. SpotPriorityProfile *SpotPriorityProfile + // Specifies the updated by a Compute Fleet test v2. + UpdatedBy *string + // Attribute based Fleet. VMAttributes *VMAttributes + // Zone Allocation Policy for Fleet. + ZoneAllocationPolicy *ZoneAllocationPolicy + // READ-ONLY; The status of the last operation. ProvisioningState *ProvisioningState @@ -403,7 +420,7 @@ type KeyVaultSecretReference struct { // LinuxConfiguration - Specifies the Linux operating system settings on the virtual machine. For a // list of supported Linux distributions, see [Linux on Azure-Endorsed -// Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). +// Distributions](https://learn.microsoft.com/azure/virtual-machines/linux/endorsed-distros). type LinuxConfiguration struct { // Specifies whether password authentication should be disabled. DisablePasswordAuthentication *bool @@ -507,14 +524,16 @@ type OSImageNotificationProfile struct { NotBeforeTimeout *string } -// Operation - Details of a REST API operation, returned from the Resource Provider Operations API +// Operation - REST API Operation +// +// Details of a REST API operation, returned from the Resource Provider Operations API type Operation struct { - // Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - ActionType *ActionType - - // READ-ONLY; Localized display information for this particular operation. + // Localized display information for this particular operation. Display *OperationDisplay + // READ-ONLY; Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + ActionType *ActionType + // READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure // Resource Manager/control-plane operations. IsDataAction *bool @@ -679,7 +698,7 @@ type SSHPublicKey struct { // SSH public key certificate used to authenticate with the VM through ssh. The // key needs to be at least 2048-bit and in ssh-rsa format. For creating ssh keys, // see [Create SSH keys on Linux and Mac for Linux VMs in - // Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + // Azure]https://learn.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). KeyData *string // Specifies the full path on the created VM where ssh public key is stored. If @@ -908,6 +927,7 @@ type VMAttributes struct { LocalStorageInGiB *VMAttributeMinMaxDouble // Specifies whether the VMSize supporting local storage should be used to build Fleet or not. + // Included - Default if not specified as most Azure VMs support local storage. LocalStorageSupport *VMAttributeSupport // The range of memory in GiB per vCPU specified from min to max. Optional parameter. Either Min or Max is required if specified. @@ -991,14 +1011,14 @@ type VMSizeProperties struct { // specified in the request body the default behavior is to set it to the value of // vCPUs available for that VM size exposed in api response of [List all available // virtual machine sizes in a - // region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). + // region](https://learn.microsoft.com/en-us/rest/api/compute/resource-skus/list). VCPUsAvailable *int32 // Specifies the vCPU to physical core ratio. When this property is not specified // in the request body the default behavior is set to the value of vCPUsPerCore // for the VM Size exposed in api response of [List all available virtual machine // sizes in a - // region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). + // region](https://learn.microsoft.com/en-us/rest/api/compute/resource-skus/list). // **Setting this property to 1 also means that hyper-threading is disabled.** VCPUsPerCore *int32 } @@ -1018,16 +1038,16 @@ type VaultCertificate struct { // This is the URL of a certificate that has been uploaded to Key Vault as a // secret. For adding a secret to the Key Vault, see [Add a key or secret to the // key - // vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). + // vault](https://learn.microsoft.com/azure/key-vault/key-vault-get-started/#add). // In this case, your certificate needs to be It is the Base64 encoding of the // following JSON Object which is encoded in UTF-8:

{
// "data":"",
"dataType":"pfx",
// "password":""
}
To install certificates on a virtual // machine it is recommended to use the [Azure Key Vault virtual machine extension // for - // Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) + // Linux](https://learn.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) // or the [Azure Key Vault virtual machine extension for - // Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + // Windows](https://learn.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). CertificateURL *string } @@ -1047,15 +1067,37 @@ type VirtualHardDisk struct { URI *string } +// VirtualMachine - An instant Fleet's virtual machine. +type VirtualMachine struct { + // READ-ONLY; The compute RP resource id of the virtual machine. subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachines/{vmName} + ID *string + + // READ-ONLY; This represents the operationStatus of the virtual machine in response to the last operation that was performed + // on it by Azure Fleet resource. + OperationStatus *VMOperationStatus + + // READ-ONLY; Error information when `operationStatus` is `Failed`. + Error *APIError + + // READ-ONLY; Type of the virtual machine + Type *string +} + +// VirtualMachineListResult - The response of a virtual machine list operation. +type VirtualMachineListResult struct { + // REQUIRED; The Virtual Machine items on this page. + Value []*VirtualMachine + + // The link to the next page of items. + NextLink *string +} + // VirtualMachineScaleSet - An AzureFleet's virtualMachineScaleSet type VirtualMachineScaleSet struct { // READ-ONLY; The compute RP resource id of the virtualMachineScaleSet // "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}" ID *string - // READ-ONLY; The name of the virtualMachineScaleSet - Name *string - // READ-ONLY; This represents the operationStatus of the VMSS in response to the last operation that was performed on it by // Azure Fleet resource. OperationStatus *ProvisioningState @@ -1419,10 +1461,10 @@ type VirtualMachineScaleSetOSProfile struct { // "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", // "Password22", "iloveyou!"

For resetting the password, see [How to // reset the Remote Desktop service or its login password in a Windows - // VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) + // VM](https://learn.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) //

For resetting root password, see [Manage users, SSH, and check or // repair disks on Azure Linux VMs using the VMAccess - // Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection) + // Extension](https://learn.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection) AdminPassword *string // Specifies the name of the administrator account.

**Windows-only @@ -1448,12 +1490,12 @@ type VirtualMachineScaleSetOSProfile struct { // is decoded to a binary array that is saved as a file on the Virtual Machine. // The maximum length of the binary array is 65535 bytes. For using cloud-init for // your VM, see [Using cloud-init to customize a Linux VM during - // creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init) + // creation](https://learn.microsoft.com/azure/virtual-machines/linux/using-cloud-init) CustomData *string // Specifies the Linux operating system settings on the virtual machine. For a // list of supported Linux distributions, see [Linux on Azure-Endorsed - // Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + // Distributions](https://learn.microsoft.com/azure/virtual-machines/linux/endorsed-distros). LinuxConfiguration *LinuxConfiguration // Optional property which must either be set to True or omitted. @@ -1462,9 +1504,9 @@ type VirtualMachineScaleSetOSProfile struct { // Specifies set of certificates that should be installed onto the virtual // machines in the scale set. To install certificates on a virtual machine it is // recommended to use the [Azure Key Vault virtual machine extension for - // Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) + // Linux](https://learn.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) // or the [Azure Key Vault virtual machine extension for - // Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + // Windows](https://learn.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). Secrets []*VaultSecretGroup // Specifies Windows operating system settings on the virtual machine. @@ -1531,7 +1573,7 @@ type VirtualMachineScaleSetStorageProfile struct { // Specifies the parameters that are used to add data disks to the virtual // machines in the scale set. For more information about disks, see [About disks // and VHDs for Azure virtual - // machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + // machines](https://learn.microsoft.com/azure/virtual-machines/managed-disks-overview). DataDisks []*VirtualMachineScaleSetDataDisk // Specifies the disk controller type configured for the virtual machines in the scale set. Minimum api-version: 2022-08-01 @@ -1546,7 +1588,7 @@ type VirtualMachineScaleSetStorageProfile struct { // Specifies information about the operating system disk used by the virtual // machines in the scale set. For more information about disks, see [About disks // and VHDs for Azure virtual - // machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + // machines](https://learn.microsoft.com/azure/virtual-machines/managed-disks-overview). OSDisk *VirtualMachineScaleSetOSDisk } @@ -1561,16 +1603,16 @@ type WinRMListener struct { // This is the URL of a certificate that has been uploaded to Key Vault as a // secret. For adding a secret to the Key Vault, see [Add a key or secret to the // key - // vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). + // vault](https://learn.microsoft.com/azure/key-vault/key-vault-get-started/#add). // In this case, your certificate needs to be the Base64 encoding of the following // JSON Object which is encoded in UTF-8:

{
// "data":"",
"dataType":"pfx",
// "password":""
}
To install certificates on a virtual // machine it is recommended to use the [Azure Key Vault virtual machine extension // for - // Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) + // Linux](https://learn.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) // or the [Azure Key Vault virtual machine extension for - // Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + // Windows](https://learn.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). CertificateURL *string // Specifies the protocol of WinRM listener. Possible values are: **http,** @@ -1604,9 +1646,9 @@ type WindowsConfiguration struct { // Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". // Possible values can be - // [TimeZoneInfo.Id](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) + // [TimeZoneInfo.Id](https://learn.microsoft.com/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) // value from time zones returned by - // [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones). + // [TimeZoneInfo.GetSystemTimeZones](https://learn.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones). TimeZone *string // Specifies the Windows Remote Management listeners. This enables remote Windows @@ -1624,3 +1666,23 @@ type WindowsVMGuestPatchAutomaticByPlatformSettings struct { // operations. RebootSetting *WindowsVMGuestPatchAutomaticByPlatformRebootSetting } + +// ZoneAllocationPolicy for Compute Fleet. +type ZoneAllocationPolicy struct { + // REQUIRED; Distribution strategy used for zone allocation policy. + DistributionStrategy *ZoneDistributionStrategy + + // Zone preferences, required when zone distribution strategy is Prioritized. + ZonePreferences []*ZonePreference +} + +// ZonePreference - Zone preferences for Compute Fleet zone allocation policy. +type ZonePreference struct { + // REQUIRED; Name of the zone. + Zone *string + + // The rank of the zone. This is used with 'Prioritized' ZoneDistributionStrategy. + // The lower the number, the higher the priority, starting with 0. + // 0 is the highest rank. If not specified, defaults to lowest rank. + Rank *int32 +} diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/models_serde.go b/sdk/resourcemanager/computefleet/armcomputefleet/models_serde.go index df1f6336792d..5a41b49c4e12 100644 --- a/sdk/resourcemanager/computefleet/armcomputefleet/models_serde.go +++ b/sdk/resourcemanager/computefleet/armcomputefleet/models_serde.go @@ -634,14 +634,19 @@ func (f *FleetListResult) UnmarshalJSON(data []byte) error { func (f FleetProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "additionalLocationsProfile", f.AdditionalLocationsProfile) + populate(objectMap, "capacityType", f.CapacityType) populate(objectMap, "computeProfile", f.ComputeProfile) + populate(objectMap, "displayName", f.DisplayName) + populate(objectMap, "mode", f.Mode) populate(objectMap, "provisioningState", f.ProvisioningState) populate(objectMap, "regularPriorityProfile", f.RegularPriorityProfile) populate(objectMap, "spotPriorityProfile", f.SpotPriorityProfile) populateDateTimeRFC3339(objectMap, "timeCreated", f.TimeCreated) populate(objectMap, "uniqueId", f.UniqueID) + populate(objectMap, "updatedBy", f.UpdatedBy) populate(objectMap, "vmAttributes", f.VMAttributes) populate(objectMap, "vmSizesProfile", f.VMSizesProfile) + populate(objectMap, "zoneAllocationPolicy", f.ZoneAllocationPolicy) return json.Marshal(objectMap) } @@ -657,9 +662,18 @@ func (f *FleetProperties) UnmarshalJSON(data []byte) error { case "additionalLocationsProfile": err = unpopulate(val, "AdditionalLocationsProfile", &f.AdditionalLocationsProfile) delete(rawMsg, key) + case "capacityType": + err = unpopulate(val, "CapacityType", &f.CapacityType) + delete(rawMsg, key) case "computeProfile": err = unpopulate(val, "ComputeProfile", &f.ComputeProfile) delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &f.DisplayName) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &f.Mode) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &f.ProvisioningState) delete(rawMsg, key) @@ -675,12 +689,18 @@ func (f *FleetProperties) UnmarshalJSON(data []byte) error { case "uniqueId": err = unpopulate(val, "UniqueID", &f.UniqueID) delete(rawMsg, key) + case "updatedBy": + err = unpopulate(val, "UpdatedBy", &f.UpdatedBy) + delete(rawMsg, key) case "vmAttributes": err = unpopulate(val, "VMAttributes", &f.VMAttributes) delete(rawMsg, key) case "vmSizesProfile": err = unpopulate(val, "VMSizesProfile", &f.VMSizesProfile) delete(rawMsg, key) + case "zoneAllocationPolicy": + err = unpopulate(val, "ZoneAllocationPolicy", &f.ZoneAllocationPolicy) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", f, err) @@ -2227,12 +2247,81 @@ func (v *VirtualHardDisk) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type VirtualMachine. +func (v VirtualMachine) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "error", v.Error) + populate(objectMap, "id", v.ID) + populate(objectMap, "operationStatus", v.OperationStatus) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachine. +func (v *VirtualMachine) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &v.Error) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "operationStatus": + err = unpopulate(val, "OperationStatus", &v.OperationStatus) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualMachineListResult. +func (v VirtualMachineListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineListResult. +func (v *VirtualMachineListResult) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSet. func (v VirtualMachineScaleSet) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "error", v.Error) populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) populate(objectMap, "operationStatus", v.OperationStatus) populate(objectMap, "type", v.Type) return json.Marshal(objectMap) @@ -2253,9 +2342,6 @@ func (v *VirtualMachineScaleSet) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &v.ID) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) case "operationStatus": err = unpopulate(val, "OperationStatus", &v.OperationStatus) delete(rawMsg, key) @@ -3262,6 +3348,68 @@ func (w *WindowsVMGuestPatchAutomaticByPlatformSettings) UnmarshalJSON(data []by return nil } +// MarshalJSON implements the json.Marshaller interface for type ZoneAllocationPolicy. +func (z ZoneAllocationPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "distributionStrategy", z.DistributionStrategy) + populate(objectMap, "zonePreferences", z.ZonePreferences) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ZoneAllocationPolicy. +func (z *ZoneAllocationPolicy) 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", z, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "distributionStrategy": + err = unpopulate(val, "DistributionStrategy", &z.DistributionStrategy) + delete(rawMsg, key) + case "zonePreferences": + err = unpopulate(val, "ZonePreferences", &z.ZonePreferences) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", z, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ZonePreference. +func (z ZonePreference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "rank", z.Rank) + populate(objectMap, "zone", z.Zone) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ZonePreference. +func (z *ZonePreference) 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", z, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "rank": + err = unpopulate(val, "Rank", &z.Rank) + delete(rawMsg, key) + case "zone": + err = unpopulate(val, "Zone", &z.Zone) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", z, err) + } + } + return nil +} + func populate(m map[string]any, k string, v any) { if v == nil { return diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/operations_client.go b/sdk/resourcemanager/computefleet/armcomputefleet/operations_client.go index e6f217fbf10e..2389af4773b6 100644 --- a/sdk/resourcemanager/computefleet/armcomputefleet/operations_client.go +++ b/sdk/resourcemanager/computefleet/armcomputefleet/operations_client.go @@ -35,7 +35,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - List the operations for the provider // -// Generated from API version 2024-11-01 +// Generated from API version 2025-08-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]{ @@ -68,7 +68,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *Operat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-01") + reqQP.Set("api-version", "2025-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/operations_client_example_test.go b/sdk/resourcemanager/computefleet/armcomputefleet/operations_client_example_test.go deleted file mode 100644 index 9ba1df570e27..000000000000 --- a/sdk/resourcemanager/computefleet/armcomputefleet/operations_client_example_test.go +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. - -package armcomputefleet_test - -import ( - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet" - "log" -) - -// Generated from example definition: 2024-11-01/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 := armcomputefleet.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 = armcomputefleet.OperationsClientListResponse{ - // OperationListResult: armcomputefleet.OperationListResult{ - // Value: []*armcomputefleet.Operation{ - // { - // Origin: to.Ptr(armcomputefleet.OriginUserSystem), - // Name: to.Ptr("Microsoft.AzureFleet/fleets/read"), - // IsDataAction: to.Ptr(false), - // Display: &armcomputefleet.OperationDisplay{ - // Provider: to.Ptr("Microsoft Azure Fleet"), - // Resource: to.Ptr("Fleets"), - // Operation: to.Ptr("Get Azure Fleet"), - // Description: to.Ptr("Get properties of Azure Fleet resource"), - // }, - // }, - // { - // Origin: to.Ptr(armcomputefleet.OriginUserSystem), - // Name: to.Ptr("Microsoft.AzureFleet/fleets/write"), - // IsDataAction: to.Ptr(false), - // Display: &armcomputefleet.OperationDisplay{ - // Provider: to.Ptr("Microsoft Azure Fleet"), - // Resource: to.Ptr("Fleets"), - // Operation: to.Ptr("Create or Update Azure Fleet"), - // Description: to.Ptr("Creates a new Azure Fleet resource or updates an existing one"), - // }, - // }, - // { - // Origin: to.Ptr(armcomputefleet.OriginUserSystem), - // Name: to.Ptr("Microsoft.AzureFleet/fleets/delete"), - // IsDataAction: to.Ptr(false), - // Display: &armcomputefleet.OperationDisplay{ - // Provider: to.Ptr("Microsoft Azure Fleet"), - // Resource: to.Ptr("Fleets"), - // Operation: to.Ptr("Delete Virtual Machine and Virtual Machine scale sets in a Azure Fleet resource"), - // Description: to.Ptr("Deletes all compute resources of Azure Fleet resource"), - // }, - // }, - // { - // Origin: to.Ptr(armcomputefleet.OriginUserSystem), - // Name: to.Ptr("Microsoft.AzureFleet/register/action"), - // IsDataAction: to.Ptr(false), - // Display: &armcomputefleet.OperationDisplay{ - // Provider: to.Ptr("Microsoft Azure Fleet"), - // Resource: to.Ptr("Subscription"), - // Operation: to.Ptr("Register subscription for Microsoft.AzureFleet"), - // Description: to.Ptr("Registers Subscription with Microsoft.AzureFleet resource provider"), - // }, - // }, - // { - // Origin: to.Ptr(armcomputefleet.OriginUserSystem), - // Name: to.Ptr("Microsoft.AzureFleet/unregister/action"), - // IsDataAction: to.Ptr(false), - // Display: &armcomputefleet.OperationDisplay{ - // Provider: to.Ptr("Microsoft Azure Fleet"), - // Resource: to.Ptr("Subscription"), - // Operation: to.Ptr("Unregister Subscription for Microsoft.AzureFleet"), - // Description: to.Ptr("Unregisters Subscription with Microsoft.AzureFleet resource provider"), - // }, - // }, - // }, - // }, - // } - } -} diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/options.go b/sdk/resourcemanager/computefleet/armcomputefleet/options.go index 570e7a366870..8850e57ea1fd 100644 --- a/sdk/resourcemanager/computefleet/armcomputefleet/options.go +++ b/sdk/resourcemanager/computefleet/armcomputefleet/options.go @@ -4,6 +4,12 @@ package armcomputefleet +// FleetsClientBeginCancelOptions contains the optional parameters for the FleetsClient.BeginCancel method. +type FleetsClientBeginCancelOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + // FleetsClientBeginCreateOrUpdateOptions contains the optional parameters for the FleetsClient.BeginCreateOrUpdate method. type FleetsClientBeginCreateOrUpdateOptions struct { // Resumes the long-running operation from the provided token. @@ -45,6 +51,16 @@ type FleetsClientListVirtualMachineScaleSetsOptions struct { // placeholder for future optional parameters } +// FleetsClientListVirtualMachinesOptions contains the optional parameters for the FleetsClient.NewListVirtualMachinesPager +// method. +type FleetsClientListVirtualMachinesOptions struct { + // Filter expression to filter the virtual machines. + Filter *string + + // Skip token for pagination. Uses the token from a previous response to fetch the next page of results. + Skiptoken *string +} + // OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/responses.go b/sdk/resourcemanager/computefleet/armcomputefleet/responses.go index 1c1710c975e3..6d3ff331d149 100644 --- a/sdk/resourcemanager/computefleet/armcomputefleet/responses.go +++ b/sdk/resourcemanager/computefleet/armcomputefleet/responses.go @@ -4,6 +4,11 @@ package armcomputefleet +// FleetsClientCancelResponse contains the response from method FleetsClient.BeginCancel. +type FleetsClientCancelResponse struct { + // placeholder for future response values +} + // FleetsClientCreateOrUpdateResponse contains the response from method FleetsClient.BeginCreateOrUpdate. type FleetsClientCreateOrUpdateResponse struct { // An Compute Fleet resource @@ -39,6 +44,12 @@ type FleetsClientListVirtualMachineScaleSetsResponse struct { VirtualMachineScaleSetListResult } +// FleetsClientListVirtualMachinesResponse contains the response from method FleetsClient.NewListVirtualMachinesPager. +type FleetsClientListVirtualMachinesResponse struct { + // The response of a virtual machine list operation. + VirtualMachineListResult +} + // FleetsClientUpdateResponse contains the response from method FleetsClient.BeginUpdate. type FleetsClientUpdateResponse struct { // An Compute Fleet resource diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/testdata/_metadata.json b/sdk/resourcemanager/computefleet/armcomputefleet/testdata/_metadata.json new file mode 100644 index 000000000000..faad0588121e --- /dev/null +++ b/sdk/resourcemanager/computefleet/armcomputefleet/testdata/_metadata.json @@ -0,0 +1,4 @@ +{ + "apiVersion": "2025-08-01", + "emitterVersion": "0.8.0" +} \ No newline at end of file diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/tsp-location.yaml b/sdk/resourcemanager/computefleet/armcomputefleet/tsp-location.yaml index c8d950e137b2..6689d3cd32a7 100644 --- a/sdk/resourcemanager/computefleet/armcomputefleet/tsp-location.yaml +++ b/sdk/resourcemanager/computefleet/armcomputefleet/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/azurefleet/AzureFleet.Management -commit: c120171b3684d88562fa26ae7db5d22b7bfa95d8 +commit: f8b97c303b60d480a110027b2442ceeb03b9d022 repo: Azure/azure-rest-api-specs additionalDirectories: diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/version.go b/sdk/resourcemanager/computefleet/armcomputefleet/version.go new file mode 100644 index 000000000000..0453806463f5 --- /dev/null +++ b/sdk/resourcemanager/computefleet/armcomputefleet/version.go @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Go Code Generator. + +package armcomputefleet + +const ( + moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet" + moduleVersion = "v2.0.0" +)