diff --git a/sdk/cdn/Microsoft.Azure.Management.Cdn/src/Generated/CustomDomainsOperations.cs b/sdk/cdn/Microsoft.Azure.Management.Cdn/src/Generated/CustomDomainsOperations.cs index 3a85e85f60d2..89494e7c5480 100644 --- a/sdk/cdn/Microsoft.Azure.Management.Cdn/src/Generated/CustomDomainsOperations.cs +++ b/sdk/cdn/Microsoft.Azure.Management.Cdn/src/Generated/CustomDomainsOperations.cs @@ -564,6 +564,70 @@ internal CustomDomainsOperations(CdnManagementClient client) /// Name of the custom domain within an endpoint. /// /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DisableCustomHttpsWithHttpMessagesAsync(string resourceGroupName, string profileName, string endpointName, string customDomainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDisableCustomHttpsWithHttpMessagesAsync(resourceGroupName, profileName, endpointName, customDomainName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Enable https delivery of the custom domain. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// Name of the CDN profile which is unique within the resource group. + /// + /// + /// Name of the endpoint under the profile which is unique globally. + /// + /// + /// Name of the custom domain within an endpoint. + /// + /// + /// The configuration specifying how to enable HTTPS for the custom domain - + /// using CDN managed certificate or user's own certificate. If not specified, + /// enabling ssl uses CDN managed certificate by default. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> EnableCustomHttpsWithHttpMessagesAsync(string resourceGroupName, string profileName, string endpointName, string customDomainName, CustomDomainHttpsParameters customDomainHttpsParameters = default(CustomDomainHttpsParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginEnableCustomHttpsWithHttpMessagesAsync(resourceGroupName, profileName, endpointName, customDomainName, customDomainHttpsParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates a new custom domain within an endpoint. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// Name of the CDN profile which is unique within the resource group. + /// + /// + /// Name of the endpoint under the profile which is unique globally. + /// + /// + /// Name of the custom domain within an endpoint. + /// + /// + /// The host name of the custom domain. Must be a domain name. + /// + /// /// Headers that will be added to request. /// /// @@ -584,7 +648,7 @@ internal CustomDomainsOperations(CdnManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> DisableCustomHttpsWithHttpMessagesAsync(string resourceGroupName, string profileName, string endpointName, string customDomainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string profileName, string endpointName, string customDomainName, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -625,6 +689,15 @@ internal CustomDomainsOperations(CdnManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + if (hostName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); + } + CustomDomainParameters customDomainProperties = new CustomDomainParameters(); + if (hostName != null) + { + customDomainProperties.HostName = hostName; + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -636,12 +709,13 @@ internal CustomDomainsOperations(CdnManagementClient client) tracingParameters.Add("profileName", profileName); tracingParameters.Add("endpointName", endpointName); tracingParameters.Add("customDomainName", customDomainName); + tracingParameters.Add("customDomainProperties", customDomainProperties); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DisableCustomHttps", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", 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.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/disableCustomHttps").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{profileName}", System.Uri.EscapeDataString(profileName)); _url = _url.Replace("{endpointName}", System.Uri.EscapeDataString(endpointName)); @@ -659,7 +733,7 @@ internal CustomDomainsOperations(CdnManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -690,6 +764,12 @@ internal CustomDomainsOperations(CdnManagementClient client) // Serialize Request string _requestContent = null; + if(customDomainProperties != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(customDomainProperties, 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) { @@ -710,7 +790,7 @@ internal CustomDomainsOperations(CdnManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -748,6 +828,42 @@ internal CustomDomainsOperations(CdnManagementClient client) _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); + } + } + // Deserialize Response if ((int)_statusCode == 202) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); @@ -773,7 +889,7 @@ internal CustomDomainsOperations(CdnManagementClient client) } /// - /// Enable https delivery of the custom domain. + /// Deletes an existing custom domain within an endpoint. /// /// /// Name of the Resource group within the Azure subscription. @@ -787,11 +903,6 @@ internal CustomDomainsOperations(CdnManagementClient client) /// /// Name of the custom domain within an endpoint. /// - /// - /// The configuration specifying how to enable HTTPS for the custom domain - - /// using CDN managed certificate or user's own certificate. If not specified, - /// enabling ssl uses CDN managed certificate by default. - /// /// /// Headers that will be added to request. /// @@ -813,7 +924,7 @@ internal CustomDomainsOperations(CdnManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> EnableCustomHttpsWithHttpMessagesAsync(string resourceGroupName, string profileName, string endpointName, string customDomainName, CustomDomainHttpsParameters customDomainHttpsParameters = default(CustomDomainHttpsParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string profileName, string endpointName, string customDomainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -846,10 +957,6 @@ internal CustomDomainsOperations(CdnManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "customDomainName"); } - if (customDomainHttpsParameters != null) - { - customDomainHttpsParameters.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -869,13 +976,12 @@ internal CustomDomainsOperations(CdnManagementClient client) tracingParameters.Add("profileName", profileName); tracingParameters.Add("endpointName", endpointName); tracingParameters.Add("customDomainName", customDomainName); - tracingParameters.Add("customDomainHttpsParameters", customDomainHttpsParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "EnableCustomHttps", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", 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.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/enableCustomHttps").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{profileName}", System.Uri.EscapeDataString(profileName)); _url = _url.Replace("{endpointName}", System.Uri.EscapeDataString(endpointName)); @@ -893,7 +999,7 @@ internal CustomDomainsOperations(CdnManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -924,12 +1030,6 @@ internal CustomDomainsOperations(CdnManagementClient client) // Serialize Request string _requestContent = null; - if(customDomainHttpsParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(customDomainHttpsParameters, 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) { @@ -950,7 +1050,7 @@ internal CustomDomainsOperations(CdnManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1013,7 +1113,7 @@ internal CustomDomainsOperations(CdnManagementClient client) } /// - /// Creates a new custom domain within an endpoint. + /// Disable https delivery of the custom domain. /// /// /// Name of the Resource group within the Azure subscription. @@ -1027,9 +1127,6 @@ internal CustomDomainsOperations(CdnManagementClient client) /// /// Name of the custom domain within an endpoint. /// - /// - /// The host name of the custom domain. Must be a domain name. - /// /// /// Headers that will be added to request. /// @@ -1051,7 +1148,7 @@ internal CustomDomainsOperations(CdnManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string profileName, string endpointName, string customDomainName, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginDisableCustomHttpsWithHttpMessagesAsync(string resourceGroupName, string profileName, string endpointName, string customDomainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1092,15 +1189,6 @@ internal CustomDomainsOperations(CdnManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (hostName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); - } - CustomDomainParameters customDomainProperties = new CustomDomainParameters(); - if (hostName != null) - { - customDomainProperties.HostName = hostName; - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1112,13 +1200,12 @@ internal CustomDomainsOperations(CdnManagementClient client) tracingParameters.Add("profileName", profileName); tracingParameters.Add("endpointName", endpointName); tracingParameters.Add("customDomainName", customDomainName); - tracingParameters.Add("customDomainProperties", customDomainProperties); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDisableCustomHttps", 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.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/disableCustomHttps").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{profileName}", System.Uri.EscapeDataString(profileName)); _url = _url.Replace("{endpointName}", System.Uri.EscapeDataString(endpointName)); @@ -1136,7 +1223,7 @@ internal CustomDomainsOperations(CdnManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1167,12 +1254,6 @@ internal CustomDomainsOperations(CdnManagementClient client) // Serialize Request string _requestContent = null; - if(customDomainProperties != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(customDomainProperties, 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) { @@ -1193,7 +1274,7 @@ internal CustomDomainsOperations(CdnManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1231,42 +1312,6 @@ internal CustomDomainsOperations(CdnManagementClient client) _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); - } - } - // Deserialize Response if ((int)_statusCode == 202) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); @@ -1292,7 +1337,7 @@ internal CustomDomainsOperations(CdnManagementClient client) } /// - /// Deletes an existing custom domain within an endpoint. + /// Enable https delivery of the custom domain. /// /// /// Name of the Resource group within the Azure subscription. @@ -1306,6 +1351,11 @@ internal CustomDomainsOperations(CdnManagementClient client) /// /// Name of the custom domain within an endpoint. /// + /// + /// The configuration specifying how to enable HTTPS for the custom domain - + /// using CDN managed certificate or user's own certificate. If not specified, + /// enabling ssl uses CDN managed certificate by default. + /// /// /// Headers that will be added to request. /// @@ -1327,7 +1377,7 @@ internal CustomDomainsOperations(CdnManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string profileName, string endpointName, string customDomainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginEnableCustomHttpsWithHttpMessagesAsync(string resourceGroupName, string profileName, string endpointName, string customDomainName, CustomDomainHttpsParameters customDomainHttpsParameters = default(CustomDomainHttpsParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1360,6 +1410,10 @@ internal CustomDomainsOperations(CdnManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "customDomainName"); } + if (customDomainHttpsParameters != null) + { + customDomainHttpsParameters.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1379,12 +1433,13 @@ internal CustomDomainsOperations(CdnManagementClient client) tracingParameters.Add("profileName", profileName); tracingParameters.Add("endpointName", endpointName); tracingParameters.Add("customDomainName", customDomainName); + tracingParameters.Add("customDomainHttpsParameters", customDomainHttpsParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginEnableCustomHttps", 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.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/enableCustomHttps").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{profileName}", System.Uri.EscapeDataString(profileName)); _url = _url.Replace("{endpointName}", System.Uri.EscapeDataString(endpointName)); @@ -1402,7 +1457,7 @@ internal CustomDomainsOperations(CdnManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1433,6 +1488,12 @@ internal CustomDomainsOperations(CdnManagementClient client) // Serialize Request string _requestContent = null; + if(customDomainHttpsParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(customDomainHttpsParameters, 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) { @@ -1453,7 +1514,7 @@ internal CustomDomainsOperations(CdnManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try diff --git a/sdk/cdn/Microsoft.Azure.Management.Cdn/src/Generated/CustomDomainsOperationsExtensions.cs b/sdk/cdn/Microsoft.Azure.Management.Cdn/src/Generated/CustomDomainsOperationsExtensions.cs index 4d0fae9c0b1d..fe183e1d4fd8 100644 --- a/sdk/cdn/Microsoft.Azure.Management.Cdn/src/Generated/CustomDomainsOperationsExtensions.cs +++ b/sdk/cdn/Microsoft.Azure.Management.Cdn/src/Generated/CustomDomainsOperationsExtensions.cs @@ -453,6 +453,120 @@ public static CustomDomain BeginDelete(this ICustomDomainsOperations operations, } } + /// + /// Disable https delivery of the custom domain. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// Name of the CDN profile which is unique within the resource group. + /// + /// + /// Name of the endpoint under the profile which is unique globally. + /// + /// + /// Name of the custom domain within an endpoint. + /// + public static CustomDomain BeginDisableCustomHttps(this ICustomDomainsOperations operations, string resourceGroupName, string profileName, string endpointName, string customDomainName) + { + return operations.BeginDisableCustomHttpsAsync(resourceGroupName, profileName, endpointName, customDomainName).GetAwaiter().GetResult(); + } + + /// + /// Disable https delivery of the custom domain. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// Name of the CDN profile which is unique within the resource group. + /// + /// + /// Name of the endpoint under the profile which is unique globally. + /// + /// + /// Name of the custom domain within an endpoint. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDisableCustomHttpsAsync(this ICustomDomainsOperations operations, string resourceGroupName, string profileName, string endpointName, string customDomainName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginDisableCustomHttpsWithHttpMessagesAsync(resourceGroupName, profileName, endpointName, customDomainName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Enable https delivery of the custom domain. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// Name of the CDN profile which is unique within the resource group. + /// + /// + /// Name of the endpoint under the profile which is unique globally. + /// + /// + /// Name of the custom domain within an endpoint. + /// + /// + /// The configuration specifying how to enable HTTPS for the custom domain - + /// using CDN managed certificate or user's own certificate. If not specified, + /// enabling ssl uses CDN managed certificate by default. + /// + public static CustomDomain BeginEnableCustomHttps(this ICustomDomainsOperations operations, string resourceGroupName, string profileName, string endpointName, string customDomainName, CustomDomainHttpsParameters customDomainHttpsParameters = default(CustomDomainHttpsParameters)) + { + return operations.BeginEnableCustomHttpsAsync(resourceGroupName, profileName, endpointName, customDomainName, customDomainHttpsParameters).GetAwaiter().GetResult(); + } + + /// + /// Enable https delivery of the custom domain. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// Name of the CDN profile which is unique within the resource group. + /// + /// + /// Name of the endpoint under the profile which is unique globally. + /// + /// + /// Name of the custom domain within an endpoint. + /// + /// + /// The configuration specifying how to enable HTTPS for the custom domain - + /// using CDN managed certificate or user's own certificate. If not specified, + /// enabling ssl uses CDN managed certificate by default. + /// + /// + /// The cancellation token. + /// + public static async Task BeginEnableCustomHttpsAsync(this ICustomDomainsOperations operations, string resourceGroupName, string profileName, string endpointName, string customDomainName, CustomDomainHttpsParameters customDomainHttpsParameters = default(CustomDomainHttpsParameters), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginEnableCustomHttpsWithHttpMessagesAsync(resourceGroupName, profileName, endpointName, customDomainName, customDomainHttpsParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Lists all of the existing custom domains within an endpoint. /// diff --git a/sdk/cdn/Microsoft.Azure.Management.Cdn/src/Generated/ICustomDomainsOperations.cs b/sdk/cdn/Microsoft.Azure.Management.Cdn/src/Generated/ICustomDomainsOperations.cs index ff7219ee7bcf..46d7e65c46dd 100644 --- a/sdk/cdn/Microsoft.Azure.Management.Cdn/src/Generated/ICustomDomainsOperations.cs +++ b/sdk/cdn/Microsoft.Azure.Management.Cdn/src/Generated/ICustomDomainsOperations.cs @@ -281,6 +281,74 @@ public partial interface ICustomDomainsOperations /// Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string profileName, string endpointName, string customDomainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Disable https delivery of the custom domain. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// Name of the CDN profile which is unique within the resource group. + /// + /// + /// Name of the endpoint under the profile which is unique globally. + /// + /// + /// Name of the custom domain within an endpoint. + /// + /// + /// 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> BeginDisableCustomHttpsWithHttpMessagesAsync(string resourceGroupName, string profileName, string endpointName, string customDomainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Enable https delivery of the custom domain. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// Name of the CDN profile which is unique within the resource group. + /// + /// + /// Name of the endpoint under the profile which is unique globally. + /// + /// + /// Name of the custom domain within an endpoint. + /// + /// + /// The configuration specifying how to enable HTTPS for the custom + /// domain - using CDN managed certificate or user's own certificate. + /// If not specified, enabling ssl uses CDN managed certificate by + /// default. + /// + /// + /// 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> BeginEnableCustomHttpsWithHttpMessagesAsync(string resourceGroupName, string profileName, string endpointName, string customDomainName, CustomDomainHttpsParameters customDomainHttpsParameters = default(CustomDomainHttpsParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Lists all of the existing custom domains within an endpoint. /// /// diff --git a/sdk/cdn/Microsoft.Azure.Management.Cdn/src/Generated/SdkInfo_CdnManagementClient.cs b/sdk/cdn/Microsoft.Azure.Management.Cdn/src/Generated/SdkInfo_CdnManagementClient.cs index e96d24543bb2..00cfa30c1dc5 100644 --- a/sdk/cdn/Microsoft.Azure.Management.Cdn/src/Generated/SdkInfo_CdnManagementClient.cs +++ b/sdk/cdn/Microsoft.Azure.Management.Cdn/src/Generated/SdkInfo_CdnManagementClient.cs @@ -47,16 +47,5 @@ public static IEnumerable> ApiInfo_CdnManagementCl }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cdn/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --tag=package-2020-09 --csharp-sdks-folder=D:\\github\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "2a6cde419916a42b032ab8298052ff31dce467d5"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } -