From 7a3e4853aa779903753eb92f7898e076b945da50 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Thu, 30 Jan 2020 20:35:11 +0000 Subject: [PATCH] Generated from c52ab5b54ab97b572170746f27ef05ce412911f2 adjusted sdk generation --- .../Generated/AutoQuotaIncreaseOperations.cs | 428 +++++++++++ .../AutoQuotaIncreaseOperationsExtensions.cs | 119 +++ .../Generated/AzureReservationAPIClient.cs | 59 +- .../Generated/IAutoQuotaIncreaseOperations.cs | 84 +++ .../Generated/IAzureReservationAPIClient.cs | 31 +- .../src/Generated/IQuotaOperations.cs | 66 ++ .../src/Generated/IQuotaRequestOperations.cs | 243 +++++++ .../src/Generated/IQuotaRequestsOperations.cs | 148 ++++ .../src/Generated/IQuotasOperations.cs | 89 +++ .../src/Generated/IReservationOperations.cs | 4 +- .../src/Generated/Models/AqiSettings.cs | 53 ++ .../Models/AutoQuotaIncreaseDetail.cs | 105 +++ .../Models/CatalogBillingPlansItem.cs | 68 -- .../CreateGenericQuotaRequestParameters.cs | 55 ++ .../src/Generated/Models/CurrentQuotaLimit.cs | 132 ++++ .../Generated/Models/CurrentQuotaLimitBase.cs | 114 +++ .../Models/CurrentQuotaLimitBaseName.cs | 60 ++ .../src/Generated/Models/EmailAction.cs | 52 ++ .../src/Generated/Models/EmailActions.cs | 55 ++ .../src/Generated/Models/ExceptionResponse.cs | 51 ++ .../Models/ExceptionResponseException.cs | 62 ++ .../src/Generated/Models/OnFailure.cs | 61 ++ .../Generated/Models/OnFailureEmailActions.cs | 53 ++ .../Generated/Models/OnFailurePhoneActions.cs | 53 ++ .../src/Generated/Models/PhoneAction.cs | 60 ++ .../Generated/Models/QuotaLimitsResponse.cs | 64 ++ .../Models/QuotaListStatusHeaders.cs | 53 ++ .../Generated/Models/QuotaRequestDetails.cs | 110 +++ .../QuotaRequestOneResourceSubmitResponse.cs | 171 +++++ .../Models/QuotaRequestProperties.cs | 81 +++ .../Models/QuotaRequestSubmitResponse.cs | 78 ++ .../Models/QuotaRequestSubmitResponse201.cs | 90 +++ .../Models/QuotasListStatusHeaders.cs | 53 ++ .../src/Generated/Models/ScopeProperties.cs | 10 +- .../src/Generated/Models/ServiceError.cs | 69 ++ .../Generated/Models/ServiceErrorDetail.cs | 59 ++ .../src/Generated/Models/SubRequest.cs | 103 +++ .../src/Generated/Models/SubRequestName.cs | 59 ++ .../Models/SubscriptionScopeProperties.cs | 6 +- .../Generated/Models/SupportRequestAction.cs | 130 ++++ .../src/Generated/OperationOperations.cs | 16 +- .../src/Generated/QuotaOperations.cs | 276 +++++++ .../Generated/QuotaOperationsExtensions.cs | 91 +++ .../src/Generated/QuotaRequestOperations.cs | 686 ++++++++++++++++++ .../QuotaRequestOperationsExtensions.cs | 409 +++++++++++ .../src/Generated/QuotaRequestsOperations.cs | 673 +++++++++++++++++ .../QuotaRequestsOperationsExtensions.cs | 231 ++++++ .../src/Generated/QuotasOperations.cs | 453 ++++++++++++ .../Generated/QuotasOperationsExtensions.cs | 129 ++++ .../src/Generated/ReservationOperations.cs | 74 +- .../ReservationOperationsExtensions.cs | 8 +- .../Generated/ReservationOrderOperations.cs | 46 +- .../Generated/SdkInfo_AzureReservationAPI.cs | 15 +- 53 files changed, 6341 insertions(+), 207 deletions(-) create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/AutoQuotaIncreaseOperations.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/AutoQuotaIncreaseOperationsExtensions.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IAutoQuotaIncreaseOperations.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IQuotaOperations.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IQuotaRequestOperations.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IQuotaRequestsOperations.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IQuotasOperations.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/AqiSettings.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/AutoQuotaIncreaseDetail.cs delete mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/CatalogBillingPlansItem.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/CreateGenericQuotaRequestParameters.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/CurrentQuotaLimit.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/CurrentQuotaLimitBase.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/CurrentQuotaLimitBaseName.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/EmailAction.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/EmailActions.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ExceptionResponse.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ExceptionResponseException.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/OnFailure.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/OnFailureEmailActions.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/OnFailurePhoneActions.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/PhoneAction.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotaLimitsResponse.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotaListStatusHeaders.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotaRequestDetails.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotaRequestOneResourceSubmitResponse.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotaRequestProperties.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotaRequestSubmitResponse.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotaRequestSubmitResponse201.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotasListStatusHeaders.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ServiceError.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ServiceErrorDetail.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/SubRequest.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/SubRequestName.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/SupportRequestAction.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotaOperations.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotaOperationsExtensions.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotaRequestOperations.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotaRequestOperationsExtensions.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotaRequestsOperations.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotaRequestsOperationsExtensions.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotasOperations.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotasOperationsExtensions.cs diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/AutoQuotaIncreaseOperations.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/AutoQuotaIncreaseOperations.cs new file mode 100644 index 000000000000..ab98e008159b --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/AutoQuotaIncreaseOperations.cs @@ -0,0 +1,428 @@ +// +// 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.Reservations +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// AutoQuotaIncreaseOperations operations. + /// + internal partial class AutoQuotaIncreaseOperations : IServiceOperations, IAutoQuotaIncreaseOperations + { + /// + /// Initializes a new instance of the AutoQuotaIncreaseOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal AutoQuotaIncreaseOperations(AzureReservationAPIClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureReservationAPIClient + /// + public AzureReservationAPIClient Client { get; private set; } + + /// + /// For the specified subscription, gets the Auto Quota Increase enrollment + /// status. + /// + /// + /// Gets the Auto Quota Increase enrollment details for the specified + /// subscription. + /// + /// + /// Azure subscription id. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetPropertiesWithHttpMessagesAsync(string subscriptionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (subscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "subscriptionId"); + } + string apiVersion = "2019-07-19-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("subscriptionId", subscriptionId); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetProperties", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Capacity/autoQuotaIncrease").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(subscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ExceptionResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ExceptionResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// For the specified subscription, sets the Auto Quota Increase enrollment + /// properties. + /// + /// + /// Sets the Auto Quota Increase enrollment properties for the specified + /// subscription. + /// + /// + /// Azure subscription id. + /// + /// + /// Auto Quota increase request payload. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateWithHttpMessagesAsync(string subscriptionId, AutoQuotaIncreaseDetail autoQuotaIncreaseRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (subscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "subscriptionId"); + } + if (autoQuotaIncreaseRequest == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "autoQuotaIncreaseRequest"); + } + string apiVersion = "2019-07-19-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("subscriptionId", subscriptionId); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("autoQuotaIncreaseRequest", autoQuotaIncreaseRequest); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Capacity/autoQuotaIncrease").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(subscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(autoQuotaIncreaseRequest != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(autoQuotaIncreaseRequest, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ExceptionResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ExceptionResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/AutoQuotaIncreaseOperationsExtensions.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/AutoQuotaIncreaseOperationsExtensions.cs new file mode 100644 index 000000000000..9eb35dec2df9 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/AutoQuotaIncreaseOperationsExtensions.cs @@ -0,0 +1,119 @@ +// +// 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.Reservations +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for AutoQuotaIncreaseOperations. + /// + public static partial class AutoQuotaIncreaseOperationsExtensions + { + /// + /// For the specified subscription, gets the Auto Quota Increase enrollment + /// status. + /// + /// + /// Gets the Auto Quota Increase enrollment details for the specified + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure subscription id. + /// + public static AutoQuotaIncreaseDetail GetProperties(this IAutoQuotaIncreaseOperations operations, string subscriptionId) + { + return operations.GetPropertiesAsync(subscriptionId).GetAwaiter().GetResult(); + } + + /// + /// For the specified subscription, gets the Auto Quota Increase enrollment + /// status. + /// + /// + /// Gets the Auto Quota Increase enrollment details for the specified + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure subscription id. + /// + /// + /// The cancellation token. + /// + public static async Task GetPropertiesAsync(this IAutoQuotaIncreaseOperations operations, string subscriptionId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPropertiesWithHttpMessagesAsync(subscriptionId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// For the specified subscription, sets the Auto Quota Increase enrollment + /// properties. + /// + /// + /// Sets the Auto Quota Increase enrollment properties for the specified + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure subscription id. + /// + /// + /// Auto Quota increase request payload. + /// + public static AutoQuotaIncreaseDetail Create(this IAutoQuotaIncreaseOperations operations, string subscriptionId, AutoQuotaIncreaseDetail autoQuotaIncreaseRequest) + { + return operations.CreateAsync(subscriptionId, autoQuotaIncreaseRequest).GetAwaiter().GetResult(); + } + + /// + /// For the specified subscription, sets the Auto Quota Increase enrollment + /// properties. + /// + /// + /// Sets the Auto Quota Increase enrollment properties for the specified + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure subscription id. + /// + /// + /// Auto Quota increase request payload. + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this IAutoQuotaIncreaseOperations operations, string subscriptionId, AutoQuotaIncreaseDetail autoQuotaIncreaseRequest, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(subscriptionId, autoQuotaIncreaseRequest, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/AzureReservationAPIClient.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/AzureReservationAPIClient.cs index c489108e8097..86d4fcd080d1 100644 --- a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/AzureReservationAPIClient.cs +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/AzureReservationAPIClient.cs @@ -23,9 +23,6 @@ namespace Microsoft.Azure.Management.Reservations using System.Threading; using System.Threading.Tasks; - /// - /// This API describe Azure Reservation - /// public partial class AzureReservationAPIClient : ServiceClient, IAzureReservationAPIClient, IAzureClient { /// @@ -48,11 +45,6 @@ public partial class AzureReservationAPIClient : ServiceClient public ServiceClientCredentials Credentials { get; private set; } - /// - /// Supported version for this document is 2019-04-01 - /// - public string ApiVersion { get; private set; } - /// /// The preferred language for the response. /// @@ -71,6 +63,31 @@ public partial class AzureReservationAPIClient : ServiceClient public bool? GenerateClientRequestId { get; set; } + /// + /// Gets the IQuotaOperations. + /// + public virtual IQuotaOperations Quota { get; private set; } + + /// + /// Gets the IQuotaRequestOperations. + /// + public virtual IQuotaRequestOperations QuotaRequest { get; private set; } + + /// + /// Gets the IQuotasOperations. + /// + public virtual IQuotasOperations Quotas { get; private set; } + + /// + /// Gets the IQuotaRequestsOperations. + /// + public virtual IQuotaRequestsOperations QuotaRequests { get; private set; } + + /// + /// Gets the IAutoQuotaIncreaseOperations. + /// + public virtual IAutoQuotaIncreaseOperations AutoQuotaIncrease { get; private set; } + /// /// Gets the IReservationOperations. /// @@ -327,11 +344,15 @@ public AzureReservationAPIClient(System.Uri baseUri, ServiceClientCredentials cr /// private void Initialize() { + Quota = new QuotaOperations(this); + QuotaRequest = new QuotaRequestOperations(this); + Quotas = new QuotasOperations(this); + QuotaRequests = new QuotaRequestsOperations(this); + AutoQuotaIncrease = new AutoQuotaIncreaseOperations(this); Reservation = new ReservationOperations(this); ReservationOrder = new ReservationOrderOperations(this); Operation = new OperationOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2019-04-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; @@ -402,10 +423,6 @@ private void Initialize() /// public async Task>> GetCatalogWithHttpMessagesAsync(string subscriptionId, string reservedResourceType, string location = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); - } if (subscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "subscriptionId"); @@ -414,6 +431,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "reservedResourceType"); } + string apiVersion = "2019-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -421,6 +439,7 @@ private void Initialize() { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("subscriptionId", subscriptionId); tracingParameters.Add("reservedResourceType", reservedResourceType); tracingParameters.Add("location", location); @@ -432,9 +451,9 @@ private void Initialize() var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Capacity/catalogs").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(subscriptionId)); List _queryParameters = new List(); - if (ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (reservedResourceType != null) { @@ -597,14 +616,11 @@ private void Initialize() /// public async Task> GetAppliedReservationListWithHttpMessagesAsync(string subscriptionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); - } if (subscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "subscriptionId"); } + string apiVersion = "2019-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -612,6 +628,7 @@ private void Initialize() { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("subscriptionId", subscriptionId); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetAppliedReservationList", tracingParameters); @@ -621,9 +638,9 @@ private void Initialize() var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Capacity/appliedReservations").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(subscriptionId)); List _queryParameters = new List(); - if (ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IAutoQuotaIncreaseOperations.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IAutoQuotaIncreaseOperations.cs new file mode 100644 index 000000000000..a90fdd53be4b --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IAutoQuotaIncreaseOperations.cs @@ -0,0 +1,84 @@ +// +// 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.Reservations +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// AutoQuotaIncreaseOperations operations. + /// + public partial interface IAutoQuotaIncreaseOperations + { + /// + /// For the specified subscription, gets the Auto Quota Increase + /// enrollment status. + /// + /// + /// Gets the Auto Quota Increase enrollment details for the specified + /// subscription. + /// + /// + /// Azure subscription id. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetPropertiesWithHttpMessagesAsync(string subscriptionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// For the specified subscription, sets the Auto Quota Increase + /// enrollment properties. + /// + /// + /// Sets the Auto Quota Increase enrollment properties for the + /// specified subscription. + /// + /// + /// Azure subscription id. + /// + /// + /// Auto Quota increase request payload. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateWithHttpMessagesAsync(string subscriptionId, AutoQuotaIncreaseDetail autoQuotaIncreaseRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IAzureReservationAPIClient.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IAzureReservationAPIClient.cs index 38adaf5b4129..e010daf83643 100644 --- a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IAzureReservationAPIClient.cs +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IAzureReservationAPIClient.cs @@ -20,7 +20,6 @@ namespace Microsoft.Azure.Management.Reservations using System.Threading.Tasks; /// - /// This API describe Azure Reservation /// public partial interface IAzureReservationAPIClient : System.IDisposable { @@ -44,11 +43,6 @@ public partial interface IAzureReservationAPIClient : System.IDisposable /// ServiceClientCredentials Credentials { get; } - /// - /// Supported version for this document is 2019-04-01 - /// - string ApiVersion { get; } - /// /// The preferred language for the response. /// @@ -68,6 +62,31 @@ public partial interface IAzureReservationAPIClient : System.IDisposable bool? GenerateClientRequestId { get; set; } + /// + /// Gets the IQuotaOperations. + /// + IQuotaOperations Quota { get; } + + /// + /// Gets the IQuotaRequestOperations. + /// + IQuotaRequestOperations QuotaRequest { get; } + + /// + /// Gets the IQuotasOperations. + /// + IQuotasOperations Quotas { get; } + + /// + /// Gets the IQuotaRequestsOperations. + /// + IQuotaRequestsOperations QuotaRequests { get; } + + /// + /// Gets the IAutoQuotaIncreaseOperations. + /// + IAutoQuotaIncreaseOperations AutoQuotaIncrease { get; } + /// /// Gets the IReservationOperations. /// diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IQuotaOperations.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IQuotaOperations.cs new file mode 100644 index 000000000000..63fa840363f8 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IQuotaOperations.cs @@ -0,0 +1,66 @@ +// +// 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.Reservations +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// QuotaOperations operations. + /// + public partial interface IQuotaOperations + { + /// + /// Gets the current quota limit and usages for the resource provider + /// for the specified location for the specific resource in the + /// parameter. + /// + /// + /// This API gets the current quota limit and usages for the specific + /// resource for resource provider for the specified location. This + /// response can be used to submit quotaRequests. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// The Resource name for the specific resource provider, such as SKU + /// name for Microsoft.Compute, pool for Microsoft.Batch. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListStatusWithHttpMessagesAsync(string subscriptionId, string providerId, string location, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IQuotaRequestOperations.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IQuotaRequestOperations.cs new file mode 100644 index 000000000000..e633338d1ea6 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IQuotaRequestOperations.cs @@ -0,0 +1,243 @@ +// +// 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.Reservations +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// QuotaRequestOperations operations. + /// + public partial interface IQuotaRequestOperations + { + /// + /// Submits a Quota Request for a resource provider at the specified + /// location for the specific resource in the parameter. + /// + /// + /// Submits Quota change request for a resource provider for the + /// specified location for the specific resource in the parameter. To + /// use, first make a Get request to get quota information. This + /// information consists of a list of resources and information + /// regarding those resources. For all the resources in that list which + /// require an update to their quotas, update their limit fields in the + /// response from the Get request to their new values. Then, submit + /// this updated JSON object to this quota request API. This will + /// update the quota to the values specified. The location header in + /// the response will be used to track the status of the quota request. + /// Please check the provisioningState field in the response. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// The Resource name for the specific resource provider, such as SKU + /// name for Microsoft.Compute, pool for Microsoft.Batch. + /// + /// + /// Quota requests payload. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from + /// the header response of the GET request or it should be * for + /// unconditional update. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateWithHttpMessagesAsync(string subscriptionId, string providerId, string location, string resourceName, CurrentQuotaLimitBase createQuotaRequest, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Submits a Quota Request for a resource provider at the specified + /// location for the specific resource in the parameter. + /// + /// + /// Submits Quota change request for a resource provider for the + /// specified location for the specific resource in the parameter. To + /// use, first make a Get request to get quota information. This + /// information consists of a list of resources and information + /// regarding those resources. For all the resources in that list which + /// require an update to their quotas, update their limit fields in the + /// response from the Get request to their new values. Then, submit + /// this updated JSON object to this quota request API. This will + /// update the quota to the values specified. The location header in + /// the response will be used to track the status of the quota request. + /// Please check the provisioningState field in the response. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// The Resource name for the specific resource provider, such as SKU + /// name for Microsoft.Compute, pool for Microsoft.Batch. + /// + /// + /// Quota requests payload. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from + /// the header response of the GET request or it should be * for + /// unconditional update. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string subscriptionId, string providerId, string location, string resourceName, CurrentQuotaLimitBase createQuotaRequest, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Submits a Quota Request for a resource provider at the specified + /// location for the specific resource in the parameter. + /// + /// + /// Submits Quota change request for a resource provider for the + /// specified location for the specific resource in the parameter. To + /// use, first make a Get request to get quota information. This + /// information consists of a list of resources and information + /// regarding those resources. For all the resources in that list which + /// require an update to their quotas, update their limit fields in the + /// response from the Get request to their new values. Then, submit + /// this updated JSON object to this quota request API. This will + /// update the quota to the values specified. The location header in + /// the response will be used to track the status of the quota request. + /// Please check the provisioningState field in the response. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// The Resource name for the specific resource provider, such as SKU + /// name for Microsoft.Compute, pool for Microsoft.Batch. + /// + /// + /// Quota requests payload. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from + /// the header response of the GET request or it should be * for + /// unconditional update. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateWithHttpMessagesAsync(string subscriptionId, string providerId, string location, string resourceName, CurrentQuotaLimitBase createQuotaRequest, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Submits a Quota Request for a resource provider at the specified + /// location for the specific resource in the parameter. + /// + /// + /// Submits Quota change request for a resource provider for the + /// specified location for the specific resource in the parameter. To + /// use, first make a Get request to get quota information. This + /// information consists of a list of resources and information + /// regarding those resources. For all the resources in that list which + /// require an update to their quotas, update their limit fields in the + /// response from the Get request to their new values. Then, submit + /// this updated JSON object to this quota request API. This will + /// update the quota to the values specified. The location header in + /// the response will be used to track the status of the quota request. + /// Please check the provisioningState field in the response. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// The Resource name for the specific resource provider, such as SKU + /// name for Microsoft.Compute, pool for Microsoft.Batch. + /// + /// + /// Quota requests payload. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from + /// the header response of the GET request or it should be * for + /// unconditional update. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginUpdateWithHttpMessagesAsync(string subscriptionId, string providerId, string location, string resourceName, CurrentQuotaLimitBase createQuotaRequest, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IQuotaRequestsOperations.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IQuotaRequestsOperations.cs new file mode 100644 index 000000000000..a249558c618a --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IQuotaRequestsOperations.cs @@ -0,0 +1,148 @@ +// +// 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.Reservations +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// QuotaRequestsOperations operations. + /// + public partial interface IQuotaRequestsOperations + { + /// + /// Gets the Quota request status by requestId, for the specified + /// resource provider at specified location. + /// + /// + /// Gets the QuotaRequest details and status by the quota requestId for + /// the resources for the resource provider at a specific location. The + /// requestId is returned as response to the Put requests for + /// serviceLimits. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// Quota Request id. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetStatusWithHttpMessagesAsync(string subscriptionId, string providerId, string location, string id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// For the specified location and resource Provider, gets the quota + /// requests under the subscription over the time + /// period of one year ago from now to one year back, based on the + /// filter specified. + /// + /// + /// For the specified location and Resource provider gets the current + /// quota requests under the subscription over the time period of one + /// year ago from now to one year back. oData filter can be used to + /// select quota requests. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// | Field | Supported operators + /// |---------------------|------------------------ + /// + /// |requestSubmitTime | ge, le, eq, gt, lt + /// + /// + /// Number of records to return. + /// + /// + /// Skiptoken is only used if a previous operation returned a partial + /// result. If a previous response contains a nextLink element, the + /// value of the nextLink element will include a skiptoken parameter + /// that specifies a starting point to use for subsequent calls + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListStatusWithHttpMessagesAsync(string subscriptionId, string providerId, string location, string filter = default(string), int? top = default(int?), string skiptoken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// For the specified location and resource Provider, gets the quota + /// requests under the subscription over the time + /// period of one year ago from now to one year back, based on the + /// filter specified. + /// + /// + /// For the specified location and Resource provider gets the current + /// quota requests under the subscription over the time period of one + /// year ago from now to one year back. oData filter can be used to + /// select quota requests. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListStatusNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IQuotasOperations.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IQuotasOperations.cs new file mode 100644 index 000000000000..7d31a62a1c03 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IQuotasOperations.cs @@ -0,0 +1,89 @@ +// +// 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.Reservations +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// QuotasOperations operations. + /// + public partial interface IQuotasOperations + { + /// + /// Gets the current quota limit and usages for all the resources by + /// the resource provider at the specified location. + /// + /// + /// This API gets the current quota limits and usages for the resource + /// provider for the specified location. This response can be used to + /// submit quotaRequests. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task,QuotasListStatusHeaders>> ListStatusWithHttpMessagesAsync(string subscriptionId, string providerId, string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the current quota limit and usages for all the resources by + /// the resource provider at the specified location. + /// + /// + /// This API gets the current quota limits and usages for the resource + /// provider for the specified location. This response can be used to + /// submit quotaRequests. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task,QuotasListStatusHeaders>> ListStatusNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IReservationOperations.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IReservationOperations.cs index 79296694a9d0..867718e7ea1a 100644 --- a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IReservationOperations.cs +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IReservationOperations.cs @@ -53,7 +53,7 @@ public partial interface IReservationOperations /// /// Thrown when a required parameter is null /// - Task> AvailableScopesWithHttpMessagesAsync(string reservationOrderId, string reservationId, SubscriptionScopeProperties body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> AvailableScopesWithHttpMessagesAsync(string reservationOrderId, string reservationId, IList body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Split the `Reservation`. /// @@ -257,7 +257,7 @@ public partial interface IReservationOperations /// /// Thrown when a required parameter is null /// - Task> BeginAvailableScopesWithHttpMessagesAsync(string reservationOrderId, string reservationId, SubscriptionScopeProperties body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginAvailableScopesWithHttpMessagesAsync(string reservationOrderId, string reservationId, IList body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Split the `Reservation`. /// diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/AqiSettings.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/AqiSettings.cs new file mode 100644 index 000000000000..e82e8fe082d4 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/AqiSettings.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Reservations.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Settings for auto quota increase. + /// + public partial class AqiSettings + { + /// + /// Initializes a new instance of the AqiSettings class. + /// + public AqiSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AqiSettings class. + /// + /// If the subscription has + /// enabled automatic quota increase. + public AqiSettings(object autoQuotaIncreaseState = default(object)) + { + AutoQuotaIncreaseState = autoQuotaIncreaseState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets if the subscription has enabled automatic quota + /// increase. + /// + [JsonProperty(PropertyName = "autoQuotaIncreaseState")] + public object AutoQuotaIncreaseState { get; set; } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/AutoQuotaIncreaseDetail.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/AutoQuotaIncreaseDetail.cs new file mode 100644 index 000000000000..0f3151b2da88 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/AutoQuotaIncreaseDetail.cs @@ -0,0 +1,105 @@ +// +// 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.Reservations.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Auto Quota Increase settings. + /// + [Rest.Serialization.JsonTransformation] + public partial class AutoQuotaIncreaseDetail : IResource + { + /// + /// Initializes a new instance of the AutoQuotaIncreaseDetail class. + /// + public AutoQuotaIncreaseDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AutoQuotaIncreaseDetail class. + /// + /// The subscription Id. + /// The name of the auto quota increase. + /// The type of the resource + /// Settings for automatic quota + /// increase. + /// The on failure Actions. + /// The on success Actions. + /// The support ticket + /// action. + public AutoQuotaIncreaseDetail(string id = default(string), string name = default(string), string type = default(string), AqiSettings settings = default(AqiSettings), OnFailure onFailure = default(OnFailure), OnFailure onSuccess = default(OnFailure), SupportRequestAction supportTicketAction = default(SupportRequestAction)) + { + Id = id; + Name = name; + Type = type; + Settings = settings; + OnFailure = onFailure; + OnSuccess = onSuccess; + SupportTicketAction = supportTicketAction; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the subscription Id. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the name of the auto quota increase. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the type of the resource + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets settings for automatic quota increase. + /// + [JsonProperty(PropertyName = "properties.settings")] + public AqiSettings Settings { get; set; } + + /// + /// Gets or sets the on failure Actions. + /// + [JsonProperty(PropertyName = "properties.onFailure")] + public OnFailure OnFailure { get; set; } + + /// + /// Gets or sets the on success Actions. + /// + [JsonProperty(PropertyName = "properties.onSuccess")] + public OnFailure OnSuccess { get; set; } + + /// + /// Gets or sets the support ticket action. + /// + [JsonProperty(PropertyName = "properties.supportTicketAction")] + public SupportRequestAction SupportTicketAction { get; set; } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/CatalogBillingPlansItem.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/CatalogBillingPlansItem.cs deleted file mode 100644 index 5554eba9f112..000000000000 --- a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/CatalogBillingPlansItem.cs +++ /dev/null @@ -1,68 +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.Reservations.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - public partial class CatalogBillingPlansItem - { - /// - /// Initializes a new instance of the CatalogBillingPlansItem class. - /// - public CatalogBillingPlansItem() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CatalogBillingPlansItem class. - /// - /// - /// - /// - public CatalogBillingPlansItem(IList p1Y = default(IList), IList p3Y = default(IList), string name = default(string)) - { - P1Y = p1Y; - P3Y = p3Y; - Name = name; - 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 the term for the billing SKU is available for. - /// Possible values include: 'P1Y', 'P3Y' - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - [JsonProperty(PropertyName = "p1Y")] - public IList P1Y { get; set; } - - [JsonProperty(PropertyName = "p3Y")] - public IList P3Y { get; set; } - - } -} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/CreateGenericQuotaRequestParameters.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/CreateGenericQuotaRequestParameters.cs new file mode 100644 index 000000000000..9a026fdc1e9a --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/CreateGenericQuotaRequestParameters.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Reservations.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Quota change requests information. + /// + public partial class CreateGenericQuotaRequestParameters + { + /// + /// Initializes a new instance of the + /// CreateGenericQuotaRequestParameters class. + /// + public CreateGenericQuotaRequestParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// CreateGenericQuotaRequestParameters class. + /// + /// Quota change requests. + public CreateGenericQuotaRequestParameters(IList value = default(IList)) + { + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets quota change requests. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/CurrentQuotaLimit.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/CurrentQuotaLimit.cs new file mode 100644 index 000000000000..fda56f3b6be1 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/CurrentQuotaLimit.cs @@ -0,0 +1,132 @@ +// +// 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.Reservations.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Quota limits. + /// + [Rest.Serialization.JsonTransformation] + public partial class CurrentQuotaLimit : IResource + { + /// + /// Initializes a new instance of the CurrentQuotaLimit class. + /// + public CurrentQuotaLimit() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CurrentQuotaLimit class. + /// + /// The quota limit. + /// The current resource usages + /// information. + /// The units of the limit, such as - Count, Bytes, + /// etc. Use the unit field provided in the Get quota response. + /// Name of the resource provide by the resource + /// Provider. Please use this name property for quotaRequests. + /// The Resource Type Name. + /// The quota period over which the usage + /// values are summarized, such as - P1D (Per one day), PT1M (Per one + /// minute), PT1S (Per one second). This parameter is optional because, + /// for some resources like compute, the period doesn’t matter. + /// Additional properties for the specific + /// resource provider. + /// The quota request status. + /// A user friendly message. + public CurrentQuotaLimit(int? limit = default(int?), int? currentValue = default(int?), string unit = default(string), CurrentQuotaLimitBaseName name = default(CurrentQuotaLimitBaseName), object resourceType = default(object), string quotaPeriod = default(string), object properties = default(object), object provisioningState = default(object), string message = default(string)) + { + Limit = limit; + CurrentValue = currentValue; + Unit = unit; + Name = name; + ResourceType = resourceType; + QuotaPeriod = quotaPeriod; + Properties = properties; + ProvisioningState = provisioningState; + Message = message; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the quota limit. + /// + [JsonProperty(PropertyName = "quotaInformation.limit")] + public int? Limit { get; set; } + + /// + /// Gets the current resource usages information. + /// + [JsonProperty(PropertyName = "quotaInformation.currentValue")] + public int? CurrentValue { get; private set; } + + /// + /// Gets or sets The units of the limit, such as - Count, Bytes, etc. + /// Use the unit field provided in the Get quota response. + /// + [JsonProperty(PropertyName = "quotaInformation.unit")] + public string Unit { get; set; } + + /// + /// Gets or sets name of the resource provide by the resource Provider. + /// Please use this name property for quotaRequests. + /// + [JsonProperty(PropertyName = "quotaInformation.name")] + public CurrentQuotaLimitBaseName Name { get; set; } + + /// + /// Gets or sets the Resource Type Name. + /// + [JsonProperty(PropertyName = "quotaInformation.resourceType")] + public object ResourceType { get; set; } + + /// + /// Gets the quota period over which the usage values are summarized, + /// such as - P1D (Per one day), PT1M (Per one minute), PT1S (Per one + /// second). This parameter is optional because, for some resources + /// like compute, the period doesn’t matter. + /// + [JsonProperty(PropertyName = "quotaInformation.quotaPeriod")] + public string QuotaPeriod { get; private set; } + + /// + /// Gets or sets additional properties for the specific resource + /// provider. + /// + [JsonProperty(PropertyName = "quotaInformation.properties")] + public object Properties { get; set; } + + /// + /// Gets the quota request status. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public object ProvisioningState { get; private set; } + + /// + /// Gets a user friendly message. + /// + [JsonProperty(PropertyName = "properties.message")] + public string Message { get; private set; } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/CurrentQuotaLimitBase.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/CurrentQuotaLimitBase.cs new file mode 100644 index 000000000000..9f463de06977 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/CurrentQuotaLimitBase.cs @@ -0,0 +1,114 @@ +// +// 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.Reservations.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Quota limits. + /// + public partial class CurrentQuotaLimitBase : IResource + { + /// + /// Initializes a new instance of the CurrentQuotaLimitBase class. + /// + public CurrentQuotaLimitBase() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CurrentQuotaLimitBase class. + /// + /// The quota limit. + /// The current resource usages + /// information. + /// The units of the limit, such as - Count, Bytes, + /// etc. Use the unit field provided in the Get quota response. + /// Name of the resource provide by the resource + /// Provider. Please use this name property for quotaRequests. + /// The Resource Type Name. + /// The quota period over which the usage + /// values are summarized, such as - P1D (Per one day), PT1M (Per one + /// minute), PT1S (Per one second). This parameter is optional because, + /// for some resources like compute, the period doesn’t matter. + /// Additional properties for the specific + /// resource provider. + public CurrentQuotaLimitBase(int? limit = default(int?), int? currentValue = default(int?), string unit = default(string), CurrentQuotaLimitBaseName name = default(CurrentQuotaLimitBaseName), object resourceType = default(object), string quotaPeriod = default(string), object properties = default(object)) + { + Limit = limit; + CurrentValue = currentValue; + Unit = unit; + Name = name; + ResourceType = resourceType; + QuotaPeriod = quotaPeriod; + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the quota limit. + /// + [JsonProperty(PropertyName = "limit")] + public int? Limit { get; set; } + + /// + /// Gets the current resource usages information. + /// + [JsonProperty(PropertyName = "currentValue")] + public int? CurrentValue { get; private set; } + + /// + /// Gets or sets The units of the limit, such as - Count, Bytes, etc. + /// Use the unit field provided in the Get quota response. + /// + [JsonProperty(PropertyName = "unit")] + public string Unit { get; set; } + + /// + /// Gets or sets name of the resource provide by the resource Provider. + /// Please use this name property for quotaRequests. + /// + [JsonProperty(PropertyName = "name")] + public CurrentQuotaLimitBaseName Name { get; set; } + + /// + /// Gets or sets the Resource Type Name. + /// + [JsonProperty(PropertyName = "resourceType")] + public object ResourceType { get; set; } + + /// + /// Gets the quota period over which the usage values are summarized, + /// such as - P1D (Per one day), PT1M (Per one minute), PT1S (Per one + /// second). This parameter is optional because, for some resources + /// like compute, the period doesn’t matter. + /// + [JsonProperty(PropertyName = "quotaPeriod")] + public string QuotaPeriod { get; private set; } + + /// + /// Gets or sets additional properties for the specific resource + /// provider. + /// + [JsonProperty(PropertyName = "properties")] + public object Properties { get; set; } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/CurrentQuotaLimitBaseName.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/CurrentQuotaLimitBaseName.cs new file mode 100644 index 000000000000..d36af3c0f9da --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/CurrentQuotaLimitBaseName.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Reservations.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Name of the resource provide by the resource Provider. Please use this + /// name property for quotaRequests. + /// + public partial class CurrentQuotaLimitBaseName + { + /// + /// Initializes a new instance of the CurrentQuotaLimitBaseName class. + /// + public CurrentQuotaLimitBaseName() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CurrentQuotaLimitBaseName class. + /// + /// Resource name. + /// Resource display name. + public CurrentQuotaLimitBaseName(string value = default(string), string localizedValue = default(string)) + { + Value = value; + LocalizedValue = localizedValue; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource name. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; set; } + + /// + /// Gets resource display name. + /// + [JsonProperty(PropertyName = "localizedValue")] + public string LocalizedValue { get; private set; } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/EmailAction.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/EmailAction.cs new file mode 100644 index 000000000000..f84aeb0b70d1 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/EmailAction.cs @@ -0,0 +1,52 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Reservations.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Email Action. + /// + public partial class EmailAction + { + /// + /// Initializes a new instance of the EmailAction class. + /// + public EmailAction() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EmailAction class. + /// + /// The email address for the + /// action. + public EmailAction(string emailAddress = default(string)) + { + EmailAddress = emailAddress; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the email address for the action. + /// + [JsonProperty(PropertyName = "emailAddress")] + public string EmailAddress { get; set; } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/EmailActions.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/EmailActions.cs new file mode 100644 index 000000000000..27999ca2bfc0 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/EmailActions.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Reservations.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The email actions. + /// + public partial class EmailActions + { + /// + /// Initializes a new instance of the EmailActions class. + /// + public EmailActions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EmailActions class. + /// + /// The list of actions based on the success or + /// failure of automatic quota increase action. + public EmailActions(IList value = default(IList)) + { + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the list of actions based on the success or failure of + /// automatic quota increase action. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ExceptionResponse.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ExceptionResponse.cs new file mode 100644 index 000000000000..53a9e1932ca1 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ExceptionResponse.cs @@ -0,0 +1,51 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Reservations.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The api error. + /// + public partial class ExceptionResponse + { + /// + /// Initializes a new instance of the ExceptionResponse class. + /// + public ExceptionResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExceptionResponse class. + /// + /// The api error details. + public ExceptionResponse(ServiceError error = default(ServiceError)) + { + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the api error details. + /// + [JsonProperty(PropertyName = "error")] + public ServiceError Error { get; set; } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ExceptionResponseException.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ExceptionResponseException.cs new file mode 100644 index 000000000000..8301bacd2831 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ExceptionResponseException.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.Reservations.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with ExceptionResponse + /// information. + /// + public partial class ExceptionResponseException : 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 ExceptionResponse Body { get; set; } + + /// + /// Initializes a new instance of the ExceptionResponseException class. + /// + public ExceptionResponseException() + { + } + + /// + /// Initializes a new instance of the ExceptionResponseException class. + /// + /// The exception message. + public ExceptionResponseException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ExceptionResponseException class. + /// + /// The exception message. + /// Inner exception. + public ExceptionResponseException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/OnFailure.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/OnFailure.cs new file mode 100644 index 000000000000..f23a55796e78 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/OnFailure.cs @@ -0,0 +1,61 @@ +// +// 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.Reservations.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The actions for auto quota increase. + /// + public partial class OnFailure + { + /// + /// Initializes a new instance of the OnFailure class. + /// + public OnFailure() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OnFailure class. + /// + /// The email actions for auto quota + /// increase. + /// The phone actions for auto quota + /// increase. + public OnFailure(OnFailureEmailActions emailActions = default(OnFailureEmailActions), OnFailurePhoneActions phoneActions = default(OnFailurePhoneActions)) + { + EmailActions = emailActions; + PhoneActions = phoneActions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the email actions for auto quota increase. + /// + [JsonProperty(PropertyName = "emailActions")] + public OnFailureEmailActions EmailActions { get; set; } + + /// + /// Gets or sets the phone actions for auto quota increase. + /// + [JsonProperty(PropertyName = "phoneActions")] + public OnFailurePhoneActions PhoneActions { get; set; } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/OnFailureEmailActions.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/OnFailureEmailActions.cs new file mode 100644 index 000000000000..fda567f2d595 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/OnFailureEmailActions.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Reservations.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The email actions for auto quota increase. + /// + public partial class OnFailureEmailActions + { + /// + /// Initializes a new instance of the OnFailureEmailActions class. + /// + public OnFailureEmailActions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OnFailureEmailActions class. + /// + /// The list of email actions. + public OnFailureEmailActions(IList value = default(IList)) + { + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the list of email actions. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/OnFailurePhoneActions.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/OnFailurePhoneActions.cs new file mode 100644 index 000000000000..c746b4b0d192 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/OnFailurePhoneActions.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Reservations.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The phone actions for auto quota increase. + /// + public partial class OnFailurePhoneActions + { + /// + /// Initializes a new instance of the OnFailurePhoneActions class. + /// + public OnFailurePhoneActions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OnFailurePhoneActions class. + /// + /// The list of phone actions. + public OnFailurePhoneActions(IList value = default(IList)) + { + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the list of phone actions. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/PhoneAction.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/PhoneAction.cs new file mode 100644 index 000000000000..2ef88aed71db --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/PhoneAction.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Reservations.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Phone Action. + /// + public partial class PhoneAction + { + /// + /// Initializes a new instance of the PhoneAction class. + /// + public PhoneAction() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PhoneAction class. + /// + /// The phone number for the action. + /// The preferred communication + /// channel. + public PhoneAction(string phoneNumber = default(string), object preferredChannel = default(object)) + { + PhoneNumber = phoneNumber; + PreferredChannel = preferredChannel; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the phone number for the action. + /// + [JsonProperty(PropertyName = "phoneNumber")] + public string PhoneNumber { get; set; } + + /// + /// Gets or sets the preferred communication channel. + /// + [JsonProperty(PropertyName = "preferredChannel")] + public object PreferredChannel { get; set; } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotaLimitsResponse.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotaLimitsResponse.cs new file mode 100644 index 000000000000..76366ad12e75 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotaLimitsResponse.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Reservations.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Quota limits request response. + /// + public partial class QuotaLimitsResponse + { + /// + /// Initializes a new instance of the QuotaLimitsResponse class. + /// + public QuotaLimitsResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QuotaLimitsResponse class. + /// + /// List of Quota limits with the quota request + /// status. + /// The uri to fetch the next page of quota + /// limits. When there are no more pages, this is null. + public QuotaLimitsResponse(IList value = default(IList), string nextLink = default(string)) + { + Value = value; + NextLink = nextLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of Quota limits with the quota request status. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + /// + /// Gets or sets the uri to fetch the next page of quota limits. When + /// there are no more pages, this is null. + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; set; } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotaListStatusHeaders.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotaListStatusHeaders.cs new file mode 100644 index 000000000000..c1b1eb125b67 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotaListStatusHeaders.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Reservations.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for listStatus operation. + /// + public partial class QuotaListStatusHeaders + { + /// + /// Initializes a new instance of the QuotaListStatusHeaders class. + /// + public QuotaListStatusHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QuotaListStatusHeaders class. + /// + /// Current entity state version. Should be treated + /// as opaque and used to make conditional HTTP requests. + public QuotaListStatusHeaders(string eTag = default(string)) + { + ETag = eTag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets current entity state version. Should be treated as + /// opaque and used to make conditional HTTP requests. + /// + [JsonProperty(PropertyName = "ETag")] + public string ETag { get; set; } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotaRequestDetails.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotaRequestDetails.cs new file mode 100644 index 000000000000..eff5c8837c06 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotaRequestDetails.cs @@ -0,0 +1,110 @@ +// +// 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.Reservations.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The details of the quota Request. + /// + [Rest.Serialization.JsonTransformation] + public partial class QuotaRequestDetails : IResource + { + /// + /// Initializes a new instance of the QuotaRequestDetails class. + /// + public QuotaRequestDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QuotaRequestDetails class. + /// + /// The quota request Id. + /// The name of the quota request. + /// The quota request status. + /// User friendly status message. + /// The quota request submit time. The + /// date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as + /// specified by the ISO 8601 standard. + /// The quotaRequests. + /// Type of resource. + /// "Microsoft.Capacity/ServiceLimits" + public QuotaRequestDetails(string id = default(string), string name = default(string), object provisioningState = default(object), string message = default(string), System.DateTime? requestSubmitTime = default(System.DateTime?), IList value = default(IList), string type = default(string)) + { + Id = id; + Name = name; + ProvisioningState = provisioningState; + Message = message; + RequestSubmitTime = requestSubmitTime; + Value = value; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the quota request Id. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the name of the quota request. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets or sets the quota request status. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public object ProvisioningState { get; set; } + + /// + /// Gets user friendly status message. + /// + [JsonProperty(PropertyName = "properties.message")] + public string Message { get; private set; } + + /// + /// Gets the quota request submit time. The date conforms to the + /// following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 + /// standard. + /// + [JsonProperty(PropertyName = "properties.requestSubmitTime")] + public System.DateTime? RequestSubmitTime { get; private set; } + + /// + /// Gets or sets the quotaRequests. + /// + [JsonProperty(PropertyName = "properties.value")] + public IList Value { get; set; } + + /// + /// Gets type of resource. "Microsoft.Capacity/ServiceLimits" + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotaRequestOneResourceSubmitResponse.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotaRequestOneResourceSubmitResponse.cs new file mode 100644 index 000000000000..a5cdd0d5da0c --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotaRequestOneResourceSubmitResponse.cs @@ -0,0 +1,171 @@ +// +// 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.Reservations.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Quota submit request response + /// + [Rest.Serialization.JsonTransformation] + public partial class QuotaRequestOneResourceSubmitResponse : IResource + { + /// + /// Initializes a new instance of the + /// QuotaRequestOneResourceSubmitResponse class. + /// + public QuotaRequestOneResourceSubmitResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// QuotaRequestOneResourceSubmitResponse class. + /// + /// The quota request Id. + /// The name of the quota request. + /// Type of resource. + /// "Microsoft.Capacity/ServiceLimits" + /// The quota request status. + /// User friendly status message. + /// The quota request submit time. The + /// date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as + /// specified by the ISO 8601 standard. + /// The quota limit. + /// The current resource usages + /// information. + /// The units of the limit, such as - Count, Bytes, + /// etc. Use the unit field provided in the Get quota response. + /// Name of the resource provide by the resource + /// Provider. Please use this name property for quotaRequests. + /// The Resource Type Name. + /// The quota period over which the usage + /// values are summarized, such as - P1D (Per one day), PT1M (Per one + /// minute), PT1S (Per one second). This parameter is optional because, + /// for some resources like compute, the period doesn’t matter. + /// Additional properties for the specific + /// resource provider. + public QuotaRequestOneResourceSubmitResponse(string id = default(string), string name = default(string), string type = default(string), object provisioningState = default(object), string message = default(string), System.DateTime? requestSubmitTime = default(System.DateTime?), int? limit = default(int?), int? currentValue = default(int?), string unit = default(string), CurrentQuotaLimitBaseName name1 = default(CurrentQuotaLimitBaseName), object resourceType = default(object), string quotaPeriod = default(string), object properties = default(object)) + { + Id = id; + Name = name; + Type = type; + ProvisioningState = provisioningState; + Message = message; + RequestSubmitTime = requestSubmitTime; + Limit = limit; + CurrentValue = currentValue; + Unit = unit; + Name1 = name1; + ResourceType = resourceType; + QuotaPeriod = quotaPeriod; + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the quota request Id. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the name of the quota request. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets type of resource. "Microsoft.Capacity/ServiceLimits" + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets the quota request status. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public object ProvisioningState { get; private set; } + + /// + /// Gets user friendly status message. + /// + [JsonProperty(PropertyName = "properties.message")] + public string Message { get; private set; } + + /// + /// Gets the quota request submit time. The date conforms to the + /// following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 + /// standard. + /// + [JsonProperty(PropertyName = "properties.requestSubmitTime")] + public System.DateTime? RequestSubmitTime { get; private set; } + + /// + /// Gets or sets the quota limit. + /// + [JsonProperty(PropertyName = "properties.properties.limit")] + public int? Limit { get; set; } + + /// + /// Gets the current resource usages information. + /// + [JsonProperty(PropertyName = "properties.properties.currentValue")] + public int? CurrentValue { get; private set; } + + /// + /// Gets or sets The units of the limit, such as - Count, Bytes, etc. + /// Use the unit field provided in the Get quota response. + /// + [JsonProperty(PropertyName = "properties.properties.unit")] + public string Unit { get; set; } + + /// + /// Gets or sets name of the resource provide by the resource Provider. + /// Please use this name property for quotaRequests. + /// + [JsonProperty(PropertyName = "properties.properties.name")] + public CurrentQuotaLimitBaseName Name1 { get; set; } + + /// + /// Gets or sets the Resource Type Name. + /// + [JsonProperty(PropertyName = "properties.properties.resourceType")] + public object ResourceType { get; set; } + + /// + /// Gets the quota period over which the usage values are summarized, + /// such as - P1D (Per one day), PT1M (Per one minute), PT1S (Per one + /// second). This parameter is optional because, for some resources + /// like compute, the period doesn’t matter. + /// + [JsonProperty(PropertyName = "properties.properties.quotaPeriod")] + public string QuotaPeriod { get; private set; } + + /// + /// Gets or sets additional properties for the specific resource + /// provider. + /// + [JsonProperty(PropertyName = "properties.properties.properties")] + public object Properties { get; set; } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotaRequestProperties.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotaRequestProperties.cs new file mode 100644 index 000000000000..10a5b7d0f104 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotaRequestProperties.cs @@ -0,0 +1,81 @@ +// +// 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.Reservations.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The details of quota request. + /// + public partial class QuotaRequestProperties + { + /// + /// Initializes a new instance of the QuotaRequestProperties class. + /// + public QuotaRequestProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QuotaRequestProperties class. + /// + /// The quota request status. + /// User friendly status message. + /// The quota request submit time. The + /// date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as + /// specified by the ISO 8601 standard. + /// The quotaRequests. + public QuotaRequestProperties(object provisioningState = default(object), string message = default(string), System.DateTime? requestSubmitTime = default(System.DateTime?), IList value = default(IList)) + { + ProvisioningState = provisioningState; + Message = message; + RequestSubmitTime = requestSubmitTime; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the quota request status. + /// + [JsonProperty(PropertyName = "provisioningState")] + public object ProvisioningState { get; set; } + + /// + /// Gets user friendly status message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets the quota request submit time. The date conforms to the + /// following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 + /// standard. + /// + [JsonProperty(PropertyName = "requestSubmitTime")] + public System.DateTime? RequestSubmitTime { get; private set; } + + /// + /// Gets or sets the quotaRequests. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotaRequestSubmitResponse.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotaRequestSubmitResponse.cs new file mode 100644 index 000000000000..53da1baf7c9f --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotaRequestSubmitResponse.cs @@ -0,0 +1,78 @@ +// +// 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.Reservations.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Quota submit request response + /// + public partial class QuotaRequestSubmitResponse : IResource + { + /// + /// Initializes a new instance of the QuotaRequestSubmitResponse class. + /// + public QuotaRequestSubmitResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QuotaRequestSubmitResponse class. + /// + /// The quota request Id. + /// The name of the quota request. + /// The quota request details. + /// Type of resource. + /// "Microsoft.Capacity/serviceLimits" + public QuotaRequestSubmitResponse(string id = default(string), string name = default(string), QuotaRequestProperties properties = default(QuotaRequestProperties), string type = default(string)) + { + Id = id; + Name = name; + Properties = properties; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the quota request Id. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the name of the quota request. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets or sets the quota request details. + /// + [JsonProperty(PropertyName = "properties")] + public QuotaRequestProperties Properties { get; set; } + + /// + /// Gets type of resource. "Microsoft.Capacity/serviceLimits" + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotaRequestSubmitResponse201.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotaRequestSubmitResponse201.cs new file mode 100644 index 000000000000..f3dc6c27b861 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotaRequestSubmitResponse201.cs @@ -0,0 +1,90 @@ +// +// 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.Reservations.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The quota request submit response with request id. + /// + [Rest.Serialization.JsonTransformation] + public partial class QuotaRequestSubmitResponse201 + { + /// + /// Initializes a new instance of the QuotaRequestSubmitResponse201 + /// class. + /// + public QuotaRequestSubmitResponse201() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QuotaRequestSubmitResponse201 + /// class. + /// + /// The quota request id. Please use the requestId to + /// check the request status. + /// The operation Id + /// The resource type + /// The quota request status. + /// A user friendly message. + public QuotaRequestSubmitResponse201(string id = default(string), string name = default(string), string type = default(string), object provisioningState = default(object), string message = default(string)) + { + Id = id; + Name = name; + Type = type; + ProvisioningState = provisioningState; + Message = message; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the quota request id. Please use the requestId to check the + /// request status. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the operation Id + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the resource type + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets the quota request status. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public object ProvisioningState { get; private set; } + + /// + /// Gets a user friendly message. + /// + [JsonProperty(PropertyName = "properties.message")] + public string Message { get; private set; } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotasListStatusHeaders.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotasListStatusHeaders.cs new file mode 100644 index 000000000000..efe6455bf1c1 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/QuotasListStatusHeaders.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Reservations.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for listStatus operation. + /// + public partial class QuotasListStatusHeaders + { + /// + /// Initializes a new instance of the QuotasListStatusHeaders class. + /// + public QuotasListStatusHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QuotasListStatusHeaders class. + /// + /// Current entity state version. Should be treated + /// as opaque and used to make conditional HTTP requests. + public QuotasListStatusHeaders(string eTag = default(string)) + { + ETag = eTag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets current entity state version. Should be treated as + /// opaque and used to make conditional HTTP requests. + /// + [JsonProperty(PropertyName = "ETag")] + public string ETag { get; set; } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ScopeProperties.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ScopeProperties.cs index fcac9c80f39e..8a3e30749277 100644 --- a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ScopeProperties.cs +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ScopeProperties.cs @@ -11,7 +11,6 @@ namespace Microsoft.Azure.Management.Reservations.Models { using Newtonsoft.Json; - using System.Collections.Generic; using System.Linq; public partial class ScopeProperties @@ -29,10 +28,7 @@ public ScopeProperties() /// public ScopeProperties(string scope = default(string), bool? valid = default(bool?)) { - Scope = new List - { - scope - }; + Scope = scope; Valid = valid; CustomInit(); } @@ -44,8 +40,8 @@ public ScopeProperties() /// /// - [JsonProperty(PropertyName = "scopes")] - public List Scope { get; set; } + [JsonProperty(PropertyName = "scope")] + public string Scope { get; set; } /// /// diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ServiceError.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ServiceError.cs new file mode 100644 index 000000000000..7ced4e22464a --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ServiceError.cs @@ -0,0 +1,69 @@ +// +// 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.Reservations.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The api error details. + /// + public partial class ServiceError + { + /// + /// Initializes a new instance of the ServiceError class. + /// + public ServiceError() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServiceError class. + /// + /// The error code. + /// The error message. + /// The list of error details. + public ServiceError(string code = default(string), string message = default(string), IList details = default(IList)) + { + Code = code; + Message = message; + Details = details; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the error code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } + + /// + /// Gets or sets the error message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + /// + /// Gets the list of error details. + /// + [JsonProperty(PropertyName = "details")] + public IList Details { get; private set; } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ServiceErrorDetail.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ServiceErrorDetail.cs new file mode 100644 index 000000000000..de2d2f36a08c --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ServiceErrorDetail.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Reservations.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The error details. + /// + public partial class ServiceErrorDetail + { + /// + /// Initializes a new instance of the ServiceErrorDetail class. + /// + public ServiceErrorDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServiceErrorDetail class. + /// + /// The error code. + /// The error message. + public ServiceErrorDetail(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 the error code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets the error message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/SubRequest.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/SubRequest.cs new file mode 100644 index 000000000000..620bec189861 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/SubRequest.cs @@ -0,0 +1,103 @@ +// +// 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.Reservations.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The sub-request submitted with the quota request. + /// + public partial class SubRequest + { + /// + /// Initializes a new instance of the SubRequest class. + /// + public SubRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SubRequest class. + /// + /// The Resource limit. + /// The Resource name. + /// Resource type for which the quota check + /// was made. + /// The units of the limit, such as - Count, Bytes, + /// etc. Use the unit field provided in the Get quota response. + /// The quota request status. + /// User friendly status message. + /// Sub request id for individual + /// request. + public SubRequest(int? limit = default(int?), SubRequestName name = default(SubRequestName), string resourceType = default(string), string unit = default(string), object provisioningState = default(object), string message = default(string), string subRequestId = default(string)) + { + Limit = limit; + Name = name; + ResourceType = resourceType; + Unit = unit; + ProvisioningState = provisioningState; + Message = message; + SubRequestId = subRequestId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the Resource limit. + /// + [JsonProperty(PropertyName = "limit")] + public int? Limit { get; private set; } + + /// + /// Gets or sets the Resource name. + /// + [JsonProperty(PropertyName = "name")] + public SubRequestName Name { get; set; } + + /// + /// Gets resource type for which the quota check was made. + /// + [JsonProperty(PropertyName = "resourceType")] + public string ResourceType { get; private set; } + + /// + /// Gets or sets The units of the limit, such as - Count, Bytes, etc. + /// Use the unit field provided in the Get quota response. + /// + [JsonProperty(PropertyName = "unit")] + public string Unit { get; set; } + + /// + /// Gets or sets the quota request status. + /// + [JsonProperty(PropertyName = "provisioningState")] + public object ProvisioningState { get; set; } + + /// + /// Gets user friendly status message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets sub request id for individual request. + /// + [JsonProperty(PropertyName = "subRequestId")] + public string SubRequestId { get; private set; } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/SubRequestName.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/SubRequestName.cs new file mode 100644 index 000000000000..1cdad422b56f --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/SubRequestName.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Reservations.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The Resource name. + /// + public partial class SubRequestName + { + /// + /// Initializes a new instance of the SubRequestName class. + /// + public SubRequestName() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SubRequestName class. + /// + /// Resource display name. + /// Resource name. + public SubRequestName(string localizedValue = default(string), string value = default(string)) + { + LocalizedValue = localizedValue; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resource display name. + /// + [JsonProperty(PropertyName = "localizedValue")] + public string LocalizedValue { get; private set; } + + /// + /// Gets resource name. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; private set; } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/SubscriptionScopeProperties.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/SubscriptionScopeProperties.cs index f7c1e46b3a42..2799a57eba0d 100644 --- a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/SubscriptionScopeProperties.cs +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/SubscriptionScopeProperties.cs @@ -30,7 +30,7 @@ public SubscriptionScopeProperties() /// Initializes a new instance of the SubscriptionScopeProperties /// class. /// - public SubscriptionScopeProperties(ScopeProperties scopes = default(ScopeProperties)) + public SubscriptionScopeProperties(IList scopes = default(IList)) { Scopes = scopes; CustomInit(); @@ -43,8 +43,8 @@ public SubscriptionScopeProperties() /// /// - [JsonProperty(PropertyName = "properties")] - public ScopeProperties Scopes { get; set; } + [JsonProperty(PropertyName = "scopes")] + public IList Scopes { get; set; } } } diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/SupportRequestAction.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/SupportRequestAction.cs new file mode 100644 index 000000000000..d2031c373b1e --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/SupportRequestAction.cs @@ -0,0 +1,130 @@ +// +// 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.Reservations.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The SupportRequest action. + /// + public partial class SupportRequestAction + { + /// + /// Initializes a new instance of the SupportRequestAction class. + /// + public SupportRequestAction() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SupportRequestAction class. + /// + /// Is support request action + /// enabled. + /// The support request severity. + /// The first name of the recipient. + /// The last name of the recipient. + /// The country of the recipient. + /// The phone number of the + /// recipient. + /// The primary email addresses of + /// the recipients. + /// The support language. + /// The preferred communication + /// channel. + /// The alternate email address + /// of the recipient. + public SupportRequestAction(object autoQuotaIncreaseState = default(object), object severity = default(object), string firstName = default(string), string lastName = default(string), string country = default(string), string phoneNumber = default(string), string primaryEmailAddress = default(string), string supportLanguage = default(string), object preferredContactMethod = default(object), IList alternateEmailAddresses = default(IList)) + { + AutoQuotaIncreaseState = autoQuotaIncreaseState; + Severity = severity; + FirstName = firstName; + LastName = lastName; + Country = country; + PhoneNumber = phoneNumber; + PrimaryEmailAddress = primaryEmailAddress; + SupportLanguage = supportLanguage; + PreferredContactMethod = preferredContactMethod; + AlternateEmailAddresses = alternateEmailAddresses; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets is support request action enabled. + /// + [JsonProperty(PropertyName = "autoQuotaIncreaseState")] + public object AutoQuotaIncreaseState { get; set; } + + /// + /// Gets or sets the support request severity. + /// + [JsonProperty(PropertyName = "severity")] + public object Severity { get; set; } + + /// + /// Gets or sets the first name of the recipient. + /// + [JsonProperty(PropertyName = "firstName")] + public string FirstName { get; set; } + + /// + /// Gets or sets the last name of the recipient. + /// + [JsonProperty(PropertyName = "lastName")] + public string LastName { get; set; } + + /// + /// Gets or sets the country of the recipient. + /// + [JsonProperty(PropertyName = "country")] + public string Country { get; set; } + + /// + /// Gets or sets the phone number of the recipient. + /// + [JsonProperty(PropertyName = "phoneNumber")] + public string PhoneNumber { get; set; } + + /// + /// Gets or sets the primary email addresses of the recipients. + /// + [JsonProperty(PropertyName = "primaryEmailAddress")] + public string PrimaryEmailAddress { get; set; } + + /// + /// Gets or sets the support language. + /// + [JsonProperty(PropertyName = "supportLanguage")] + public string SupportLanguage { get; set; } + + /// + /// Gets or sets the preferred communication channel. + /// + [JsonProperty(PropertyName = "preferredContactMethod")] + public object PreferredContactMethod { get; set; } + + /// + /// Gets or sets the alternate email address of the recipient. + /// + [JsonProperty(PropertyName = "alternateEmailAddresses")] + public IList AlternateEmailAddresses { get; set; } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/OperationOperations.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/OperationOperations.cs index e64b4330c2e6..da28dd104bef 100644 --- a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/OperationOperations.cs +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/OperationOperations.cs @@ -68,21 +68,12 @@ internal OperationOperations(AzureReservationAPIClient client) /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// /// /// A response object containing the response body and response headers. /// public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2019-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -90,6 +81,7 @@ internal OperationOperations(AzureReservationAPIClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -97,9 +89,9 @@ internal OperationOperations(AzureReservationAPIClient client) var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Capacity/operations").ToString(); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotaOperations.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotaOperations.cs new file mode 100644 index 000000000000..7a2ae6113569 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotaOperations.cs @@ -0,0 +1,276 @@ +// +// 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.Reservations +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// QuotaOperations operations. + /// + internal partial class QuotaOperations : IServiceOperations, IQuotaOperations + { + /// + /// Initializes a new instance of the QuotaOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal QuotaOperations(AzureReservationAPIClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureReservationAPIClient + /// + public AzureReservationAPIClient Client { get; private set; } + + /// + /// Gets the current quota limit and usages for the resource provider for the + /// specified location for the specific resource in the parameter. + /// + /// + /// This API gets the current quota limit and usages for the specific resource + /// for resource provider for the specified location. This response can be used + /// to submit quotaRequests. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// The Resource name for the specific resource provider, such as SKU name for + /// Microsoft.Compute, pool for Microsoft.Batch. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListStatusWithHttpMessagesAsync(string subscriptionId, string providerId, string location, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (subscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "subscriptionId"); + } + if (providerId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "providerId"); + } + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + string apiVersion = "2019-07-19-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("subscriptionId", subscriptionId); + tracingParameters.Add("providerId", providerId); + tracingParameters.Add("location", location); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListStatus", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(subscriptionId)); + _url = _url.Replace("{providerId}", System.Uri.EscapeDataString(providerId)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ExceptionResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ExceptionResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotaOperationsExtensions.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotaOperationsExtensions.cs new file mode 100644 index 000000000000..4982df10f680 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotaOperationsExtensions.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.Reservations +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for QuotaOperations. + /// + public static partial class QuotaOperationsExtensions + { + /// + /// Gets the current quota limit and usages for the resource provider for the + /// specified location for the specific resource in the parameter. + /// + /// + /// This API gets the current quota limit and usages for the specific resource + /// for resource provider for the specified location. This response can be used + /// to submit quotaRequests. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// The Resource name for the specific resource provider, such as SKU name for + /// Microsoft.Compute, pool for Microsoft.Batch. + /// + public static CurrentQuotaLimitBase ListStatus(this IQuotaOperations operations, string subscriptionId, string providerId, string location, string resourceName) + { + return operations.ListStatusAsync(subscriptionId, providerId, location, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Gets the current quota limit and usages for the resource provider for the + /// specified location for the specific resource in the parameter. + /// + /// + /// This API gets the current quota limit and usages for the specific resource + /// for resource provider for the specified location. This response can be used + /// to submit quotaRequests. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// The Resource name for the specific resource provider, such as SKU name for + /// Microsoft.Compute, pool for Microsoft.Batch. + /// + /// + /// The cancellation token. + /// + public static async Task ListStatusAsync(this IQuotaOperations operations, string subscriptionId, string providerId, string location, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListStatusWithHttpMessagesAsync(subscriptionId, providerId, location, resourceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotaRequestOperations.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotaRequestOperations.cs new file mode 100644 index 000000000000..b8792fbfcf6c --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotaRequestOperations.cs @@ -0,0 +1,686 @@ +// +// 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.Reservations +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// QuotaRequestOperations operations. + /// + internal partial class QuotaRequestOperations : IServiceOperations, IQuotaRequestOperations + { + /// + /// Initializes a new instance of the QuotaRequestOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal QuotaRequestOperations(AzureReservationAPIClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureReservationAPIClient + /// + public AzureReservationAPIClient Client { get; private set; } + + /// + /// Submits a Quota Request for a resource provider at the specified location + /// for the specific resource in the parameter. + /// + /// + /// Submits Quota change request for a resource provider for the specified + /// location for the specific resource in the parameter. To use, first make a + /// Get request to get quota information. This information consists of a list + /// of resources and information regarding those resources. For all the + /// resources in that list which require an update to their quotas, update + /// their limit fields in the response from the Get request to their new + /// values. Then, submit this updated JSON object to this quota request API. + /// This will update the quota to the values specified. The location header in + /// the response will be used to track the status of the quota request. Please + /// check the provisioningState field in the response. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// The Resource name for the specific resource provider, such as SKU name for + /// Microsoft.Compute, pool for Microsoft.Batch. + /// + /// + /// Quota requests payload. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from the + /// header response of the GET request or it should be * for unconditional + /// update. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateWithHttpMessagesAsync(string subscriptionId, string providerId, string location, string resourceName, CurrentQuotaLimitBase createQuotaRequest, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(subscriptionId, providerId, location, resourceName, createQuotaRequest, ifMatch, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Submits a Quota Request for a resource provider at the specified location + /// for the specific resource in the parameter. + /// + /// + /// Submits Quota change request for a resource provider for the specified + /// location for the specific resource in the parameter. To use, first make a + /// Get request to get quota information. This information consists of a list + /// of resources and information regarding those resources. For all the + /// resources in that list which require an update to their quotas, update + /// their limit fields in the response from the Get request to their new + /// values. Then, submit this updated JSON object to this quota request API. + /// This will update the quota to the values specified. The location header in + /// the response will be used to track the status of the quota request. Please + /// check the provisioningState field in the response. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// The Resource name for the specific resource provider, such as SKU name for + /// Microsoft.Compute, pool for Microsoft.Batch. + /// + /// + /// Quota requests payload. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from the + /// header response of the GET request or it should be * for unconditional + /// update. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string subscriptionId, string providerId, string location, string resourceName, CurrentQuotaLimitBase createQuotaRequest, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(subscriptionId, providerId, location, resourceName, createQuotaRequest, ifMatch, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Submits a Quota Request for a resource provider at the specified location + /// for the specific resource in the parameter. + /// + /// + /// Submits Quota change request for a resource provider for the specified + /// location for the specific resource in the parameter. To use, first make a + /// Get request to get quota information. This information consists of a list + /// of resources and information regarding those resources. For all the + /// resources in that list which require an update to their quotas, update + /// their limit fields in the response from the Get request to their new + /// values. Then, submit this updated JSON object to this quota request API. + /// This will update the quota to the values specified. The location header in + /// the response will be used to track the status of the quota request. Please + /// check the provisioningState field in the response. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// The Resource name for the specific resource provider, such as SKU name for + /// Microsoft.Compute, pool for Microsoft.Batch. + /// + /// + /// Quota requests payload. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from the + /// header response of the GET request or it should be * for unconditional + /// update. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginCreateWithHttpMessagesAsync(string subscriptionId, string providerId, string location, string resourceName, CurrentQuotaLimitBase createQuotaRequest, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (subscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "subscriptionId"); + } + if (providerId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "providerId"); + } + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (createQuotaRequest == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "createQuotaRequest"); + } + if (ifMatch == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch"); + } + string apiVersion = "2019-07-19-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("subscriptionId", subscriptionId); + tracingParameters.Add("providerId", providerId); + tracingParameters.Add("location", location); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("createQuotaRequest", createQuotaRequest); + tracingParameters.Add("ifMatch", ifMatch); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(subscriptionId)); + _url = _url.Replace("{providerId}", System.Uri.EscapeDataString(providerId)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (ifMatch != null) + { + if (_httpRequest.Headers.Contains("If-Match")) + { + _httpRequest.Headers.Remove("If-Match"); + } + _httpRequest.Headers.TryAddWithoutValidation("If-Match", ifMatch); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(createQuotaRequest != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(createQuotaRequest, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new ExceptionResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ExceptionResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Submits a Quota Request for a resource provider at the specified location + /// for the specific resource in the parameter. + /// + /// + /// Submits Quota change request for a resource provider for the specified + /// location for the specific resource in the parameter. To use, first make a + /// Get request to get quota information. This information consists of a list + /// of resources and information regarding those resources. For all the + /// resources in that list which require an update to their quotas, update + /// their limit fields in the response from the Get request to their new + /// values. Then, submit this updated JSON object to this quota request API. + /// This will update the quota to the values specified. The location header in + /// the response will be used to track the status of the quota request. Please + /// check the provisioningState field in the response. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// The Resource name for the specific resource provider, such as SKU name for + /// Microsoft.Compute, pool for Microsoft.Batch. + /// + /// + /// Quota requests payload. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from the + /// header response of the GET request or it should be * for unconditional + /// update. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginUpdateWithHttpMessagesAsync(string subscriptionId, string providerId, string location, string resourceName, CurrentQuotaLimitBase createQuotaRequest, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (subscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "subscriptionId"); + } + if (providerId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "providerId"); + } + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (createQuotaRequest == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "createQuotaRequest"); + } + if (ifMatch == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch"); + } + string apiVersion = "2019-07-19-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("subscriptionId", subscriptionId); + tracingParameters.Add("providerId", providerId); + tracingParameters.Add("location", location); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("createQuotaRequest", createQuotaRequest); + tracingParameters.Add("ifMatch", ifMatch); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(subscriptionId)); + _url = _url.Replace("{providerId}", System.Uri.EscapeDataString(providerId)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (ifMatch != null) + { + if (_httpRequest.Headers.Contains("If-Match")) + { + _httpRequest.Headers.Remove("If-Match"); + } + _httpRequest.Headers.TryAddWithoutValidation("If-Match", ifMatch); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(createQuotaRequest != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(createQuotaRequest, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new ExceptionResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ExceptionResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotaRequestOperationsExtensions.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotaRequestOperationsExtensions.cs new file mode 100644 index 000000000000..fe6a11e363f5 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotaRequestOperationsExtensions.cs @@ -0,0 +1,409 @@ +// +// 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.Reservations +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for QuotaRequestOperations. + /// + public static partial class QuotaRequestOperationsExtensions + { + /// + /// Submits a Quota Request for a resource provider at the specified location + /// for the specific resource in the parameter. + /// + /// + /// Submits Quota change request for a resource provider for the specified + /// location for the specific resource in the parameter. To use, first make a + /// Get request to get quota information. This information consists of a list + /// of resources and information regarding those resources. For all the + /// resources in that list which require an update to their quotas, update + /// their limit fields in the response from the Get request to their new + /// values. Then, submit this updated JSON object to this quota request API. + /// This will update the quota to the values specified. The location header in + /// the response will be used to track the status of the quota request. Please + /// check the provisioningState field in the response. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// The Resource name for the specific resource provider, such as SKU name for + /// Microsoft.Compute, pool for Microsoft.Batch. + /// + /// + /// Quota requests payload. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from the + /// header response of the GET request or it should be * for unconditional + /// update. + /// + public static object Create(this IQuotaRequestOperations operations, string subscriptionId, string providerId, string location, string resourceName, CurrentQuotaLimitBase createQuotaRequest, string ifMatch) + { + return operations.CreateAsync(subscriptionId, providerId, location, resourceName, createQuotaRequest, ifMatch).GetAwaiter().GetResult(); + } + + /// + /// Submits a Quota Request for a resource provider at the specified location + /// for the specific resource in the parameter. + /// + /// + /// Submits Quota change request for a resource provider for the specified + /// location for the specific resource in the parameter. To use, first make a + /// Get request to get quota information. This information consists of a list + /// of resources and information regarding those resources. For all the + /// resources in that list which require an update to their quotas, update + /// their limit fields in the response from the Get request to their new + /// values. Then, submit this updated JSON object to this quota request API. + /// This will update the quota to the values specified. The location header in + /// the response will be used to track the status of the quota request. Please + /// check the provisioningState field in the response. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// The Resource name for the specific resource provider, such as SKU name for + /// Microsoft.Compute, pool for Microsoft.Batch. + /// + /// + /// Quota requests payload. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from the + /// header response of the GET request or it should be * for unconditional + /// update. + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this IQuotaRequestOperations operations, string subscriptionId, string providerId, string location, string resourceName, CurrentQuotaLimitBase createQuotaRequest, string ifMatch, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(subscriptionId, providerId, location, resourceName, createQuotaRequest, ifMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Submits a Quota Request for a resource provider at the specified location + /// for the specific resource in the parameter. + /// + /// + /// Submits Quota change request for a resource provider for the specified + /// location for the specific resource in the parameter. To use, first make a + /// Get request to get quota information. This information consists of a list + /// of resources and information regarding those resources. For all the + /// resources in that list which require an update to their quotas, update + /// their limit fields in the response from the Get request to their new + /// values. Then, submit this updated JSON object to this quota request API. + /// This will update the quota to the values specified. The location header in + /// the response will be used to track the status of the quota request. Please + /// check the provisioningState field in the response. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// The Resource name for the specific resource provider, such as SKU name for + /// Microsoft.Compute, pool for Microsoft.Batch. + /// + /// + /// Quota requests payload. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from the + /// header response of the GET request or it should be * for unconditional + /// update. + /// + public static object Update(this IQuotaRequestOperations operations, string subscriptionId, string providerId, string location, string resourceName, CurrentQuotaLimitBase createQuotaRequest, string ifMatch) + { + return operations.UpdateAsync(subscriptionId, providerId, location, resourceName, createQuotaRequest, ifMatch).GetAwaiter().GetResult(); + } + + /// + /// Submits a Quota Request for a resource provider at the specified location + /// for the specific resource in the parameter. + /// + /// + /// Submits Quota change request for a resource provider for the specified + /// location for the specific resource in the parameter. To use, first make a + /// Get request to get quota information. This information consists of a list + /// of resources and information regarding those resources. For all the + /// resources in that list which require an update to their quotas, update + /// their limit fields in the response from the Get request to their new + /// values. Then, submit this updated JSON object to this quota request API. + /// This will update the quota to the values specified. The location header in + /// the response will be used to track the status of the quota request. Please + /// check the provisioningState field in the response. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// The Resource name for the specific resource provider, such as SKU name for + /// Microsoft.Compute, pool for Microsoft.Batch. + /// + /// + /// Quota requests payload. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from the + /// header response of the GET request or it should be * for unconditional + /// update. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IQuotaRequestOperations operations, string subscriptionId, string providerId, string location, string resourceName, CurrentQuotaLimitBase createQuotaRequest, string ifMatch, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(subscriptionId, providerId, location, resourceName, createQuotaRequest, ifMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Submits a Quota Request for a resource provider at the specified location + /// for the specific resource in the parameter. + /// + /// + /// Submits Quota change request for a resource provider for the specified + /// location for the specific resource in the parameter. To use, first make a + /// Get request to get quota information. This information consists of a list + /// of resources and information regarding those resources. For all the + /// resources in that list which require an update to their quotas, update + /// their limit fields in the response from the Get request to their new + /// values. Then, submit this updated JSON object to this quota request API. + /// This will update the quota to the values specified. The location header in + /// the response will be used to track the status of the quota request. Please + /// check the provisioningState field in the response. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// The Resource name for the specific resource provider, such as SKU name for + /// Microsoft.Compute, pool for Microsoft.Batch. + /// + /// + /// Quota requests payload. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from the + /// header response of the GET request or it should be * for unconditional + /// update. + /// + public static object BeginCreate(this IQuotaRequestOperations operations, string subscriptionId, string providerId, string location, string resourceName, CurrentQuotaLimitBase createQuotaRequest, string ifMatch) + { + return operations.BeginCreateAsync(subscriptionId, providerId, location, resourceName, createQuotaRequest, ifMatch).GetAwaiter().GetResult(); + } + + /// + /// Submits a Quota Request for a resource provider at the specified location + /// for the specific resource in the parameter. + /// + /// + /// Submits Quota change request for a resource provider for the specified + /// location for the specific resource in the parameter. To use, first make a + /// Get request to get quota information. This information consists of a list + /// of resources and information regarding those resources. For all the + /// resources in that list which require an update to their quotas, update + /// their limit fields in the response from the Get request to their new + /// values. Then, submit this updated JSON object to this quota request API. + /// This will update the quota to the values specified. The location header in + /// the response will be used to track the status of the quota request. Please + /// check the provisioningState field in the response. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// The Resource name for the specific resource provider, such as SKU name for + /// Microsoft.Compute, pool for Microsoft.Batch. + /// + /// + /// Quota requests payload. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from the + /// header response of the GET request or it should be * for unconditional + /// update. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateAsync(this IQuotaRequestOperations operations, string subscriptionId, string providerId, string location, string resourceName, CurrentQuotaLimitBase createQuotaRequest, string ifMatch, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateWithHttpMessagesAsync(subscriptionId, providerId, location, resourceName, createQuotaRequest, ifMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Submits a Quota Request for a resource provider at the specified location + /// for the specific resource in the parameter. + /// + /// + /// Submits Quota change request for a resource provider for the specified + /// location for the specific resource in the parameter. To use, first make a + /// Get request to get quota information. This information consists of a list + /// of resources and information regarding those resources. For all the + /// resources in that list which require an update to their quotas, update + /// their limit fields in the response from the Get request to their new + /// values. Then, submit this updated JSON object to this quota request API. + /// This will update the quota to the values specified. The location header in + /// the response will be used to track the status of the quota request. Please + /// check the provisioningState field in the response. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// The Resource name for the specific resource provider, such as SKU name for + /// Microsoft.Compute, pool for Microsoft.Batch. + /// + /// + /// Quota requests payload. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from the + /// header response of the GET request or it should be * for unconditional + /// update. + /// + public static object BeginUpdate(this IQuotaRequestOperations operations, string subscriptionId, string providerId, string location, string resourceName, CurrentQuotaLimitBase createQuotaRequest, string ifMatch) + { + return operations.BeginUpdateAsync(subscriptionId, providerId, location, resourceName, createQuotaRequest, ifMatch).GetAwaiter().GetResult(); + } + + /// + /// Submits a Quota Request for a resource provider at the specified location + /// for the specific resource in the parameter. + /// + /// + /// Submits Quota change request for a resource provider for the specified + /// location for the specific resource in the parameter. To use, first make a + /// Get request to get quota information. This information consists of a list + /// of resources and information regarding those resources. For all the + /// resources in that list which require an update to their quotas, update + /// their limit fields in the response from the Get request to their new + /// values. Then, submit this updated JSON object to this quota request API. + /// This will update the quota to the values specified. The location header in + /// the response will be used to track the status of the quota request. Please + /// check the provisioningState field in the response. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// The Resource name for the specific resource provider, such as SKU name for + /// Microsoft.Compute, pool for Microsoft.Batch. + /// + /// + /// Quota requests payload. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from the + /// header response of the GET request or it should be * for unconditional + /// update. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this IQuotaRequestOperations operations, string subscriptionId, string providerId, string location, string resourceName, CurrentQuotaLimitBase createQuotaRequest, string ifMatch, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(subscriptionId, providerId, location, resourceName, createQuotaRequest, ifMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotaRequestsOperations.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotaRequestsOperations.cs new file mode 100644 index 000000000000..4d46a289d207 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotaRequestsOperations.cs @@ -0,0 +1,673 @@ +// +// 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.Reservations +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// QuotaRequestsOperations operations. + /// + internal partial class QuotaRequestsOperations : IServiceOperations, IQuotaRequestsOperations + { + /// + /// Initializes a new instance of the QuotaRequestsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal QuotaRequestsOperations(AzureReservationAPIClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureReservationAPIClient + /// + public AzureReservationAPIClient Client { get; private set; } + + /// + /// Gets the Quota request status by requestId, for the specified resource + /// provider at specified location. + /// + /// + /// Gets the QuotaRequest details and status by the quota requestId for the + /// resources for the resource provider at a specific location. The requestId + /// is returned as response to the Put requests for serviceLimits. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// Quota Request id. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetStatusWithHttpMessagesAsync(string subscriptionId, string providerId, string location, string id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (subscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "subscriptionId"); + } + if (providerId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "providerId"); + } + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (id == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "id"); + } + string apiVersion = "2019-07-19-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("subscriptionId", subscriptionId); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("providerId", providerId); + tracingParameters.Add("location", location); + tracingParameters.Add("id", id); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetStatus", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimitsRequests/{id}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(subscriptionId)); + _url = _url.Replace("{providerId}", System.Uri.EscapeDataString(providerId)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ExceptionResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ExceptionResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// For the specified location and resource Provider, gets the quota requests + /// under the subscription over the time + /// period of one year ago from now to one year back, based on the filter + /// specified. + /// + /// + /// For the specified location and Resource provider gets the current quota + /// requests under the subscription over the time period of one year ago from + /// now to one year back. oData filter can be used to select quota requests. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// | Field | Supported operators + /// |---------------------|------------------------ + /// + /// |requestSubmitTime | ge, le, eq, gt, lt + /// + /// + /// Number of records to return. + /// + /// + /// Skiptoken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skiptoken parameter that specifies a + /// starting point to use for subsequent calls + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListStatusWithHttpMessagesAsync(string subscriptionId, string providerId, string location, string filter = default(string), int? top = default(int?), string skiptoken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (subscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "subscriptionId"); + } + if (providerId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "providerId"); + } + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (top < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + } + string apiVersion = "2019-07-19-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("subscriptionId", subscriptionId); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("providerId", providerId); + tracingParameters.Add("location", location); + tracingParameters.Add("filter", filter); + tracingParameters.Add("top", top); + tracingParameters.Add("skiptoken", skiptoken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListStatus", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimitsRequests").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(subscriptionId)); + _url = _url.Replace("{providerId}", System.Uri.EscapeDataString(providerId)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (top != null) + { + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + } + if (skiptoken != null) + { + _queryParameters.Add(string.Format("$skiptoken={0}", System.Uri.EscapeDataString(skiptoken))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ExceptionResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ExceptionResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// For the specified location and resource Provider, gets the quota requests + /// under the subscription over the time + /// period of one year ago from now to one year back, based on the filter + /// specified. + /// + /// + /// For the specified location and Resource provider gets the current quota + /// requests under the subscription over the time period of one year ago from + /// now to one year back. oData filter can be used to select quota requests. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListStatusNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListStatusNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ExceptionResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ExceptionResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotaRequestsOperationsExtensions.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotaRequestsOperationsExtensions.cs new file mode 100644 index 000000000000..7a6a2e7c0d6f --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotaRequestsOperationsExtensions.cs @@ -0,0 +1,231 @@ +// +// 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.Reservations +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for QuotaRequestsOperations. + /// + public static partial class QuotaRequestsOperationsExtensions + { + /// + /// Gets the Quota request status by requestId, for the specified resource + /// provider at specified location. + /// + /// + /// Gets the QuotaRequest details and status by the quota requestId for the + /// resources for the resource provider at a specific location. The requestId + /// is returned as response to the Put requests for serviceLimits. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// Quota Request id. + /// + public static QuotaRequestDetails GetStatus(this IQuotaRequestsOperations operations, string subscriptionId, string providerId, string location, string id) + { + return operations.GetStatusAsync(subscriptionId, providerId, location, id).GetAwaiter().GetResult(); + } + + /// + /// Gets the Quota request status by requestId, for the specified resource + /// provider at specified location. + /// + /// + /// Gets the QuotaRequest details and status by the quota requestId for the + /// resources for the resource provider at a specific location. The requestId + /// is returned as response to the Put requests for serviceLimits. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// Quota Request id. + /// + /// + /// The cancellation token. + /// + public static async Task GetStatusAsync(this IQuotaRequestsOperations operations, string subscriptionId, string providerId, string location, string id, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetStatusWithHttpMessagesAsync(subscriptionId, providerId, location, id, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// For the specified location and resource Provider, gets the quota requests + /// under the subscription over the time + /// period of one year ago from now to one year back, based on the filter + /// specified. + /// + /// + /// For the specified location and Resource provider gets the current quota + /// requests under the subscription over the time period of one year ago from + /// now to one year back. oData filter can be used to select quota requests. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// | Field | Supported operators + /// |---------------------|------------------------ + /// + /// |requestSubmitTime | ge, le, eq, gt, lt + /// + /// + /// Number of records to return. + /// + /// + /// Skiptoken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skiptoken parameter that specifies a + /// starting point to use for subsequent calls + /// + public static IPage ListStatus(this IQuotaRequestsOperations operations, string subscriptionId, string providerId, string location, string filter = default(string), int? top = default(int?), string skiptoken = default(string)) + { + return operations.ListStatusAsync(subscriptionId, providerId, location, filter, top, skiptoken).GetAwaiter().GetResult(); + } + + /// + /// For the specified location and resource Provider, gets the quota requests + /// under the subscription over the time + /// period of one year ago from now to one year back, based on the filter + /// specified. + /// + /// + /// For the specified location and Resource provider gets the current quota + /// requests under the subscription over the time period of one year ago from + /// now to one year back. oData filter can be used to select quota requests. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// | Field | Supported operators + /// |---------------------|------------------------ + /// + /// |requestSubmitTime | ge, le, eq, gt, lt + /// + /// + /// Number of records to return. + /// + /// + /// Skiptoken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skiptoken parameter that specifies a + /// starting point to use for subsequent calls + /// + /// + /// The cancellation token. + /// + public static async Task> ListStatusAsync(this IQuotaRequestsOperations operations, string subscriptionId, string providerId, string location, string filter = default(string), int? top = default(int?), string skiptoken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListStatusWithHttpMessagesAsync(subscriptionId, providerId, location, filter, top, skiptoken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// For the specified location and resource Provider, gets the quota requests + /// under the subscription over the time + /// period of one year ago from now to one year back, based on the filter + /// specified. + /// + /// + /// For the specified location and Resource provider gets the current quota + /// requests under the subscription over the time period of one year ago from + /// now to one year back. oData filter can be used to select quota requests. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListStatusNext(this IQuotaRequestsOperations operations, string nextPageLink) + { + return operations.ListStatusNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// For the specified location and resource Provider, gets the quota requests + /// under the subscription over the time + /// period of one year ago from now to one year back, based on the filter + /// specified. + /// + /// + /// For the specified location and Resource provider gets the current quota + /// requests under the subscription over the time period of one year ago from + /// now to one year back. oData filter can be used to select quota requests. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListStatusNextAsync(this IQuotaRequestsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListStatusNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotasOperations.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotasOperations.cs new file mode 100644 index 000000000000..e83fbbecc2c5 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotasOperations.cs @@ -0,0 +1,453 @@ +// +// 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.Reservations +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// QuotasOperations operations. + /// + internal partial class QuotasOperations : IServiceOperations, IQuotasOperations + { + /// + /// Initializes a new instance of the QuotasOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal QuotasOperations(AzureReservationAPIClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureReservationAPIClient + /// + public AzureReservationAPIClient Client { get; private set; } + + /// + /// Gets the current quota limit and usages for all the resources by the + /// resource provider at the specified location. + /// + /// + /// This API gets the current quota limits and usages for the resource provider + /// for the specified location. This response can be used to submit + /// quotaRequests. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task,QuotasListStatusHeaders>> ListStatusWithHttpMessagesAsync(string subscriptionId, string providerId, string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (subscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "subscriptionId"); + } + if (providerId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "providerId"); + } + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + string apiVersion = "2019-07-19-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("subscriptionId", subscriptionId); + tracingParameters.Add("providerId", providerId); + tracingParameters.Add("location", location); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListStatus", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(subscriptionId)); + _url = _url.Replace("{providerId}", System.Uri.EscapeDataString(providerId)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ExceptionResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ExceptionResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse,QuotasListStatusHeaders>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the current quota limit and usages for all the resources by the + /// resource provider at the specified location. + /// + /// + /// This API gets the current quota limits and usages for the resource provider + /// for the specified location. This response can be used to submit + /// quotaRequests. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task,QuotasListStatusHeaders>> ListStatusNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListStatusNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ExceptionResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ExceptionResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse,QuotasListStatusHeaders>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotasOperationsExtensions.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotasOperationsExtensions.cs new file mode 100644 index 000000000000..0e8a52509112 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/QuotasOperationsExtensions.cs @@ -0,0 +1,129 @@ +// +// 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.Reservations +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for QuotasOperations. + /// + public static partial class QuotasOperationsExtensions + { + /// + /// Gets the current quota limit and usages for all the resources by the + /// resource provider at the specified location. + /// + /// + /// This API gets the current quota limits and usages for the resource provider + /// for the specified location. This response can be used to submit + /// quotaRequests. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + public static IPage ListStatus(this IQuotasOperations operations, string subscriptionId, string providerId, string location) + { + return operations.ListStatusAsync(subscriptionId, providerId, location).GetAwaiter().GetResult(); + } + + /// + /// Gets the current quota limit and usages for all the resources by the + /// resource provider at the specified location. + /// + /// + /// This API gets the current quota limits and usages for the resource provider + /// for the specified location. This response can be used to submit + /// quotaRequests. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure subscription id. + /// + /// + /// Azure resource Provider id. + /// + /// + /// Azure region. + /// + /// + /// The cancellation token. + /// + public static async Task> ListStatusAsync(this IQuotasOperations operations, string subscriptionId, string providerId, string location, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListStatusWithHttpMessagesAsync(subscriptionId, providerId, location, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the current quota limit and usages for all the resources by the + /// resource provider at the specified location. + /// + /// + /// This API gets the current quota limits and usages for the resource provider + /// for the specified location. This response can be used to submit + /// quotaRequests. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListStatusNext(this IQuotasOperations operations, string nextPageLink) + { + return operations.ListStatusNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the current quota limit and usages for all the resources by the + /// resource provider at the specified location. + /// + /// + /// This API gets the current quota limits and usages for the resource provider + /// for the specified location. This response can be used to submit + /// quotaRequests. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListStatusNextAsync(this IQuotasOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListStatusNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/ReservationOperations.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/ReservationOperations.cs index 31300cd1e07c..251407c017b7 100644 --- a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/ReservationOperations.cs +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/ReservationOperations.cs @@ -71,7 +71,7 @@ internal ReservationOperations(AzureReservationAPIClient client) /// /// The cancellation token. /// - public async Task> AvailableScopesWithHttpMessagesAsync(string reservationOrderId, string reservationId, SubscriptionScopeProperties body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> AvailableScopesWithHttpMessagesAsync(string reservationOrderId, string reservationId, IList body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request AzureOperationResponse _response = await BeginAvailableScopesWithHttpMessagesAsync(reservationOrderId, reservationId, body, customHeaders, cancellationToken).ConfigureAwait(false); @@ -166,10 +166,7 @@ internal ReservationOperations(AzureReservationAPIClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "reservationOrderId"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2019-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -178,6 +175,7 @@ internal ReservationOperations(AzureReservationAPIClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("reservationOrderId", reservationOrderId); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -186,9 +184,9 @@ internal ReservationOperations(AzureReservationAPIClient client) var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations").ToString(); _url = _url.Replace("{reservationOrderId}", System.Uri.EscapeDataString(reservationOrderId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -356,10 +354,7 @@ internal ReservationOperations(AzureReservationAPIClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "reservationOrderId"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2019-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -369,6 +364,7 @@ internal ReservationOperations(AzureReservationAPIClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("reservationId", reservationId); tracingParameters.Add("reservationOrderId", reservationOrderId); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); @@ -379,9 +375,9 @@ internal ReservationOperations(AzureReservationAPIClient client) _url = _url.Replace("{reservationId}", System.Uri.EscapeDataString(reservationId)); _url = _url.Replace("{reservationOrderId}", System.Uri.EscapeDataString(reservationOrderId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (expand != null) { @@ -578,10 +574,7 @@ internal ReservationOperations(AzureReservationAPIClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "reservationOrderId"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2019-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -591,6 +584,7 @@ internal ReservationOperations(AzureReservationAPIClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("reservationId", reservationId); tracingParameters.Add("reservationOrderId", reservationOrderId); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListRevisions", tracingParameters); } @@ -600,9 +594,9 @@ internal ReservationOperations(AzureReservationAPIClient client) _url = _url.Replace("{reservationId}", System.Uri.EscapeDataString(reservationId)); _url = _url.Replace("{reservationOrderId}", System.Uri.EscapeDataString(reservationOrderId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -760,7 +754,7 @@ internal ReservationOperations(AzureReservationAPIClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginAvailableScopesWithHttpMessagesAsync(string reservationOrderId, string reservationId, SubscriptionScopeProperties body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginAvailableScopesWithHttpMessagesAsync(string reservationOrderId, string reservationId, IList body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (reservationOrderId == null) { @@ -770,14 +764,11 @@ internal ReservationOperations(AzureReservationAPIClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "reservationId"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } if (body == null) { throw new ValidationException(ValidationRules.CannotBeNull, "body"); } + string apiVersion = "2019-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -787,6 +778,7 @@ internal ReservationOperations(AzureReservationAPIClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("reservationOrderId", reservationOrderId); tracingParameters.Add("reservationId", reservationId); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("body", body); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginAvailableScopes", tracingParameters); @@ -797,9 +789,9 @@ internal ReservationOperations(AzureReservationAPIClient client) _url = _url.Replace("{reservationOrderId}", System.Uri.EscapeDataString(reservationOrderId)); _url = _url.Replace("{reservationId}", System.Uri.EscapeDataString(reservationId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -967,14 +959,11 @@ internal ReservationOperations(AzureReservationAPIClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "reservationOrderId"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } if (body == null) { throw new ValidationException(ValidationRules.CannotBeNull, "body"); } + string apiVersion = "2019-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -983,6 +972,7 @@ internal ReservationOperations(AzureReservationAPIClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("reservationOrderId", reservationOrderId); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("body", body); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginSplit", tracingParameters); @@ -992,9 +982,9 @@ internal ReservationOperations(AzureReservationAPIClient client) var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/split").ToString(); _url = _url.Replace("{reservationOrderId}", System.Uri.EscapeDataString(reservationOrderId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -1162,14 +1152,11 @@ internal ReservationOperations(AzureReservationAPIClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "reservationOrderId"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } if (body == null) { throw new ValidationException(ValidationRules.CannotBeNull, "body"); } + string apiVersion = "2019-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1178,6 +1165,7 @@ internal ReservationOperations(AzureReservationAPIClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("reservationOrderId", reservationOrderId); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("body", body); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginMerge", tracingParameters); @@ -1187,9 +1175,9 @@ internal ReservationOperations(AzureReservationAPIClient client) var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/merge").ToString(); _url = _url.Replace("{reservationOrderId}", System.Uri.EscapeDataString(reservationOrderId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -1363,14 +1351,11 @@ internal ReservationOperations(AzureReservationAPIClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "reservationId"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } if (parameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } + string apiVersion = "2019-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1380,6 +1365,7 @@ internal ReservationOperations(AzureReservationAPIClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("reservationOrderId", reservationOrderId); tracingParameters.Add("reservationId", reservationId); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); @@ -1390,9 +1376,9 @@ internal ReservationOperations(AzureReservationAPIClient client) _url = _url.Replace("{reservationOrderId}", System.Uri.EscapeDataString(reservationOrderId)); _url = _url.Replace("{reservationId}", System.Uri.EscapeDataString(reservationId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/ReservationOperationsExtensions.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/ReservationOperationsExtensions.cs index 61135f6bf623..2a461fa4b619 100644 --- a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/ReservationOperationsExtensions.cs +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/ReservationOperationsExtensions.cs @@ -41,7 +41,7 @@ public static partial class ReservationOperationsExtensions /// /// /// - public static Properties AvailableScopes(this IReservationOperations operations, string reservationOrderId, string reservationId, SubscriptionScopeProperties body) + public static Properties AvailableScopes(this IReservationOperations operations, string reservationOrderId, string reservationId, IList body) { return operations.AvailableScopesAsync(reservationOrderId, reservationId, body).GetAwaiter().GetResult(); } @@ -67,7 +67,7 @@ public static Properties AvailableScopes(this IReservationOperations operations, /// /// The cancellation token. /// - public static async Task AvailableScopesAsync(this IReservationOperations operations, string reservationOrderId, string reservationId, SubscriptionScopeProperties body, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task AvailableScopesAsync(this IReservationOperations operations, string reservationOrderId, string reservationId, IList body, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.AvailableScopesWithHttpMessagesAsync(reservationOrderId, reservationId, body, null, cancellationToken).ConfigureAwait(false)) { @@ -379,7 +379,7 @@ public static IPage ListRevisions(this IReservationOperatio /// /// /// - public static Properties BeginAvailableScopes(this IReservationOperations operations, string reservationOrderId, string reservationId, SubscriptionScopeProperties body) + public static Properties BeginAvailableScopes(this IReservationOperations operations, string reservationOrderId, string reservationId, IList body) { return operations.BeginAvailableScopesAsync(reservationOrderId, reservationId, body).GetAwaiter().GetResult(); } @@ -405,7 +405,7 @@ public static Properties BeginAvailableScopes(this IReservationOperations operat /// /// The cancellation token. /// - public static async Task BeginAvailableScopesAsync(this IReservationOperations operations, string reservationOrderId, string reservationId, SubscriptionScopeProperties body, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginAvailableScopesAsync(this IReservationOperations operations, string reservationOrderId, string reservationId, IList body, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginAvailableScopesWithHttpMessagesAsync(reservationOrderId, reservationId, body, null, cancellationToken).ConfigureAwait(false)) { diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/ReservationOrderOperations.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/ReservationOrderOperations.cs index 1ac24c52fa22..18a326d48f7f 100644 --- a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/ReservationOrderOperations.cs +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/ReservationOrderOperations.cs @@ -82,14 +82,11 @@ internal ReservationOrderOperations(AzureReservationAPIClient client) /// public async Task> CalculateWithHttpMessagesAsync(PurchaseRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } if (body == null) { throw new ValidationException(ValidationRules.CannotBeNull, "body"); } + string apiVersion = "2019-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -97,6 +94,7 @@ internal ReservationOrderOperations(AzureReservationAPIClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("body", body); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Calculate", tracingParameters); @@ -105,9 +103,9 @@ internal ReservationOrderOperations(AzureReservationAPIClient client) var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Capacity/calculatePrice").ToString(); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -254,21 +252,12 @@ internal ReservationOrderOperations(AzureReservationAPIClient client) /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// /// /// A response object containing the response body and response headers. /// public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2019-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -276,6 +265,7 @@ internal ReservationOrderOperations(AzureReservationAPIClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -283,9 +273,9 @@ internal ReservationOrderOperations(AzureReservationAPIClient client) var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Capacity/reservationOrders").ToString(); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -471,10 +461,7 @@ internal ReservationOrderOperations(AzureReservationAPIClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "reservationOrderId"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } + string apiVersion = "2019-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -483,6 +470,7 @@ internal ReservationOrderOperations(AzureReservationAPIClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("reservationOrderId", reservationOrderId); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); @@ -492,9 +480,9 @@ internal ReservationOrderOperations(AzureReservationAPIClient client) var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}").ToString(); _url = _url.Replace("{reservationOrderId}", System.Uri.EscapeDataString(reservationOrderId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (expand != null) { @@ -659,14 +647,11 @@ internal ReservationOrderOperations(AzureReservationAPIClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "reservationOrderId"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } if (body == null) { throw new ValidationException(ValidationRules.CannotBeNull, "body"); } + string apiVersion = "2019-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -675,6 +660,7 @@ internal ReservationOrderOperations(AzureReservationAPIClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("reservationOrderId", reservationOrderId); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("body", body); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginPurchase", tracingParameters); @@ -684,9 +670,9 @@ internal ReservationOrderOperations(AzureReservationAPIClient client) var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}").ToString(); _url = _url.Replace("{reservationOrderId}", System.Uri.EscapeDataString(reservationOrderId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/SdkInfo_AzureReservationAPI.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/SdkInfo_AzureReservationAPI.cs index 80ecd39925a7..3c3805bec35d 100644 --- a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/SdkInfo_AzureReservationAPI.cs +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/SdkInfo_AzureReservationAPI.cs @@ -19,23 +19,18 @@ public static IEnumerable> ApiInfo_AzureReservatio { return new Tuple[] { + new Tuple("Capacity", "AutoQuotaIncrease", "2019-07-19-preview"), new Tuple("Capacity", "GetAppliedReservationList", "2019-04-01"), new Tuple("Capacity", "GetCatalog", "2019-04-01"), new Tuple("Capacity", "Operation", "2019-04-01"), + new Tuple("Capacity", "Quota", "2019-07-19-preview"), + new Tuple("Capacity", "QuotaRequest", "2019-07-19-preview"), + new Tuple("Capacity", "QuotaRequests", "2019-07-19-preview"), + new Tuple("Capacity", "Quotas", "2019-07-19-preview"), new Tuple("Capacity", "Reservation", "2019-04-01"), new Tuple("Capacity", "ReservationOrder", "2019-04-01"), }.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/reservations/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=D:\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "08800e55784acd375627f6f2f3ecaddbbbc41c3c"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } }