From 8cce255fe9dba22b93cbdefb2312203c2d7c87bd Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Thu, 17 Oct 2019 15:22:40 +0000 Subject: [PATCH] Generated from 7a341e37a79769dd5da5e242a2a6856b8cb8a44b fix samples --- .../src/Generated/AccountsOperations.cs | 55 +-- .../Generated/AccountsOperationsExtensions.cs | 50 +- .../CheckSkuAvailabilityOperations.cs | 276 ----------- ...heckSkuAvailabilityOperationsExtensions.cs | 79 ---- .../CognitiveServicesManagementClient.cs | 437 +++++++++++++++++- ...itiveServicesManagementClientExtensions.cs | 119 +++++ .../src/Generated/IAccountsOperations.cs | 21 +- .../ICheckSkuAvailabilityOperations.cs | 58 --- .../ICognitiveServicesManagementClient.cs | 43 +- .../CheckDomainAvailabilityParameter.cs | 79 ++++ .../Models/CheckDomainAvailabilityResult.cs | 78 ++++ .../Models/CognitiveServicesAccount.cs | 68 +-- .../CognitiveServicesAccountApiProperties.cs | 116 +++++ ...ognitiveServicesAccountCreateParameters.cs | 139 ------ .../CognitiveServicesAccountProperties.cs | 116 +++++ ...ognitiveServicesAccountUpdateParameters.cs | 95 ---- .../Generated/Models/{IPRule.cs => IpRule.cs} | 0 .../Models/NetworkRuleBypassOptions.cs | 22 - .../src/Generated/Models/NetworkRuleSet.cs | 15 +- ...kInfo_CognitiveServicesManagementClient.cs | 12 +- 20 files changed, 1033 insertions(+), 845 deletions(-) delete mode 100644 sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/CheckSkuAvailabilityOperations.cs delete mode 100644 sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/CheckSkuAvailabilityOperationsExtensions.cs create mode 100644 sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/CognitiveServicesManagementClientExtensions.cs delete mode 100644 sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/ICheckSkuAvailabilityOperations.cs create mode 100644 sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/CheckDomainAvailabilityParameter.cs create mode 100644 sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/CheckDomainAvailabilityResult.cs create mode 100644 sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/CognitiveServicesAccountApiProperties.cs delete mode 100644 sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/CognitiveServicesAccountCreateParameters.cs create mode 100644 sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/CognitiveServicesAccountProperties.cs delete mode 100644 sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/CognitiveServicesAccountUpdateParameters.cs rename sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/{IPRule.cs => IpRule.cs} (100%) delete mode 100644 sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/NetworkRuleBypassOptions.cs diff --git a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/AccountsOperations.cs b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/AccountsOperations.cs index d89f87571d66..72877bc72481 100644 --- a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/AccountsOperations.cs +++ b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/AccountsOperations.cs @@ -61,7 +61,7 @@ internal AccountsOperations(CognitiveServicesManagementClient client) /// /// The name of Cognitive Services account. /// - /// + /// /// The parameters to provide for the created account. /// /// @@ -85,7 +85,7 @@ internal AccountsOperations(CognitiveServicesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, CognitiveServicesAccountCreateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, CognitiveServicesAccount account, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -110,13 +110,13 @@ internal AccountsOperations(CognitiveServicesManagementClient client) throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); } } - if (parameters == null) + if (account == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "account"); } - if (parameters != null) + if (account != null) { - parameters.Validate(); + account.Validate(); } if (Client.ApiVersion == null) { @@ -135,7 +135,7 @@ internal AccountsOperations(CognitiveServicesManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("parameters", parameters); + tracingParameters.Add("account", account); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); } @@ -188,9 +188,9 @@ internal AccountsOperations(CognitiveServicesManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) + if(account != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(account, 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"); } @@ -303,18 +303,8 @@ internal AccountsOperations(CognitiveServicesManagementClient client) /// /// The name of Cognitive Services account. /// - /// - /// Gets or sets the SKU of the resource. - /// - /// - /// Gets or sets a list of key value pairs that describe the resource. These - /// tags can be used in viewing and grouping this resource (across resource - /// groups). A maximum of 15 tags can be provided for a resource. Each tag must - /// have a key no greater than 128 characters and value no greater than 256 - /// characters. - /// - /// - /// Additional properties for Account. Only provided fields will be updated. + /// + /// The parameters to provide for the created account. /// /// /// Headers that will be added to request. @@ -337,7 +327,7 @@ internal AccountsOperations(CognitiveServicesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, Sku sku = default(Sku), IDictionary tags = default(IDictionary), object properties = default(object), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, CognitiveServicesAccount account, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -362,6 +352,10 @@ internal AccountsOperations(CognitiveServicesManagementClient client) throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"); } } + if (account == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "account"); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -370,17 +364,6 @@ internal AccountsOperations(CognitiveServicesManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (sku != null) - { - sku.Validate(); - } - CognitiveServicesAccountUpdateParameters parameters = new CognitiveServicesAccountUpdateParameters(); - if (sku != null || tags != null || properties != null) - { - parameters.Sku = sku; - parameters.Tags = tags; - parameters.Properties = properties; - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -390,7 +373,7 @@ internal AccountsOperations(CognitiveServicesManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("parameters", parameters); + tracingParameters.Add("account", account); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } @@ -443,9 +426,9 @@ internal AccountsOperations(CognitiveServicesManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) + if(account != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(account, 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"); } diff --git a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/AccountsOperationsExtensions.cs b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/AccountsOperationsExtensions.cs index 16d8756da0e3..f80a1853481d 100644 --- a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/AccountsOperationsExtensions.cs +++ b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/AccountsOperationsExtensions.cs @@ -13,8 +13,6 @@ namespace Microsoft.Azure.Management.CognitiveServices using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -37,12 +35,12 @@ public static partial class AccountsOperationsExtensions /// /// The name of Cognitive Services account. /// - /// + /// /// The parameters to provide for the created account. /// - public static CognitiveServicesAccount Create(this IAccountsOperations operations, string resourceGroupName, string accountName, CognitiveServicesAccountCreateParameters parameters) + public static CognitiveServicesAccount Create(this IAccountsOperations operations, string resourceGroupName, string accountName, CognitiveServicesAccount account) { - return operations.CreateAsync(resourceGroupName, accountName, parameters).GetAwaiter().GetResult(); + return operations.CreateAsync(resourceGroupName, accountName, account).GetAwaiter().GetResult(); } /// @@ -59,15 +57,15 @@ public static CognitiveServicesAccount Create(this IAccountsOperations operation /// /// The name of Cognitive Services account. /// - /// + /// /// The parameters to provide for the created account. /// /// /// The cancellation token. /// - public static async Task CreateAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, CognitiveServicesAccountCreateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, CognitiveServicesAccount account, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, accountName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, accountName, account, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -85,22 +83,12 @@ public static CognitiveServicesAccount Create(this IAccountsOperations operation /// /// The name of Cognitive Services account. /// - /// - /// Gets or sets the SKU of the resource. - /// - /// - /// Gets or sets a list of key value pairs that describe the resource. These - /// tags can be used in viewing and grouping this resource (across resource - /// groups). A maximum of 15 tags can be provided for a resource. Each tag must - /// have a key no greater than 128 characters and value no greater than 256 - /// characters. - /// - /// - /// Additional properties for Account. Only provided fields will be updated. + /// + /// The parameters to provide for the created account. /// - public static CognitiveServicesAccount Update(this IAccountsOperations operations, string resourceGroupName, string accountName, Sku sku = default(Sku), IDictionary tags = default(IDictionary), object properties = default(object)) + public static CognitiveServicesAccount Update(this IAccountsOperations operations, string resourceGroupName, string accountName, CognitiveServicesAccount account) { - return operations.UpdateAsync(resourceGroupName, accountName, sku, tags, properties).GetAwaiter().GetResult(); + return operations.UpdateAsync(resourceGroupName, accountName, account).GetAwaiter().GetResult(); } /// @@ -115,25 +103,15 @@ public static CognitiveServicesAccount Create(this IAccountsOperations operation /// /// The name of Cognitive Services account. /// - /// - /// Gets or sets the SKU of the resource. - /// - /// - /// Gets or sets a list of key value pairs that describe the resource. These - /// tags can be used in viewing and grouping this resource (across resource - /// groups). A maximum of 15 tags can be provided for a resource. Each tag must - /// have a key no greater than 128 characters and value no greater than 256 - /// characters. - /// - /// - /// Additional properties for Account. Only provided fields will be updated. + /// + /// The parameters to provide for the created account. /// /// /// The cancellation token. /// - public static async Task UpdateAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, Sku sku = default(Sku), IDictionary tags = default(IDictionary), object properties = default(object), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, CognitiveServicesAccount account, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, accountName, sku, tags, properties, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, accountName, account, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/CheckSkuAvailabilityOperations.cs b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/CheckSkuAvailabilityOperations.cs deleted file mode 100644 index 7dac9dd94e72..000000000000 --- a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/CheckSkuAvailabilityOperations.cs +++ /dev/null @@ -1,276 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.CognitiveServices -{ - 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; - - /// - /// CheckSkuAvailabilityOperations operations. - /// - internal partial class CheckSkuAvailabilityOperations : IServiceOperations, ICheckSkuAvailabilityOperations - { - /// - /// Initializes a new instance of the CheckSkuAvailabilityOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal CheckSkuAvailabilityOperations(CognitiveServicesManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the CognitiveServicesManagementClient - /// - public CognitiveServicesManagementClient Client { get; private set; } - - /// - /// Check available SKUs. - /// - /// - /// Resource location. - /// - /// - /// The SKU of the resource. - /// - /// - /// The Kind of the resource. - /// - /// - /// The Type of the 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 location, IList skus, string kind, string type, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); - } - if (skus == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "skus"); - } - if (kind == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "kind"); - } - if (type == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "type"); - } - CheckSkuAvailabilityParameter parameters = new CheckSkuAvailabilityParameter(); - if (skus != null || kind != null || type != null) - { - parameters.Skus = skus; - parameters.Kind = kind; - parameters.Type = type; - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("location", location); - tracingParameters.Add("parameters", parameters); - 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}/providers/Microsoft.CognitiveServices/locations/{location}/checkSkuAvailability").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - 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 CloudException(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); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - 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); - } - _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/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/CheckSkuAvailabilityOperationsExtensions.cs b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/CheckSkuAvailabilityOperationsExtensions.cs deleted file mode 100644 index b0c88b30e7b2..000000000000 --- a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/CheckSkuAvailabilityOperationsExtensions.cs +++ /dev/null @@ -1,79 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.CognitiveServices -{ - 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 CheckSkuAvailabilityOperations. - /// - public static partial class CheckSkuAvailabilityOperationsExtensions - { - /// - /// Check available SKUs. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Resource location. - /// - /// - /// The SKU of the resource. - /// - /// - /// The Kind of the resource. - /// - /// - /// The Type of the resource. - /// - public static CheckSkuAvailabilityResultList List(this ICheckSkuAvailabilityOperations operations, string location, IList skus, string kind, string type) - { - return operations.ListAsync(location, skus, kind, type).GetAwaiter().GetResult(); - } - - /// - /// Check available SKUs. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Resource location. - /// - /// - /// The SKU of the resource. - /// - /// - /// The Kind of the resource. - /// - /// - /// The Type of the resource. - /// - /// - /// The cancellation token. - /// - public static async Task ListAsync(this ICheckSkuAvailabilityOperations operations, string location, IList skus, string kind, string type, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(location, skus, kind, type, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/CognitiveServicesManagementClient.cs b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/CognitiveServicesManagementClient.cs index 7faff410cf95..a072c48dbaf6 100644 --- a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/CognitiveServicesManagementClient.cs +++ b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/CognitiveServicesManagementClient.cs @@ -20,6 +20,8 @@ namespace Microsoft.Azure.Management.CognitiveServices using System.Linq; using System.Net; using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// Cognitive Services Management Client @@ -90,11 +92,6 @@ public partial class CognitiveServicesManagementClient : ServiceClient public virtual IOperations Operations { get; private set; } - /// - /// Gets the ICheckSkuAvailabilityOperations. - /// - public virtual ICheckSkuAvailabilityOperations CheckSkuAvailability { get; private set; } - /// /// Initializes a new instance of the CognitiveServicesManagementClient class. /// @@ -339,7 +336,6 @@ private void Initialize() Accounts = new AccountsOperations(this); ResourceSkus = new ResourceSkusOperations(this); Operations = new Operations(this); - CheckSkuAvailability = new CheckSkuAvailabilityOperations(this); BaseUri = new System.Uri("https://management.azure.com"); ApiVersion = "2017-04-18"; AcceptLanguage = "en-US"; @@ -358,7 +354,6 @@ private void Initialize() new Iso8601TimeSpanConverter() } }; - SerializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings = new JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, @@ -372,8 +367,434 @@ private void Initialize() } }; CustomInitialize(); - DeserializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); } + /// + /// Check available SKUs. + /// + /// + /// Resource location. + /// + /// + /// The SKU of the resource. + /// + /// + /// The Kind of the resource. + /// + /// + /// The Type of the 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> CheckSkuAvailabilityWithHttpMessagesAsync(string location, IList skus, string kind, string type, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (skus == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "skus"); + } + if (kind == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "kind"); + } + if (type == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "type"); + } + CheckSkuAvailabilityParameter parameters = new CheckSkuAvailabilityParameter(); + if (skus != null || kind != null || type != null) + { + parameters.Skus = skus; + parameters.Kind = kind; + parameters.Type = type; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CheckSkuAvailability", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/checkSkuAvailability").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", 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 = SafeJsonConvert.SerializeObject(parameters, 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 (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _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 = SafeJsonConvert.DeserializeObject(_responseContent, 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; + } + + /// + /// Check whether a domain is available. + /// + /// + /// The subdomain name to use. + /// + /// + /// The Type of the 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> CheckDomainAvailabilityWithHttpMessagesAsync(string subdomainName, string type, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (subdomainName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "subdomainName"); + } + if (type == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "type"); + } + CheckDomainAvailabilityParameter parameters = new CheckDomainAvailabilityParameter(); + if (subdomainName != null || type != null) + { + parameters.SubdomainName = subdomainName; + parameters.Type = type; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CheckDomainAvailability", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/checkDomainAvailability").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", 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 = SafeJsonConvert.SerializeObject(parameters, 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 (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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); + } + _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 = SafeJsonConvert.DeserializeObject(_responseContent, 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/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/CognitiveServicesManagementClientExtensions.cs b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/CognitiveServicesManagementClientExtensions.cs new file mode 100644 index 000000000000..35edaaa493e9 --- /dev/null +++ b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/CognitiveServicesManagementClientExtensions.cs @@ -0,0 +1,119 @@ +// +// 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.CognitiveServices +{ + 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 CognitiveServicesManagementClient. + /// + public static partial class CognitiveServicesManagementClientExtensions + { + /// + /// Check available SKUs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource location. + /// + /// + /// The SKU of the resource. + /// + /// + /// The Kind of the resource. + /// + /// + /// The Type of the resource. + /// + public static CheckSkuAvailabilityResultList CheckSkuAvailability(this ICognitiveServicesManagementClient operations, string location, IList skus, string kind, string type) + { + return operations.CheckSkuAvailabilityAsync(location, skus, kind, type).GetAwaiter().GetResult(); + } + + /// + /// Check available SKUs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource location. + /// + /// + /// The SKU of the resource. + /// + /// + /// The Kind of the resource. + /// + /// + /// The Type of the resource. + /// + /// + /// The cancellation token. + /// + public static async Task CheckSkuAvailabilityAsync(this ICognitiveServicesManagementClient operations, string location, IList skus, string kind, string type, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CheckSkuAvailabilityWithHttpMessagesAsync(location, skus, kind, type, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Check whether a domain is available. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The subdomain name to use. + /// + /// + /// The Type of the resource. + /// + public static CheckDomainAvailabilityResult CheckDomainAvailability(this ICognitiveServicesManagementClient operations, string subdomainName, string type) + { + return operations.CheckDomainAvailabilityAsync(subdomainName, type).GetAwaiter().GetResult(); + } + + /// + /// Check whether a domain is available. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The subdomain name to use. + /// + /// + /// The Type of the resource. + /// + /// + /// The cancellation token. + /// + public static async Task CheckDomainAvailabilityAsync(this ICognitiveServicesManagementClient operations, string subdomainName, string type, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CheckDomainAvailabilityWithHttpMessagesAsync(subdomainName, type, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/IAccountsOperations.cs b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/IAccountsOperations.cs index 8bb6e85b9741..df1a6cc3215c 100644 --- a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/IAccountsOperations.cs +++ b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/IAccountsOperations.cs @@ -34,7 +34,7 @@ public partial interface IAccountsOperations /// /// The name of Cognitive Services account. /// - /// + /// /// The parameters to provide for the created account. /// /// @@ -52,7 +52,7 @@ public partial interface IAccountsOperations /// /// Thrown when a required parameter is null /// - Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, CognitiveServicesAccountCreateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, CognitiveServicesAccount account, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Updates a Cognitive Services account /// @@ -62,19 +62,8 @@ public partial interface IAccountsOperations /// /// The name of Cognitive Services account. /// - /// - /// Gets or sets the SKU of the resource. - /// - /// - /// Gets or sets a list of key value pairs that describe the resource. - /// These tags can be used in viewing and grouping this resource - /// (across resource groups). A maximum of 15 tags can be provided for - /// a resource. Each tag must have a key no greater than 128 characters - /// and value no greater than 256 characters. - /// - /// - /// Additional properties for Account. Only provided fields will be - /// updated. + /// + /// The parameters to provide for the created account. /// /// /// The headers that will be added to request. @@ -91,7 +80,7 @@ public partial interface IAccountsOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, Sku sku = default(Sku), IDictionary tags = default(IDictionary), object properties = default(object), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, CognitiveServicesAccount account, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes a Cognitive Services account from the resource group. /// diff --git a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/ICheckSkuAvailabilityOperations.cs b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/ICheckSkuAvailabilityOperations.cs deleted file mode 100644 index 3ae4bc6c6318..000000000000 --- a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/ICheckSkuAvailabilityOperations.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.CognitiveServices -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// CheckSkuAvailabilityOperations operations. - /// - public partial interface ICheckSkuAvailabilityOperations - { - /// - /// Check available SKUs. - /// - /// - /// Resource location. - /// - /// - /// The SKU of the resource. - /// - /// - /// The Kind of the resource. - /// - /// - /// The Type of the 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 location, IList skus, string kind, string type, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/ICognitiveServicesManagementClient.cs b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/ICognitiveServicesManagementClient.cs index 6e897bac33a1..72a1db034c84 100644 --- a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/ICognitiveServicesManagementClient.cs +++ b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/ICognitiveServicesManagementClient.cs @@ -14,6 +14,10 @@ namespace Microsoft.Azure.Management.CognitiveServices using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// Cognitive Services Management Client @@ -86,9 +90,44 @@ public partial interface ICognitiveServicesManagementClient : System.IDisposable IOperations Operations { get; } /// - /// Gets the ICheckSkuAvailabilityOperations. + /// Check available SKUs. /// - ICheckSkuAvailabilityOperations CheckSkuAvailability { get; } + /// + /// Resource location. + /// + /// + /// The SKU of the resource. + /// + /// + /// The Kind of the resource. + /// + /// + /// The Type of the resource. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> CheckSkuAvailabilityWithHttpMessagesAsync(string location, IList skus, string kind, string type, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Check whether a domain is available. + /// + /// + /// The subdomain name to use. + /// + /// + /// The Type of the resource. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> CheckDomainAvailabilityWithHttpMessagesAsync(string subdomainName, string type, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/CheckDomainAvailabilityParameter.cs b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/CheckDomainAvailabilityParameter.cs new file mode 100644 index 000000000000..2fc0681513a9 --- /dev/null +++ b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/CheckDomainAvailabilityParameter.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.CognitiveServices.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Check Domain availability parameter. + /// + public partial class CheckDomainAvailabilityParameter + { + /// + /// Initializes a new instance of the CheckDomainAvailabilityParameter + /// class. + /// + public CheckDomainAvailabilityParameter() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CheckDomainAvailabilityParameter + /// class. + /// + /// The subdomain name to use. + /// The Type of the resource. + public CheckDomainAvailabilityParameter(string subdomainName, string type) + { + SubdomainName = subdomainName; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the subdomain name to use. + /// + [JsonProperty(PropertyName = "subdomainName")] + public string SubdomainName { get; set; } + + /// + /// Gets or sets the Type of the resource. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (SubdomainName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "SubdomainName"); + } + if (Type == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Type"); + } + } + } +} diff --git a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/CheckDomainAvailabilityResult.cs b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/CheckDomainAvailabilityResult.cs new file mode 100644 index 000000000000..7582f4616c84 --- /dev/null +++ b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/CheckDomainAvailabilityResult.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.CognitiveServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Check Domain availability result. + /// + public partial class CheckDomainAvailabilityResult + { + /// + /// Initializes a new instance of the CheckDomainAvailabilityResult + /// class. + /// + public CheckDomainAvailabilityResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CheckDomainAvailabilityResult + /// class. + /// + /// Indicates the given SKU is + /// available or not. + /// Reason why the SKU is not available. + /// The subdomain name to use. + /// The Type of the resource. + public CheckDomainAvailabilityResult(bool? isSubdomainAvailable = default(bool?), string reason = default(string), string subdomainName = default(string), string type = default(string)) + { + IsSubdomainAvailable = isSubdomainAvailable; + Reason = reason; + SubdomainName = subdomainName; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets indicates the given SKU is available or not. + /// + [JsonProperty(PropertyName = "isSubdomainAvailable")] + public bool? IsSubdomainAvailable { get; set; } + + /// + /// Gets or sets reason why the SKU is not available. + /// + [JsonProperty(PropertyName = "reason")] + public string Reason { get; set; } + + /// + /// Gets or sets the subdomain name to use. + /// + [JsonProperty(PropertyName = "subdomainName")] + public string SubdomainName { get; set; } + + /// + /// Gets or sets the Type of the resource. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + } +} diff --git a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/CognitiveServicesAccount.cs b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/CognitiveServicesAccount.cs index 2780d0f16127..eb5157dd5234 100644 --- a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/CognitiveServicesAccount.cs +++ b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/CognitiveServicesAccount.cs @@ -12,7 +12,6 @@ namespace Microsoft.Azure.Management.CognitiveServices.Models { using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -22,7 +21,6 @@ namespace Microsoft.Azure.Management.CognitiveServices.Models /// Cognitive Services Account is an Azure resource representing the /// provisioned account, its type, location and SKU. /// - [Rest.Serialization.JsonTransformation] public partial class CognitiveServicesAccount : IResource { /// @@ -38,19 +36,11 @@ public CognitiveServicesAccount() /// /// Entity Tag /// The id of the created account - /// Type of cognitive service account. + /// The Kind of the resource. /// The location of the resource /// The name of the created account - /// Gets the status of the cognitive - /// services account at the time the operation was called. Possible - /// values include: 'Creating', 'ResolvingDNS', 'Moving', 'Deleting', - /// 'Succeeded', 'Failed' - /// Endpoint of the created account. - /// The internal identifier. - /// Optional subdomain name used for - /// token-based authentication. - /// A collection of rules governing the - /// accessibility from specific network locations. + /// Properties of Cognitive Services + /// account. /// The SKU of Cognitive Services account. /// Gets or sets a list of key value pairs that /// describe the resource. These tags can be used in viewing and @@ -59,18 +49,14 @@ public CognitiveServicesAccount() /// greater than 128 characters and value no greater than 256 /// characters. /// Resource type - public CognitiveServicesAccount(string etag = default(string), string id = default(string), string kind = default(string), string location = default(string), string name = default(string), string provisioningState = default(string), string endpoint = default(string), string internalId = default(string), string customSubDomainName = default(string), NetworkRuleSet networkAcls = default(NetworkRuleSet), Sku sku = default(Sku), IDictionary tags = default(IDictionary), string type = default(string)) + public CognitiveServicesAccount(string etag = default(string), string id = default(string), string kind = default(string), string location = default(string), string name = default(string), CognitiveServicesAccountProperties properties = default(CognitiveServicesAccountProperties), Sku sku = default(Sku), IDictionary tags = default(IDictionary), string type = default(string)) { Etag = etag; Id = id; Kind = kind; Location = location; Name = name; - ProvisioningState = provisioningState; - Endpoint = endpoint; - InternalId = internalId; - CustomSubDomainName = customSubDomainName; - NetworkAcls = networkAcls; + Properties = properties; Sku = sku; Tags = tags; Type = type; @@ -83,10 +69,10 @@ public CognitiveServicesAccount() partial void CustomInit(); /// - /// Gets or sets entity Tag + /// Gets entity Tag /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// /// Gets the id of the created account @@ -95,7 +81,7 @@ public CognitiveServicesAccount() public string Id { get; private set; } /// - /// Gets or sets type of cognitive service account. + /// Gets or sets the Kind of the resource. /// [JsonProperty(PropertyName = "kind")] public string Kind { get; set; } @@ -113,38 +99,10 @@ public CognitiveServicesAccount() public string Name { get; private set; } /// - /// Gets the status of the cognitive services account at the time the - /// operation was called. Possible values include: 'Creating', - /// 'ResolvingDNS', 'Moving', 'Deleting', 'Succeeded', 'Failed' + /// Gets or sets properties of Cognitive Services account. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Gets or sets endpoint of the created account. - /// - [JsonProperty(PropertyName = "properties.endpoint")] - public string Endpoint { get; set; } - - /// - /// Gets or sets the internal identifier. - /// - [JsonProperty(PropertyName = "properties.internalId")] - public string InternalId { get; set; } - - /// - /// Gets or sets optional subdomain name used for token-based - /// authentication. - /// - [JsonProperty(PropertyName = "properties.customSubDomainName")] - public string CustomSubDomainName { get; set; } - - /// - /// Gets or sets a collection of rules governing the accessibility from - /// specific network locations. - /// - [JsonProperty(PropertyName = "properties.networkAcls")] - public NetworkRuleSet NetworkAcls { get; set; } + [JsonProperty(PropertyName = "properties")] + public CognitiveServicesAccountProperties Properties { get; set; } /// /// Gets or sets the SKU of Cognitive Services account. @@ -176,6 +134,10 @@ public CognitiveServicesAccount() /// public virtual void Validate() { + if (Properties != null) + { + Properties.Validate(); + } if (Sku != null) { Sku.Validate(); diff --git a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/CognitiveServicesAccountApiProperties.cs b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/CognitiveServicesAccountApiProperties.cs new file mode 100644 index 000000000000..5e36ffd769ed --- /dev/null +++ b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/CognitiveServicesAccountApiProperties.cs @@ -0,0 +1,116 @@ +// +// 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.CognitiveServices.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The api properties for special APIs. + /// + public partial class CognitiveServicesAccountApiProperties + { + /// + /// Initializes a new instance of the + /// CognitiveServicesAccountApiProperties class. + /// + public CognitiveServicesAccountApiProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// CognitiveServicesAccountApiProperties class. + /// + /// (QnAMaker Only) The runtime + /// endpoint of QnAMaker. + /// (Bing Search Only) The flag to + /// enable statistics of Bing Search. + /// (Personalization Only) The + /// flag to enable statistics of Bing Search. + /// (Personalization Only) + /// The storage account connection string. + public CognitiveServicesAccountApiProperties(string qnaRuntimeEndpoint = default(string), bool? statisticsEnabled = default(bool?), string eventHubConnectionString = default(string), string storageAccountConnectionString = default(string)) + { + QnaRuntimeEndpoint = qnaRuntimeEndpoint; + StatisticsEnabled = statisticsEnabled; + EventHubConnectionString = eventHubConnectionString; + StorageAccountConnectionString = storageAccountConnectionString; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets (QnAMaker Only) The runtime endpoint of QnAMaker. + /// + [JsonProperty(PropertyName = "qnaRuntimeEndpoint")] + public string QnaRuntimeEndpoint { get; set; } + + /// + /// Gets or sets (Bing Search Only) The flag to enable statistics of + /// Bing Search. + /// + [JsonProperty(PropertyName = "statisticsEnabled")] + public bool? StatisticsEnabled { get; set; } + + /// + /// Gets or sets (Personalization Only) The flag to enable statistics + /// of Bing Search. + /// + [JsonProperty(PropertyName = "eventHubConnectionString")] + public string EventHubConnectionString { get; set; } + + /// + /// Gets or sets (Personalization Only) The storage account connection + /// string. + /// + [JsonProperty(PropertyName = "storageAccountConnectionString")] + public string StorageAccountConnectionString { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (EventHubConnectionString != null) + { + if (EventHubConnectionString.Length > 1000) + { + throw new ValidationException(ValidationRules.MaxLength, "EventHubConnectionString", 1000); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(EventHubConnectionString, "^( *)Endpoint=sb://(.*);( *)SharedAccessKeyName=(.*);( *)SharedAccessKey=(.*)$")) + { + throw new ValidationException(ValidationRules.Pattern, "EventHubConnectionString", "^( *)Endpoint=sb://(.*);( *)SharedAccessKeyName=(.*);( *)SharedAccessKey=(.*)$"); + } + } + if (StorageAccountConnectionString != null) + { + if (StorageAccountConnectionString.Length > 1000) + { + throw new ValidationException(ValidationRules.MaxLength, "StorageAccountConnectionString", 1000); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(StorageAccountConnectionString, "^(( *)DefaultEndpointsProtocol=(http|https)( *);( *))?AccountName=(.*)AccountKey=(.*)EndpointSuffix=(.*)$")) + { + throw new ValidationException(ValidationRules.Pattern, "StorageAccountConnectionString", "^(( *)DefaultEndpointsProtocol=(http|https)( *);( *))?AccountName=(.*)AccountKey=(.*)EndpointSuffix=(.*)$"); + } + } + } + } +} diff --git a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/CognitiveServicesAccountCreateParameters.cs b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/CognitiveServicesAccountCreateParameters.cs deleted file mode 100644 index 937a85194926..000000000000 --- a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/CognitiveServicesAccountCreateParameters.cs +++ /dev/null @@ -1,139 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.CognitiveServices.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The parameters to provide for the account. - /// - public partial class CognitiveServicesAccountCreateParameters - { - /// - /// Initializes a new instance of the - /// CognitiveServicesAccountCreateParameters class. - /// - public CognitiveServicesAccountCreateParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// CognitiveServicesAccountCreateParameters class. - /// - /// Required. Gets or sets the SKU of the - /// resource. - /// Required. Gets or sets the Kind of the - /// resource. - /// Required. Gets or sets the location of the - /// resource. This will be one of the supported and registered Azure - /// Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo - /// region of a resource cannot be changed once it is created, but if - /// an identical geo region is specified on update the request will - /// succeed. - /// Must exist in the request. Must be an - /// empty object. Must not be null. - /// Gets or sets a list of key value pairs that - /// describe the resource. These tags can be used in viewing and - /// grouping this resource (across resource groups). A maximum of 15 - /// tags can be provided for a resource. Each tag must have a key no - /// greater than 128 characters and value no greater than 256 - /// characters. - public CognitiveServicesAccountCreateParameters(Sku sku, string kind, string location, object properties, IDictionary tags = default(IDictionary)) - { - Sku = sku; - Kind = kind; - Location = location; - Tags = tags; - Properties = properties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets required. Gets or sets the SKU of the resource. - /// - [JsonProperty(PropertyName = "sku")] - public Sku Sku { get; set; } - - /// - /// Gets or sets required. Gets or sets the Kind of the resource. - /// - [JsonProperty(PropertyName = "kind")] - public string Kind { get; set; } - - /// - /// Gets or sets required. Gets or sets the location of the resource. - /// This will be one of the supported and registered Azure Geo Regions - /// (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - /// resource cannot be changed once it is created, but if an identical - /// geo region is specified on update the request will succeed. - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - - /// - /// Gets or sets a list of key value pairs that describe the resource. - /// These tags can be used in viewing and grouping this resource - /// (across resource groups). A maximum of 15 tags can be provided for - /// a resource. Each tag must have a key no greater than 128 characters - /// and value no greater than 256 characters. - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - - /// - /// Gets or sets must exist in the request. Must be an empty object. - /// Must not be null. - /// - [JsonProperty(PropertyName = "properties")] - public object Properties { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Sku == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Sku"); - } - if (Kind == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Kind"); - } - if (Location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); - } - if (Properties == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Properties"); - } - if (Sku != null) - { - Sku.Validate(); - } - } - } -} diff --git a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/CognitiveServicesAccountProperties.cs b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/CognitiveServicesAccountProperties.cs new file mode 100644 index 000000000000..aab58f8e89c2 --- /dev/null +++ b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/CognitiveServicesAccountProperties.cs @@ -0,0 +1,116 @@ +// +// 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.CognitiveServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Properties of Cognitive Services account. + /// + public partial class CognitiveServicesAccountProperties + { + /// + /// Initializes a new instance of the + /// CognitiveServicesAccountProperties class. + /// + public CognitiveServicesAccountProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// CognitiveServicesAccountProperties class. + /// + /// Gets the status of the cognitive + /// services account at the time the operation was called. Possible + /// values include: 'Creating', 'ResolvingDNS', 'Moving', 'Deleting', + /// 'Succeeded', 'Failed' + /// Endpoint of the created account. + /// The internal identifier. + /// Optional subdomain name used for + /// token-based authentication. + /// A collection of rules governing the + /// accessibility from specific network locations. + /// The api properties for special + /// APIs. + public CognitiveServicesAccountProperties(string provisioningState = default(string), string endpoint = default(string), string internalId = default(string), string customSubDomainName = default(string), NetworkRuleSet networkAcls = default(NetworkRuleSet), CognitiveServicesAccountApiProperties apiProperties = default(CognitiveServicesAccountApiProperties)) + { + ProvisioningState = provisioningState; + Endpoint = endpoint; + InternalId = internalId; + CustomSubDomainName = customSubDomainName; + NetworkAcls = networkAcls; + ApiProperties = apiProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the status of the cognitive services account at the time the + /// operation was called. Possible values include: 'Creating', + /// 'ResolvingDNS', 'Moving', 'Deleting', 'Succeeded', 'Failed' + /// + [JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets endpoint of the created account. + /// + [JsonProperty(PropertyName = "endpoint")] + public string Endpoint { get; private set; } + + /// + /// Gets the internal identifier. + /// + [JsonProperty(PropertyName = "internalId")] + public string InternalId { get; private set; } + + /// + /// Gets or sets optional subdomain name used for token-based + /// authentication. + /// + [JsonProperty(PropertyName = "customSubDomainName")] + public string CustomSubDomainName { get; set; } + + /// + /// Gets or sets a collection of rules governing the accessibility from + /// specific network locations. + /// + [JsonProperty(PropertyName = "networkAcls")] + public NetworkRuleSet NetworkAcls { get; set; } + + /// + /// Gets or sets the api properties for special APIs. + /// + [JsonProperty(PropertyName = "apiProperties")] + public CognitiveServicesAccountApiProperties ApiProperties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ApiProperties != null) + { + ApiProperties.Validate(); + } + } + } +} diff --git a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/CognitiveServicesAccountUpdateParameters.cs b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/CognitiveServicesAccountUpdateParameters.cs deleted file mode 100644 index 9ca1e70eab7b..000000000000 --- a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/CognitiveServicesAccountUpdateParameters.cs +++ /dev/null @@ -1,95 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.CognitiveServices.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The parameters to provide for the account. - /// - public partial class CognitiveServicesAccountUpdateParameters - { - /// - /// Initializes a new instance of the - /// CognitiveServicesAccountUpdateParameters class. - /// - public CognitiveServicesAccountUpdateParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// CognitiveServicesAccountUpdateParameters class. - /// - /// Gets or sets the SKU of the resource. - /// Gets or sets a list of key value pairs that - /// describe the resource. These tags can be used in viewing and - /// grouping this resource (across resource groups). A maximum of 15 - /// tags can be provided for a resource. Each tag must have a key no - /// greater than 128 characters and value no greater than 256 - /// characters. - /// Additional properties for Account. Only - /// provided fields will be updated. - public CognitiveServicesAccountUpdateParameters(Sku sku = default(Sku), IDictionary tags = default(IDictionary), object properties = default(object)) - { - Sku = sku; - Tags = tags; - Properties = properties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the SKU of the resource. - /// - [JsonProperty(PropertyName = "sku")] - public Sku Sku { get; set; } - - /// - /// Gets or sets a list of key value pairs that describe the resource. - /// These tags can be used in viewing and grouping this resource - /// (across resource groups). A maximum of 15 tags can be provided for - /// a resource. Each tag must have a key no greater than 128 characters - /// and value no greater than 256 characters. - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - - /// - /// Gets or sets additional properties for Account. Only provided - /// fields will be updated. - /// - [JsonProperty(PropertyName = "properties")] - public object Properties { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Sku != null) - { - Sku.Validate(); - } - } - } -} diff --git a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/IPRule.cs b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/IpRule.cs similarity index 100% rename from sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/IPRule.cs rename to sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/IpRule.cs diff --git a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/NetworkRuleBypassOptions.cs b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/NetworkRuleBypassOptions.cs deleted file mode 100644 index 7fe11f223842..000000000000 --- a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/NetworkRuleBypassOptions.cs +++ /dev/null @@ -1,22 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.CognitiveServices.Models -{ - - /// - /// Defines values for NetworkRuleBypassOptions. - /// - public static class NetworkRuleBypassOptions - { - public const string AzureServices = "AzureServices"; - public const string None = "None"; - } -} diff --git a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/NetworkRuleSet.cs b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/NetworkRuleSet.cs index 663b44602d1c..7a0b8540e6d3 100644 --- a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/NetworkRuleSet.cs +++ b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/Models/NetworkRuleSet.cs @@ -31,10 +31,6 @@ public NetworkRuleSet() /// /// Initializes a new instance of the NetworkRuleSet class. /// - /// Tells what traffic can bypass network rules. - /// This can be 'AzureServices' or 'None'. If not specified the - /// default is 'AzureServices'. Possible values include: - /// 'AzureServices', 'None' /// The default action when no rule from /// ipRules and from virtualNetworkRules match. This is only used after /// the bypass property has been evaluated. Possible values include: @@ -42,9 +38,8 @@ public NetworkRuleSet() /// The list of IP address rules. /// The list of virtual network /// rules. - public NetworkRuleSet(string bypass = default(string), string defaultAction = default(string), IList ipRules = default(IList), IList virtualNetworkRules = default(IList)) + public NetworkRuleSet(string defaultAction = default(string), IList ipRules = default(IList), IList virtualNetworkRules = default(IList)) { - Bypass = bypass; DefaultAction = defaultAction; IpRules = ipRules; VirtualNetworkRules = virtualNetworkRules; @@ -56,14 +51,6 @@ public NetworkRuleSet() /// partial void CustomInit(); - /// - /// Gets or sets tells what traffic can bypass network rules. This can - /// be 'AzureServices' or 'None'. If not specified the default is - /// 'AzureServices'. Possible values include: 'AzureServices', 'None' - /// - [JsonProperty(PropertyName = "bypass")] - public string Bypass { get; set; } - /// /// Gets or sets the default action when no rule from ipRules and from /// virtualNetworkRules match. This is only used after the bypass diff --git a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/SdkInfo_CognitiveServicesManagementClient.cs b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/SdkInfo_CognitiveServicesManagementClient.cs index 230a99061186..48cf31a0e168 100644 --- a/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/SdkInfo_CognitiveServicesManagementClient.cs +++ b/sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/src/Generated/SdkInfo_CognitiveServicesManagementClient.cs @@ -20,22 +20,12 @@ public static IEnumerable> ApiInfo_CognitiveServic return new Tuple[] { new Tuple("CognitiveServices", "Accounts", "2017-04-18"), + new Tuple("CognitiveServices", "CheckDomainAvailability", "2017-04-18"), new Tuple("CognitiveServices", "CheckSkuAvailability", "2017-04-18"), new Tuple("CognitiveServices", "Operations", "2017-04-18"), new Tuple("CognitiveServices", "ResourceSkus", "2017-04-18"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "latest"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=D:\\Github\\azure-sdk-for-net\\src\\SDKs"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "f58c2f349207bda6f5ca4c010dd7f56c38ddb70e"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } -