diff --git a/sdk/resourcemanager/botservice/armbotservice/CHANGELOG.md b/sdk/resourcemanager/botservice/armbotservice/CHANGELOG.md index 0aaa02914b99..e3563773960b 100644 --- a/sdk/resourcemanager/botservice/armbotservice/CHANGELOG.md +++ b/sdk/resourcemanager/botservice/armbotservice/CHANGELOG.md @@ -1,5 +1,36 @@ # Release History +## 1.2.0-beta.1 (2023-10-10) +### 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.1.1 (2023-04-14) ### Bug Fixes diff --git a/sdk/resourcemanager/botservice/armbotservice/autorest.md b/sdk/resourcemanager/botservice/armbotservice/autorest.md index 40bc96e36b06..2f558e835003 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.1.1 +module-version: 1.2.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 60384eb9b8de..b0dc9dc98811 100644 --- a/sdk/resourcemanager/botservice/armbotservice/botconnection_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/botconnection_client.go @@ -3,9 +3,8 @@ // 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. +// 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. -// DO NOT EDIT. package armbotservice @@ -47,25 +46,28 @@ 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. // - parameters - The parameters to provide for creating the Connection Setting. // - options - BotConnectionClientCreateOptions contains the optional parameters for the BotConnectionClient.Create method. func (client *BotConnectionClient) Create(ctx context.Context, resourceGroupName string, resourceName string, connectionName string, parameters ConnectionSetting, options *BotConnectionClientCreateOptions) (BotConnectionClientCreateResponse, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, resourceName, connectionName, parameters, options) if err != nil { return BotConnectionClientCreateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BotConnectionClientCreateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return BotConnectionClientCreateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return BotConnectionClientCreateResponse{}, err } - return client.createHandleResponse(resp) + resp, err := client.createHandleResponse(httpResp) + return resp, err } // createCreateRequest creates the Create request. @@ -92,10 +94,13 @@ 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"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createHandleResponse handles the Create response. @@ -110,22 +115,24 @@ 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. // - options - BotConnectionClientDeleteOptions contains the optional parameters for the BotConnectionClient.Delete method. func (client *BotConnectionClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, connectionName string, options *BotConnectionClientDeleteOptions) (BotConnectionClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, connectionName, options) if err != nil { return BotConnectionClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BotConnectionClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return BotConnectionClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return BotConnectionClientDeleteResponse{}, err } return BotConnectionClientDeleteResponse{}, nil } @@ -154,7 +161,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 @@ -163,24 +170,27 @@ 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. // - options - BotConnectionClientGetOptions contains the optional parameters for the BotConnectionClient.Get method. func (client *BotConnectionClient) Get(ctx context.Context, resourceGroupName string, resourceName string, connectionName string, options *BotConnectionClientGetOptions) (BotConnectionClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, connectionName, options) if err != nil { return BotConnectionClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BotConnectionClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BotConnectionClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BotConnectionClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -207,7 +217,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 @@ -224,7 +234,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 @@ -277,7 +287,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 @@ -295,22 +305,25 @@ 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) { + var err error req, err := client.listServiceProvidersCreateRequest(ctx, options) if err != nil { return BotConnectionClientListServiceProvidersResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BotConnectionClientListServiceProvidersResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BotConnectionClientListServiceProvidersResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BotConnectionClientListServiceProvidersResponse{}, err } - return client.listServiceProvidersHandleResponse(resp) + resp, err := client.listServiceProvidersHandleResponse(httpResp) + return resp, err } // listServiceProvidersCreateRequest creates the ListServiceProviders request. @@ -325,7 +338,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 @@ -343,25 +356,28 @@ 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. // - options - BotConnectionClientListWithSecretsOptions contains the optional parameters for the BotConnectionClient.ListWithSecrets // method. func (client *BotConnectionClient) ListWithSecrets(ctx context.Context, resourceGroupName string, resourceName string, connectionName string, options *BotConnectionClientListWithSecretsOptions) (BotConnectionClientListWithSecretsResponse, error) { + var err error req, err := client.listWithSecretsCreateRequest(ctx, resourceGroupName, resourceName, connectionName, options) if err != nil { return BotConnectionClientListWithSecretsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BotConnectionClientListWithSecretsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BotConnectionClientListWithSecretsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BotConnectionClientListWithSecretsResponse{}, err } - return client.listWithSecretsHandleResponse(resp) + resp, err := client.listWithSecretsHandleResponse(httpResp) + return resp, err } // listWithSecretsCreateRequest creates the ListWithSecrets request. @@ -388,7 +404,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 @@ -406,25 +422,28 @@ 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. // - parameters - The parameters to provide for updating the Connection Setting. // - options - BotConnectionClientUpdateOptions contains the optional parameters for the BotConnectionClient.Update method. func (client *BotConnectionClient) Update(ctx context.Context, resourceGroupName string, resourceName string, connectionName string, parameters ConnectionSetting, options *BotConnectionClientUpdateOptions) (BotConnectionClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, resourceName, connectionName, parameters, options) if err != nil { return BotConnectionClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BotConnectionClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return BotConnectionClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return BotConnectionClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -451,10 +470,13 @@ 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"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. 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 b1187a91a19d..4a254d15e661 100644 --- a/sdk/resourcemanager/botservice/armbotservice/bots_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/bots_client.go @@ -3,9 +3,8 @@ // 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. +// 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. -// DO NOT EDIT. package armbotservice @@ -47,24 +46,27 @@ 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. // - options - BotsClientCreateOptions contains the optional parameters for the BotsClient.Create method. func (client *BotsClient) Create(ctx context.Context, resourceGroupName string, resourceName string, parameters Bot, options *BotsClientCreateOptions) (BotsClientCreateResponse, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { return BotsClientCreateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BotsClientCreateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return BotsClientCreateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return BotsClientCreateResponse{}, err } - return client.createHandleResponse(resp) + resp, err := client.createHandleResponse(httpResp) + return resp, err } // createCreateRequest creates the Create request. @@ -87,10 +89,13 @@ 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"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createHandleResponse handles the Create response. @@ -105,21 +110,23 @@ 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. func (client *BotsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, options *BotsClientDeleteOptions) (BotsClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return BotsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BotsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return BotsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return BotsClientDeleteResponse{}, err } return BotsClientDeleteResponse{}, nil } @@ -144,7 +151,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 @@ -153,23 +160,26 @@ 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. func (client *BotsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, options *BotsClientGetOptions) (BotsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return BotsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BotsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BotsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BotsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -192,7 +202,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 @@ -210,23 +220,26 @@ 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. func (client *BotsClient) GetCheckNameAvailability(ctx context.Context, parameters CheckNameAvailabilityRequestBody, options *BotsClientGetCheckNameAvailabilityOptions) (BotsClientGetCheckNameAvailabilityResponse, error) { + var err error req, err := client.getCheckNameAvailabilityCreateRequest(ctx, parameters, options) if err != nil { return BotsClientGetCheckNameAvailabilityResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BotsClientGetCheckNameAvailabilityResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BotsClientGetCheckNameAvailabilityResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BotsClientGetCheckNameAvailabilityResponse{}, err } - return client.getCheckNameAvailabilityHandleResponse(resp) + resp, err := client.getCheckNameAvailabilityHandleResponse(httpResp) + return resp, err } // getCheckNameAvailabilityCreateRequest creates the GetCheckNameAvailability request. @@ -237,10 +250,13 @@ 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"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // getCheckNameAvailabilityHandleResponse handles the GetCheckNameAvailability response. @@ -254,7 +270,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]{ @@ -296,7 +312,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 @@ -313,7 +329,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. @@ -361,7 +377,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 @@ -379,24 +395,27 @@ 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. // - options - BotsClientUpdateOptions contains the optional parameters for the BotsClient.Update method. func (client *BotsClient) Update(ctx context.Context, resourceGroupName string, resourceName string, parameters Bot, options *BotsClientUpdateOptions) (BotsClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { return BotsClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BotsClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return BotsClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return BotsClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -419,10 +438,13 @@ 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"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. 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/channels_client.go b/sdk/resourcemanager/botservice/armbotservice/channels_client.go index b21a52d77512..18e00598aab7 100644 --- a/sdk/resourcemanager/botservice/armbotservice/channels_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/channels_client.go @@ -3,9 +3,8 @@ // 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. +// 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. -// DO NOT EDIT. package armbotservice @@ -47,25 +46,28 @@ 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. // - parameters - The parameters to provide for the created bot. // - options - ChannelsClientCreateOptions contains the optional parameters for the ChannelsClient.Create method. func (client *ChannelsClient) Create(ctx context.Context, resourceGroupName string, resourceName string, channelName ChannelName, parameters BotChannel, options *ChannelsClientCreateOptions) (ChannelsClientCreateResponse, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, resourceName, channelName, parameters, options) if err != nil { return ChannelsClientCreateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ChannelsClientCreateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ChannelsClientCreateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ChannelsClientCreateResponse{}, err } - return client.createHandleResponse(resp) + resp, err := client.createHandleResponse(httpResp) + return resp, err } // createCreateRequest creates the Create request. @@ -92,10 +94,13 @@ 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"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createHandleResponse handles the Create response. @@ -110,22 +115,24 @@ 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. // - 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) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, channelName, options) if err != nil { return ChannelsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ChannelsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return ChannelsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ChannelsClientDeleteResponse{}, err } return ChannelsClientDeleteResponse{}, nil } @@ -154,7 +161,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 @@ -163,24 +170,27 @@ 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. // - 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) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, channelName, options) if err != nil { return ChannelsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ChannelsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ChannelsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ChannelsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -207,7 +217,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 @@ -224,7 +234,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 @@ -277,7 +287,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 @@ -295,24 +305,27 @@ 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. // - options - ChannelsClientListWithKeysOptions contains the optional parameters for the ChannelsClient.ListWithKeys method. func (client *ChannelsClient) ListWithKeys(ctx context.Context, resourceGroupName string, resourceName string, channelName ChannelName, options *ChannelsClientListWithKeysOptions) (ChannelsClientListWithKeysResponse, error) { + var err error req, err := client.listWithKeysCreateRequest(ctx, resourceGroupName, resourceName, channelName, options) if err != nil { return ChannelsClientListWithKeysResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ChannelsClientListWithKeysResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ChannelsClientListWithKeysResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ChannelsClientListWithKeysResponse{}, err } - return client.listWithKeysHandleResponse(resp) + resp, err := client.listWithKeysHandleResponse(httpResp) + return resp, err } // listWithKeysCreateRequest creates the ListWithKeys request. @@ -339,7 +352,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 @@ -357,25 +370,28 @@ 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. // - parameters - The parameters to provide for the created bot. // - options - ChannelsClientUpdateOptions contains the optional parameters for the ChannelsClient.Update method. func (client *ChannelsClient) Update(ctx context.Context, resourceGroupName string, resourceName string, channelName ChannelName, parameters BotChannel, options *ChannelsClientUpdateOptions) (ChannelsClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, resourceName, channelName, parameters, options) if err != nil { return ChannelsClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ChannelsClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ChannelsClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ChannelsClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -402,10 +418,13 @@ 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"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. 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 a2b2957a5a96..00364e81bc89 100644 --- a/sdk/resourcemanager/botservice/armbotservice/client_factory.go +++ b/sdk/resourcemanager/botservice/armbotservice/client_factory.go @@ -3,9 +3,8 @@ // 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. +// 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. -// DO NOT EDIT. package armbotservice @@ -38,6 +37,11 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, nil } +func (c *ClientFactory) NewBotConnectionClient() *BotConnectionClient { + subClient, _ := NewBotConnectionClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewBotsClient() *BotsClient { subClient, _ := NewBotsClient(c.subscriptionID, c.credential, c.options) return subClient @@ -58,28 +62,23 @@ func (c *ClientFactory) NewEmailClient() *EmailClient { return subClient } -func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) +func (c *ClientFactory) NewHostSettingsClient() *HostSettingsClient { + subClient, _ := NewHostSettingsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewBotConnectionClient() *BotConnectionClient { - subClient, _ := NewBotConnectionClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewNetworkSecurityPerimeterConfigurationsClient() *NetworkSecurityPerimeterConfigurationsClient { + subClient, _ := NewNetworkSecurityPerimeterConfigurationsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewQnAMakerEndpointKeysClient() *QnAMakerEndpointKeysClient { - subClient, _ := NewQnAMakerEndpointKeysClient(c.subscriptionID, c.credential, c.options) - return subClient -} - -func (c *ClientFactory) NewHostSettingsClient() *HostSettingsClient { - subClient, _ := NewHostSettingsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewOperationResultsClient() *OperationResultsClient { + subClient, _ := NewOperationResultsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewOperationResultsClient() *OperationResultsClient { - subClient, _ := NewOperationResultsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + subClient, _ := NewOperationsClient(c.credential, c.options) return subClient } @@ -92,3 +91,8 @@ func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesCli subClient, _ := NewPrivateLinkResourcesClient(c.subscriptionID, c.credential, c.options) return subClient } + +func (c *ClientFactory) NewQnAMakerEndpointKeysClient() *QnAMakerEndpointKeysClient { + subClient, _ := NewQnAMakerEndpointKeysClient(c.subscriptionID, c.credential, c.options) + return subClient +} diff --git a/sdk/resourcemanager/botservice/armbotservice/constants.go b/sdk/resourcemanager/botservice/armbotservice/constants.go index 91ad5970b3d9..72b0f5337720 100644 --- a/sdk/resourcemanager/botservice/armbotservice/constants.go +++ b/sdk/resourcemanager/botservice/armbotservice/constants.go @@ -3,63 +3,80 @@ // 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. +// 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. -// DO NOT EDIT. package armbotservice const ( moduleName = "armbotservice" - moduleVersion = "v1.1.1" + moduleVersion = "v1.2.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 ( + ChannelNameAcsChatChannel ChannelName = "AcsChatChannel" ChannelNameAlexaChannel ChannelName = "AlexaChannel" - ChannelNameFacebookChannel ChannelName = "FacebookChannel" + ChannelNameDirectLineChannel ChannelName = "DirectLineChannel" + ChannelNameDirectLineSpeechChannel ChannelName = "DirectLineSpeechChannel" ChannelNameEmailChannel ChannelName = "EmailChannel" + ChannelNameFacebookChannel ChannelName = "FacebookChannel" ChannelNameKikChannel ChannelName = "KikChannel" - ChannelNameTelegramChannel ChannelName = "TelegramChannel" - ChannelNameSlackChannel ChannelName = "SlackChannel" + ChannelNameLineChannel ChannelName = "LineChannel" + ChannelNameM365Extensions ChannelName = "M365Extensions" ChannelNameMsTeamsChannel ChannelName = "MsTeamsChannel" + ChannelNameOmnichannel ChannelName = "Omnichannel" + ChannelNameOutlookChannel ChannelName = "OutlookChannel" + ChannelNameSearchAssistant ChannelName = "SearchAssistant" ChannelNameSkypeChannel ChannelName = "SkypeChannel" - ChannelNameWebChatChannel ChannelName = "WebChatChannel" - ChannelNameDirectLineChannel ChannelName = "DirectLineChannel" + ChannelNameSlackChannel ChannelName = "SlackChannel" ChannelNameSmsChannel ChannelName = "SmsChannel" - ChannelNameLineChannel ChannelName = "LineChannel" - ChannelNameDirectLineSpeechChannel ChannelName = "DirectLineSpeechChannel" - ChannelNameOutlookChannel ChannelName = "OutlookChannel" - ChannelNameOmnichannel ChannelName = "Omnichannel" + ChannelNameTelegramChannel ChannelName = "TelegramChannel" ChannelNameTelephonyChannel ChannelName = "TelephonyChannel" - ChannelNameAcsChatChannel ChannelName = "AcsChatChannel" - ChannelNameSearchAssistant ChannelName = "SearchAssistant" - ChannelNameM365Extensions ChannelName = "M365Extensions" + ChannelNameWebChatChannel ChannelName = "WebChatChannel" ) // PossibleChannelNameValues returns the possible values for the ChannelName const type. func PossibleChannelNameValues() []ChannelName { return []ChannelName{ + ChannelNameAcsChatChannel, ChannelNameAlexaChannel, - ChannelNameFacebookChannel, + ChannelNameDirectLineChannel, + ChannelNameDirectLineSpeechChannel, ChannelNameEmailChannel, + ChannelNameFacebookChannel, ChannelNameKikChannel, - ChannelNameTelegramChannel, - ChannelNameSlackChannel, + ChannelNameLineChannel, + ChannelNameM365Extensions, ChannelNameMsTeamsChannel, + ChannelNameOmnichannel, + ChannelNameOutlookChannel, + ChannelNameSearchAssistant, ChannelNameSkypeChannel, - ChannelNameWebChatChannel, - ChannelNameDirectLineChannel, + ChannelNameSlackChannel, ChannelNameSmsChannel, - ChannelNameLineChannel, - ChannelNameDirectLineSpeechChannel, - ChannelNameOutlookChannel, - ChannelNameOmnichannel, + ChannelNameTelegramChannel, ChannelNameTelephonyChannel, - ChannelNameAcsChatChannel, - ChannelNameSearchAssistant, - ChannelNameM365Extensions, + ChannelNameWebChatChannel, } } @@ -67,17 +84,17 @@ func PossibleChannelNameValues() []ChannelName { type EmailChannelAuthMethod float32 const ( - // EmailChannelAuthMethodPassword - Basic authentication. - EmailChannelAuthMethodPassword EmailChannelAuthMethod = 0 // EmailChannelAuthMethodGraph - Modern authentication. EmailChannelAuthMethodGraph EmailChannelAuthMethod = 1 + // EmailChannelAuthMethodPassword - Basic authentication. + EmailChannelAuthMethodPassword EmailChannelAuthMethod = 0 ) // PossibleEmailChannelAuthMethodValues returns the possible values for the EmailChannelAuthMethod const type. func PossibleEmailChannelAuthMethodValues() []EmailChannelAuthMethod { return []EmailChannelAuthMethod{ - EmailChannelAuthMethodPassword, EmailChannelAuthMethodGraph, + EmailChannelAuthMethodPassword, } } @@ -137,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 @@ -197,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. @@ -210,21 +267,22 @@ func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { return []PublicNetworkAccess{ PublicNetworkAccessDisabled, PublicNetworkAccessEnabled, + PublicNetworkAccessSecuredByPerimeter, } } type RegenerateKeysChannelName string const ( - RegenerateKeysChannelNameWebChatChannel RegenerateKeysChannelName = "WebChatChannel" RegenerateKeysChannelNameDirectLineChannel RegenerateKeysChannelName = "DirectLineChannel" + RegenerateKeysChannelNameWebChatChannel RegenerateKeysChannelName = "WebChatChannel" ) // PossibleRegenerateKeysChannelNameValues returns the possible values for the RegenerateKeysChannelName const type. func PossibleRegenerateKeysChannelNameValues() []RegenerateKeysChannelName { return []RegenerateKeysChannelName{ - RegenerateKeysChannelNameWebChatChannel, RegenerateKeysChannelNameDirectLineChannel, + RegenerateKeysChannelNameWebChatChannel, } } @@ -259,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 d8833ef8b1b2..5089da3184ca 100644 --- a/sdk/resourcemanager/botservice/armbotservice/directline_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/directline_client.go @@ -3,9 +3,8 @@ // 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. +// 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. -// DO NOT EDIT. package armbotservice @@ -47,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. @@ -55,18 +54,21 @@ func NewDirectLineClient(subscriptionID string, credential azcore.TokenCredentia // - options - DirectLineClientRegenerateKeysOptions contains the optional parameters for the DirectLineClient.RegenerateKeys // method. func (client *DirectLineClient) RegenerateKeys(ctx context.Context, resourceGroupName string, resourceName string, channelName RegenerateKeysChannelName, parameters SiteInfo, options *DirectLineClientRegenerateKeysOptions) (DirectLineClientRegenerateKeysResponse, error) { + var err error req, err := client.regenerateKeysCreateRequest(ctx, resourceGroupName, resourceName, channelName, parameters, options) if err != nil { return DirectLineClientRegenerateKeysResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DirectLineClientRegenerateKeysResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DirectLineClientRegenerateKeysResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DirectLineClientRegenerateKeysResponse{}, err } - return client.regenerateKeysHandleResponse(resp) + resp, err := client.regenerateKeysHandleResponse(httpResp) + return resp, err } // regenerateKeysCreateRequest creates the RegenerateKeys request. @@ -93,10 +95,13 @@ 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"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // regenerateKeysHandleResponse handles the RegenerateKeys response. 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 a0d8dca4f44d..349ccf082c0c 100644 --- a/sdk/resourcemanager/botservice/armbotservice/email_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/email_client.go @@ -3,9 +3,8 @@ // 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. +// 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. -// DO NOT EDIT. package armbotservice @@ -47,23 +46,26 @@ 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. func (client *EmailClient) CreateSignInURL(ctx context.Context, resourceGroupName string, resourceName string, options *EmailClientCreateSignInURLOptions) (EmailClientCreateSignInURLResponse, error) { + var err error req, err := client.createSignInURLCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return EmailClientCreateSignInURLResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return EmailClientCreateSignInURLResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return EmailClientCreateSignInURLResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return EmailClientCreateSignInURLResponse{}, err } - return client.createSignInURLHandleResponse(resp) + resp, err := client.createSignInURLHandleResponse(httpResp) + return resp, err } // createSignInURLCreateRequest creates the CreateSignInURL request. @@ -86,7 +88,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/go.mod b/sdk/resourcemanager/botservice/armbotservice/go.mod index 87ca2427d407..434a3be1c48c 100644 --- a/sdk/resourcemanager/botservice/armbotservice/go.mod +++ b/sdk/resourcemanager/botservice/armbotservice/go.mod @@ -3,15 +3,15 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotse go 1.18 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 - github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 + github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.1.1 github.com/stretchr/testify v1.7.0 ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dnaeon/go-vcr v1.1.0 // indirect @@ -21,9 +21,9 @@ require ( github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect golang.org/x/crypto v0.6.0 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + golang.org/x/net v0.8.0 // indirect + golang.org/x/sys v0.6.0 // indirect + golang.org/x/text v0.8.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/botservice/armbotservice/go.sum b/sdk/resourcemanager/botservice/armbotservice/go.sum index 9e67f59f4a17..926722ebe8a7 100644 --- a/sdk/resourcemanager/botservice/armbotservice/go.sum +++ b/sdk/resourcemanager/botservice/armbotservice/go.sum @@ -1,9 +1,9 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 h1:SEy2xmstIphdPwNBUi7uhvjyjhVKISfwjfOJmuy7kg4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 h1:mLY+pNLjCUeKhgnAJWAKhEUQM+RJQo2H1fuGSw1Ky1E= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2/go.mod h1:FbdwsQ2EzwvXxOPcMFYO8ogEc9uMMIj3YkmCdXdAFmk= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups v1.0.0 h1:pPvTJ1dY0sA35JOeFq6TsY2xj6Z85Yo23Pj4wCCvu4o= @@ -32,13 +32,13 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/sdk/resourcemanager/botservice/armbotservice/hostsettings_client.go b/sdk/resourcemanager/botservice/armbotservice/hostsettings_client.go index 83c06d11b752..1ade3e926c9d 100644 --- a/sdk/resourcemanager/botservice/armbotservice/hostsettings_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/hostsettings_client.go @@ -3,9 +3,8 @@ // 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. +// 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. -// DO NOT EDIT. package armbotservice @@ -47,21 +46,24 @@ 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 req, err := client.getCreateRequest(ctx, options) if err != nil { return HostSettingsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return HostSettingsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return HostSettingsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return HostSettingsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -76,7 +78,7 @@ func (client *HostSettingsClient) getCreateRequest(ctx context.Context, options return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-15") + reqQP.Set("api-version", "2023-09-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/botservice/armbotservice/hostsettings_client_example_test.go b/sdk/resourcemanager/botservice/armbotservice/hostsettings_client_example_test.go 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/interfaces.go b/sdk/resourcemanager/botservice/armbotservice/interfaces.go new file mode 100644 index 000000000000..42a17dcbe22f --- /dev/null +++ b/sdk/resourcemanager/botservice/armbotservice/interfaces.go @@ -0,0 +1,20 @@ +//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 + +// ChannelClassification provides polymorphic access to related types. +// Call the interface's GetChannel() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AcsChatChannel, *AlexaChannel, *Channel, *DirectLineChannel, *DirectLineSpeechChannel, *EmailChannel, *FacebookChannel, +// - *KikChannel, *LineChannel, *M365Extensions, *MsTeamsChannel, *Omnichannel, *OutlookChannel, *SearchAssistant, *SkypeChannel, +// - *SlackChannel, *SmsChannel, *TelegramChannel, *TelephonyChannel, *WebChatChannel +type ChannelClassification interface { + // GetChannel returns the Channel content of the underlying type. + GetChannel() *Channel +} diff --git a/sdk/resourcemanager/botservice/armbotservice/models.go b/sdk/resourcemanager/botservice/armbotservice/models.go index a73b60f4cce6..e3655f8a91cc 100644 --- a/sdk/resourcemanager/botservice/armbotservice/models.go +++ b/sdk/resourcemanager/botservice/armbotservice/models.go @@ -3,9 +3,8 @@ // 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. +// 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. -// DO NOT EDIT. package armbotservice @@ -31,8 +30,8 @@ func (a *AcsChatChannel) GetChannel() *Channel { return &Channel{ ChannelName: a.ChannelName, Etag: a.Etag, - ProvisioningState: a.ProvisioningState, Location: a.Location, + ProvisioningState: a.ProvisioningState, } } @@ -59,8 +58,8 @@ func (a *AlexaChannel) GetChannel() *Channel { return &Channel{ ChannelName: a.ChannelName, Etag: a.Etag, - ProvisioningState: a.ProvisioningState, Location: a.Location, + ProvisioningState: a.ProvisioningState, } } @@ -81,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. @@ -114,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. @@ -145,44 +144,6 @@ type BotChannel struct { Zones []*string } -// BotConnectionClientCreateOptions contains the optional parameters for the BotConnectionClient.Create method. -type BotConnectionClientCreateOptions struct { - // placeholder for future optional parameters -} - -// BotConnectionClientDeleteOptions contains the optional parameters for the BotConnectionClient.Delete method. -type BotConnectionClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// BotConnectionClientGetOptions contains the optional parameters for the BotConnectionClient.Get method. -type BotConnectionClientGetOptions struct { - // placeholder for future optional parameters -} - -// BotConnectionClientListByBotServiceOptions contains the optional parameters for the BotConnectionClient.NewListByBotServicePager -// method. -type BotConnectionClientListByBotServiceOptions struct { - // placeholder for future optional parameters -} - -// BotConnectionClientListServiceProvidersOptions contains the optional parameters for the BotConnectionClient.ListServiceProviders -// method. -type BotConnectionClientListServiceProvidersOptions struct { - // placeholder for future optional parameters -} - -// BotConnectionClientListWithSecretsOptions contains the optional parameters for the BotConnectionClient.ListWithSecrets -// method. -type BotConnectionClientListWithSecretsOptions struct { - // placeholder for future optional parameters -} - -// BotConnectionClientUpdateOptions contains the optional parameters for the BotConnectionClient.Update method. -type BotConnectionClientUpdateOptions struct { - // placeholder for future optional parameters -} - // BotProperties - The parameters to provide for the Bot. type BotProperties struct { // REQUIRED; The Name of the bot @@ -284,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 @@ -300,53 +264,6 @@ type BotResponseList struct { Value []*Bot } -// BotsClientCreateOptions contains the optional parameters for the BotsClient.Create method. -type BotsClientCreateOptions struct { - // placeholder for future optional parameters -} - -// BotsClientDeleteOptions contains the optional parameters for the BotsClient.Delete method. -type BotsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// BotsClientGetCheckNameAvailabilityOptions contains the optional parameters for the BotsClient.GetCheckNameAvailability -// method. -type BotsClientGetCheckNameAvailabilityOptions struct { - // placeholder for future optional parameters -} - -// BotsClientGetOptions contains the optional parameters for the BotsClient.Get method. -type BotsClientGetOptions struct { - // placeholder for future optional parameters -} - -// BotsClientListByResourceGroupOptions contains the optional parameters for the BotsClient.NewListByResourceGroupPager method. -type BotsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// BotsClientListOptions contains the optional parameters for the BotsClient.NewListPager method. -type BotsClientListOptions struct { - // placeholder for future optional parameters -} - -// BotsClientUpdateOptions contains the optional parameters for the BotsClient.Update method. -type BotsClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// ChannelClassification provides polymorphic access to related types. -// Call the interface's GetChannel() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AcsChatChannel, *AlexaChannel, *Channel, *DirectLineChannel, *DirectLineSpeechChannel, *EmailChannel, *FacebookChannel, -// - *KikChannel, *LineChannel, *M365Extensions, *MsTeamsChannel, *Omnichannel, *OutlookChannel, *SearchAssistant, *SkypeChannel, -// - *SlackChannel, *SmsChannel, *TelegramChannel, *TelephonyChannel, *WebChatChannel -type ChannelClassification interface { - // GetChannel returns the Channel content of the underlying type. - GetChannel() *Channel -} - // Channel definition type Channel struct { // REQUIRED; The channel name @@ -407,37 +324,6 @@ type ChannelSettings struct { Sites []*Site } -// ChannelsClientCreateOptions contains the optional parameters for the ChannelsClient.Create method. -type ChannelsClientCreateOptions struct { - // placeholder for future optional parameters -} - -// ChannelsClientDeleteOptions contains the optional parameters for the ChannelsClient.Delete method. -type ChannelsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ChannelsClientGetOptions contains the optional parameters for the ChannelsClient.Get method. -type ChannelsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ChannelsClientListByResourceGroupOptions contains the optional parameters for the ChannelsClient.NewListByResourceGroupPager -// method. -type ChannelsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ChannelsClientListWithKeysOptions contains the optional parameters for the ChannelsClient.ListWithKeys method. -type ChannelsClientListWithKeysOptions struct { - // placeholder for future optional parameters -} - -// ChannelsClientUpdateOptions contains the optional parameters for the ChannelsClient.Update method. -type ChannelsClientUpdateOptions struct { - // placeholder for future optional parameters -} - // CheckNameAvailabilityRequestBody - The request body for a request to Bot Service Management to check availability of a // bot name. type CheckNameAvailabilityRequestBody struct { @@ -469,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. @@ -517,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 @@ -586,8 +478,8 @@ func (d *DirectLineChannel) GetChannel() *Channel { return &Channel{ ChannelName: d.ChannelName, Etag: d.Etag, - ProvisioningState: d.ProvisioningState, Location: d.Location, + ProvisioningState: d.ProvisioningState, } } @@ -606,11 +498,6 @@ type DirectLineChannelProperties struct { Sites []*DirectLineSite } -// DirectLineClientRegenerateKeysOptions contains the optional parameters for the DirectLineClient.RegenerateKeys method. -type DirectLineClientRegenerateKeysOptions struct { - // placeholder for future optional parameters -} - // DirectLineSite - A site for the Direct Line channel type DirectLineSite struct { // REQUIRED; Whether this site is enabled for DirectLine channel @@ -694,8 +581,8 @@ func (d *DirectLineSpeechChannel) GetChannel() *Channel { return &Channel{ ChannelName: d.ChannelName, Etag: d.Etag, - ProvisioningState: d.ProvisioningState, Location: d.Location, + ProvisioningState: d.ProvisioningState, } } @@ -746,8 +633,8 @@ func (e *EmailChannel) GetChannel() *Channel { return &Channel{ ChannelName: e.ChannelName, Etag: e.Etag, - ProvisioningState: e.ProvisioningState, Location: e.Location, + ProvisioningState: e.ProvisioningState, } } @@ -769,17 +656,21 @@ type EmailChannelProperties struct { Password *string } -// EmailClientCreateSignInURLOptions contains the optional parameters for the EmailClient.CreateSignInURL method. -type EmailClientCreateSignInURLOptions struct { - // placeholder for future optional parameters -} - // Error - Bot Service error object. type Error struct { // The error body. 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 @@ -789,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 @@ -812,8 +728,8 @@ func (f *FacebookChannel) GetChannel() *Channel { return &Channel{ ChannelName: f.ChannelName, Etag: f.Etag, - ProvisioningState: f.ProvisioningState, Location: f.Location, + ProvisioningState: f.ProvisioningState, } } @@ -847,11 +763,6 @@ type FacebookPage struct { AccessToken *string } -// HostSettingsClientGetOptions contains the optional parameters for the HostSettingsClient.Get method. -type HostSettingsClientGetOptions struct { - // placeholder for future optional parameters -} - // HostSettingsResponse - The response body returned for a request to Bot Service Management to check per subscription hostSettings type HostSettingsResponse struct { // Same as toBotFromChannelOpenIdMetadataUrl, used by SDK < v4.12 @@ -902,8 +813,8 @@ func (k *KikChannel) GetChannel() *Channel { return &Channel{ ChannelName: k.ChannelName, Etag: k.Etag, - ProvisioningState: k.ProvisioningState, Location: k.Location, + ProvisioningState: k.ProvisioningState, } } @@ -945,8 +856,8 @@ func (l *LineChannel) GetChannel() *Channel { return &Channel{ ChannelName: l.ChannelName, Etag: l.Etag, - ProvisioningState: l.ProvisioningState, Location: l.Location, + ProvisioningState: l.ProvisioningState, } } @@ -982,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. @@ -1042,8 +953,8 @@ func (m *M365Extensions) GetChannel() *Channel { return &Channel{ ChannelName: m.ChannelName, Etag: m.Etag, - ProvisioningState: m.ProvisioningState, Location: m.Location, + ProvisioningState: m.ProvisioningState, } } @@ -1070,8 +981,8 @@ func (m *MsTeamsChannel) GetChannel() *Channel { return &Channel{ ChannelName: m.ChannelName, Etag: m.Etag, - ProvisioningState: m.ProvisioningState, Location: m.Location, + ProvisioningState: m.ProvisioningState, } } @@ -1096,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 @@ -1116,8 +1118,8 @@ func (o *Omnichannel) GetChannel() *Channel { return &Channel{ ChannelName: o.ChannelName, Etag: o.Etag, - ProvisioningState: o.ProvisioningState, Location: o.Location, + ProvisioningState: o.ProvisioningState, } } @@ -1160,12 +1162,6 @@ type OperationEntityListResult struct { Value []*OperationEntity } -// OperationResultsClientBeginGetOptions contains the optional parameters for the OperationResultsClient.BeginGet method. -type OperationResultsClientBeginGetOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - // OperationResultsDescription - The properties indicating the operation result of an operation on a service. type OperationResultsDescription struct { // READ-ONLY; The ID of the operation returned. @@ -1181,11 +1177,6 @@ type OperationResultsDescription struct { Status *OperationResultStatus } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters -} - // OutlookChannel - Outlook channel definition type OutlookChannel struct { // REQUIRED; The channel name @@ -1206,8 +1197,8 @@ func (o *OutlookChannel) GetChannel() *Channel { return &Channel{ ChannelName: o.ChannelName, Etag: o.Etag, - ProvisioningState: o.ProvisioningState, Location: o.Location, + ProvisioningState: o.ProvisioningState, } } @@ -1253,30 +1244,6 @@ type PrivateEndpointConnectionProperties struct { ProvisioningState *PrivateEndpointConnectionProvisioningState } -// PrivateEndpointConnectionsClientCreateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Create -// method. -type PrivateEndpointConnectionsClientCreateOptions struct { - // placeholder for future optional parameters -} - -// PrivateEndpointConnectionsClientDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Delete -// method. -type PrivateEndpointConnectionsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get -// method. -type PrivateEndpointConnectionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListPager -// method. -type PrivateEndpointConnectionsClientListOptions struct { - // placeholder for future optional parameters -} - // PrivateLinkResource - A private link resource type PrivateLinkResource struct { // Resource properties. @@ -1322,12 +1289,6 @@ type PrivateLinkResourceProperties struct { RequiredMembers []*string } -// PrivateLinkResourcesClientListByBotResourceOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByBotResource -// method. -type PrivateLinkResourcesClientListByBotResourceOptions struct { - // placeholder for future optional parameters -} - // PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer // and provider. type PrivateLinkServiceConnectionState struct { @@ -1341,9 +1302,49 @@ type PrivateLinkServiceConnectionState struct { Status *PrivateEndpointServiceConnectionStatus } -// QnAMakerEndpointKeysClientGetOptions contains the optional parameters for the QnAMakerEndpointKeysClient.Get method. -type QnAMakerEndpointKeysClientGetOptions struct { - // placeholder for future optional parameters +// 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. @@ -1372,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. @@ -1400,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 @@ -1429,8 +1439,8 @@ func (s *SearchAssistant) GetChannel() *Channel { return &Channel{ ChannelName: s.ChannelName, Etag: s.Etag, - ProvisioningState: s.ProvisioningState, Location: s.Location, + ProvisioningState: s.ProvisioningState, } } @@ -1598,8 +1608,8 @@ func (s *SkypeChannel) GetChannel() *Channel { return &Channel{ ChannelName: s.ChannelName, Etag: s.Etag, - ProvisioningState: s.ProvisioningState, Location: s.Location, + ProvisioningState: s.ProvisioningState, } } @@ -1659,8 +1669,8 @@ func (s *SlackChannel) GetChannel() *Channel { return &Channel{ ChannelName: s.ChannelName, Etag: s.Etag, - ProvisioningState: s.ProvisioningState, Location: s.Location, + ProvisioningState: s.ProvisioningState, } } @@ -1723,8 +1733,8 @@ func (s *SmsChannel) GetChannel() *Channel { return &Channel{ ChannelName: s.ChannelName, Etag: s.Etag, - ProvisioningState: s.ProvisioningState, Location: s.Location, + ProvisioningState: s.ProvisioningState, } } @@ -1769,8 +1779,8 @@ func (t *TelegramChannel) GetChannel() *Channel { return &Channel{ ChannelName: t.ChannelName, Etag: t.Etag, - ProvisioningState: t.ProvisioningState, Location: t.Location, + ProvisioningState: t.ProvisioningState, } } @@ -1809,8 +1819,8 @@ func (t *TelephonyChannel) GetChannel() *Channel { return &Channel{ ChannelName: t.ChannelName, Etag: t.Etag, - ProvisioningState: t.ProvisioningState, Location: t.Location, + ProvisioningState: t.ProvisioningState, } } @@ -1915,8 +1925,8 @@ func (w *WebChatChannel) GetChannel() *Channel { return &Channel{ ChannelName: w.ChannelName, Etag: w.Etag, - ProvisioningState: w.ProvisioningState, Location: w.Location, + ProvisioningState: w.ProvisioningState, } } diff --git a/sdk/resourcemanager/botservice/armbotservice/models_serde.go b/sdk/resourcemanager/botservice/armbotservice/models_serde.go index 5fa264122148..59a8b320b845 100644 --- a/sdk/resourcemanager/botservice/armbotservice/models_serde.go +++ b/sdk/resourcemanager/botservice/armbotservice/models_serde.go @@ -3,9 +3,8 @@ // 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. +// 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. -// DO NOT EDIT. package armbotservice @@ -292,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) @@ -391,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) @@ -782,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) @@ -806,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) @@ -1313,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) @@ -1344,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) @@ -1927,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) @@ -2456,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) @@ -2585,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..72a220e97a36 --- /dev/null +++ b/sdk/resourcemanager/botservice/armbotservice/networksecurityperimeterconfigurations_client.go @@ -0,0 +1,253 @@ +//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+".NetworkSecurityPerimeterConfigurationsClient", 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 + 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) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, resourceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return NetworkSecurityPerimeterConfigurationsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkSecurityPerimeterConfigurationsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NetworkSecurityPerimeterConfigurationsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// 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[NetworkSecurityPerimeterConfigurationsClientReconcileResponse](resp, client.internal.Pipeline(), nil) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[NetworkSecurityPerimeterConfigurationsClientReconcileResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// 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 + 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 e5096bad95f1..5d121cbbb258 100644 --- a/sdk/resourcemanager/botservice/armbotservice/operationresults_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/operationresults_client.go @@ -3,9 +3,8 @@ // 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. +// 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. -// DO NOT EDIT. package armbotservice @@ -47,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. @@ -57,7 +56,8 @@ func (client *OperationResultsClient) BeginGet(ctx context.Context, operationRes if err != nil { return nil, err } - return runtime.NewPoller[OperationResultsClientGetResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[OperationResultsClientGetResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[OperationResultsClientGetResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -66,20 +66,22 @@ 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 req, err := client.getCreateRequest(ctx, operationResultID, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // getCreateRequest creates the Get request. @@ -98,7 +100,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 46e0be02ce7a..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.2716301Z"); return t}()), - // Status: to.Ptr(armbotservice.OperationResultStatusRequested), - // } -} diff --git a/sdk/resourcemanager/botservice/armbotservice/operations_client.go b/sdk/resourcemanager/botservice/armbotservice/operations_client.go index 33a677ddb495..9b10322b7085 100644 --- a/sdk/resourcemanager/botservice/armbotservice/operations_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/operations_client.go @@ -3,9 +3,8 @@ // 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. +// 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. -// DO NOT EDIT. package armbotservice @@ -40,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]{ @@ -78,7 +77,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 new file mode 100644 index 000000000000..f48648b22aef --- /dev/null +++ b/sdk/resourcemanager/botservice/armbotservice/options.go @@ -0,0 +1,194 @@ +//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 + +// BotConnectionClientCreateOptions contains the optional parameters for the BotConnectionClient.Create method. +type BotConnectionClientCreateOptions struct { + // placeholder for future optional parameters +} + +// BotConnectionClientDeleteOptions contains the optional parameters for the BotConnectionClient.Delete method. +type BotConnectionClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// BotConnectionClientGetOptions contains the optional parameters for the BotConnectionClient.Get method. +type BotConnectionClientGetOptions struct { + // placeholder for future optional parameters +} + +// BotConnectionClientListByBotServiceOptions contains the optional parameters for the BotConnectionClient.NewListByBotServicePager +// method. +type BotConnectionClientListByBotServiceOptions struct { + // placeholder for future optional parameters +} + +// BotConnectionClientListServiceProvidersOptions contains the optional parameters for the BotConnectionClient.ListServiceProviders +// method. +type BotConnectionClientListServiceProvidersOptions struct { + // placeholder for future optional parameters +} + +// BotConnectionClientListWithSecretsOptions contains the optional parameters for the BotConnectionClient.ListWithSecrets +// method. +type BotConnectionClientListWithSecretsOptions struct { + // placeholder for future optional parameters +} + +// BotConnectionClientUpdateOptions contains the optional parameters for the BotConnectionClient.Update method. +type BotConnectionClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// BotsClientCreateOptions contains the optional parameters for the BotsClient.Create method. +type BotsClientCreateOptions struct { + // placeholder for future optional parameters +} + +// BotsClientDeleteOptions contains the optional parameters for the BotsClient.Delete method. +type BotsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// BotsClientGetCheckNameAvailabilityOptions contains the optional parameters for the BotsClient.GetCheckNameAvailability +// method. +type BotsClientGetCheckNameAvailabilityOptions struct { + // placeholder for future optional parameters +} + +// BotsClientGetOptions contains the optional parameters for the BotsClient.Get method. +type BotsClientGetOptions struct { + // placeholder for future optional parameters +} + +// BotsClientListByResourceGroupOptions contains the optional parameters for the BotsClient.NewListByResourceGroupPager method. +type BotsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// BotsClientListOptions contains the optional parameters for the BotsClient.NewListPager method. +type BotsClientListOptions struct { + // placeholder for future optional parameters +} + +// BotsClientUpdateOptions contains the optional parameters for the BotsClient.Update method. +type BotsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// ChannelsClientCreateOptions contains the optional parameters for the ChannelsClient.Create method. +type ChannelsClientCreateOptions struct { + // placeholder for future optional parameters +} + +// ChannelsClientDeleteOptions contains the optional parameters for the ChannelsClient.Delete method. +type ChannelsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ChannelsClientGetOptions contains the optional parameters for the ChannelsClient.Get method. +type ChannelsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ChannelsClientListByResourceGroupOptions contains the optional parameters for the ChannelsClient.NewListByResourceGroupPager +// method. +type ChannelsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ChannelsClientListWithKeysOptions contains the optional parameters for the ChannelsClient.ListWithKeys method. +type ChannelsClientListWithKeysOptions struct { + // placeholder for future optional parameters +} + +// ChannelsClientUpdateOptions contains the optional parameters for the ChannelsClient.Update method. +type ChannelsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// DirectLineClientRegenerateKeysOptions contains the optional parameters for the DirectLineClient.RegenerateKeys method. +type DirectLineClientRegenerateKeysOptions struct { + // placeholder for future optional parameters +} + +// EmailClientCreateSignInURLOptions contains the optional parameters for the EmailClient.CreateSignInURL method. +type EmailClientCreateSignInURLOptions struct { + // placeholder for future optional parameters +} + +// HostSettingsClientGetOptions contains the optional parameters for the HostSettingsClient.Get method. +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. + ResumeToken string +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientCreateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Create +// method. +type PrivateEndpointConnectionsClientCreateOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Delete +// method. +type PrivateEndpointConnectionsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get +// method. +type PrivateEndpointConnectionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListPager +// method. +type PrivateEndpointConnectionsClientListOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkResourcesClientListByBotResourceOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByBotResource +// method. +type PrivateLinkResourcesClientListByBotResourceOptions struct { + // placeholder for future optional parameters +} + +// QnAMakerEndpointKeysClientGetOptions contains the optional parameters for the QnAMakerEndpointKeysClient.Get method. +type QnAMakerEndpointKeysClientGetOptions struct { + // placeholder for future optional parameters +} diff --git a/sdk/resourcemanager/botservice/armbotservice/polymorphic_helpers.go b/sdk/resourcemanager/botservice/armbotservice/polymorphic_helpers.go index 48835e7262c8..6a816aaf5410 100644 --- a/sdk/resourcemanager/botservice/armbotservice/polymorphic_helpers.go +++ b/sdk/resourcemanager/botservice/armbotservice/polymorphic_helpers.go @@ -3,9 +3,8 @@ // 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. +// 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. -// DO NOT EDIT. package armbotservice @@ -62,5 +61,8 @@ func unmarshalChannelClassification(rawMsg json.RawMessage) (ChannelClassificati default: b = &Channel{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } diff --git a/sdk/resourcemanager/botservice/armbotservice/privateendpointconnections_client.go b/sdk/resourcemanager/botservice/armbotservice/privateendpointconnections_client.go index 5cf42b963209..8b5ccf4ba817 100644 --- a/sdk/resourcemanager/botservice/armbotservice/privateendpointconnections_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/privateendpointconnections_client.go @@ -3,9 +3,8 @@ // 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. +// 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. -// DO NOT EDIT. package armbotservice @@ -47,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 @@ -55,18 +54,21 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // - options - PrivateEndpointConnectionsClientCreateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Create // method. func (client *PrivateEndpointConnectionsClient) Create(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, properties PrivateEndpointConnection, options *PrivateEndpointConnectionsClientCreateOptions) (PrivateEndpointConnectionsClientCreateResponse, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, properties, options) if err != nil { return PrivateEndpointConnectionsClientCreateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PrivateEndpointConnectionsClientCreateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateEndpointConnectionsClientCreateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateEndpointConnectionsClientCreateResponse{}, err } - return client.createHandleResponse(resp) + resp, err := client.createHandleResponse(httpResp) + return resp, err } // createCreateRequest creates the Create request. @@ -93,10 +95,13 @@ 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"} - return req, runtime.MarshalAsJSON(req, properties) + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err + } + return req, nil } // createHandleResponse handles the Create response. @@ -111,23 +116,25 @@ 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 // - options - PrivateEndpointConnectionsClientDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Delete // method. func (client *PrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientDeleteOptions) (PrivateEndpointConnectionsClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, options) if err != nil { return PrivateEndpointConnectionsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PrivateEndpointConnectionsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return PrivateEndpointConnectionsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return PrivateEndpointConnectionsClientDeleteResponse{}, err } return PrivateEndpointConnectionsClientDeleteResponse{}, nil } @@ -156,7 +163,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 @@ -165,25 +172,28 @@ 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 // - options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get // method. func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, options) if err != nil { return PrivateEndpointConnectionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PrivateEndpointConnectionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateEndpointConnectionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateEndpointConnectionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -210,7 +220,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 @@ -227,7 +237,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 @@ -274,7 +284,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 c8bf6018f51b..3aed6d712e7e 100644 --- a/sdk/resourcemanager/botservice/armbotservice/privatelinkresources_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/privatelinkresources_client.go @@ -3,9 +3,8 @@ // 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. +// 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. -// DO NOT EDIT. package armbotservice @@ -47,24 +46,27 @@ 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 // method. func (client *PrivateLinkResourcesClient) ListByBotResource(ctx context.Context, resourceGroupName string, resourceName string, options *PrivateLinkResourcesClientListByBotResourceOptions) (PrivateLinkResourcesClientListByBotResourceResponse, error) { + var err error req, err := client.listByBotResourceCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return PrivateLinkResourcesClientListByBotResourceResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PrivateLinkResourcesClientListByBotResourceResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateLinkResourcesClientListByBotResourceResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateLinkResourcesClientListByBotResourceResponse{}, err } - return client.listByBotResourceHandleResponse(resp) + resp, err := client.listByBotResourceHandleResponse(httpResp) + return resp, err } // listByBotResourceCreateRequest creates the ListByBotResource request. @@ -87,7 +89,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 14b2d3ad19b1..c4964dfa3494 100644 --- a/sdk/resourcemanager/botservice/armbotservice/qnamakerendpointkeys_client.go +++ b/sdk/resourcemanager/botservice/armbotservice/qnamakerendpointkeys_client.go @@ -3,9 +3,8 @@ // 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. +// 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. -// DO NOT EDIT. package armbotservice @@ -47,23 +46,26 @@ 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. func (client *QnAMakerEndpointKeysClient) Get(ctx context.Context, parameters QnAMakerEndpointKeysRequestBody, options *QnAMakerEndpointKeysClientGetOptions) (QnAMakerEndpointKeysClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, parameters, options) if err != nil { return QnAMakerEndpointKeysClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return QnAMakerEndpointKeysClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return QnAMakerEndpointKeysClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return QnAMakerEndpointKeysClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -78,10 +80,13 @@ 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"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // getHandleResponse handles the Get response. 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 d854a0744848..0bffd87bcc9c 100644 --- a/sdk/resourcemanager/botservice/armbotservice/response_types.go +++ b/sdk/resourcemanager/botservice/armbotservice/response_types.go @@ -3,14 +3,14 @@ // 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. +// 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. -// DO NOT EDIT. package armbotservice // BotConnectionClientCreateResponse contains the response from method BotConnectionClient.Create. type BotConnectionClientCreateResponse struct { + // Bot channel resource definition ConnectionSetting } @@ -21,31 +21,37 @@ type BotConnectionClientDeleteResponse struct { // BotConnectionClientGetResponse contains the response from method BotConnectionClient.Get. type BotConnectionClientGetResponse struct { + // Bot channel resource definition ConnectionSetting } // BotConnectionClientListByBotServiceResponse contains the response from method BotConnectionClient.NewListByBotServicePager. type BotConnectionClientListByBotServiceResponse struct { + // The list of bot service connection settings response. ConnectionSettingResponseList } // BotConnectionClientListServiceProvidersResponse contains the response from method BotConnectionClient.ListServiceProviders. type BotConnectionClientListServiceProvidersResponse struct { + // The list of bot service providers response. ServiceProviderResponseList } // BotConnectionClientListWithSecretsResponse contains the response from method BotConnectionClient.ListWithSecrets. type BotConnectionClientListWithSecretsResponse struct { + // Bot channel resource definition ConnectionSetting } // BotConnectionClientUpdateResponse contains the response from method BotConnectionClient.Update. type BotConnectionClientUpdateResponse struct { + // Bot channel resource definition ConnectionSetting } // BotsClientCreateResponse contains the response from method BotsClient.Create. type BotsClientCreateResponse struct { + // Bot resource definition Bot } @@ -56,31 +62,37 @@ type BotsClientDeleteResponse struct { // BotsClientGetCheckNameAvailabilityResponse contains the response from method BotsClient.GetCheckNameAvailability. type BotsClientGetCheckNameAvailabilityResponse struct { + // The response body returned for a request to Bot Service Management to check availability of a bot name. CheckNameAvailabilityResponseBody } // BotsClientGetResponse contains the response from method BotsClient.Get. type BotsClientGetResponse struct { + // Bot resource definition Bot } // BotsClientListByResourceGroupResponse contains the response from method BotsClient.NewListByResourceGroupPager. type BotsClientListByResourceGroupResponse struct { + // The list of bot service operation response. BotResponseList } // BotsClientListResponse contains the response from method BotsClient.NewListPager. type BotsClientListResponse struct { + // The list of bot service operation response. BotResponseList } // BotsClientUpdateResponse contains the response from method BotsClient.Update. type BotsClientUpdateResponse struct { + // Bot resource definition Bot } // ChannelsClientCreateResponse contains the response from method ChannelsClient.Create. type ChannelsClientCreateResponse struct { + // Bot channel resource definition BotChannel } @@ -91,51 +103,79 @@ type ChannelsClientDeleteResponse struct { // ChannelsClientGetResponse contains the response from method ChannelsClient.Get. type ChannelsClientGetResponse struct { + // Bot channel resource definition BotChannel } // ChannelsClientListByResourceGroupResponse contains the response from method ChannelsClient.NewListByResourceGroupPager. type ChannelsClientListByResourceGroupResponse struct { + // The list of bot service channel operation response. ChannelResponseList } // ChannelsClientListWithKeysResponse contains the response from method ChannelsClient.ListWithKeys. type ChannelsClientListWithKeysResponse struct { + // The ARM channel of list channel with keys operation response. ListChannelWithKeysResponse } // ChannelsClientUpdateResponse contains the response from method ChannelsClient.Update. type ChannelsClientUpdateResponse struct { + // Bot channel resource definition BotChannel } // DirectLineClientRegenerateKeysResponse contains the response from method DirectLineClient.RegenerateKeys. type DirectLineClientRegenerateKeysResponse struct { + // Bot channel resource definition BotChannel } // EmailClientCreateSignInURLResponse contains the response from method EmailClient.CreateSignInURL. type EmailClientCreateSignInURLResponse struct { + // The ARM create email sign in url operation response. CreateEmailSignInURLResponse } // HostSettingsClientGetResponse contains the response from method HostSettingsClient.Get. type HostSettingsClientGetResponse struct { + // The response body returned for a request to Bot Service Management to check per subscription hostSettings 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. OperationResultsDescription } // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { + // The list of bot service operation response. OperationEntityListResult } // PrivateEndpointConnectionsClientCreateResponse contains the response from method PrivateEndpointConnectionsClient.Create. type PrivateEndpointConnectionsClientCreateResponse struct { + // The Private Endpoint Connection resource. PrivateEndpointConnection } @@ -146,20 +186,24 @@ type PrivateEndpointConnectionsClientDeleteResponse struct { // PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get. type PrivateEndpointConnectionsClientGetResponse struct { + // The Private Endpoint Connection resource. PrivateEndpointConnection } // PrivateEndpointConnectionsClientListResponse contains the response from method PrivateEndpointConnectionsClient.NewListPager. type PrivateEndpointConnectionsClientListResponse struct { + // List of private endpoint connection associated with the specified storage account PrivateEndpointConnectionListResult } // PrivateLinkResourcesClientListByBotResourceResponse contains the response from method PrivateLinkResourcesClient.ListByBotResource. type PrivateLinkResourcesClientListByBotResourceResponse struct { + // A list of private link resources PrivateLinkResourceListResult } // QnAMakerEndpointKeysClientGetResponse contains the response from method QnAMakerEndpointKeysClient.Get. type QnAMakerEndpointKeysClientGetResponse struct { + // Schema for EndpointKeys generate/refresh operations. QnAMakerEndpointKeysResponse } diff --git a/sdk/resourcemanager/botservice/armbotservice/time_rfc3339.go b/sdk/resourcemanager/botservice/armbotservice/time_rfc3339.go index 4e7d2d01999c..21c64b5dc13b 100644 --- a/sdk/resourcemanager/botservice/armbotservice/time_rfc3339.go +++ b/sdk/resourcemanager/botservice/armbotservice/time_rfc3339.go @@ -3,9 +3,8 @@ // 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. +// 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. -// DO NOT EDIT. package armbotservice