diff --git a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/AdvisorManagementClient.cs b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/AdvisorManagementClient.cs index 9aed0ac6744d1..a876c70d6f407 100644 --- a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/AdvisorManagementClient.cs +++ b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/AdvisorManagementClient.cs @@ -346,7 +346,7 @@ private void Initialize() Operations = new Operations(this); Suppressions = new SuppressionsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2017-04-19"; + ApiVersion = "2020-01-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; diff --git a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/ConfigurationsOperations.cs b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/ConfigurationsOperations.cs index b7f5c75264796..ab439f853f380 100644 --- a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/ConfigurationsOperations.cs +++ b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/ConfigurationsOperations.cs @@ -63,7 +63,7 @@ internal ConfigurationsOperations(AdvisorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -167,14 +167,13 @@ internal ConfigurationsOperations(AdvisorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ArmErrorResponseException(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); + ArmErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -184,10 +183,6 @@ internal ConfigurationsOperations(AdvisorManagementClient client) } 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); @@ -248,7 +243,7 @@ internal ConfigurationsOperations(AdvisorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -263,7 +258,7 @@ internal ConfigurationsOperations(AdvisorManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateInSubscriptionWithHttpMessagesAsync(ConfigData configContract, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateInSubscriptionWithHttpMessagesAsync(ConfigData configContract, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -277,6 +272,7 @@ internal ConfigurationsOperations(AdvisorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string configurationName = "default"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -285,13 +281,15 @@ internal ConfigurationsOperations(AdvisorManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("configContract", configContract); + tracingParameters.Add("configurationName", configurationName); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateInSubscription", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Advisor/configurations").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Advisor/configurations/{configurationName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -361,16 +359,15 @@ internal ConfigurationsOperations(AdvisorManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 400) + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ArmErrorResponseException(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); + ArmErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -380,10 +377,6 @@ internal ConfigurationsOperations(AdvisorManagementClient client) } 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); @@ -396,7 +389,7 @@ internal ConfigurationsOperations(AdvisorManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -404,12 +397,12 @@ internal ConfigurationsOperations(AdvisorManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 400) + if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -440,7 +433,7 @@ internal ConfigurationsOperations(AdvisorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -550,14 +543,13 @@ internal ConfigurationsOperations(AdvisorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ArmErrorResponseException(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); + ArmErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -567,10 +559,6 @@ internal ConfigurationsOperations(AdvisorManagementClient client) } 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); @@ -630,7 +618,7 @@ internal ConfigurationsOperations(AdvisorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -645,7 +633,7 @@ internal ConfigurationsOperations(AdvisorManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateInResourceGroupWithHttpMessagesAsync(ConfigData configContract, string resourceGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateInResourceGroupWithHttpMessagesAsync(ConfigData configContract, string resourceGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -663,6 +651,7 @@ internal ConfigurationsOperations(AdvisorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroup"); } + string configurationName = "default"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -671,14 +660,16 @@ internal ConfigurationsOperations(AdvisorManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("configContract", configContract); + tracingParameters.Add("configurationName", configurationName); tracingParameters.Add("resourceGroup", resourceGroup); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateInResourceGroup", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Advisor/configurations").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Advisor/configurations/{configurationName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); _url = _url.Replace("{resourceGroup}", System.Uri.EscapeDataString(resourceGroup)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -749,16 +740,15 @@ internal ConfigurationsOperations(AdvisorManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 400) + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ArmErrorResponseException(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); + ArmErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -768,10 +758,6 @@ internal ConfigurationsOperations(AdvisorManagementClient client) } 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); @@ -784,7 +770,7 @@ internal ConfigurationsOperations(AdvisorManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -792,12 +778,12 @@ internal ConfigurationsOperations(AdvisorManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 400) + if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -832,7 +818,7 @@ internal ConfigurationsOperations(AdvisorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -928,14 +914,13 @@ internal ConfigurationsOperations(AdvisorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ArmErrorResponseException(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); + ArmErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -945,10 +930,6 @@ internal ConfigurationsOperations(AdvisorManagementClient client) } 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); diff --git a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/ConfigurationsOperationsExtensions.cs b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/ConfigurationsOperationsExtensions.cs index bcdd4405c3ed5..22e643f4335b7 100644 --- a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/ConfigurationsOperationsExtensions.cs +++ b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/ConfigurationsOperationsExtensions.cs @@ -72,7 +72,7 @@ public static IPage ListBySubscription(this IConfigurationsOperation /// /// The Azure Advisor configuration data structure. /// - public static ARMErrorResponseBody CreateInSubscription(this IConfigurationsOperations operations, ConfigData configContract) + public static ConfigData CreateInSubscription(this IConfigurationsOperations operations, ConfigData configContract) { return operations.CreateInSubscriptionAsync(configContract).GetAwaiter().GetResult(); } @@ -93,7 +93,7 @@ public static ARMErrorResponseBody CreateInSubscription(this IConfigurationsOper /// /// The cancellation token. /// - public static async Task CreateInSubscriptionAsync(this IConfigurationsOperations operations, ConfigData configContract, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateInSubscriptionAsync(this IConfigurationsOperations operations, ConfigData configContract, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateInSubscriptionWithHttpMessagesAsync(configContract, null, cancellationToken).ConfigureAwait(false)) { @@ -147,7 +147,7 @@ public static IEnumerable ListByResourceGroup(this IConfigurationsOp /// /// The name of the Azure resource group. /// - public static ARMErrorResponseBody CreateInResourceGroup(this IConfigurationsOperations operations, ConfigData configContract, string resourceGroup) + public static ConfigData CreateInResourceGroup(this IConfigurationsOperations operations, ConfigData configContract, string resourceGroup) { return operations.CreateInResourceGroupAsync(configContract, resourceGroup).GetAwaiter().GetResult(); } @@ -167,7 +167,7 @@ public static ARMErrorResponseBody CreateInResourceGroup(this IConfigurationsOpe /// /// The cancellation token. /// - public static async Task CreateInResourceGroupAsync(this IConfigurationsOperations operations, ConfigData configContract, string resourceGroup, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateInResourceGroupAsync(this IConfigurationsOperations operations, ConfigData configContract, string resourceGroup, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateInResourceGroupWithHttpMessagesAsync(configContract, resourceGroup, null, cancellationToken).ConfigureAwait(false)) { diff --git a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/IConfigurationsOperations.cs b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/IConfigurationsOperations.cs index 8b820eb79e4b0..d19e72b650584 100644 --- a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/IConfigurationsOperations.cs +++ b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/IConfigurationsOperations.cs @@ -36,7 +36,7 @@ public partial interface IConfigurationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -62,7 +62,7 @@ public partial interface IConfigurationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -71,7 +71,7 @@ public partial interface IConfigurationsOperations /// /// Thrown when a required parameter is null /// - Task> CreateInSubscriptionWithHttpMessagesAsync(ConfigData configContract, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateInSubscriptionWithHttpMessagesAsync(ConfigData configContract, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve Azure Advisor configurations. /// @@ -84,7 +84,7 @@ public partial interface IConfigurationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -109,7 +109,7 @@ public partial interface IConfigurationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -118,7 +118,7 @@ public partial interface IConfigurationsOperations /// /// Thrown when a required parameter is null /// - Task> CreateInResourceGroupWithHttpMessagesAsync(ConfigData configContract, string resourceGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateInResourceGroupWithHttpMessagesAsync(ConfigData configContract, string resourceGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve Azure Advisor configurations. /// @@ -135,7 +135,7 @@ public partial interface IConfigurationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/ArmErrorResponse.cs b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/ArmErrorResponse.cs new file mode 100644 index 0000000000000..3e6fe92637eed --- /dev/null +++ b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/ArmErrorResponse.cs @@ -0,0 +1,46 @@ +// +// 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.Advisor.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class ArmErrorResponse + { + /// + /// Initializes a new instance of the ArmErrorResponse class. + /// + public ArmErrorResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ArmErrorResponse class. + /// + public ArmErrorResponse(ARMErrorResponseBody error = default(ARMErrorResponseBody)) + { + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "error")] + public ARMErrorResponseBody Error { get; set; } + + } +} diff --git a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/ArmErrorResponseException.cs b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/ArmErrorResponseException.cs new file mode 100644 index 0000000000000..e0f0706b5a19e --- /dev/null +++ b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/ArmErrorResponseException.cs @@ -0,0 +1,62 @@ +// +// 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.Advisor.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with ArmErrorResponse + /// information. + /// + public partial class ArmErrorResponseException : RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public ArmErrorResponse Body { get; set; } + + /// + /// Initializes a new instance of the ArmErrorResponseException class. + /// + public ArmErrorResponseException() + { + } + + /// + /// Initializes a new instance of the ArmErrorResponseException class. + /// + /// The exception message. + public ArmErrorResponseException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ArmErrorResponseException class. + /// + /// The exception message. + /// Inner exception. + public ArmErrorResponseException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/Category.cs b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/Category.cs index 5a74551292a25..120c76c5893a7 100644 --- a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/Category.cs +++ b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/Category.cs @@ -20,5 +20,6 @@ public static class Category public const string Security = "Security"; public const string Performance = "Performance"; public const string Cost = "Cost"; + public const string OperationalExcellence = "OperationalExcellence"; } } diff --git a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/ConfigData.cs b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/ConfigData.cs index 560d2cfa5d9c2..54165343ff79f 100644 --- a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/ConfigData.cs +++ b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/ConfigData.cs @@ -10,13 +10,18 @@ namespace Microsoft.Azure.Management.Advisor.Models { + using Microsoft.Rest; + using Microsoft.Rest.Serialization; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// The Advisor configuration data structure. /// - public partial class ConfigData + [Rest.Serialization.JsonTransformation] + public partial class ConfigData : Resource { /// /// Initializes a new instance of the ConfigData class. @@ -29,18 +34,23 @@ public ConfigData() /// /// Initializes a new instance of the ConfigData class. /// - /// The resource Id of the configuration - /// resource. - /// The type of the configuration resource. - /// The name of the configuration resource. - /// The list of property name/value - /// pairs. - public ConfigData(string id = default(string), string type = default(string), string name = default(string), ConfigDataProperties properties = default(ConfigDataProperties)) + /// The resource ID. + /// The name of the resource. + /// The type of the resource. + /// Exclude the resource from Advisor + /// evaluations. Valid values: False (default) or True. + /// Minimum percentage threshold for + /// Advisor low CPU utilization evaluation. Valid only for + /// subscriptions. Valid values: 5 (default), 10, 15 or 20. Possible + /// values include: '5', '10', '15', '20' + /// Advisor digest configuration. Valid only for + /// subscriptions + public ConfigData(string id = default(string), string name = default(string), string type = default(string), bool? exclude = default(bool?), string lowCpuThreshold = default(string), IList digests = default(IList)) + : base(id, name, type) { - Id = id; - Type = type; - Name = name; - Properties = properties; + Exclude = exclude; + LowCpuThreshold = lowCpuThreshold; + Digests = digests; CustomInit(); } @@ -50,28 +60,27 @@ public ConfigData() partial void CustomInit(); /// - /// Gets or sets the resource Id of the configuration resource. + /// Gets or sets exclude the resource from Advisor evaluations. Valid + /// values: False (default) or True. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [JsonProperty(PropertyName = "properties.exclude")] + public bool? Exclude { get; set; } /// - /// Gets or sets the type of the configuration resource. + /// Gets or sets minimum percentage threshold for Advisor low CPU + /// utilization evaluation. Valid only for subscriptions. Valid values: + /// 5 (default), 10, 15 or 20. Possible values include: '5', '10', + /// '15', '20' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [JsonProperty(PropertyName = "properties.lowCpuThreshold")] + public string LowCpuThreshold { get; set; } /// - /// Gets or sets the name of the configuration resource. + /// Gets or sets advisor digest configuration. Valid only for + /// subscriptions /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the list of property name/value pairs. - /// - [JsonProperty(PropertyName = "properties")] - public ConfigDataProperties Properties { get; set; } + [JsonProperty(PropertyName = "properties.digests")] + public IList Digests { get; set; } } } diff --git a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/ConfigDataProperties.cs b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/ConfigDataProperties.cs deleted file mode 100644 index 283e0cf44197d..0000000000000 --- a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/ConfigDataProperties.cs +++ /dev/null @@ -1,77 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Advisor.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The list of property name/value pairs. - /// - public partial class ConfigDataProperties - { - /// - /// Initializes a new instance of the ConfigDataProperties class. - /// - public ConfigDataProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ConfigDataProperties class. - /// - /// Unmatched properties from the - /// message are deserialized this collection - /// Exclude the resource from Advisor - /// evaluations. Valid values: False (default) or True. - /// Minimum percentage threshold for - /// Advisor low CPU utilization evaluation. Valid only for - /// subscriptions. Valid values: 5 (default), 10, 15 or 20. - public ConfigDataProperties(IDictionary additionalProperties = default(IDictionary), bool? exclude = default(bool?), string lowCpuThreshold = default(string)) - { - AdditionalProperties = additionalProperties; - Exclude = exclude; - LowCpuThreshold = lowCpuThreshold; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets unmatched properties from the message are deserialized - /// this collection - /// - [JsonExtensionData] - public IDictionary AdditionalProperties { get; set; } - - /// - /// Gets or sets exclude the resource from Advisor evaluations. Valid - /// values: False (default) or True. - /// - [JsonProperty(PropertyName = "exclude")] - public bool? Exclude { get; set; } - - /// - /// Gets or sets minimum percentage threshold for Advisor low CPU - /// utilization evaluation. Valid only for subscriptions. Valid values: - /// 5 (default), 10, 15 or 20. - /// - [JsonProperty(PropertyName = "low_cpu_threshold")] - public string LowCpuThreshold { get; set; } - - } -} diff --git a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/CpuThreshold.cs b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/CpuThreshold.cs new file mode 100644 index 0000000000000..5ff901369049d --- /dev/null +++ b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/CpuThreshold.cs @@ -0,0 +1,24 @@ +// +// 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.Advisor.Models +{ + + /// + /// Defines values for CpuThreshold. + /// + public static class CpuThreshold + { + public const string Five = "5"; + public const string OneZero = "10"; + public const string OneFive = "15"; + public const string TwoZero = "20"; + } +} diff --git a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/DigestConfig.cs b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/DigestConfig.cs new file mode 100644 index 0000000000000..cec820d5b9710 --- /dev/null +++ b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/DigestConfig.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.Advisor.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Advisor Digest configuration entity + /// + public partial class DigestConfig + { + /// + /// Initializes a new instance of the DigestConfig class. + /// + public DigestConfig() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DigestConfig class. + /// + /// Name of digest configuration. Value is + /// case-insensitive and must be unique within a subscription. + /// Action group resource id used + /// by digest. + /// Frequency that digest will be triggered, in + /// days. Value must be between 7 and 30 days inclusive. + /// Categories to send digest for. If + /// categories are not provided, then digest will be sent for all + /// categories. + /// Language for digest content body. Value must + /// be ISO 639-1 code for one of Azure portal supported languages. + /// Otherwise, it will be converted into one. Default value is English + /// (en). + /// State of digest configuration. Possible values + /// include: 'Active', 'Disabled' + public DigestConfig(string name = default(string), string actionGroupResourceId = default(string), int? frequency = default(int?), IList categories = default(IList), string language = default(string), string state = default(string)) + { + Name = name; + ActionGroupResourceId = actionGroupResourceId; + Frequency = frequency; + Categories = categories; + Language = language; + State = state; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of digest configuration. Value is + /// case-insensitive and must be unique within a subscription. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets action group resource id used by digest. + /// + [JsonProperty(PropertyName = "actionGroupResourceId")] + public string ActionGroupResourceId { get; set; } + + /// + /// Gets or sets frequency that digest will be triggered, in days. + /// Value must be between 7 and 30 days inclusive. + /// + [JsonProperty(PropertyName = "frequency")] + public int? Frequency { get; set; } + + /// + /// Gets or sets categories to send digest for. If categories are not + /// provided, then digest will be sent for all categories. + /// + [JsonProperty(PropertyName = "categories")] + public IList Categories { get; set; } + + /// + /// Gets or sets language for digest content body. Value must be ISO + /// 639-1 code for one of Azure portal supported languages. Otherwise, + /// it will be converted into one. Default value is English (en). + /// + [JsonProperty(PropertyName = "language")] + public string Language { get; set; } + + /// + /// Gets or sets state of digest configuration. Possible values + /// include: 'Active', 'Disabled' + /// + [JsonProperty(PropertyName = "state")] + public string State { get; set; } + + } +} diff --git a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/DigestConfigState.cs b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/DigestConfigState.cs new file mode 100644 index 0000000000000..71abaeb0b2b10 --- /dev/null +++ b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/DigestConfigState.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.Advisor.Models +{ + + /// + /// Defines values for DigestConfigState. + /// + public static class DigestConfigState + { + public const string Active = "Active"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/ResourceRecommendationBase.cs b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/ResourceRecommendationBase.cs index 0c4e0b9643ef3..96d7ca9cf3a56 100644 --- a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/ResourceRecommendationBase.cs +++ b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/ResourceRecommendationBase.cs @@ -39,7 +39,7 @@ public ResourceRecommendationBase() /// The type of the resource. /// The category of the recommendation. Possible /// values include: 'HighAvailability', 'Security', 'Performance', - /// 'Cost' + /// 'Cost', 'OperationalExcellence' /// The business impact of the recommendation. /// Possible values include: 'High', 'Medium', 'Low' /// The resource type identified by @@ -83,7 +83,8 @@ public ResourceRecommendationBase() /// /// Gets or sets the category of the recommendation. Possible values - /// include: 'HighAvailability', 'Security', 'Performance', 'Cost' + /// include: 'HighAvailability', 'Security', 'Performance', 'Cost', + /// 'OperationalExcellence' /// [JsonProperty(PropertyName = "properties.category")] public string Category { get; set; } diff --git a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/SdkInfo_AdvisorManagementClient.cs b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/SdkInfo_AdvisorManagementClient.cs index f497618657182..bad0b4a71623c 100644 --- a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/SdkInfo_AdvisorManagementClient.cs +++ b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/SdkInfo_AdvisorManagementClient.cs @@ -19,11 +19,11 @@ public static IEnumerable> ApiInfo_AdvisorManageme { return new Tuple[] { - new Tuple("Advisor", "Configurations", "2017-04-19"), - new Tuple("Advisor", "Operations", "2017-04-19"), - new Tuple("Advisor", "RecommendationMetadata", "2017-04-19"), - new Tuple("Advisor", "Recommendations", "2017-04-19"), - new Tuple("Advisor", "Suppressions", "2017-04-19"), + new Tuple("Advisor", "Configurations", "2020-01-01"), + new Tuple("Advisor", "Operations", "2020-01-01"), + new Tuple("Advisor", "RecommendationMetadata", "2020-01-01"), + new Tuple("Advisor", "Recommendations", "2020-01-01"), + new Tuple("Advisor", "Suppressions", "2020-01-01"), }.AsEnumerable(); } }