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 9aed0ac6744d..a876c70d6f40 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 b7f5c7526479..ab439f853f38 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 bcdd4405c3ed..22e643f4335b 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 8b820eb79e4b..d19e72b65058 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/IOperations.cs b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/IOperations.cs index 6c1140912d21..ea346053d8e4 100644 --- a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/IOperations.cs +++ b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/IOperations.cs @@ -32,7 +32,7 @@ public partial interface IOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -54,7 +54,7 @@ public partial interface IOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/IRecommendationMetadataOperations.cs b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/IRecommendationMetadataOperations.cs index dde0066a0b1d..b3ae72b8220a 100644 --- a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/IRecommendationMetadataOperations.cs +++ b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/IRecommendationMetadataOperations.cs @@ -35,7 +35,7 @@ public partial interface IRecommendationMetadataOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -44,7 +44,7 @@ public partial interface IRecommendationMetadataOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the list of metadata entities. /// @@ -54,7 +54,7 @@ public partial interface IRecommendationMetadataOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -76,7 +76,7 @@ public partial interface IRecommendationMetadataOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/IRecommendationsOperations.cs b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/IRecommendationsOperations.cs index 76ab9e2a6152..4f7e8dcebe35 100644 --- a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/IRecommendationsOperations.cs +++ b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/IRecommendationsOperations.cs @@ -34,7 +34,7 @@ public partial interface IRecommendationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -57,7 +57,7 @@ public partial interface IRecommendationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -70,7 +70,11 @@ public partial interface IRecommendationsOperations /// generateRecommendations. /// /// - /// The filter to apply to the recommendations. + /// The filter to apply to the recommendations.<br>Filter can be + /// applied to properties ['ResourceId', 'ResourceGroup', + /// 'RecommendationTypeGuid', '[Category](#category)'] with operators + /// ['eq', 'and', 'or'].<br>Example:<br>- $filter=Category + /// eq 'Cost' and ResourceGroup eq 'MyResourceGroup' /// /// /// The number of recommendations per page if a paged version of this @@ -86,7 +90,7 @@ public partial interface IRecommendationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -112,7 +116,7 @@ public partial interface IRecommendationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -136,7 +140,7 @@ public partial interface IRecommendationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/ISuppressionsOperations.cs b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/ISuppressionsOperations.cs index cdd8adf3626c..0d38672f4453 100644 --- a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/ISuppressionsOperations.cs +++ b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/ISuppressionsOperations.cs @@ -42,7 +42,7 @@ public partial interface ISuppressionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -78,7 +78,7 @@ public partial interface ISuppressionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -109,7 +109,7 @@ public partial interface ISuppressionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -135,7 +135,7 @@ public partial interface ISuppressionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -159,7 +159,7 @@ public partial interface ISuppressionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/ARMErrorResponseBodyException.cs b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/ARMErrorResponseBodyException.cs new file mode 100644 index 000000000000..0683043a3c51 --- /dev/null +++ b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/ARMErrorResponseBodyException.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 ARMErrorResponseBody + /// information. + /// + public partial class ARMErrorResponseBodyException : 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 ARMErrorResponseBody Body { get; set; } + + /// + /// Initializes a new instance of the ARMErrorResponseBodyException class. + /// + public ARMErrorResponseBodyException() + { + } + + /// + /// Initializes a new instance of the ARMErrorResponseBodyException class. + /// + /// The exception message. + public ARMErrorResponseBodyException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ARMErrorResponseBodyException class. + /// + /// The exception message. + /// Inner exception. + public ARMErrorResponseBodyException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} 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 000000000000..3e6fe92637ee --- /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 000000000000..e0f0706b5a19 --- /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 5a74551292a2..120c76c5893a 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 560d2cfa5d9c..54165343ff79 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 283e0cf44197..000000000000 --- 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 000000000000..5ff901369049 --- /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 000000000000..cec820d5b971 --- /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 000000000000..71abaeb0b2b1 --- /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/ResourceMetadata.cs b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/ResourceMetadata.cs new file mode 100644 index 000000000000..4f4bbf8aacc3 --- /dev/null +++ b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/ResourceMetadata.cs @@ -0,0 +1,91 @@ +// +// 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; + + /// + /// Recommendation resource metadata + /// + public partial class ResourceMetadata + { + /// + /// Initializes a new instance of the ResourceMetadata class. + /// + public ResourceMetadata() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceMetadata class. + /// + /// Azure resource Id of the assessed + /// resource + /// Source from which recommendation is + /// generated + /// The action to view resource. + /// The singular user friendly name of resource + /// type. eg: virtual machine + /// The plural user friendly name of resource + /// type. eg: virtual machines + public ResourceMetadata(string resourceId = default(string), string source = default(string), IDictionary action = default(IDictionary), string singular = default(string), string plural = default(string)) + { + ResourceId = resourceId; + Source = source; + Action = action; + Singular = singular; + Plural = plural; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets azure resource Id of the assessed resource + /// + [JsonProperty(PropertyName = "resourceId")] + public string ResourceId { get; set; } + + /// + /// Gets or sets source from which recommendation is generated + /// + [JsonProperty(PropertyName = "source")] + public string Source { get; set; } + + /// + /// Gets or sets the action to view resource. + /// + [JsonProperty(PropertyName = "action")] + public IDictionary Action { get; set; } + + /// + /// Gets or sets the singular user friendly name of resource type. eg: + /// virtual machine + /// + [JsonProperty(PropertyName = "singular")] + public string Singular { get; set; } + + /// + /// Gets or sets the plural user friendly name of resource type. eg: + /// virtual machines + /// + [JsonProperty(PropertyName = "plural")] + public string Plural { get; set; } + + } +} 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 0c4e0b9643ef..8eba86f1f89f 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 @@ -59,7 +59,23 @@ public ResourceRecommendationBase() /// The list of snoozed and dismissed /// rules for the recommendation. /// Extended properties - public ResourceRecommendationBase(string id = default(string), string name = default(string), string type = default(string), string category = default(string), string impact = default(string), string impactedField = default(string), string impactedValue = default(string), System.DateTime? lastUpdated = default(System.DateTime?), IDictionary metadata = default(IDictionary), string recommendationTypeId = default(string), string risk = default(string), ShortDescription shortDescription = default(ShortDescription), IList suppressionIds = default(IList), IDictionary extendedProperties = default(IDictionary)) + /// Metadata of resource that was + /// assessed + /// The detailed description of + /// recommendation. + /// The label of recommendation. + /// The link to learn more about + /// recommendation and generation logic. + /// The potential benefit of + /// implementing recommendation. + /// The list of recommended actions to implement + /// recommendation. + /// The automated way to apply + /// recommendation. + /// The recommendation metadata + /// properties exposed to customer to provide additional + /// information. + public ResourceRecommendationBase(string id = default(string), string name = default(string), string type = default(string), string category = default(string), string impact = default(string), string impactedField = default(string), string impactedValue = default(string), System.DateTime? lastUpdated = default(System.DateTime?), IDictionary metadata = default(IDictionary), string recommendationTypeId = default(string), string risk = default(string), ShortDescription shortDescription = default(ShortDescription), IList suppressionIds = default(IList), IDictionary extendedProperties = default(IDictionary), ResourceMetadata resourceMetadata = default(ResourceMetadata), string description = default(string), string label = default(string), string learnMoreLink = default(string), string potentialBenefits = default(string), IList> actions = default(IList>), IDictionary remediation = default(IDictionary), IDictionary exposedMetadataProperties = default(IDictionary)) : base(id, name, type) { Category = category; @@ -73,6 +89,14 @@ public ResourceRecommendationBase() ShortDescription = shortDescription; SuppressionIds = suppressionIds; ExtendedProperties = extendedProperties; + ResourceMetadata = resourceMetadata; + Description = description; + Label = label; + LearnMoreLink = learnMoreLink; + PotentialBenefits = potentialBenefits; + Actions = actions; + Remediation = remediation; + ExposedMetadataProperties = exposedMetadataProperties; CustomInit(); } @@ -83,7 +107,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; } @@ -152,5 +177,56 @@ public ResourceRecommendationBase() [JsonProperty(PropertyName = "properties.extendedProperties")] public IDictionary ExtendedProperties { get; set; } + /// + /// Gets or sets metadata of resource that was assessed + /// + [JsonProperty(PropertyName = "properties.resourceMetadata")] + public ResourceMetadata ResourceMetadata { get; set; } + + /// + /// Gets or sets the detailed description of recommendation. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets the label of recommendation. + /// + [JsonProperty(PropertyName = "properties.label")] + public string Label { get; set; } + + /// + /// Gets or sets the link to learn more about recommendation and + /// generation logic. + /// + [JsonProperty(PropertyName = "properties.learnMoreLink")] + public string LearnMoreLink { get; set; } + + /// + /// Gets or sets the potential benefit of implementing recommendation. + /// + [JsonProperty(PropertyName = "properties.potentialBenefits")] + public string PotentialBenefits { get; set; } + + /// + /// Gets or sets the list of recommended actions to implement + /// recommendation. + /// + [JsonProperty(PropertyName = "properties.actions")] + public IList> Actions { get; set; } + + /// + /// Gets or sets the automated way to apply recommendation. + /// + [JsonProperty(PropertyName = "properties.remediation")] + public IDictionary Remediation { get; set; } + + /// + /// Gets or sets the recommendation metadata properties exposed to + /// customer to provide additional information. + /// + [JsonProperty(PropertyName = "properties.exposedMetadataProperties")] + public IDictionary ExposedMetadataProperties { get; set; } + } } diff --git a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/SuppressionContract.cs b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/SuppressionContract.cs index 30d086ffb0a7..a1566bbfeaaa 100644 --- a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/SuppressionContract.cs +++ b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Models/SuppressionContract.cs @@ -39,11 +39,14 @@ public SuppressionContract() /// The GUID of the suppression. /// The duration for which the suppression is /// valid. - public SuppressionContract(string id = default(string), string name = default(string), string type = default(string), string suppressionId = default(string), string ttl = default(string)) + /// Gets or sets the expiration time + /// stamp. + public SuppressionContract(string id = default(string), string name = default(string), string type = default(string), string suppressionId = default(string), string ttl = default(string), System.DateTime? expirationTimeStamp = default(System.DateTime?)) : base(id, name, type) { SuppressionId = suppressionId; Ttl = ttl; + ExpirationTimeStamp = expirationTimeStamp; CustomInit(); } @@ -64,5 +67,11 @@ public SuppressionContract() [JsonProperty(PropertyName = "properties.ttl")] public string Ttl { get; set; } + /// + /// Gets or sets the expiration time stamp. + /// + [JsonProperty(PropertyName = "properties.expirationTimeStamp")] + public System.DateTime? ExpirationTimeStamp { get; private set; } + } } diff --git a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Operations.cs b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Operations.cs index f21b596bc035..698b204e65bd 100644 --- a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Operations.cs +++ b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/Operations.cs @@ -59,7 +59,7 @@ internal Operations(AdvisorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -158,14 +158,13 @@ internal Operations(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; } } @@ -175,10 +174,6 @@ internal Operations(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); @@ -235,7 +230,7 @@ internal Operations(AdvisorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -331,14 +326,13 @@ internal Operations(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; } } @@ -348,10 +342,6 @@ internal Operations(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/RecommendationMetadataOperations.cs b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/RecommendationMetadataOperations.cs index c0e421ce38ac..f32e8f6c8ca4 100644 --- a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/RecommendationMetadataOperations.cs +++ b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/RecommendationMetadataOperations.cs @@ -62,7 +62,7 @@ internal RecommendationMetadataOperations(AdvisorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -77,7 +77,7 @@ internal RecommendationMetadataOperations(AdvisorManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (name == null) { @@ -167,14 +167,13 @@ internal RecommendationMetadataOperations(AdvisorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 404) { - 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 RecommendationMetadataOperations(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); @@ -200,7 +195,7 @@ internal RecommendationMetadataOperations(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")) @@ -259,7 +254,7 @@ internal RecommendationMetadataOperations(AdvisorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -358,14 +353,13 @@ internal RecommendationMetadataOperations(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; } } @@ -375,10 +369,6 @@ internal RecommendationMetadataOperations(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); @@ -435,7 +425,7 @@ internal RecommendationMetadataOperations(AdvisorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -531,14 +521,13 @@ internal RecommendationMetadataOperations(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; } } @@ -548,10 +537,6 @@ internal RecommendationMetadataOperations(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/RecommendationMetadataOperationsExtensions.cs b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/RecommendationMetadataOperationsExtensions.cs index 0ba5fbde6c17..3f63f28983aa 100644 --- a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/RecommendationMetadataOperationsExtensions.cs +++ b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/RecommendationMetadataOperationsExtensions.cs @@ -30,7 +30,7 @@ public static partial class RecommendationMetadataOperationsExtensions /// /// Name of metadata entity. /// - public static object Get(this IRecommendationMetadataOperations operations, string name) + public static MetadataEntity Get(this IRecommendationMetadataOperations operations, string name) { return operations.GetAsync(name).GetAwaiter().GetResult(); } @@ -47,7 +47,7 @@ public static object Get(this IRecommendationMetadataOperations operations, stri /// /// The cancellation token. /// - public static async Task GetAsync(this IRecommendationMetadataOperations operations, string name, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IRecommendationMetadataOperations operations, string name, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(name, null, cancellationToken).ConfigureAwait(false)) { diff --git a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/RecommendationsOperations.cs b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/RecommendationsOperations.cs index b1d8b6644c65..84e68ce2980b 100644 --- a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/RecommendationsOperations.cs +++ b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/RecommendationsOperations.cs @@ -61,7 +61,7 @@ internal RecommendationsOperations(AdvisorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -162,14 +162,13 @@ internal RecommendationsOperations(AdvisorManagementClient client) string _responseContent = null; if ((int)_statusCode != 202) { - 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; } } @@ -179,10 +178,6 @@ internal RecommendationsOperations(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); @@ -237,7 +232,7 @@ internal RecommendationsOperations(AdvisorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -340,14 +335,13 @@ internal RecommendationsOperations(AdvisorManagementClient client) string _responseContent = null; if ((int)_statusCode != 202 && (int)_statusCode != 204) { - 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; } } @@ -357,10 +351,6 @@ internal RecommendationsOperations(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); @@ -392,7 +382,11 @@ internal RecommendationsOperations(AdvisorManagementClient client) /// generated or computed by invoking generateRecommendations. /// /// - /// The filter to apply to the recommendations. + /// The filter to apply to the recommendations.<br>Filter can be applied + /// to properties ['ResourceId', 'ResourceGroup', 'RecommendationTypeGuid', + /// '[Category](#category)'] with operators ['eq', 'and', + /// 'or'].<br>Example:<br>- $filter=Category eq 'Cost' and + /// ResourceGroup eq 'MyResourceGroup' /// /// /// The number of recommendations per page if a paged version of this API is @@ -407,7 +401,7 @@ internal RecommendationsOperations(AdvisorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -526,14 +520,13 @@ internal RecommendationsOperations(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; } } @@ -543,10 +536,6 @@ internal RecommendationsOperations(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); @@ -607,7 +596,7 @@ internal RecommendationsOperations(AdvisorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -718,14 +707,13 @@ internal RecommendationsOperations(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; } } @@ -735,10 +723,6 @@ internal RecommendationsOperations(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); @@ -796,7 +780,7 @@ internal RecommendationsOperations(AdvisorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -892,14 +876,13 @@ internal RecommendationsOperations(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; } } @@ -909,10 +892,6 @@ internal RecommendationsOperations(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/RecommendationsOperationsExtensions.cs b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/RecommendationsOperationsExtensions.cs index bfdec37064e4..4020f25e67ec 100644 --- a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/RecommendationsOperationsExtensions.cs +++ b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/RecommendationsOperationsExtensions.cs @@ -98,7 +98,11 @@ public static void GetGenerateStatus(this IRecommendationsOperations operations, /// The operations group for this extension method. /// /// - /// The filter to apply to the recommendations. + /// The filter to apply to the recommendations.<br>Filter can be applied + /// to properties ['ResourceId', 'ResourceGroup', 'RecommendationTypeGuid', + /// '[Category](#category)'] with operators ['eq', 'and', + /// 'or'].<br>Example:<br>- $filter=Category eq 'Cost' and + /// ResourceGroup eq 'MyResourceGroup' /// /// /// The number of recommendations per page if a paged version of this API is @@ -120,7 +124,11 @@ public static void GetGenerateStatus(this IRecommendationsOperations operations, /// The operations group for this extension method. /// /// - /// The filter to apply to the recommendations. + /// The filter to apply to the recommendations.<br>Filter can be applied + /// to properties ['ResourceId', 'ResourceGroup', 'RecommendationTypeGuid', + /// '[Category](#category)'] with operators ['eq', 'and', + /// 'or'].<br>Example:<br>- $filter=Category eq 'Cost' and + /// ResourceGroup eq 'MyResourceGroup' /// /// /// The number of recommendations per page if a paged version of this API is 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 f49761865718..bad0b4a71623 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(); } } diff --git a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/SuppressionsOperations.cs b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/SuppressionsOperations.cs index 16fd878d2c42..272690e60ad9 100644 --- a/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/SuppressionsOperations.cs +++ b/sdk/advisor/Microsoft.Azure.Management.Advisor/src/Generated/SuppressionsOperations.cs @@ -69,7 +69,7 @@ internal SuppressionsOperations(AdvisorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -184,16 +184,15 @@ internal SuppressionsOperations(AdvisorManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { - 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; } } @@ -203,10 +202,6 @@ internal SuppressionsOperations(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); @@ -244,6 +239,24 @@ internal SuppressionsOperations(AdvisorManagementClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + // Deserialize Response + if ((int)_statusCode == 404) + { + _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); @@ -275,7 +288,7 @@ internal SuppressionsOperations(AdvisorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -401,16 +414,15 @@ internal SuppressionsOperations(AdvisorManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { - 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; } } @@ -420,10 +432,6 @@ internal SuppressionsOperations(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); @@ -461,6 +469,24 @@ internal SuppressionsOperations(AdvisorManagementClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + // Deserialize Response + if ((int)_statusCode == 404) + { + _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); @@ -489,7 +515,7 @@ internal SuppressionsOperations(AdvisorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -603,14 +629,13 @@ internal SuppressionsOperations(AdvisorManagementClient client) string _responseContent = null; if ((int)_statusCode != 204) { - 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; } } @@ -620,10 +645,6 @@ internal SuppressionsOperations(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); @@ -668,7 +689,7 @@ internal SuppressionsOperations(AdvisorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -782,14 +803,13 @@ internal SuppressionsOperations(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; } } @@ -799,10 +819,6 @@ internal SuppressionsOperations(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); @@ -861,7 +877,7 @@ internal SuppressionsOperations(AdvisorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -957,14 +973,13 @@ internal SuppressionsOperations(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; } } @@ -974,10 +989,6 @@ internal SuppressionsOperations(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);