From a80f86f3e28205ebd390045bebbc48b0784cc962 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 17 Jan 2024 12:20:10 +0000 Subject: [PATCH] CodeGen from PR 27351 in Azure/azure-rest-api-specs Merge d7bde14390faee008eb0cd2626350c19cd492180 into 97cefc844971fe445d9a294cf68e2adfd63852ac --- .../botservice/armbotservice/CHANGELOG.md | 37 + .../botservice/armbotservice/README.md | 6 +- .../botservice/armbotservice/autorest.md | 6 +- .../armbotservice/botconnection_client.go | 28 +- .../botconnection_client_example_test.go | 282 ------- .../botservice/armbotservice/bots_client.go | 28 +- .../armbotservice/bots_client_example_test.go | 450 ----------- .../armbotservice/botservice_live_test.go | 2 +- .../armbotservice/channels_client.go | 40 +- .../channels_client_example_test.go | 709 ------------------ .../armbotservice/client_factory.go | 6 + .../botservice/armbotservice/constants.go | 83 +- .../armbotservice/directline_client.go | 4 +- .../directline_client_example_test.go | 100 --- .../botservice/armbotservice/email_client.go | 4 +- .../email_client_example_test.go | 45 -- .../fake/botconnection_server.go | 2 +- .../armbotservice/fake/bots_server.go | 2 +- .../armbotservice/fake/channels_server.go | 22 +- .../armbotservice/fake/directline_server.go | 2 +- .../armbotservice/fake/email_server.go | 2 +- .../armbotservice/fake/hostsettings_server.go | 2 +- ...ksecurityperimeterconfigurations_server.go | 212 ++++++ .../fake/operationresults_server.go | 2 +- .../armbotservice/fake/operations_server.go | 2 +- .../fake/privateendpointconnections_server.go | 2 +- .../fake/privatelinkresources_server.go | 2 +- .../fake/qnamakerendpointkeys_server.go | 2 +- .../armbotservice/fake/server_factory.go | 55 +- .../botservice/armbotservice/go.mod | 4 +- .../armbotservice/hostsettings_client.go | 4 +- .../hostsettings_client_example_test.go | 48 -- .../botservice/armbotservice/models.go | 198 ++++- .../botservice/armbotservice/models_serde.go | 518 +++++++++++++ ...ksecurityperimeterconfigurations_client.go | 260 +++++++ .../armbotservice/operationresults_client.go | 6 +- .../operationresults_client_example_test.go | 48 -- .../armbotservice/operations_client.go | 4 +- .../operations_client_example_test.go | 86 --- .../botservice/armbotservice/options.go | 19 + .../privateendpointconnections_client.go | 16 +- ...endpointconnections_client_example_test.go | 175 ----- .../privatelinkresources_client.go | 4 +- ...rivatelinkresources_client_example_test.go | 53 -- .../qnamakerendpointkeys_client.go | 4 +- ...namakerendpointkeys_client_example_test.go | 48 -- .../armbotservice/response_types.go | 18 + 47 files changed, 1480 insertions(+), 2172 deletions(-) delete mode 100644 sdk/resourcemanager/botservice/armbotservice/botconnection_client_example_test.go delete mode 100644 sdk/resourcemanager/botservice/armbotservice/bots_client_example_test.go delete mode 100644 sdk/resourcemanager/botservice/armbotservice/channels_client_example_test.go delete mode 100644 sdk/resourcemanager/botservice/armbotservice/directline_client_example_test.go delete mode 100644 sdk/resourcemanager/botservice/armbotservice/email_client_example_test.go create mode 100644 sdk/resourcemanager/botservice/armbotservice/fake/networksecurityperimeterconfigurations_server.go delete mode 100644 sdk/resourcemanager/botservice/armbotservice/hostsettings_client_example_test.go create mode 100644 sdk/resourcemanager/botservice/armbotservice/networksecurityperimeterconfigurations_client.go delete mode 100644 sdk/resourcemanager/botservice/armbotservice/operationresults_client_example_test.go delete mode 100644 sdk/resourcemanager/botservice/armbotservice/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/botservice/armbotservice/privateendpointconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/botservice/armbotservice/privatelinkresources_client_example_test.go delete mode 100644 sdk/resourcemanager/botservice/armbotservice/qnamakerendpointkeys_client_example_test.go diff --git a/sdk/resourcemanager/botservice/armbotservice/CHANGELOG.md b/sdk/resourcemanager/botservice/armbotservice/CHANGELOG.md index 6ad7813be2c5..e108167acc16 100644 --- a/sdk/resourcemanager/botservice/armbotservice/CHANGELOG.md +++ b/sdk/resourcemanager/botservice/armbotservice/CHANGELOG.md @@ -1,5 +1,42 @@ # Release History +## 2.0.0-beta.1 (2024-01-17) +### Breaking Changes + +- Type alias `EmailChannelAuthMethod` type has been changed from `float32` to `int32` +- Function `*ChannelsClient.Delete` parameter(s) have been changed from `(context.Context, string, string, string, *ChannelsClientDeleteOptions)` to `(context.Context, string, string, ChannelName, *ChannelsClientDeleteOptions)` +- Function `*ChannelsClient.Get` parameter(s) have been changed from `(context.Context, string, string, string, *ChannelsClientGetOptions)` to `(context.Context, string, string, ChannelName, *ChannelsClientGetOptions)` + +### Features Added + +- New value `PublicNetworkAccessSecuredByPerimeter` added to enum type `PublicNetworkAccess` +- New enum type `AccessMode` with values `AccessModeAudit`, `AccessModeEnforced`, `AccessModeLearning` +- 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 `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 `ErrorAdditionalInfo` +- New struct `ErrorDetail` +- New struct `ErrorResponse` +- 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 field `NetworkSecurityPerimeterConfigurations` in struct `BotProperties` +- New field `ID`, `Name` in struct `ConnectionSettingProperties` + + ## 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 1c2cfd5fc9f8..10a73ff978f3 100644 --- a/sdk/resourcemanager/botservice/armbotservice/README.md +++ b/sdk/resourcemanager/botservice/armbotservice/README.md @@ -1,6 +1,6 @@ # Azure Bot Service Module for Go -[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice) +[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice/v2)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice/v2) The `armbotservice` module provides operations for working with Azure Bot Service. @@ -20,7 +20,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 @@ -57,7 +57,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 index 6fc18ed9fd2b..4a09332e675e 100644 --- a/sdk/resourcemanager/botservice/armbotservice/autorest.md +++ b/sdk/resourcemanager/botservice/armbotservice/autorest.md @@ -5,8 +5,8 @@ ``` 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 +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/botservice/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/botservice/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.2.0 +module-version: 2.0.0-beta.1 ``` \ 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..68d33d6d28dd 100644 --- a/sdk/resourcemanager/botservice/armbotservice/botconnection_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/botconnection_client.go @@ -46,7 +46,7 @@ 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 +// Generated from API version 2023-09-15-preview // - resourceGroupName - The name of the Bot resource group in the user subscription. // - resourceName - The name of the Bot resource. // - connectionName - The name of the Bot Service Connection Setting resource. @@ -98,7 +98,7 @@ func (client *BotConnectionClient) createCreateRequest(ctx context.Context, reso 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"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -119,7 +119,7 @@ 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 +// Generated from API version 2023-09-15-preview // - resourceGroupName - The name of the Bot resource group in the user subscription. // - resourceName - The name of the Bot resource. // - connectionName - The name of the Bot Service Connection Setting resource. @@ -169,7 +169,7 @@ func (client *BotConnectionClient) deleteCreateRequest(ctx context.Context, reso 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 @@ -178,7 +178,7 @@ func (client *BotConnectionClient) deleteCreateRequest(ctx context.Context, reso // 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 +// Generated from API version 2023-09-15-preview // - resourceGroupName - The name of the Bot resource group in the user subscription. // - resourceName - The name of the Bot resource. // - connectionName - The name of the Bot Service Connection Setting resource. @@ -229,7 +229,7 @@ func (client *BotConnectionClient) getCreateRequest(ctx context.Context, resourc 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,7 +246,7 @@ 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 +// Generated from API version 2023-09-15-preview // - resourceGroupName - The name of the Bot resource group in the user subscription. // - resourceName - The name of the Bot resource. // - options - BotConnectionClientListByBotServiceOptions contains the optional parameters for the BotConnectionClient.NewListByBotServicePager @@ -294,7 +294,7 @@ func (client *BotConnectionClient) listByBotServiceCreateRequest(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 @@ -312,7 +312,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) { @@ -349,7 +349,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,7 +367,7 @@ 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 +// Generated from API version 2023-09-15-preview // - resourceGroupName - The name of the Bot resource group in the user subscription. // - resourceName - The name of the Bot resource. // - connectionName - The name of the Bot Service Connection Setting resource. @@ -419,7 +419,7 @@ func (client *BotConnectionClient) listWithSecretsCreateRequest(ctx context.Cont 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,7 +437,7 @@ 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 +// Generated from API version 2023-09-15-preview // - resourceGroupName - The name of the Bot resource group in the user subscription. // - resourceName - The name of the Bot resource. // - connectionName - The name of the Bot Service Connection Setting resource. @@ -489,7 +489,7 @@ func (client *BotConnectionClient) updateCreateRequest(ctx context.Context, reso 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"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/botservice/armbotservice/botconnection_client_example_test.go b/sdk/resourcemanager/botservice/armbotservice/botconnection_client_example_test.go deleted file mode 100644 index 9d00e11ef482..000000000000 --- a/sdk/resourcemanager/botservice/armbotservice/botconnection_client_example_test.go +++ /dev/null @@ -1,282 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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" -) - -// 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() { - 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) - 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.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"), - // }, - // }}, - // } -} - -// 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() { - 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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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.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"), - // }, - // } -} - -// 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() { - 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) - 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) - 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"), - // }, - // } -} - -// 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() { - 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) - 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) - 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{ - // { - // 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/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewBotConnectionClient().Delete(ctx, "OneResourceGroupName", "samplebotname", "sampleConnection", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/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) - 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"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/botservice/armbotservice/bots_client.go b/sdk/resourcemanager/botservice/armbotservice/bots_client.go index cb61b5f3ebe3..5ba0094b4777 100644 --- a/sdk/resourcemanager/botservice/armbotservice/bots_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/bots_client.go @@ -46,7 +46,7 @@ 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 +// Generated from API version 2023-09-15-preview // - resourceGroupName - The name of the Bot resource group in the user subscription. // - resourceName - The name of the Bot resource. // - parameters - The parameters to provide for the created bot. @@ -93,7 +93,7 @@ func (client *BotsClient) createCreateRequest(ctx context.Context, resourceGroup 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"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -114,7 +114,7 @@ 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 +// Generated from API version 2023-09-15-preview // - resourceGroupName - The name of the Bot resource group in the user subscription. // - resourceName - The name of the Bot resource. // - options - BotsClientDeleteOptions contains the optional parameters for the BotsClient.Delete method. @@ -159,7 +159,7 @@ func (client *BotsClient) deleteCreateRequest(ctx context.Context, resourceGroup 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 @@ -168,7 +168,7 @@ func (client *BotsClient) deleteCreateRequest(ctx context.Context, resourceGroup // 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 +// Generated from API version 2023-09-15-preview // - resourceGroupName - The name of the Bot resource group in the user subscription. // - resourceName - The name of the Bot resource. // - options - BotsClientGetOptions contains the optional parameters for the BotsClient.Get method. @@ -214,7 +214,7 @@ func (client *BotsClient) getCreateRequest(ctx context.Context, resourceGroupNam 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,7 +232,7 @@ 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 +// Generated from API version 2023-09-15-preview // - parameters - The request body parameters to provide for the check name availability request // - options - BotsClientGetCheckNameAvailabilityOptions contains the optional parameters for the BotsClient.GetCheckNameAvailability // method. @@ -266,7 +266,7 @@ func (client *BotsClient) getCheckNameAvailabilityCreateRequest(ctx context.Cont 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"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -286,7 +286,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]{ @@ -323,7 +323,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,7 +340,7 @@ 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 +// Generated from API version 2023-09-15-preview // - resourceGroupName - The name of the Bot resource group in the user subscription. // - options - BotsClientListByResourceGroupOptions contains the optional parameters for the BotsClient.NewListByResourceGroupPager // method. @@ -383,7 +383,7 @@ func (client *BotsClient) listByResourceGroupCreateRequest(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"} return req, nil @@ -401,7 +401,7 @@ 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 +// Generated from API version 2023-09-15-preview // - resourceGroupName - The name of the Bot resource group in the user subscription. // - resourceName - The name of the Bot resource. // - parameters - The parameters to provide for the created bot. @@ -448,7 +448,7 @@ func (client *BotsClient) updateCreateRequest(ctx context.Context, resourceGroup 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"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/botservice/armbotservice/bots_client_example_test.go b/sdk/resourcemanager/botservice/armbotservice/bots_client_example_test.go deleted file mode 100644 index 24b92a0207bc..000000000000 --- a/sdk/resourcemanager/botservice/armbotservice/bots_client_example_test.go +++ /dev/null @@ -1,450 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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" -) - -// 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 -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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBotsClient().Create(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("exampleappid"), - MsaAppMSIResourceID: to.Ptr("/subscriptions/foo/resourcegroups/bar/providers/microsoft.managedidentity/userassignedidentities/sampleId"), - MsaAppTenantID: to.Ptr("exampleapptenantid"), - MsaAppType: to.Ptr(armbotservice.MsaAppTypeUserAssignedMSI), - PublicNetworkAccess: to.Ptr(armbotservice.PublicNetworkAccessEnabled), - SchemaTransformationVersion: to.Ptr("1.0"), - }, - }, 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"), - // }, - // } -} - -// 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() { - 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) - 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) - 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"), - // }, - // } -} - -// 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() { - 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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewBotsClient().Delete(ctx, "OneResourceGroupName", "samplebotname", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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.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), - // 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() { - 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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBotsClient().NewListByResourceGroupPager("OneResourceGroupName", 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.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")}, - // 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"), - // }, - // }}, - // } - } -} - -// 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() { - 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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBotsClient().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.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")}, - // 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"), - // }, - // }}, - // } - } -} - -// 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() { - 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) - 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"), - }, 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.CheckNameAvailabilityResponseBody = armbotservice.CheckNameAvailabilityResponseBody{ - // Message: to.Ptr("custom message from server"), - // Valid: to.Ptr(true), - // } -} diff --git a/sdk/resourcemanager/botservice/armbotservice/botservice_live_test.go b/sdk/resourcemanager/botservice/armbotservice/botservice_live_test.go index 6f7558e5aed5..ec446dad6d46 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/v2/testutil" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" "github.com/stretchr/testify/suite" diff --git a/sdk/resourcemanager/botservice/armbotservice/channels_client.go b/sdk/resourcemanager/botservice/armbotservice/channels_client.go index 47e9ee6fb5be..fa76218bc483 100644 --- a/sdk/resourcemanager/botservice/armbotservice/channels_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/channels_client.go @@ -46,7 +46,7 @@ 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 +// Generated from API version 2023-09-15-preview // - resourceGroupName - The name of the Bot resource group in the user subscription. // - resourceName - The name of the Bot resource. // - channelName - The name of the Channel resource. @@ -98,7 +98,7 @@ func (client *ChannelsClient) createCreateRequest(ctx context.Context, resourceG 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"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -119,12 +119,12 @@ 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 +// Generated from API version 2023-09-15-preview // - resourceGroupName - The name of the Bot resource group in the user subscription. // - resourceName - The name of the Bot resource. -// - channelName - The name of the Bot resource. +// - channelName - The name of the Channel resource. // - options - ChannelsClientDeleteOptions contains the optional parameters for the ChannelsClient.Delete method. -func (client *ChannelsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, channelName string, options *ChannelsClientDeleteOptions) (ChannelsClientDeleteResponse, error) { +func (client *ChannelsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, channelName ChannelName, options *ChannelsClientDeleteOptions) (ChannelsClientDeleteResponse, error) { var err error const operationName = "ChannelsClient.Delete" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) @@ -146,7 +146,7 @@ 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 ChannelName, options *ChannelsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -159,7 +159,7 @@ func (client *ChannelsClient) deleteCreateRequest(ctx context.Context, resourceG if channelName == "" { return nil, errors.New("parameter channelName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{channelName}", url.PathEscape(channelName)) + urlPath = strings.ReplaceAll(urlPath, "{channelName}", url.PathEscape(string(channelName))) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -169,7 +169,7 @@ func (client *ChannelsClient) deleteCreateRequest(ctx context.Context, resourceG 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 @@ -178,12 +178,12 @@ func (client *ChannelsClient) deleteCreateRequest(ctx context.Context, resourceG // 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 +// Generated from API version 2023-09-15-preview // - resourceGroupName - The name of the Bot resource group in the user subscription. // - resourceName - The name of the Bot resource. -// - channelName - The name of the Bot resource. +// - channelName - The name of the Channel resource. // - options - ChannelsClientGetOptions contains the optional parameters for the ChannelsClient.Get method. -func (client *ChannelsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, channelName string, options *ChannelsClientGetOptions) (ChannelsClientGetResponse, error) { +func (client *ChannelsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, channelName ChannelName, options *ChannelsClientGetOptions) (ChannelsClientGetResponse, error) { var err error const operationName = "ChannelsClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) @@ -206,7 +206,7 @@ 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 ChannelName, options *ChannelsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -219,7 +219,7 @@ func (client *ChannelsClient) getCreateRequest(ctx context.Context, resourceGrou if channelName == "" { return nil, errors.New("parameter channelName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{channelName}", url.PathEscape(channelName)) + urlPath = strings.ReplaceAll(urlPath, "{channelName}", url.PathEscape(string(channelName))) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -229,7 +229,7 @@ func (client *ChannelsClient) getCreateRequest(ctx context.Context, resourceGrou 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,7 +246,7 @@ 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 +// Generated from API version 2023-09-15-preview // - resourceGroupName - The name of the Bot resource group in the user subscription. // - resourceName - The name of the Bot resource. // - options - ChannelsClientListByResourceGroupOptions contains the optional parameters for the ChannelsClient.NewListByResourceGroupPager @@ -294,7 +294,7 @@ func (client *ChannelsClient) listByResourceGroupCreateRequest(ctx context.Conte 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 +312,7 @@ 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 +// Generated from API version 2023-09-15-preview // - resourceGroupName - The name of the Bot resource group in the user subscription. // - resourceName - The name of the Bot resource. // - channelName - The name of the Channel resource. @@ -363,7 +363,7 @@ func (client *ChannelsClient) listWithKeysCreateRequest(ctx context.Context, res 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,7 +381,7 @@ 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 +// Generated from API version 2023-09-15-preview // - resourceGroupName - The name of the Bot resource group in the user subscription. // - resourceName - The name of the Bot resource. // - channelName - The name of the Channel resource. @@ -433,7 +433,7 @@ func (client *ChannelsClient) updateCreateRequest(ctx context.Context, resourceG 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"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/botservice/armbotservice/channels_client_example_test.go b/sdk/resourcemanager/botservice/armbotservice/channels_client_example_test.go deleted file mode 100644 index aafa11d4684c..000000000000 --- a/sdk/resourcemanager/botservice/armbotservice/channels_client_example_test.go +++ /dev/null @@ -1,709 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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" -) - -// 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 -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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewChannelsClient().Create(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.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 -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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewChannelsClient().Create(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.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 -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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewChannelsClient().Create(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.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 -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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewChannelsClient().Create(ctx, "OneResourceGroupName", "samplebotname", armbotservice.ChannelNameEmailChannel, armbotservice.BotChannel{ - 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), - MagicCode: to.Ptr("000000"), - }, - }, - }, 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{ - // 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 -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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewChannelsClient().Create(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.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() { - 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) - 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) - 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"), - // }, - // }, - // } -} - -// 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() { - 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) - 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) - 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"), - // }, - // }, - // } -} - -// 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() { - 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) - 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) - 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), - // }, - // }, - // } -} - -// 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() { - 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) - 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) - 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"), - // }}, - // }, - // }, - // } -} - -// 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() { - 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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewChannelsClient().Delete(ctx, "OneResourceGroupName", "samplebotname", "EmailChannel", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewChannelsClient().Delete(ctx, "OneResourceGroupName", "samplebotname", "DirectLineSpeechChannel", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/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) - 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) - } - // 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() { - 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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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.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/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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.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/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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.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/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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.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), - // 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() { - 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) - 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"), - // }}, - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/botservice/armbotservice/client_factory.go b/sdk/resourcemanager/botservice/armbotservice/client_factory.go index 3ba9cf6f6eb0..c55c2d84f579 100644 --- a/sdk/resourcemanager/botservice/armbotservice/client_factory.go +++ b/sdk/resourcemanager/botservice/armbotservice/client_factory.go @@ -73,6 +73,12 @@ func (c *ClientFactory) NewHostSettingsClient() *HostSettingsClient { return subClient } +// NewNetworkSecurityPerimeterConfigurationsClient creates a new instance of NetworkSecurityPerimeterConfigurationsClient. +func (c *ClientFactory) NewNetworkSecurityPerimeterConfigurationsClient() *NetworkSecurityPerimeterConfigurationsClient { + subClient, _ := NewNetworkSecurityPerimeterConfigurationsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + // NewOperationResultsClient creates a new instance of OperationResultsClient. func (c *ClientFactory) NewOperationResultsClient() *OperationResultsClient { subClient, _ := NewOperationResultsClient(c.subscriptionID, c.credential, c.options) diff --git a/sdk/resourcemanager/botservice/armbotservice/constants.go b/sdk/resourcemanager/botservice/armbotservice/constants.go index 149e38bcbfc3..9b10edf7f2bd 100644 --- a/sdk/resourcemanager/botservice/armbotservice/constants.go +++ b/sdk/resourcemanager/botservice/armbotservice/constants.go @@ -10,9 +10,27 @@ package armbotservice const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice" - moduleVersion = "v1.2.0" + moduleVersion = "v2.0.0-beta.1" ) +// AccessMode - Access Mode of the resource association +type AccessMode string + +const ( + 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 ( @@ -63,7 +81,7 @@ func PossibleChannelNameValues() []ChannelName { } // EmailChannelAuthMethod - Email channel auth method. 0 Password (Default); 1 Graph. -type EmailChannelAuthMethod float32 +type EmailChannelAuthMethod int32 const ( // EmailChannelAuthMethodGraph - Modern authentication. @@ -136,6 +154,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 +230,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 +267,7 @@ func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { return []PublicNetworkAccess{ PublicNetworkAccessDisabled, PublicNetworkAccessEnabled, + PublicNetworkAccessSecuredByPerimeter, } } @@ -258,3 +317,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..948b0906d9aa 100644 --- a/sdk/resourcemanager/botservice/armbotservice/directline_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/directline_client.go @@ -46,7 +46,7 @@ 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 +// Generated from API version 2023-09-15-preview // - resourceGroupName - The name of the Bot resource group in the user subscription. // - resourceName - The name of the Bot resource. // - channelName - The name of the Channel resource for which keys are to be regenerated. @@ -99,7 +99,7 @@ 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"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/botservice/armbotservice/directline_client_example_test.go b/sdk/resourcemanager/botservice/armbotservice/directline_client_example_test.go deleted file mode 100644 index c7c230411c8d..000000000000 --- a/sdk/resourcemanager/botservice/armbotservice/directline_client_example_test.go +++ /dev/null @@ -1,100 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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" -) - -// 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 -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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDirectLineClient().RegenerateKeys(ctx, "OneResourceGroupName", "samplebotname", armbotservice.RegenerateKeysChannelNameDirectLineChannel, armbotservice.SiteInfo{ - Key: to.Ptr(armbotservice.KeyKey1), - SiteName: to.Ptr("testSiteName"), - }, 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{ - // 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 -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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDirectLineClient().RegenerateKeys(ctx, "OneResourceGroupName", "samplebotname", armbotservice.RegenerateKeysChannelNameWebChatChannel, armbotservice.SiteInfo{ - Key: to.Ptr(armbotservice.KeyKey1), - SiteName: to.Ptr("testSiteName"), - }, 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{ - // 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..03d52149834e 100644 --- a/sdk/resourcemanager/botservice/armbotservice/email_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/email_client.go @@ -46,7 +46,7 @@ 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 +// Generated from API version 2023-09-15-preview // - resourceGroupName - The name of the Bot resource group in the user subscription. // - resourceName - The name of the Bot resource. // - options - EmailClientCreateSignInURLOptions contains the optional parameters for the EmailClient.CreateSignInURL method. @@ -92,7 +92,7 @@ func (client *EmailClient) createSignInURLCreateRequest(ctx context.Context, res 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 deleted file mode 100644 index eefe5a663e05..000000000000 --- a/sdk/resourcemanager/botservice/armbotservice/email_client_example_test.go +++ /dev/null @@ -1,45 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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" -) - -// 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 -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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEmailClient().CreateSignInURL(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.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..d775c9e01b5d 100644 --- a/sdk/resourcemanager/botservice/armbotservice/fake/botconnection_server.go +++ b/sdk/resourcemanager/botservice/armbotservice/fake/botconnection_server.go @@ -16,7 +16,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" diff --git a/sdk/resourcemanager/botservice/armbotservice/fake/bots_server.go b/sdk/resourcemanager/botservice/armbotservice/fake/bots_server.go index 7ad8c6f200ab..5f8a009a1a30 100644 --- a/sdk/resourcemanager/botservice/armbotservice/fake/bots_server.go +++ b/sdk/resourcemanager/botservice/armbotservice/fake/bots_server.go @@ -16,7 +16,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" diff --git a/sdk/resourcemanager/botservice/armbotservice/fake/channels_server.go b/sdk/resourcemanager/botservice/armbotservice/fake/channels_server.go index dde4d08c2161..13549ae7be9e 100644 --- a/sdk/resourcemanager/botservice/armbotservice/fake/channels_server.go +++ b/sdk/resourcemanager/botservice/armbotservice/fake/channels_server.go @@ -16,7 +16,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" @@ -30,11 +30,11 @@ type ChannelsServer struct { // Delete is the fake for method ChannelsClient.Delete // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent - Delete func(ctx context.Context, resourceGroupName string, resourceName string, channelName string, options *armbotservice.ChannelsClientDeleteOptions) (resp azfake.Responder[armbotservice.ChannelsClientDeleteResponse], errResp azfake.ErrorResponder) + Delete func(ctx context.Context, resourceGroupName string, resourceName string, channelName armbotservice.ChannelName, options *armbotservice.ChannelsClientDeleteOptions) (resp azfake.Responder[armbotservice.ChannelsClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method ChannelsClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, resourceName string, channelName string, options *armbotservice.ChannelsClientGetOptions) (resp azfake.Responder[armbotservice.ChannelsClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, resourceName string, channelName armbotservice.ChannelName, options *armbotservice.ChannelsClientGetOptions) (resp azfake.Responder[armbotservice.ChannelsClientGetResponse], errResp azfake.ErrorResponder) // NewListByResourceGroupPager is the fake for method ChannelsClient.NewListByResourceGroupPager // HTTP status codes to indicate success: http.StatusOK @@ -166,7 +166,13 @@ func (c *ChannelsServerTransport) dispatchDelete(req *http.Request) (*http.Respo if err != nil { return nil, err } - channelNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("channelName")]) + channelNameParam, err := parseWithCast(matches[regex.SubexpIndex("channelName")], func(v string) (armbotservice.ChannelName, error) { + p, unescapeErr := url.PathUnescape(v) + if unescapeErr != nil { + return "", unescapeErr + } + return armbotservice.ChannelName(p), nil + }) if err != nil { return nil, err } @@ -203,7 +209,13 @@ func (c *ChannelsServerTransport) dispatchGet(req *http.Request) (*http.Response if err != nil { return nil, err } - channelNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("channelName")]) + channelNameParam, err := parseWithCast(matches[regex.SubexpIndex("channelName")], func(v string) (armbotservice.ChannelName, error) { + p, unescapeErr := url.PathUnescape(v) + if unescapeErr != nil { + return "", unescapeErr + } + return armbotservice.ChannelName(p), nil + }) if err != nil { return nil, err } diff --git a/sdk/resourcemanager/botservice/armbotservice/fake/directline_server.go b/sdk/resourcemanager/botservice/armbotservice/fake/directline_server.go index d3d8a0683ff5..05527df8d163 100644 --- a/sdk/resourcemanager/botservice/armbotservice/fake/directline_server.go +++ b/sdk/resourcemanager/botservice/armbotservice/fake/directline_server.go @@ -15,7 +15,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" diff --git a/sdk/resourcemanager/botservice/armbotservice/fake/email_server.go b/sdk/resourcemanager/botservice/armbotservice/fake/email_server.go index 3557d7c80a7f..06afa09b090f 100644 --- a/sdk/resourcemanager/botservice/armbotservice/fake/email_server.go +++ b/sdk/resourcemanager/botservice/armbotservice/fake/email_server.go @@ -15,7 +15,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" diff --git a/sdk/resourcemanager/botservice/armbotservice/fake/hostsettings_server.go b/sdk/resourcemanager/botservice/armbotservice/fake/hostsettings_server.go index 4364c6b06d18..d3d20928aec8 100644 --- a/sdk/resourcemanager/botservice/armbotservice/fake/hostsettings_server.go +++ b/sdk/resourcemanager/botservice/armbotservice/fake/hostsettings_server.go @@ -15,7 +15,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" ) 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..fe1e2b644f82 --- /dev/null +++ b/sdk/resourcemanager/botservice/armbotservice/fake/networksecurityperimeterconfigurations_server.go @@ -0,0 +1,212 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/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")} + } + + var resp *http.Response + var err error + + switch method { + case "NetworkSecurityPerimeterConfigurationsClient.Get": + resp, err = n.dispatchGet(req) + case "NetworkSecurityPerimeterConfigurationsClient.NewListPager": + resp, err = n.dispatchNewListPager(req) + case "NetworkSecurityPerimeterConfigurationsClient.BeginReconcile": + resp, err = n.dispatchBeginReconcile(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +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 matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + 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 matches == nil || len(matches) < 3 { + 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 matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + 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 +} diff --git a/sdk/resourcemanager/botservice/armbotservice/fake/operationresults_server.go b/sdk/resourcemanager/botservice/armbotservice/fake/operationresults_server.go index 06dd5c325606..354d416d061c 100644 --- a/sdk/resourcemanager/botservice/armbotservice/fake/operationresults_server.go +++ b/sdk/resourcemanager/botservice/armbotservice/fake/operationresults_server.go @@ -15,7 +15,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" diff --git a/sdk/resourcemanager/botservice/armbotservice/fake/operations_server.go b/sdk/resourcemanager/botservice/armbotservice/fake/operations_server.go index a467dd6e6eab..a5ebbb165a0a 100644 --- a/sdk/resourcemanager/botservice/armbotservice/fake/operations_server.go +++ b/sdk/resourcemanager/botservice/armbotservice/fake/operations_server.go @@ -15,7 +15,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" ) diff --git a/sdk/resourcemanager/botservice/armbotservice/fake/privateendpointconnections_server.go b/sdk/resourcemanager/botservice/armbotservice/fake/privateendpointconnections_server.go index 17115bf5a29c..6410e749ca10 100644 --- a/sdk/resourcemanager/botservice/armbotservice/fake/privateendpointconnections_server.go +++ b/sdk/resourcemanager/botservice/armbotservice/fake/privateendpointconnections_server.go @@ -15,7 +15,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" diff --git a/sdk/resourcemanager/botservice/armbotservice/fake/privatelinkresources_server.go b/sdk/resourcemanager/botservice/armbotservice/fake/privatelinkresources_server.go index c34ec64a9952..ee315c8e3ecc 100644 --- a/sdk/resourcemanager/botservice/armbotservice/fake/privatelinkresources_server.go +++ b/sdk/resourcemanager/botservice/armbotservice/fake/privatelinkresources_server.go @@ -15,7 +15,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" diff --git a/sdk/resourcemanager/botservice/armbotservice/fake/qnamakerendpointkeys_server.go b/sdk/resourcemanager/botservice/armbotservice/fake/qnamakerendpointkeys_server.go index b38f932fcb7b..fd6b00c4d2aa 100644 --- a/sdk/resourcemanager/botservice/armbotservice/fake/qnamakerendpointkeys_server.go +++ b/sdk/resourcemanager/botservice/armbotservice/fake/qnamakerendpointkeys_server.go @@ -15,7 +15,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" ) diff --git a/sdk/resourcemanager/botservice/armbotservice/fake/server_factory.go b/sdk/resourcemanager/botservice/armbotservice/fake/server_factory.go index c98ddb569262..48e66f67d8e4 100644 --- a/sdk/resourcemanager/botservice/armbotservice/fake/server_factory.go +++ b/sdk/resourcemanager/botservice/armbotservice/fake/server_factory.go @@ -19,17 +19,18 @@ 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 - PrivateEndpointConnectionsServer PrivateEndpointConnectionsServer - PrivateLinkResourcesServer PrivateLinkResourcesServer - QnAMakerEndpointKeysServer QnAMakerEndpointKeysServer + BotConnectionServer BotConnectionServer + BotsServer BotsServer + ChannelsServer ChannelsServer + DirectLineServer DirectLineServer + EmailServer EmailServer + HostSettingsServer HostSettingsServer + NetworkSecurityPerimeterConfigurationsServer NetworkSecurityPerimeterConfigurationsServer + OperationResultsServer OperationResultsServer + OperationsServer OperationsServer + PrivateEndpointConnectionsServer PrivateEndpointConnectionsServer + PrivateLinkResourcesServer PrivateLinkResourcesServer + QnAMakerEndpointKeysServer QnAMakerEndpointKeysServer } // NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. @@ -44,19 +45,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 +94,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/go.mod b/sdk/resourcemanager/botservice/armbotservice/go.mod index 434f692a7c98..cc498fb212b1 100644 --- a/sdk/resourcemanager/botservice/armbotservice/go.mod +++ b/sdk/resourcemanager/botservice/armbotservice/go.mod @@ -1,10 +1,9 @@ -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.18 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.1.1 @@ -12,6 +11,7 @@ require ( ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dnaeon/go-vcr v1.2.0 // indirect diff --git a/sdk/resourcemanager/botservice/armbotservice/hostsettings_client.go b/sdk/resourcemanager/botservice/armbotservice/hostsettings_client.go index 6252608282e2..06a1357cc460 100644 --- a/sdk/resourcemanager/botservice/armbotservice/hostsettings_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/hostsettings_client.go @@ -46,7 +46,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 @@ -82,7 +82,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 deleted file mode 100644 index fb4ef845c7e7..000000000000 --- a/sdk/resourcemanager/botservice/armbotservice/hostsettings_client_example_test.go +++ /dev/null @@ -1,48 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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" -) - -// 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 -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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewHostSettingsClient().Get(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.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/models.go b/sdk/resourcemanager/botservice/armbotservice/models.go index 4d85c45a3d8f..e3655f8a91cc 100644 --- a/sdk/resourcemanager/botservice/armbotservice/models.go +++ b/sdk/resourcemanager/botservice/armbotservice/models.go @@ -80,7 +80,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. @@ -113,7 +113,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. @@ -245,6 +245,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 @@ -352,7 +355,7 @@ type ConnectionItemName struct { // ConnectionSetting - Bot channel resource definition type ConnectionSetting struct { - // Entity Tag + // Entity Tag. Etag *string // Required. Gets or sets the Kind of the resource. @@ -400,6 +403,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 @@ -653,6 +662,15 @@ type Error struct { Error *ErrorBody } +// ErrorAdditionalInfo - The resource management error additional info. +type ErrorAdditionalInfo struct { + // READ-ONLY; The additional info. + Info any + + // READ-ONLY; The additional info type. + Type *string +} + // ErrorBody - Bot Service error body. type ErrorBody struct { // REQUIRED; error code @@ -662,6 +680,31 @@ type ErrorBody struct { Message *string } +// ErrorDetail - The error detail. +type ErrorDetail struct { + // READ-ONLY; The error additional info. + AdditionalInfo []*ErrorAdditionalInfo + + // READ-ONLY; The error code. + Code *string + + // READ-ONLY; The error details. + Details []*ErrorDetail + + // READ-ONLY; The error message. + Message *string + + // READ-ONLY; The error target. + Target *string +} + +// ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. +// (This also follows the OData error response format.). +type ErrorResponse struct { + // The error object. + Error *ErrorDetail +} + // FacebookChannel - Facebook channel definition type FacebookChannel struct { // REQUIRED; The channel name @@ -850,7 +893,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. @@ -964,6 +1007,97 @@ 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 { + // Fully qualified identifier of the resource + ID *string + + // Name of the resource + Name *string + + // Type of the resource + Type *string + + // READ-ONLY; Properties of the Network Security Perimeter configuration + Properties *NetworkSecurityPerimeterConfigurationProperties +} + +// NetworkSecurityPerimeterConfigurationList - Result of the List NetworkSecurityPerimeterConfiguration operation. +type NetworkSecurityPerimeterConfigurationList struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string + + // READ-ONLY; A collection of Network Security Perimeter configurations + Value []*NetworkSecurityPerimeterConfiguration +} + +// 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 @@ -1168,6 +1302,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. @@ -1194,7 +1373,7 @@ type QnAMakerEndpointKeysResponse struct { // Resource - Azure resource type Resource struct { - // Entity Tag + // Entity Tag. Etag *string // Required. Gets or sets the Kind of the resource. @@ -1222,6 +1401,15 @@ type Resource struct { Zones []*string } +// ResourceAssociation - Information about resource association +type ResourceAssociation struct { + // Access Mode of the resource association + AccessMode *AccessMode + + // Name of the resource association + Name *string +} + // SKU - The SKU of the cognitive services account. type SKU struct { // REQUIRED; The sku name diff --git a/sdk/resourcemanager/botservice/armbotservice/models_serde.go b/sdk/resourcemanager/botservice/armbotservice/models_serde.go index f8b6f5b49f83..9a09841b0966 100644 --- a/sdk/resourcemanager/botservice/armbotservice/models_serde.go +++ b/sdk/resourcemanager/botservice/armbotservice/models_serde.go @@ -291,6 +291,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 +391,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) @@ -781,6 +785,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 +811,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) @@ -1312,6 +1324,37 @@ func (e *Error) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateAny(objectMap, "info", e.Info) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. +func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "info": + err = unpopulate(val, "Info", &e.Info) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ErrorBody. func (e ErrorBody) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1343,6 +1386,76 @@ func (e *ErrorBody) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. +func (e ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. +func (e *ErrorDetail) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + delete(rawMsg, key) + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. +func (e ErrorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "error", e.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. +func (e *ErrorResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &e.Error) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type FacebookChannel. func (f FacebookChannel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1926,6 +2039,263 @@ 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, "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 "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) @@ -2455,6 +2825,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) @@ -2584,6 +3071,37 @@ func (r *Resource) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ResourceAssociation. +func (r ResourceAssociation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accessMode", r.AccessMode) + populate(objectMap, "name", r.Name) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "accessMode": + err = unpopulate(val, "AccessMode", &r.AccessMode) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SKU. func (s SKU) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/sdk/resourcemanager/botservice/armbotservice/networksecurityperimeterconfigurations_client.go b/sdk/resourcemanager/botservice/armbotservice/networksecurityperimeterconfigurations_client.go new file mode 100644 index 000000000000..3e12d686230d --- /dev/null +++ b/sdk/resourcemanager/botservice/armbotservice/networksecurityperimeterconfigurations_client.go @@ -0,0 +1,260 @@ +//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 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 - Azure Subscription ID. +// - 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 Bot resource group in the user subscription. +// - 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, options *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 Bot resource group in the user subscription. +// - 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, options *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 Bot resource group in the user subscription. +// - 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, options *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/operationresults_client.go b/sdk/resourcemanager/botservice/armbotservice/operationresults_client.go index 9530d65da7e9..cf06fe7e04e2 100644 --- a/sdk/resourcemanager/botservice/armbotservice/operationresults_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/operationresults_client.go @@ -46,7 +46,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 +70,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" @@ -108,7 +108,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 deleted file mode 100644 index de33e353c27a..000000000000 --- a/sdk/resourcemanager/botservice/armbotservice/operationresults_client_example_test.go +++ /dev/null @@ -1,48 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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" -) - -// 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 -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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOperationResultsClient().BeginGet(ctx, "exampleid", 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.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), - // } -} diff --git a/sdk/resourcemanager/botservice/armbotservice/operations_client.go b/sdk/resourcemanager/botservice/armbotservice/operations_client.go index c6e42780575e..353b8ffe10aa 100644 --- a/sdk/resourcemanager/botservice/armbotservice/operations_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/operations_client.go @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all the available BotService operations. // -// 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]{ @@ -72,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(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/operations_client_example_test.go b/sdk/resourcemanager/botservice/armbotservice/operations_client_example_test.go deleted file mode 100644 index 0118d988c3f6..000000000000 --- a/sdk/resourcemanager/botservice/armbotservice/operations_client_example_test.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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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" -) - -// 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 -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) - 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.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"), - // }, - // { - // 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"), - // }, - // { - // 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"), - // }, - // { - // 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"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/botservice/armbotservice/options.go b/sdk/resourcemanager/botservice/armbotservice/options.go index 6763df9e8bf0..f48648b22aef 100644 --- a/sdk/resourcemanager/botservice/armbotservice/options.go +++ b/sdk/resourcemanager/botservice/armbotservice/options.go @@ -128,6 +128,25 @@ type HostSettingsClientGetOptions struct { // placeholder for future optional parameters } +// NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.BeginReconcile +// method. +type NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions struct { + // Resumes the LRO 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. diff --git a/sdk/resourcemanager/botservice/armbotservice/privateendpointconnections_client.go b/sdk/resourcemanager/botservice/armbotservice/privateendpointconnections_client.go index c56cb9f676a0..23c86a6aeaf3 100644 --- a/sdk/resourcemanager/botservice/armbotservice/privateendpointconnections_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/privateendpointconnections_client.go @@ -46,7 +46,7 @@ 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 +// Generated from API version 2023-09-15-preview // - resourceGroupName - The name of the Bot resource group in the user subscription. // - resourceName - The name of the Bot resource. // - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource @@ -99,7 +99,7 @@ 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"} if err := runtime.MarshalAsJSON(req, properties); err != nil { @@ -120,7 +120,7 @@ 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 +// Generated from API version 2023-09-15-preview // - resourceGroupName - The name of the Bot resource group in the user subscription. // - resourceName - The name of the Bot resource. // - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource @@ -171,7 +171,7 @@ 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 @@ -180,7 +180,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // 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 +// Generated from API version 2023-09-15-preview // - resourceGroupName - The name of the Bot resource group in the user subscription. // - resourceName - The name of the Bot resource. // - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource @@ -232,7 +232,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,7 +249,7 @@ 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 +// Generated from API version 2023-09-15-preview // - resourceGroupName - The name of the Bot resource group in the user subscription. // - resourceName - The name of the Bot resource. // - options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListPager @@ -298,7 +298,7 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co 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 deleted file mode 100644 index 458d69ebacd2..000000000000 --- a/sdk/resourcemanager/botservice/armbotservice/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,175 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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" -) - -// 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() { - 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) - 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), - // }, - // }}, - // } - } -} - -// 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() { - 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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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"), - // }, - // 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/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) - 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) - 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), - // }, - // } -} - -// 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() { - 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) - 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) - } -} diff --git a/sdk/resourcemanager/botservice/armbotservice/privatelinkresources_client.go b/sdk/resourcemanager/botservice/armbotservice/privatelinkresources_client.go index 445c18c18c53..262900eeab6f 100644 --- a/sdk/resourcemanager/botservice/armbotservice/privatelinkresources_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/privatelinkresources_client.go @@ -46,7 +46,7 @@ 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 +// Generated from API version 2023-09-15-preview // - resourceGroupName - The name of the Bot resource group in the user subscription. // - resourceName - The name of the Bot resource. // - options - PrivateLinkResourcesClientListByBotResourceOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByBotResource @@ -93,7 +93,7 @@ func (client *PrivateLinkResourcesClient) listByBotResourceCreateRequest(ctx 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 diff --git a/sdk/resourcemanager/botservice/armbotservice/privatelinkresources_client_example_test.go b/sdk/resourcemanager/botservice/armbotservice/privatelinkresources_client_example_test.go deleted file mode 100644 index 2ae0504011df..000000000000 --- a/sdk/resourcemanager/botservice/armbotservice/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,53 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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" -) - -// 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 -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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkResourcesClient().ListByBotResource(ctx, "res6977", "sto2527", 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.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")}, - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/botservice/armbotservice/qnamakerendpointkeys_client.go b/sdk/resourcemanager/botservice/armbotservice/qnamakerendpointkeys_client.go index aabf21bbba6e..5443b5a80d13 100644 --- a/sdk/resourcemanager/botservice/armbotservice/qnamakerendpointkeys_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/qnamakerendpointkeys_client.go @@ -46,7 +46,7 @@ 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 +// Generated from API version 2023-09-15-preview // - parameters - The request body parameters to provide for the check name availability request // - options - QnAMakerEndpointKeysClientGetOptions contains the optional parameters for the QnAMakerEndpointKeysClient.Get // method. @@ -84,7 +84,7 @@ 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"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/botservice/armbotservice/qnamakerendpointkeys_client_example_test.go b/sdk/resourcemanager/botservice/armbotservice/qnamakerendpointkeys_client_example_test.go deleted file mode 100644 index 3837e13fea78..000000000000 --- a/sdk/resourcemanager/botservice/armbotservice/qnamakerendpointkeys_client_example_test.go +++ /dev/null @@ -1,48 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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" -) - -// 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 -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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewQnAMakerEndpointKeysClient().Get(ctx, armbotservice.QnAMakerEndpointKeysRequestBody{ - Authkey: to.Ptr("testAuthKey"), - Hostname: to.Ptr("https://xxx.cognitiveservices.azure.com/"), - }, 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.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/response_types.go index 12d611860406..0bffd87bcc9c 100644 --- a/sdk/resourcemanager/botservice/armbotservice/response_types.go +++ b/sdk/resourcemanager/botservice/armbotservice/response_types.go @@ -143,6 +143,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.