From b47f6dc05fdaeff3320de8a06d2363ad2eba1a64 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 20 May 2021 01:22:50 +0000 Subject: [PATCH] CodeGen from PR 14490 in Azure/azure-rest-api-specs Merge a3348835278124e47b1f031f79bdbb8929238d0c into 3d9f52499fcb4131c95287ddc789cffa75425b75 --- .../Generated/IKubeEnvironmentsOperations.cs | 297 +++ .../src/Generated/IWebSiteManagementClient.cs | 27 +- .../Generated/KubeEnvironmentsOperations.cs | 1708 +++++++++++++++++ .../KubeEnvironmentsOperationsExtensions.cs | 467 +++++ .../Generated/Models/AppLogsConfiguration.cs | 52 + .../src/Generated/Models/AppServicePlan.cs | 8 +- .../Models/AppServicePlanPatchResource.cs | 13 +- .../src/Generated/Models/ArcConfiguration.cs | 86 + .../Models/CsmOperationDescription.cs | 8 +- .../src/Generated/Models/ExtendedLocation.cs | 59 + .../Generated/Models/FrontEndConfiguration.cs | 49 + .../Generated/Models/FrontEndServiceType.cs | 60 + .../src/Generated/Models/KubeEnvironment.cs | 156 ++ .../Models/KubeEnvironmentPatchResource.cs | 138 ++ .../KubeEnvironmentProvisioningState.cs | 108 ++ .../Models/LogAnalyticsConfiguration.cs | 52 + .../src/Generated/Models/Site.cs | 8 +- .../src/Generated/Models/StorageType.cs | 60 + .../SdkInfo_WebSiteManagementClient.cs | 80 +- .../src/Generated/WebSiteManagementClient.cs | 38 +- 20 files changed, 3398 insertions(+), 76 deletions(-) create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IKubeEnvironmentsOperations.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/KubeEnvironmentsOperations.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/KubeEnvironmentsOperationsExtensions.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppLogsConfiguration.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArcConfiguration.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ExtendedLocation.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FrontEndConfiguration.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FrontEndServiceType.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironment.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentPatchResource.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProvisioningState.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogAnalyticsConfiguration.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageType.cs diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IKubeEnvironmentsOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IKubeEnvironmentsOperations.cs new file mode 100644 index 000000000000..c91aa361b24a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IKubeEnvironmentsOperations.cs @@ -0,0 +1,297 @@ +// +// 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.WebSites +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// KubeEnvironmentsOperations operations. + /// + public partial interface IKubeEnvironmentsOperations + { + /// + /// Get all Kubernetes Environments for a subscription. + /// + /// + /// Description for Get all Kubernetes Environments for a subscription. + /// + /// + /// 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>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get all the Kubernetes Environments in a resource group. + /// + /// + /// Description for Get all the Kubernetes Environments in a resource + /// group. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get the properties of a Kubernetes Environment. + /// + /// + /// Description for Get the properties of a Kubernetes Environment. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the Kubernetes Environment. + /// + /// + /// 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 name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a Kubernetes Environment. + /// + /// + /// Description for Creates or updates a Kubernetes Environment. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the Kubernetes Environment. + /// + /// + /// Configuration details of the Kubernetes Environment. + /// + /// + /// 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 name, KubeEnvironment kubeEnvironmentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a Kubernetes Environment. + /// + /// + /// Description for Delete a Kubernetes Environment. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the Kubernetes Environment. + /// + /// + /// 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 name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a Kubernetes Environment. + /// + /// + /// Description for Creates or updates a Kubernetes Environment. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the Kubernetes Environment. + /// + /// + /// Configuration details of the Kubernetes Environment. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string name, KubeEnvironmentPatchResource kubeEnvironmentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a Kubernetes Environment. + /// + /// + /// Description for Creates or updates a Kubernetes Environment. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the Kubernetes Environment. + /// + /// + /// Configuration details of the Kubernetes Environment. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string name, KubeEnvironment kubeEnvironmentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a Kubernetes Environment. + /// + /// + /// Description for Delete a Kubernetes Environment. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the Kubernetes Environment. + /// + /// + /// 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 BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get all Kubernetes Environments for a subscription. + /// + /// + /// Description for Get all Kubernetes Environments for a subscription. + /// + /// + /// 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>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get all the Kubernetes Environments in a resource group. + /// + /// + /// Description for Get all the Kubernetes Environments in a resource + /// group. + /// + /// + /// 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>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IWebSiteManagementClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IWebSiteManagementClient.cs index 2c6b10eea2a4..43c2b46180c4 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IWebSiteManagementClient.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IWebSiteManagementClient.cs @@ -104,6 +104,16 @@ public partial interface IWebSiteManagementClient : System.IDisposable /// IDomainRegistrationProviderOperations DomainRegistrationProvider { get; } + /// + /// Gets the IAppServiceEnvironmentsOperations. + /// + IAppServiceEnvironmentsOperations AppServiceEnvironments { get; } + + /// + /// Gets the IAppServicePlansOperations. + /// + IAppServicePlansOperations AppServicePlans { get; } + /// /// Gets the ICertificatesOperations. /// @@ -135,9 +145,9 @@ public partial interface IWebSiteManagementClient : System.IDisposable IRecommendationsOperations Recommendations { get; } /// - /// Gets the IWebAppsOperations. + /// Gets the IResourceHealthMetadataOperations. /// - IWebAppsOperations WebApps { get; } + IResourceHealthMetadataOperations ResourceHealthMetadata { get; } /// /// Gets the IStaticSitesOperations. @@ -145,19 +155,14 @@ public partial interface IWebSiteManagementClient : System.IDisposable IStaticSitesOperations StaticSites { get; } /// - /// Gets the IAppServiceEnvironmentsOperations. - /// - IAppServiceEnvironmentsOperations AppServiceEnvironments { get; } - - /// - /// Gets the IAppServicePlansOperations. + /// Gets the IWebAppsOperations. /// - IAppServicePlansOperations AppServicePlans { get; } + IWebAppsOperations WebApps { get; } /// - /// Gets the IResourceHealthMetadataOperations. + /// Gets the IKubeEnvironmentsOperations. /// - IResourceHealthMetadataOperations ResourceHealthMetadata { get; } + IKubeEnvironmentsOperations KubeEnvironments { get; } /// /// Exchange code for GitHub access token for AppService CLI diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/KubeEnvironmentsOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/KubeEnvironmentsOperations.cs new file mode 100644 index 000000000000..6f817f1b68ec --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/KubeEnvironmentsOperations.cs @@ -0,0 +1,1708 @@ +// +// 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.WebSites +{ + 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; + + /// + /// KubeEnvironmentsOperations operations. + /// + internal partial class KubeEnvironmentsOperations : IServiceOperations, IKubeEnvironmentsOperations + { + /// + /// Initializes a new instance of the KubeEnvironmentsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal KubeEnvironmentsOperations(WebSiteManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the WebSiteManagementClient + /// + public WebSiteManagementClient Client { get; private set; } + + /// + /// Get all Kubernetes Environments for a subscription. + /// + /// + /// Description for Get all Kubernetes Environments for a subscription. + /// + /// + /// 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>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Web/kubeEnvironments").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get all the Kubernetes Environments in a resource group. + /// + /// + /// Description for Get all the Kubernetes Environments in a resource group. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", 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.Web/kubeEnvironments").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get the properties of a Kubernetes Environment. + /// + /// + /// Description for Get the properties of a Kubernetes Environment. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the Kubernetes Environment. + /// + /// + /// 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 name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + 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.Web/kubeEnvironments/{name}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a Kubernetes Environment. + /// + /// + /// Description for Creates or updates a Kubernetes Environment. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the Kubernetes Environment. + /// + /// + /// Configuration details of the Kubernetes Environment. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string name, KubeEnvironment kubeEnvironmentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, name, kubeEnvironmentEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete a Kubernetes Environment. + /// + /// + /// Description for Delete a Kubernetes Environment. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the Kubernetes Environment. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, name, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates or updates a Kubernetes Environment. + /// + /// + /// Description for Creates or updates a Kubernetes Environment. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the Kubernetes Environment. + /// + /// + /// Configuration details of the Kubernetes Environment. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string name, KubeEnvironmentPatchResource kubeEnvironmentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (kubeEnvironmentEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "kubeEnvironmentEnvelope"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("kubeEnvironmentEnvelope", kubeEnvironmentEnvelope); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/kubeEnvironments/{name}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(kubeEnvironmentEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(kubeEnvironmentEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a Kubernetes Environment. + /// + /// + /// Description for Creates or updates a Kubernetes Environment. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the Kubernetes Environment. + /// + /// + /// Configuration details of the Kubernetes Environment. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string name, KubeEnvironment kubeEnvironmentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (kubeEnvironmentEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "kubeEnvironmentEnvelope"); + } + if (kubeEnvironmentEnvelope != null) + { + kubeEnvironmentEnvelope.Validate(); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("kubeEnvironmentEnvelope", kubeEnvironmentEnvelope); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", 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.Web/kubeEnvironments/{name}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(kubeEnvironmentEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(kubeEnvironmentEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Delete a Kubernetes Environment. + /// + /// + /// Description for Delete a Kubernetes Environment. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the Kubernetes Environment. + /// + /// + /// 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 BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/kubeEnvironments/{name}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get all Kubernetes Environments for a subscription. + /// + /// + /// Description for Get all Kubernetes Environments for a subscription. + /// + /// + /// 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>> ListBySubscriptionNextWithHttpMessagesAsync(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, "ListBySubscriptionNext", 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 DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get all the Kubernetes Environments in a resource group. + /// + /// + /// Description for Get all the Kubernetes Environments in a resource group. + /// + /// + /// 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>> ListByResourceGroupNextWithHttpMessagesAsync(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, "ListByResourceGroupNext", 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 DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/KubeEnvironmentsOperationsExtensions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/KubeEnvironmentsOperationsExtensions.cs new file mode 100644 index 000000000000..fda574b00e42 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/KubeEnvironmentsOperationsExtensions.cs @@ -0,0 +1,467 @@ +// +// 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.WebSites +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for KubeEnvironmentsOperations. + /// + public static partial class KubeEnvironmentsOperationsExtensions + { + /// + /// Get all Kubernetes Environments for a subscription. + /// + /// + /// Description for Get all Kubernetes Environments for a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IPage ListBySubscription(this IKubeEnvironmentsOperations operations) + { + return operations.ListBySubscriptionAsync().GetAwaiter().GetResult(); + } + + /// + /// Get all Kubernetes Environments for a subscription. + /// + /// + /// Description for Get all Kubernetes Environments for a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySubscriptionAsync(this IKubeEnvironmentsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get all the Kubernetes Environments in a resource group. + /// + /// + /// Description for Get all the Kubernetes Environments in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + public static IPage ListByResourceGroup(this IKubeEnvironmentsOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Get all the Kubernetes Environments in a resource group. + /// + /// + /// Description for Get all the Kubernetes Environments in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IKubeEnvironmentsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get the properties of a Kubernetes Environment. + /// + /// + /// Description for Get the properties of a Kubernetes Environment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the Kubernetes Environment. + /// + public static KubeEnvironment Get(this IKubeEnvironmentsOperations operations, string resourceGroupName, string name) + { + return operations.GetAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Get the properties of a Kubernetes Environment. + /// + /// + /// Description for Get the properties of a Kubernetes Environment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the Kubernetes Environment. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IKubeEnvironmentsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a Kubernetes Environment. + /// + /// + /// Description for Creates or updates a Kubernetes Environment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the Kubernetes Environment. + /// + /// + /// Configuration details of the Kubernetes Environment. + /// + public static KubeEnvironment CreateOrUpdate(this IKubeEnvironmentsOperations operations, string resourceGroupName, string name, KubeEnvironment kubeEnvironmentEnvelope) + { + return operations.CreateOrUpdateAsync(resourceGroupName, name, kubeEnvironmentEnvelope).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a Kubernetes Environment. + /// + /// + /// Description for Creates or updates a Kubernetes Environment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the Kubernetes Environment. + /// + /// + /// Configuration details of the Kubernetes Environment. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IKubeEnvironmentsOperations operations, string resourceGroupName, string name, KubeEnvironment kubeEnvironmentEnvelope, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, name, kubeEnvironmentEnvelope, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a Kubernetes Environment. + /// + /// + /// Description for Delete a Kubernetes Environment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the Kubernetes Environment. + /// + public static void Delete(this IKubeEnvironmentsOperations operations, string resourceGroupName, string name) + { + operations.DeleteAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Delete a Kubernetes Environment. + /// + /// + /// Description for Delete a Kubernetes Environment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the Kubernetes Environment. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IKubeEnvironmentsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates or updates a Kubernetes Environment. + /// + /// + /// Description for Creates or updates a Kubernetes Environment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the Kubernetes Environment. + /// + /// + /// Configuration details of the Kubernetes Environment. + /// + public static KubeEnvironment Update(this IKubeEnvironmentsOperations operations, string resourceGroupName, string name, KubeEnvironmentPatchResource kubeEnvironmentEnvelope) + { + return operations.UpdateAsync(resourceGroupName, name, kubeEnvironmentEnvelope).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a Kubernetes Environment. + /// + /// + /// Description for Creates or updates a Kubernetes Environment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the Kubernetes Environment. + /// + /// + /// Configuration details of the Kubernetes Environment. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IKubeEnvironmentsOperations operations, string resourceGroupName, string name, KubeEnvironmentPatchResource kubeEnvironmentEnvelope, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, name, kubeEnvironmentEnvelope, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a Kubernetes Environment. + /// + /// + /// Description for Creates or updates a Kubernetes Environment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the Kubernetes Environment. + /// + /// + /// Configuration details of the Kubernetes Environment. + /// + public static KubeEnvironment BeginCreateOrUpdate(this IKubeEnvironmentsOperations operations, string resourceGroupName, string name, KubeEnvironment kubeEnvironmentEnvelope) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, name, kubeEnvironmentEnvelope).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a Kubernetes Environment. + /// + /// + /// Description for Creates or updates a Kubernetes Environment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the Kubernetes Environment. + /// + /// + /// Configuration details of the Kubernetes Environment. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IKubeEnvironmentsOperations operations, string resourceGroupName, string name, KubeEnvironment kubeEnvironmentEnvelope, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, name, kubeEnvironmentEnvelope, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a Kubernetes Environment. + /// + /// + /// Description for Delete a Kubernetes Environment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the Kubernetes Environment. + /// + public static void BeginDelete(this IKubeEnvironmentsOperations operations, string resourceGroupName, string name) + { + operations.BeginDeleteAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Delete a Kubernetes Environment. + /// + /// + /// Description for Delete a Kubernetes Environment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the Kubernetes Environment. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IKubeEnvironmentsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Get all Kubernetes Environments for a subscription. + /// + /// + /// Description for Get all Kubernetes Environments for a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListBySubscriptionNext(this IKubeEnvironmentsOperations operations, string nextPageLink) + { + return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get all Kubernetes Environments for a subscription. + /// + /// + /// Description for Get all Kubernetes Environments for a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySubscriptionNextAsync(this IKubeEnvironmentsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get all the Kubernetes Environments in a resource group. + /// + /// + /// Description for Get all the Kubernetes Environments in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this IKubeEnvironmentsOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get all the Kubernetes Environments in a resource group. + /// + /// + /// Description for Get all the Kubernetes Environments in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupNextAsync(this IKubeEnvironmentsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppLogsConfiguration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppLogsConfiguration.cs new file mode 100644 index 000000000000..a1deb095dbf0 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppLogsConfiguration.cs @@ -0,0 +1,52 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class AppLogsConfiguration + { + /// + /// Initializes a new instance of the AppLogsConfiguration class. + /// + public AppLogsConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AppLogsConfiguration class. + /// + public AppLogsConfiguration(string destination = default(string), LogAnalyticsConfiguration logAnalyticsConfiguration = default(LogAnalyticsConfiguration)) + { + Destination = destination; + LogAnalyticsConfiguration = logAnalyticsConfiguration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "destination")] + public string Destination { get; set; } + + /// + /// + [JsonProperty(PropertyName = "logAnalyticsConfiguration")] + public LogAnalyticsConfiguration LogAnalyticsConfiguration { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.cs index b77592992597..172e39ecdee2 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.cs @@ -84,7 +84,7 @@ public AppServicePlan() /// 'Canceled', 'InProgress', 'Deleting' /// Specification for the /// Kubernetes Environment to use for the App Service plan. - public AppServicePlan(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string workerTierName = default(string), StatusOptions? status = default(StatusOptions?), string subscription = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), int? maximumNumberOfWorkers = default(int?), string geoRegion = default(string), bool? perSiteScaling = default(bool?), int? maximumElasticWorkerCount = default(int?), int? numberOfSites = default(int?), bool? isSpot = default(bool?), System.DateTime? spotExpirationTime = default(System.DateTime?), System.DateTime? freeOfferExpirationTime = default(System.DateTime?), string resourceGroup = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), int? targetWorkerCount = default(int?), int? targetWorkerSizeId = default(int?), ProvisioningState? provisioningState = default(ProvisioningState?), KubeEnvironmentProfile kubeEnvironmentProfile = default(KubeEnvironmentProfile), SkuDescription sku = default(SkuDescription)) + public AppServicePlan(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string workerTierName = default(string), StatusOptions? status = default(StatusOptions?), string subscription = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), int? maximumNumberOfWorkers = default(int?), string geoRegion = default(string), bool? perSiteScaling = default(bool?), int? maximumElasticWorkerCount = default(int?), int? numberOfSites = default(int?), bool? isSpot = default(bool?), System.DateTime? spotExpirationTime = default(System.DateTime?), System.DateTime? freeOfferExpirationTime = default(System.DateTime?), string resourceGroup = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), int? targetWorkerCount = default(int?), int? targetWorkerSizeId = default(int?), ProvisioningState? provisioningState = default(ProvisioningState?), KubeEnvironmentProfile kubeEnvironmentProfile = default(KubeEnvironmentProfile), SkuDescription sku = default(SkuDescription), ExtendedLocation extendedLocation = default(ExtendedLocation)) : base(location, id, name, kind, type, tags) { WorkerTierName = workerTierName; @@ -108,6 +108,7 @@ public AppServicePlan() ProvisioningState = provisioningState; KubeEnvironmentProfile = kubeEnvironmentProfile; Sku = sku; + ExtendedLocation = extendedLocation; CustomInit(); } @@ -259,6 +260,11 @@ public AppServicePlan() [JsonProperty(PropertyName = "sku")] public SkuDescription Sku { get; set; } + /// + /// + [JsonProperty(PropertyName = "extendedLocation")] + public ExtendedLocation ExtendedLocation { get; set; } + /// /// Validate the object. /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.cs index 87b7050495c3..418fba09030a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.cs @@ -53,6 +53,9 @@ public AppServicePlanPatchResource() /// assigned to this App Service plan can be scaled independently. /// If <code>false</code>, apps assigned to this App /// Service plan will scale to all instances of the plan. + /// ServerFarm supports ElasticScale. + /// Apps in this plan will scale as if the ServerFarm was + /// ElasticPremium sku /// Maximum number of total /// workers allowed for this ElasticScaleEnabled App Service /// Plan @@ -82,7 +85,7 @@ public AppServicePlanPatchResource() /// 'Canceled', 'InProgress', 'Deleting' /// Specification for the /// Kubernetes Environment to use for the App Service plan. - public AppServicePlanPatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string workerTierName = default(string), StatusOptions? status = default(StatusOptions?), string subscription = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), int? maximumNumberOfWorkers = default(int?), string geoRegion = default(string), bool? perSiteScaling = default(bool?), int? maximumElasticWorkerCount = default(int?), int? numberOfSites = default(int?), bool? isSpot = default(bool?), System.DateTime? spotExpirationTime = default(System.DateTime?), System.DateTime? freeOfferExpirationTime = default(System.DateTime?), string resourceGroup = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), int? targetWorkerCount = default(int?), int? targetWorkerSizeId = default(int?), ProvisioningState? provisioningState = default(ProvisioningState?), KubeEnvironmentProfile kubeEnvironmentProfile = default(KubeEnvironmentProfile)) + public AppServicePlanPatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string workerTierName = default(string), StatusOptions? status = default(StatusOptions?), string subscription = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), int? maximumNumberOfWorkers = default(int?), string geoRegion = default(string), bool? perSiteScaling = default(bool?), bool? elasticScaleEnabled = default(bool?), int? maximumElasticWorkerCount = default(int?), int? numberOfSites = default(int?), bool? isSpot = default(bool?), System.DateTime? spotExpirationTime = default(System.DateTime?), System.DateTime? freeOfferExpirationTime = default(System.DateTime?), string resourceGroup = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), int? targetWorkerCount = default(int?), int? targetWorkerSizeId = default(int?), ProvisioningState? provisioningState = default(ProvisioningState?), KubeEnvironmentProfile kubeEnvironmentProfile = default(KubeEnvironmentProfile)) : base(id, name, kind, type) { WorkerTierName = workerTierName; @@ -92,6 +95,7 @@ public AppServicePlanPatchResource() MaximumNumberOfWorkers = maximumNumberOfWorkers; GeoRegion = geoRegion; PerSiteScaling = perSiteScaling; + ElasticScaleEnabled = elasticScaleEnabled; MaximumElasticWorkerCount = maximumElasticWorkerCount; NumberOfSites = numberOfSites; IsSpot = isSpot; @@ -161,6 +165,13 @@ public AppServicePlanPatchResource() [JsonProperty(PropertyName = "properties.perSiteScaling")] public bool? PerSiteScaling { get; set; } + /// + /// Gets or sets serverFarm supports ElasticScale. Apps in this plan + /// will scale as if the ServerFarm was ElasticPremium sku + /// + [JsonProperty(PropertyName = "properties.elasticScaleEnabled")] + public bool? ElasticScaleEnabled { get; set; } + /// /// Gets or sets maximum number of total workers allowed for this /// ElasticScaleEnabled App Service Plan diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArcConfiguration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArcConfiguration.cs new file mode 100644 index 000000000000..8fa89baad2b2 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArcConfiguration.cs @@ -0,0 +1,86 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class ArcConfiguration + { + /// + /// Initializes a new instance of the ArcConfiguration class. + /// + public ArcConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ArcConfiguration class. + /// + /// Possible values include: + /// 'LocalNode', 'NetworkFileSystem' + public ArcConfiguration(StorageType? artifactsStorageType = default(StorageType?), string artifactStorageClassName = default(string), string artifactStorageMountPath = default(string), string artifactStorageNodeName = default(string), string artifactStorageAccessMode = default(string), FrontEndConfiguration frontEndServiceConfiguration = default(FrontEndConfiguration), string kubeConfig = default(string)) + { + ArtifactsStorageType = artifactsStorageType; + ArtifactStorageClassName = artifactStorageClassName; + ArtifactStorageMountPath = artifactStorageMountPath; + ArtifactStorageNodeName = artifactStorageNodeName; + ArtifactStorageAccessMode = artifactStorageAccessMode; + FrontEndServiceConfiguration = frontEndServiceConfiguration; + KubeConfig = kubeConfig; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets possible values include: 'LocalNode', + /// 'NetworkFileSystem' + /// + [JsonProperty(PropertyName = "artifactsStorageType")] + public StorageType? ArtifactsStorageType { get; set; } + + /// + /// + [JsonProperty(PropertyName = "artifactStorageClassName")] + public string ArtifactStorageClassName { get; set; } + + /// + /// + [JsonProperty(PropertyName = "artifactStorageMountPath")] + public string ArtifactStorageMountPath { get; set; } + + /// + /// + [JsonProperty(PropertyName = "artifactStorageNodeName")] + public string ArtifactStorageNodeName { get; set; } + + /// + /// + [JsonProperty(PropertyName = "artifactStorageAccessMode")] + public string ArtifactStorageAccessMode { get; set; } + + /// + /// + [JsonProperty(PropertyName = "frontEndServiceConfiguration")] + public FrontEndConfiguration FrontEndServiceConfiguration { get; set; } + + /// + /// + [JsonProperty(PropertyName = "kubeConfig")] + public string KubeConfig { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescription.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescription.cs index e37bb469ac64..52de32488e8f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescription.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescription.cs @@ -30,9 +30,10 @@ public CsmOperationDescription() /// /// Initializes a new instance of the CsmOperationDescription class. /// - public CsmOperationDescription(string name = default(string), CsmOperationDisplay display = default(CsmOperationDisplay), string origin = default(string), CsmOperationDescriptionProperties properties = default(CsmOperationDescriptionProperties)) + public CsmOperationDescription(string name = default(string), bool? isDataAction = default(bool?), CsmOperationDisplay display = default(CsmOperationDisplay), string origin = default(string), CsmOperationDescriptionProperties properties = default(CsmOperationDescriptionProperties)) { Name = name; + IsDataAction = isDataAction; Display = display; Origin = origin; Properties = properties; @@ -49,6 +50,11 @@ public CsmOperationDescription() [JsonProperty(PropertyName = "name")] public string Name { get; set; } + /// + /// + [JsonProperty(PropertyName = "isDataAction")] + public bool? IsDataAction { get; set; } + /// /// [JsonProperty(PropertyName = "display")] diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ExtendedLocation.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ExtendedLocation.cs new file mode 100644 index 000000000000..3fa0e6d091ef --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ExtendedLocation.cs @@ -0,0 +1,59 @@ +// +// 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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Extended Location. + /// + public partial class ExtendedLocation + { + /// + /// Initializes a new instance of the ExtendedLocation class. + /// + public ExtendedLocation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExtendedLocation class. + /// + /// Name of extended location. + /// Type of extended location. + public ExtendedLocation(string name = default(string), string type = default(string)) + { + Name = name; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of extended location. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets type of extended location. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FrontEndConfiguration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FrontEndConfiguration.cs new file mode 100644 index 000000000000..0f851ec956af --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FrontEndConfiguration.cs @@ -0,0 +1,49 @@ +// +// 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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class FrontEndConfiguration + { + /// + /// Initializes a new instance of the FrontEndConfiguration class. + /// + public FrontEndConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FrontEndConfiguration class. + /// + /// Possible values include: 'NodePort', + /// 'LoadBalancer' + public FrontEndConfiguration(FrontEndServiceType? kind = default(FrontEndServiceType?)) + { + Kind = kind; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets possible values include: 'NodePort', 'LoadBalancer' + /// + [JsonProperty(PropertyName = "kind")] + public FrontEndServiceType? Kind { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FrontEndServiceType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FrontEndServiceType.cs new file mode 100644 index 000000000000..b89583e73855 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FrontEndServiceType.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.WebSites.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for FrontEndServiceType. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum FrontEndServiceType + { + [EnumMember(Value = "NodePort")] + NodePort, + [EnumMember(Value = "LoadBalancer")] + LoadBalancer + } + internal static class FrontEndServiceTypeEnumExtension + { + internal static string ToSerializedValue(this FrontEndServiceType? value) + { + return value == null ? null : ((FrontEndServiceType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this FrontEndServiceType value) + { + switch( value ) + { + case FrontEndServiceType.NodePort: + return "NodePort"; + case FrontEndServiceType.LoadBalancer: + return "LoadBalancer"; + } + return null; + } + + internal static FrontEndServiceType? ParseFrontEndServiceType(this string value) + { + switch( value ) + { + case "NodePort": + return FrontEndServiceType.NodePort; + case "LoadBalancer": + return FrontEndServiceType.LoadBalancer; + } + return null; + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironment.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironment.cs new file mode 100644 index 000000000000..17a2f2ac7f9c --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironment.cs @@ -0,0 +1,156 @@ +// +// 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.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A Kubernetes cluster specialized for web workloads by Azure App Service + /// + [Rest.Serialization.JsonTransformation] + public partial class KubeEnvironment : Resource + { + /// + /// Initializes a new instance of the KubeEnvironment class. + /// + public KubeEnvironment() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the KubeEnvironment class. + /// + /// Resource Location. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Resource tags. + /// Provisioning state of the + /// Kubernetes Environment. Possible values include: 'Succeeded', + /// 'Failed', 'Canceled', 'Waiting', 'InitializationInProgress', + /// 'InfrastructureSetupInProgress', 'InfrastructureSetupComplete', + /// 'ScheduledForDelete', 'UpgradeRequested', 'UpgradeFailed' + /// Any errors that occurred during + /// deployment or deployment validation + /// Only visible within + /// Vnet/Subnet + /// Default Domain Name for the + /// cluster + /// Static IP of the KubeEnvironment + /// Cluster configuration which + /// determines the ARC cluster + /// components types. Eg: Choosing between BuildService kind, + /// FrontEnd Service ArtifactsStorageType etc. + /// Cluster configuration which + /// enables the log daemon to export + /// app logs to a destination. Currently only "log-analytics" is + /// supported + public KubeEnvironment(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), KubeEnvironmentProvisioningState? provisioningState = default(KubeEnvironmentProvisioningState?), string deploymentErrors = default(string), bool? internalLoadBalancerEnabled = default(bool?), string defaultDomain = default(string), string staticIp = default(string), ArcConfiguration arcConfiguration = default(ArcConfiguration), AppLogsConfiguration appLogsConfiguration = default(AppLogsConfiguration), string aksResourceID = default(string), ExtendedLocation extendedLocation = default(ExtendedLocation)) + : base(location, id, name, kind, type, tags) + { + ProvisioningState = provisioningState; + DeploymentErrors = deploymentErrors; + InternalLoadBalancerEnabled = internalLoadBalancerEnabled; + DefaultDomain = defaultDomain; + StaticIp = staticIp; + ArcConfiguration = arcConfiguration; + AppLogsConfiguration = appLogsConfiguration; + AksResourceID = aksResourceID; + ExtendedLocation = extendedLocation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets provisioning state of the Kubernetes Environment. Possible + /// values include: 'Succeeded', 'Failed', 'Canceled', 'Waiting', + /// 'InitializationInProgress', 'InfrastructureSetupInProgress', + /// 'InfrastructureSetupComplete', 'ScheduledForDelete', + /// 'UpgradeRequested', 'UpgradeFailed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public KubeEnvironmentProvisioningState? ProvisioningState { get; private set; } + + /// + /// Gets any errors that occurred during deployment or deployment + /// validation + /// + [JsonProperty(PropertyName = "properties.deploymentErrors")] + public string DeploymentErrors { get; private set; } + + /// + /// Gets or sets only visible within Vnet/Subnet + /// + [JsonProperty(PropertyName = "properties.internalLoadBalancerEnabled")] + public bool? InternalLoadBalancerEnabled { get; set; } + + /// + /// Gets default Domain Name for the cluster + /// + [JsonProperty(PropertyName = "properties.defaultDomain")] + public string DefaultDomain { get; private set; } + + /// + /// Gets or sets static IP of the KubeEnvironment + /// + [JsonProperty(PropertyName = "properties.staticIp")] + public string StaticIp { get; set; } + + /// + /// Gets or sets cluster configuration which determines the ARC cluster + /// components types. Eg: Choosing between BuildService kind, + /// FrontEnd Service ArtifactsStorageType etc. + /// + [JsonProperty(PropertyName = "properties.arcConfiguration")] + public ArcConfiguration ArcConfiguration { get; set; } + + /// + /// Gets or sets cluster configuration which enables the log daemon to + /// export + /// app logs to a destination. Currently only "log-analytics" is + /// supported + /// + [JsonProperty(PropertyName = "properties.appLogsConfiguration")] + public AppLogsConfiguration AppLogsConfiguration { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.aksResourceID")] + public string AksResourceID { get; set; } + + /// + /// + [JsonProperty(PropertyName = "extendedLocation")] + public ExtendedLocation ExtendedLocation { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentPatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentPatchResource.cs new file mode 100644 index 000000000000..b68076067de1 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentPatchResource.cs @@ -0,0 +1,138 @@ +// +// 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.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// ARM resource for a KubeEnvironment when patching + /// + [Rest.Serialization.JsonTransformation] + public partial class KubeEnvironmentPatchResource : ProxyOnlyResource + { + /// + /// Initializes a new instance of the KubeEnvironmentPatchResource + /// class. + /// + public KubeEnvironmentPatchResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the KubeEnvironmentPatchResource + /// class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Provisioning state of the + /// Kubernetes Environment. Possible values include: 'Succeeded', + /// 'Failed', 'Canceled', 'Waiting', 'InitializationInProgress', + /// 'InfrastructureSetupInProgress', 'InfrastructureSetupComplete', + /// 'ScheduledForDelete', 'UpgradeRequested', 'UpgradeFailed' + /// Any errors that occurred during + /// deployment or deployment validation + /// Only visible within + /// Vnet/Subnet + /// Default Domain Name for the + /// cluster + /// Static IP of the KubeEnvironment + /// Cluster configuration which + /// determines the ARC cluster + /// components types. Eg: Choosing between BuildService kind, + /// FrontEnd Service ArtifactsStorageType etc. + /// Cluster configuration which + /// enables the log daemon to export + /// app logs to a destination. Currently only "log-analytics" is + /// supported + public KubeEnvironmentPatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), KubeEnvironmentProvisioningState? provisioningState = default(KubeEnvironmentProvisioningState?), string deploymentErrors = default(string), bool? internalLoadBalancerEnabled = default(bool?), string defaultDomain = default(string), string staticIp = default(string), ArcConfiguration arcConfiguration = default(ArcConfiguration), AppLogsConfiguration appLogsConfiguration = default(AppLogsConfiguration), string aksResourceID = default(string)) + : base(id, name, kind, type) + { + ProvisioningState = provisioningState; + DeploymentErrors = deploymentErrors; + InternalLoadBalancerEnabled = internalLoadBalancerEnabled; + DefaultDomain = defaultDomain; + StaticIp = staticIp; + ArcConfiguration = arcConfiguration; + AppLogsConfiguration = appLogsConfiguration; + AksResourceID = aksResourceID; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets provisioning state of the Kubernetes Environment. Possible + /// values include: 'Succeeded', 'Failed', 'Canceled', 'Waiting', + /// 'InitializationInProgress', 'InfrastructureSetupInProgress', + /// 'InfrastructureSetupComplete', 'ScheduledForDelete', + /// 'UpgradeRequested', 'UpgradeFailed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public KubeEnvironmentProvisioningState? ProvisioningState { get; private set; } + + /// + /// Gets any errors that occurred during deployment or deployment + /// validation + /// + [JsonProperty(PropertyName = "properties.deploymentErrors")] + public string DeploymentErrors { get; private set; } + + /// + /// Gets or sets only visible within Vnet/Subnet + /// + [JsonProperty(PropertyName = "properties.internalLoadBalancerEnabled")] + public bool? InternalLoadBalancerEnabled { get; set; } + + /// + /// Gets default Domain Name for the cluster + /// + [JsonProperty(PropertyName = "properties.defaultDomain")] + public string DefaultDomain { get; private set; } + + /// + /// Gets or sets static IP of the KubeEnvironment + /// + [JsonProperty(PropertyName = "properties.staticIp")] + public string StaticIp { get; set; } + + /// + /// Gets or sets cluster configuration which determines the ARC cluster + /// components types. Eg: Choosing between BuildService kind, + /// FrontEnd Service ArtifactsStorageType etc. + /// + [JsonProperty(PropertyName = "properties.arcConfiguration")] + public ArcConfiguration ArcConfiguration { get; set; } + + /// + /// Gets or sets cluster configuration which enables the log daemon to + /// export + /// app logs to a destination. Currently only "log-analytics" is + /// supported + /// + [JsonProperty(PropertyName = "properties.appLogsConfiguration")] + public AppLogsConfiguration AppLogsConfiguration { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.aksResourceID")] + public string AksResourceID { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProvisioningState.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProvisioningState.cs new file mode 100644 index 000000000000..46249dd6048b --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProvisioningState.cs @@ -0,0 +1,108 @@ +// +// 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.WebSites.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for KubeEnvironmentProvisioningState. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum KubeEnvironmentProvisioningState + { + [EnumMember(Value = "Succeeded")] + Succeeded, + [EnumMember(Value = "Failed")] + Failed, + [EnumMember(Value = "Canceled")] + Canceled, + [EnumMember(Value = "Waiting")] + Waiting, + [EnumMember(Value = "InitializationInProgress")] + InitializationInProgress, + [EnumMember(Value = "InfrastructureSetupInProgress")] + InfrastructureSetupInProgress, + [EnumMember(Value = "InfrastructureSetupComplete")] + InfrastructureSetupComplete, + [EnumMember(Value = "ScheduledForDelete")] + ScheduledForDelete, + [EnumMember(Value = "UpgradeRequested")] + UpgradeRequested, + [EnumMember(Value = "UpgradeFailed")] + UpgradeFailed + } + internal static class KubeEnvironmentProvisioningStateEnumExtension + { + internal static string ToSerializedValue(this KubeEnvironmentProvisioningState? value) + { + return value == null ? null : ((KubeEnvironmentProvisioningState)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this KubeEnvironmentProvisioningState value) + { + switch( value ) + { + case KubeEnvironmentProvisioningState.Succeeded: + return "Succeeded"; + case KubeEnvironmentProvisioningState.Failed: + return "Failed"; + case KubeEnvironmentProvisioningState.Canceled: + return "Canceled"; + case KubeEnvironmentProvisioningState.Waiting: + return "Waiting"; + case KubeEnvironmentProvisioningState.InitializationInProgress: + return "InitializationInProgress"; + case KubeEnvironmentProvisioningState.InfrastructureSetupInProgress: + return "InfrastructureSetupInProgress"; + case KubeEnvironmentProvisioningState.InfrastructureSetupComplete: + return "InfrastructureSetupComplete"; + case KubeEnvironmentProvisioningState.ScheduledForDelete: + return "ScheduledForDelete"; + case KubeEnvironmentProvisioningState.UpgradeRequested: + return "UpgradeRequested"; + case KubeEnvironmentProvisioningState.UpgradeFailed: + return "UpgradeFailed"; + } + return null; + } + + internal static KubeEnvironmentProvisioningState? ParseKubeEnvironmentProvisioningState(this string value) + { + switch( value ) + { + case "Succeeded": + return KubeEnvironmentProvisioningState.Succeeded; + case "Failed": + return KubeEnvironmentProvisioningState.Failed; + case "Canceled": + return KubeEnvironmentProvisioningState.Canceled; + case "Waiting": + return KubeEnvironmentProvisioningState.Waiting; + case "InitializationInProgress": + return KubeEnvironmentProvisioningState.InitializationInProgress; + case "InfrastructureSetupInProgress": + return KubeEnvironmentProvisioningState.InfrastructureSetupInProgress; + case "InfrastructureSetupComplete": + return KubeEnvironmentProvisioningState.InfrastructureSetupComplete; + case "ScheduledForDelete": + return KubeEnvironmentProvisioningState.ScheduledForDelete; + case "UpgradeRequested": + return KubeEnvironmentProvisioningState.UpgradeRequested; + case "UpgradeFailed": + return KubeEnvironmentProvisioningState.UpgradeFailed; + } + return null; + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogAnalyticsConfiguration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogAnalyticsConfiguration.cs new file mode 100644 index 000000000000..c2a3350d2da9 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogAnalyticsConfiguration.cs @@ -0,0 +1,52 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class LogAnalyticsConfiguration + { + /// + /// Initializes a new instance of the LogAnalyticsConfiguration class. + /// + public LogAnalyticsConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LogAnalyticsConfiguration class. + /// + public LogAnalyticsConfiguration(string customerId = default(string), string sharedKey = default(string)) + { + CustomerId = customerId; + SharedKey = sharedKey; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "customerId")] + public string CustomerId { get; set; } + + /// + /// + [JsonProperty(PropertyName = "sharedKey")] + public string SharedKey { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.cs index 9d2e1ed4bb32..cda65a55c0cc 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.cs @@ -149,7 +149,7 @@ public Site() /// Integration. /// This must be of the form /// /subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName} - public Site(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string state = default(string), IList hostNames = default(IList), string repositorySiteName = default(string), UsageState? usageState = default(UsageState?), bool? enabled = default(bool?), IList enabledHostNames = default(IList), SiteAvailabilityState? availabilityState = default(SiteAvailabilityState?), IList hostNameSslStates = default(IList), string serverFarmId = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), System.DateTime? lastModifiedTimeUtc = default(System.DateTime?), SiteConfig siteConfig = default(SiteConfig), IList trafficManagerHostNames = default(IList), bool? scmSiteAlsoStopped = default(bool?), string targetSwapSlot = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), bool? clientAffinityEnabled = default(bool?), bool? clientCertEnabled = default(bool?), ClientCertMode? clientCertMode = default(ClientCertMode?), string clientCertExclusionPaths = default(string), bool? hostNamesDisabled = default(bool?), string customDomainVerificationId = default(string), string outboundIpAddresses = default(string), string possibleOutboundIpAddresses = default(string), int? containerSize = default(int?), int? dailyMemoryTimeQuota = default(int?), System.DateTime? suspendedTill = default(System.DateTime?), int? maxNumberOfWorkers = default(int?), CloningInfo cloningInfo = default(CloningInfo), string resourceGroup = default(string), bool? isDefaultContainer = default(bool?), string defaultHostName = default(string), SlotSwapStatus slotSwapStatus = default(SlotSwapStatus), bool? httpsOnly = default(bool?), RedundancyMode? redundancyMode = default(RedundancyMode?), System.Guid? inProgressOperationId = default(System.Guid?), bool? storageAccountRequired = default(bool?), string keyVaultReferenceIdentity = default(string), string virtualNetworkSubnetId = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) + public Site(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string state = default(string), IList hostNames = default(IList), string repositorySiteName = default(string), UsageState? usageState = default(UsageState?), bool? enabled = default(bool?), IList enabledHostNames = default(IList), SiteAvailabilityState? availabilityState = default(SiteAvailabilityState?), IList hostNameSslStates = default(IList), string serverFarmId = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), System.DateTime? lastModifiedTimeUtc = default(System.DateTime?), SiteConfig siteConfig = default(SiteConfig), IList trafficManagerHostNames = default(IList), bool? scmSiteAlsoStopped = default(bool?), string targetSwapSlot = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), bool? clientAffinityEnabled = default(bool?), bool? clientCertEnabled = default(bool?), ClientCertMode? clientCertMode = default(ClientCertMode?), string clientCertExclusionPaths = default(string), bool? hostNamesDisabled = default(bool?), string customDomainVerificationId = default(string), string outboundIpAddresses = default(string), string possibleOutboundIpAddresses = default(string), int? containerSize = default(int?), int? dailyMemoryTimeQuota = default(int?), System.DateTime? suspendedTill = default(System.DateTime?), int? maxNumberOfWorkers = default(int?), CloningInfo cloningInfo = default(CloningInfo), string resourceGroup = default(string), bool? isDefaultContainer = default(bool?), string defaultHostName = default(string), SlotSwapStatus slotSwapStatus = default(SlotSwapStatus), bool? httpsOnly = default(bool?), RedundancyMode? redundancyMode = default(RedundancyMode?), System.Guid? inProgressOperationId = default(System.Guid?), bool? storageAccountRequired = default(bool?), string keyVaultReferenceIdentity = default(string), string virtualNetworkSubnetId = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), ExtendedLocation extendedLocation = default(ExtendedLocation)) : base(location, id, name, kind, type, tags) { State = state; @@ -194,6 +194,7 @@ public Site() KeyVaultReferenceIdentity = keyVaultReferenceIdentity; VirtualNetworkSubnetId = virtualNetworkSubnetId; Identity = identity; + ExtendedLocation = extendedLocation; CustomInit(); } @@ -511,6 +512,11 @@ public Site() [JsonProperty(PropertyName = "identity")] public ManagedServiceIdentity Identity { get; set; } + /// + /// + [JsonProperty(PropertyName = "extendedLocation")] + public ExtendedLocation ExtendedLocation { get; set; } + /// /// Validate the object. /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageType.cs new file mode 100644 index 000000000000..4303d47c3dee --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageType.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.WebSites.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for StorageType. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum StorageType + { + [EnumMember(Value = "LocalNode")] + LocalNode, + [EnumMember(Value = "NetworkFileSystem")] + NetworkFileSystem + } + internal static class StorageTypeEnumExtension + { + internal static string ToSerializedValue(this StorageType? value) + { + return value == null ? null : ((StorageType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this StorageType value) + { + switch( value ) + { + case StorageType.LocalNode: + return "LocalNode"; + case StorageType.NetworkFileSystem: + return "NetworkFileSystem"; + } + return null; + } + + internal static StorageType? ParseStorageType(this string value) + { + switch( value ) + { + case "LocalNode": + return StorageType.LocalNode; + case "NetworkFileSystem": + return StorageType.NetworkFileSystem; + } + return null; + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/SdkInfo_WebSiteManagementClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/SdkInfo_WebSiteManagementClient.cs index e081f8220e4f..f96d148856db 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/SdkInfo_WebSiteManagementClient.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/SdkInfo_WebSiteManagementClient.cs @@ -19,53 +19,43 @@ public static IEnumerable> ApiInfo_WebSiteManageme { return new Tuple[] { - new Tuple("CertificateRegistration", "AppServiceCertificateOrders", "2020-12-01"), - new Tuple("CertificateRegistration", "CertificateOrdersDiagnostics", "2020-12-01"), - new Tuple("CertificateRegistration", "CertificateRegistrationProvider", "2020-12-01"), - new Tuple("DomainRegistration", "DomainRegistrationProvider", "2020-12-01"), - new Tuple("DomainRegistration", "Domains", "2020-12-01"), - new Tuple("DomainRegistration", "TopLevelDomains", "2020-12-01"), - new Tuple("Web", "AppServiceEnvironments", "2020-12-01"), - new Tuple("Web", "AppServicePlans", "2020-12-01"), - new Tuple("Web", "Certificates", "2020-12-01"), - new Tuple("Web", "CheckNameAvailability", "2020-12-01"), - new Tuple("Web", "DeletedWebApps", "2020-12-01"), - new Tuple("Web", "Diagnostics", "2020-12-01"), - new Tuple("Web", "GenerateGithubAccessTokenForAppserviceCLIAsync", "2020-12-01"), - new Tuple("Web", "GetPublishingUser", "2020-12-01"), - new Tuple("Web", "GetSourceControl", "2020-12-01"), - new Tuple("Web", "GetSubscriptionDeploymentLocations", "2020-12-01"), - new Tuple("Web", "Global", "2020-12-01"), - new Tuple("Web", "ListBillingMeters", "2020-12-01"), - new Tuple("Web", "ListGeoRegions", "2020-12-01"), - new Tuple("Web", "ListPremierAddOnOffers", "2020-12-01"), - new Tuple("Web", "ListSiteIdentifiersAssignedToHostName", "2020-12-01"), - new Tuple("Web", "ListSkus", "2020-12-01"), - new Tuple("Web", "ListSourceControls", "2020-12-01"), - new Tuple("Web", "Provider", "2020-12-01"), - new Tuple("Web", "Recommendations", "2020-12-01"), - new Tuple("Web", "ResourceHealthMetadata", "2020-12-01"), - new Tuple("Web", "StaticSites", "2020-12-01"), - new Tuple("Web", "UpdatePublishingUser", "2020-12-01"), - new Tuple("Web", "UpdateSourceControl", "2020-12-01"), - new Tuple("Web", "Validate", "2020-12-01"), - new Tuple("Web", "VerifyHostingEnvironmentVnet", "2020-12-01"), - new Tuple("Web", "WebApps", "2020-12-01"), - new Tuple("WebSiteManagementClient", "Move", "2020-12-01"), - new Tuple("WebSiteManagementClient", "ValidateMove", "2020-12-01"), + new Tuple("CertificateRegistration", "AppServiceCertificateOrders", "2021-01-01"), + new Tuple("CertificateRegistration", "CertificateOrdersDiagnostics", "2021-01-01"), + new Tuple("CertificateRegistration", "CertificateRegistrationProvider", "2021-01-01"), + new Tuple("DomainRegistration", "DomainRegistrationProvider", "2021-01-01"), + new Tuple("DomainRegistration", "Domains", "2021-01-01"), + new Tuple("DomainRegistration", "TopLevelDomains", "2021-01-01"), + new Tuple("Web", "AppServiceEnvironments", "2021-01-01"), + new Tuple("Web", "AppServicePlans", "2021-01-01"), + new Tuple("Web", "Certificates", "2021-01-01"), + new Tuple("Web", "CheckNameAvailability", "2021-01-01"), + new Tuple("Web", "DeletedWebApps", "2021-01-01"), + new Tuple("Web", "Diagnostics", "2021-01-01"), + new Tuple("Web", "GenerateGithubAccessTokenForAppserviceCLIAsync", "2021-01-01"), + new Tuple("Web", "GetPublishingUser", "2021-01-01"), + new Tuple("Web", "GetSourceControl", "2021-01-01"), + new Tuple("Web", "GetSubscriptionDeploymentLocations", "2021-01-01"), + new Tuple("Web", "Global", "2021-01-01"), + new Tuple("Web", "KubeEnvironments", "2021-01-01"), + new Tuple("Web", "ListBillingMeters", "2021-01-01"), + new Tuple("Web", "ListGeoRegions", "2021-01-01"), + new Tuple("Web", "ListPremierAddOnOffers", "2021-01-01"), + new Tuple("Web", "ListSiteIdentifiersAssignedToHostName", "2021-01-01"), + new Tuple("Web", "ListSkus", "2021-01-01"), + new Tuple("Web", "ListSourceControls", "2021-01-01"), + new Tuple("Web", "Provider", "2021-01-01"), + new Tuple("Web", "Recommendations", "2021-01-01"), + new Tuple("Web", "ResourceHealthMetadata", "2021-01-01"), + new Tuple("Web", "StaticSites", "2021-01-01"), + new Tuple("Web", "UpdatePublishingUser", "2021-01-01"), + new Tuple("Web", "UpdateSourceControl", "2021-01-01"), + new Tuple("Web", "Validate", "2021-01-01"), + new Tuple("Web", "VerifyHostingEnvironmentVnet", "2021-01-01"), + new Tuple("Web", "WebApps", "2021-01-01"), + new Tuple("WebSiteManagementClient", "Move", "2021-01-01"), + new Tuple("WebSiteManagementClient", "ValidateMove", "2021-01-01"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/web/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --tag=package-2020-12 --csharp-sdks-folder=K:\\DotNet-SDK\\Apr-2021\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "03a759c3b3c86cecc1c6030cc5e4d6940437706a"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementClient.cs index 0ccd5a99dd44..70af6b9d672f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementClient.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementClient.cs @@ -107,6 +107,16 @@ public partial class WebSiteManagementClient : ServiceClient public virtual IDomainRegistrationProviderOperations DomainRegistrationProvider { get; private set; } + /// + /// Gets the IAppServiceEnvironmentsOperations. + /// + public virtual IAppServiceEnvironmentsOperations AppServiceEnvironments { get; private set; } + + /// + /// Gets the IAppServicePlansOperations. + /// + public virtual IAppServicePlansOperations AppServicePlans { get; private set; } + /// /// Gets the ICertificatesOperations. /// @@ -138,9 +148,9 @@ public partial class WebSiteManagementClient : ServiceClient - /// Gets the IWebAppsOperations. + /// Gets the IResourceHealthMetadataOperations. /// - public virtual IWebAppsOperations WebApps { get; private set; } + public virtual IResourceHealthMetadataOperations ResourceHealthMetadata { get; private set; } /// /// Gets the IStaticSitesOperations. @@ -148,19 +158,14 @@ public partial class WebSiteManagementClient : ServiceClient - /// Gets the IAppServiceEnvironmentsOperations. - /// - public virtual IAppServiceEnvironmentsOperations AppServiceEnvironments { get; private set; } - - /// - /// Gets the IAppServicePlansOperations. + /// Gets the IWebAppsOperations. /// - public virtual IAppServicePlansOperations AppServicePlans { get; private set; } + public virtual IWebAppsOperations WebApps { get; private set; } /// - /// Gets the IResourceHealthMetadataOperations. + /// Gets the IKubeEnvironmentsOperations. /// - public virtual IResourceHealthMetadataOperations ResourceHealthMetadata { get; private set; } + public virtual IKubeEnvironmentsOperations KubeEnvironments { get; private set; } /// /// Initializes a new instance of the WebSiteManagementClient class. @@ -409,19 +414,20 @@ private void Initialize() Domains = new DomainsOperations(this); TopLevelDomains = new TopLevelDomainsOperations(this); DomainRegistrationProvider = new DomainRegistrationProviderOperations(this); + AppServiceEnvironments = new AppServiceEnvironmentsOperations(this); + AppServicePlans = new AppServicePlansOperations(this); Certificates = new CertificatesOperations(this); DeletedWebApps = new DeletedWebAppsOperations(this); Diagnostics = new DiagnosticsOperations(this); GlobalModel = new GlobalModelOperations(this); Provider = new ProviderOperations(this); Recommendations = new RecommendationsOperations(this); - WebApps = new WebAppsOperations(this); - StaticSites = new StaticSitesOperations(this); - AppServiceEnvironments = new AppServiceEnvironmentsOperations(this); - AppServicePlans = new AppServicePlansOperations(this); ResourceHealthMetadata = new ResourceHealthMetadataOperations(this); + StaticSites = new StaticSitesOperations(this); + WebApps = new WebAppsOperations(this); + KubeEnvironments = new KubeEnvironmentsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2020-12-01"; + ApiVersion = "2021-01-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true;