diff --git a/sdk/reservations/arm-reservations/LICENSE.txt b/sdk/reservations/arm-reservations/LICENSE.txt index b73b4a1293c3..ea8fb1516028 100644 --- a/sdk/reservations/arm-reservations/LICENSE.txt +++ b/sdk/reservations/arm-reservations/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2019 Microsoft +Copyright (c) 2020 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/reservations/arm-reservations/README.md b/sdk/reservations/arm-reservations/README.md index 4c4c1a39dcb7..2da5176a8437 100644 --- a/sdk/reservations/arm-reservations/README.md +++ b/sdk/reservations/arm-reservations/README.md @@ -15,7 +15,7 @@ npm install @azure/arm-reservations ### How to use -#### nodejs - Authentication, client creation and list reservation as an example written in TypeScript. +#### nodejs - Authentication, client creation and listStatus quota as an example written in TypeScript. ##### Install @azure/ms-rest-nodeauth @@ -35,8 +35,11 @@ const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; msRestNodeAuth.interactiveLogin().then((creds) => { const client = new AzureReservationAPI(creds, subscriptionId); - const reservationOrderId = "testreservationOrderId"; - client.reservation.list(reservationOrderId).then((result) => { + const subscriptionId = "testsubscriptionId"; + const providerId = "testproviderId"; + const location = "westus"; + const resourceName = "testresourceName"; + client.quota.listStatus(subscriptionId, providerId, location, resourceName).then((result) => { console.log("The result is:"); console.log(result); }); @@ -45,7 +48,7 @@ msRestNodeAuth.interactiveLogin().then((creds) => { }); ``` -#### browser - Authentication, client creation and list reservation as an example written in JavaScript. +#### browser - Authentication, client creation and listStatus quota as an example written in JavaScript. ##### Install @azure/ms-rest-browserauth @@ -79,8 +82,11 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to authManager.login(); } const client = new Azure.ArmReservations.AzureReservationAPI(res.creds, subscriptionId); - const reservationOrderId = "testreservationOrderId"; - client.reservation.list(reservationOrderId).then((result) => { + const subscriptionId = "testsubscriptionId"; + const providerId = "testproviderId"; + const location = "westus"; + const resourceName = "testresourceName"; + client.quota.listStatus(subscriptionId, providerId, location, resourceName).then((result) => { console.log("The result is:"); console.log(result); }).catch((err) => { @@ -98,4 +104,4 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Freservations%2Farm-reservations%2FREADME.png) +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/reservations/arm-reservations/README.png) diff --git a/sdk/reservations/arm-reservations/src/azureReservationAPI.ts b/sdk/reservations/arm-reservations/src/azureReservationAPI.ts index 04ad2547c57d..9e9a85cfd8b6 100644 --- a/sdk/reservations/arm-reservations/src/azureReservationAPI.ts +++ b/sdk/reservations/arm-reservations/src/azureReservationAPI.ts @@ -18,6 +18,11 @@ import { AzureReservationAPIContext } from "./azureReservationAPIContext"; class AzureReservationAPI extends AzureReservationAPIContext { // Operation groups + quota: operations.Quota; + quotaRequest: operations.QuotaRequest; + quotas: operations.Quotas; + quotaRequests: operations.QuotaRequests; + autoQuotaIncrease: operations.AutoQuotaIncrease; reservation: operations.Reservation; reservationOrder: operations.ReservationOrder; operation: operations.Operation; @@ -29,6 +34,11 @@ class AzureReservationAPI extends AzureReservationAPIContext { */ constructor(credentials: msRest.ServiceClientCredentials, options?: Models.AzureReservationAPIOptions) { super(credentials, options); + this.quota = new operations.Quota(this); + this.quotaRequest = new operations.QuotaRequest(this); + this.quotas = new operations.Quotas(this); + this.quotaRequests = new operations.QuotaRequests(this); + this.autoQuotaIncrease = new operations.AutoQuotaIncrease(this); this.reservation = new operations.Reservation(this); this.reservationOrder = new operations.ReservationOrder(this); this.operation = new operations.Operation(this); @@ -107,9 +117,9 @@ const getCatalogOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], queryParameters: [ - Parameters.apiVersion, + Parameters.apiVersion1, Parameters.reservedResourceType, - Parameters.location + Parameters.location1 ], headerParameters: [ Parameters.acceptLanguage @@ -143,7 +153,7 @@ const getAppliedReservationListOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion1 ], headerParameters: [ Parameters.acceptLanguage diff --git a/sdk/reservations/arm-reservations/src/azureReservationAPIContext.ts b/sdk/reservations/arm-reservations/src/azureReservationAPIContext.ts index 79bdbe3eda31..91fe99fa7ff0 100644 --- a/sdk/reservations/arm-reservations/src/azureReservationAPIContext.ts +++ b/sdk/reservations/arm-reservations/src/azureReservationAPIContext.ts @@ -13,11 +13,10 @@ import * as msRest from "@azure/ms-rest-js"; import * as msRestAzure from "@azure/ms-rest-azure-js"; const packageName = "@azure/arm-reservations"; -const packageVersion = "4.0.0"; +const packageVersion = "5.0.0"; export class AzureReservationAPIContext extends msRestAzure.AzureServiceClient { credentials: msRest.ServiceClientCredentials; - apiVersion?: string; /** * Initializes a new instance of the AzureReservationAPI class. @@ -39,7 +38,6 @@ export class AzureReservationAPIContext extends msRestAzure.AzureServiceClient { super(credentials, options); - this.apiVersion = '2019-04-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; diff --git a/sdk/reservations/arm-reservations/src/models/autoQuotaIncreaseMappers.ts b/sdk/reservations/arm-reservations/src/models/autoQuotaIncreaseMappers.ts new file mode 100644 index 000000000000..f79be013e678 --- /dev/null +++ b/sdk/reservations/arm-reservations/src/models/autoQuotaIncreaseMappers.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + AqiSettings, + AutoQuotaIncreaseDetail, + BaseResource, + CurrentQuotaLimit, + CurrentQuotaLimitBase, + CurrentQuotaLimitBaseName, + EmailAction, + ExceptionResponse, + ExtendedStatusInfo, + OnFailure, + OnFailureEmailActions, + OnFailurePhoneActions, + PaymentDetail, + PhoneAction, + Price, + PurchaseRequest, + PurchaseRequestPropertiesReservedResourceProperties, + QuotaRequestDetails, + QuotaRequestOneResourceSubmitResponse, + QuotaRequestProperties, + QuotaRequestSubmitResponse, + RenewPropertiesResponse, + RenewPropertiesResponseBillingCurrencyTotal, + RenewPropertiesResponsePricingCurrencyTotal, + ReservationMergeProperties, + ReservationOrderBillingPlanInformation, + ReservationOrderResponse, + ReservationProperties, + ReservationResponse, + ReservationSplitProperties, + ServiceError, + ServiceErrorDetail, + SkuName, + SubRequest, + SubRequestName, + SupportRequestAction +} from "../models/mappers"; diff --git a/sdk/reservations/arm-reservations/src/models/index.ts b/sdk/reservations/arm-reservations/src/models/index.ts index fbbaa8eb4ff2..2d9098de448a 100644 --- a/sdk/reservations/arm-reservations/src/models/index.ts +++ b/sdk/reservations/arm-reservations/src/models/index.ts @@ -11,6 +11,589 @@ import * as msRest from "@azure/ms-rest-js"; export { BaseResource, CloudError }; +/** + * Name of the resource provide by the resource Provider. Please use this name property for + * quotaRequests. + */ +export interface CurrentQuotaLimitBaseName { + /** + * Resource name. + */ + value?: string; + /** + * Resource display name. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly localizedValue?: string; +} + +/** + * Quota limits. + */ +export interface CurrentQuotaLimitBase extends BaseResource { + /** + * The quota limit. + */ + limit?: number; + /** + * The current resource usages information. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly currentValue?: number; + /** + * The units of the limit, such as - Count, Bytes, etc. Use the unit field provided in the Get + * quota response. + */ + unit?: string; + /** + * Name of the resource provide by the resource Provider. Please use this name property for + * quotaRequests. + */ + name?: CurrentQuotaLimitBaseName; + /** + * The Resource Type Name. + */ + resourceType?: any; + /** + * 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. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly quotaPeriod?: string; + /** + * Additional properties for the specific resource provider. + */ + properties?: any; +} + +/** + * Quota limits. + */ +export interface CurrentQuotaLimit extends BaseResource { + /** + * The quota limit. + */ + limit?: number; + /** + * The current resource usages information. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly currentValue?: number; + /** + * The units of the limit, such as - Count, Bytes, etc. Use the unit field provided in the Get + * quota response. + */ + unit?: string; + /** + * Name of the resource provide by the resource Provider. Please use this name property for + * quotaRequests. + */ + name?: CurrentQuotaLimitBaseName; + /** + * The Resource Type Name. + */ + resourceType?: any; + /** + * 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. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly quotaPeriod?: string; + /** + * Additional properties for the specific resource provider. + */ + properties?: any; + /** + * The quota request status. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provisioningState?: any; + /** + * A user friendly message. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly message?: string; +} + +/** + * Quota limits request response. + */ +export interface QuotaLimitsResponse { + /** + * List of Quota limits with the quota request status. + */ + value?: CurrentQuotaLimit[]; + /** + * The uri to fetch the next page of quota limits. When there are no more pages, this is null. + */ + nextLink?: string; +} + +/** + * Quota change requests information. + */ +export interface CreateGenericQuotaRequestParameters { + /** + * Quota change requests. + */ + value?: CurrentQuotaLimitBase[]; +} + +/** + * The Resource name. + */ +export interface SubRequestName { + /** + * Resource display name. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly localizedValue?: string; + /** + * Resource name. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly value?: string; +} + +/** + * The sub-request submitted with the quota request. + */ +export interface SubRequest { + /** + * The Resource limit. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly limit?: number; + /** + * The Resource name. + */ + name?: SubRequestName; + /** + * Resource type for which the quota check was made. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly resourceType?: string; + /** + * The units of the limit, such as - Count, Bytes, etc. Use the unit field provided in the Get + * quota response. + */ + unit?: string; + /** + * The quota request status. + */ + provisioningState?: any; + /** + * User friendly status message. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly message?: string; + /** + * Sub request id for individual request. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly subRequestId?: string; +} + +/** + * Quota submit request response + */ +export interface QuotaRequestOneResourceSubmitResponse extends BaseResource { + /** + * The quota request Id. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The name of the quota request. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * Type of resource. "Microsoft.Capacity/ServiceLimits" + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * The quota request status. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provisioningState?: any; + /** + * User friendly status message. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly message?: string; + /** + * The quota request submit time. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ + * as specified by the ISO 8601 standard. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly requestSubmitTime?: Date; + /** + * The quota limit. + */ + limit?: number; + /** + * The current resource usages information. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly currentValue?: number; + /** + * The units of the limit, such as - Count, Bytes, etc. Use the unit field provided in the Get + * quota response. + */ + unit?: string; + /** + * Name of the resource provide by the resource Provider. Please use this name property for + * quotaRequests. + */ + name1?: CurrentQuotaLimitBaseName; + /** + * The Resource Type Name. + */ + resourceType?: any; + /** + * 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. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly quotaPeriod?: string; + /** + * Additional properties for the specific resource provider. + */ + properties?: any; +} + +/** + * The details of quota request. + */ +export interface QuotaRequestProperties { + /** + * The quota request status. + */ + provisioningState?: any; + /** + * User friendly status message. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly message?: string; + /** + * The quota request submit time. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ + * as specified by the ISO 8601 standard. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly requestSubmitTime?: Date; + /** + * The quotaRequests. + */ + value?: SubRequest[]; +} + +/** + * Quota submit request response + */ +export interface QuotaRequestSubmitResponse extends BaseResource { + /** + * The quota request Id. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The name of the quota request. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The quota request details. + */ + properties?: QuotaRequestProperties; + /** + * Type of resource. "Microsoft.Capacity/serviceLimits" + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; +} + +/** + * The quota request submit response with request id. + */ +export interface QuotaRequestSubmitResponse201 { + /** + * The quota request id. Please use the requestId to check the request status. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The operation Id + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The resource type + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * The quota request status. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provisioningState?: any; + /** + * A user friendly message. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly message?: string; +} + +/** + * The details of the quota Request. + */ +export interface QuotaRequestDetails extends BaseResource { + /** + * The quota request Id. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The name of the quota request. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The quota request status. + */ + provisioningState?: any; + /** + * User friendly status message. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly message?: string; + /** + * The quota request submit time. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ + * as specified by the ISO 8601 standard. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly requestSubmitTime?: Date; + /** + * The quotaRequests. + */ + value?: SubRequest[]; + /** + * Type of resource. "Microsoft.Capacity/ServiceLimits" + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; +} + +/** + * Settings for auto quota increase. + */ +export interface AqiSettings { + /** + * If the subscription has enabled automatic quota increase. + */ + autoQuotaIncreaseState?: any; +} + +/** + * Email Action. + */ +export interface EmailAction { + /** + * The email address for the action. + */ + emailAddress?: string; +} + +/** + * The email actions for auto quota increase. + */ +export interface OnFailureEmailActions { + /** + * The list of email actions. + */ + value?: EmailAction[]; +} + +/** + * Phone Action. + */ +export interface PhoneAction { + /** + * The phone number for the action. + */ + phoneNumber?: string; + /** + * The preferred communication channel. + */ + preferredChannel?: any; +} + +/** + * The phone actions for auto quota increase. + */ +export interface OnFailurePhoneActions { + /** + * The list of phone actions. + */ + value?: PhoneAction[]; +} + +/** + * The actions for auto quota increase. + */ +export interface OnFailure { + /** + * The email actions for auto quota increase. + */ + emailActions?: OnFailureEmailActions; + /** + * The phone actions for auto quota increase. + */ + phoneActions?: OnFailurePhoneActions; +} + +/** + * The SupportRequest action. + */ +export interface SupportRequestAction { + /** + * Is support request action enabled. + */ + autoQuotaIncreaseState?: any; + /** + * The support request severity. + */ + severity?: any; + /** + * The first name of the recipient. + */ + firstName?: string; + /** + * The last name of the recipient. + */ + lastName?: string; + /** + * The country of the recipient. + */ + country?: string; + /** + * The phone number of the recipient. + */ + phoneNumber?: string; + /** + * The primary email addresses of the recipients. + */ + primaryEmailAddress?: string; + /** + * The support language. + */ + supportLanguage?: string; + /** + * The preferred communication channel. + */ + preferredContactMethod?: any; + /** + * The alternate email address of the recipient. + */ + alternateEmailAddresses?: string[]; +} + +/** + * Auto Quota Increase settings. + */ +export interface AutoQuotaIncreaseDetail extends BaseResource { + /** + * The subscription Id. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The name of the auto quota increase. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The type of the resource + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * Settings for automatic quota increase. + */ + settings?: AqiSettings; + /** + * The on failure Actions. + */ + onFailure?: OnFailure; + /** + * The on success Actions. + */ + onSuccess?: OnFailure; + /** + * The support ticket action. + */ + supportTicketAction?: SupportRequestAction; +} + +/** + * The email actions. + */ +export interface EmailActions { + /** + * The list of actions based on the success or failure of automatic quota increase action. + */ + value?: EmailAction[]; +} + +/** + * The error details. + */ +export interface ServiceErrorDetail { + /** + * The error code. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly code?: string; + /** + * The error message. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly message?: string; +} + +/** + * The api error details. + */ +export interface ServiceError { + /** + * The error code. + */ + code?: string; + /** + * The error message. + */ + message?: string; + /** + * The list of error details. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly details?: ServiceErrorDetail[]; +} + +/** + * The api error. + */ +export interface ExceptionResponse { + /** + * The api error details. + */ + error?: ServiceError; +} + /** * An interface representing SkuName. */ @@ -659,6 +1242,29 @@ export interface Properties { properties?: SubscriptionScopeProperties; } +/** + * Optional Parameters. + */ +export interface QuotaRequestsListStatusOptionalParams extends msRest.RequestOptionsBase { + /** + * | Field | Supported operators + * |---------------------|------------------------ + * + * |requestSubmitTime | ge, le, eq, gt, lt + */ + filter?: string; + /** + * Number of records to return. + */ + top?: number; + /** + * 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 + */ + skiptoken?: string; +} + /** * Optional Parameters. */ @@ -697,6 +1303,52 @@ export interface AzureReservationAPIOptions extends AzureServiceClientOptions { baseUri?: string; } +/** + * Defines headers for listStatus operation. + */ +export interface QuotaListStatusHeaders { + /** + * Current entity state version. Should be treated as opaque and used to make conditional HTTP + * requests. + */ + eTag: string; +} + +/** + * Defines headers for listStatus operation. + */ +export interface QuotasListStatusHeaders { + /** + * Current entity state version. Should be treated as opaque and used to make conditional HTTP + * requests. + */ + eTag: string; +} + +/** + * @interface + * Quota limits. + * @extends Array + */ +export interface QuotaLimits extends Array { + /** + * The uri to fetch the next page of quota limits. When there are no more pages, this is null. + */ + nextLink?: string; +} + +/** + * @interface + * Quota requests information. + * @extends Array + */ +export interface QuotaRequestDetailsList extends Array { + /** + * The uri to fetch the next page of quota limits. When there are no more pages, this is null. + */ + nextLink?: string; +} + /** * @interface * An interface representing the ReservationList. @@ -817,6 +1469,256 @@ export type InstanceFlexibility = 'On' | 'Off'; */ export type AppliedScopeType = 'Single' | 'Shared'; +/** + * Contains response data for the listStatus operation. + */ +export type QuotaListStatusResponse = CurrentQuotaLimitBase & QuotaListStatusHeaders & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: QuotaListStatusHeaders; + + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CurrentQuotaLimitBase; + }; +}; + +/** + * Contains response data for the create operation. + */ +export type QuotaRequestCreateResponse = { + /** + * The parsed response body. + */ + body: any; + + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: any; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type QuotaRequestUpdateResponse = { + /** + * The parsed response body. + */ + body: any; + + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: any; + }; +}; + +/** + * Contains response data for the beginCreate operation. + */ +export type QuotaRequestBeginCreateResponse = { + /** + * The parsed response body. + */ + body: any; + + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: any; + }; +}; + +/** + * Contains response data for the beginUpdate operation. + */ +export type QuotaRequestBeginUpdateResponse = { + /** + * The parsed response body. + */ + body: any; + + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: any; + }; +}; + +/** + * Contains response data for the listStatus operation. + */ +export type QuotasListStatusResponse = QuotaLimits & QuotasListStatusHeaders & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: QuotasListStatusHeaders; + + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: QuotaLimits; + }; +}; + +/** + * Contains response data for the getStatus operation. + */ +export type QuotaRequestsGetStatusResponse = QuotaRequestDetails & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: QuotaRequestDetails; + }; +}; + +/** + * Contains response data for the listStatus operation. + */ +export type QuotaRequestsListStatusResponse = QuotaRequestDetailsList & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: QuotaRequestDetailsList; + }; +}; + +/** + * Contains response data for the listStatusNext operation. + */ +export type QuotaRequestsListStatusNextResponse = QuotaRequestDetailsList & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: QuotaRequestDetailsList; + }; +}; + +/** + * Contains response data for the getProperties operation. + */ +export type AutoQuotaIncreaseGetPropertiesResponse = AutoQuotaIncreaseDetail & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: AutoQuotaIncreaseDetail; + }; +}; + +/** + * Contains response data for the create operation. + */ +export type AutoQuotaIncreaseCreateResponse = AutoQuotaIncreaseDetail & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: AutoQuotaIncreaseDetail; + }; +}; + /** * Contains response data for the availableScopes operation. */ diff --git a/sdk/reservations/arm-reservations/src/models/mappers.ts b/sdk/reservations/arm-reservations/src/models/mappers.ts index 9545a18421a1..035788de0319 100644 --- a/sdk/reservations/arm-reservations/src/models/mappers.ts +++ b/sdk/reservations/arm-reservations/src/models/mappers.ts @@ -12,6 +12,923 @@ import * as msRest from "@azure/ms-rest-js"; export const CloudError = CloudErrorMapper; export const BaseResource = BaseResourceMapper; +export const CurrentQuotaLimitBaseName: msRest.CompositeMapper = { + serializedName: "CurrentQuotaLimitBase_name", + type: { + name: "Composite", + className: "CurrentQuotaLimitBaseName", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "String" + } + }, + localizedValue: { + readOnly: true, + serializedName: "localizedValue", + type: { + name: "String" + } + } + } + } +}; + +export const CurrentQuotaLimitBase: msRest.CompositeMapper = { + serializedName: "CurrentQuotaLimitBase", + type: { + name: "Composite", + className: "CurrentQuotaLimitBase", + modelProperties: { + limit: { + serializedName: "limit", + type: { + name: "Number" + } + }, + currentValue: { + readOnly: true, + serializedName: "currentValue", + type: { + name: "Number" + } + }, + unit: { + serializedName: "unit", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "Composite", + className: "CurrentQuotaLimitBaseName" + } + }, + resourceType: { + serializedName: "resourceType", + type: { + name: "Object" + } + }, + quotaPeriod: { + readOnly: true, + serializedName: "quotaPeriod", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Object" + } + } + } + } +}; + +export const CurrentQuotaLimit: msRest.CompositeMapper = { + serializedName: "CurrentQuotaLimit", + type: { + name: "Composite", + className: "CurrentQuotaLimit", + modelProperties: { + limit: { + serializedName: "quotaInformation.limit", + type: { + name: "Number" + } + }, + currentValue: { + readOnly: true, + serializedName: "quotaInformation.currentValue", + type: { + name: "Number" + } + }, + unit: { + serializedName: "quotaInformation.unit", + type: { + name: "String" + } + }, + name: { + serializedName: "quotaInformation.name", + type: { + name: "Composite", + className: "CurrentQuotaLimitBaseName" + } + }, + resourceType: { + serializedName: "quotaInformation.resourceType", + type: { + name: "Object" + } + }, + quotaPeriod: { + readOnly: true, + serializedName: "quotaInformation.quotaPeriod", + type: { + name: "String" + } + }, + properties: { + serializedName: "quotaInformation.properties", + type: { + name: "Object" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "Object" + } + }, + message: { + readOnly: true, + serializedName: "properties.message", + type: { + name: "String" + } + } + } + } +}; + +export const QuotaLimitsResponse: msRest.CompositeMapper = { + serializedName: "QuotaLimitsResponse", + type: { + name: "Composite", + className: "QuotaLimitsResponse", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CurrentQuotaLimit" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const CreateGenericQuotaRequestParameters: msRest.CompositeMapper = { + serializedName: "CreateGenericQuotaRequestParameters", + type: { + name: "Composite", + className: "CreateGenericQuotaRequestParameters", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CurrentQuotaLimitBase" + } + } + } + } + } + } +}; + +export const SubRequestName: msRest.CompositeMapper = { + serializedName: "SubRequest_name", + type: { + name: "Composite", + className: "SubRequestName", + modelProperties: { + localizedValue: { + readOnly: true, + serializedName: "localizedValue", + type: { + name: "String" + } + }, + value: { + readOnly: true, + serializedName: "value", + type: { + name: "String" + } + } + } + } +}; + +export const SubRequest: msRest.CompositeMapper = { + serializedName: "SubRequest", + type: { + name: "Composite", + className: "SubRequest", + modelProperties: { + limit: { + readOnly: true, + serializedName: "limit", + type: { + name: "Number" + } + }, + name: { + serializedName: "name", + type: { + name: "Composite", + className: "SubRequestName" + } + }, + resourceType: { + readOnly: true, + serializedName: "resourceType", + type: { + name: "String" + } + }, + unit: { + serializedName: "unit", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "provisioningState", + type: { + name: "Object" + } + }, + message: { + readOnly: true, + serializedName: "message", + type: { + name: "String" + } + }, + subRequestId: { + readOnly: true, + serializedName: "subRequestId", + type: { + name: "String" + } + } + } + } +}; + +export const QuotaRequestOneResourceSubmitResponse: msRest.CompositeMapper = { + serializedName: "QuotaRequestOneResourceSubmitResponse", + type: { + name: "Composite", + className: "QuotaRequestOneResourceSubmitResponse", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "Object" + } + }, + message: { + readOnly: true, + serializedName: "properties.message", + type: { + name: "String" + } + }, + requestSubmitTime: { + readOnly: true, + serializedName: "properties.requestSubmitTime", + type: { + name: "DateTime" + } + }, + limit: { + serializedName: "properties.properties.limit", + type: { + name: "Number" + } + }, + currentValue: { + readOnly: true, + serializedName: "properties.properties.currentValue", + type: { + name: "Number" + } + }, + unit: { + serializedName: "properties.properties.unit", + type: { + name: "String" + } + }, + name1: { + serializedName: "properties.properties.name", + type: { + name: "Composite", + className: "CurrentQuotaLimitBaseName" + } + }, + resourceType: { + serializedName: "properties.properties.resourceType", + type: { + name: "Object" + } + }, + quotaPeriod: { + readOnly: true, + serializedName: "properties.properties.quotaPeriod", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties.properties.properties", + type: { + name: "Object" + } + } + } + } +}; + +export const QuotaRequestProperties: msRest.CompositeMapper = { + serializedName: "QuotaRequestProperties", + type: { + name: "Composite", + className: "QuotaRequestProperties", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + type: { + name: "Object" + } + }, + message: { + readOnly: true, + serializedName: "message", + type: { + name: "String" + } + }, + requestSubmitTime: { + readOnly: true, + serializedName: "requestSubmitTime", + type: { + name: "DateTime" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SubRequest" + } + } + } + } + } + } +}; + +export const QuotaRequestSubmitResponse: msRest.CompositeMapper = { + serializedName: "QuotaRequestSubmitResponse", + type: { + name: "Composite", + className: "QuotaRequestSubmitResponse", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "QuotaRequestProperties" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const QuotaRequestSubmitResponse201: msRest.CompositeMapper = { + serializedName: "QuotaRequestSubmitResponse201", + type: { + name: "Composite", + className: "QuotaRequestSubmitResponse201", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "Object" + } + }, + message: { + readOnly: true, + serializedName: "properties.message", + type: { + name: "String" + } + } + } + } +}; + +export const QuotaRequestDetails: msRest.CompositeMapper = { + serializedName: "QuotaRequestDetails", + type: { + name: "Composite", + className: "QuotaRequestDetails", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "Object" + } + }, + message: { + readOnly: true, + serializedName: "properties.message", + type: { + name: "String" + } + }, + requestSubmitTime: { + readOnly: true, + serializedName: "properties.requestSubmitTime", + type: { + name: "DateTime" + } + }, + value: { + serializedName: "properties.value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SubRequest" + } + } + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const AqiSettings: msRest.CompositeMapper = { + serializedName: "aqiSettings", + type: { + name: "Composite", + className: "AqiSettings", + modelProperties: { + autoQuotaIncreaseState: { + serializedName: "autoQuotaIncreaseState", + type: { + name: "Object" + } + } + } + } +}; + +export const EmailAction: msRest.CompositeMapper = { + serializedName: "EmailAction", + type: { + name: "Composite", + className: "EmailAction", + modelProperties: { + emailAddress: { + serializedName: "emailAddress", + type: { + name: "String" + } + } + } + } +}; + +export const OnFailureEmailActions: msRest.CompositeMapper = { + serializedName: "OnFailure_emailActions", + type: { + name: "Composite", + className: "OnFailureEmailActions", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EmailAction" + } + } + } + } + } + } +}; + +export const PhoneAction: msRest.CompositeMapper = { + serializedName: "PhoneAction", + type: { + name: "Composite", + className: "PhoneAction", + modelProperties: { + phoneNumber: { + serializedName: "phoneNumber", + type: { + name: "String" + } + }, + preferredChannel: { + serializedName: "preferredChannel", + type: { + name: "Object" + } + } + } + } +}; + +export const OnFailurePhoneActions: msRest.CompositeMapper = { + serializedName: "OnFailure_phoneActions", + type: { + name: "Composite", + className: "OnFailurePhoneActions", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PhoneAction" + } + } + } + } + } + } +}; + +export const OnFailure: msRest.CompositeMapper = { + serializedName: "OnFailure", + type: { + name: "Composite", + className: "OnFailure", + modelProperties: { + emailActions: { + serializedName: "emailActions", + type: { + name: "Composite", + className: "OnFailureEmailActions" + } + }, + phoneActions: { + serializedName: "phoneActions", + type: { + name: "Composite", + className: "OnFailurePhoneActions" + } + } + } + } +}; + +export const SupportRequestAction: msRest.CompositeMapper = { + serializedName: "SupportRequestAction", + type: { + name: "Composite", + className: "SupportRequestAction", + modelProperties: { + autoQuotaIncreaseState: { + serializedName: "autoQuotaIncreaseState", + type: { + name: "Object" + } + }, + severity: { + serializedName: "severity", + type: { + name: "Object" + } + }, + firstName: { + serializedName: "firstName", + type: { + name: "String" + } + }, + lastName: { + serializedName: "lastName", + type: { + name: "String" + } + }, + country: { + serializedName: "country", + type: { + name: "String" + } + }, + phoneNumber: { + serializedName: "phoneNumber", + type: { + name: "String" + } + }, + primaryEmailAddress: { + serializedName: "primaryEmailAddress", + type: { + name: "String" + } + }, + supportLanguage: { + serializedName: "supportLanguage", + type: { + name: "String" + } + }, + preferredContactMethod: { + serializedName: "preferredContactMethod", + type: { + name: "Object" + } + }, + alternateEmailAddresses: { + serializedName: "alternateEmailAddresses", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const AutoQuotaIncreaseDetail: msRest.CompositeMapper = { + serializedName: "AutoQuotaIncreaseDetail", + type: { + name: "Composite", + className: "AutoQuotaIncreaseDetail", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + settings: { + serializedName: "properties.settings", + type: { + name: "Composite", + className: "AqiSettings" + } + }, + onFailure: { + serializedName: "properties.onFailure", + type: { + name: "Composite", + className: "OnFailure" + } + }, + onSuccess: { + serializedName: "properties.onSuccess", + type: { + name: "Composite", + className: "OnFailure" + } + }, + supportTicketAction: { + serializedName: "properties.supportTicketAction", + type: { + name: "Composite", + className: "SupportRequestAction" + } + } + } + } +}; + +export const EmailActions: msRest.CompositeMapper = { + serializedName: "EmailActions", + type: { + name: "Composite", + className: "EmailActions", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EmailAction" + } + } + } + } + } + } +}; + +export const ServiceErrorDetail: msRest.CompositeMapper = { + serializedName: "ServiceErrorDetail", + type: { + name: "Composite", + className: "ServiceErrorDetail", + modelProperties: { + code: { + readOnly: true, + serializedName: "code", + type: { + name: "String" + } + }, + message: { + readOnly: true, + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const ServiceError: msRest.CompositeMapper = { + serializedName: "ServiceError", + type: { + name: "Composite", + className: "ServiceError", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + }, + details: { + readOnly: true, + serializedName: "details", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ServiceErrorDetail" + } + } + } + } + } + } +}; + +export const ExceptionResponse: msRest.CompositeMapper = { + serializedName: "ExceptionResponse", + type: { + name: "Composite", + className: "ExceptionResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ServiceError" + } + } + } + } +}; + export const SkuName: msRest.CompositeMapper = { serializedName: "SkuName", type: { @@ -1321,6 +2238,94 @@ export const Properties: msRest.CompositeMapper = { } }; +export const QuotaListStatusHeaders: msRest.CompositeMapper = { + serializedName: "quota-liststatus-headers", + type: { + name: "Composite", + className: "QuotaListStatusHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const QuotasListStatusHeaders: msRest.CompositeMapper = { + serializedName: "quotas-liststatus-headers", + type: { + name: "Composite", + className: "QuotasListStatusHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const QuotaLimits: msRest.CompositeMapper = { + serializedName: "QuotaLimits", + type: { + name: "Composite", + className: "QuotaLimits", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CurrentQuotaLimitBase" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const QuotaRequestDetailsList: msRest.CompositeMapper = { + serializedName: "QuotaRequestDetailsList", + type: { + name: "Composite", + className: "QuotaRequestDetailsList", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "QuotaRequestDetails" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + export const ReservationList: msRest.CompositeMapper = { serializedName: "ReservationList", type: { diff --git a/sdk/reservations/arm-reservations/src/models/parameters.ts b/sdk/reservations/arm-reservations/src/models/parameters.ts index 7b6fd0df4ef5..276781071712 100644 --- a/sdk/reservations/arm-reservations/src/models/parameters.ts +++ b/sdk/reservations/arm-reservations/src/models/parameters.ts @@ -20,11 +20,25 @@ export const acceptLanguage: msRest.OperationParameter = { } } }; -export const apiVersion: msRest.OperationQueryParameter = { +export const apiVersion0: msRest.OperationQueryParameter = { parameterPath: "apiVersion", mapper: { required: true, + isConstant: true, serializedName: "api-version", + defaultValue: '2019-07-19-preview', + type: { + name: "String" + } + } +}; +export const apiVersion1: msRest.OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + required: true, + isConstant: true, + serializedName: "api-version", + defaultValue: '2019-04-01', type: { name: "String" } @@ -54,7 +68,49 @@ export const expand1: msRest.OperationQueryParameter = { } } }; -export const location: msRest.OperationQueryParameter = { +export const filter: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "filter" + ], + mapper: { + serializedName: "$filter", + type: { + name: "String" + } + } +}; +export const id: msRest.OperationURLParameter = { + parameterPath: "id", + mapper: { + required: true, + serializedName: "id", + type: { + name: "String" + } + } +}; +export const ifMatch: msRest.OperationParameter = { + parameterPath: "ifMatch", + mapper: { + required: true, + serializedName: "If-Match", + type: { + name: "String" + } + } +}; +export const location0: msRest.OperationURLParameter = { + parameterPath: "location", + mapper: { + required: true, + serializedName: "location", + type: { + name: "String" + } + } +}; +export const location1: msRest.OperationQueryParameter = { parameterPath: [ "options", "location" @@ -77,6 +133,16 @@ export const nextPageLink: msRest.OperationURLParameter = { }, skipEncoding: true }; +export const providerId: msRest.OperationURLParameter = { + parameterPath: "providerId", + mapper: { + required: true, + serializedName: "providerId", + type: { + name: "String" + } + } +}; export const reservationId: msRest.OperationURLParameter = { parameterPath: "reservationId", mapper: { @@ -107,6 +173,28 @@ export const reservedResourceType: msRest.OperationQueryParameter = { } } }; +export const resourceName: msRest.OperationURLParameter = { + parameterPath: "resourceName", + mapper: { + required: true, + serializedName: "resourceName", + type: { + name: "String" + } + } +}; +export const skiptoken: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "skiptoken" + ], + mapper: { + serializedName: "$skiptoken", + type: { + name: "String" + } + } +}; export const subscriptionId: msRest.OperationURLParameter = { parameterPath: "subscriptionId", mapper: { @@ -117,3 +205,18 @@ export const subscriptionId: msRest.OperationURLParameter = { } } }; +export const top: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "top" + ], + mapper: { + serializedName: "$top", + constraints: { + InclusiveMinimum: 1 + }, + type: { + name: "Number" + } + } +}; diff --git a/sdk/reservations/arm-reservations/src/models/quotaMappers.ts b/sdk/reservations/arm-reservations/src/models/quotaMappers.ts new file mode 100644 index 000000000000..3c9bf66fc360 --- /dev/null +++ b/sdk/reservations/arm-reservations/src/models/quotaMappers.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + AqiSettings, + AutoQuotaIncreaseDetail, + BaseResource, + CurrentQuotaLimit, + CurrentQuotaLimitBase, + CurrentQuotaLimitBaseName, + EmailAction, + ExceptionResponse, + ExtendedStatusInfo, + OnFailure, + OnFailureEmailActions, + OnFailurePhoneActions, + PaymentDetail, + PhoneAction, + Price, + PurchaseRequest, + PurchaseRequestPropertiesReservedResourceProperties, + QuotaListStatusHeaders, + QuotaRequestDetails, + QuotaRequestOneResourceSubmitResponse, + QuotaRequestProperties, + QuotaRequestSubmitResponse, + RenewPropertiesResponse, + RenewPropertiesResponseBillingCurrencyTotal, + RenewPropertiesResponsePricingCurrencyTotal, + ReservationMergeProperties, + ReservationOrderBillingPlanInformation, + ReservationOrderResponse, + ReservationProperties, + ReservationResponse, + ReservationSplitProperties, + ServiceError, + ServiceErrorDetail, + SkuName, + SubRequest, + SubRequestName, + SupportRequestAction +} from "../models/mappers"; diff --git a/sdk/reservations/arm-reservations/src/models/quotaRequestMappers.ts b/sdk/reservations/arm-reservations/src/models/quotaRequestMappers.ts new file mode 100644 index 000000000000..585c917d3ca6 --- /dev/null +++ b/sdk/reservations/arm-reservations/src/models/quotaRequestMappers.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + AqiSettings, + AutoQuotaIncreaseDetail, + BaseResource, + CurrentQuotaLimit, + CurrentQuotaLimitBase, + CurrentQuotaLimitBaseName, + EmailAction, + ExceptionResponse, + ExtendedStatusInfo, + OnFailure, + OnFailureEmailActions, + OnFailurePhoneActions, + PaymentDetail, + PhoneAction, + Price, + PurchaseRequest, + PurchaseRequestPropertiesReservedResourceProperties, + QuotaRequestDetails, + QuotaRequestOneResourceSubmitResponse, + QuotaRequestProperties, + QuotaRequestSubmitResponse, + QuotaRequestSubmitResponse201, + RenewPropertiesResponse, + RenewPropertiesResponseBillingCurrencyTotal, + RenewPropertiesResponsePricingCurrencyTotal, + ReservationMergeProperties, + ReservationOrderBillingPlanInformation, + ReservationOrderResponse, + ReservationProperties, + ReservationResponse, + ReservationSplitProperties, + ServiceError, + ServiceErrorDetail, + SkuName, + SubRequest, + SubRequestName, + SupportRequestAction +} from "../models/mappers"; diff --git a/sdk/reservations/arm-reservations/src/models/quotaRequestsMappers.ts b/sdk/reservations/arm-reservations/src/models/quotaRequestsMappers.ts new file mode 100644 index 000000000000..8b9353442c96 --- /dev/null +++ b/sdk/reservations/arm-reservations/src/models/quotaRequestsMappers.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + AqiSettings, + AutoQuotaIncreaseDetail, + BaseResource, + CurrentQuotaLimit, + CurrentQuotaLimitBase, + CurrentQuotaLimitBaseName, + EmailAction, + ExceptionResponse, + ExtendedStatusInfo, + OnFailure, + OnFailureEmailActions, + OnFailurePhoneActions, + PaymentDetail, + PhoneAction, + Price, + PurchaseRequest, + PurchaseRequestPropertiesReservedResourceProperties, + QuotaRequestDetails, + QuotaRequestDetailsList, + QuotaRequestOneResourceSubmitResponse, + QuotaRequestProperties, + QuotaRequestSubmitResponse, + RenewPropertiesResponse, + RenewPropertiesResponseBillingCurrencyTotal, + RenewPropertiesResponsePricingCurrencyTotal, + ReservationMergeProperties, + ReservationOrderBillingPlanInformation, + ReservationOrderResponse, + ReservationProperties, + ReservationResponse, + ReservationSplitProperties, + ServiceError, + ServiceErrorDetail, + SkuName, + SubRequest, + SubRequestName, + SupportRequestAction +} from "../models/mappers"; diff --git a/sdk/reservations/arm-reservations/src/models/quotasMappers.ts b/sdk/reservations/arm-reservations/src/models/quotasMappers.ts new file mode 100644 index 000000000000..42a90e570436 --- /dev/null +++ b/sdk/reservations/arm-reservations/src/models/quotasMappers.ts @@ -0,0 +1,48 @@ +/* + * 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. + */ + +export { + AqiSettings, + AutoQuotaIncreaseDetail, + BaseResource, + CurrentQuotaLimit, + CurrentQuotaLimitBase, + CurrentQuotaLimitBaseName, + EmailAction, + ExceptionResponse, + ExtendedStatusInfo, + OnFailure, + OnFailureEmailActions, + OnFailurePhoneActions, + PaymentDetail, + PhoneAction, + Price, + PurchaseRequest, + PurchaseRequestPropertiesReservedResourceProperties, + QuotaLimits, + QuotaRequestDetails, + QuotaRequestOneResourceSubmitResponse, + QuotaRequestProperties, + QuotaRequestSubmitResponse, + QuotasListStatusHeaders, + RenewPropertiesResponse, + RenewPropertiesResponseBillingCurrencyTotal, + RenewPropertiesResponsePricingCurrencyTotal, + ReservationMergeProperties, + ReservationOrderBillingPlanInformation, + ReservationOrderResponse, + ReservationProperties, + ReservationResponse, + ReservationSplitProperties, + ServiceError, + ServiceErrorDetail, + SkuName, + SubRequest, + SubRequestName, + SupportRequestAction +} from "../models/mappers"; diff --git a/sdk/reservations/arm-reservations/src/models/reservationMappers.ts b/sdk/reservations/arm-reservations/src/models/reservationMappers.ts index 3d29bc7020c1..f5ced169a48f 100644 --- a/sdk/reservations/arm-reservations/src/models/reservationMappers.ts +++ b/sdk/reservations/arm-reservations/src/models/reservationMappers.ts @@ -7,18 +7,32 @@ */ export { + AqiSettings, + AutoQuotaIncreaseDetail, BaseResource, + CurrentQuotaLimit, + CurrentQuotaLimitBase, + CurrentQuotaLimitBaseName, + EmailAction, ErrorModel, ExtendedErrorInfo, ExtendedStatusInfo, MergeRequest, + OnFailure, + OnFailureEmailActions, + OnFailurePhoneActions, Patch, PatchPropertiesRenewProperties, PaymentDetail, + PhoneAction, Price, Properties, PurchaseRequest, PurchaseRequestPropertiesReservedResourceProperties, + QuotaRequestDetails, + QuotaRequestOneResourceSubmitResponse, + QuotaRequestProperties, + QuotaRequestSubmitResponse, RenewPropertiesResponse, RenewPropertiesResponseBillingCurrencyTotal, RenewPropertiesResponsePricingCurrencyTotal, @@ -32,5 +46,8 @@ export { ScopeProperties, SkuName, SplitRequest, - SubscriptionScopeProperties + SubRequest, + SubRequestName, + SubscriptionScopeProperties, + SupportRequestAction } from "../models/mappers"; diff --git a/sdk/reservations/arm-reservations/src/models/reservationOrderMappers.ts b/sdk/reservations/arm-reservations/src/models/reservationOrderMappers.ts index 3d1469c70c00..3d22eb283da9 100644 --- a/sdk/reservations/arm-reservations/src/models/reservationOrderMappers.ts +++ b/sdk/reservations/arm-reservations/src/models/reservationOrderMappers.ts @@ -7,18 +7,32 @@ */ export { + AqiSettings, + AutoQuotaIncreaseDetail, BaseResource, CalculatePriceResponse, CalculatePriceResponseProperties, CalculatePriceResponsePropertiesBillingCurrencyTotal, CalculatePriceResponsePropertiesPricingCurrencyTotal, + CurrentQuotaLimit, + CurrentQuotaLimitBase, + CurrentQuotaLimitBaseName, + EmailAction, ErrorModel, ExtendedErrorInfo, ExtendedStatusInfo, + OnFailure, + OnFailureEmailActions, + OnFailurePhoneActions, PaymentDetail, + PhoneAction, Price, PurchaseRequest, PurchaseRequestPropertiesReservedResourceProperties, + QuotaRequestDetails, + QuotaRequestOneResourceSubmitResponse, + QuotaRequestProperties, + QuotaRequestSubmitResponse, RenewPropertiesResponse, RenewPropertiesResponseBillingCurrencyTotal, RenewPropertiesResponsePricingCurrencyTotal, @@ -29,5 +43,8 @@ export { ReservationProperties, ReservationResponse, ReservationSplitProperties, - SkuName + SkuName, + SubRequest, + SubRequestName, + SupportRequestAction } from "../models/mappers"; diff --git a/sdk/reservations/arm-reservations/src/operations/autoQuotaIncrease.ts b/sdk/reservations/arm-reservations/src/operations/autoQuotaIncrease.ts new file mode 100644 index 000000000000..4ed989314187 --- /dev/null +++ b/sdk/reservations/arm-reservations/src/operations/autoQuotaIncrease.ts @@ -0,0 +1,145 @@ +/* + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/autoQuotaIncreaseMappers"; +import * as Parameters from "../models/parameters"; +import { AzureReservationAPIContext } from "../azureReservationAPIContext"; + +/** Class representing a AutoQuotaIncrease. */ +export class AutoQuotaIncrease { + private readonly client: AzureReservationAPIContext; + + /** + * Create a AutoQuotaIncrease. + * @param {AzureReservationAPIContext} client Reference to the service client. + */ + constructor(client: AzureReservationAPIContext) { + this.client = client; + } + + /** + * Gets the Auto Quota Increase enrollment details for the specified subscription. + * @summary For the specified subscription, gets the Auto Quota Increase enrollment status. + * @param subscriptionId Azure subscription id. + * @param [options] The optional parameters + * @returns Promise + */ + getProperties(subscriptionId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param subscriptionId Azure subscription id. + * @param callback The callback + */ + getProperties(subscriptionId: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Azure subscription id. + * @param options The optional parameters + * @param callback The callback + */ + getProperties(subscriptionId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getProperties(subscriptionId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + options + }, + getPropertiesOperationSpec, + callback) as Promise; + } + + /** + * Sets the Auto Quota Increase enrollment properties for the specified subscription. + * @summary For the specified subscription, sets the Auto Quota Increase enrollment properties. + * @param subscriptionId Azure subscription id. + * @param autoQuotaIncreaseRequest Auto Quota increase request payload. + * @param [options] The optional parameters + * @returns Promise + */ + create(subscriptionId: string, autoQuotaIncreaseRequest: Models.AutoQuotaIncreaseDetail, options?: msRest.RequestOptionsBase): Promise; + /** + * @param subscriptionId Azure subscription id. + * @param autoQuotaIncreaseRequest Auto Quota increase request payload. + * @param callback The callback + */ + create(subscriptionId: string, autoQuotaIncreaseRequest: Models.AutoQuotaIncreaseDetail, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Azure subscription id. + * @param autoQuotaIncreaseRequest Auto Quota increase request payload. + * @param options The optional parameters + * @param callback The callback + */ + create(subscriptionId: string, autoQuotaIncreaseRequest: Models.AutoQuotaIncreaseDetail, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + create(subscriptionId: string, autoQuotaIncreaseRequest: Models.AutoQuotaIncreaseDetail, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + autoQuotaIncreaseRequest, + options + }, + createOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getPropertiesOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Capacity/autoQuotaIncrease", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion0 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.AutoQuotaIncreaseDetail + }, + default: { + bodyMapper: Mappers.ExceptionResponse + } + }, + serializer +}; + +const createOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Capacity/autoQuotaIncrease", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion0 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "autoQuotaIncreaseRequest", + mapper: { + ...Mappers.AutoQuotaIncreaseDetail, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.AutoQuotaIncreaseDetail + }, + default: { + bodyMapper: Mappers.ExceptionResponse + } + }, + serializer +}; diff --git a/sdk/reservations/arm-reservations/src/operations/index.ts b/sdk/reservations/arm-reservations/src/operations/index.ts index 6f4743f6af52..8b1716a7c990 100644 --- a/sdk/reservations/arm-reservations/src/operations/index.ts +++ b/sdk/reservations/arm-reservations/src/operations/index.ts @@ -8,6 +8,11 @@ * regenerated. */ +export * from "./quota"; +export * from "./quotaRequest"; +export * from "./quotas"; +export * from "./quotaRequests"; +export * from "./autoQuotaIncrease"; export * from "./reservation"; export * from "./reservationOrder"; export * from "./operation"; diff --git a/sdk/reservations/arm-reservations/src/operations/operation.ts b/sdk/reservations/arm-reservations/src/operations/operation.ts index b1c036dbf972..64ca6b5662de 100644 --- a/sdk/reservations/arm-reservations/src/operations/operation.ts +++ b/sdk/reservations/arm-reservations/src/operations/operation.ts @@ -87,7 +87,7 @@ const listOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "providers/Microsoft.Capacity/operations", queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion1 ], headerParameters: [ Parameters.acceptLanguage diff --git a/sdk/reservations/arm-reservations/src/operations/quota.ts b/sdk/reservations/arm-reservations/src/operations/quota.ts new file mode 100644 index 000000000000..bd913d27fe6b --- /dev/null +++ b/sdk/reservations/arm-reservations/src/operations/quota.ts @@ -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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/quotaMappers"; +import * as Parameters from "../models/parameters"; +import { AzureReservationAPIContext } from "../azureReservationAPIContext"; + +/** Class representing a Quota. */ +export class Quota { + private readonly client: AzureReservationAPIContext; + + /** + * Create a Quota. + * @param {AzureReservationAPIContext} client Reference to the service client. + */ + constructor(client: AzureReservationAPIContext) { + this.client = client; + } + + /** + * 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. + * @summary Gets the current quota limit and usages for the resource provider for the specified + * location for the specific resource in the parameter. + * @param subscriptionId Azure subscription id. + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param resourceName The Resource name for the specific resource provider, such as SKU name for + * Microsoft.Compute, pool for Microsoft.Batch. + * @param [options] The optional parameters + * @returns Promise + */ + listStatus(subscriptionId: string, providerId: string, location: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param subscriptionId Azure subscription id. + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param resourceName The Resource name for the specific resource provider, such as SKU name for + * Microsoft.Compute, pool for Microsoft.Batch. + * @param callback The callback + */ + listStatus(subscriptionId: string, providerId: string, location: string, resourceName: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Azure subscription id. + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param resourceName The Resource name for the specific resource provider, such as SKU name for + * Microsoft.Compute, pool for Microsoft.Batch. + * @param options The optional parameters + * @param callback The callback + */ + listStatus(subscriptionId: string, providerId: string, location: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listStatus(subscriptionId: string, providerId: string, location: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + providerId, + location, + resourceName, + options + }, + listStatusOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listStatusOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.providerId, + Parameters.location0, + Parameters.resourceName + ], + queryParameters: [ + Parameters.apiVersion0 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CurrentQuotaLimitBase, + headersMapper: Mappers.QuotaListStatusHeaders + }, + default: { + bodyMapper: Mappers.ExceptionResponse + } + }, + serializer +}; diff --git a/sdk/reservations/arm-reservations/src/operations/quotaRequest.ts b/sdk/reservations/arm-reservations/src/operations/quotaRequest.ts new file mode 100644 index 000000000000..04aab2322e1a --- /dev/null +++ b/sdk/reservations/arm-reservations/src/operations/quotaRequest.ts @@ -0,0 +1,233 @@ +/* + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/quotaRequestMappers"; +import * as Parameters from "../models/parameters"; +import { AzureReservationAPIContext } from "../azureReservationAPIContext"; + +/** Class representing a QuotaRequest. */ +export class QuotaRequest { + private readonly client: AzureReservationAPIContext; + + /** + * Create a QuotaRequest. + * @param {AzureReservationAPIContext} client Reference to the service client. + */ + constructor(client: AzureReservationAPIContext) { + this.client = client; + } + + /** + * 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. + * @summary Submits a Quota Request for a resource provider at the specified location for the + * specific resource in the parameter. + * @param subscriptionId Azure subscription id. + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param resourceName The Resource name for the specific resource provider, such as SKU name for + * Microsoft.Compute, pool for Microsoft.Batch. + * @param createQuotaRequest Quota requests payload. + * @param ifMatch 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. + * @param [options] The optional parameters + * @returns Promise + */ + create(subscriptionId: string, providerId: string, location: string, resourceName: string, createQuotaRequest: Models.CurrentQuotaLimitBase, ifMatch: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreate(subscriptionId,providerId,location,resourceName,createQuotaRequest,ifMatch,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * 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. + * @summary Submits a Quota Request for a resource provider at the specified location for the + * specific resource in the parameter. + * @param subscriptionId Azure subscription id. + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param resourceName The Resource name for the specific resource provider, such as SKU name for + * Microsoft.Compute, pool for Microsoft.Batch. + * @param createQuotaRequest Quota requests payload. + * @param ifMatch 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. + * @param [options] The optional parameters + * @returns Promise + */ + update(subscriptionId: string, providerId: string, location: string, resourceName: string, createQuotaRequest: Models.CurrentQuotaLimitBase, ifMatch: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginUpdate(subscriptionId,providerId,location,resourceName,createQuotaRequest,ifMatch,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * 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. + * @summary Submits a Quota Request for a resource provider at the specified location for the + * specific resource in the parameter. + * @param subscriptionId Azure subscription id. + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param resourceName The Resource name for the specific resource provider, such as SKU name for + * Microsoft.Compute, pool for Microsoft.Batch. + * @param createQuotaRequest Quota requests payload. + * @param ifMatch 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. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreate(subscriptionId: string, providerId: string, location: string, resourceName: string, createQuotaRequest: Models.CurrentQuotaLimitBase, ifMatch: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + subscriptionId, + providerId, + location, + resourceName, + createQuotaRequest, + ifMatch, + options + }, + beginCreateOperationSpec, + options); + } + + /** + * 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. + * @summary Submits a Quota Request for a resource provider at the specified location for the + * specific resource in the parameter. + * @param subscriptionId Azure subscription id. + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param resourceName The Resource name for the specific resource provider, such as SKU name for + * Microsoft.Compute, pool for Microsoft.Batch. + * @param createQuotaRequest Quota requests payload. + * @param ifMatch 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. + * @param [options] The optional parameters + * @returns Promise + */ + beginUpdate(subscriptionId: string, providerId: string, location: string, resourceName: string, createQuotaRequest: Models.CurrentQuotaLimitBase, ifMatch: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + subscriptionId, + providerId, + location, + resourceName, + createQuotaRequest, + ifMatch, + options + }, + beginUpdateOperationSpec, + options); + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const beginCreateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.providerId, + Parameters.location0, + Parameters.resourceName + ], + queryParameters: [ + Parameters.apiVersion0 + ], + headerParameters: [ + Parameters.ifMatch, + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "createQuotaRequest", + mapper: { + ...Mappers.CurrentQuotaLimitBase, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.QuotaRequestOneResourceSubmitResponse + }, + 201: { + bodyMapper: Mappers.QuotaRequestSubmitResponse201 + }, + default: { + bodyMapper: Mappers.ExceptionResponse + } + }, + serializer +}; + +const beginUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.providerId, + Parameters.location0, + Parameters.resourceName + ], + queryParameters: [ + Parameters.apiVersion0 + ], + headerParameters: [ + Parameters.ifMatch, + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "createQuotaRequest", + mapper: { + ...Mappers.CurrentQuotaLimitBase, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.QuotaRequestOneResourceSubmitResponse + }, + 201: { + bodyMapper: Mappers.QuotaRequestSubmitResponse201 + }, + default: { + bodyMapper: Mappers.ExceptionResponse + } + }, + serializer +}; diff --git a/sdk/reservations/arm-reservations/src/operations/quotaRequests.ts b/sdk/reservations/arm-reservations/src/operations/quotaRequests.ts new file mode 100644 index 000000000000..4bb262903462 --- /dev/null +++ b/sdk/reservations/arm-reservations/src/operations/quotaRequests.ts @@ -0,0 +1,223 @@ +/* + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/quotaRequestsMappers"; +import * as Parameters from "../models/parameters"; +import { AzureReservationAPIContext } from "../azureReservationAPIContext"; + +/** Class representing a QuotaRequests. */ +export class QuotaRequests { + private readonly client: AzureReservationAPIContext; + + /** + * Create a QuotaRequests. + * @param {AzureReservationAPIContext} client Reference to the service client. + */ + constructor(client: AzureReservationAPIContext) { + this.client = client; + } + + /** + * 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. + * @summary Gets the Quota request status by requestId, for the specified resource provider at + * specified location. + * @param subscriptionId Azure subscription id. + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param id Quota Request id. + * @param [options] The optional parameters + * @returns Promise + */ + getStatus(subscriptionId: string, providerId: string, location: string, id: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param subscriptionId Azure subscription id. + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param id Quota Request id. + * @param callback The callback + */ + getStatus(subscriptionId: string, providerId: string, location: string, id: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Azure subscription id. + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param id Quota Request id. + * @param options The optional parameters + * @param callback The callback + */ + getStatus(subscriptionId: string, providerId: string, location: string, id: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getStatus(subscriptionId: string, providerId: string, location: string, id: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + providerId, + location, + id, + options + }, + getStatusOperationSpec, + callback) as Promise; + } + + /** + * 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. + * @summary 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. + * @param subscriptionId Azure subscription id. + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param [options] The optional parameters + * @returns Promise + */ + listStatus(subscriptionId: string, providerId: string, location: string, options?: Models.QuotaRequestsListStatusOptionalParams): Promise; + /** + * @param subscriptionId Azure subscription id. + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param callback The callback + */ + listStatus(subscriptionId: string, providerId: string, location: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Azure subscription id. + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param options The optional parameters + * @param callback The callback + */ + listStatus(subscriptionId: string, providerId: string, location: string, options: Models.QuotaRequestsListStatusOptionalParams, callback: msRest.ServiceCallback): void; + listStatus(subscriptionId: string, providerId: string, location: string, options?: Models.QuotaRequestsListStatusOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + providerId, + location, + options + }, + listStatusOperationSpec, + callback) as Promise; + } + + /** + * 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. + * @summary 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. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listStatusNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listStatusNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listStatusNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listStatusNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listStatusNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getStatusOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimitsRequests/{id}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.providerId, + Parameters.location0, + Parameters.id + ], + queryParameters: [ + Parameters.apiVersion0 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.QuotaRequestDetails + }, + default: { + bodyMapper: Mappers.ExceptionResponse + } + }, + serializer +}; + +const listStatusOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimitsRequests", + urlParameters: [ + Parameters.subscriptionId, + Parameters.providerId, + Parameters.location0 + ], + queryParameters: [ + Parameters.apiVersion0, + Parameters.filter, + Parameters.top, + Parameters.skiptoken + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.QuotaRequestDetailsList + }, + default: { + bodyMapper: Mappers.ExceptionResponse + } + }, + serializer +}; + +const listStatusNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.QuotaRequestDetailsList + }, + default: { + bodyMapper: Mappers.ExceptionResponse + } + }, + serializer +}; diff --git a/sdk/reservations/arm-reservations/src/operations/quotas.ts b/sdk/reservations/arm-reservations/src/operations/quotas.ts new file mode 100644 index 000000000000..a4584d99cb8c --- /dev/null +++ b/sdk/reservations/arm-reservations/src/operations/quotas.ts @@ -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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/quotasMappers"; +import * as Parameters from "../models/parameters"; +import { AzureReservationAPIContext } from "../azureReservationAPIContext"; + +/** Class representing a Quotas. */ +export class Quotas { + private readonly client: AzureReservationAPIContext; + + /** + * Create a Quotas. + * @param {AzureReservationAPIContext} client Reference to the service client. + */ + constructor(client: AzureReservationAPIContext) { + this.client = client; + } + + /** + * 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. + * @summary Gets the current quota limit and usages for all the resources by the resource provider + * at the specified location. + * @param subscriptionId Azure subscription id. + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param [options] The optional parameters + * @returns Promise + */ + listStatus(subscriptionId: string, providerId: string, location: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param subscriptionId Azure subscription id. + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param callback The callback + */ + listStatus(subscriptionId: string, providerId: string, location: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Azure subscription id. + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param options The optional parameters + * @param callback The callback + */ + listStatus(subscriptionId: string, providerId: string, location: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listStatus(subscriptionId: string, providerId: string, location: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + providerId, + location, + options + }, + listStatusOperationSpec, + callback) as Promise; + } + + /** + * 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. + * @summary Gets the current quota limit and usages for all the resources by the resource provider + * at the specified location. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listStatusNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listStatusNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listStatusNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listStatusNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listStatusNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listStatusOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits", + urlParameters: [ + Parameters.subscriptionId, + Parameters.providerId, + Parameters.location0 + ], + queryParameters: [ + Parameters.apiVersion0 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.QuotaLimits, + headersMapper: Mappers.QuotasListStatusHeaders + }, + default: { + bodyMapper: Mappers.ExceptionResponse + } + }, + serializer +}; + +const listStatusNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.QuotaLimits, + headersMapper: Mappers.QuotasListStatusHeaders + }, + default: { + bodyMapper: Mappers.ExceptionResponse + } + }, + serializer +}; diff --git a/sdk/reservations/arm-reservations/src/operations/reservation.ts b/sdk/reservations/arm-reservations/src/operations/reservation.ts index 07f8c02ebb18..f7bb7e9c5bd9 100644 --- a/sdk/reservations/arm-reservations/src/operations/reservation.ts +++ b/sdk/reservations/arm-reservations/src/operations/reservation.ts @@ -326,7 +326,7 @@ const listOperationSpec: msRest.OperationSpec = { Parameters.reservationOrderId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion1 ], headerParameters: [ Parameters.acceptLanguage @@ -350,7 +350,7 @@ const getOperationSpec: msRest.OperationSpec = { Parameters.reservationOrderId ], queryParameters: [ - Parameters.apiVersion, + Parameters.apiVersion1, Parameters.expand0 ], headerParameters: [ @@ -375,7 +375,7 @@ const listRevisionsOperationSpec: msRest.OperationSpec = { Parameters.reservationOrderId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion1 ], headerParameters: [ Parameters.acceptLanguage @@ -399,7 +399,7 @@ const beginAvailableScopesOperationSpec: msRest.OperationSpec = { Parameters.reservationId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion1 ], headerParameters: [ Parameters.acceptLanguage @@ -437,7 +437,7 @@ const beginSplitOperationSpec: msRest.OperationSpec = { Parameters.reservationOrderId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion1 ], headerParameters: [ Parameters.acceptLanguage @@ -479,7 +479,7 @@ const beginMergeOperationSpec: msRest.OperationSpec = { Parameters.reservationOrderId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion1 ], headerParameters: [ Parameters.acceptLanguage @@ -522,7 +522,7 @@ const beginUpdateOperationSpec: msRest.OperationSpec = { Parameters.reservationId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion1 ], headerParameters: [ Parameters.acceptLanguage diff --git a/sdk/reservations/arm-reservations/src/operations/reservationOrder.ts b/sdk/reservations/arm-reservations/src/operations/reservationOrder.ts index 07d0d9272af5..fa7198ca7fcc 100644 --- a/sdk/reservations/arm-reservations/src/operations/reservationOrder.ts +++ b/sdk/reservations/arm-reservations/src/operations/reservationOrder.ts @@ -178,7 +178,7 @@ const calculateOperationSpec: msRest.OperationSpec = { httpMethod: "POST", path: "providers/Microsoft.Capacity/calculatePrice", queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion1 ], headerParameters: [ Parameters.acceptLanguage @@ -205,7 +205,7 @@ const listOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "providers/Microsoft.Capacity/reservationOrders", queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion1 ], headerParameters: [ Parameters.acceptLanguage @@ -228,7 +228,7 @@ const getOperationSpec: msRest.OperationSpec = { Parameters.reservationOrderId ], queryParameters: [ - Parameters.apiVersion, + Parameters.apiVersion1, Parameters.expand1 ], headerParameters: [ @@ -252,7 +252,7 @@ const beginPurchaseOperationSpec: msRest.OperationSpec = { Parameters.reservationOrderId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion1 ], headerParameters: [ Parameters.acceptLanguage