diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/AppPlatformManagementClient.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/AppPlatformManagementClient.cs index 45efe0c1cc27..57dbb115039b 100644 --- a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/AppPlatformManagementClient.cs +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/AppPlatformManagementClient.cs @@ -91,6 +91,16 @@ public partial class AppPlatformManagementClient : ServiceClient public virtual IBindingsOperations Bindings { get; private set; } + /// + /// Gets the ICertificatesOperations. + /// + public virtual ICertificatesOperations Certificates { get; private set; } + + /// + /// Gets the ICustomDomainsOperations. + /// + public virtual ICustomDomainsOperations CustomDomains { get; private set; } + /// /// Gets the IDeploymentsOperations. /// @@ -345,6 +355,8 @@ private void Initialize() Services = new ServicesOperations(this); Apps = new AppsOperations(this); Bindings = new BindingsOperations(this); + Certificates = new CertificatesOperations(this); + CustomDomains = new CustomDomainsOperations(this); Deployments = new DeploymentsOperations(this); Operations = new Operations(this); BaseUri = new System.Uri("https://management.azure.com"); diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/AppsOperations.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/AppsOperations.cs index df36895e2fe9..97d769fb7f05 100644 --- a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/AppsOperations.cs +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/AppsOperations.cs @@ -112,10 +112,10 @@ internal AppsOperations(AppPlatformManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("syncStatus", syncStatus); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceName", serviceName); tracingParameters.Add("appName", appName); + tracingParameters.Add("syncStatus", syncStatus); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -127,14 +127,14 @@ internal AppsOperations(AppPlatformManagementClient client) _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); _url = _url.Replace("{appName}", System.Uri.EscapeDataString(appName)); List _queryParameters = new List(); - if (syncStatus != null) - { - _queryParameters.Add(string.Format("syncStatus={0}", System.Uri.EscapeDataString(syncStatus))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } + if (syncStatus != null) + { + _queryParameters.Add(string.Format("syncStatus={0}", System.Uri.EscapeDataString(syncStatus))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -282,7 +282,7 @@ internal AppsOperations(AppPlatformManagementClient client) /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, AppResource appResource = default(AppResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, AppResource appResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, appName, appResource, customHeaders, cancellationToken).ConfigureAwait(false); @@ -492,7 +492,7 @@ internal AppsOperations(AppPlatformManagementClient client) /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, AppResource appResource = default(AppResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, AppResource appResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, appName, appResource, customHeaders, cancellationToken).ConfigureAwait(false); @@ -932,12 +932,8 @@ internal AppsOperations(AppPlatformManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, AppResource appResource = default(AppResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, AppResource appResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (appResource != null) - { - appResource.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -954,6 +950,14 @@ internal AppsOperations(AppPlatformManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "appName"); } + if (appResource == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "appResource"); + } + if (appResource != null) + { + appResource.Validate(); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -961,10 +965,10 @@ internal AppsOperations(AppPlatformManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("appResource", appResource); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceName", serviceName); tracingParameters.Add("appName", appName); + tracingParameters.Add("appResource", appResource); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } @@ -1166,7 +1170,7 @@ internal AppsOperations(AppPlatformManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, AppResource appResource = default(AppResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, AppResource appResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -1184,6 +1188,10 @@ internal AppsOperations(AppPlatformManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "appName"); } + if (appResource == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "appResource"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1191,10 +1199,10 @@ internal AppsOperations(AppPlatformManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("appResource", appResource); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceName", serviceName); tracingParameters.Add("appName", appName); + tracingParameters.Add("appResource", appResource); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/AppsOperationsExtensions.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/AppsOperationsExtensions.cs index 52c356b2e138..bc06f0ce657c 100644 --- a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/AppsOperationsExtensions.cs +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/AppsOperationsExtensions.cs @@ -94,7 +94,7 @@ public static partial class AppsOperationsExtensions /// /// Parameters for the create or update operation /// - public static AppResource CreateOrUpdate(this IAppsOperations operations, string resourceGroupName, string serviceName, string appName, AppResource appResource = default(AppResource)) + public static AppResource CreateOrUpdate(this IAppsOperations operations, string resourceGroupName, string serviceName, string appName, AppResource appResource) { return operations.CreateOrUpdateAsync(resourceGroupName, serviceName, appName, appResource).GetAwaiter().GetResult(); } @@ -121,7 +121,7 @@ public static partial class AppsOperationsExtensions /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IAppsOperations operations, string resourceGroupName, string serviceName, string appName, AppResource appResource = default(AppResource), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IAppsOperations operations, string resourceGroupName, string serviceName, string appName, AppResource appResource, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, appName, appResource, null, cancellationToken).ConfigureAwait(false)) { @@ -193,7 +193,7 @@ public static void Delete(this IAppsOperations operations, string resourceGroupN /// /// Parameters for the update operation /// - public static AppResource Update(this IAppsOperations operations, string resourceGroupName, string serviceName, string appName, AppResource appResource = default(AppResource)) + public static AppResource Update(this IAppsOperations operations, string resourceGroupName, string serviceName, string appName, AppResource appResource) { return operations.UpdateAsync(resourceGroupName, serviceName, appName, appResource).GetAwaiter().GetResult(); } @@ -220,7 +220,7 @@ public static void Delete(this IAppsOperations operations, string resourceGroupN /// /// The cancellation token. /// - public static async Task UpdateAsync(this IAppsOperations operations, string resourceGroupName, string serviceName, string appName, AppResource appResource = default(AppResource), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAsync(this IAppsOperations operations, string resourceGroupName, string serviceName, string appName, AppResource appResource, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serviceName, appName, appResource, null, cancellationToken).ConfigureAwait(false)) { @@ -339,7 +339,7 @@ public static ResourceUploadDefinition GetResourceUploadUrl(this IAppsOperations /// /// Parameters for the create or update operation /// - public static AppResource BeginCreateOrUpdate(this IAppsOperations operations, string resourceGroupName, string serviceName, string appName, AppResource appResource = default(AppResource)) + public static AppResource BeginCreateOrUpdate(this IAppsOperations operations, string resourceGroupName, string serviceName, string appName, AppResource appResource) { return operations.BeginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, appResource).GetAwaiter().GetResult(); } @@ -366,7 +366,7 @@ public static ResourceUploadDefinition GetResourceUploadUrl(this IAppsOperations /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this IAppsOperations operations, string resourceGroupName, string serviceName, string appName, AppResource appResource = default(AppResource), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this IAppsOperations operations, string resourceGroupName, string serviceName, string appName, AppResource appResource, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, appName, appResource, null, cancellationToken).ConfigureAwait(false)) { @@ -393,7 +393,7 @@ public static ResourceUploadDefinition GetResourceUploadUrl(this IAppsOperations /// /// Parameters for the update operation /// - public static AppResource BeginUpdate(this IAppsOperations operations, string resourceGroupName, string serviceName, string appName, AppResource appResource = default(AppResource)) + public static AppResource BeginUpdate(this IAppsOperations operations, string resourceGroupName, string serviceName, string appName, AppResource appResource) { return operations.BeginUpdateAsync(resourceGroupName, serviceName, appName, appResource).GetAwaiter().GetResult(); } @@ -420,7 +420,7 @@ public static ResourceUploadDefinition GetResourceUploadUrl(this IAppsOperations /// /// The cancellation token. /// - public static async Task BeginUpdateAsync(this IAppsOperations operations, string resourceGroupName, string serviceName, string appName, AppResource appResource = default(AppResource), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginUpdateAsync(this IAppsOperations operations, string resourceGroupName, string serviceName, string appName, AppResource appResource, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, appName, appResource, null, cancellationToken).ConfigureAwait(false)) { diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/BindingsOperations.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/BindingsOperations.cs index 384581af1fee..1c433b41c8b4 100644 --- a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/BindingsOperations.cs +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/BindingsOperations.cs @@ -301,7 +301,7 @@ internal BindingsOperations(AppPlatformManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string bindingName, BindingResource bindingResource = default(BindingResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string bindingName, BindingResource bindingResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -323,6 +323,10 @@ internal BindingsOperations(AppPlatformManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "bindingName"); } + if (bindingResource == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "bindingResource"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -330,11 +334,11 @@ internal BindingsOperations(AppPlatformManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("bindingResource", bindingResource); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceName", serviceName); tracingParameters.Add("appName", appName); tracingParameters.Add("bindingName", bindingName); + tracingParameters.Add("bindingResource", bindingResource); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } @@ -712,7 +716,7 @@ internal BindingsOperations(AppPlatformManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string bindingName, BindingResource bindingResource = default(BindingResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string bindingName, BindingResource bindingResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -734,6 +738,10 @@ internal BindingsOperations(AppPlatformManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "bindingName"); } + if (bindingResource == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "bindingResource"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -741,11 +749,11 @@ internal BindingsOperations(AppPlatformManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("bindingResource", bindingResource); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceName", serviceName); tracingParameters.Add("appName", appName); tracingParameters.Add("bindingName", bindingName); + tracingParameters.Add("bindingResource", bindingResource); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/BindingsOperationsExtensions.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/BindingsOperationsExtensions.cs index b142c94ba3d1..94c75bd32e0e 100644 --- a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/BindingsOperationsExtensions.cs +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/BindingsOperationsExtensions.cs @@ -97,7 +97,7 @@ public static BindingResource Get(this IBindingsOperations operations, string re /// /// Parameters for the create or update operation /// - public static BindingResource CreateOrUpdate(this IBindingsOperations operations, string resourceGroupName, string serviceName, string appName, string bindingName, BindingResource bindingResource = default(BindingResource)) + public static BindingResource CreateOrUpdate(this IBindingsOperations operations, string resourceGroupName, string serviceName, string appName, string bindingName, BindingResource bindingResource) { return operations.CreateOrUpdateAsync(resourceGroupName, serviceName, appName, bindingName, bindingResource).GetAwaiter().GetResult(); } @@ -127,7 +127,7 @@ public static BindingResource Get(this IBindingsOperations operations, string re /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IBindingsOperations operations, string resourceGroupName, string serviceName, string appName, string bindingName, BindingResource bindingResource = default(BindingResource), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IBindingsOperations operations, string resourceGroupName, string serviceName, string appName, string bindingName, BindingResource bindingResource, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, appName, bindingName, bindingResource, null, cancellationToken).ConfigureAwait(false)) { @@ -208,7 +208,7 @@ public static void Delete(this IBindingsOperations operations, string resourceGr /// /// Parameters for the update operation /// - public static BindingResource Update(this IBindingsOperations operations, string resourceGroupName, string serviceName, string appName, string bindingName, BindingResource bindingResource = default(BindingResource)) + public static BindingResource Update(this IBindingsOperations operations, string resourceGroupName, string serviceName, string appName, string bindingName, BindingResource bindingResource) { return operations.UpdateAsync(resourceGroupName, serviceName, appName, bindingName, bindingResource).GetAwaiter().GetResult(); } @@ -238,7 +238,7 @@ public static void Delete(this IBindingsOperations operations, string resourceGr /// /// The cancellation token. /// - public static async Task UpdateAsync(this IBindingsOperations operations, string resourceGroupName, string serviceName, string appName, string bindingName, BindingResource bindingResource = default(BindingResource), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAsync(this IBindingsOperations operations, string resourceGroupName, string serviceName, string appName, string bindingName, BindingResource bindingResource, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serviceName, appName, bindingName, bindingResource, null, cancellationToken).ConfigureAwait(false)) { diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/CertificatesOperations.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/CertificatesOperations.cs new file mode 100644 index 000000000000..ead5a0107458 --- /dev/null +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/CertificatesOperations.cs @@ -0,0 +1,1023 @@ +// +// 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.AppPlatform +{ + 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; + + /// + /// CertificatesOperations operations. + /// + internal partial class CertificatesOperations : IServiceOperations, ICertificatesOperations + { + /// + /// Initializes a new instance of the CertificatesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal CertificatesOperations(AppPlatformManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AppPlatformManagementClient + /// + public AppPlatformManagementClient Client { get; private set; } + + /// + /// Get the certificate resource. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the certificate resource. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serviceName, string certificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + } + if (certificateName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "certificateName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("certificateName", certificateName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); + _url = _url.Replace("{certificateName}", System.Uri.EscapeDataString(certificateName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new 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; + } + + /// + /// Create or update certificate resource. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the certificate resource. + /// + /// + /// Parameters for the create or update operation + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string certificateName, CertificateResource certificateResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + } + if (certificateName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "certificateName"); + } + if (certificateResource == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "certificateResource"); + } + if (certificateResource != null) + { + certificateResource.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("certificateName", certificateName); + tracingParameters.Add("certificateResource", certificateResource); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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.AppPlatform/Spring/{serviceName}/certificates/{certificateName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); + _url = _url.Replace("{certificateName}", System.Uri.EscapeDataString(certificateName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(certificateResource != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(certificateResource, 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; + } + + /// + /// Delete the certificate resource. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the certificate resource. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceName, string certificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + } + if (certificateName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "certificateName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("certificateName", certificateName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); + _url = _url.Replace("{certificateName}", System.Uri.EscapeDataString(certificateName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) + { + var ex = new 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List all the certificates of one user. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string serviceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new 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; + } + + /// + /// List all the certificates of one user. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new 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/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/CertificatesOperationsExtensions.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/CertificatesOperationsExtensions.cs new file mode 100644 index 000000000000..a895ad18dd96 --- /dev/null +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/CertificatesOperationsExtensions.cs @@ -0,0 +1,248 @@ +// +// 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.AppPlatform +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for CertificatesOperations. + /// + public static partial class CertificatesOperationsExtensions + { + /// + /// Get the certificate resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the certificate resource. + /// + public static CertificateResource Get(this ICertificatesOperations operations, string resourceGroupName, string serviceName, string certificateName) + { + return operations.GetAsync(resourceGroupName, serviceName, certificateName).GetAwaiter().GetResult(); + } + + /// + /// Get the certificate resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the certificate resource. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ICertificatesOperations operations, string resourceGroupName, string serviceName, string certificateName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serviceName, certificateName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or update certificate resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the certificate resource. + /// + /// + /// Parameters for the create or update operation + /// + public static CertificateResource CreateOrUpdate(this ICertificatesOperations operations, string resourceGroupName, string serviceName, string certificateName, CertificateResource certificateResource) + { + return operations.CreateOrUpdateAsync(resourceGroupName, serviceName, certificateName, certificateResource).GetAwaiter().GetResult(); + } + + /// + /// Create or update certificate resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the certificate resource. + /// + /// + /// Parameters for the create or update operation + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this ICertificatesOperations operations, string resourceGroupName, string serviceName, string certificateName, CertificateResource certificateResource, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, certificateName, certificateResource, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete the certificate resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the certificate resource. + /// + public static void Delete(this ICertificatesOperations operations, string resourceGroupName, string serviceName, string certificateName) + { + operations.DeleteAsync(resourceGroupName, serviceName, certificateName).GetAwaiter().GetResult(); + } + + /// + /// Delete the certificate resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the certificate resource. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ICertificatesOperations operations, string resourceGroupName, string serviceName, string certificateName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serviceName, certificateName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// List all the certificates of one user. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + public static IPage List(this ICertificatesOperations operations, string resourceGroupName, string serviceName) + { + return operations.ListAsync(resourceGroupName, serviceName).GetAwaiter().GetResult(); + } + + /// + /// List all the certificates of one user. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this ICertificatesOperations operations, string resourceGroupName, string serviceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, serviceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List all the certificates of one user. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this ICertificatesOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List all the certificates of one user. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this ICertificatesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/CustomDomainsOperations.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/CustomDomainsOperations.cs new file mode 100644 index 000000000000..681342baafb4 --- /dev/null +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/CustomDomainsOperations.cs @@ -0,0 +1,1499 @@ +// +// 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.AppPlatform +{ + 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; + + /// + /// CustomDomainsOperations operations. + /// + internal partial class CustomDomainsOperations : IServiceOperations, ICustomDomainsOperations + { + /// + /// Initializes a new instance of the CustomDomainsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal CustomDomainsOperations(AppPlatformManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AppPlatformManagementClient + /// + public AppPlatformManagementClient Client { get; private set; } + + /// + /// Get the custom domain of one lifecycle application. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the App resource. + /// + /// + /// The name of the custom domain resource. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + } + if (appName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "appName"); + } + if (domainName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("appName", appName); + tracingParameters.Add("domainName", domainName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); + _url = _url.Replace("{appName}", System.Uri.EscapeDataString(appName)); + _url = _url.Replace("{domainName}", System.Uri.EscapeDataString(domainName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new 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; + } + + /// + /// Create or update custom domain of one lifecycle application. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the App resource. + /// + /// + /// The name of the custom domain resource. + /// + /// + /// Parameters for the create or update operation + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string domainName, CustomDomainResource domainResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + } + if (appName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "appName"); + } + if (domainName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainName"); + } + if (domainResource == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainResource"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("appName", appName); + tracingParameters.Add("domainName", domainName); + tracingParameters.Add("domainResource", domainResource); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); + _url = _url.Replace("{appName}", System.Uri.EscapeDataString(appName)); + _url = _url.Replace("{domainName}", System.Uri.EscapeDataString(domainName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(domainResource != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(domainResource, 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; + } + + /// + /// Delete the custom domain of one lifecycle application. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the App resource. + /// + /// + /// The name of the custom domain resource. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + } + if (appName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "appName"); + } + if (domainName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("appName", appName); + tracingParameters.Add("domainName", domainName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); + _url = _url.Replace("{appName}", System.Uri.EscapeDataString(appName)); + _url = _url.Replace("{domainName}", System.Uri.EscapeDataString(domainName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) + { + var ex = new 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Update custom domain of one lifecycle application. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the App resource. + /// + /// + /// The name of the custom domain resource. + /// + /// + /// Parameters for the create or update operation + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> PatchWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string domainName, CustomDomainResource domainResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + } + if (appName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "appName"); + } + if (domainName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainName"); + } + if (domainResource == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainResource"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("appName", appName); + tracingParameters.Add("domainName", domainName); + tracingParameters.Add("domainResource", domainResource); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Patch", 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.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); + _url = _url.Replace("{appName}", System.Uri.EscapeDataString(appName)); + _url = _url.Replace("{domainName}", System.Uri.EscapeDataString(domainName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(domainResource != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(domainResource, 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; + } + + /// + /// List the custom domains of one lifecycle application. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the App resource. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + } + if (appName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "appName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("appName", appName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); + _url = _url.Replace("{appName}", System.Uri.EscapeDataString(appName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new 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; + } + + /// + /// Check the resource name is valid as well as not in use. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the App 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> ValidateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, CustomDomainValidatePayload validatePayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + } + if (appName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "appName"); + } + if (validatePayload == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "validatePayload"); + } + if (validatePayload != null) + { + validatePayload.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("appName", appName); + tracingParameters.Add("validatePayload", validatePayload); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Validate", 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.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/validate").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); + _url = _url.Replace("{appName}", System.Uri.EscapeDataString(appName)); + 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(validatePayload != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(validatePayload, 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; + } + + /// + /// List the custom domains of one lifecycle application. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new 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/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/CustomDomainsOperationsExtensions.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/CustomDomainsOperationsExtensions.cs new file mode 100644 index 000000000000..54245e22370b --- /dev/null +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/CustomDomainsOperationsExtensions.cs @@ -0,0 +1,384 @@ +// +// 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.AppPlatform +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for CustomDomainsOperations. + /// + public static partial class CustomDomainsOperationsExtensions + { + /// + /// Get the custom domain of one lifecycle application. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the App resource. + /// + /// + /// The name of the custom domain resource. + /// + public static CustomDomainResource Get(this ICustomDomainsOperations operations, string resourceGroupName, string serviceName, string appName, string domainName) + { + return operations.GetAsync(resourceGroupName, serviceName, appName, domainName).GetAwaiter().GetResult(); + } + + /// + /// Get the custom domain of one lifecycle application. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the App resource. + /// + /// + /// The name of the custom domain resource. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ICustomDomainsOperations operations, string resourceGroupName, string serviceName, string appName, string domainName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serviceName, appName, domainName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or update custom domain of one lifecycle application. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the App resource. + /// + /// + /// The name of the custom domain resource. + /// + /// + /// Parameters for the create or update operation + /// + public static CustomDomainResource CreateOrUpdate(this ICustomDomainsOperations operations, string resourceGroupName, string serviceName, string appName, string domainName, CustomDomainResource domainResource) + { + return operations.CreateOrUpdateAsync(resourceGroupName, serviceName, appName, domainName, domainResource).GetAwaiter().GetResult(); + } + + /// + /// Create or update custom domain of one lifecycle application. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the App resource. + /// + /// + /// The name of the custom domain resource. + /// + /// + /// Parameters for the create or update operation + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this ICustomDomainsOperations operations, string resourceGroupName, string serviceName, string appName, string domainName, CustomDomainResource domainResource, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, appName, domainName, domainResource, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete the custom domain of one lifecycle application. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the App resource. + /// + /// + /// The name of the custom domain resource. + /// + public static void Delete(this ICustomDomainsOperations operations, string resourceGroupName, string serviceName, string appName, string domainName) + { + operations.DeleteAsync(resourceGroupName, serviceName, appName, domainName).GetAwaiter().GetResult(); + } + + /// + /// Delete the custom domain of one lifecycle application. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the App resource. + /// + /// + /// The name of the custom domain resource. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ICustomDomainsOperations operations, string resourceGroupName, string serviceName, string appName, string domainName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serviceName, appName, domainName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Update custom domain of one lifecycle application. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the App resource. + /// + /// + /// The name of the custom domain resource. + /// + /// + /// Parameters for the create or update operation + /// + public static CustomDomainResource Patch(this ICustomDomainsOperations operations, string resourceGroupName, string serviceName, string appName, string domainName, CustomDomainResource domainResource) + { + return operations.PatchAsync(resourceGroupName, serviceName, appName, domainName, domainResource).GetAwaiter().GetResult(); + } + + /// + /// Update custom domain of one lifecycle application. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the App resource. + /// + /// + /// The name of the custom domain resource. + /// + /// + /// Parameters for the create or update operation + /// + /// + /// The cancellation token. + /// + public static async Task PatchAsync(this ICustomDomainsOperations operations, string resourceGroupName, string serviceName, string appName, string domainName, CustomDomainResource domainResource, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PatchWithHttpMessagesAsync(resourceGroupName, serviceName, appName, domainName, domainResource, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List the custom domains of one lifecycle application. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the App resource. + /// + public static IPage List(this ICustomDomainsOperations operations, string resourceGroupName, string serviceName, string appName) + { + return operations.ListAsync(resourceGroupName, serviceName, appName).GetAwaiter().GetResult(); + } + + /// + /// List the custom domains of one lifecycle application. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the App resource. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this ICustomDomainsOperations operations, string resourceGroupName, string serviceName, string appName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, serviceName, appName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Check the resource name is valid as well as not in use. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the App resource. + /// + /// + /// + public static CustomDomainValidateResult Validate(this ICustomDomainsOperations operations, string resourceGroupName, string serviceName, string appName, CustomDomainValidatePayload validatePayload) + { + return operations.ValidateAsync(resourceGroupName, serviceName, appName, validatePayload).GetAwaiter().GetResult(); + } + + /// + /// Check the resource name is valid as well as not in use. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the App resource. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task ValidateAsync(this ICustomDomainsOperations operations, string resourceGroupName, string serviceName, string appName, CustomDomainValidatePayload validatePayload, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ValidateWithHttpMessagesAsync(resourceGroupName, serviceName, appName, validatePayload, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List the custom domains of one lifecycle application. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this ICustomDomainsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List the custom domains of one lifecycle application. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this ICustomDomainsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/DeploymentsOperations.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/DeploymentsOperations.cs index ddea91a1e7e7..db8af90a0616 100644 --- a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/DeploymentsOperations.cs +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/DeploymentsOperations.cs @@ -286,7 +286,7 @@ internal DeploymentsOperations(AppPlatformManagementClient client) /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource = default(DeploymentResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource, customHeaders, cancellationToken).ConfigureAwait(false); @@ -508,7 +508,7 @@ internal DeploymentsOperations(AppPlatformManagementClient client) /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource = default(DeploymentResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource, customHeaders, cancellationToken).ConfigureAwait(false); @@ -577,10 +577,10 @@ internal DeploymentsOperations(AppPlatformManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("version", version); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceName", serviceName); tracingParameters.Add("appName", appName); + tracingParameters.Add("version", version); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -592,6 +592,10 @@ internal DeploymentsOperations(AppPlatformManagementClient client) _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); _url = _url.Replace("{appName}", System.Uri.EscapeDataString(appName)); List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } if (version != null) { if (version.Count == 0) @@ -606,10 +610,6 @@ internal DeploymentsOperations(AppPlatformManagementClient client) } } } - 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); @@ -790,9 +790,9 @@ internal DeploymentsOperations(AppPlatformManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("version", version); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("version", version); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListClusterAllDeployments", tracingParameters); } @@ -803,6 +803,10 @@ internal DeploymentsOperations(AppPlatformManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } if (version != null) { if (version.Count == 0) @@ -817,10 +821,6 @@ internal DeploymentsOperations(AppPlatformManagementClient client) } } } - 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); @@ -1284,12 +1284,8 @@ internal DeploymentsOperations(AppPlatformManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource = default(DeploymentResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (deploymentResource != null) - { - deploymentResource.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1310,6 +1306,14 @@ internal DeploymentsOperations(AppPlatformManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "deploymentName"); } + if (deploymentResource == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deploymentResource"); + } + if (deploymentResource != null) + { + deploymentResource.Validate(); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1317,11 +1321,11 @@ internal DeploymentsOperations(AppPlatformManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("deploymentResource", deploymentResource); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceName", serviceName); tracingParameters.Add("appName", appName); tracingParameters.Add("deploymentName", deploymentName); + tracingParameters.Add("deploymentResource", deploymentResource); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } @@ -1527,7 +1531,7 @@ internal DeploymentsOperations(AppPlatformManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource = default(DeploymentResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -1549,6 +1553,10 @@ internal DeploymentsOperations(AppPlatformManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "deploymentName"); } + if (deploymentResource == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deploymentResource"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1556,11 +1564,11 @@ internal DeploymentsOperations(AppPlatformManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("deploymentResource", deploymentResource); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceName", serviceName); tracingParameters.Add("appName", appName); tracingParameters.Add("deploymentName", deploymentName); + tracingParameters.Add("deploymentResource", deploymentResource); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/DeploymentsOperationsExtensions.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/DeploymentsOperationsExtensions.cs index ccc13f39adb3..d7be46cfce75 100644 --- a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/DeploymentsOperationsExtensions.cs +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/DeploymentsOperationsExtensions.cs @@ -99,7 +99,7 @@ public static DeploymentResource Get(this IDeploymentsOperations operations, str /// /// Parameters for the create or update operation /// - public static DeploymentResource CreateOrUpdate(this IDeploymentsOperations operations, string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource = default(DeploymentResource)) + public static DeploymentResource CreateOrUpdate(this IDeploymentsOperations operations, string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource) { return operations.CreateOrUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource).GetAwaiter().GetResult(); } @@ -129,7 +129,7 @@ public static DeploymentResource Get(this IDeploymentsOperations operations, str /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IDeploymentsOperations operations, string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource = default(DeploymentResource), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IDeploymentsOperations operations, string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource, null, cancellationToken).ConfigureAwait(false)) { @@ -210,7 +210,7 @@ public static void Delete(this IDeploymentsOperations operations, string resourc /// /// Parameters for the update operation /// - public static DeploymentResource Update(this IDeploymentsOperations operations, string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource = default(DeploymentResource)) + public static DeploymentResource Update(this IDeploymentsOperations operations, string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource) { return operations.UpdateAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource).GetAwaiter().GetResult(); } @@ -240,7 +240,7 @@ public static void Delete(this IDeploymentsOperations operations, string resourc /// /// The cancellation token. /// - public static async Task UpdateAsync(this IDeploymentsOperations operations, string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource = default(DeploymentResource), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAsync(this IDeploymentsOperations operations, string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource, null, cancellationToken).ConfigureAwait(false)) { @@ -579,7 +579,7 @@ public static LogFileUrlResponse GetLogFileUrl(this IDeploymentsOperations opera /// /// Parameters for the create or update operation /// - public static DeploymentResource BeginCreateOrUpdate(this IDeploymentsOperations operations, string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource = default(DeploymentResource)) + public static DeploymentResource BeginCreateOrUpdate(this IDeploymentsOperations operations, string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource) { return operations.BeginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource).GetAwaiter().GetResult(); } @@ -609,7 +609,7 @@ public static LogFileUrlResponse GetLogFileUrl(this IDeploymentsOperations opera /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this IDeploymentsOperations operations, string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource = default(DeploymentResource), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this IDeploymentsOperations operations, string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource, null, cancellationToken).ConfigureAwait(false)) { @@ -639,7 +639,7 @@ public static LogFileUrlResponse GetLogFileUrl(this IDeploymentsOperations opera /// /// Parameters for the update operation /// - public static DeploymentResource BeginUpdate(this IDeploymentsOperations operations, string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource = default(DeploymentResource)) + public static DeploymentResource BeginUpdate(this IDeploymentsOperations operations, string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource) { return operations.BeginUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource).GetAwaiter().GetResult(); } @@ -669,7 +669,7 @@ public static LogFileUrlResponse GetLogFileUrl(this IDeploymentsOperations opera /// /// The cancellation token. /// - public static async Task BeginUpdateAsync(this IDeploymentsOperations operations, string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource = default(DeploymentResource), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginUpdateAsync(this IDeploymentsOperations operations, string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource, null, cancellationToken).ConfigureAwait(false)) { diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IAppPlatformManagementClient.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IAppPlatformManagementClient.cs index 2f2ac51bed1c..fab6fd3ee461 100644 --- a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IAppPlatformManagementClient.cs +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IAppPlatformManagementClient.cs @@ -86,6 +86,16 @@ public partial interface IAppPlatformManagementClient : System.IDisposable /// IBindingsOperations Bindings { get; } + /// + /// Gets the ICertificatesOperations. + /// + ICertificatesOperations Certificates { get; } + + /// + /// Gets the ICustomDomainsOperations. + /// + ICustomDomainsOperations CustomDomains { get; } + /// /// Gets the IDeploymentsOperations. /// diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IAppsOperations.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IAppsOperations.cs index 94d306ba27ba..9d0b2a18dd50 100644 --- a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IAppsOperations.cs +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IAppsOperations.cs @@ -88,7 +88,7 @@ public partial interface IAppsOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, AppResource appResource = default(AppResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, AppResource appResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Operation to delete an App. /// @@ -148,7 +148,7 @@ public partial interface IAppsOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, AppResource appResource = default(AppResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, AppResource appResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Handles requests to list all resources in a Service. /// @@ -239,7 +239,7 @@ public partial interface IAppsOperations /// /// Thrown when a required parameter is null /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, AppResource appResource = default(AppResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, AppResource appResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Operation to update an exiting App. /// @@ -272,7 +272,7 @@ public partial interface IAppsOperations /// /// Thrown when a required parameter is null /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, AppResource appResource = default(AppResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, AppResource appResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Handles requests to list all resources in a Service. /// diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IBindingsOperations.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IBindingsOperations.cs index 004a05161abc..116be486591e 100644 --- a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IBindingsOperations.cs +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IBindingsOperations.cs @@ -91,7 +91,7 @@ public partial interface IBindingsOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string bindingName, BindingResource bindingResource = default(BindingResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string bindingName, BindingResource bindingResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Operation to delete a Binding. /// @@ -157,7 +157,7 @@ public partial interface IBindingsOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string bindingName, BindingResource bindingResource = default(BindingResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string bindingName, BindingResource bindingResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Handles requests to list all resources in an App. /// diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/ICertificatesOperations.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/ICertificatesOperations.cs new file mode 100644 index 000000000000..719f9af1e429 --- /dev/null +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/ICertificatesOperations.cs @@ -0,0 +1,166 @@ +// +// 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.AppPlatform +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// CertificatesOperations operations. + /// + public partial interface ICertificatesOperations + { + /// + /// Get the certificate resource. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the certificate resource. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string serviceName, string certificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or update certificate resource. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the certificate resource. + /// + /// + /// Parameters for the create or update operation + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string certificateName, CertificateResource certificateResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete the certificate resource. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the certificate resource. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceName, string certificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List all the certificates of one user. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string serviceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List all the certificates of one user. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/ICustomDomainsOperations.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/ICustomDomainsOperations.cs new file mode 100644 index 000000000000..6834091f29a4 --- /dev/null +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/ICustomDomainsOperations.cs @@ -0,0 +1,246 @@ +// +// 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.AppPlatform +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// CustomDomainsOperations operations. + /// + public partial interface ICustomDomainsOperations + { + /// + /// Get the custom domain of one lifecycle application. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the App resource. + /// + /// + /// The name of the custom domain resource. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or update custom domain of one lifecycle application. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the App resource. + /// + /// + /// The name of the custom domain resource. + /// + /// + /// Parameters for the create or update operation + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string domainName, CustomDomainResource domainResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete the custom domain of one lifecycle application. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the App resource. + /// + /// + /// The name of the custom domain resource. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update custom domain of one lifecycle application. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the App resource. + /// + /// + /// The name of the custom domain resource. + /// + /// + /// Parameters for the create or update operation + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> PatchWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string domainName, CustomDomainResource domainResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List the custom domains of one lifecycle application. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the App resource. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Check the resource name is valid as well as not in use. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// The name of the App 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> ValidateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, CustomDomainValidatePayload validatePayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List the custom domains of one lifecycle application. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IDeploymentsOperations.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IDeploymentsOperations.cs index cff4e12aa866..e0d31759571e 100644 --- a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IDeploymentsOperations.cs +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IDeploymentsOperations.cs @@ -91,7 +91,7 @@ public partial interface IDeploymentsOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource = default(DeploymentResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Operation to delete a Deployment. /// @@ -157,7 +157,7 @@ public partial interface IDeploymentsOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource = default(DeploymentResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Handles requests to list all resources in an App. /// @@ -379,7 +379,7 @@ public partial interface IDeploymentsOperations /// /// Thrown when a required parameter is null /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource = default(DeploymentResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Operation to update an exiting Deployment. /// @@ -415,7 +415,7 @@ public partial interface IDeploymentsOperations /// /// Thrown when a required parameter is null /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource = default(DeploymentResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string appName, string deploymentName, DeploymentResource deploymentResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Start the deployment. /// diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IServicesOperations.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IServicesOperations.cs index 7a423182f725..bd9787908f67 100644 --- a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IServicesOperations.cs +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IServicesOperations.cs @@ -79,7 +79,7 @@ public partial interface IServicesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, ServiceResource resource = default(ServiceResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, ServiceResource resource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Operation to delete a Service. /// @@ -133,7 +133,7 @@ public partial interface IServicesOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, ServiceResource resource = default(ServiceResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, ServiceResource resource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// List test keys for a Service. /// @@ -190,7 +190,7 @@ public partial interface IServicesOperations /// /// Thrown when a required parameter is null /// - Task> RegenerateTestKeyWithHttpMessagesAsync(string resourceGroupName, string serviceName, RegenerateTestKeyRequestPayload regenerateTestKeyRequest = default(RegenerateTestKeyRequestPayload), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> RegenerateTestKeyWithHttpMessagesAsync(string resourceGroupName, string serviceName, RegenerateTestKeyRequestPayload regenerateTestKeyRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// The name of the resource group that contains the resource. You can /// obtain this value from the Azure Resource Manager API or the @@ -333,7 +333,7 @@ public partial interface IServicesOperations /// /// Thrown when a required parameter is null /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, ServiceResource resource = default(ServiceResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, ServiceResource resource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Operation to delete a Service. /// @@ -387,7 +387,7 @@ public partial interface IServicesOperations /// /// Thrown when a required parameter is null /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, ServiceResource resource = default(ServiceResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, ServiceResource resource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Handles requests to list all resources in a subscription. /// diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/AppResource.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/AppResource.cs index 7de0ba73bd8c..420e170bb3dd 100644 --- a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/AppResource.cs +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/AppResource.cs @@ -34,10 +34,13 @@ public AppResource() /// The name of the resource. /// The type of the resource. /// Properties of the App resource - public AppResource(string id = default(string), string name = default(string), string type = default(string), AppResourceProperties properties = default(AppResourceProperties)) + /// The GEO location of the application, always + /// the same with its parent resource + public AppResource(string id = default(string), string name = default(string), string type = default(string), AppResourceProperties properties = default(AppResourceProperties), string location = default(string)) : base(id, name, type) { Properties = properties; + Location = location; CustomInit(); } @@ -52,6 +55,13 @@ public AppResource() [JsonProperty(PropertyName = "properties")] public AppResourceProperties Properties { get; set; } + /// + /// Gets or sets the GEO location of the application, always the same + /// with its parent resource + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + /// /// Validate the object. /// diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/AppResourceProperties.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/AppResourceProperties.cs index 8d0164d84661..269c2197b706 100644 --- a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/AppResourceProperties.cs +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/AppResourceProperties.cs @@ -37,16 +37,20 @@ public AppResourceProperties() /// 'Updating' /// Name of the active deployment of /// the App + /// Fully qualified dns Name. + /// Indicate if only https is allowed. /// Date time when the resource is /// created /// Temporary disk settings /// Persistent disk settings - public AppResourceProperties(bool? publicProperty = default(bool?), string url = default(string), string provisioningState = default(string), string activeDeploymentName = default(string), System.DateTime? createdTime = default(System.DateTime?), TemporaryDisk temporaryDisk = default(TemporaryDisk), PersistentDisk persistentDisk = default(PersistentDisk)) + public AppResourceProperties(bool? publicProperty = default(bool?), string url = default(string), string provisioningState = default(string), string activeDeploymentName = default(string), string fqdn = default(string), bool? httpsOnly = default(bool?), System.DateTime? createdTime = default(System.DateTime?), TemporaryDisk temporaryDisk = default(TemporaryDisk), PersistentDisk persistentDisk = default(PersistentDisk)) { PublicProperty = publicProperty; Url = url; ProvisioningState = provisioningState; ActiveDeploymentName = activeDeploymentName; + Fqdn = fqdn; + HttpsOnly = httpsOnly; CreatedTime = createdTime; TemporaryDisk = temporaryDisk; PersistentDisk = persistentDisk; @@ -83,6 +87,18 @@ public AppResourceProperties() [JsonProperty(PropertyName = "activeDeploymentName")] public string ActiveDeploymentName { get; set; } + /// + /// Gets or sets fully qualified dns Name. + /// + [JsonProperty(PropertyName = "fqdn")] + public string Fqdn { get; set; } + + /// + /// Gets or sets indicate if only https is allowed. + /// + [JsonProperty(PropertyName = "httpsOnly")] + public bool? HttpsOnly { get; set; } + /// /// Gets date time when the resource is created /// diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/CertificateProperties.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/CertificateProperties.cs new file mode 100644 index 000000000000..1c329b618576 --- /dev/null +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/CertificateProperties.cs @@ -0,0 +1,147 @@ +// +// 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.AppPlatform.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Certificate resource payload. + /// + public partial class CertificateProperties + { + /// + /// Initializes a new instance of the CertificateProperties class. + /// + public CertificateProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CertificateProperties class. + /// + /// The vault uri of user key vault. + /// The certificate name of key + /// vault. + /// The thumbprint of certificate. + /// The certificate version of key + /// vault. + /// The issuer of certificate. + /// The issue date of certificate. + /// The expiration date of + /// certificate. + /// The activate date of + /// certificate. + /// The subject name of certificate. + /// The domain list of certificate. + public CertificateProperties(string vaultUri, string keyVaultCertName, string thumbprint = default(string), string certVersion = default(string), string issuer = default(string), string issuedDate = default(string), string expirationDate = default(string), string activateDate = default(string), string subjectName = default(string), IList dnsNames = default(IList)) + { + Thumbprint = thumbprint; + VaultUri = vaultUri; + KeyVaultCertName = keyVaultCertName; + CertVersion = certVersion; + Issuer = issuer; + IssuedDate = issuedDate; + ExpirationDate = expirationDate; + ActivateDate = activateDate; + SubjectName = subjectName; + DnsNames = dnsNames; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the thumbprint of certificate. + /// + [JsonProperty(PropertyName = "thumbprint")] + public string Thumbprint { get; private set; } + + /// + /// Gets or sets the vault uri of user key vault. + /// + [JsonProperty(PropertyName = "vaultUri")] + public string VaultUri { get; set; } + + /// + /// Gets or sets the certificate name of key vault. + /// + [JsonProperty(PropertyName = "keyVaultCertName")] + public string KeyVaultCertName { get; set; } + + /// + /// Gets or sets the certificate version of key vault. + /// + [JsonProperty(PropertyName = "certVersion")] + public string CertVersion { get; set; } + + /// + /// Gets the issuer of certificate. + /// + [JsonProperty(PropertyName = "issuer")] + public string Issuer { get; private set; } + + /// + /// Gets the issue date of certificate. + /// + [JsonProperty(PropertyName = "issuedDate")] + public string IssuedDate { get; private set; } + + /// + /// Gets the expiration date of certificate. + /// + [JsonProperty(PropertyName = "expirationDate")] + public string ExpirationDate { get; private set; } + + /// + /// Gets the activate date of certificate. + /// + [JsonProperty(PropertyName = "activateDate")] + public string ActivateDate { get; private set; } + + /// + /// Gets the subject name of certificate. + /// + [JsonProperty(PropertyName = "subjectName")] + public string SubjectName { get; private set; } + + /// + /// Gets the domain list of certificate. + /// + [JsonProperty(PropertyName = "dnsNames")] + public IList DnsNames { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (VaultUri == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "VaultUri"); + } + if (KeyVaultCertName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "KeyVaultCertName"); + } + } + } +} diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/CertificateResource.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/CertificateResource.cs new file mode 100644 index 000000000000..7b5989b76c86 --- /dev/null +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/CertificateResource.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.AppPlatform.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Certificate resource payload. + /// + public partial class CertificateResource : ProxyResource + { + /// + /// Initializes a new instance of the CertificateResource class. + /// + public CertificateResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CertificateResource class. + /// + /// Fully qualified resource Id for the + /// resource. + /// The name of the resource. + /// The type of the resource. + /// Properties of the certificate resource + /// payload. + public CertificateResource(string id = default(string), string name = default(string), string type = default(string), CertificateProperties properties = default(CertificateProperties)) + : base(id, name, type) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets properties of the certificate resource payload. + /// + [JsonProperty(PropertyName = "properties")] + public CertificateProperties Properties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Properties != null) + { + Properties.Validate(); + } + } + } +} diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/CustomDomainProperties.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/CustomDomainProperties.cs new file mode 100644 index 000000000000..dcf9d2087312 --- /dev/null +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/CustomDomainProperties.cs @@ -0,0 +1,69 @@ +// +// 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.AppPlatform.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Custom domain of app resource payload. + /// + public partial class CustomDomainProperties + { + /// + /// Initializes a new instance of the CustomDomainProperties class. + /// + public CustomDomainProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CustomDomainProperties class. + /// + /// The thumbprint of bound + /// certificate. + /// The app name of domain. + /// The bound certificate name of + /// domain. + public CustomDomainProperties(string thumbprint = default(string), string appName = default(string), string certName = default(string)) + { + Thumbprint = thumbprint; + AppName = appName; + CertName = certName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the thumbprint of bound certificate. + /// + [JsonProperty(PropertyName = "thumbprint")] + public string Thumbprint { get; set; } + + /// + /// Gets or sets the app name of domain. + /// + [JsonProperty(PropertyName = "appName")] + public string AppName { get; set; } + + /// + /// Gets or sets the bound certificate name of domain. + /// + [JsonProperty(PropertyName = "certName")] + public string CertName { get; set; } + + } +} diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/CustomDomainResource.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/CustomDomainResource.cs new file mode 100644 index 000000000000..4934ad8c2444 --- /dev/null +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/CustomDomainResource.cs @@ -0,0 +1,57 @@ +// +// 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.AppPlatform.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Custom domain resource payload. + /// + public partial class CustomDomainResource : ProxyResource + { + /// + /// Initializes a new instance of the CustomDomainResource class. + /// + public CustomDomainResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CustomDomainResource class. + /// + /// Fully qualified resource Id for the + /// resource. + /// The name of the resource. + /// The type of the resource. + /// Properties of the custom domain + /// resource. + public CustomDomainResource(string id = default(string), string name = default(string), string type = default(string), CustomDomainProperties properties = default(CustomDomainProperties)) + : base(id, name, type) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets properties of the custom domain resource. + /// + [JsonProperty(PropertyName = "properties")] + public CustomDomainProperties Properties { get; set; } + + } +} diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/CustomDomainValidatePayload.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/CustomDomainValidatePayload.cs new file mode 100644 index 000000000000..704c1962c25a --- /dev/null +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/CustomDomainValidatePayload.cs @@ -0,0 +1,67 @@ +// +// 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.AppPlatform.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Custom domain validate payload. + /// + public partial class CustomDomainValidatePayload + { + /// + /// Initializes a new instance of the CustomDomainValidatePayload + /// class. + /// + public CustomDomainValidatePayload() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CustomDomainValidatePayload + /// class. + /// + /// Name to be validated + public CustomDomainValidatePayload(string name) + { + Name = name; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name to be validated + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + } + } +} diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/CustomDomainValidateResult.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/CustomDomainValidateResult.cs new file mode 100644 index 000000000000..ac7b8ecd0acf --- /dev/null +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/CustomDomainValidateResult.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.AppPlatform.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Validation result for custom domain. + /// + public partial class CustomDomainValidateResult + { + /// + /// Initializes a new instance of the CustomDomainValidateResult class. + /// + public CustomDomainValidateResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CustomDomainValidateResult class. + /// + /// Indicates if domain name is valid. + /// Message of why domain name is + /// invalid. + public CustomDomainValidateResult(bool? isValid = default(bool?), string message = default(string)) + { + IsValid = isValid; + Message = message; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets indicates if domain name is valid. + /// + [JsonProperty(PropertyName = "isValid")] + public bool? IsValid { get; set; } + + /// + /// Gets or sets message of why domain name is invalid. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + } +} diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/DeploymentResourceProperties.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/DeploymentResourceProperties.cs index 9aecafe50082..0d9fc2f41d55 100644 --- a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/DeploymentResourceProperties.cs +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/DeploymentResourceProperties.cs @@ -36,11 +36,11 @@ public DeploymentResourceProperties() /// Uploaded source information of the /// deployment. /// App name of the deployment + /// Deployment settings of the + /// Deployment /// Provisioning state of the /// Deployment. Possible values include: 'Creating', 'Updating', /// 'Succeeded', 'Failed' - /// Deployment settings of the - /// Deployment /// Status of the Deployment. Possible values /// include: 'Unknown', 'Stopped', 'Running', 'Failed', 'Allocating', /// 'Upgrading', 'Compiling' @@ -50,12 +50,12 @@ public DeploymentResourceProperties() /// created /// Collection of instances belong to the /// Deployment - public DeploymentResourceProperties(UserSourceInfo source = default(UserSourceInfo), string appName = default(string), string provisioningState = default(string), DeploymentSettings deploymentSettings = default(DeploymentSettings), string status = default(string), bool? active = default(bool?), System.DateTime? createdTime = default(System.DateTime?), IList instances = default(IList)) + public DeploymentResourceProperties(UserSourceInfo source = default(UserSourceInfo), string appName = default(string), DeploymentSettings deploymentSettings = default(DeploymentSettings), string provisioningState = default(string), string status = default(string), bool? active = default(bool?), System.DateTime? createdTime = default(System.DateTime?), IList instances = default(IList)) { Source = source; AppName = appName; - ProvisioningState = provisioningState; DeploymentSettings = deploymentSettings; + ProvisioningState = provisioningState; Status = status; Active = active; CreatedTime = createdTime; @@ -80,6 +80,12 @@ public DeploymentResourceProperties() [JsonProperty(PropertyName = "appName")] public string AppName { get; private set; } + /// + /// Gets or sets deployment settings of the Deployment + /// + [JsonProperty(PropertyName = "deploymentSettings")] + public DeploymentSettings DeploymentSettings { get; set; } + /// /// Gets provisioning state of the Deployment. Possible values include: /// 'Creating', 'Updating', 'Succeeded', 'Failed' @@ -87,12 +93,6 @@ public DeploymentResourceProperties() [JsonProperty(PropertyName = "provisioningState")] public string ProvisioningState { get; private set; } - /// - /// Gets or sets deployment settings of the Deployment - /// - [JsonProperty(PropertyName = "deploymentSettings")] - public DeploymentSettings DeploymentSettings { get; set; } - /// /// Gets status of the Deployment. Possible values include: 'Unknown', /// 'Stopped', 'Running', 'Failed', 'Allocating', 'Upgrading', diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/SdkInfo_AppPlatformManagementClient.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/SdkInfo_AppPlatformManagementClient.cs index a3dc655780c9..8698bc715061 100644 --- a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/SdkInfo_AppPlatformManagementClient.cs +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/SdkInfo_AppPlatformManagementClient.cs @@ -21,22 +21,13 @@ public static IEnumerable> ApiInfo_AppPlatformMana { new Tuple("AppPlatform", "Apps", "2019-05-01-preview"), new Tuple("AppPlatform", "Bindings", "2019-05-01-preview"), + new Tuple("AppPlatform", "Certificates", "2019-05-01-preview"), + new Tuple("AppPlatform", "CustomDomains", "2019-05-01-preview"), new Tuple("AppPlatform", "Deployments", "2019-05-01-preview"), new Tuple("AppPlatform", "Operations", "2019-05-01-preview"), new Tuple("AppPlatform", "Services", "2019-05-01-preview"), }.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/appplatform/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=C:\\projects\\spring-service\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "191aa6f4e91585f08acf453f47817a36f1db9c69"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/ServicesOperations.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/ServicesOperations.cs index 32ea5c265bc0..880c1682c073 100644 --- a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/ServicesOperations.cs +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/ServicesOperations.cs @@ -262,7 +262,7 @@ internal ServicesOperations(AppPlatformManagementClient client) /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, ServiceResource resource = default(ServiceResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, ServiceResource resource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, resource, customHeaders, cancellationToken).ConfigureAwait(false); @@ -311,7 +311,7 @@ internal ServicesOperations(AppPlatformManagementClient client) /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, ServiceResource resource = default(ServiceResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, ServiceResource resource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, resource, customHeaders, cancellationToken).ConfigureAwait(false); @@ -545,12 +545,8 @@ internal ServicesOperations(AppPlatformManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> RegenerateTestKeyWithHttpMessagesAsync(string resourceGroupName, string serviceName, RegenerateTestKeyRequestPayload regenerateTestKeyRequest = default(RegenerateTestKeyRequestPayload), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> RegenerateTestKeyWithHttpMessagesAsync(string resourceGroupName, string serviceName, RegenerateTestKeyRequestPayload regenerateTestKeyRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (regenerateTestKeyRequest != null) - { - regenerateTestKeyRequest.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -563,6 +559,14 @@ internal ServicesOperations(AppPlatformManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); } + if (regenerateTestKeyRequest == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "regenerateTestKeyRequest"); + } + if (regenerateTestKeyRequest != null) + { + regenerateTestKeyRequest.Validate(); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -570,9 +574,9 @@ internal ServicesOperations(AppPlatformManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("regenerateTestKeyRequest", regenerateTestKeyRequest); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("regenerateTestKeyRequest", regenerateTestKeyRequest); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "RegenerateTestKey", tracingParameters); } @@ -1109,6 +1113,10 @@ internal ServicesOperations(AppPlatformManagementClient client) /// public async Task> CheckNameAvailabilityWithHttpMessagesAsync(string location, NameAvailabilityParameters availabilityParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } if (location == null) { throw new ValidationException(ValidationRules.CannotBeNull, "location"); @@ -1121,10 +1129,6 @@ internal ServicesOperations(AppPlatformManagementClient client) { availabilityParameters.Validate(); } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1140,8 +1144,8 @@ internal ServicesOperations(AppPlatformManagementClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability").ToString(); - _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _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) { @@ -1670,12 +1674,8 @@ internal ServicesOperations(AppPlatformManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, ServiceResource resource = default(ServiceResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, ServiceResource resource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (resource != null) - { - resource.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1688,6 +1688,14 @@ internal ServicesOperations(AppPlatformManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); } + if (resource == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resource"); + } + if (resource != null) + { + resource.Validate(); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1695,9 +1703,9 @@ internal ServicesOperations(AppPlatformManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resource", resource); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("resource", resource); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } @@ -2067,7 +2075,7 @@ internal ServicesOperations(AppPlatformManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, ServiceResource resource = default(ServiceResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, ServiceResource resource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -2081,6 +2089,10 @@ internal ServicesOperations(AppPlatformManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); } + if (resource == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resource"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2088,9 +2100,9 @@ internal ServicesOperations(AppPlatformManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resource", resource); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("resource", resource); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/ServicesOperationsExtensions.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/ServicesOperationsExtensions.cs index bdaf9933f5b6..90a0f1a4fc6f 100644 --- a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/ServicesOperationsExtensions.cs +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/ServicesOperationsExtensions.cs @@ -79,7 +79,7 @@ public static ServiceResource Get(this IServicesOperations operations, string re /// /// Parameters for the create or update operation /// - public static ServiceResource CreateOrUpdate(this IServicesOperations operations, string resourceGroupName, string serviceName, ServiceResource resource = default(ServiceResource)) + public static ServiceResource CreateOrUpdate(this IServicesOperations operations, string resourceGroupName, string serviceName, ServiceResource resource) { return operations.CreateOrUpdateAsync(resourceGroupName, serviceName, resource).GetAwaiter().GetResult(); } @@ -103,7 +103,7 @@ public static ServiceResource Get(this IServicesOperations operations, string re /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IServicesOperations operations, string resourceGroupName, string serviceName, ServiceResource resource = default(ServiceResource), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IServicesOperations operations, string resourceGroupName, string serviceName, ServiceResource resource, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, resource, null, cancellationToken).ConfigureAwait(false)) { @@ -166,7 +166,7 @@ public static void Delete(this IServicesOperations operations, string resourceGr /// /// Parameters for the update operation /// - public static ServiceResource Update(this IServicesOperations operations, string resourceGroupName, string serviceName, ServiceResource resource = default(ServiceResource)) + public static ServiceResource Update(this IServicesOperations operations, string resourceGroupName, string serviceName, ServiceResource resource) { return operations.UpdateAsync(resourceGroupName, serviceName, resource).GetAwaiter().GetResult(); } @@ -190,7 +190,7 @@ public static void Delete(this IServicesOperations operations, string resourceGr /// /// The cancellation token. /// - public static async Task UpdateAsync(this IServicesOperations operations, string resourceGroupName, string serviceName, ServiceResource resource = default(ServiceResource), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAsync(this IServicesOperations operations, string resourceGroupName, string serviceName, ServiceResource resource, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serviceName, resource, null, cancellationToken).ConfigureAwait(false)) { @@ -256,7 +256,7 @@ public static TestKeys ListTestKeys(this IServicesOperations operations, string /// /// Parameters for the operation /// - public static TestKeys RegenerateTestKey(this IServicesOperations operations, string resourceGroupName, string serviceName, RegenerateTestKeyRequestPayload regenerateTestKeyRequest = default(RegenerateTestKeyRequestPayload)) + public static TestKeys RegenerateTestKey(this IServicesOperations operations, string resourceGroupName, string serviceName, RegenerateTestKeyRequestPayload regenerateTestKeyRequest) { return operations.RegenerateTestKeyAsync(resourceGroupName, serviceName, regenerateTestKeyRequest).GetAwaiter().GetResult(); } @@ -280,7 +280,7 @@ public static TestKeys ListTestKeys(this IServicesOperations operations, string /// /// The cancellation token. /// - public static async Task RegenerateTestKeyAsync(this IServicesOperations operations, string resourceGroupName, string serviceName, RegenerateTestKeyRequestPayload regenerateTestKeyRequest = default(RegenerateTestKeyRequestPayload), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task RegenerateTestKeyAsync(this IServicesOperations operations, string resourceGroupName, string serviceName, RegenerateTestKeyRequestPayload regenerateTestKeyRequest, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.RegenerateTestKeyWithHttpMessagesAsync(resourceGroupName, serviceName, regenerateTestKeyRequest, null, cancellationToken).ConfigureAwait(false)) { @@ -477,7 +477,7 @@ public static IPage List(this IServicesOperations operations, s /// /// Parameters for the create or update operation /// - public static ServiceResource BeginCreateOrUpdate(this IServicesOperations operations, string resourceGroupName, string serviceName, ServiceResource resource = default(ServiceResource)) + public static ServiceResource BeginCreateOrUpdate(this IServicesOperations operations, string resourceGroupName, string serviceName, ServiceResource resource) { return operations.BeginCreateOrUpdateAsync(resourceGroupName, serviceName, resource).GetAwaiter().GetResult(); } @@ -501,7 +501,7 @@ public static IPage List(this IServicesOperations operations, s /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this IServicesOperations operations, string resourceGroupName, string serviceName, ServiceResource resource = default(ServiceResource), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this IServicesOperations operations, string resourceGroupName, string serviceName, ServiceResource resource, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, resource, null, cancellationToken).ConfigureAwait(false)) { @@ -564,7 +564,7 @@ public static void BeginDelete(this IServicesOperations operations, string resou /// /// Parameters for the update operation /// - public static ServiceResource BeginUpdate(this IServicesOperations operations, string resourceGroupName, string serviceName, ServiceResource resource = default(ServiceResource)) + public static ServiceResource BeginUpdate(this IServicesOperations operations, string resourceGroupName, string serviceName, ServiceResource resource) { return operations.BeginUpdateAsync(resourceGroupName, serviceName, resource).GetAwaiter().GetResult(); } @@ -588,7 +588,7 @@ public static void BeginDelete(this IServicesOperations operations, string resou /// /// The cancellation token. /// - public static async Task BeginUpdateAsync(this IServicesOperations operations, string resourceGroupName, string serviceName, ServiceResource resource = default(ServiceResource), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginUpdateAsync(this IServicesOperations operations, string resourceGroupName, string serviceName, ServiceResource resource, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, resource, null, cancellationToken).ConfigureAwait(false)) {