From 492ea1e78bd1f04c09bc5eef97b117e8ffb21e4f Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 15 Mar 2022 11:04:12 +0000 Subject: [PATCH] CodeGen from PR 18255 in Azure/azure-rest-api-specs Merge 947333e51a47a11269064ddd0cb1eafa057a621f into 6354ca8bf06ea064f4f0fef331a10c1baf62ac35 --- .../src/Generated/AzureBotServiceClient.cs | 94 +- .../src/Generated/BotConnectionOperations.cs | 1890 +++++++++++++++++ .../BotConnectionOperationsExtensions.cs | 370 ++++ .../src/Generated/BotsOperations.cs | 91 +- .../src/Generated/BotsOperationsExtensions.cs | 24 +- .../src/Generated/ChannelsOperations.cs | 122 +- .../Generated/ChannelsOperationsExtensions.cs | 56 +- .../src/Generated/DirectLineOperations.cs | 300 +++ .../DirectLineOperationsExtensions.cs | 81 + .../src/Generated/HostSettingsOperations.cs | 228 ++ .../HostSettingsOperationsExtensions.cs | 55 + .../src/Generated/IAzureBotServiceClient.cs | 44 +- .../src/Generated/IBotConnectionOperations.cs | 239 +++ .../src/Generated/IBotsOperations.cs | 12 +- .../src/Generated/IChannelsOperations.cs | 37 +- .../src/Generated/IDirectLineOperations.cs | 61 + .../src/Generated/IHostSettingsOperations.cs | 47 + .../Generated/IOperationResultsOperations.cs | 71 + .../src/Generated/IOperations.cs | 4 +- .../IPrivateEndpointConnectionsOperations.cs | 142 ++ .../IPrivateLinkResourcesOperations.cs | 52 + .../src/Generated/Models/AlexaChannel.cs | 72 + .../Models/AlexaChannelProperties.cs | 92 + .../src/Generated/Models/Bot.cs | 9 +- .../src/Generated/Models/BotChannel.cs | 9 +- .../src/Generated/Models/BotProperties.cs | 207 +- .../src/Generated/Models/Channel.cs | 34 + .../src/Generated/Models/ChannelName.cs | 20 +- .../src/Generated/Models/ChannelSettings.cs | 121 ++ .../Generated/Models/ConnectionItemName.cs | 52 + .../src/Generated/Models/ConnectionSetting.cs | 78 + .../Models/ConnectionSettingParameter.cs | 62 + .../Models/ConnectionSettingProperties.cs | 139 ++ .../src/Generated/Models/DirectLineChannel.cs | 8 +- .../Models/DirectLineChannelProperties.cs | 11 +- .../src/Generated/Models/DirectLineSite.cs | 46 +- .../Models/DirectLineSpeechChannel.cs | 72 + .../DirectLineSpeechChannelProperties.cs | 120 ++ .../src/Generated/Models/EmailChannel.cs | 8 +- .../Models/EmailChannelProperties.cs | 10 +- .../src/Generated/Models/FacebookChannel.cs | 8 +- .../Models/FacebookChannelProperties.cs | 12 +- .../src/Generated/Models/FacebookPage.cs | 6 +- .../Generated/Models/HostSettingsResponse.cs | 118 + .../src/Generated/Models/Key.cs | 60 + .../src/Generated/Models/KikChannel.cs | 8 +- .../Generated/Models/KikChannelProperties.cs | 10 +- .../src/Generated/Models/Kind.cs | 1 + .../src/Generated/Models/LineChannel.cs | 72 + .../Generated/Models/LineChannelProperties.cs | 86 + .../src/Generated/Models/LineRegistration.cs | 70 + .../Models/ListChannelWithKeysResponse.cs | 115 + .../src/Generated/Models/MsTeamsChannel.cs | 8 +- .../Models/MsTeamsChannelProperties.cs | 63 +- .../src/Generated/Models/MsaAppType.cs | 23 + .../Generated/Models/OperationResultStatus.cs | 25 + .../Models/OperationResultsDescription.cs | 82 + .../src/Generated/Models/Page1.cs | 53 + .../src/Generated/Models/PrivateEndpoint.cs | 51 + .../Models/PrivateEndpointConnection.cs | 98 + ...vateEndpointConnectionProvisioningState.cs | 24 + .../PrivateEndpointServiceConnectionStatus.cs | 23 + .../Generated/Models/PrivateLinkResource.cs | 81 + .../Models/PrivateLinkResourceBase.cs | 79 + .../Models/PrivateLinkResourceListResult.cs | 55 + .../PrivateLinkServiceConnectionState.cs | 77 + .../Generated/Models/PublicNetworkAccess.cs | 22 + .../Models/RegenerateKeysChannelName.cs | 60 + .../src/Generated/Models/Resource.cs | 17 +- .../src/Generated/Models/ServiceProvider.cs | 52 + .../Models/ServiceProviderParameter.cs | 102 + .../ServiceProviderParameterMetadata.cs | 54 + ...iceProviderParameterMetadataConstraints.cs | 54 + .../Models/ServiceProviderProperties.cs | 97 + .../Models/ServiceProviderResponseList.cs | 66 + .../src/Generated/Models/Site.cs | 181 ++ .../src/Generated/Models/SiteInfo.cs | 76 + .../src/Generated/Models/SkypeChannel.cs | 8 +- .../Models/SkypeChannelProperties.cs | 11 +- .../src/Generated/Models/SlackChannel.cs | 8 +- .../Models/SlackChannelProperties.cs | 40 +- .../src/Generated/Models/SmsChannel.cs | 8 +- .../Generated/Models/SmsChannelProperties.cs | 10 +- .../src/Generated/Models/TelegramChannel.cs | 8 +- .../Models/TelegramChannelProperties.cs | 14 +- .../src/Generated/Models/WebChatChannel.cs | 8 +- .../src/Generated/Models/WebChatSite.cs | 12 +- .../Generated/OperationResultsOperations.cs | 237 +++ .../OperationResultsOperationsExtensions.cs | 93 + .../src/Generated/Operations.cs | 22 +- .../PrivateEndpointConnectionsOperations.cs | 966 +++++++++ ...EndpointConnectionsOperationsExtensions.cs | 216 ++ .../PrivateLinkResourcesOperations.cs | 275 +++ ...rivateLinkResourcesOperationsExtensions.cs | 65 + .../src/Generated/SdkInfo_AzureBotService.cs | 47 +- 95 files changed, 9060 insertions(+), 267 deletions(-) create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/BotConnectionOperations.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/BotConnectionOperationsExtensions.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/DirectLineOperations.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/DirectLineOperationsExtensions.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/HostSettingsOperations.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/HostSettingsOperationsExtensions.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IBotConnectionOperations.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IDirectLineOperations.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IHostSettingsOperations.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IOperationResultsOperations.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IPrivateEndpointConnectionsOperations.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IPrivateLinkResourcesOperations.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/AlexaChannel.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/AlexaChannelProperties.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ChannelSettings.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ConnectionItemName.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ConnectionSetting.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ConnectionSettingParameter.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ConnectionSettingProperties.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/DirectLineSpeechChannel.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/DirectLineSpeechChannelProperties.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/HostSettingsResponse.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/Key.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/LineChannel.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/LineChannelProperties.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/LineRegistration.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ListChannelWithKeysResponse.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/MsaAppType.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/OperationResultStatus.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/OperationResultsDescription.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/Page1.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateEndpoint.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateEndpointConnection.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateEndpointConnectionProvisioningState.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateEndpointServiceConnectionStatus.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateLinkResource.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateLinkResourceBase.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateLinkResourceListResult.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateLinkServiceConnectionState.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PublicNetworkAccess.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/RegenerateKeysChannelName.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ServiceProvider.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ServiceProviderParameter.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ServiceProviderParameterMetadata.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ServiceProviderParameterMetadataConstraints.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ServiceProviderProperties.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ServiceProviderResponseList.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/Site.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/SiteInfo.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/OperationResultsOperations.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/OperationResultsOperationsExtensions.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/PrivateEndpointConnectionsOperations.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/PrivateLinkResourcesOperations.cs create mode 100644 sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/PrivateLinkResourcesOperationsExtensions.cs diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/AzureBotServiceClient.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/AzureBotServiceClient.cs index 5d99896e58c57..6cbc9e34914ca 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/AzureBotServiceClient.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/AzureBotServiceClient.cs @@ -53,25 +53,25 @@ public partial class AzureBotServiceClient : ServiceClient - /// Version of the API to be used with the client request. Current version is - /// 2017-12-01 + /// Version of the API to be used with the client request. /// public string ApiVersion { get; private set; } /// - /// Gets or sets the preferred language for the response. + /// The preferred language for the response. /// public string AcceptLanguage { get; set; } /// - /// Gets or sets the retry timeout in seconds for Long Running Operations. - /// Default value is 30. + /// The retry timeout in seconds for Long Running Operations. Default value is + /// 30. /// public int? LongRunningOperationRetryTimeout { get; set; } /// - /// When set to true a unique x-ms-client-request-id value is generated and - /// included in each request. Default is true. + /// Whether a unique x-ms-client-request-id should be generated. When set to + /// true a unique x-ms-client-request-id value is generated and included in + /// each request. Default is true. /// public bool? GenerateClientRequestId { get; set; } @@ -85,11 +85,54 @@ public partial class AzureBotServiceClient : ServiceClient public virtual IChannelsOperations Channels { get; private set; } + /// + /// Gets the IDirectLineOperations. + /// + public virtual IDirectLineOperations DirectLine { get; private set; } + /// /// Gets the IOperations. /// public virtual IOperations Operations { get; private set; } + /// + /// Gets the IBotConnectionOperations. + /// + public virtual IBotConnectionOperations BotConnection { get; private set; } + + /// + /// Gets the IHostSettingsOperations. + /// + public virtual IHostSettingsOperations HostSettings { get; private set; } + + /// + /// Gets the IOperationResultsOperations. + /// + public virtual IOperationResultsOperations OperationResults { get; private set; } + + /// + /// Gets the IPrivateEndpointConnectionsOperations. + /// + public virtual IPrivateEndpointConnectionsOperations PrivateEndpointConnections { get; private set; } + + /// + /// Gets the IPrivateLinkResourcesOperations. + /// + public virtual IPrivateLinkResourcesOperations PrivateLinkResources { get; private set; } + + /// + /// Initializes a new instance of the AzureBotServiceClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling AzureBotServiceClient.Dispose(). False: will not dispose provided httpClient + protected AzureBotServiceClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + Initialize(); + } + /// /// Initializes a new instance of the AzureBotServiceClient class. /// @@ -185,6 +228,33 @@ public AzureBotServiceClient(ServiceClientCredentials credentials, params Delega } } + /// + /// Initializes a new instance of the AzureBotServiceClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling AzureBotServiceClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public AzureBotServiceClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + /// /// Initializes a new instance of the AzureBotServiceClient class. /// @@ -293,9 +363,15 @@ private void Initialize() { Bots = new BotsOperations(this); Channels = new ChannelsOperations(this); + DirectLine = new DirectLineOperations(this); Operations = new Operations(this); + BotConnection = new BotConnectionOperations(this); + HostSettings = new HostSettingsOperations(this); + OperationResults = new OperationResultsOperations(this); + PrivateEndpointConnections = new PrivateEndpointConnectionsOperations(this); + PrivateLinkResources = new PrivateLinkResourcesOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2017-12-01"; + ApiVersion = "2021-05-01-preview"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; @@ -312,6 +388,7 @@ private void Initialize() new Iso8601TimeSpanConverter() } }; + SerializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings = new JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, @@ -327,6 +404,7 @@ private void Initialize() SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("channelName")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("channelName")); CustomInitialize(); + DeserializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); } } diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/BotConnectionOperations.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/BotConnectionOperations.cs new file mode 100644 index 0000000000000..70d35ea332e36 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/BotConnectionOperations.cs @@ -0,0 +1,1890 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BotConnectionOperations operations. + /// + internal partial class BotConnectionOperations : IServiceOperations, IBotConnectionOperations + { + /// + /// Initializes a new instance of the BotConnectionOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal BotConnectionOperations(AzureBotServiceClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureBotServiceClient + /// + public AzureBotServiceClient Client { get; private set; } + + /// + /// Lists the available Service Providers for creating Connection Settings + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListServiceProvidersWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListServiceProviders", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.BotService/listAuthServiceProviders").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get a Connection Setting registration for a Bot Service + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the Bot Service Connection Setting resource. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListWithSecretsWithHttpMessagesAsync(string resourceGroupName, string resourceName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 64); + } + if (resourceGroupName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (resourceName != null) + { + if (resourceName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceName", 64); + } + if (resourceName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } + if (connectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + } + if (connectionName != null) + { + if (connectionName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "connectionName", 64); + } + if (connectionName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "connectionName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(connectionName, "^[a-zA-Z0-9][\\sa-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "connectionName", "^[a-zA-Z0-9][\\sa-zA-Z0-9_.-]*$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("connectionName", connectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListWithSecrets", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}/listWithSecrets").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Register a new Auth Connection for a Bot Service + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the Bot Service Connection Setting resource. + /// + /// + /// The parameters to provide for creating the Connection Setting. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string resourceName, string connectionName, ConnectionSetting parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 64); + } + if (resourceGroupName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (resourceName != null) + { + if (resourceName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceName", 64); + } + if (resourceName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } + if (connectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + } + if (connectionName != null) + { + if (connectionName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "connectionName", 64); + } + if (connectionName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "connectionName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(connectionName, "^[a-zA-Z0-9][\\sa-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "connectionName", "^[a-zA-Z0-9][\\sa-zA-Z0-9_.-]*$"); + } + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("connectionName", connectionName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates a Connection Setting registration for a Bot Service + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the Bot Service Connection Setting resource. + /// + /// + /// The parameters to provide for updating the Connection Setting. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, string connectionName, ConnectionSetting parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 64); + } + if (resourceGroupName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (resourceName != null) + { + if (resourceName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceName", 64); + } + if (resourceName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } + if (connectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + } + if (connectionName != null) + { + if (connectionName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "connectionName", 64); + } + if (connectionName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "connectionName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(connectionName, "^[a-zA-Z0-9][\\sa-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "connectionName", "^[a-zA-Z0-9][\\sa-zA-Z0-9_.-]*$"); + } + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("connectionName", connectionName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get a Connection Setting registration for a Bot Service + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the Bot Service Connection Setting resource. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string resourceName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 64); + } + if (resourceGroupName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (resourceName != null) + { + if (resourceName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceName", 64); + } + if (resourceName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } + if (connectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + } + if (connectionName != null) + { + if (connectionName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "connectionName", 64); + } + if (connectionName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "connectionName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(connectionName, "^[a-zA-Z0-9][\\sa-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "connectionName", "^[a-zA-Z0-9][\\sa-zA-Z0-9_.-]*$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("connectionName", connectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a Connection Setting registration for a Bot Service + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the Bot Service Connection Setting resource. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 64); + } + if (resourceGroupName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (resourceName != null) + { + if (resourceName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceName", 64); + } + if (resourceName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } + if (connectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + } + if (connectionName != null) + { + if (connectionName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "connectionName", 64); + } + if (connectionName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "connectionName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(connectionName, "^[a-zA-Z0-9][\\sa-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "connectionName", "^[a-zA-Z0-9][\\sa-zA-Z0-9_.-]*$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("connectionName", connectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns all the Connection Settings registered to a particular BotService + /// resource + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByBotServiceWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 64); + } + if (resourceGroupName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (resourceName != null) + { + if (resourceName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceName", 64); + } + if (resourceName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByBotService", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns all the Connection Settings registered to a particular BotService + /// resource + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByBotServiceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByBotServiceNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/BotConnectionOperationsExtensions.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/BotConnectionOperationsExtensions.cs new file mode 100644 index 0000000000000..2039f4eb900b3 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/BotConnectionOperationsExtensions.cs @@ -0,0 +1,370 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for BotConnectionOperations. + /// + public static partial class BotConnectionOperationsExtensions + { + /// + /// Lists the available Service Providers for creating Connection Settings + /// + /// + /// The operations group for this extension method. + /// + public static ServiceProviderResponseList ListServiceProviders(this IBotConnectionOperations operations) + { + return operations.ListServiceProvidersAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists the available Service Providers for creating Connection Settings + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task ListServiceProvidersAsync(this IBotConnectionOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListServiceProvidersWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get a Connection Setting registration for a Bot Service + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the Bot Service Connection Setting resource. + /// + public static ConnectionSetting ListWithSecrets(this IBotConnectionOperations operations, string resourceGroupName, string resourceName, string connectionName) + { + return operations.ListWithSecretsAsync(resourceGroupName, resourceName, connectionName).GetAwaiter().GetResult(); + } + + /// + /// Get a Connection Setting registration for a Bot Service + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the Bot Service Connection Setting resource. + /// + /// + /// The cancellation token. + /// + public static async Task ListWithSecretsAsync(this IBotConnectionOperations operations, string resourceGroupName, string resourceName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithSecretsWithHttpMessagesAsync(resourceGroupName, resourceName, connectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Register a new Auth Connection for a Bot Service + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the Bot Service Connection Setting resource. + /// + /// + /// The parameters to provide for creating the Connection Setting. + /// + public static ConnectionSetting Create(this IBotConnectionOperations operations, string resourceGroupName, string resourceName, string connectionName, ConnectionSetting parameters) + { + return operations.CreateAsync(resourceGroupName, resourceName, connectionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Register a new Auth Connection for a Bot Service + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the Bot Service Connection Setting resource. + /// + /// + /// The parameters to provide for creating the Connection Setting. + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this IBotConnectionOperations operations, string resourceGroupName, string resourceName, string connectionName, ConnectionSetting parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, resourceName, connectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates a Connection Setting registration for a Bot Service + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the Bot Service Connection Setting resource. + /// + /// + /// The parameters to provide for updating the Connection Setting. + /// + public static ConnectionSetting Update(this IBotConnectionOperations operations, string resourceGroupName, string resourceName, string connectionName, ConnectionSetting parameters) + { + return operations.UpdateAsync(resourceGroupName, resourceName, connectionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a Connection Setting registration for a Bot Service + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the Bot Service Connection Setting resource. + /// + /// + /// The parameters to provide for updating the Connection Setting. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IBotConnectionOperations operations, string resourceGroupName, string resourceName, string connectionName, ConnectionSetting parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, resourceName, connectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get a Connection Setting registration for a Bot Service + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the Bot Service Connection Setting resource. + /// + public static ConnectionSetting Get(this IBotConnectionOperations operations, string resourceGroupName, string resourceName, string connectionName) + { + return operations.GetAsync(resourceGroupName, resourceName, connectionName).GetAwaiter().GetResult(); + } + + /// + /// Get a Connection Setting registration for a Bot Service + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the Bot Service Connection Setting resource. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IBotConnectionOperations operations, string resourceGroupName, string resourceName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, resourceName, connectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a Connection Setting registration for a Bot Service + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the Bot Service Connection Setting resource. + /// + public static void Delete(this IBotConnectionOperations operations, string resourceGroupName, string resourceName, string connectionName) + { + operations.DeleteAsync(resourceGroupName, resourceName, connectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a Connection Setting registration for a Bot Service + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the Bot Service Connection Setting resource. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IBotConnectionOperations operations, string resourceGroupName, string resourceName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, resourceName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Returns all the Connection Settings registered to a particular BotService + /// resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + public static IPage ListByBotService(this IBotConnectionOperations operations, string resourceGroupName, string resourceName) + { + return operations.ListByBotServiceAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Returns all the Connection Settings registered to a particular BotService + /// resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByBotServiceAsync(this IBotConnectionOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByBotServiceWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns all the Connection Settings registered to a particular BotService + /// resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByBotServiceNext(this IBotConnectionOperations operations, string nextPageLink) + { + return operations.ListByBotServiceNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Returns all the Connection Settings registered to a particular BotService + /// resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByBotServiceNextAsync(this IBotConnectionOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByBotServiceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/BotsOperations.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/BotsOperations.cs index c9c92ac29b2f5..08f960000c7ab 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/BotsOperations.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/BotsOperations.cs @@ -54,7 +54,7 @@ internal BotsOperations(AzureBotServiceClient client) /// Creates a Bot Service. Bot Service is a resource group wide resource type. /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. @@ -89,6 +89,21 @@ internal BotsOperations(AzureBotServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 64); + } + if (resourceGroupName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } if (resourceName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); @@ -296,7 +311,7 @@ internal BotsOperations(AzureBotServiceClient client) /// Updates a Bot Service /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. @@ -312,7 +327,7 @@ internal BotsOperations(AzureBotServiceClient client) /// /// /// Required. Gets or sets the Kind of the resource. Possible values include: - /// 'sdk', 'designer', 'bot', 'function' + /// 'sdk', 'designer', 'bot', 'function', 'azurebot' /// /// /// Entity Tag @@ -347,6 +362,21 @@ internal BotsOperations(AzureBotServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 64); + } + if (resourceGroupName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } if (resourceName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); @@ -564,7 +594,7 @@ internal BotsOperations(AzureBotServiceClient client) /// Deletes a Bot Service from the resource group. /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. @@ -593,6 +623,21 @@ internal BotsOperations(AzureBotServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 64); + } + if (resourceGroupName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } if (resourceName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); @@ -749,7 +794,7 @@ internal BotsOperations(AzureBotServiceClient client) /// Returns a BotService specified by the parameters. /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. @@ -781,6 +826,21 @@ internal BotsOperations(AzureBotServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 64); + } + if (resourceGroupName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } if (resourceName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); @@ -956,7 +1016,7 @@ internal BotsOperations(AzureBotServiceClient client) /// group /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// Headers that will be added to request. @@ -985,6 +1045,21 @@ internal BotsOperations(AzureBotServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 64); + } + if (resourceGroupName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1358,7 +1433,7 @@ internal BotsOperations(AzureBotServiceClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.BotService/botServices/checkNameAvailability").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.BotService/checkNameAvailability").ToString(); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -1371,7 +1446,7 @@ internal BotsOperations(AzureBotServiceClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/BotsOperationsExtensions.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/BotsOperationsExtensions.cs index c4fab1ee5b809..5b28825ca712b 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/BotsOperationsExtensions.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/BotsOperationsExtensions.cs @@ -30,7 +30,7 @@ public static partial class BotsOperationsExtensions /// The operations group for this extension method. /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. @@ -50,7 +50,7 @@ public static Bot Create(this IBotsOperations operations, string resourceGroupNa /// The operations group for this extension method. /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. @@ -76,7 +76,7 @@ public static Bot Create(this IBotsOperations operations, string resourceGroupNa /// The operations group for this extension method. /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. @@ -92,7 +92,7 @@ public static Bot Create(this IBotsOperations operations, string resourceGroupNa /// /// /// Required. Gets or sets the Kind of the resource. Possible values include: - /// 'sdk', 'designer', 'bot', 'function' + /// 'sdk', 'designer', 'bot', 'function', 'azurebot' /// /// /// Entity Tag @@ -112,7 +112,7 @@ public static Bot Create(this IBotsOperations operations, string resourceGroupNa /// The operations group for this extension method. /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. @@ -128,7 +128,7 @@ public static Bot Create(this IBotsOperations operations, string resourceGroupNa /// /// /// Required. Gets or sets the Kind of the resource. Possible values include: - /// 'sdk', 'designer', 'bot', 'function' + /// 'sdk', 'designer', 'bot', 'function', 'azurebot' /// /// /// Entity Tag @@ -154,7 +154,7 @@ public static Bot Create(this IBotsOperations operations, string resourceGroupNa /// The operations group for this extension method. /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. @@ -171,7 +171,7 @@ public static void Delete(this IBotsOperations operations, string resourceGroupN /// The operations group for this extension method. /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. @@ -191,7 +191,7 @@ public static void Delete(this IBotsOperations operations, string resourceGroupN /// The operations group for this extension method. /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. @@ -208,7 +208,7 @@ public static Bot Get(this IBotsOperations operations, string resourceGroupName, /// The operations group for this extension method. /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. @@ -232,7 +232,7 @@ public static Bot Get(this IBotsOperations operations, string resourceGroupName, /// The operations group for this extension method. /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// public static IPage ListByResourceGroup(this IBotsOperations operations, string resourceGroupName) { @@ -247,7 +247,7 @@ public static IPage ListByResourceGroup(this IBotsOperations operations, st /// The operations group for this extension method. /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The cancellation token. diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/ChannelsOperations.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/ChannelsOperations.cs index 98aac56863ec8..4d1f9050f8aec 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/ChannelsOperations.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/ChannelsOperations.cs @@ -54,16 +54,16 @@ internal ChannelsOperations(AzureBotServiceClient client) /// Creates a Channel registration for a Bot Service /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. /// /// - /// The name of the Channel resource. Possible values include: + /// The name of the Channel resource. Possible values include: 'AlexaChannel', /// 'FacebookChannel', 'EmailChannel', 'KikChannel', 'TelegramChannel', /// 'SlackChannel', 'MsTeamsChannel', 'SkypeChannel', 'WebChatChannel', - /// 'DirectLineChannel', 'SmsChannel' + /// 'DirectLineChannel', 'SmsChannel', 'LineChannel', 'DirectLineSpeechChannel' /// /// /// The parameters to provide for the created bot. @@ -95,6 +95,21 @@ internal ChannelsOperations(AzureBotServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 64); + } + if (resourceGroupName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } if (resourceName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); @@ -304,16 +319,16 @@ internal ChannelsOperations(AzureBotServiceClient client) /// Updates a Channel registration for a Bot Service /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. /// /// - /// The name of the Channel resource. Possible values include: + /// The name of the Channel resource. Possible values include: 'AlexaChannel', /// 'FacebookChannel', 'EmailChannel', 'KikChannel', 'TelegramChannel', /// 'SlackChannel', 'MsTeamsChannel', 'SkypeChannel', 'WebChatChannel', - /// 'DirectLineChannel', 'SmsChannel' + /// 'DirectLineChannel', 'SmsChannel', 'LineChannel', 'DirectLineSpeechChannel' /// /// /// Specifies the location of the resource. @@ -326,7 +341,7 @@ internal ChannelsOperations(AzureBotServiceClient client) /// /// /// Required. Gets or sets the Kind of the resource. Possible values include: - /// 'sdk', 'designer', 'bot', 'function' + /// 'sdk', 'designer', 'bot', 'function', 'azurebot' /// /// /// Entity Tag @@ -361,6 +376,21 @@ internal ChannelsOperations(AzureBotServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 64); + } + if (resourceGroupName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } if (resourceName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); @@ -576,7 +606,7 @@ internal ChannelsOperations(AzureBotServiceClient client) /// Deletes a Channel registration from a Bot Service /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. @@ -608,6 +638,21 @@ internal ChannelsOperations(AzureBotServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 64); + } + if (resourceGroupName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } if (resourceName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); @@ -785,7 +830,7 @@ internal ChannelsOperations(AzureBotServiceClient client) /// Returns a BotService Channel registration specified by the parameters. /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. @@ -820,6 +865,21 @@ internal ChannelsOperations(AzureBotServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 64); + } + if (resourceGroupName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } if (resourceName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); @@ -1015,16 +1075,16 @@ internal ChannelsOperations(AzureBotServiceClient client) /// Lists a Channel registration for a Bot Service including secrets /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. /// /// - /// The name of the Channel resource. Possible values include: + /// The name of the Channel resource. Possible values include: 'AlexaChannel', /// 'FacebookChannel', 'EmailChannel', 'KikChannel', 'TelegramChannel', /// 'SlackChannel', 'MsTeamsChannel', 'SkypeChannel', 'WebChatChannel', - /// 'DirectLineChannel', 'SmsChannel' + /// 'DirectLineChannel', 'SmsChannel', 'LineChannel', 'DirectLineSpeechChannel' /// /// /// Headers that will be added to request. @@ -1047,12 +1107,27 @@ internal ChannelsOperations(AzureBotServiceClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListWithKeysWithHttpMessagesAsync(string resourceGroupName, string resourceName, ChannelName channelName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListWithKeysWithHttpMessagesAsync(string resourceGroupName, string resourceName, ChannelName channelName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 64); + } + if (resourceGroupName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } if (resourceName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); @@ -1193,7 +1268,7 @@ internal ChannelsOperations(AzureBotServiceClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1206,7 +1281,7 @@ internal ChannelsOperations(AzureBotServiceClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1229,7 +1304,7 @@ internal ChannelsOperations(AzureBotServiceClient client) /// Returns all the Channel registrations of a particular BotService resource /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. @@ -1261,6 +1336,21 @@ internal ChannelsOperations(AzureBotServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 64); + } + if (resourceGroupName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } if (resourceName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/ChannelsOperationsExtensions.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/ChannelsOperationsExtensions.cs index da7b35534675d..848e4998124df 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/ChannelsOperationsExtensions.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/ChannelsOperationsExtensions.cs @@ -30,16 +30,16 @@ public static partial class ChannelsOperationsExtensions /// The operations group for this extension method. /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. /// /// - /// The name of the Channel resource. Possible values include: + /// The name of the Channel resource. Possible values include: 'AlexaChannel', /// 'FacebookChannel', 'EmailChannel', 'KikChannel', 'TelegramChannel', /// 'SlackChannel', 'MsTeamsChannel', 'SkypeChannel', 'WebChatChannel', - /// 'DirectLineChannel', 'SmsChannel' + /// 'DirectLineChannel', 'SmsChannel', 'LineChannel', 'DirectLineSpeechChannel' /// /// /// The parameters to provide for the created bot. @@ -56,16 +56,16 @@ public static BotChannel Create(this IChannelsOperations operations, string reso /// The operations group for this extension method. /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. /// /// - /// The name of the Channel resource. Possible values include: + /// The name of the Channel resource. Possible values include: 'AlexaChannel', /// 'FacebookChannel', 'EmailChannel', 'KikChannel', 'TelegramChannel', /// 'SlackChannel', 'MsTeamsChannel', 'SkypeChannel', 'WebChatChannel', - /// 'DirectLineChannel', 'SmsChannel' + /// 'DirectLineChannel', 'SmsChannel', 'LineChannel', 'DirectLineSpeechChannel' /// /// /// The parameters to provide for the created bot. @@ -88,16 +88,16 @@ public static BotChannel Create(this IChannelsOperations operations, string reso /// The operations group for this extension method. /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. /// /// - /// The name of the Channel resource. Possible values include: + /// The name of the Channel resource. Possible values include: 'AlexaChannel', /// 'FacebookChannel', 'EmailChannel', 'KikChannel', 'TelegramChannel', /// 'SlackChannel', 'MsTeamsChannel', 'SkypeChannel', 'WebChatChannel', - /// 'DirectLineChannel', 'SmsChannel' + /// 'DirectLineChannel', 'SmsChannel', 'LineChannel', 'DirectLineSpeechChannel' /// /// /// Specifies the location of the resource. @@ -110,7 +110,7 @@ public static BotChannel Create(this IChannelsOperations operations, string reso /// /// /// Required. Gets or sets the Kind of the resource. Possible values include: - /// 'sdk', 'designer', 'bot', 'function' + /// 'sdk', 'designer', 'bot', 'function', 'azurebot' /// /// /// Entity Tag @@ -130,16 +130,16 @@ public static BotChannel Create(this IChannelsOperations operations, string reso /// The operations group for this extension method. /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. /// /// - /// The name of the Channel resource. Possible values include: + /// The name of the Channel resource. Possible values include: 'AlexaChannel', /// 'FacebookChannel', 'EmailChannel', 'KikChannel', 'TelegramChannel', /// 'SlackChannel', 'MsTeamsChannel', 'SkypeChannel', 'WebChatChannel', - /// 'DirectLineChannel', 'SmsChannel' + /// 'DirectLineChannel', 'SmsChannel', 'LineChannel', 'DirectLineSpeechChannel' /// /// /// Specifies the location of the resource. @@ -152,7 +152,7 @@ public static BotChannel Create(this IChannelsOperations operations, string reso /// /// /// Required. Gets or sets the Kind of the resource. Possible values include: - /// 'sdk', 'designer', 'bot', 'function' + /// 'sdk', 'designer', 'bot', 'function', 'azurebot' /// /// /// Entity Tag @@ -178,7 +178,7 @@ public static BotChannel Create(this IChannelsOperations operations, string reso /// The operations group for this extension method. /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. @@ -198,7 +198,7 @@ public static void Delete(this IChannelsOperations operations, string resourceGr /// The operations group for this extension method. /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. @@ -221,7 +221,7 @@ public static void Delete(this IChannelsOperations operations, string resourceGr /// The operations group for this extension method. /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. @@ -241,7 +241,7 @@ public static BotChannel Get(this IChannelsOperations operations, string resourc /// The operations group for this extension method. /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. @@ -267,18 +267,18 @@ public static BotChannel Get(this IChannelsOperations operations, string resourc /// The operations group for this extension method. /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. /// /// - /// The name of the Channel resource. Possible values include: + /// The name of the Channel resource. Possible values include: 'AlexaChannel', /// 'FacebookChannel', 'EmailChannel', 'KikChannel', 'TelegramChannel', /// 'SlackChannel', 'MsTeamsChannel', 'SkypeChannel', 'WebChatChannel', - /// 'DirectLineChannel', 'SmsChannel' + /// 'DirectLineChannel', 'SmsChannel', 'LineChannel', 'DirectLineSpeechChannel' /// - public static BotChannel ListWithKeys(this IChannelsOperations operations, string resourceGroupName, string resourceName, ChannelName channelName) + public static ListChannelWithKeysResponse ListWithKeys(this IChannelsOperations operations, string resourceGroupName, string resourceName, ChannelName channelName) { return operations.ListWithKeysAsync(resourceGroupName, resourceName, channelName).GetAwaiter().GetResult(); } @@ -290,21 +290,21 @@ public static BotChannel ListWithKeys(this IChannelsOperations operations, strin /// The operations group for this extension method. /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. /// /// - /// The name of the Channel resource. Possible values include: + /// The name of the Channel resource. Possible values include: 'AlexaChannel', /// 'FacebookChannel', 'EmailChannel', 'KikChannel', 'TelegramChannel', /// 'SlackChannel', 'MsTeamsChannel', 'SkypeChannel', 'WebChatChannel', - /// 'DirectLineChannel', 'SmsChannel' + /// 'DirectLineChannel', 'SmsChannel', 'LineChannel', 'DirectLineSpeechChannel' /// /// /// The cancellation token. /// - public static async Task ListWithKeysAsync(this IChannelsOperations operations, string resourceGroupName, string resourceName, ChannelName channelName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListWithKeysAsync(this IChannelsOperations operations, string resourceGroupName, string resourceName, ChannelName channelName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithKeysWithHttpMessagesAsync(resourceGroupName, resourceName, channelName, null, cancellationToken).ConfigureAwait(false)) { @@ -319,7 +319,7 @@ public static BotChannel ListWithKeys(this IChannelsOperations operations, strin /// The operations group for this extension method. /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. @@ -336,7 +336,7 @@ public static IPage ListByResourceGroup(this IChannelsOperations ope /// The operations group for this extension method. /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/DirectLineOperations.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/DirectLineOperations.cs new file mode 100644 index 0000000000000..4446aa45909e8 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/DirectLineOperations.cs @@ -0,0 +1,300 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DirectLineOperations operations. + /// + internal partial class DirectLineOperations : IServiceOperations, IDirectLineOperations + { + /// + /// Initializes a new instance of the DirectLineOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal DirectLineOperations(AzureBotServiceClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureBotServiceClient + /// + public AzureBotServiceClient Client { get; private set; } + + /// + /// Regenerates secret keys and returns them for the DirectLine Channel of a + /// particular BotService resource + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the Channel resource for which keys are to be regenerated. + /// Possible values include: 'WebChatChannel', 'DirectLineChannel' + /// + /// + /// The parameters to provide for the created bot. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string resourceName, RegenerateKeysChannelName channelName, SiteInfo parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 64); + } + if (resourceGroupName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (resourceName != null) + { + if (resourceName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceName", 64); + } + if (resourceName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("channelName", channelName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "RegenerateKeys", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}/regeneratekeys").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{channelName}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(channelName, Client.SerializationSettings).Trim('"'))); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/DirectLineOperationsExtensions.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/DirectLineOperationsExtensions.cs new file mode 100644 index 0000000000000..9e4d385e5a846 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/DirectLineOperationsExtensions.cs @@ -0,0 +1,81 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for DirectLineOperations. + /// + public static partial class DirectLineOperationsExtensions + { + /// + /// Regenerates secret keys and returns them for the DirectLine Channel of a + /// particular BotService resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the Channel resource for which keys are to be regenerated. + /// Possible values include: 'WebChatChannel', 'DirectLineChannel' + /// + /// + /// The parameters to provide for the created bot. + /// + public static BotChannel RegenerateKeys(this IDirectLineOperations operations, string resourceGroupName, string resourceName, RegenerateKeysChannelName channelName, SiteInfo parameters) + { + return operations.RegenerateKeysAsync(resourceGroupName, resourceName, channelName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Regenerates secret keys and returns them for the DirectLine Channel of a + /// particular BotService resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the Channel resource for which keys are to be regenerated. + /// Possible values include: 'WebChatChannel', 'DirectLineChannel' + /// + /// + /// The parameters to provide for the created bot. + /// + /// + /// The cancellation token. + /// + public static async Task RegenerateKeysAsync(this IDirectLineOperations operations, string resourceGroupName, string resourceName, RegenerateKeysChannelName channelName, SiteInfo parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.RegenerateKeysWithHttpMessagesAsync(resourceGroupName, resourceName, channelName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/HostSettingsOperations.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/HostSettingsOperations.cs new file mode 100644 index 0000000000000..fb73267d5635e --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/HostSettingsOperations.cs @@ -0,0 +1,228 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// HostSettingsOperations operations. + /// + internal partial class HostSettingsOperations : IServiceOperations, IHostSettingsOperations + { + /// + /// Initializes a new instance of the HostSettingsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal HostSettingsOperations(AzureBotServiceClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureBotServiceClient + /// + public AzureBotServiceClient Client { get; private set; } + + /// + /// Get per subscription settings needed to host bot in compute resource such + /// as Azure App Service + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.BotService/hostSettings").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/HostSettingsOperationsExtensions.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/HostSettingsOperationsExtensions.cs new file mode 100644 index 0000000000000..b166d9f8a5463 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/HostSettingsOperationsExtensions.cs @@ -0,0 +1,55 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for HostSettingsOperations. + /// + public static partial class HostSettingsOperationsExtensions + { + /// + /// Get per subscription settings needed to host bot in compute resource such + /// as Azure App Service + /// + /// + /// The operations group for this extension method. + /// + public static HostSettingsResponse Get(this IHostSettingsOperations operations) + { + return operations.GetAsync().GetAwaiter().GetResult(); + } + + /// + /// Get per subscription settings needed to host bot in compute resource such + /// as Azure App Service + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IHostSettingsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IAzureBotServiceClient.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IAzureBotServiceClient.cs index b20a65d231323..792a53ae3a253 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IAzureBotServiceClient.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IAzureBotServiceClient.cs @@ -47,25 +47,25 @@ public partial interface IAzureBotServiceClient : System.IDisposable string SubscriptionId { get; set; } /// - /// Version of the API to be used with the client request. Current - /// version is 2017-12-01 + /// Version of the API to be used with the client request. /// string ApiVersion { get; } /// - /// Gets or sets the preferred language for the response. + /// The preferred language for the response. /// string AcceptLanguage { get; set; } /// - /// Gets or sets the retry timeout in seconds for Long Running - /// Operations. Default value is 30. + /// The retry timeout in seconds for Long Running Operations. Default + /// value is 30. /// int? LongRunningOperationRetryTimeout { get; set; } /// - /// When set to true a unique x-ms-client-request-id value is generated - /// and included in each request. Default is true. + /// Whether a unique x-ms-client-request-id should be generated. When + /// set to true a unique x-ms-client-request-id value is generated and + /// included in each request. Default is true. /// bool? GenerateClientRequestId { get; set; } @@ -80,10 +80,40 @@ public partial interface IAzureBotServiceClient : System.IDisposable /// IChannelsOperations Channels { get; } + /// + /// Gets the IDirectLineOperations. + /// + IDirectLineOperations DirectLine { get; } + /// /// Gets the IOperations. /// IOperations Operations { get; } + /// + /// Gets the IBotConnectionOperations. + /// + IBotConnectionOperations BotConnection { get; } + + /// + /// Gets the IHostSettingsOperations. + /// + IHostSettingsOperations HostSettings { get; } + + /// + /// Gets the IOperationResultsOperations. + /// + IOperationResultsOperations OperationResults { get; } + + /// + /// Gets the IPrivateEndpointConnectionsOperations. + /// + IPrivateEndpointConnectionsOperations PrivateEndpointConnections { get; } + + /// + /// Gets the IPrivateLinkResourcesOperations. + /// + IPrivateLinkResourcesOperations PrivateLinkResources { get; } + } } diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IBotConnectionOperations.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IBotConnectionOperations.cs new file mode 100644 index 0000000000000..a273d3867ff4d --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IBotConnectionOperations.cs @@ -0,0 +1,239 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BotConnectionOperations operations. + /// + public partial interface IBotConnectionOperations + { + /// + /// Lists the available Service Providers for creating Connection + /// Settings + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListServiceProvidersWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get a Connection Setting registration for a Bot Service + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the Bot Service Connection Setting resource. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListWithSecretsWithHttpMessagesAsync(string resourceGroupName, string resourceName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Register a new Auth Connection for a Bot Service + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the Bot Service Connection Setting resource. + /// + /// + /// The parameters to provide for creating the Connection Setting. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateWithHttpMessagesAsync(string resourceGroupName, string resourceName, string connectionName, ConnectionSetting parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates a Connection Setting registration for a Bot Service + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the Bot Service Connection Setting resource. + /// + /// + /// The parameters to provide for updating the Connection Setting. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, string connectionName, ConnectionSetting parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get a Connection Setting registration for a Bot Service + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the Bot Service Connection Setting resource. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string resourceName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a Connection Setting registration for a Bot Service + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the Bot Service Connection Setting resource. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns all the Connection Settings registered to a particular + /// BotService resource + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByBotServiceWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns all the Connection Settings registered to a particular + /// BotService resource + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByBotServiceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IBotsOperations.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IBotsOperations.cs index 95e5168e22b45..61e9848510a30 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IBotsOperations.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IBotsOperations.cs @@ -28,7 +28,7 @@ public partial interface IBotsOperations /// resource type. /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. @@ -56,7 +56,7 @@ public partial interface IBotsOperations /// Updates a Bot Service /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. @@ -72,7 +72,7 @@ public partial interface IBotsOperations /// /// /// Required. Gets or sets the Kind of the resource. Possible values - /// include: 'sdk', 'designer', 'bot', 'function' + /// include: 'sdk', 'designer', 'bot', 'function', 'azurebot' /// /// /// Entity Tag @@ -100,7 +100,7 @@ public partial interface IBotsOperations /// Deletes a Bot Service from the resource group. /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. @@ -122,7 +122,7 @@ public partial interface IBotsOperations /// Returns a BotService specified by the parameters. /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. @@ -148,7 +148,7 @@ public partial interface IBotsOperations /// resource group /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The headers that will be added to request. diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IChannelsOperations.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IChannelsOperations.cs index 9707b69b1d0c3..74104e59b7a76 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IChannelsOperations.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IChannelsOperations.cs @@ -27,16 +27,17 @@ public partial interface IChannelsOperations /// Creates a Channel registration for a Bot Service /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. /// /// /// The name of the Channel resource. Possible values include: - /// 'FacebookChannel', 'EmailChannel', 'KikChannel', 'TelegramChannel', - /// 'SlackChannel', 'MsTeamsChannel', 'SkypeChannel', 'WebChatChannel', - /// 'DirectLineChannel', 'SmsChannel' + /// 'AlexaChannel', 'FacebookChannel', 'EmailChannel', 'KikChannel', + /// 'TelegramChannel', 'SlackChannel', 'MsTeamsChannel', + /// 'SkypeChannel', 'WebChatChannel', 'DirectLineChannel', + /// 'SmsChannel', 'LineChannel', 'DirectLineSpeechChannel' /// /// /// The parameters to provide for the created bot. @@ -61,16 +62,17 @@ public partial interface IChannelsOperations /// Updates a Channel registration for a Bot Service /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. /// /// /// The name of the Channel resource. Possible values include: - /// 'FacebookChannel', 'EmailChannel', 'KikChannel', 'TelegramChannel', - /// 'SlackChannel', 'MsTeamsChannel', 'SkypeChannel', 'WebChatChannel', - /// 'DirectLineChannel', 'SmsChannel' + /// 'AlexaChannel', 'FacebookChannel', 'EmailChannel', 'KikChannel', + /// 'TelegramChannel', 'SlackChannel', 'MsTeamsChannel', + /// 'SkypeChannel', 'WebChatChannel', 'DirectLineChannel', + /// 'SmsChannel', 'LineChannel', 'DirectLineSpeechChannel' /// /// /// Specifies the location of the resource. @@ -83,7 +85,7 @@ public partial interface IChannelsOperations /// /// /// Required. Gets or sets the Kind of the resource. Possible values - /// include: 'sdk', 'designer', 'bot', 'function' + /// include: 'sdk', 'designer', 'bot', 'function', 'azurebot' /// /// /// Entity Tag @@ -111,7 +113,7 @@ public partial interface IChannelsOperations /// Deletes a Channel registration from a Bot Service /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. @@ -137,7 +139,7 @@ public partial interface IChannelsOperations /// parameters. /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. @@ -165,16 +167,17 @@ public partial interface IChannelsOperations /// Lists a Channel registration for a Bot Service including secrets /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. /// /// /// The name of the Channel resource. Possible values include: - /// 'FacebookChannel', 'EmailChannel', 'KikChannel', 'TelegramChannel', - /// 'SlackChannel', 'MsTeamsChannel', 'SkypeChannel', 'WebChatChannel', - /// 'DirectLineChannel', 'SmsChannel' + /// 'AlexaChannel', 'FacebookChannel', 'EmailChannel', 'KikChannel', + /// 'TelegramChannel', 'SlackChannel', 'MsTeamsChannel', + /// 'SkypeChannel', 'WebChatChannel', 'DirectLineChannel', + /// 'SmsChannel', 'LineChannel', 'DirectLineSpeechChannel' /// /// /// The headers that will be added to request. @@ -191,13 +194,13 @@ public partial interface IChannelsOperations /// /// Thrown when a required parameter is null /// - Task> ListWithKeysWithHttpMessagesAsync(string resourceGroupName, string resourceName, ChannelName channelName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListWithKeysWithHttpMessagesAsync(string resourceGroupName, string resourceName, ChannelName channelName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Returns all the Channel registrations of a particular BotService /// resource /// /// - /// The name of the resource group within the user's subscription. + /// The name of the Bot resource group in the user subscription. /// /// /// The name of the Bot resource. diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IDirectLineOperations.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IDirectLineOperations.cs new file mode 100644 index 0000000000000..0f507f622ece7 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IDirectLineOperations.cs @@ -0,0 +1,61 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DirectLineOperations operations. + /// + public partial interface IDirectLineOperations + { + /// + /// Regenerates secret keys and returns them for the DirectLine Channel + /// of a particular BotService resource + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the Channel resource for which keys are to be + /// regenerated. Possible values include: 'WebChatChannel', + /// 'DirectLineChannel' + /// + /// + /// The parameters to provide for the created bot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string resourceName, RegenerateKeysChannelName channelName, SiteInfo parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IHostSettingsOperations.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IHostSettingsOperations.cs new file mode 100644 index 0000000000000..8d9f3e4ef7492 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IHostSettingsOperations.cs @@ -0,0 +1,47 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// HostSettingsOperations operations. + /// + public partial interface IHostSettingsOperations + { + /// + /// Get per subscription settings needed to host bot in compute + /// resource such as Azure App Service + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IOperationResultsOperations.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IOperationResultsOperations.cs new file mode 100644 index 0000000000000..208fd04a8fd19 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IOperationResultsOperations.cs @@ -0,0 +1,71 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// OperationResultsOperations operations. + /// + public partial interface IOperationResultsOperations + { + /// + /// Get the operation result for a long running operation. + /// + /// + /// The ID of the operation result to get. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string operationResultId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get the operation result for a long running operation. + /// + /// + /// The ID of the operation result to get. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginGetWithHttpMessagesAsync(string operationResultId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IOperations.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IOperations.cs index 27f723df0fe39..a699513400b5b 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IOperations.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IOperations.cs @@ -32,7 +32,7 @@ public partial interface IOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -54,7 +54,7 @@ public partial interface IOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IPrivateEndpointConnectionsOperations.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IPrivateEndpointConnectionsOperations.cs new file mode 100644 index 0000000000000..cebb4487730c3 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IPrivateEndpointConnectionsOperations.cs @@ -0,0 +1,142 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PrivateEndpointConnectionsOperations operations. + /// + public partial interface IPrivateEndpointConnectionsOperations + { + /// + /// List all the private endpoint connections associated with the Bot. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the specified private endpoint connection associated with the + /// Bot. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the private endpoint connection associated with the + /// Azure resource + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string resourceName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update the state of specified private endpoint connection + /// associated with the Bot. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the private endpoint connection associated with the + /// Azure resource + /// + /// + /// The private endpoint connection properties. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateWithHttpMessagesAsync(string resourceGroupName, string resourceName, string privateEndpointConnectionName, PrivateEndpointConnection properties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the specified private endpoint connection associated with + /// the Bot. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the private endpoint connection associated with the + /// Azure resource + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IPrivateLinkResourcesOperations.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IPrivateLinkResourcesOperations.cs new file mode 100644 index 0000000000000..4718cdad7ae2f --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/IPrivateLinkResourcesOperations.cs @@ -0,0 +1,52 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PrivateLinkResourcesOperations operations. + /// + public partial interface IPrivateLinkResourcesOperations + { + /// + /// Gets the private link resources that need to be created for a Bot. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListByBotResourceWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/AlexaChannel.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/AlexaChannel.cs new file mode 100644 index 0000000000000..38deff571d753 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/AlexaChannel.cs @@ -0,0 +1,72 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Alexa channel definition + /// + public partial class AlexaChannel : Channel + { + /// + /// Initializes a new instance of the AlexaChannel class. + /// + public AlexaChannel() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AlexaChannel class. + /// + /// Entity Tag of the resource + /// Provisioning state of the + /// resource + /// Specifies the location of the + /// resource. + /// The set of properties specific to Alexa + /// channel resource + public AlexaChannel(string etag = default(string), string provisioningState = default(string), string location = default(string), AlexaChannelProperties properties = default(AlexaChannelProperties)) + : base(etag, provisioningState, location) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the set of properties specific to Alexa channel + /// resource + /// + [JsonProperty(PropertyName = "properties")] + public AlexaChannelProperties Properties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Properties != null) + { + Properties.Validate(); + } + } + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/AlexaChannelProperties.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/AlexaChannelProperties.cs new file mode 100644 index 0000000000000..ac09ac0c17387 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/AlexaChannelProperties.cs @@ -0,0 +1,92 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The parameters to provide for the Alexa channel. + /// + public partial class AlexaChannelProperties + { + /// + /// Initializes a new instance of the AlexaChannelProperties class. + /// + public AlexaChannelProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AlexaChannelProperties class. + /// + /// The Alexa skill Id + /// Whether this channel is enabled for the + /// bot + /// Url fragment used in part of the Uri + /// configured in Alexa + /// Full Uri used to configured the + /// skill in Alexa + public AlexaChannelProperties(string alexaSkillId, bool isEnabled, string urlFragment = default(string), string serviceEndpointUri = default(string)) + { + AlexaSkillId = alexaSkillId; + UrlFragment = urlFragment; + ServiceEndpointUri = serviceEndpointUri; + IsEnabled = isEnabled; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Alexa skill Id + /// + [JsonProperty(PropertyName = "alexaSkillId")] + public string AlexaSkillId { get; set; } + + /// + /// Gets url fragment used in part of the Uri configured in Alexa + /// + [JsonProperty(PropertyName = "urlFragment")] + public string UrlFragment { get; private set; } + + /// + /// Gets full Uri used to configured the skill in Alexa + /// + [JsonProperty(PropertyName = "serviceEndpointUri")] + public string ServiceEndpointUri { get; private set; } + + /// + /// Gets or sets whether this channel is enabled for the bot + /// + [JsonProperty(PropertyName = "isEnabled")] + public bool IsEnabled { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (AlexaSkillId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AlexaSkillId"); + } + } + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/Bot.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/Bot.cs index 9e43268312280..2a835bc504a1b 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/Bot.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/Bot.cs @@ -40,13 +40,14 @@ public Bot() /// pairs. /// Gets or sets the SKU of the resource. /// Required. Gets or sets the Kind of the resource. - /// Possible values include: 'sdk', 'designer', 'bot', - /// 'function' + /// Possible values include: 'sdk', 'designer', 'bot', 'function', + /// 'azurebot' /// Entity Tag + /// Entity zones /// The set of properties specific to bot /// resource - public Bot(string id = default(string), string name = default(string), string location = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), string kind = default(string), string etag = default(string), BotProperties properties = default(BotProperties)) - : base(id, name, location, type, tags, sku, kind, etag) + public Bot(string id = default(string), string name = default(string), string location = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), string kind = default(string), string etag = default(string), IList zones = default(IList), BotProperties properties = default(BotProperties)) + : base(id, name, location, type, tags, sku, kind, etag, zones) { Properties = properties; CustomInit(); diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/BotChannel.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/BotChannel.cs index 997d6551fd512..fb71fcf79707a 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/BotChannel.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/BotChannel.cs @@ -40,13 +40,14 @@ public BotChannel() /// pairs. /// Gets or sets the SKU of the resource. /// Required. Gets or sets the Kind of the resource. - /// Possible values include: 'sdk', 'designer', 'bot', - /// 'function' + /// Possible values include: 'sdk', 'designer', 'bot', 'function', + /// 'azurebot' /// Entity Tag + /// Entity zones /// The set of properties specific to bot /// channel resource - public BotChannel(string id = default(string), string name = default(string), string location = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), string kind = default(string), string etag = default(string), Channel properties = default(Channel)) - : base(id, name, location, type, tags, sku, kind, etag) + public BotChannel(string id = default(string), string name = default(string), string location = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), string kind = default(string), string etag = default(string), IList zones = default(IList), Channel properties = default(Channel)) + : base(id, name, location, type, tags, sku, kind, etag, zones) { Properties = properties; CustomInit(); diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/BotProperties.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/BotProperties.cs index ff4e537b294df..c544cc002cfbd 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/BotProperties.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/BotProperties.cs @@ -38,6 +38,18 @@ public BotProperties() /// The description of the bot /// The Icon Url of the bot /// The bot's endpoint version + /// Contains resource all settings defined as + /// key/value pairs. + /// Contains resource parameters defined as + /// key/value pairs. + /// The bot's manifest url + /// Microsoft App Type for the bot. Possible + /// values include: 'UserAssignedMSI', 'SingleTenant', + /// 'MultiTenant' + /// Microsoft App Tenant Id for the + /// bot + /// Microsoft App Managed Identity + /// Resource Id for the bot /// Collection of channels for which /// the bot is configured /// Collection of channels for which the @@ -50,14 +62,49 @@ public BotProperties() /// Insights App Id /// Collection of LUIS App Ids /// The LUIS Key - public BotProperties(string displayName, string endpoint, string msaAppId, string description = default(string), string iconUrl = default(string), string endpointVersion = default(string), IList configuredChannels = default(IList), IList enabledChannels = default(IList), string developerAppInsightKey = default(string), string developerAppInsightsApiKey = default(string), string developerAppInsightsApplicationId = default(string), IList luisAppIds = default(IList), string luisKey = default(string)) + /// Whether Cmek is enabled + /// The CMK Url + /// The CMK encryption + /// status + /// Whether the bot is in an isolated + /// network. Possible values include: 'Enabled', 'Disabled' + /// Whether the bot is streaming + /// supported + /// Whether the bot is + /// developerAppInsightsApiKey set + /// Token used to migrate non Azure bot to + /// azure subscription + /// Opt-out of local authentication and + /// ensure only MSI and AAD can be used exclusively for + /// authentication. + /// The channel schema + /// transformation version for the bot + /// The storage resourceId for the + /// bot + /// List of Private Endpoint + /// Connections configured for the bot + /// The hint to browser (e.g. protocol + /// handler) on how to open the bot for authoring + /// The hint (e.g. keyVault secret + /// resourceId) on how to fetch the app secret + /// Provisioning state of the + /// resource + /// Publishing credentials of the + /// resource + public BotProperties(string displayName, string endpoint, string msaAppId, string description = default(string), string iconUrl = default(string), string endpointVersion = default(string), IDictionary allSettings = default(IDictionary), IDictionary parameters = default(IDictionary), string manifestUrl = default(string), string msaAppType = default(string), string msaAppTenantId = default(string), string msaAppMSIResourceId = default(string), IList configuredChannels = default(IList), IList enabledChannels = default(IList), string developerAppInsightKey = default(string), string developerAppInsightsApiKey = default(string), string developerAppInsightsApplicationId = default(string), IList luisAppIds = default(IList), string luisKey = default(string), bool? isCmekEnabled = default(bool?), string cmekKeyVaultUrl = default(string), string cmekEncryptionStatus = default(string), string publicNetworkAccess = default(string), bool? isStreamingSupported = default(bool?), bool? isDeveloperAppInsightsApiKeySet = default(bool?), string migrationToken = default(string), bool? disableLocalAuth = default(bool?), string schemaTransformationVersion = default(string), string storageResourceId = default(string), IList privateEndpointConnections = default(IList), string openWithHint = default(string), string appPasswordHint = default(string), string provisioningState = default(string), string publishingCredentials = default(string)) { DisplayName = displayName; Description = description; IconUrl = iconUrl; Endpoint = endpoint; EndpointVersion = endpointVersion; + AllSettings = allSettings; + Parameters = parameters; + ManifestUrl = manifestUrl; + MsaAppType = msaAppType; MsaAppId = msaAppId; + MsaAppTenantId = msaAppTenantId; + MsaAppMSIResourceId = msaAppMSIResourceId; ConfiguredChannels = configuredChannels; EnabledChannels = enabledChannels; DeveloperAppInsightKey = developerAppInsightKey; @@ -65,6 +112,21 @@ public BotProperties() DeveloperAppInsightsApplicationId = developerAppInsightsApplicationId; LuisAppIds = luisAppIds; LuisKey = luisKey; + IsCmekEnabled = isCmekEnabled; + CmekKeyVaultUrl = cmekKeyVaultUrl; + CmekEncryptionStatus = cmekEncryptionStatus; + PublicNetworkAccess = publicNetworkAccess; + IsStreamingSupported = isStreamingSupported; + IsDeveloperAppInsightsApiKeySet = isDeveloperAppInsightsApiKeySet; + MigrationToken = migrationToken; + DisableLocalAuth = disableLocalAuth; + SchemaTransformationVersion = schemaTransformationVersion; + StorageResourceId = storageResourceId; + PrivateEndpointConnections = privateEndpointConnections; + OpenWithHint = openWithHint; + AppPasswordHint = appPasswordHint; + ProvisioningState = provisioningState; + PublishingCredentials = publishingCredentials; CustomInit(); } @@ -103,12 +165,51 @@ public BotProperties() [JsonProperty(PropertyName = "endpointVersion")] public string EndpointVersion { get; private set; } + /// + /// Gets or sets contains resource all settings defined as key/value + /// pairs. + /// + [JsonProperty(PropertyName = "allSettings")] + public IDictionary AllSettings { get; set; } + + /// + /// Gets or sets contains resource parameters defined as key/value + /// pairs. + /// + [JsonProperty(PropertyName = "parameters")] + public IDictionary Parameters { get; set; } + + /// + /// Gets or sets the bot's manifest url + /// + [JsonProperty(PropertyName = "manifestUrl")] + public string ManifestUrl { get; set; } + + /// + /// Gets or sets microsoft App Type for the bot. Possible values + /// include: 'UserAssignedMSI', 'SingleTenant', 'MultiTenant' + /// + [JsonProperty(PropertyName = "msaAppType")] + public string MsaAppType { get; set; } + /// /// Gets or sets microsoft App Id for the bot /// [JsonProperty(PropertyName = "msaAppId")] public string MsaAppId { get; set; } + /// + /// Gets or sets microsoft App Tenant Id for the bot + /// + [JsonProperty(PropertyName = "msaAppTenantId")] + public string MsaAppTenantId { get; set; } + + /// + /// Gets or sets microsoft App Managed Identity Resource Id for the bot + /// + [JsonProperty(PropertyName = "msaAppMSIResourceId")] + public string MsaAppMSIResourceId { get; set; } + /// /// Gets collection of channels for which the bot is configured /// @@ -151,6 +252,100 @@ public BotProperties() [JsonProperty(PropertyName = "luisKey")] public string LuisKey { get; set; } + /// + /// Gets or sets whether Cmek is enabled + /// + [JsonProperty(PropertyName = "isCmekEnabled")] + public bool? IsCmekEnabled { get; set; } + + /// + /// Gets or sets the CMK Url + /// + [JsonProperty(PropertyName = "cmekKeyVaultUrl")] + public string CmekKeyVaultUrl { get; set; } + + /// + /// Gets the CMK encryption status + /// + [JsonProperty(PropertyName = "cmekEncryptionStatus")] + public string CmekEncryptionStatus { get; private set; } + + /// + /// Gets or sets whether the bot is in an isolated network. Possible + /// values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "publicNetworkAccess")] + public string PublicNetworkAccess { get; set; } + + /// + /// Gets or sets whether the bot is streaming supported + /// + [JsonProperty(PropertyName = "isStreamingSupported")] + public bool? IsStreamingSupported { get; set; } + + /// + /// Gets whether the bot is developerAppInsightsApiKey set + /// + [JsonProperty(PropertyName = "isDeveloperAppInsightsApiKeySet")] + public bool? IsDeveloperAppInsightsApiKeySet { get; private set; } + + /// + /// Gets token used to migrate non Azure bot to azure subscription + /// + [JsonProperty(PropertyName = "migrationToken")] + public string MigrationToken { get; private set; } + + /// + /// Gets or sets opt-out of local authentication and ensure only MSI + /// and AAD can be used exclusively for authentication. + /// + [JsonProperty(PropertyName = "disableLocalAuth")] + public bool? DisableLocalAuth { get; set; } + + /// + /// Gets or sets the channel schema transformation version for the bot + /// + [JsonProperty(PropertyName = "schemaTransformationVersion")] + public string SchemaTransformationVersion { get; set; } + + /// + /// Gets or sets the storage resourceId for the bot + /// + [JsonProperty(PropertyName = "storageResourceId")] + public string StorageResourceId { get; set; } + + /// + /// Gets list of Private Endpoint Connections configured for the bot + /// + [JsonProperty(PropertyName = "privateEndpointConnections")] + public IList PrivateEndpointConnections { get; private set; } + + /// + /// Gets or sets the hint to browser (e.g. protocol handler) on how to + /// open the bot for authoring + /// + [JsonProperty(PropertyName = "openWithHint")] + public string OpenWithHint { get; set; } + + /// + /// Gets or sets the hint (e.g. keyVault secret resourceId) on how to + /// fetch the app secret + /// + [JsonProperty(PropertyName = "appPasswordHint")] + public string AppPasswordHint { get; set; } + + /// + /// Gets provisioning state of the resource + /// + [JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets publishing credentials of the resource + /// + [JsonProperty(PropertyName = "publishingCredentials")] + public string PublishingCredentials { get; set; } + /// /// Validate the object. /// @@ -171,6 +366,16 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "MsaAppId"); } + if (PrivateEndpointConnections != null) + { + foreach (var element in PrivateEndpointConnections) + { + if (element != null) + { + element.Validate(); + } + } + } } } } diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/Channel.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/Channel.cs index 84c74d4a05ed0..9bbc3979ba493 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/Channel.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/Channel.cs @@ -10,6 +10,7 @@ namespace Microsoft.Azure.Management.BotService.Models { + using Newtonsoft.Json; using System.Linq; /// @@ -25,11 +26,44 @@ public Channel() CustomInit(); } + /// + /// Initializes a new instance of the Channel class. + /// + /// Entity Tag of the resource + /// Provisioning state of the + /// resource + /// Specifies the location of the + /// resource. + public Channel(string etag = default(string), string provisioningState = default(string), string location = default(string)) + { + Etag = etag; + ProvisioningState = provisioningState; + Location = location; + CustomInit(); + } /// /// An initialization method that performs custom operations like setting defaults /// partial void CustomInit(); + /// + /// Gets or sets entity Tag of the resource + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; set; } + + /// + /// Gets provisioning state of the resource + /// + [JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets specifies the location of the resource. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + } } diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ChannelName.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ChannelName.cs index 3c953a2f98689..323a2806db912 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ChannelName.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ChannelName.cs @@ -21,6 +21,8 @@ namespace Microsoft.Azure.Management.BotService.Models [JsonConverter(typeof(StringEnumConverter))] public enum ChannelName { + [EnumMember(Value = "AlexaChannel")] + AlexaChannel, [EnumMember(Value = "FacebookChannel")] FacebookChannel, [EnumMember(Value = "EmailChannel")] @@ -40,7 +42,11 @@ public enum ChannelName [EnumMember(Value = "DirectLineChannel")] DirectLineChannel, [EnumMember(Value = "SmsChannel")] - SmsChannel + SmsChannel, + [EnumMember(Value = "LineChannel")] + LineChannel, + [EnumMember(Value = "DirectLineSpeechChannel")] + DirectLineSpeechChannel } internal static class ChannelNameEnumExtension { @@ -53,6 +59,8 @@ internal static string ToSerializedValue(this ChannelName value) { switch( value ) { + case ChannelName.AlexaChannel: + return "AlexaChannel"; case ChannelName.FacebookChannel: return "FacebookChannel"; case ChannelName.EmailChannel: @@ -73,6 +81,10 @@ internal static string ToSerializedValue(this ChannelName value) return "DirectLineChannel"; case ChannelName.SmsChannel: return "SmsChannel"; + case ChannelName.LineChannel: + return "LineChannel"; + case ChannelName.DirectLineSpeechChannel: + return "DirectLineSpeechChannel"; } return null; } @@ -81,6 +93,8 @@ internal static string ToSerializedValue(this ChannelName value) { switch( value ) { + case "AlexaChannel": + return ChannelName.AlexaChannel; case "FacebookChannel": return ChannelName.FacebookChannel; case "EmailChannel": @@ -101,6 +115,10 @@ internal static string ToSerializedValue(this ChannelName value) return ChannelName.DirectLineChannel; case "SmsChannel": return ChannelName.SmsChannel; + case "LineChannel": + return ChannelName.LineChannel; + case "DirectLineSpeechChannel": + return ChannelName.DirectLineSpeechChannel; } return null; } diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ChannelSettings.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ChannelSettings.cs new file mode 100644 index 0000000000000..5f428d07c075c --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ChannelSettings.cs @@ -0,0 +1,121 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Channel settings definition + /// + public partial class ChannelSettings + { + /// + /// Initializes a new instance of the ChannelSettings class. + /// + public ChannelSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ChannelSettings class. + /// + /// The extensionKey1 + /// The extensionKey2 + /// The list of sites + /// The channel id + /// The channel display name + /// The bot id + /// The bot icon url + /// Whether this channel is enabled for the + /// bot + /// Opt-out of local authentication and + /// ensure only MSI and AAD can be used exclusively for + /// authentication. + public ChannelSettings(string extensionKey1 = default(string), string extensionKey2 = default(string), IList sites = default(IList), string channelId = default(string), string channelDisplayName = default(string), string botId = default(string), string botIconUrl = default(string), bool? isEnabled = default(bool?), bool? disableLocalAuth = default(bool?)) + { + ExtensionKey1 = extensionKey1; + ExtensionKey2 = extensionKey2; + Sites = sites; + ChannelId = channelId; + ChannelDisplayName = channelDisplayName; + BotId = botId; + BotIconUrl = botIconUrl; + IsEnabled = isEnabled; + DisableLocalAuth = disableLocalAuth; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the extensionKey1 + /// + [JsonProperty(PropertyName = "extensionKey1")] + public string ExtensionKey1 { get; set; } + + /// + /// Gets or sets the extensionKey2 + /// + [JsonProperty(PropertyName = "extensionKey2")] + public string ExtensionKey2 { get; set; } + + /// + /// Gets or sets the list of sites + /// + [JsonProperty(PropertyName = "sites")] + public IList Sites { get; set; } + + /// + /// Gets or sets the channel id + /// + [JsonProperty(PropertyName = "channelId")] + public string ChannelId { get; set; } + + /// + /// Gets or sets the channel display name + /// + [JsonProperty(PropertyName = "channelDisplayName")] + public string ChannelDisplayName { get; set; } + + /// + /// Gets or sets the bot id + /// + [JsonProperty(PropertyName = "botId")] + public string BotId { get; set; } + + /// + /// Gets or sets the bot icon url + /// + [JsonProperty(PropertyName = "botIconUrl")] + public string BotIconUrl { get; set; } + + /// + /// Gets or sets whether this channel is enabled for the bot + /// + [JsonProperty(PropertyName = "isEnabled")] + public bool? IsEnabled { get; set; } + + /// + /// Gets or sets opt-out of local authentication and ensure only MSI + /// and AAD can be used exclusively for authentication. + /// + [JsonProperty(PropertyName = "disableLocalAuth")] + public bool? DisableLocalAuth { get; set; } + + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ConnectionItemName.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ConnectionItemName.cs new file mode 100644 index 0000000000000..f1ae4d6ae1158 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ConnectionItemName.cs @@ -0,0 +1,52 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The display name of a connection Item Setting registered with the Bot + /// + public partial class ConnectionItemName + { + /// + /// Initializes a new instance of the ConnectionItemName class. + /// + public ConnectionItemName() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ConnectionItemName class. + /// + /// Connection Item name that has been added in the + /// API + public ConnectionItemName(string name = default(string)) + { + Name = name; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets connection Item name that has been added in the API + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ConnectionSetting.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ConnectionSetting.cs new file mode 100644 index 0000000000000..e45017e9f67f6 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ConnectionSetting.cs @@ -0,0 +1,78 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Bot channel resource definition + /// + public partial class ConnectionSetting : Resource + { + /// + /// Initializes a new instance of the ConnectionSetting class. + /// + public ConnectionSetting() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ConnectionSetting class. + /// + /// Specifies the resource ID. + /// Specifies the name of the resource. + /// Specifies the location of the + /// resource. + /// Specifies the type of the resource. + /// Contains resource tags defined as key/value + /// pairs. + /// Gets or sets the SKU of the resource. + /// Required. Gets or sets the Kind of the resource. + /// Possible values include: 'sdk', 'designer', 'bot', 'function', + /// 'azurebot' + /// Entity Tag + /// Entity zones + /// The set of properties specific to bot + /// channel resource + public ConnectionSetting(string id = default(string), string name = default(string), string location = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), string kind = default(string), string etag = default(string), IList zones = default(IList), ConnectionSettingProperties properties = default(ConnectionSettingProperties)) + : base(id, name, location, type, tags, sku, kind, etag, zones) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the set of properties specific to bot channel resource + /// + [JsonProperty(PropertyName = "properties")] + public ConnectionSettingProperties Properties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ConnectionSettingParameter.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ConnectionSettingParameter.cs new file mode 100644 index 0000000000000..4144808ef27ab --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ConnectionSettingParameter.cs @@ -0,0 +1,62 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Extra Parameter in a Connection Setting Properties to indicate service + /// provider specific properties + /// + public partial class ConnectionSettingParameter + { + /// + /// Initializes a new instance of the ConnectionSettingParameter class. + /// + public ConnectionSettingParameter() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ConnectionSettingParameter class. + /// + /// Key for the Connection Setting Parameter. + /// Value associated with the Connection Setting + /// Parameter. + public ConnectionSettingParameter(string key = default(string), string value = default(string)) + { + Key = key; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets key for the Connection Setting Parameter. + /// + [JsonProperty(PropertyName = "key")] + public string Key { get; set; } + + /// + /// Gets or sets value associated with the Connection Setting + /// Parameter. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; set; } + + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ConnectionSettingProperties.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ConnectionSettingProperties.cs new file mode 100644 index 0000000000000..aa8e112658bcb --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ConnectionSettingProperties.cs @@ -0,0 +1,139 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Properties for a Connection Setting Item + /// + public partial class ConnectionSettingProperties + { + /// + /// Initializes a new instance of the ConnectionSettingProperties + /// class. + /// + public ConnectionSettingProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ConnectionSettingProperties + /// class. + /// + /// Id associated with the Connection Setting. + /// Name associated with the Connection + /// Setting. + /// Client Id associated with the Connection + /// Setting. + /// Setting Id set by the service for the + /// Connection Setting. + /// Client Secret associated with the + /// Connection Setting + /// Scopes associated with the Connection + /// Setting + /// Service Provider Id associated with + /// the Connection Setting + /// Service Provider Display + /// Name associated with the Connection Setting + /// Service Provider Parameters associated + /// with the Connection Setting + /// Provisioning state of the + /// resource + public ConnectionSettingProperties(string id = default(string), string name = default(string), string clientId = default(string), string settingId = default(string), string clientSecret = default(string), string scopes = default(string), string serviceProviderId = default(string), string serviceProviderDisplayName = default(string), IList parameters = default(IList), string provisioningState = default(string)) + { + Id = id; + Name = name; + ClientId = clientId; + SettingId = settingId; + ClientSecret = clientSecret; + Scopes = scopes; + ServiceProviderId = serviceProviderId; + ServiceProviderDisplayName = serviceProviderDisplayName; + Parameters = parameters; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets id associated with the Connection Setting. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets name associated with the Connection Setting. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets client Id associated with the Connection Setting. + /// + [JsonProperty(PropertyName = "clientId")] + public string ClientId { get; set; } + + /// + /// Gets setting Id set by the service for the Connection Setting. + /// + [JsonProperty(PropertyName = "settingId")] + public string SettingId { get; private set; } + + /// + /// Gets or sets client Secret associated with the Connection Setting + /// + [JsonProperty(PropertyName = "clientSecret")] + public string ClientSecret { get; set; } + + /// + /// Gets or sets scopes associated with the Connection Setting + /// + [JsonProperty(PropertyName = "scopes")] + public string Scopes { get; set; } + + /// + /// Gets or sets service Provider Id associated with the Connection + /// Setting + /// + [JsonProperty(PropertyName = "serviceProviderId")] + public string ServiceProviderId { get; set; } + + /// + /// Gets or sets service Provider Display Name associated with the + /// Connection Setting + /// + [JsonProperty(PropertyName = "serviceProviderDisplayName")] + public string ServiceProviderDisplayName { get; set; } + + /// + /// Gets or sets service Provider Parameters associated with the + /// Connection Setting + /// + [JsonProperty(PropertyName = "parameters")] + public IList Parameters { get; set; } + + /// + /// Gets or sets provisioning state of the resource + /// + [JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState { get; set; } + + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/DirectLineChannel.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/DirectLineChannel.cs index 2fa472cb22453..a1ffd39427cca 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/DirectLineChannel.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/DirectLineChannel.cs @@ -29,9 +29,15 @@ public DirectLineChannel() /// /// Initializes a new instance of the DirectLineChannel class. /// + /// Entity Tag of the resource + /// Provisioning state of the + /// resource + /// Specifies the location of the + /// resource. /// The set of properties specific to Direct /// Line channel resource - public DirectLineChannel(DirectLineChannelProperties properties = default(DirectLineChannelProperties)) + public DirectLineChannel(string etag = default(string), string provisioningState = default(string), string location = default(string), DirectLineChannelProperties properties = default(DirectLineChannelProperties)) + : base(etag, provisioningState, location) { Properties = properties; CustomInit(); diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/DirectLineChannelProperties.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/DirectLineChannelProperties.cs index 4d74376002fc9..9640401ea2d7c 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/DirectLineChannelProperties.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/DirectLineChannelProperties.cs @@ -34,9 +34,12 @@ public DirectLineChannelProperties() /// class. /// /// The list of Direct Line sites - public DirectLineChannelProperties(IList sites = default(IList)) + /// Direct Line embed code of the + /// resource + public DirectLineChannelProperties(IList sites = default(IList), string directLineEmbedCode = default(string)) { Sites = sites; + DirectLineEmbedCode = directLineEmbedCode; CustomInit(); } @@ -51,5 +54,11 @@ public DirectLineChannelProperties() [JsonProperty(PropertyName = "sites")] public IList Sites { get; set; } + /// + /// Gets or sets direct Line embed code of the resource + /// + [JsonProperty(PropertyName = "DirectLineEmbedCode")] + public string DirectLineEmbedCode { get; set; } + } } diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/DirectLineSite.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/DirectLineSite.cs index 41476af5c0762..61218580fe37e 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/DirectLineSite.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/DirectLineSite.cs @@ -12,6 +12,8 @@ namespace Microsoft.Azure.Management.BotService.Models { using Microsoft.Rest; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -32,17 +34,24 @@ public DirectLineSite() /// /// Site name /// Whether this site is enabled for DirectLine - /// channel + /// channel. /// Whether this site is enabled for Bot - /// Framework V1 protocol + /// Framework V1 protocol. /// Whether this site is enabled for Bot - /// Framework V1 protocol + /// Framework V1 protocol. /// Site Id /// Primary key. Value only returned through POST to /// the action Channel List API, otherwise empty. /// Secondary key. Value only returned through POST /// to the action Channel List API, otherwise empty. - public DirectLineSite(string siteName, bool isEnabled, bool isV1Enabled, bool isV3Enabled, string siteId = default(string), string key = default(string), string key2 = default(string)) + /// Whether this site is enabled for + /// authentication with Bot Framework. + /// Whether this site is enabled + /// for block user upload. + /// List of Trusted Origin URLs for this + /// site. This field is applicable only if isSecureSiteEnabled is + /// True. + public DirectLineSite(string siteName, bool isEnabled, bool isV1Enabled, bool isV3Enabled, string siteId = default(string), string key = default(string), string key2 = default(string), bool? isSecureSiteEnabled = default(bool?), bool? isBlockUserUploadEnabled = default(bool?), IList trustedOrigins = default(IList)) { SiteId = siteId; SiteName = siteName; @@ -51,6 +60,9 @@ public DirectLineSite() IsEnabled = isEnabled; IsV1Enabled = isV1Enabled; IsV3Enabled = isV3Enabled; + IsSecureSiteEnabled = isSecureSiteEnabled; + IsBlockUserUploadEnabled = isBlockUserUploadEnabled; + TrustedOrigins = trustedOrigins; CustomInit(); } @@ -86,25 +98,45 @@ public DirectLineSite() public string Key2 { get; private set; } /// - /// Gets or sets whether this site is enabled for DirectLine channel + /// Gets or sets whether this site is enabled for DirectLine channel. /// [JsonProperty(PropertyName = "isEnabled")] public bool IsEnabled { get; set; } /// /// Gets or sets whether this site is enabled for Bot Framework V1 - /// protocol + /// protocol. /// [JsonProperty(PropertyName = "isV1Enabled")] public bool IsV1Enabled { get; set; } /// /// Gets or sets whether this site is enabled for Bot Framework V1 - /// protocol + /// protocol. /// [JsonProperty(PropertyName = "isV3Enabled")] public bool IsV3Enabled { get; set; } + /// + /// Gets or sets whether this site is enabled for authentication with + /// Bot Framework. + /// + [JsonProperty(PropertyName = "isSecureSiteEnabled")] + public bool? IsSecureSiteEnabled { get; set; } + + /// + /// Gets or sets whether this site is enabled for block user upload. + /// + [JsonProperty(PropertyName = "isBlockUserUploadEnabled")] + public bool? IsBlockUserUploadEnabled { get; set; } + + /// + /// Gets or sets list of Trusted Origin URLs for this site. This field + /// is applicable only if isSecureSiteEnabled is True. + /// + [JsonProperty(PropertyName = "trustedOrigins")] + public IList TrustedOrigins { get; set; } + /// /// Validate the object. /// diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/DirectLineSpeechChannel.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/DirectLineSpeechChannel.cs new file mode 100644 index 0000000000000..df7099462bdb9 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/DirectLineSpeechChannel.cs @@ -0,0 +1,72 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// DirectLine Speech channel definition + /// + public partial class DirectLineSpeechChannel : Channel + { + /// + /// Initializes a new instance of the DirectLineSpeechChannel class. + /// + public DirectLineSpeechChannel() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DirectLineSpeechChannel class. + /// + /// Entity Tag of the resource + /// Provisioning state of the + /// resource + /// Specifies the location of the + /// resource. + /// The set of properties specific to + /// DirectLine Speech channel resource + public DirectLineSpeechChannel(string etag = default(string), string provisioningState = default(string), string location = default(string), DirectLineSpeechChannelProperties properties = default(DirectLineSpeechChannelProperties)) + : base(etag, provisioningState, location) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the set of properties specific to DirectLine Speech + /// channel resource + /// + [JsonProperty(PropertyName = "properties")] + public DirectLineSpeechChannelProperties Properties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Properties != null) + { + Properties.Validate(); + } + } + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/DirectLineSpeechChannelProperties.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/DirectLineSpeechChannelProperties.cs new file mode 100644 index 0000000000000..31c47cb0b9653 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/DirectLineSpeechChannelProperties.cs @@ -0,0 +1,120 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The parameters to provide for the DirectLine Speech channel. + /// + public partial class DirectLineSpeechChannelProperties + { + /// + /// Initializes a new instance of the DirectLineSpeechChannelProperties + /// class. + /// + public DirectLineSpeechChannelProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DirectLineSpeechChannelProperties + /// class. + /// + /// The cognitive service region + /// with this channel registration. + /// The cognitive service + /// subscription key to use with this channel registration. + /// Whether this channel is enabled or + /// not. + /// Custom speech model id + /// (optional). + /// Custom voice deployment id + /// (optional). + /// Make this a default bot + /// for chosen cognitive service account. + public DirectLineSpeechChannelProperties(string cognitiveServiceRegion, string cognitiveServiceSubscriptionKey, bool? isEnabled = default(bool?), string customVoiceDeploymentId = default(string), string customSpeechModelId = default(string), bool? isDefaultBotForCogSvcAccount = default(bool?)) + { + CognitiveServiceRegion = cognitiveServiceRegion; + CognitiveServiceSubscriptionKey = cognitiveServiceSubscriptionKey; + IsEnabled = isEnabled; + CustomVoiceDeploymentId = customVoiceDeploymentId; + CustomSpeechModelId = customSpeechModelId; + IsDefaultBotForCogSvcAccount = isDefaultBotForCogSvcAccount; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the cognitive service region with this channel + /// registration. + /// + [JsonProperty(PropertyName = "cognitiveServiceRegion")] + public string CognitiveServiceRegion { get; set; } + + /// + /// Gets or sets the cognitive service subscription key to use with + /// this channel registration. + /// + [JsonProperty(PropertyName = "cognitiveServiceSubscriptionKey")] + public string CognitiveServiceSubscriptionKey { get; set; } + + /// + /// Gets or sets whether this channel is enabled or not. + /// + [JsonProperty(PropertyName = "isEnabled")] + public bool? IsEnabled { get; set; } + + /// + /// Gets or sets custom speech model id (optional). + /// + [JsonProperty(PropertyName = "customVoiceDeploymentId")] + public string CustomVoiceDeploymentId { get; set; } + + /// + /// Gets or sets custom voice deployment id (optional). + /// + [JsonProperty(PropertyName = "customSpeechModelId")] + public string CustomSpeechModelId { get; set; } + + /// + /// Gets or sets make this a default bot for chosen cognitive service + /// account. + /// + [JsonProperty(PropertyName = "isDefaultBotForCogSvcAccount")] + public bool? IsDefaultBotForCogSvcAccount { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (CognitiveServiceRegion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "CognitiveServiceRegion"); + } + if (CognitiveServiceSubscriptionKey == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "CognitiveServiceSubscriptionKey"); + } + } + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/EmailChannel.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/EmailChannel.cs index c50818f6feb6e..fc459cc9f6501 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/EmailChannel.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/EmailChannel.cs @@ -29,9 +29,15 @@ public EmailChannel() /// /// Initializes a new instance of the EmailChannel class. /// + /// Entity Tag of the resource + /// Provisioning state of the + /// resource + /// Specifies the location of the + /// resource. /// The set of properties specific to email /// channel resource - public EmailChannel(EmailChannelProperties properties = default(EmailChannelProperties)) + public EmailChannel(string etag = default(string), string provisioningState = default(string), string location = default(string), EmailChannelProperties properties = default(EmailChannelProperties)) + : base(etag, provisioningState, location) { Properties = properties; CustomInit(); diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/EmailChannelProperties.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/EmailChannelProperties.cs index 0cfdb80166c38..a483fb8018584 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/EmailChannelProperties.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/EmailChannelProperties.cs @@ -31,12 +31,12 @@ public EmailChannelProperties() /// Initializes a new instance of the EmailChannelProperties class. /// /// The email address + /// Whether this channel is enabled for the + /// bot /// The password for the email address. Value /// only returned through POST to the action Channel List API, /// otherwise empty. - /// Whether this channel is enabled for the - /// bot - public EmailChannelProperties(string emailAddress, string password, bool isEnabled) + public EmailChannelProperties(string emailAddress, bool isEnabled, string password = default(string)) { EmailAddress = emailAddress; Password = password; @@ -81,10 +81,6 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "EmailAddress"); } - if (Password == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Password"); - } } } } diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/FacebookChannel.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/FacebookChannel.cs index 3ba334d31396f..a044b8abf18a0 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/FacebookChannel.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/FacebookChannel.cs @@ -29,9 +29,15 @@ public FacebookChannel() /// /// Initializes a new instance of the FacebookChannel class. /// + /// Entity Tag of the resource + /// Provisioning state of the + /// resource + /// Specifies the location of the + /// resource. /// The set of properties specific to bot /// facebook channel - public FacebookChannel(FacebookChannelProperties properties = default(FacebookChannelProperties)) + public FacebookChannel(string etag = default(string), string provisioningState = default(string), string location = default(string), FacebookChannelProperties properties = default(FacebookChannelProperties)) + : base(etag, provisioningState, location) { Properties = properties; CustomInit(); diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/FacebookChannelProperties.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/FacebookChannelProperties.cs index 92ffff557915f..97df7558e82c4 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/FacebookChannelProperties.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/FacebookChannelProperties.cs @@ -33,16 +33,16 @@ public FacebookChannelProperties() /// Initializes a new instance of the FacebookChannelProperties class. /// /// Facebook application id - /// Facebook application secret. Value only - /// returned through POST to the action Channel List API, otherwise - /// empty. /// Whether this channel is enabled for the /// bot /// Verify token. Value only returned through /// POST to the action Channel List API, otherwise empty. /// The list of Facebook pages + /// Facebook application secret. Value only + /// returned through POST to the action Channel List API, otherwise + /// empty. /// Callback Url - public FacebookChannelProperties(string appId, string appSecret, bool isEnabled, string verifyToken = default(string), IList pages = default(IList), string callbackUrl = default(string)) + public FacebookChannelProperties(string appId, bool isEnabled, string verifyToken = default(string), IList pages = default(IList), string appSecret = default(string), string callbackUrl = default(string)) { VerifyToken = verifyToken; Pages = pages; @@ -108,10 +108,6 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "AppId"); } - if (AppSecret == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AppSecret"); - } if (Pages != null) { foreach (var element in Pages) diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/FacebookPage.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/FacebookPage.cs index 6f1a8dc581bbb..38ee7a26d1b34 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/FacebookPage.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/FacebookPage.cs @@ -34,7 +34,7 @@ public FacebookPage() /// Facebook application access token. Value /// only returned through POST to the action Channel List API, /// otherwise empty. - public FacebookPage(string id, string accessToken) + public FacebookPage(string id, string accessToken = default(string)) { Id = id; AccessToken = accessToken; @@ -71,10 +71,6 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "Id"); } - if (AccessToken == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AccessToken"); - } } } } diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/HostSettingsResponse.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/HostSettingsResponse.cs new file mode 100644 index 0000000000000..edd916629b706 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/HostSettingsResponse.cs @@ -0,0 +1,118 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The response body returned for a request to Bot Service Management to + /// check per subscription hostSettings + /// + public partial class HostSettingsResponse + { + /// + /// Initializes a new instance of the HostSettingsResponse class. + /// + public HostSettingsResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the HostSettingsResponse class. + /// + /// For in-conversation bot user + /// authentication + /// For verifying + /// incoming tokens from the channels + /// For verifying incoming + /// tokens from the channels + /// For verifying + /// incoming tokens from bot emulator + /// For getting access token to + /// channels from bot host + /// For getting access token + /// to channels from bot host + /// Per cloud OAuth setting on whether + /// authority is validated + /// Same as + /// toBotFromChannelOpenIdMetadataUrl, used by SDK < v4.12 + public HostSettingsResponse(string oAuthUrl = default(string), string toBotFromChannelOpenIdMetadataUrl = default(string), string toBotFromChannelTokenIssuer = default(string), string toBotFromEmulatorOpenIdMetadataUrl = default(string), string toChannelFromBotLoginUrl = default(string), string toChannelFromBotOAuthScope = default(string), bool? validateAuthority = default(bool?), string botOpenIdMetadata = default(string)) + { + OAuthUrl = oAuthUrl; + ToBotFromChannelOpenIdMetadataUrl = toBotFromChannelOpenIdMetadataUrl; + ToBotFromChannelTokenIssuer = toBotFromChannelTokenIssuer; + ToBotFromEmulatorOpenIdMetadataUrl = toBotFromEmulatorOpenIdMetadataUrl; + ToChannelFromBotLoginUrl = toChannelFromBotLoginUrl; + ToChannelFromBotOAuthScope = toChannelFromBotOAuthScope; + ValidateAuthority = validateAuthority; + BotOpenIdMetadata = botOpenIdMetadata; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets for in-conversation bot user authentication + /// + [JsonProperty(PropertyName = "OAuthUrl")] + public string OAuthUrl { get; set; } + + /// + /// Gets or sets for verifying incoming tokens from the channels + /// + [JsonProperty(PropertyName = "ToBotFromChannelOpenIdMetadataUrl")] + public string ToBotFromChannelOpenIdMetadataUrl { get; set; } + + /// + /// Gets or sets for verifying incoming tokens from the channels + /// + [JsonProperty(PropertyName = "ToBotFromChannelTokenIssuer")] + public string ToBotFromChannelTokenIssuer { get; set; } + + /// + /// Gets or sets for verifying incoming tokens from bot emulator + /// + [JsonProperty(PropertyName = "ToBotFromEmulatorOpenIdMetadataUrl")] + public string ToBotFromEmulatorOpenIdMetadataUrl { get; set; } + + /// + /// Gets or sets for getting access token to channels from bot host + /// + [JsonProperty(PropertyName = "ToChannelFromBotLoginUrl")] + public string ToChannelFromBotLoginUrl { get; set; } + + /// + /// Gets or sets for getting access token to channels from bot host + /// + [JsonProperty(PropertyName = "ToChannelFromBotOAuthScope")] + public string ToChannelFromBotOAuthScope { get; set; } + + /// + /// Gets or sets per cloud OAuth setting on whether authority is + /// validated + /// + [JsonProperty(PropertyName = "ValidateAuthority")] + public bool? ValidateAuthority { get; set; } + + /// + /// Gets or sets same as toBotFromChannelOpenIdMetadataUrl, used by SDK + /// &lt; v4.12 + /// + [JsonProperty(PropertyName = "BotOpenIdMetadata")] + public string BotOpenIdMetadata { get; set; } + + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/Key.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/Key.cs new file mode 100644 index 0000000000000..7365bfbc2b11a --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/Key.cs @@ -0,0 +1,60 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for Key. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum Key + { + [EnumMember(Value = "key1")] + Key1, + [EnumMember(Value = "key2")] + Key2 + } + internal static class KeyEnumExtension + { + internal static string ToSerializedValue(this Key? value) + { + return value == null ? null : ((Key)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this Key value) + { + switch( value ) + { + case Key.Key1: + return "key1"; + case Key.Key2: + return "key2"; + } + return null; + } + + internal static Key? ParseKey(this string value) + { + switch( value ) + { + case "key1": + return Key.Key1; + case "key2": + return Key.Key2; + } + return null; + } + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/KikChannel.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/KikChannel.cs index e54534de0956b..7addb7b9d71c0 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/KikChannel.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/KikChannel.cs @@ -29,9 +29,15 @@ public KikChannel() /// /// Initializes a new instance of the KikChannel class. /// + /// Entity Tag of the resource + /// Provisioning state of the + /// resource + /// Specifies the location of the + /// resource. /// The set of properties specific to Kik /// channel resource - public KikChannel(KikChannelProperties properties = default(KikChannelProperties)) + public KikChannel(string etag = default(string), string provisioningState = default(string), string location = default(string), KikChannelProperties properties = default(KikChannelProperties)) + : base(etag, provisioningState, location) { Properties = properties; CustomInit(); diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/KikChannelProperties.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/KikChannelProperties.cs index 6b7039d0c7b07..fbe8eac6dcc9f 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/KikChannelProperties.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/KikChannelProperties.cs @@ -31,13 +31,13 @@ public KikChannelProperties() /// Initializes a new instance of the KikChannelProperties class. /// /// The Kik user name - /// Kik API key. Value only returned through POST - /// to the action Channel List API, otherwise empty. /// Whether this channel is enabled for the /// bot + /// Kik API key. Value only returned through POST + /// to the action Channel List API, otherwise empty. /// Whether this channel is validated for the /// bot - public KikChannelProperties(string userName, string apiKey, bool isEnabled, bool? isValidated = default(bool?)) + public KikChannelProperties(string userName, bool isEnabled, string apiKey = default(string), bool? isValidated = default(bool?)) { UserName = userName; ApiKey = apiKey; @@ -88,10 +88,6 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "UserName"); } - if (ApiKey == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ApiKey"); - } } } } diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/Kind.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/Kind.cs index 1a8d20452e79f..ac0b7ed4bcdb9 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/Kind.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/Kind.cs @@ -20,5 +20,6 @@ public static class Kind public const string Designer = "designer"; public const string Bot = "bot"; public const string Function = "function"; + public const string Azurebot = "azurebot"; } } diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/LineChannel.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/LineChannel.cs new file mode 100644 index 0000000000000..b64ec722df4ae --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/LineChannel.cs @@ -0,0 +1,72 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Line channel definition + /// + public partial class LineChannel : Channel + { + /// + /// Initializes a new instance of the LineChannel class. + /// + public LineChannel() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LineChannel class. + /// + /// Entity Tag of the resource + /// Provisioning state of the + /// resource + /// Specifies the location of the + /// resource. + /// The set of properties specific to line + /// channel resource + public LineChannel(string etag = default(string), string provisioningState = default(string), string location = default(string), LineChannelProperties properties = default(LineChannelProperties)) + : base(etag, provisioningState, location) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the set of properties specific to line channel + /// resource + /// + [JsonProperty(PropertyName = "properties")] + public LineChannelProperties Properties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Properties != null) + { + Properties.Validate(); + } + } + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/LineChannelProperties.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/LineChannelProperties.cs new file mode 100644 index 0000000000000..eda15c45a19b9 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/LineChannelProperties.cs @@ -0,0 +1,86 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The parameters to provide for the Line channel. + /// + public partial class LineChannelProperties + { + /// + /// Initializes a new instance of the LineChannelProperties class. + /// + public LineChannelProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LineChannelProperties class. + /// + /// The list of line channel + /// registrations + /// Callback Url to enter in line + /// registration. + /// Whether this channel is validated for the + /// bot + public LineChannelProperties(IList lineRegistrations, string callbackUrl = default(string), bool? isValidated = default(bool?)) + { + LineRegistrations = lineRegistrations; + CallbackUrl = callbackUrl; + IsValidated = isValidated; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the list of line channel registrations + /// + [JsonProperty(PropertyName = "lineRegistrations")] + public IList LineRegistrations { get; set; } + + /// + /// Gets callback Url to enter in line registration. + /// + [JsonProperty(PropertyName = "callbackUrl")] + public string CallbackUrl { get; private set; } + + /// + /// Gets whether this channel is validated for the bot + /// + [JsonProperty(PropertyName = "isValidated")] + public bool? IsValidated { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (LineRegistrations == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "LineRegistrations"); + } + } + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/LineRegistration.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/LineRegistration.cs new file mode 100644 index 0000000000000..bbae69383e0a8 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/LineRegistration.cs @@ -0,0 +1,70 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The properties corresponding to a line channel registration + /// + public partial class LineRegistration + { + /// + /// Initializes a new instance of the LineRegistration class. + /// + public LineRegistration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LineRegistration class. + /// + /// Id generated for the line channel + /// registration + /// Secret for the line channel + /// registration + /// Access token for the line channel + /// registration + public LineRegistration(string generatedId = default(string), string channelSecret = default(string), string channelAccessToken = default(string)) + { + GeneratedId = generatedId; + ChannelSecret = channelSecret; + ChannelAccessToken = channelAccessToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets id generated for the line channel registration + /// + [JsonProperty(PropertyName = "generatedId")] + public string GeneratedId { get; private set; } + + /// + /// Gets or sets secret for the line channel registration + /// + [JsonProperty(PropertyName = "channelSecret")] + public string ChannelSecret { get; set; } + + /// + /// Gets or sets access token for the line channel registration + /// + [JsonProperty(PropertyName = "channelAccessToken")] + public string ChannelAccessToken { get; set; } + + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ListChannelWithKeysResponse.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ListChannelWithKeysResponse.cs new file mode 100644 index 0000000000000..57181646132a0 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ListChannelWithKeysResponse.cs @@ -0,0 +1,115 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The ARM channel of list channel with keys operation response. + /// + public partial class ListChannelWithKeysResponse : BotChannel + { + /// + /// Initializes a new instance of the ListChannelWithKeysResponse + /// class. + /// + public ListChannelWithKeysResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ListChannelWithKeysResponse + /// class. + /// + /// Specifies the resource ID. + /// Specifies the name of the resource. + /// Specifies the location of the + /// resource. + /// Specifies the type of the resource. + /// Contains resource tags defined as key/value + /// pairs. + /// Gets or sets the SKU of the resource. + /// Required. Gets or sets the Kind of the resource. + /// Possible values include: 'sdk', 'designer', 'bot', 'function', + /// 'azurebot' + /// Entity Tag + /// Entity zones + /// The set of properties specific to bot + /// channel resource + /// The set of properties specific to bot + /// channel resource + /// Channel settings + /// Provisioning state of the + /// resource + /// Entity tag of the resource + /// Changed time of the resource + public ListChannelWithKeysResponse(string id = default(string), string name = default(string), string location = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), string kind = default(string), string etag = default(string), IList zones = default(IList), Channel properties = default(Channel), Channel resource = default(Channel), ChannelSettings setting = default(ChannelSettings), string provisioningState = default(string), string entityTag = default(string), string changedTime = default(string)) + : base(id, name, location, type, tags, sku, kind, etag, zones, properties) + { + Resource = resource; + Setting = setting; + ProvisioningState = provisioningState; + EntityTag = entityTag; + ChangedTime = changedTime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the set of properties specific to bot channel resource + /// + [JsonProperty(PropertyName = "resource")] + public Channel Resource { get; set; } + + /// + /// Gets or sets channel settings + /// + [JsonProperty(PropertyName = "setting")] + public ChannelSettings Setting { get; set; } + + /// + /// Gets or sets provisioning state of the resource + /// + [JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState { get; set; } + + /// + /// Gets or sets entity tag of the resource + /// + [JsonProperty(PropertyName = "entityTag")] + public string EntityTag { get; set; } + + /// + /// Gets or sets changed time of the resource + /// + [JsonProperty(PropertyName = "changedTime")] + public string ChangedTime { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/MsTeamsChannel.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/MsTeamsChannel.cs index e97484efc59da..f0ac198b58d70 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/MsTeamsChannel.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/MsTeamsChannel.cs @@ -29,9 +29,15 @@ public MsTeamsChannel() /// /// Initializes a new instance of the MsTeamsChannel class. /// + /// Entity Tag of the resource + /// Provisioning state of the + /// resource + /// Specifies the location of the + /// resource. /// The set of properties specific to /// Microsoft Teams channel resource - public MsTeamsChannel(MsTeamsChannelProperties properties = default(MsTeamsChannelProperties)) + public MsTeamsChannel(string etag = default(string), string provisioningState = default(string), string location = default(string), MsTeamsChannelProperties properties = default(MsTeamsChannelProperties)) + : base(etag, provisioningState, location) { Properties = properties; CustomInit(); diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/MsTeamsChannelProperties.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/MsTeamsChannelProperties.cs index b7ffff1a65564..af0d91006e846 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/MsTeamsChannelProperties.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/MsTeamsChannelProperties.cs @@ -31,24 +31,24 @@ public MsTeamsChannelProperties() /// /// Whether this channel is enabled for the /// bot - /// Enable messaging for Microsoft Teams - /// channel - /// Enable media cards for Microsoft - /// Teams channel - /// Enable video for Microsoft Teams - /// channel /// Enable calling for Microsoft Teams /// channel - /// Enable messaging for Microsoft Teams - /// channel - public MsTeamsChannelProperties(bool isEnabled, bool? enableMessaging = default(bool?), bool? enableMediaCards = default(bool?), bool? enableVideo = default(bool?), bool? enableCalling = default(bool?), string callMode = default(string)) + /// Webhook for Microsoft Teams channel + /// calls + /// Webhook for Microsoft Teams channel + /// calls + /// Deployment environment for + /// Microsoft Teams channel calls + /// Whether this channel accepted + /// terms + public MsTeamsChannelProperties(bool isEnabled, bool? enableCalling = default(bool?), string callingWebHook = default(string), string incomingCallRoute = default(string), string deploymentEnvironment = default(string), bool? acceptedTerms = default(bool?)) { - EnableMessaging = enableMessaging; - EnableMediaCards = enableMediaCards; - EnableVideo = enableVideo; EnableCalling = enableCalling; - CallMode = callMode; + CallingWebHook = callingWebHook; IsEnabled = isEnabled; + IncomingCallRoute = incomingCallRoute; + DeploymentEnvironment = deploymentEnvironment; + AcceptedTerms = acceptedTerms; CustomInit(); } @@ -58,40 +58,41 @@ public MsTeamsChannelProperties() partial void CustomInit(); /// - /// Gets or sets enable messaging for Microsoft Teams channel + /// Gets or sets enable calling for Microsoft Teams channel /// - [JsonProperty(PropertyName = "enableMessaging")] - public bool? EnableMessaging { get; set; } + [JsonProperty(PropertyName = "enableCalling")] + public bool? EnableCalling { get; set; } /// - /// Gets or sets enable media cards for Microsoft Teams channel + /// Gets or sets webhook for Microsoft Teams channel calls /// - [JsonProperty(PropertyName = "enableMediaCards")] - public bool? EnableMediaCards { get; set; } + [JsonProperty(PropertyName = "callingWebHook")] + public string CallingWebHook { get; set; } /// - /// Gets or sets enable video for Microsoft Teams channel + /// Gets or sets whether this channel is enabled for the bot /// - [JsonProperty(PropertyName = "enableVideo")] - public bool? EnableVideo { get; set; } + [JsonProperty(PropertyName = "isEnabled")] + public bool IsEnabled { get; set; } /// - /// Gets or sets enable calling for Microsoft Teams channel + /// Gets or sets webhook for Microsoft Teams channel calls /// - [JsonProperty(PropertyName = "enableCalling")] - public bool? EnableCalling { get; set; } + [JsonProperty(PropertyName = "incomingCallRoute")] + public string IncomingCallRoute { get; set; } /// - /// Gets or sets enable messaging for Microsoft Teams channel + /// Gets or sets deployment environment for Microsoft Teams channel + /// calls /// - [JsonProperty(PropertyName = "callMode")] - public string CallMode { get; set; } + [JsonProperty(PropertyName = "deploymentEnvironment")] + public string DeploymentEnvironment { get; set; } /// - /// Gets or sets whether this channel is enabled for the bot + /// Gets or sets whether this channel accepted terms /// - [JsonProperty(PropertyName = "isEnabled")] - public bool IsEnabled { get; set; } + [JsonProperty(PropertyName = "acceptedTerms")] + public bool? AcceptedTerms { get; set; } /// /// Validate the object. diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/MsaAppType.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/MsaAppType.cs new file mode 100644 index 0000000000000..042bfaa056a0a --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/MsaAppType.cs @@ -0,0 +1,23 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + + /// + /// Defines values for MsaAppType. + /// + public static class MsaAppType + { + public const string UserAssignedMSI = "UserAssignedMSI"; + public const string SingleTenant = "SingleTenant"; + public const string MultiTenant = "MultiTenant"; + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/OperationResultStatus.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/OperationResultStatus.cs new file mode 100644 index 0000000000000..464d13ea92563 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/OperationResultStatus.cs @@ -0,0 +1,25 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + + /// + /// Defines values for OperationResultStatus. + /// + public static class OperationResultStatus + { + public const string Canceled = "Canceled"; + public const string Succeeded = "Succeeded"; + public const string Failed = "Failed"; + public const string Requested = "Requested"; + public const string Running = "Running"; + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/OperationResultsDescription.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/OperationResultsDescription.cs new file mode 100644 index 0000000000000..0d8c6eb7e5aa8 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/OperationResultsDescription.cs @@ -0,0 +1,82 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The properties indicating the operation result of an operation on a + /// service. + /// + public partial class OperationResultsDescription + { + /// + /// Initializes a new instance of the OperationResultsDescription + /// class. + /// + public OperationResultsDescription() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationResultsDescription + /// class. + /// + /// The ID of the operation returned. + /// The name of the operation result. + /// The status of the operation being performed. + /// Possible values include: 'Canceled', 'Succeeded', 'Failed', + /// 'Requested', 'Running' + /// The time that the operation was + /// started. + public OperationResultsDescription(string id = default(string), string name = default(string), string status = default(string), System.DateTime? startTime = default(System.DateTime?)) + { + Id = id; + Name = name; + Status = status; + StartTime = startTime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the ID of the operation returned. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the name of the operation result. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the status of the operation being performed. Possible values + /// include: 'Canceled', 'Succeeded', 'Failed', 'Requested', 'Running' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; private set; } + + /// + /// Gets the time that the operation was started. + /// + [JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime { get; private set; } + + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/Page1.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/Page1.cs new file mode 100644 index 0000000000000..0745ca09c1ddf --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/Page1.cs @@ -0,0 +1,53 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [JsonObject] + public class Page1 : IPage + { + /// + /// Gets the link to the next page. + /// + [JsonProperty("")] + public string NextPageLink { get; private set; } + + [JsonProperty("value")] + private IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public IEnumerator GetEnumerator() + { + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateEndpoint.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateEndpoint.cs new file mode 100644 index 0000000000000..3906f962d7965 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateEndpoint.cs @@ -0,0 +1,51 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The Private Endpoint resource. + /// + public partial class PrivateEndpoint + { + /// + /// Initializes a new instance of the PrivateEndpoint class. + /// + public PrivateEndpoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateEndpoint class. + /// + /// The ARM identifier for Private Endpoint + public PrivateEndpoint(string id = default(string)) + { + Id = id; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the ARM identifier for Private Endpoint + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateEndpointConnection.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateEndpointConnection.cs new file mode 100644 index 0000000000000..362fee99c1edc --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateEndpointConnection.cs @@ -0,0 +1,98 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The Private Endpoint Connection resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class PrivateEndpointConnection : PrivateLinkResourceBase + { + /// + /// Initializes a new instance of the PrivateEndpointConnection class. + /// + public PrivateEndpointConnection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateEndpointConnection class. + /// + /// A collection of + /// information about the state of the connection between service + /// consumer and provider. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// The resource of private end + /// point. + /// The provisioning state of the + /// private endpoint connection resource. Possible values include: + /// 'Succeeded', 'Creating', 'Deleting', 'Failed' + public PrivateEndpointConnection(PrivateLinkServiceConnectionState privateLinkServiceConnectionState, string id = default(string), string name = default(string), string type = default(string), PrivateEndpoint privateEndpoint = default(PrivateEndpoint), string provisioningState = default(string)) + : base(id, name, type) + { + PrivateEndpoint = privateEndpoint; + PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the resource of private end point. + /// + [JsonProperty(PropertyName = "properties.privateEndpoint")] + public PrivateEndpoint PrivateEndpoint { get; set; } + + /// + /// Gets or sets a collection of information about the state of the + /// connection between service consumer and provider. + /// + [JsonProperty(PropertyName = "properties.privateLinkServiceConnectionState")] + public PrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + + /// + /// Gets or sets the provisioning state of the private endpoint + /// connection resource. Possible values include: 'Succeeded', + /// 'Creating', 'Deleting', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (PrivateLinkServiceConnectionState == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "PrivateLinkServiceConnectionState"); + } + } + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateEndpointConnectionProvisioningState.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateEndpointConnectionProvisioningState.cs new file mode 100644 index 0000000000000..003e27a639718 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateEndpointConnectionProvisioningState.cs @@ -0,0 +1,24 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + + /// + /// Defines values for PrivateEndpointConnectionProvisioningState. + /// + public static class PrivateEndpointConnectionProvisioningState + { + public const string Succeeded = "Succeeded"; + public const string Creating = "Creating"; + public const string Deleting = "Deleting"; + public const string Failed = "Failed"; + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateEndpointServiceConnectionStatus.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateEndpointServiceConnectionStatus.cs new file mode 100644 index 0000000000000..714ba79b7be60 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateEndpointServiceConnectionStatus.cs @@ -0,0 +1,23 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + + /// + /// Defines values for PrivateEndpointServiceConnectionStatus. + /// + public static class PrivateEndpointServiceConnectionStatus + { + public const string Pending = "Pending"; + public const string Approved = "Approved"; + public const string Rejected = "Rejected"; + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateLinkResource.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateLinkResource.cs new file mode 100644 index 0000000000000..7ff80578a5944 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateLinkResource.cs @@ -0,0 +1,81 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A private link resource + /// + [Rest.Serialization.JsonTransformation] + public partial class PrivateLinkResource : PrivateLinkResourceBase + { + /// + /// Initializes a new instance of the PrivateLinkResource class. + /// + public PrivateLinkResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateLinkResource class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// The private link resource group id. + /// The private link resource required + /// member names. + /// The private link resource Private + /// link DNS zone name. + public PrivateLinkResource(string id = default(string), string name = default(string), string type = default(string), string groupId = default(string), IList requiredMembers = default(IList), IList requiredZoneNames = default(IList)) + : base(id, name, type) + { + GroupId = groupId; + RequiredMembers = requiredMembers; + RequiredZoneNames = requiredZoneNames; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the private link resource group id. + /// + [JsonProperty(PropertyName = "properties.groupId")] + public string GroupId { get; private set; } + + /// + /// Gets the private link resource required member names. + /// + [JsonProperty(PropertyName = "properties.requiredMembers")] + public IList RequiredMembers { get; private set; } + + /// + /// Gets or sets the private link resource Private link DNS zone name. + /// + [JsonProperty(PropertyName = "properties.requiredZoneNames")] + public IList RequiredZoneNames { get; set; } + + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateLinkResourceBase.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateLinkResourceBase.cs new file mode 100644 index 0000000000000..fd23d9c928b40 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateLinkResourceBase.cs @@ -0,0 +1,79 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Private Link Resource Base + /// + /// + /// Common fields that are returned in the response for all BotService + /// Private Link Resources + /// + public partial class PrivateLinkResourceBase : IResource + { + /// + /// Initializes a new instance of the PrivateLinkResourceBase class. + /// + public PrivateLinkResourceBase() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateLinkResourceBase class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + public PrivateLinkResourceBase(string id = default(string), string name = default(string), string type = default(string)) + { + Id = id; + Name = name; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the name of the resource + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateLinkResourceListResult.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateLinkResourceListResult.cs new file mode 100644 index 0000000000000..8c6e324fdb07a --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateLinkResourceListResult.cs @@ -0,0 +1,55 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A list of private link resources + /// + public partial class PrivateLinkResourceListResult + { + /// + /// Initializes a new instance of the PrivateLinkResourceListResult + /// class. + /// + public PrivateLinkResourceListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateLinkResourceListResult + /// class. + /// + /// Array of private link resources + public PrivateLinkResourceListResult(IList value = default(IList)) + { + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets array of private link resources + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateLinkServiceConnectionState.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateLinkServiceConnectionState.cs new file mode 100644 index 0000000000000..74a5e4b23bd50 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PrivateLinkServiceConnectionState.cs @@ -0,0 +1,77 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// A collection of information about the state of the connection between + /// service consumer and provider. + /// + public partial class PrivateLinkServiceConnectionState + { + /// + /// Initializes a new instance of the PrivateLinkServiceConnectionState + /// class. + /// + public PrivateLinkServiceConnectionState() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateLinkServiceConnectionState + /// class. + /// + /// Indicates whether the connection has been + /// Approved/Rejected/Removed by the owner of the service. Possible + /// values include: 'Pending', 'Approved', 'Rejected' + /// The reason for approval/rejection of the + /// connection. + /// A message indicating if changes on + /// the service provider require any updates on the consumer. + public PrivateLinkServiceConnectionState(string status = default(string), string description = default(string), string actionsRequired = default(string)) + { + Status = status; + Description = description; + ActionsRequired = actionsRequired; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets indicates whether the connection has been + /// Approved/Rejected/Removed by the owner of the service. Possible + /// values include: 'Pending', 'Approved', 'Rejected' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets the reason for approval/rejection of the connection. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets a message indicating if changes on the service + /// provider require any updates on the consumer. + /// + [JsonProperty(PropertyName = "actionsRequired")] + public string ActionsRequired { get; set; } + + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PublicNetworkAccess.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PublicNetworkAccess.cs new file mode 100644 index 0000000000000..5e8c4b4542fb1 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/PublicNetworkAccess.cs @@ -0,0 +1,22 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + + /// + /// Defines values for PublicNetworkAccess. + /// + public static class PublicNetworkAccess + { + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/RegenerateKeysChannelName.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/RegenerateKeysChannelName.cs new file mode 100644 index 0000000000000..0fdc17ccaee47 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/RegenerateKeysChannelName.cs @@ -0,0 +1,60 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for RegenerateKeysChannelName. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum RegenerateKeysChannelName + { + [EnumMember(Value = "WebChatChannel")] + WebChatChannel, + [EnumMember(Value = "DirectLineChannel")] + DirectLineChannel + } + internal static class RegenerateKeysChannelNameEnumExtension + { + internal static string ToSerializedValue(this RegenerateKeysChannelName? value) + { + return value == null ? null : ((RegenerateKeysChannelName)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this RegenerateKeysChannelName value) + { + switch( value ) + { + case RegenerateKeysChannelName.WebChatChannel: + return "WebChatChannel"; + case RegenerateKeysChannelName.DirectLineChannel: + return "DirectLineChannel"; + } + return null; + } + + internal static RegenerateKeysChannelName? ParseRegenerateKeysChannelName(this string value) + { + switch( value ) + { + case "WebChatChannel": + return RegenerateKeysChannelName.WebChatChannel; + case "DirectLineChannel": + return RegenerateKeysChannelName.DirectLineChannel; + } + return null; + } + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/Resource.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/Resource.cs index 03c9c85526a80..c9f59ed3ea8a8 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/Resource.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/Resource.cs @@ -42,10 +42,11 @@ public Resource() /// pairs. /// Gets or sets the SKU of the resource. /// Required. Gets or sets the Kind of the resource. - /// Possible values include: 'sdk', 'designer', 'bot', - /// 'function' + /// Possible values include: 'sdk', 'designer', 'bot', 'function', + /// 'azurebot' /// Entity Tag - public Resource(string id = default(string), string name = default(string), string location = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), string kind = default(string), string etag = default(string)) + /// Entity zones + public Resource(string id = default(string), string name = default(string), string location = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), string kind = default(string), string etag = default(string), IList zones = default(IList)) { Id = id; Name = name; @@ -55,6 +56,7 @@ public Resource() Sku = sku; Kind = kind; Etag = etag; + Zones = zones; CustomInit(); } @@ -101,7 +103,8 @@ public Resource() /// /// Gets or sets required. Gets or sets the Kind of the resource. - /// Possible values include: 'sdk', 'designer', 'bot', 'function' + /// Possible values include: 'sdk', 'designer', 'bot', 'function', + /// 'azurebot' /// [JsonProperty(PropertyName = "kind")] public string Kind { get; set; } @@ -112,6 +115,12 @@ public Resource() [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } + /// + /// Gets entity zones + /// + [JsonProperty(PropertyName = "zones")] + public IList Zones { get; private set; } + /// /// Validate the object. /// diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ServiceProvider.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ServiceProvider.cs new file mode 100644 index 0000000000000..e442d60144afe --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ServiceProvider.cs @@ -0,0 +1,52 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Service Provider Definition + /// + public partial class ServiceProvider + { + /// + /// Initializes a new instance of the ServiceProvider class. + /// + public ServiceProvider() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServiceProvider class. + /// + /// The Properties of a Service Provider + /// Object + public ServiceProvider(ServiceProviderProperties properties = default(ServiceProviderProperties)) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Properties of a Service Provider Object + /// + [JsonProperty(PropertyName = "properties")] + public ServiceProviderProperties Properties { get; set; } + + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ServiceProviderParameter.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ServiceProviderParameter.cs new file mode 100644 index 0000000000000..77d7488e648fe --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ServiceProviderParameter.cs @@ -0,0 +1,102 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Extra Parameters specific to each Service Provider + /// + public partial class ServiceProviderParameter + { + /// + /// Initializes a new instance of the ServiceProviderParameter class. + /// + public ServiceProviderParameter() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServiceProviderParameter class. + /// + /// Name of the Service Provider + /// Type of the Service Provider + /// Display Name of the Service + /// Provider + /// Description of the Service + /// Provider + /// Help Url for the Service Provider + /// Default Name for the Service + /// Provider + /// Meta data for the Service Provider + public ServiceProviderParameter(string name = default(string), string type = default(string), string displayName = default(string), string description = default(string), string helpUrl = default(string), string defaultProperty = default(string), ServiceProviderParameterMetadata metadata = default(ServiceProviderParameterMetadata)) + { + Name = name; + Type = type; + DisplayName = displayName; + Description = description; + HelpUrl = helpUrl; + DefaultProperty = defaultProperty; + Metadata = metadata; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets name of the Service Provider + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets type of the Service Provider + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets display Name of the Service Provider + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets description of the Service Provider + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; private set; } + + /// + /// Gets help Url for the Service Provider + /// + [JsonProperty(PropertyName = "helpUrl")] + public string HelpUrl { get; private set; } + + /// + /// Gets default Name for the Service Provider + /// + [JsonProperty(PropertyName = "default")] + public string DefaultProperty { get; private set; } + + /// + /// Gets meta data for the Service Provider + /// + [JsonProperty(PropertyName = "metadata")] + public ServiceProviderParameterMetadata Metadata { get; private set; } + + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ServiceProviderParameterMetadata.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ServiceProviderParameterMetadata.cs new file mode 100644 index 0000000000000..52db45975f0bd --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ServiceProviderParameterMetadata.cs @@ -0,0 +1,54 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Meta data for the Service Provider + /// + public partial class ServiceProviderParameterMetadata + { + /// + /// Initializes a new instance of the ServiceProviderParameterMetadata + /// class. + /// + public ServiceProviderParameterMetadata() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServiceProviderParameterMetadata + /// class. + /// + /// the constraints of the bot meta + /// data. + public ServiceProviderParameterMetadata(ServiceProviderParameterMetadataConstraints constraints = default(ServiceProviderParameterMetadataConstraints)) + { + Constraints = constraints; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the constraints of the bot meta data. + /// + [JsonProperty(PropertyName = "constraints")] + public ServiceProviderParameterMetadataConstraints Constraints { get; set; } + + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ServiceProviderParameterMetadataConstraints.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ServiceProviderParameterMetadataConstraints.cs new file mode 100644 index 0000000000000..49ce703e954d9 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ServiceProviderParameterMetadataConstraints.cs @@ -0,0 +1,54 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// the constraints of the bot meta data. + /// + public partial class ServiceProviderParameterMetadataConstraints + { + /// + /// Initializes a new instance of the + /// ServiceProviderParameterMetadataConstraints class. + /// + public ServiceProviderParameterMetadataConstraints() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ServiceProviderParameterMetadataConstraints class. + /// + /// Whether required the constraints of the bot + /// meta data. + public ServiceProviderParameterMetadataConstraints(bool? required = default(bool?)) + { + Required = required; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets whether required the constraints of the bot meta data. + /// + [JsonProperty(PropertyName = "required")] + public bool? Required { get; set; } + + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ServiceProviderProperties.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ServiceProviderProperties.cs new file mode 100644 index 0000000000000..93092b941bb89 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ServiceProviderProperties.cs @@ -0,0 +1,97 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The Object used to describe a Service Provider supported by Bot Service + /// + public partial class ServiceProviderProperties + { + /// + /// Initializes a new instance of the ServiceProviderProperties class. + /// + public ServiceProviderProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServiceProviderProperties class. + /// + /// Id for Service Provider + /// Display Name of the Service + /// Provider + /// Display Name of the Service + /// Provider + /// Display Name of the Service + /// Provider + /// Display Name of the Service Provider + /// The list of parameters for the Service + /// Provider + public ServiceProviderProperties(string id = default(string), string displayName = default(string), string serviceProviderName = default(string), string devPortalUrl = default(string), string iconUrl = default(string), IList parameters = default(IList)) + { + Id = id; + DisplayName = displayName; + ServiceProviderName = serviceProviderName; + DevPortalUrl = devPortalUrl; + IconUrl = iconUrl; + Parameters = parameters; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets id for Service Provider + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets display Name of the Service Provider + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets display Name of the Service Provider + /// + [JsonProperty(PropertyName = "serviceProviderName")] + public string ServiceProviderName { get; private set; } + + /// + /// Gets display Name of the Service Provider + /// + [JsonProperty(PropertyName = "devPortalUrl")] + public string DevPortalUrl { get; private set; } + + /// + /// Gets display Name of the Service Provider + /// + [JsonProperty(PropertyName = "iconUrl")] + public string IconUrl { get; private set; } + + /// + /// Gets or sets the list of parameters for the Service Provider + /// + [JsonProperty(PropertyName = "parameters")] + public IList Parameters { get; set; } + + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ServiceProviderResponseList.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ServiceProviderResponseList.cs new file mode 100644 index 0000000000000..868a9b90b5302 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/ServiceProviderResponseList.cs @@ -0,0 +1,66 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The list of bot service providers response. + /// + public partial class ServiceProviderResponseList + { + /// + /// Initializes a new instance of the ServiceProviderResponseList + /// class. + /// + public ServiceProviderResponseList() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServiceProviderResponseList + /// class. + /// + /// The link used to get the next page of bot + /// service providers. + /// Gets the list of bot service providers and + /// their properties. + public ServiceProviderResponseList(string nextLink = default(string), IList value = default(IList)) + { + NextLink = nextLink; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the link used to get the next page of bot service + /// providers. + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; set; } + + /// + /// Gets the list of bot service providers and their properties. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; private set; } + + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/Site.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/Site.cs new file mode 100644 index 0000000000000..0951d0456cd0a --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/Site.cs @@ -0,0 +1,181 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A site for the channel + /// + public partial class Site + { + /// + /// Initializes a new instance of the Site class. + /// + public Site() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Site class. + /// + /// Site name + /// Whether this site is enabled for DirectLine + /// channel + /// Whether this site is enabled + /// for preview versions of Webchat + /// Whether this site is enabled for Bot + /// Framework V1 protocol. + /// Whether this site is enabled for Bot + /// Framework V1 protocol. + /// Site Id + /// Primary key. Value only returned through POST to + /// the action Channel List API, otherwise empty. + /// Secondary key. Value only returned through POST + /// to the action Channel List API, otherwise empty. + /// Whether this site is enabled for + /// authentication with Bot Framework. + /// Whether this site is enabled + /// for block user upload. + /// List of Trusted Origin URLs for this + /// site. This field is applicable only if isSecureSiteEnabled is + /// True. + /// Whether this site is token enabled for + /// channel + /// Entity Tag + public Site(string siteName, bool isEnabled, bool isWebchatPreviewEnabled, bool isV1Enabled, bool isV3Enabled, string siteId = default(string), string key = default(string), string key2 = default(string), bool? isSecureSiteEnabled = default(bool?), bool? isBlockUserUploadEnabled = default(bool?), IList trustedOrigins = default(IList), bool? isTokenEnabled = default(bool?), string eTag = default(string)) + { + SiteId = siteId; + SiteName = siteName; + Key = key; + Key2 = key2; + IsEnabled = isEnabled; + IsWebchatPreviewEnabled = isWebchatPreviewEnabled; + IsV1Enabled = isV1Enabled; + IsV3Enabled = isV3Enabled; + IsSecureSiteEnabled = isSecureSiteEnabled; + IsBlockUserUploadEnabled = isBlockUserUploadEnabled; + TrustedOrigins = trustedOrigins; + IsTokenEnabled = isTokenEnabled; + ETag = eTag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets site Id + /// + [JsonProperty(PropertyName = "siteId")] + public string SiteId { get; private set; } + + /// + /// Gets or sets site name + /// + [JsonProperty(PropertyName = "siteName")] + public string SiteName { get; set; } + + /// + /// Gets primary key. Value only returned through POST to the action + /// Channel List API, otherwise empty. + /// + [JsonProperty(PropertyName = "key")] + public string Key { get; private set; } + + /// + /// Gets secondary key. Value only returned through POST to the action + /// Channel List API, otherwise empty. + /// + [JsonProperty(PropertyName = "key2")] + public string Key2 { get; private set; } + + /// + /// Gets or sets whether this site is enabled for DirectLine channel + /// + [JsonProperty(PropertyName = "isEnabled")] + public bool IsEnabled { get; set; } + + /// + /// Gets or sets whether this site is enabled for preview versions of + /// Webchat + /// + [JsonProperty(PropertyName = "isWebchatPreviewEnabled")] + public bool IsWebchatPreviewEnabled { get; set; } + + /// + /// Gets or sets whether this site is enabled for Bot Framework V1 + /// protocol. + /// + [JsonProperty(PropertyName = "isV1Enabled")] + public bool IsV1Enabled { get; set; } + + /// + /// Gets or sets whether this site is enabled for Bot Framework V1 + /// protocol. + /// + [JsonProperty(PropertyName = "isV3Enabled")] + public bool IsV3Enabled { get; set; } + + /// + /// Gets or sets whether this site is enabled for authentication with + /// Bot Framework. + /// + [JsonProperty(PropertyName = "isSecureSiteEnabled")] + public bool? IsSecureSiteEnabled { get; set; } + + /// + /// Gets or sets whether this site is enabled for block user upload. + /// + [JsonProperty(PropertyName = "isBlockUserUploadEnabled")] + public bool? IsBlockUserUploadEnabled { get; set; } + + /// + /// Gets or sets list of Trusted Origin URLs for this site. This field + /// is applicable only if isSecureSiteEnabled is True. + /// + [JsonProperty(PropertyName = "trustedOrigins")] + public IList TrustedOrigins { get; set; } + + /// + /// Gets or sets whether this site is token enabled for channel + /// + [JsonProperty(PropertyName = "isTokenEnabled")] + public bool? IsTokenEnabled { get; set; } + + /// + /// Gets or sets entity Tag + /// + [JsonProperty(PropertyName = "eTag")] + public string ETag { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (SiteName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "SiteName"); + } + } + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/SiteInfo.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/SiteInfo.cs new file mode 100644 index 0000000000000..e4a2e5920fab7 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/SiteInfo.cs @@ -0,0 +1,76 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Site information for WebChat or DirectLine Channels to identify which + /// site to regenerate keys for. + /// + public partial class SiteInfo + { + /// + /// Initializes a new instance of the SiteInfo class. + /// + public SiteInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SiteInfo class. + /// + /// The site name + /// Determines which key is to be regenerated. + /// Possible values include: 'key1', 'key2' + public SiteInfo(string siteName, Key key) + { + SiteName = siteName; + Key = key; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the site name + /// + [JsonProperty(PropertyName = "siteName")] + public string SiteName { get; set; } + + /// + /// Gets or sets determines which key is to be regenerated. Possible + /// values include: 'key1', 'key2' + /// + [JsonProperty(PropertyName = "key")] + public Key Key { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (SiteName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "SiteName"); + } + } + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/SkypeChannel.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/SkypeChannel.cs index f4dd37fa72d2a..2bbf0ae848dc1 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/SkypeChannel.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/SkypeChannel.cs @@ -29,9 +29,15 @@ public SkypeChannel() /// /// Initializes a new instance of the SkypeChannel class. /// + /// Entity Tag of the resource + /// Provisioning state of the + /// resource + /// Specifies the location of the + /// resource. /// The set of properties specific to Skype /// channel resource - public SkypeChannel(SkypeChannelProperties properties = default(SkypeChannelProperties)) + public SkypeChannel(string etag = default(string), string provisioningState = default(string), string location = default(string), SkypeChannelProperties properties = default(SkypeChannelProperties)) + : base(etag, provisioningState, location) { Properties = properties; CustomInit(); diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/SkypeChannelProperties.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/SkypeChannelProperties.cs index d67437aee605e..397c07763c8fe 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/SkypeChannelProperties.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/SkypeChannelProperties.cs @@ -44,7 +44,9 @@ public SkypeChannelProperties() /// Group mode for Skype channel /// Calling web hook for Skype /// channel - public SkypeChannelProperties(bool isEnabled, bool? enableMessaging = default(bool?), bool? enableMediaCards = default(bool?), bool? enableVideo = default(bool?), bool? enableCalling = default(bool?), bool? enableScreenSharing = default(bool?), bool? enableGroups = default(bool?), string groupsMode = default(string), string callingWebHook = default(string)) + /// Incoming call route for Skype + /// channel + public SkypeChannelProperties(bool isEnabled, bool? enableMessaging = default(bool?), bool? enableMediaCards = default(bool?), bool? enableVideo = default(bool?), bool? enableCalling = default(bool?), bool? enableScreenSharing = default(bool?), bool? enableGroups = default(bool?), string groupsMode = default(string), string callingWebHook = default(string), string incomingCallRoute = default(string)) { EnableMessaging = enableMessaging; EnableMediaCards = enableMediaCards; @@ -54,6 +56,7 @@ public SkypeChannelProperties() EnableGroups = enableGroups; GroupsMode = groupsMode; CallingWebHook = callingWebHook; + IncomingCallRoute = incomingCallRoute; IsEnabled = isEnabled; CustomInit(); } @@ -111,6 +114,12 @@ public SkypeChannelProperties() [JsonProperty(PropertyName = "callingWebHook")] public string CallingWebHook { get; set; } + /// + /// Gets or sets incoming call route for Skype channel + /// + [JsonProperty(PropertyName = "incomingCallRoute")] + public string IncomingCallRoute { get; set; } + /// /// Gets or sets whether this channel is enabled for the bot /// diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/SlackChannel.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/SlackChannel.cs index 73caf9378bbcf..9e61cfde08535 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/SlackChannel.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/SlackChannel.cs @@ -29,9 +29,15 @@ public SlackChannel() /// /// Initializes a new instance of the SlackChannel class. /// + /// Entity Tag of the resource + /// Provisioning state of the + /// resource + /// Specifies the location of the + /// resource. /// The set of properties specific to Slack /// channel resource - public SlackChannel(SlackChannelProperties properties = default(SlackChannelProperties)) + public SlackChannel(string etag = default(string), string provisioningState = default(string), string location = default(string), SlackChannelProperties properties = default(SlackChannelProperties)) + : base(etag, provisioningState, location) { Properties = properties; CustomInit(); diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/SlackChannelProperties.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/SlackChannelProperties.cs index 701731e494016..058c508fd2831 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/SlackChannelProperties.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/SlackChannelProperties.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.BotService.Models { - using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -30,6 +29,8 @@ public SlackChannelProperties() /// /// Initializes a new instance of the SlackChannelProperties class. /// + /// Whether this channel is enabled for the + /// bot /// The Slack client id /// The Slack client secret. Value only /// returned through POST to the action Channel List API, otherwise @@ -37,8 +38,7 @@ public SlackChannelProperties() /// The Slack verification token. Value /// only returned through POST to the action Channel List API, /// otherwise empty. - /// Whether this channel is enabled for the - /// bot + /// The Slack permission scopes. /// The Slack landing page Url /// The Slack redirect action /// The Sms auth token @@ -47,16 +47,19 @@ public SlackChannelProperties() /// True. /// Whether this channel is validated for the /// bot - public SlackChannelProperties(string clientId, string clientSecret, string verificationToken, bool isEnabled, string landingPageUrl = default(string), string redirectAction = default(string), string lastSubmissionId = default(string), bool? registerBeforeOAuthFlow = default(bool?), bool? isValidated = default(bool?)) + /// The Slack signing secret. + public SlackChannelProperties(bool isEnabled, string clientId = default(string), string clientSecret = default(string), string verificationToken = default(string), string scopes = default(string), string landingPageUrl = default(string), string redirectAction = default(string), string lastSubmissionId = default(string), bool? registerBeforeOAuthFlow = default(bool?), bool? isValidated = default(bool?), string signingSecret = default(string)) { ClientId = clientId; ClientSecret = clientSecret; VerificationToken = verificationToken; + Scopes = scopes; LandingPageUrl = landingPageUrl; RedirectAction = redirectAction; LastSubmissionId = lastSubmissionId; RegisterBeforeOAuthFlow = registerBeforeOAuthFlow; IsValidated = isValidated; + SigningSecret = signingSecret; IsEnabled = isEnabled; CustomInit(); } @@ -86,6 +89,12 @@ public SlackChannelProperties() [JsonProperty(PropertyName = "verificationToken")] public string VerificationToken { get; set; } + /// + /// Gets or sets the Slack permission scopes. + /// + [JsonProperty(PropertyName = "scopes")] + public string Scopes { get; set; } + /// /// Gets or sets the Slack landing page Url /// @@ -114,9 +123,15 @@ public SlackChannelProperties() /// /// Gets whether this channel is validated for the bot /// - [JsonProperty(PropertyName = "isValidated")] + [JsonProperty(PropertyName = "IsValidated")] public bool? IsValidated { get; private set; } + /// + /// Gets or sets the Slack signing secret. + /// + [JsonProperty(PropertyName = "signingSecret")] + public string SigningSecret { get; set; } + /// /// Gets or sets whether this channel is enabled for the bot /// @@ -126,23 +141,12 @@ public SlackChannelProperties() /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (ClientId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ClientId"); - } - if (ClientSecret == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ClientSecret"); - } - if (VerificationToken == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "VerificationToken"); - } + //Nothing to validate } } } diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/SmsChannel.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/SmsChannel.cs index f50a293ba9750..b004146b53094 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/SmsChannel.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/SmsChannel.cs @@ -29,9 +29,15 @@ public SmsChannel() /// /// Initializes a new instance of the SmsChannel class. /// + /// Entity Tag of the resource + /// Provisioning state of the + /// resource + /// Specifies the location of the + /// resource. /// The set of properties specific to Sms /// channel resource - public SmsChannel(SmsChannelProperties properties = default(SmsChannelProperties)) + public SmsChannel(string etag = default(string), string provisioningState = default(string), string location = default(string), SmsChannelProperties properties = default(SmsChannelProperties)) + : base(etag, provisioningState, location) { Properties = properties; CustomInit(); diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/SmsChannelProperties.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/SmsChannelProperties.cs index 3787bf2037aa8..0b55ae1110919 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/SmsChannelProperties.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/SmsChannelProperties.cs @@ -34,14 +34,14 @@ public SmsChannelProperties() /// The Sms account SID. Value only returned /// through POST to the action Channel List API, otherwise /// empty. + /// Whether this channel is enabled for the + /// bot /// The Sms auth token. Value only returned /// through POST to the action Channel List API, otherwise /// empty. - /// Whether this channel is enabled for the - /// bot /// Whether this channel is validated for the /// bot - public SmsChannelProperties(string phone, string accountSID, string authToken, bool isEnabled, bool? isValidated = default(bool?)) + public SmsChannelProperties(string phone, string accountSID, bool isEnabled, string authToken = default(string), bool? isValidated = default(bool?)) { Phone = phone; AccountSID = accountSID; @@ -104,10 +104,6 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "AccountSID"); } - if (AuthToken == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AuthToken"); - } } } } diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/TelegramChannel.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/TelegramChannel.cs index f2d6fc97976f7..f665e6d47c70c 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/TelegramChannel.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/TelegramChannel.cs @@ -29,9 +29,15 @@ public TelegramChannel() /// /// Initializes a new instance of the TelegramChannel class. /// + /// Entity Tag of the resource + /// Provisioning state of the + /// resource + /// Specifies the location of the + /// resource. /// The set of properties specific to Telegram /// channel resource - public TelegramChannel(TelegramChannelProperties properties = default(TelegramChannelProperties)) + public TelegramChannel(string etag = default(string), string provisioningState = default(string), string location = default(string), TelegramChannelProperties properties = default(TelegramChannelProperties)) + : base(etag, provisioningState, location) { Properties = properties; CustomInit(); diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/TelegramChannelProperties.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/TelegramChannelProperties.cs index 5d7c4e9788e3b..af76bc981f071 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/TelegramChannelProperties.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/TelegramChannelProperties.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.BotService.Models { - using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -30,14 +29,14 @@ public TelegramChannelProperties() /// /// Initializes a new instance of the TelegramChannelProperties class. /// + /// Whether this channel is enabled for the + /// bot /// The Telegram access token. Value only /// returned through POST to the action Channel List API, otherwise /// empty. - /// Whether this channel is enabled for the - /// bot /// Whether this channel is validated for the /// bot - public TelegramChannelProperties(string accessToken, bool isEnabled, bool? isValidated = default(bool?)) + public TelegramChannelProperties(bool isEnabled, string accessToken = default(string), bool? isValidated = default(bool?)) { AccessToken = accessToken; IsValidated = isValidated; @@ -72,15 +71,12 @@ public TelegramChannelProperties() /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (AccessToken == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AccessToken"); - } + //Nothing to validate } } } diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/WebChatChannel.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/WebChatChannel.cs index 792d38283513d..c67f01016fb43 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/WebChatChannel.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/WebChatChannel.cs @@ -29,9 +29,15 @@ public WebChatChannel() /// /// Initializes a new instance of the WebChatChannel class. /// + /// Entity Tag of the resource + /// Provisioning state of the + /// resource + /// Specifies the location of the + /// resource. /// The set of properties specific to Web Chat /// channel resource - public WebChatChannel(WebChatChannelProperties properties = default(WebChatChannelProperties)) + public WebChatChannel(string etag = default(string), string provisioningState = default(string), string location = default(string), WebChatChannelProperties properties = default(WebChatChannelProperties)) + : base(etag, provisioningState, location) { Properties = properties; CustomInit(); diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/WebChatSite.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/WebChatSite.cs index 0a33fa7420486..39a0451a3e61c 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/WebChatSite.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Models/WebChatSite.cs @@ -33,21 +33,21 @@ public WebChatSite() /// Site name /// Whether this site is enabled for DirectLine /// channel - /// Whether this site is enabled for - /// preview versions of Webchat + /// Whether this site is enabled + /// for preview versions of Webchat /// Site Id /// Primary key. Value only returned through POST to /// the action Channel List API, otherwise empty. /// Secondary key. Value only returned through POST /// to the action Channel List API, otherwise empty. - public WebChatSite(string siteName, bool isEnabled, bool enablePreview, string siteId = default(string), string key = default(string), string key2 = default(string)) + public WebChatSite(string siteName, bool isEnabled, bool isWebchatPreviewEnabled, string siteId = default(string), string key = default(string), string key2 = default(string)) { SiteId = siteId; SiteName = siteName; Key = key; Key2 = key2; IsEnabled = isEnabled; - EnablePreview = enablePreview; + IsWebchatPreviewEnabled = isWebchatPreviewEnabled; CustomInit(); } @@ -92,8 +92,8 @@ public WebChatSite() /// Gets or sets whether this site is enabled for preview versions of /// Webchat /// - [JsonProperty(PropertyName = "enablePreview")] - public bool EnablePreview { get; set; } + [JsonProperty(PropertyName = "isWebchatPreviewEnabled")] + public bool IsWebchatPreviewEnabled { get; set; } /// /// Validate the object. diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/OperationResultsOperations.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/OperationResultsOperations.cs new file mode 100644 index 0000000000000..690827f539bb3 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/OperationResultsOperations.cs @@ -0,0 +1,237 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// OperationResultsOperations operations. + /// + internal partial class OperationResultsOperations : IServiceOperations, IOperationResultsOperations + { + /// + /// Initializes a new instance of the OperationResultsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal OperationResultsOperations(AzureBotServiceClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureBotServiceClient + /// + public AzureBotServiceClient Client { get; private set; } + + + /// + /// Get the operation result for a long running operation. + /// + /// + /// The ID of the operation result to get. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginGetWithHttpMessagesAsync(string operationResultId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (operationResultId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationResultId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("operationResultId", operationResultId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginGet", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.BotService/operationresults/{operationResultId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{operationResultId}", System.Uri.EscapeDataString(operationResultId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/OperationResultsOperationsExtensions.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/OperationResultsOperationsExtensions.cs new file mode 100644 index 0000000000000..0bd43643a92b2 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/OperationResultsOperationsExtensions.cs @@ -0,0 +1,93 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for OperationResultsOperations. + /// + public static partial class OperationResultsOperationsExtensions + { + /// + /// Get the operation result for a long running operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID of the operation result to get. + /// + public static OperationResultsDescription Get(this IOperationResultsOperations operations, string operationResultId) + { + return operations.GetAsync(operationResultId).GetAwaiter().GetResult(); + } + + /// + /// Get the operation result for a long running operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID of the operation result to get. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IOperationResultsOperations operations, string operationResultId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(operationResultId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get the operation result for a long running operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID of the operation result to get. + /// + public static OperationResultsDescription BeginGet(this IOperationResultsOperations operations, string operationResultId) + { + return operations.BeginGetAsync(operationResultId).GetAwaiter().GetResult(); + } + + /// + /// Get the operation result for a long running operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID of the operation result to get. + /// + /// + /// The cancellation token. + /// + public static async Task BeginGetAsync(this IOperationResultsOperations operations, string operationResultId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginGetWithHttpMessagesAsync(operationResultId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Operations.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Operations.cs index b3c15f769aac3..1b4a711b8edfe 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Operations.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/Operations.cs @@ -59,7 +59,7 @@ internal Operations(AzureBotServiceClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -158,14 +158,13 @@ internal Operations(AzureBotServiceClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -175,10 +174,6 @@ internal Operations(AzureBotServiceClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -235,7 +230,7 @@ internal Operations(AzureBotServiceClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -331,14 +326,13 @@ internal Operations(AzureBotServiceClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -348,10 +342,6 @@ internal Operations(AzureBotServiceClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/PrivateEndpointConnectionsOperations.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/PrivateEndpointConnectionsOperations.cs new file mode 100644 index 0000000000000..cbb34cb051cd0 --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/PrivateEndpointConnectionsOperations.cs @@ -0,0 +1,966 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PrivateEndpointConnectionsOperations operations. + /// + internal partial class PrivateEndpointConnectionsOperations : IServiceOperations, IPrivateEndpointConnectionsOperations + { + /// + /// Initializes a new instance of the PrivateEndpointConnectionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal PrivateEndpointConnectionsOperations(AzureBotServiceClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureBotServiceClient + /// + public AzureBotServiceClient Client { get; private set; } + + /// + /// List all the private endpoint connections associated with the Bot. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 64); + } + if (resourceGroupName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (resourceName != null) + { + if (resourceName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceName", 64); + } + if (resourceName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the specified private endpoint connection associated with the Bot. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the private endpoint connection associated with the Azure + /// resource + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string resourceName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 64); + } + if (resourceGroupName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (resourceName != null) + { + if (resourceName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceName", 64); + } + if (resourceName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Update the state of specified private endpoint connection associated with + /// the Bot. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the private endpoint connection associated with the Azure + /// resource + /// + /// + /// The private endpoint connection properties. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string resourceName, string privateEndpointConnectionName, PrivateEndpointConnection properties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 64); + } + if (resourceGroupName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (resourceName != null) + { + if (resourceName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceName", 64); + } + if (resourceName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + if (properties == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "properties"); + } + if (properties != null) + { + properties.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("properties", properties); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(properties != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(properties, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes the specified private endpoint connection associated with the Bot. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the private endpoint connection associated with the Azure + /// resource + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 64); + } + if (resourceGroupName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (resourceName != null) + { + if (resourceName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceName", 64); + } + if (resourceName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs new file mode 100644 index 0000000000000..952ca937b25ea --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs @@ -0,0 +1,216 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for PrivateEndpointConnectionsOperations. + /// + public static partial class PrivateEndpointConnectionsOperationsExtensions + { + /// + /// List all the private endpoint connections associated with the Bot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + public static IEnumerable List(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string resourceName) + { + return operations.ListAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// List all the private endpoint connections associated with the Bot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the specified private endpoint connection associated with the Bot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the private endpoint connection associated with the Azure + /// resource + /// + public static PrivateEndpointConnection Get(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string resourceName, string privateEndpointConnectionName) + { + return operations.GetAsync(resourceGroupName, resourceName, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Gets the specified private endpoint connection associated with the Bot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the private endpoint connection associated with the Azure + /// resource + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string resourceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, resourceName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update the state of specified private endpoint connection associated with + /// the Bot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the private endpoint connection associated with the Azure + /// resource + /// + /// + /// The private endpoint connection properties. + /// + public static PrivateEndpointConnection Create(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string resourceName, string privateEndpointConnectionName, PrivateEndpointConnection properties) + { + return operations.CreateAsync(resourceGroupName, resourceName, privateEndpointConnectionName, properties).GetAwaiter().GetResult(); + } + + /// + /// Update the state of specified private endpoint connection associated with + /// the Bot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the private endpoint connection associated with the Azure + /// resource + /// + /// + /// The private endpoint connection properties. + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string resourceName, string privateEndpointConnectionName, PrivateEndpointConnection properties, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, resourceName, privateEndpointConnectionName, properties, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the specified private endpoint connection associated with the Bot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the private endpoint connection associated with the Azure + /// resource + /// + public static void Delete(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string resourceName, string privateEndpointConnectionName) + { + operations.DeleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified private endpoint connection associated with the Bot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The name of the private endpoint connection associated with the Azure + /// resource + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string resourceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, resourceName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/PrivateLinkResourcesOperations.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/PrivateLinkResourcesOperations.cs new file mode 100644 index 0000000000000..8aa983918d85a --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/PrivateLinkResourcesOperations.cs @@ -0,0 +1,275 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PrivateLinkResourcesOperations operations. + /// + internal partial class PrivateLinkResourcesOperations : IServiceOperations, IPrivateLinkResourcesOperations + { + /// + /// Initializes a new instance of the PrivateLinkResourcesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal PrivateLinkResourcesOperations(AzureBotServiceClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureBotServiceClient + /// + public AzureBotServiceClient Client { get; private set; } + + /// + /// Gets the private link resources that need to be created for a Bot. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListByBotResourceWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 64); + } + if (resourceGroupName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (resourceName != null) + { + if (resourceName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceName", 64); + } + if (resourceName.Length < 2) + { + throw new ValidationException(ValidationRules.MinLength, "resourceName", 2); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByBotResource", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateLinkResources").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/PrivateLinkResourcesOperationsExtensions.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/PrivateLinkResourcesOperationsExtensions.cs new file mode 100644 index 0000000000000..c240d4e3e0afa --- /dev/null +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/PrivateLinkResourcesOperationsExtensions.cs @@ -0,0 +1,65 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.BotService +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for PrivateLinkResourcesOperations. + /// + public static partial class PrivateLinkResourcesOperationsExtensions + { + /// + /// Gets the private link resources that need to be created for a Bot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + public static PrivateLinkResourceListResult ListByBotResource(this IPrivateLinkResourcesOperations operations, string resourceGroupName, string resourceName) + { + return operations.ListByBotResourceAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Gets the private link resources that need to be created for a Bot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Bot resource group in the user subscription. + /// + /// + /// The name of the Bot resource. + /// + /// + /// The cancellation token. + /// + public static async Task ListByBotResourceAsync(this IPrivateLinkResourcesOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByBotResourceWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/SdkInfo_AzureBotService.cs b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/SdkInfo_AzureBotService.cs index 7cea5b1f8c6ea..9392d860a7bed 100644 --- a/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/SdkInfo_AzureBotService.cs +++ b/sdk/botservice/Microsoft.Azure.Management.BotService/src/Generated/SdkInfo_AzureBotService.cs @@ -1,20 +1,35 @@ -using System; -using System.Collections.Generic; -using System.Linq; +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// -internal static partial class SdkInfo +namespace Microsoft.Azure.Management.BotService { - public static IEnumerable> ApiInfo_AzureBotService - { - get - { - return new Tuple[] - { - new Tuple("BotService", "Bots", "2017-12-01"), - new Tuple("BotService", "Channels", "2017-12-01"), - new Tuple("BotService", "Operations", "2017-12-01"), - }.AsEnumerable(); - } - } + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_AzureBotService + { + get + { + return new Tuple[] + { + new Tuple("BotService", "BotConnection", "2021-05-01-preview"), + new Tuple("BotService", "Bots", "2021-05-01-preview"), + new Tuple("BotService", "Channels", "2021-05-01-preview"), + new Tuple("BotService", "DirectLine", "2021-05-01-preview"), + new Tuple("BotService", "HostSettings", "2021-05-01-preview"), + new Tuple("BotService", "OperationResults", "2021-05-01-preview"), + new Tuple("BotService", "Operations", "2021-05-01-preview"), + new Tuple("BotService", "PrivateEndpointConnections", "2021-05-01-preview"), + new Tuple("BotService", "PrivateLinkResources", "2021-05-01-preview"), + }.AsEnumerable(); + } + } + } }