From 29829900031365c50102b9777bce3849dc77f371 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 24 Nov 2020 04:05:51 +0000 Subject: [PATCH] CodeGen from PR 10858 in Azure/azure-rest-api-specs add validate config server(stable) (#10858) * add validate config server(stable) * prettier * typo --- .../Generated/AppPlatformManagementClient.cs | 6 + .../src/Generated/ConfigServersOperations.cs | 255 ++++++++++++++++++ .../ConfigServersOperationsExtensions.cs | 96 +++++++ .../Generated/IAppPlatformManagementClient.cs | 5 + .../src/Generated/IConfigServersOperations.cs | 60 +++++ .../Generated/IRuntimeVersionsOperations.cs | 47 ++++ .../Models/AvailableRuntimeVersions.cs | 51 ++++ .../Models/ConfigServerSettingsErrorRecord.cs | 74 +++++ .../ConfigServerSettingsValidateResult.cs | 64 +++++ .../Generated/Models/DeploymentInstance.cs | 11 +- .../Generated/Models/DeploymentSettings.cs | 15 +- .../src/Generated/Models/NetworkProfile.cs | 11 +- .../Models/NetworkProfileOutboundIPs.cs | 53 ++++ .../src/Generated/Models/RuntimeVersion.cs | 1 + .../Models/SupportedRuntimePlatform.cs | 22 ++ .../Generated/Models/SupportedRuntimeValue.cs | 23 ++ .../Models/SupportedRuntimeVersion.cs | 75 ++++++ .../src/Generated/Models/UserSourceInfo.cs | 4 +- .../src/Generated/Models/UserSourceType.cs | 1 + .../Generated/RuntimeVersionsOperations.cs | 218 +++++++++++++++ .../RuntimeVersionsOperationsExtensions.cs | 55 ++++ .../SdkInfo_AppPlatformManagementClient.cs | 12 +- 22 files changed, 1141 insertions(+), 18 deletions(-) create mode 100644 sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IRuntimeVersionsOperations.cs create mode 100644 sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/AvailableRuntimeVersions.cs create mode 100644 sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/ConfigServerSettingsErrorRecord.cs create mode 100644 sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/ConfigServerSettingsValidateResult.cs create mode 100644 sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/NetworkProfileOutboundIPs.cs create mode 100644 sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/SupportedRuntimePlatform.cs create mode 100644 sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/SupportedRuntimeValue.cs create mode 100644 sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/SupportedRuntimeVersion.cs create mode 100644 sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/RuntimeVersionsOperations.cs create mode 100644 sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/RuntimeVersionsOperationsExtensions.cs diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/AppPlatformManagementClient.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/AppPlatformManagementClient.cs index bd2bce28203f1..81f3eb06ba65d 100644 --- a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/AppPlatformManagementClient.cs +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/AppPlatformManagementClient.cs @@ -121,6 +121,11 @@ public partial class AppPlatformManagementClient : ServiceClient public virtual IOperations Operations { get; private set; } + /// + /// Gets the IRuntimeVersionsOperations. + /// + public virtual IRuntimeVersionsOperations RuntimeVersions { get; private set; } + /// /// Gets the ISkusOperations. /// @@ -376,6 +381,7 @@ private void Initialize() CustomDomains = new CustomDomainsOperations(this); Deployments = new DeploymentsOperations(this); Operations = new Operations(this); + RuntimeVersions = new RuntimeVersionsOperations(this); Skus = new SkusOperations(this); BaseUri = new System.Uri("https://management.azure.com"); ApiVersion = "2020-07-01"; diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/ConfigServersOperations.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/ConfigServersOperations.cs index 23371dfa06567..b6eda2afa8443 100644 --- a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/ConfigServersOperations.cs +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/ConfigServersOperations.cs @@ -295,6 +295,32 @@ internal ConfigServersOperations(AppPlatformManagementClient client) return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } + /// + /// Check if the config server settings are valid. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// Config server settings to be validated + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> ValidateWithHttpMessagesAsync(string resourceGroupName, string serviceName, ConfigServerSettings configServerSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginValidateWithHttpMessagesAsync(resourceGroupName, serviceName, configServerSettings, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Update the config server. /// @@ -749,5 +775,234 @@ internal ConfigServersOperations(AppPlatformManagementClient client) return _result; } + /// + /// Check if the config server settings are valid. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// Config server settings to be validated + /// + /// + /// 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> BeginValidateWithHttpMessagesAsync(string resourceGroupName, string serviceName, ConfigServerSettings configServerSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + } + if (configServerSettings == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configServerSettings"); + } + if (configServerSettings != null) + { + configServerSettings.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("configServerSettings", configServerSettings); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginValidate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(configServerSettings != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(configServerSettings, 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 != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + } } diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/ConfigServersOperationsExtensions.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/ConfigServersOperationsExtensions.cs index 4c39e83152f27..5f12bb0a679db 100644 --- a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/ConfigServersOperationsExtensions.cs +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/ConfigServersOperationsExtensions.cs @@ -159,6 +159,54 @@ public static ConfigServerResource UpdatePatch(this IConfigServersOperations ope } } + /// + /// Check if the config server settings are valid. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// Config server settings to be validated + /// + public static ConfigServerSettingsValidateResult Validate(this IConfigServersOperations operations, string resourceGroupName, string serviceName, ConfigServerSettings configServerSettings) + { + return operations.ValidateAsync(resourceGroupName, serviceName, configServerSettings).GetAwaiter().GetResult(); + } + + /// + /// Check if the config server settings are valid. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// Config server settings to be validated + /// + /// + /// The cancellation token. + /// + public static async Task ValidateAsync(this IConfigServersOperations operations, string resourceGroupName, string serviceName, ConfigServerSettings configServerSettings, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ValidateWithHttpMessagesAsync(resourceGroupName, serviceName, configServerSettings, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Update the config server. /// @@ -255,5 +303,53 @@ public static ConfigServerResource BeginUpdatePatch(this IConfigServersOperation } } + /// + /// Check if the config server settings are valid. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// Config server settings to be validated + /// + public static ConfigServerSettingsValidateResult BeginValidate(this IConfigServersOperations operations, string resourceGroupName, string serviceName, ConfigServerSettings configServerSettings) + { + return operations.BeginValidateAsync(resourceGroupName, serviceName, configServerSettings).GetAwaiter().GetResult(); + } + + /// + /// Check if the config server settings are valid. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// Config server settings to be validated + /// + /// + /// The cancellation token. + /// + public static async Task BeginValidateAsync(this IConfigServersOperations operations, string resourceGroupName, string serviceName, ConfigServerSettings configServerSettings, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginValidateWithHttpMessagesAsync(resourceGroupName, serviceName, configServerSettings, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IAppPlatformManagementClient.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IAppPlatformManagementClient.cs index 9c4f133213174..e39d20eb85621 100644 --- a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IAppPlatformManagementClient.cs +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IAppPlatformManagementClient.cs @@ -116,6 +116,11 @@ public partial interface IAppPlatformManagementClient : System.IDisposable /// IOperations Operations { get; } + /// + /// Gets the IRuntimeVersionsOperations. + /// + IRuntimeVersionsOperations RuntimeVersions { get; } + /// /// Gets the ISkusOperations. /// diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IConfigServersOperations.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IConfigServersOperations.cs index c8847958b2bf9..a2069478d3cdc 100644 --- a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IConfigServersOperations.cs +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IConfigServersOperations.cs @@ -111,6 +111,36 @@ public partial interface IConfigServersOperations /// Task> UpdatePatchWithHttpMessagesAsync(string resourceGroupName, string serviceName, ConfigServerResource configServerResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Check if the config server settings are valid. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// Config server settings to be validated + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ValidateWithHttpMessagesAsync(string resourceGroupName, string serviceName, ConfigServerSettings configServerSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Update the config server. /// /// @@ -170,5 +200,35 @@ public partial interface IConfigServersOperations /// Thrown when a required parameter is null /// Task> BeginUpdatePatchWithHttpMessagesAsync(string resourceGroupName, string serviceName, ConfigServerResource configServerResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Check if the config server settings are valid. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the Service resource. + /// + /// + /// Config server settings to be validated + /// + /// + /// 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> BeginValidateWithHttpMessagesAsync(string resourceGroupName, string serviceName, ConfigServerSettings configServerSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IRuntimeVersionsOperations.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IRuntimeVersionsOperations.cs new file mode 100644 index 0000000000000..5d400ba6005be --- /dev/null +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/IRuntimeVersionsOperations.cs @@ -0,0 +1,47 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.AppPlatform +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// RuntimeVersionsOperations operations. + /// + public partial interface IRuntimeVersionsOperations + { + /// + /// Lists all of the available runtime versions supported by + /// Microsoft.AppPlatform provider. + /// + /// + /// 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> ListRuntimeVersionsWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/AvailableRuntimeVersions.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/AvailableRuntimeVersions.cs new file mode 100644 index 0000000000000..e43ab6c67933c --- /dev/null +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/AvailableRuntimeVersions.cs @@ -0,0 +1,51 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.AppPlatform.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class AvailableRuntimeVersions + { + /// + /// Initializes a new instance of the AvailableRuntimeVersions class. + /// + public AvailableRuntimeVersions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AvailableRuntimeVersions class. + /// + /// A list of all supported runtime + /// versions. + public AvailableRuntimeVersions(IList value = default(IList)) + { + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a list of all supported runtime versions. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; private set; } + + } +} diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/ConfigServerSettingsErrorRecord.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/ConfigServerSettingsErrorRecord.cs new file mode 100644 index 0000000000000..c9789943485b1 --- /dev/null +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/ConfigServerSettingsErrorRecord.cs @@ -0,0 +1,74 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.AppPlatform.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Error record of the config server settings + /// + public partial class ConfigServerSettingsErrorRecord + { + /// + /// Initializes a new instance of the ConfigServerSettingsErrorRecord + /// class. + /// + public ConfigServerSettingsErrorRecord() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ConfigServerSettingsErrorRecord + /// class. + /// + /// The name of the config server settings error + /// record + /// The uri of the config server settings error + /// record + /// The detail error messages of the + /// record + public ConfigServerSettingsErrorRecord(string name = default(string), string uri = default(string), IList messages = default(IList)) + { + Name = name; + Uri = uri; + Messages = messages; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the config server settings error record + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the uri of the config server settings error record + /// + [JsonProperty(PropertyName = "uri")] + public string Uri { get; set; } + + /// + /// Gets or sets the detail error messages of the record + /// + [JsonProperty(PropertyName = "messages")] + public IList Messages { get; set; } + + } +} diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/ConfigServerSettingsValidateResult.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/ConfigServerSettingsValidateResult.cs new file mode 100644 index 0000000000000..74042dfd81741 --- /dev/null +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/ConfigServerSettingsValidateResult.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.AppPlatform.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Validation result for config server settings + /// + public partial class ConfigServerSettingsValidateResult + { + /// + /// Initializes a new instance of the + /// ConfigServerSettingsValidateResult class. + /// + public ConfigServerSettingsValidateResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ConfigServerSettingsValidateResult class. + /// + /// Indicate if the config server settings are + /// valid + /// The detail validation results + public ConfigServerSettingsValidateResult(bool? isValid = default(bool?), IList details = default(IList)) + { + IsValid = isValid; + Details = details; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets indicate if the config server settings are valid + /// + [JsonProperty(PropertyName = "isValid")] + public bool? IsValid { get; set; } + + /// + /// Gets or sets the detail validation results + /// + [JsonProperty(PropertyName = "details")] + public IList Details { get; set; } + + } +} diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/DeploymentInstance.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/DeploymentInstance.cs index d6d46ffb419f3..65d7e0ce73317 100644 --- a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/DeploymentInstance.cs +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/DeploymentInstance.cs @@ -35,12 +35,15 @@ public DeploymentInstance() /// instance /// Discovery status of the deployment /// instance - public DeploymentInstance(string name = default(string), string status = default(string), string reason = default(string), string discoveryStatus = default(string)) + /// Start time of the deployment + /// instance + public DeploymentInstance(string name = default(string), string status = default(string), string reason = default(string), string discoveryStatus = default(string), string startTime = default(string)) { Name = name; Status = status; Reason = reason; DiscoveryStatus = discoveryStatus; + StartTime = startTime; CustomInit(); } @@ -73,5 +76,11 @@ public DeploymentInstance() [JsonProperty(PropertyName = "discoveryStatus")] public string DiscoveryStatus { get; private set; } + /// + /// Gets start time of the deployment instance + /// + [JsonProperty(PropertyName = "startTime")] + public string StartTime { get; private set; } + } } diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/DeploymentSettings.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/DeploymentSettings.cs index 22a75d79a93dc..232e2fb3c3e0e 100644 --- a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/DeploymentSettings.cs +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/DeploymentSettings.cs @@ -37,15 +37,18 @@ public DeploymentSettings() /// should be in range (1, 2), standard tier should be in range (1, /// 8) /// JVM parameter + /// The path to the .NET executable + /// relative to zip root /// Collection of environment /// variables /// Runtime version. Possible values - /// include: 'Java_8', 'Java_11' - public DeploymentSettings(int? cpu = default(int?), int? memoryInGB = default(int?), string jvmOptions = default(string), IDictionary environmentVariables = default(IDictionary), string runtimeVersion = default(string)) + /// include: 'Java_8', 'Java_11', 'NetCore_31' + public DeploymentSettings(int? cpu = default(int?), int? memoryInGB = default(int?), string jvmOptions = default(string), string netCoreMainEntryPath = default(string), IDictionary environmentVariables = default(IDictionary), string runtimeVersion = default(string)) { Cpu = cpu; MemoryInGB = memoryInGB; JvmOptions = jvmOptions; + NetCoreMainEntryPath = netCoreMainEntryPath; EnvironmentVariables = environmentVariables; RuntimeVersion = runtimeVersion; CustomInit(); @@ -76,6 +79,12 @@ public DeploymentSettings() [JsonProperty(PropertyName = "jvmOptions")] public string JvmOptions { get; set; } + /// + /// Gets or sets the path to the .NET executable relative to zip root + /// + [JsonProperty(PropertyName = "netCoreMainEntryPath")] + public string NetCoreMainEntryPath { get; set; } + /// /// Gets or sets collection of environment variables /// @@ -84,7 +93,7 @@ public DeploymentSettings() /// /// Gets or sets runtime version. Possible values include: 'Java_8', - /// 'Java_11' + /// 'Java_11', 'NetCore_31' /// [JsonProperty(PropertyName = "runtimeVersion")] public string RuntimeVersion { get; set; } diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/NetworkProfile.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/NetworkProfile.cs index 22cf9244ea34f..45061fc0544e0 100644 --- a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/NetworkProfile.cs +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/NetworkProfile.cs @@ -40,13 +40,16 @@ public NetworkProfile() /// Service Runtime /// Name of the resource group /// containing network resources of Azure Spring Cloud Apps - public NetworkProfile(string serviceRuntimeSubnetId = default(string), string appSubnetId = default(string), string serviceCidr = default(string), string serviceRuntimeNetworkResourceGroup = default(string), string appNetworkResourceGroup = default(string)) + /// Desired outbound IP resources for Azure + /// Spring Cloud instance. + public NetworkProfile(string serviceRuntimeSubnetId = default(string), string appSubnetId = default(string), string serviceCidr = default(string), string serviceRuntimeNetworkResourceGroup = default(string), string appNetworkResourceGroup = default(string), NetworkProfileOutboundIPs outboundIPs = default(NetworkProfileOutboundIPs)) { ServiceRuntimeSubnetId = serviceRuntimeSubnetId; AppSubnetId = appSubnetId; ServiceCidr = serviceCidr; ServiceRuntimeNetworkResourceGroup = serviceRuntimeNetworkResourceGroup; AppNetworkResourceGroup = appNetworkResourceGroup; + OutboundIPs = outboundIPs; CustomInit(); } @@ -89,5 +92,11 @@ public NetworkProfile() [JsonProperty(PropertyName = "appNetworkResourceGroup")] public string AppNetworkResourceGroup { get; set; } + /// + /// Gets desired outbound IP resources for Azure Spring Cloud instance. + /// + [JsonProperty(PropertyName = "outboundIPs")] + public NetworkProfileOutboundIPs OutboundIPs { get; private set; } + } } diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/NetworkProfileOutboundIPs.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/NetworkProfileOutboundIPs.cs new file mode 100644 index 0000000000000..c652972316d3c --- /dev/null +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/NetworkProfileOutboundIPs.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.AppPlatform.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Desired outbound IP resources for Azure Spring Cloud instance. + /// + public partial class NetworkProfileOutboundIPs + { + /// + /// Initializes a new instance of the NetworkProfileOutboundIPs class. + /// + public NetworkProfileOutboundIPs() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkProfileOutboundIPs class. + /// + /// A list of public IP addresses. + public NetworkProfileOutboundIPs(IList publicIPs = default(IList)) + { + PublicIPs = publicIPs; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a list of public IP addresses. + /// + [JsonProperty(PropertyName = "publicIPs")] + public IList PublicIPs { get; private set; } + + } +} diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/RuntimeVersion.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/RuntimeVersion.cs index 8ed6b3d5bfd94..20cb840e2164f 100644 --- a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/RuntimeVersion.cs +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/RuntimeVersion.cs @@ -18,5 +18,6 @@ public static class RuntimeVersion { public const string Java8 = "Java_8"; public const string Java11 = "Java_11"; + public const string NetCore31 = "NetCore_31"; } } diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/SupportedRuntimePlatform.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/SupportedRuntimePlatform.cs new file mode 100644 index 0000000000000..97b855b27ec50 --- /dev/null +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/SupportedRuntimePlatform.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.AppPlatform.Models +{ + + /// + /// Defines values for SupportedRuntimePlatform. + /// + public static class SupportedRuntimePlatform + { + public const string Java = "Java"; + public const string NETCore = ".NET Core"; + } +} diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/SupportedRuntimeValue.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/SupportedRuntimeValue.cs new file mode 100644 index 0000000000000..0f33fd5a77b1b --- /dev/null +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/SupportedRuntimeValue.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.AppPlatform.Models +{ + + /// + /// Defines values for SupportedRuntimeValue. + /// + public static class SupportedRuntimeValue + { + public const string Java8 = "Java_8"; + public const string Java11 = "Java_11"; + public const string NetCore31 = "NetCore_31"; + } +} diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/SupportedRuntimeVersion.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/SupportedRuntimeVersion.cs new file mode 100644 index 0000000000000..c083092060a28 --- /dev/null +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/SupportedRuntimeVersion.cs @@ -0,0 +1,75 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.AppPlatform.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Supported deployment runtime version descriptor. + /// + public partial class SupportedRuntimeVersion + { + /// + /// Initializes a new instance of the SupportedRuntimeVersion class. + /// + public SupportedRuntimeVersion() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SupportedRuntimeVersion class. + /// + /// The raw value which could be passed to + /// deployment CRUD operations. Possible values include: 'Java_8', + /// 'Java_11', 'NetCore_31' + /// The platform of this runtime version + /// (possible values: "Java" or ".NET"). Possible values include: + /// 'Java', '.NET Core' + /// The detailed version (major.minor) of the + /// platform. + public SupportedRuntimeVersion(string value = default(string), string platform = default(string), string version = default(string)) + { + Value = value; + Platform = platform; + Version = version; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the raw value which could be passed to deployment CRUD + /// operations. Possible values include: 'Java_8', 'Java_11', + /// 'NetCore_31' + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; set; } + + /// + /// Gets or sets the platform of this runtime version (possible values: + /// "Java" or ".NET"). Possible values include: 'Java', '.NET Core' + /// + [JsonProperty(PropertyName = "platform")] + public string Platform { get; set; } + + /// + /// Gets or sets the detailed version (major.minor) of the platform. + /// + [JsonProperty(PropertyName = "version")] + public string Version { get; set; } + + } +} diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/UserSourceInfo.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/UserSourceInfo.cs index 8d24e6c2e9c3a..134ca697d8a25 100644 --- a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/UserSourceInfo.cs +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/UserSourceInfo.cs @@ -30,7 +30,7 @@ public UserSourceInfo() /// Initializes a new instance of the UserSourceInfo class. /// /// Type of the source uploaded. Possible values - /// include: 'Jar', 'Source' + /// include: 'Jar', 'NetCoreZip', 'Source' /// Relative path of the storage which /// stores the source /// Version of the source @@ -53,7 +53,7 @@ public UserSourceInfo() /// /// Gets or sets type of the source uploaded. Possible values include: - /// 'Jar', 'Source' + /// 'Jar', 'NetCoreZip', 'Source' /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/UserSourceType.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/UserSourceType.cs index dc52cbfed23a5..278fdb334cb3a 100644 --- a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/UserSourceType.cs +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/Models/UserSourceType.cs @@ -17,6 +17,7 @@ namespace Microsoft.Azure.Management.AppPlatform.Models public static class UserSourceType { public const string Jar = "Jar"; + public const string NetCoreZip = "NetCoreZip"; public const string Source = "Source"; } } diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/RuntimeVersionsOperations.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/RuntimeVersionsOperations.cs new file mode 100644 index 0000000000000..cbb006997fc73 --- /dev/null +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/RuntimeVersionsOperations.cs @@ -0,0 +1,218 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.AppPlatform +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// RuntimeVersionsOperations operations. + /// + internal partial class RuntimeVersionsOperations : IServiceOperations, IRuntimeVersionsOperations + { + /// + /// Initializes a new instance of the RuntimeVersionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal RuntimeVersionsOperations(AppPlatformManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AppPlatformManagementClient + /// + public AppPlatformManagementClient Client { get; private set; } + + /// + /// Lists all of the available runtime versions supported by + /// Microsoft.AppPlatform provider. + /// + /// + /// 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 + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListRuntimeVersionsWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // 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, "ListRuntimeVersions", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.AppPlatform/runtimeVersions").ToString(); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/RuntimeVersionsOperationsExtensions.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/RuntimeVersionsOperationsExtensions.cs new file mode 100644 index 0000000000000..058bf0ab66cfa --- /dev/null +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/RuntimeVersionsOperationsExtensions.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.AppPlatform +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for RuntimeVersionsOperations. + /// + public static partial class RuntimeVersionsOperationsExtensions + { + /// + /// Lists all of the available runtime versions supported by + /// Microsoft.AppPlatform provider. + /// + /// + /// The operations group for this extension method. + /// + public static AvailableRuntimeVersions ListRuntimeVersions(this IRuntimeVersionsOperations operations) + { + return operations.ListRuntimeVersionsAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all of the available runtime versions supported by + /// Microsoft.AppPlatform provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task ListRuntimeVersionsAsync(this IRuntimeVersionsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListRuntimeVersionsWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/SdkInfo_AppPlatformManagementClient.cs b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/SdkInfo_AppPlatformManagementClient.cs index 0733735f0fe79..af14bc204e116 100644 --- a/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/SdkInfo_AppPlatformManagementClient.cs +++ b/sdk/appplatform/Microsoft.Azure.Management.AppPlatform/src/Generated/SdkInfo_AppPlatformManagementClient.cs @@ -27,21 +27,11 @@ public static IEnumerable> ApiInfo_AppPlatformMana new Tuple("AppPlatform", "Deployments", "2020-07-01"), new Tuple("AppPlatform", "MonitoringSettings", "2020-07-01"), new Tuple("AppPlatform", "Operations", "2020-07-01"), + new Tuple("AppPlatform", "RuntimeVersions", "2020-07-01"), new Tuple("AppPlatform", "Services", "2020-07-01"), new Tuple("AppPlatform", "Skus", "2020-07-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/appplatform/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\\code\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "d6d4333280243b7003565fc1caedb60c188b3b3a"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } -