diff --git a/eng/mgmt/mgmtmetadata/attestation_resource-manager.txt b/eng/mgmt/mgmtmetadata/attestation_resource-manager.txt new file mode 100644 index 000000000000..cd5229163250 --- /dev/null +++ b/eng/mgmt/mgmtmetadata/attestation_resource-manager.txt @@ -0,0 +1,14 @@ +Installing AutoRest version: latest +AutoRest installed successfully. +Commencing code generation +Generating CSharp code +Executing AutoRest command +cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/attestation/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=C:\azure-sdk-for-net\sdk +2019-07-18 06:23:11 UTC +Azure-rest-api-specs repository information +GitHub fork: Azure +Branch: master +Commit: 76c353d92b8037fe1e02c36deeb06d78d284e5d7 +AutoRest information +Requested version: latest +Bootstrapper version: autorest@2.0.4283 diff --git a/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/AttestationManagementClient.cs b/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/AttestationManagementClient.cs index e81def4e32b5..dbdd7cceb407 100644 --- a/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/AttestationManagementClient.cs +++ b/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/AttestationManagementClient.cs @@ -48,16 +48,14 @@ public partial class AttestationManagementClient : ServiceClient - /// Subscription credentials that uniquely identify the Microsoft Azure - /// subscription. The subscription ID forms part of the URI for every service - /// call. + /// Client API version. /// - public string SubscriptionId { get; set; } + public string ApiVersion { get; private set; } /// - /// Client API version. + /// The ID of the target subscription. /// - public string ApiVersion { get; private set; } + public string SubscriptionId { get; set; } /// /// The preferred language for the response. diff --git a/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/AttestationProvidersOperations.cs b/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/AttestationProvidersOperations.cs index ee7849be7257..3a90bf5f0156 100644 --- a/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/AttestationProvidersOperations.cs +++ b/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/AttestationProvidersOperations.cs @@ -54,7 +54,7 @@ internal AttestationProvidersOperations(AttestationManagementClient client) /// Get the status of Attestation Provider. /// /// - /// Name of the resource group to which the resource belongs. + /// The name of the resource group. The name is case insensitive. /// /// /// Name of the attestation service instance @@ -65,7 +65,7 @@ internal AttestationProvidersOperations(AttestationManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -86,6 +86,13 @@ internal AttestationProvidersOperations(AttestationManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -100,22 +107,15 @@ internal AttestationProvidersOperations(AttestationManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } if (providerName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "providerName"); } - if (providerName != null) - { - if (!System.Text.RegularExpressions.Regex.IsMatch(providerName, "^[a-z0-9]{3,24}$")) - { - throw new ValidationException(ValidationRules.Pattern, "providerName", "^[a-z0-9]{3,24}$"); - } - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -199,13 +199,14 @@ internal AttestationProvidersOperations(AttestationManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ErrorResultException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResult _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -215,6 +216,10 @@ internal AttestationProvidersOperations(AttestationManagementClient 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); @@ -263,7 +268,7 @@ internal AttestationProvidersOperations(AttestationManagementClient client) /// Creates or updates the Attestation Provider. /// /// - /// Name of the resource group to which the resource belongs. + /// The name of the resource group. The name is case insensitive. /// /// /// Name of the attestation service @@ -277,7 +282,7 @@ internal AttestationProvidersOperations(AttestationManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -298,6 +303,13 @@ internal AttestationProvidersOperations(AttestationManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -312,22 +324,15 @@ internal AttestationProvidersOperations(AttestationManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } if (providerName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "providerName"); } - if (providerName != null) - { - if (!System.Text.RegularExpressions.Regex.IsMatch(providerName, "^[a-zA-Z0-9-]{3,24}$")) - { - throw new ValidationException(ValidationRules.Pattern, "providerName", "^[a-zA-Z0-9-]{3,24}$"); - } - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -418,13 +423,14 @@ internal AttestationProvidersOperations(AttestationManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new ErrorResultException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResult _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -434,6 +440,10 @@ internal AttestationProvidersOperations(AttestationManagementClient 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); @@ -500,7 +510,7 @@ internal AttestationProvidersOperations(AttestationManagementClient client) /// Delete Attestation Service. /// /// - /// Name of the resource group to which the resource belongs. + /// The name of the resource group. The name is case insensitive. /// /// /// Name of the attestation service @@ -511,7 +521,7 @@ internal AttestationProvidersOperations(AttestationManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -529,6 +539,13 @@ internal AttestationProvidersOperations(AttestationManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -543,22 +560,15 @@ internal AttestationProvidersOperations(AttestationManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } if (providerName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "providerName"); } - if (providerName != null) - { - if (!System.Text.RegularExpressions.Regex.IsMatch(providerName, "^[a-zA-Z0-9-]{3,24}$")) - { - throw new ValidationException(ValidationRules.Pattern, "providerName", "^[a-zA-Z0-9-]{3,24}$"); - } - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -642,13 +652,14 @@ internal AttestationProvidersOperations(AttestationManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new ErrorResultException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResult _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -658,6 +669,10 @@ internal AttestationProvidersOperations(AttestationManagementClient 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); @@ -693,7 +708,7 @@ internal AttestationProvidersOperations(AttestationManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -714,6 +729,13 @@ internal AttestationProvidersOperations(AttestationManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -793,13 +815,14 @@ internal AttestationProvidersOperations(AttestationManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ErrorResultException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResult _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -809,6 +832,10 @@ internal AttestationProvidersOperations(AttestationManagementClient 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); @@ -857,7 +884,7 @@ internal AttestationProvidersOperations(AttestationManagementClient client) /// Returns attestation providers list in a resource group. /// /// - /// Name of the resource group to which the resource belongs. + /// The name of the resource group. The name is case insensitive. /// /// /// Headers that will be added to request. @@ -865,7 +892,7 @@ internal AttestationProvidersOperations(AttestationManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -896,15 +923,22 @@ internal AttestationProvidersOperations(AttestationManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -986,13 +1020,14 @@ internal AttestationProvidersOperations(AttestationManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ErrorResultException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResult _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1002,6 +1037,10 @@ internal AttestationProvidersOperations(AttestationManagementClient 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/attestation/Microsoft.Azure.Management.Attestation/src/Generated/AttestationProvidersOperationsExtensions.cs b/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/AttestationProvidersOperationsExtensions.cs index adb206c1320e..1e5b7fa16c5d 100644 --- a/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/AttestationProvidersOperationsExtensions.cs +++ b/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/AttestationProvidersOperationsExtensions.cs @@ -30,7 +30,7 @@ public static partial class AttestationProvidersOperationsExtensions /// The operations group for this extension method. /// /// - /// Name of the resource group to which the resource belongs. + /// The name of the resource group. The name is case insensitive. /// /// /// Name of the attestation service instance @@ -47,7 +47,7 @@ public static AttestationProvider Get(this IAttestationProvidersOperations opera /// The operations group for this extension method. /// /// - /// Name of the resource group to which the resource belongs. + /// The name of the resource group. The name is case insensitive. /// /// /// Name of the attestation service instance @@ -70,7 +70,7 @@ public static AttestationProvider Get(this IAttestationProvidersOperations opera /// The operations group for this extension method. /// /// - /// Name of the resource group to which the resource belongs. + /// The name of the resource group. The name is case insensitive. /// /// /// Name of the attestation service @@ -90,7 +90,7 @@ public static AttestationProvider Get(this IAttestationProvidersOperations opera /// The operations group for this extension method. /// /// - /// Name of the resource group to which the resource belongs. + /// The name of the resource group. The name is case insensitive. /// /// /// Name of the attestation service @@ -116,7 +116,7 @@ public static AttestationProvider Get(this IAttestationProvidersOperations opera /// The operations group for this extension method. /// /// - /// Name of the resource group to which the resource belongs. + /// The name of the resource group. The name is case insensitive. /// /// /// Name of the attestation service @@ -133,7 +133,7 @@ public static void Delete(this IAttestationProvidersOperations operations, strin /// The operations group for this extension method. /// /// - /// Name of the resource group to which the resource belongs. + /// The name of the resource group. The name is case insensitive. /// /// /// Name of the attestation service @@ -181,7 +181,7 @@ public static IEnumerable List(this IAttestationProvidersOp /// The operations group for this extension method. /// /// - /// Name of the resource group to which the resource belongs. + /// The name of the resource group. The name is case insensitive. /// public static IEnumerable ListByResourceGroup(this IAttestationProvidersOperations operations, string resourceGroupName) { @@ -195,7 +195,7 @@ public static IEnumerable ListByResourceGroup(this IAttesta /// The operations group for this extension method. /// /// - /// Name of the resource group to which the resource belongs. + /// The name of the resource group. The name is case insensitive. /// /// /// The cancellation token. diff --git a/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/IAttestationManagementClient.cs b/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/IAttestationManagementClient.cs index ae4c3e5cd426..89861c1868bc 100644 --- a/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/IAttestationManagementClient.cs +++ b/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/IAttestationManagementClient.cs @@ -42,16 +42,14 @@ public partial interface IAttestationManagementClient : System.IDisposable ServiceClientCredentials Credentials { get; } /// - /// Subscription credentials that uniquely identify the Microsoft Azure - /// subscription. The subscription ID forms part of the URI for every - /// service call. + /// Client API version. /// - string SubscriptionId { get; set; } + string ApiVersion { get; } /// - /// Client API version. + /// The ID of the target subscription. /// - string ApiVersion { get; } + string SubscriptionId { get; set; } /// /// The preferred language for the response. diff --git a/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/IAttestationProvidersOperations.cs b/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/IAttestationProvidersOperations.cs index 96fab0d8cc89..75218fb7bd3f 100644 --- a/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/IAttestationProvidersOperations.cs +++ b/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/IAttestationProvidersOperations.cs @@ -27,7 +27,7 @@ public partial interface IAttestationProvidersOperations /// Get the status of Attestation Provider. /// /// - /// Name of the resource group to which the resource belongs. + /// The name of the resource group. The name is case insensitive. /// /// /// Name of the attestation service instance @@ -38,7 +38,7 @@ public partial interface IAttestationProvidersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -52,7 +52,7 @@ public partial interface IAttestationProvidersOperations /// Creates or updates the Attestation Provider. /// /// - /// Name of the resource group to which the resource belongs. + /// The name of the resource group. The name is case insensitive. /// /// /// Name of the attestation service @@ -66,7 +66,7 @@ public partial interface IAttestationProvidersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -80,7 +80,7 @@ public partial interface IAttestationProvidersOperations /// Delete Attestation Service. /// /// - /// Name of the resource group to which the resource belongs. + /// The name of the resource group. The name is case insensitive. /// /// /// Name of the attestation service @@ -91,7 +91,7 @@ public partial interface IAttestationProvidersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -107,7 +107,7 @@ public partial interface IAttestationProvidersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -121,7 +121,7 @@ public partial interface IAttestationProvidersOperations /// Returns attestation providers list in a resource group. /// /// - /// Name of the resource group to which the resource belongs. + /// The name of the resource group. The name is case insensitive. /// /// /// The headers that will be added to request. @@ -129,7 +129,7 @@ public partial interface IAttestationProvidersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/IOperations.cs b/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/IOperations.cs index 9fcf29e842c9..ab7abf8e6217 100644 --- a/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/IOperations.cs +++ b/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/IOperations.cs @@ -32,7 +32,7 @@ public partial interface IOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/Models/ErrorResponse.cs b/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/Models/ErrorResponse.cs deleted file mode 100644 index 9dc3e2518c66..000000000000 --- a/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/Models/ErrorResponse.cs +++ /dev/null @@ -1,51 +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.Attestation.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Error response - /// - public partial class ErrorResponse - { - /// - /// Initializes a new instance of the ErrorResponse class. - /// - public ErrorResponse() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ErrorResponse class. - /// - /// Error response - public ErrorResponse(ErrorResponseError error = default(ErrorResponseError)) - { - Error = error; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets error response - /// - [JsonProperty(PropertyName = "error")] - public ErrorResponseError Error { get; set; } - - } -} diff --git a/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/Models/ErrorResponseBody.cs b/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/Models/ErrorResponseBody.cs deleted file mode 100644 index b32bc28b5ab2..000000000000 --- a/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/Models/ErrorResponseBody.cs +++ /dev/null @@ -1,80 +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.Attestation.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Error - /// - /// - /// Error description and code explaining why an operation failed. - /// - public partial class ErrorResponseBody - { - /// - /// Initializes a new instance of the ErrorResponseBody class. - /// - public ErrorResponseBody() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ErrorResponseBody class. - /// - /// Description of the error. - /// Service specific error code - public ErrorResponseBody(string message, string code) - { - Message = message; - Code = code; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets description of the error. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } - - /// - /// Gets or sets service specific error code - /// - [JsonProperty(PropertyName = "code")] - public string Code { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Message == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Message"); - } - if (Code == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Code"); - } - } - } -} diff --git a/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/Models/ErrorResponseError.cs b/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/Models/ErrorResponseError.cs deleted file mode 100644 index 7c7d88e1680b..000000000000 --- a/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/Models/ErrorResponseError.cs +++ /dev/null @@ -1,59 +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.Attestation.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Error response - /// - public partial class ErrorResponseError - { - /// - /// Initializes a new instance of the ErrorResponseError class. - /// - public ErrorResponseError() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ErrorResponseError class. - /// - /// Description of the error. - /// Service specific error code. - public ErrorResponseError(string code = default(string), string message = default(string)) - { - Code = code; - Message = message; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets description of the error. - /// - [JsonProperty(PropertyName = "code")] - public string Code { get; set; } - - /// - /// Gets or sets service specific error code. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } - - } -} diff --git a/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/Models/ErrorResult.cs b/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/Models/ErrorResult.cs deleted file mode 100644 index 55db5a72b248..000000000000 --- a/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/Models/ErrorResult.cs +++ /dev/null @@ -1,67 +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.Attestation.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Error - /// - /// - /// Error description and code explaining why an operation failed. - /// - public partial class ErrorResult - { - /// - /// Initializes a new instance of the ErrorResult class. - /// - public ErrorResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ErrorResult class. - /// - /// Error object. - public ErrorResult(ErrorResponseBody error = default(ErrorResponseBody)) - { - Error = error; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets error object. - /// - [JsonProperty(PropertyName = "error")] - public ErrorResponseBody Error { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Error != null) - { - Error.Validate(); - } - } - } -} diff --git a/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/Models/ErrorResultException.cs b/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/Models/ErrorResultException.cs deleted file mode 100644 index 820737b5cec4..000000000000 --- a/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/Models/ErrorResultException.cs +++ /dev/null @@ -1,61 +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.Attestation.Models -{ - using Microsoft.Rest; - - /// - /// Exception thrown for an invalid response with ErrorResult information. - /// - public partial class ErrorResultException : 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 ErrorResult Body { get; set; } - - /// - /// Initializes a new instance of the ErrorResultException class. - /// - public ErrorResultException() - { - } - - /// - /// Initializes a new instance of the ErrorResultException class. - /// - /// The exception message. - public ErrorResultException(string message) - : this(message, null) - { - } - - /// - /// Initializes a new instance of the ErrorResultException class. - /// - /// The exception message. - /// Inner exception. - public ErrorResultException(string message, System.Exception innerException) - : base(message, innerException) - { - } - } -} diff --git a/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/Operations.cs b/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/Operations.cs index 1889867e4308..d8efd6c507a6 100644 --- a/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/Operations.cs +++ b/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/Operations.cs @@ -59,7 +59,7 @@ internal Operations(AttestationManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -148,13 +148,14 @@ internal Operations(AttestationManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ErrorResultException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResult _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -164,6 +165,10 @@ internal Operations(AttestationManagementClient 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/attestation/Microsoft.Azure.Management.Attestation/src/Generated/SdkInfo_AttestationManagementClient.cs b/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/SdkInfo_AttestationManagementClient.cs index d73cbdde8c92..8a7744bc37a7 100644 --- a/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/SdkInfo_AttestationManagementClient.cs +++ b/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Generated/SdkInfo_AttestationManagementClient.cs @@ -24,5 +24,16 @@ public static IEnumerable> ApiInfo_AttestationMana }.AsEnumerable(); } } + // BEGIN: Code Generation Metadata Section + public static readonly String AutoRestVersion = "latest"; + public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; + public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/attestation/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=C:\\azure-sdk-for-net\\sdk"; + public static readonly String GithubForkName = "Azure"; + public static readonly String GithubBranchName = "master"; + public static readonly String GithubCommidId = "76c353d92b8037fe1e02c36deeb06d78d284e5d7"; + public static readonly String CodeGenerationErrors = ""; + public static readonly String GithubRepoName = "azure-rest-api-specs"; + // END: Code Generation Metadata Section } } + diff --git a/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Microsoft.Azure.Management.Attestation.csproj b/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Microsoft.Azure.Management.Attestation.csproj index cc7562f08f5d..75aa80657dbc 100644 --- a/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Microsoft.Azure.Management.Attestation.csproj +++ b/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Microsoft.Azure.Management.Attestation.csproj @@ -6,7 +6,7 @@ Microsoft Azure Attestation Library Microsoft.Azure.Management.Attestation - 0.9.5-preview + 0.9.6-preview Microsoft.Azure.Management.Attestation Management.Attestation;Attestation;recommendations; diff --git a/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Properties/AssemblyInfo.cs b/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Properties/AssemblyInfo.cs index 4b6182efb557..12d7715f8743 100644 --- a/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Properties/AssemblyInfo.cs +++ b/sdk/attestation/Microsoft.Azure.Management.Attestation/src/Properties/AssemblyInfo.cs @@ -7,8 +7,8 @@ [assembly: AssemblyTitle("Microsoft Azure Attestation Management Library")] [assembly: AssemblyDescription("Provides management functionality for Microsoft Azure Attestation recommendations.")] -[assembly: AssemblyVersion("0.9.0.0")] -[assembly: AssemblyFileVersion("0.9.5.0")] +[assembly: AssemblyVersion("0.9.6.0")] +[assembly: AssemblyFileVersion("0.9.6.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Microsoft Azure .NET SDK")]