diff --git a/sdk/reservations/arm-reservations/README.md b/sdk/reservations/arm-reservations/README.md index 2da5176a8437..d7c14403a267 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 listStatus quota as an example written in TypeScript. +#### nodejs - Authentication, client creation and get quota as an example written in TypeScript. ##### Install @azure/ms-rest-nodeauth @@ -39,7 +39,7 @@ msRestNodeAuth.interactiveLogin().then((creds) => { const providerId = "testproviderId"; const location = "westus"; const resourceName = "testresourceName"; - client.quota.listStatus(subscriptionId, providerId, location, resourceName).then((result) => { + client.quota.get(subscriptionId, providerId, location, resourceName).then((result) => { console.log("The result is:"); console.log(result); }); @@ -48,7 +48,7 @@ msRestNodeAuth.interactiveLogin().then((creds) => { }); ``` -#### browser - Authentication, client creation and listStatus quota as an example written in JavaScript. +#### browser - Authentication, client creation and get quota as an example written in JavaScript. ##### Install @azure/ms-rest-browserauth @@ -86,7 +86,7 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to const providerId = "testproviderId"; const location = "westus"; const resourceName = "testresourceName"; - client.quota.listStatus(subscriptionId, providerId, location, resourceName).then((result) => { + client.quota.get(subscriptionId, providerId, location, resourceName).then((result) => { console.log("The result is:"); console.log(result); }).catch((err) => { diff --git a/sdk/reservations/arm-reservations/src/azureReservationAPI.ts b/sdk/reservations/arm-reservations/src/azureReservationAPI.ts index 9e9a85cfd8b6..7144f601969a 100644 --- a/sdk/reservations/arm-reservations/src/azureReservationAPI.ts +++ b/sdk/reservations/arm-reservations/src/azureReservationAPI.ts @@ -19,9 +19,7 @@ import { AzureReservationAPIContext } from "./azureReservationAPIContext"; class AzureReservationAPI extends AzureReservationAPIContext { // Operation groups quota: operations.Quota; - quotaRequest: operations.QuotaRequest; - quotas: operations.Quotas; - quotaRequests: operations.QuotaRequests; + quotaRequestStatus: operations.QuotaRequestStatus; autoQuotaIncrease: operations.AutoQuotaIncrease; reservation: operations.Reservation; reservationOrder: operations.ReservationOrder; @@ -35,9 +33,7 @@ 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.quotaRequestStatus = new operations.QuotaRequestStatus(this); this.autoQuotaIncrease = new operations.AutoQuotaIncrease(this); this.reservation = new operations.Reservation(this); this.reservationOrder = new operations.ReservationOrder(this); diff --git a/sdk/reservations/arm-reservations/src/models/autoQuotaIncreaseMappers.ts b/sdk/reservations/arm-reservations/src/models/autoQuotaIncreaseMappers.ts index 2cad5c7e9409..20c18ae09551 100644 --- a/sdk/reservations/arm-reservations/src/models/autoQuotaIncreaseMappers.ts +++ b/sdk/reservations/arm-reservations/src/models/autoQuotaIncreaseMappers.ts @@ -7,19 +7,17 @@ */ export { + Actions, AqiSettings, AutoQuotaIncreaseDetail, BaseResource, CurrentQuotaLimit, CurrentQuotaLimitBase, EmailAction, + EmailActions, ExceptionResponse, ExtendedStatusInfo, - OnFailure, - OnFailureEmailActions, - OnFailurePhoneActions, PaymentDetail, - PhoneAction, Price, PurchaseRequest, PurchaseRequestPropertiesReservedResourceProperties, diff --git a/sdk/reservations/arm-reservations/src/models/index.ts b/sdk/reservations/arm-reservations/src/models/index.ts index 1e8b33bd4a9f..e61ebc3184fc 100644 --- a/sdk/reservations/arm-reservations/src/models/index.ts +++ b/sdk/reservations/arm-reservations/src/models/index.ts @@ -343,51 +343,23 @@ export interface EmailAction { } /** - * The email actions for auto quota increase. + * The email actions. */ -export interface OnFailureEmailActions { +export interface EmailActions { /** * 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[]; + emailAddresses?: EmailAction[]; } /** * The actions for auto quota increase. */ -export interface OnFailure { +export interface Actions { /** * The email actions for auto quota increase. */ - emailActions?: OnFailureEmailActions; - /** - * The phone actions for auto quota increase. - */ - phoneActions?: OnFailurePhoneActions; + emailActions?: EmailActions; } /** @@ -462,11 +434,11 @@ export interface AutoQuotaIncreaseDetail extends BaseResource { /** * The on failure Actions. */ - onFailure?: OnFailure; + onFailure?: Actions; /** * The on success Actions. */ - onSuccess?: OnFailure; + onSuccess?: Actions; /** * The support ticket action. */ @@ -474,13 +446,17 @@ export interface AutoQuotaIncreaseDetail extends BaseResource { } /** - * The email actions. + * Phone Action. */ -export interface EmailActions { +export interface PhoneAction { + /** + * The phone number for the action. + */ + phoneNumber?: string; /** - * The list of email actions based on the success or failure of automatic quota increase action. + * The preferred communication channel. */ - value?: EmailAction[]; + preferredChannel?: any; } /** @@ -1179,7 +1155,7 @@ export interface Properties { /** * Optional Parameters. */ -export interface QuotaRequestsListStatusOptionalParams extends msRest.RequestOptionsBase { +export interface QuotaRequestStatusListOptionalParams extends msRest.RequestOptionsBase { /** * | Field | Supported operators * |---------------------|------------------------ @@ -1238,9 +1214,9 @@ export interface AzureReservationAPIOptions extends AzureServiceClientOptions { } /** - * Defines headers for listStatus operation. + * Defines headers for Get operation. */ -export interface QuotaListStatusHeaders { +export interface QuotaGetHeaders { /** * Current entity state version. Should be treated as opaque and used to make conditional HTTP * requests. @@ -1249,9 +1225,9 @@ export interface QuotaListStatusHeaders { } /** - * Defines headers for listStatus operation. + * Defines headers for List operation. */ -export interface QuotasListStatusHeaders { +export interface QuotaListHeaders { /** * Current entity state version. Should be treated as opaque and used to make conditional HTTP * requests. @@ -1404,9 +1380,9 @@ export type InstanceFlexibility = 'On' | 'Off'; export type AppliedScopeType = 'Single' | 'Shared'; /** - * Contains response data for the listStatus operation. + * Contains response data for the get operation. */ -export type QuotaListStatusResponse = CurrentQuotaLimitBase & QuotaListStatusHeaders & { +export type QuotaGetResponse = CurrentQuotaLimitBase & QuotaGetHeaders & { /** * The underlying HTTP response. */ @@ -1414,7 +1390,7 @@ export type QuotaListStatusResponse = CurrentQuotaLimitBase & QuotaListStatusHea /** * The parsed HTTP response headers. */ - parsedHeaders: QuotaListStatusHeaders; + parsedHeaders: QuotaGetHeaders; /** * The response body as text (string format) @@ -1429,9 +1405,9 @@ export type QuotaListStatusResponse = CurrentQuotaLimitBase & QuotaListStatusHea }; /** - * Contains response data for the create operation. + * Contains response data for the createOrUpdate operation. */ -export type QuotaRequestCreateResponse = { +export type QuotaCreateOrUpdateResponse = { /** * The parsed response body. */ @@ -1456,7 +1432,7 @@ export type QuotaRequestCreateResponse = { /** * Contains response data for the update operation. */ -export type QuotaRequestUpdateResponse = { +export type QuotaUpdateResponse = { /** * The parsed response body. */ @@ -1479,18 +1455,18 @@ export type QuotaRequestUpdateResponse = { }; /** - * Contains response data for the beginCreate operation. + * Contains response data for the list operation. */ -export type QuotaRequestBeginCreateResponse = { - /** - * The parsed response body. - */ - body: any; - +export type QuotaListResponse = QuotaLimits & QuotaListHeaders & { /** * The underlying HTTP response. */ _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: QuotaListHeaders; + /** * The response body as text (string format) */ @@ -1499,14 +1475,14 @@ export type QuotaRequestBeginCreateResponse = { /** * The response body as parsed JSON or XML */ - parsedBody: any; + parsedBody: QuotaLimits; }; }; /** - * Contains response data for the beginUpdate operation. + * Contains response data for the beginCreateOrUpdate operation. */ -export type QuotaRequestBeginUpdateResponse = { +export type QuotaBeginCreateOrUpdateResponse = { /** * The parsed response body. */ @@ -1529,18 +1505,18 @@ export type QuotaRequestBeginUpdateResponse = { }; /** - * Contains response data for the listStatus operation. + * Contains response data for the beginUpdate operation. */ -export type QuotasListStatusResponse = QuotaLimits & QuotasListStatusHeaders & { +export type QuotaBeginUpdateResponse = { + /** + * The parsed response body. + */ + body: any; + /** * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: QuotasListStatusHeaders; - /** * The response body as text (string format) */ @@ -1549,14 +1525,14 @@ export type QuotasListStatusResponse = QuotaLimits & QuotasListStatusHeaders & { /** * The response body as parsed JSON or XML */ - parsedBody: QuotaLimits; + parsedBody: any; }; }; /** - * Contains response data for the getStatus operation. + * Contains response data for the get operation. */ -export type QuotaRequestsGetStatusResponse = QuotaRequestDetails & { +export type QuotaRequestStatusGetResponse = QuotaRequestDetails & { /** * The underlying HTTP response. */ @@ -1574,9 +1550,9 @@ export type QuotaRequestsGetStatusResponse = QuotaRequestDetails & { }; /** - * Contains response data for the listStatus operation. + * Contains response data for the list operation. */ -export type QuotaRequestsListStatusResponse = QuotaRequestDetailsList & { +export type QuotaRequestStatusListResponse = QuotaRequestDetailsList & { /** * The underlying HTTP response. */ @@ -1594,9 +1570,9 @@ export type QuotaRequestsListStatusResponse = QuotaRequestDetailsList & { }; /** - * Contains response data for the listStatusNext operation. + * Contains response data for the listNext operation. */ -export type QuotaRequestsListStatusNextResponse = QuotaRequestDetailsList & { +export type QuotaRequestStatusListNextResponse = QuotaRequestDetailsList & { /** * The underlying HTTP response. */ diff --git a/sdk/reservations/arm-reservations/src/models/mappers.ts b/sdk/reservations/arm-reservations/src/models/mappers.ts index 08ca572377e0..acb688ee3c3f 100644 --- a/sdk/reservations/arm-reservations/src/models/mappers.ts +++ b/sdk/reservations/arm-reservations/src/models/mappers.ts @@ -524,14 +524,14 @@ export const EmailAction: msRest.CompositeMapper = { } }; -export const OnFailureEmailActions: msRest.CompositeMapper = { - serializedName: "OnFailure_emailActions", +export const EmailActions: msRest.CompositeMapper = { + serializedName: "EmailActions", type: { name: "Composite", - className: "OnFailureEmailActions", + className: "EmailActions", modelProperties: { - value: { - serializedName: "value", + emailAddresses: { + serializedName: "emailAddresses", type: { name: "Sequence", element: { @@ -546,68 +546,17 @@ export const OnFailureEmailActions: msRest.CompositeMapper = { } }; -export const PhoneAction: msRest.CompositeMapper = { - serializedName: "PhoneAction", +export const Actions: msRest.CompositeMapper = { + serializedName: "Actions", 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", + className: "Actions", modelProperties: { emailActions: { serializedName: "emailActions", type: { name: "Composite", - className: "OnFailureEmailActions" - } - }, - phoneActions: { - serializedName: "phoneActions", - type: { - name: "Composite", - className: "OnFailurePhoneActions" + className: "EmailActions" } } } @@ -727,14 +676,14 @@ export const AutoQuotaIncreaseDetail: msRest.CompositeMapper = { serializedName: "properties.onFailure", type: { name: "Composite", - className: "OnFailure" + className: "Actions" } }, onSuccess: { serializedName: "properties.onSuccess", type: { name: "Composite", - className: "OnFailure" + className: "Actions" } }, supportTicketAction: { @@ -748,22 +697,22 @@ export const AutoQuotaIncreaseDetail: msRest.CompositeMapper = { } }; -export const EmailActions: msRest.CompositeMapper = { - serializedName: "EmailActions", +export const PhoneAction: msRest.CompositeMapper = { + serializedName: "PhoneAction", type: { name: "Composite", - className: "EmailActions", + className: "PhoneAction", modelProperties: { - value: { - serializedName: "value", + phoneNumber: { + serializedName: "phoneNumber", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "EmailAction" - } - } + name: "String" + } + }, + preferredChannel: { + serializedName: "preferredChannel", + type: { + name: "Object" } } } @@ -2155,11 +2104,11 @@ export const Properties: msRest.CompositeMapper = { } }; -export const QuotaListStatusHeaders: msRest.CompositeMapper = { - serializedName: "quota-liststatus-headers", +export const QuotaGetHeaders: msRest.CompositeMapper = { + serializedName: "quota-get-headers", type: { name: "Composite", - className: "QuotaListStatusHeaders", + className: "QuotaGetHeaders", modelProperties: { eTag: { serializedName: "etag", @@ -2171,11 +2120,11 @@ export const QuotaListStatusHeaders: msRest.CompositeMapper = { } }; -export const QuotasListStatusHeaders: msRest.CompositeMapper = { - serializedName: "quotas-liststatus-headers", +export const QuotaListHeaders: msRest.CompositeMapper = { + serializedName: "quota-list-headers", type: { name: "Composite", - className: "QuotasListStatusHeaders", + className: "QuotaListHeaders", modelProperties: { eTag: { serializedName: "etag", diff --git a/sdk/reservations/arm-reservations/src/models/parameters.ts b/sdk/reservations/arm-reservations/src/models/parameters.ts index 276781071712..d4fe8e71b7d2 100644 --- a/sdk/reservations/arm-reservations/src/models/parameters.ts +++ b/sdk/reservations/arm-reservations/src/models/parameters.ts @@ -90,16 +90,6 @@ export const id: msRest.OperationURLParameter = { } } }; -export const ifMatch: msRest.OperationParameter = { - parameterPath: "ifMatch", - mapper: { - required: true, - serializedName: "If-Match", - type: { - name: "String" - } - } -}; export const location0: msRest.OperationURLParameter = { parameterPath: "location", mapper: { diff --git a/sdk/reservations/arm-reservations/src/models/quotaMappers.ts b/sdk/reservations/arm-reservations/src/models/quotaMappers.ts index 82fc7be567e6..c534a9487143 100644 --- a/sdk/reservations/arm-reservations/src/models/quotaMappers.ts +++ b/sdk/reservations/arm-reservations/src/models/quotaMappers.ts @@ -7,28 +7,29 @@ */ export { + Actions, AqiSettings, AutoQuotaIncreaseDetail, BaseResource, CurrentQuotaLimit, CurrentQuotaLimitBase, EmailAction, + EmailActions, ExceptionResponse, ExtendedStatusInfo, - OnFailure, - OnFailureEmailActions, - OnFailurePhoneActions, PaymentDetail, - PhoneAction, Price, PurchaseRequest, PurchaseRequestPropertiesReservedResourceProperties, - QuotaListStatusHeaders, + QuotaGetHeaders, + QuotaLimits, + QuotaListHeaders, QuotaProperties, QuotaRequestDetails, QuotaRequestOneResourceSubmitResponse, QuotaRequestProperties, QuotaRequestSubmitResponse, + QuotaRequestSubmitResponse201, RenewPropertiesResponse, RenewPropertiesResponseBillingCurrencyTotal, RenewPropertiesResponsePricingCurrencyTotal, diff --git a/sdk/reservations/arm-reservations/src/models/quotaRequestMappers.ts b/sdk/reservations/arm-reservations/src/models/quotaRequestMappers.ts deleted file mode 100644 index 29a9d269013e..000000000000 --- a/sdk/reservations/arm-reservations/src/models/quotaRequestMappers.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - AqiSettings, - AutoQuotaIncreaseDetail, - BaseResource, - CurrentQuotaLimit, - CurrentQuotaLimitBase, - EmailAction, - ExceptionResponse, - ExtendedStatusInfo, - OnFailure, - OnFailureEmailActions, - OnFailurePhoneActions, - PaymentDetail, - PhoneAction, - Price, - PurchaseRequest, - PurchaseRequestPropertiesReservedResourceProperties, - QuotaProperties, - QuotaRequestDetails, - QuotaRequestOneResourceSubmitResponse, - QuotaRequestProperties, - QuotaRequestSubmitResponse, - QuotaRequestSubmitResponse201, - RenewPropertiesResponse, - RenewPropertiesResponseBillingCurrencyTotal, - RenewPropertiesResponsePricingCurrencyTotal, - ReservationMergeProperties, - ReservationOrderBillingPlanInformation, - ReservationOrderResponse, - ReservationProperties, - ReservationResponse, - ReservationSplitProperties, - ResourceName, - ServiceError, - ServiceErrorDetail, - SkuName, - SubRequest, - SupportRequestAction -} from "../models/mappers"; diff --git a/sdk/reservations/arm-reservations/src/models/quotaRequestsMappers.ts b/sdk/reservations/arm-reservations/src/models/quotaRequestStatusMappers.ts similarity index 93% rename from sdk/reservations/arm-reservations/src/models/quotaRequestsMappers.ts rename to sdk/reservations/arm-reservations/src/models/quotaRequestStatusMappers.ts index 55516b5297be..fff340699edd 100644 --- a/sdk/reservations/arm-reservations/src/models/quotaRequestsMappers.ts +++ b/sdk/reservations/arm-reservations/src/models/quotaRequestStatusMappers.ts @@ -7,19 +7,17 @@ */ export { + Actions, AqiSettings, AutoQuotaIncreaseDetail, BaseResource, CurrentQuotaLimit, CurrentQuotaLimitBase, EmailAction, + EmailActions, ExceptionResponse, ExtendedStatusInfo, - OnFailure, - OnFailureEmailActions, - OnFailurePhoneActions, PaymentDetail, - PhoneAction, Price, PurchaseRequest, PurchaseRequestPropertiesReservedResourceProperties, diff --git a/sdk/reservations/arm-reservations/src/models/quotasMappers.ts b/sdk/reservations/arm-reservations/src/models/quotasMappers.ts deleted file mode 100644 index ea2d64bc8211..000000000000 --- a/sdk/reservations/arm-reservations/src/models/quotasMappers.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - AqiSettings, - AutoQuotaIncreaseDetail, - BaseResource, - CurrentQuotaLimit, - CurrentQuotaLimitBase, - EmailAction, - ExceptionResponse, - ExtendedStatusInfo, - OnFailure, - OnFailureEmailActions, - OnFailurePhoneActions, - PaymentDetail, - PhoneAction, - Price, - PurchaseRequest, - PurchaseRequestPropertiesReservedResourceProperties, - QuotaLimits, - QuotaProperties, - QuotaRequestDetails, - QuotaRequestOneResourceSubmitResponse, - QuotaRequestProperties, - QuotaRequestSubmitResponse, - QuotasListStatusHeaders, - RenewPropertiesResponse, - RenewPropertiesResponseBillingCurrencyTotal, - RenewPropertiesResponsePricingCurrencyTotal, - ReservationMergeProperties, - ReservationOrderBillingPlanInformation, - ReservationOrderResponse, - ReservationProperties, - ReservationResponse, - ReservationSplitProperties, - ResourceName, - ServiceError, - ServiceErrorDetail, - SkuName, - SubRequest, - 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 6779d27ad40f..d18c0abdafa3 100644 --- a/sdk/reservations/arm-reservations/src/models/reservationMappers.ts +++ b/sdk/reservations/arm-reservations/src/models/reservationMappers.ts @@ -7,23 +7,21 @@ */ export { + Actions, AqiSettings, AutoQuotaIncreaseDetail, BaseResource, CurrentQuotaLimit, CurrentQuotaLimitBase, EmailAction, + EmailActions, ErrorModel, ExtendedErrorInfo, ExtendedStatusInfo, MergeRequest, - OnFailure, - OnFailureEmailActions, - OnFailurePhoneActions, Patch, PatchPropertiesRenewProperties, PaymentDetail, - PhoneAction, Price, Properties, PurchaseRequest, diff --git a/sdk/reservations/arm-reservations/src/models/reservationOrderMappers.ts b/sdk/reservations/arm-reservations/src/models/reservationOrderMappers.ts index a70ada11fafa..ed7d25267a6a 100644 --- a/sdk/reservations/arm-reservations/src/models/reservationOrderMappers.ts +++ b/sdk/reservations/arm-reservations/src/models/reservationOrderMappers.ts @@ -7,6 +7,7 @@ */ export { + Actions, AqiSettings, AutoQuotaIncreaseDetail, BaseResource, @@ -17,14 +18,11 @@ export { CurrentQuotaLimit, CurrentQuotaLimitBase, EmailAction, + EmailActions, ErrorModel, ExtendedErrorInfo, ExtendedStatusInfo, - OnFailure, - OnFailureEmailActions, - OnFailurePhoneActions, PaymentDetail, - PhoneAction, Price, PurchaseRequest, PurchaseRequestPropertiesReservedResourceProperties, diff --git a/sdk/reservations/arm-reservations/src/operations/index.ts b/sdk/reservations/arm-reservations/src/operations/index.ts index 8b1716a7c990..9fd5ff8ff5bb 100644 --- a/sdk/reservations/arm-reservations/src/operations/index.ts +++ b/sdk/reservations/arm-reservations/src/operations/index.ts @@ -9,9 +9,7 @@ */ export * from "./quota"; -export * from "./quotaRequest"; -export * from "./quotas"; -export * from "./quotaRequests"; +export * from "./quotaRequestStatus"; export * from "./autoQuotaIncrease"; export * from "./reservation"; export * from "./reservationOrder"; diff --git a/sdk/reservations/arm-reservations/src/operations/quota.ts b/sdk/reservations/arm-reservations/src/operations/quota.ts index bd913d27fe6b..74849b2714e9 100644 --- a/sdk/reservations/arm-reservations/src/operations/quota.ts +++ b/sdk/reservations/arm-reservations/src/operations/quota.ts @@ -9,6 +9,7 @@ */ 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/quotaMappers"; import * as Parameters from "../models/parameters"; @@ -37,9 +38,9 @@ export class Quota { * @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 + * @returns Promise */ - listStatus(subscriptionId: string, providerId: string, location: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; + get(subscriptionId: string, providerId: string, location: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; /** * @param subscriptionId Azure subscription id. * @param providerId Azure resource Provider id. @@ -48,7 +49,7 @@ export class Quota { * Microsoft.Compute, pool for Microsoft.Batch. * @param callback The callback */ - listStatus(subscriptionId: string, providerId: string, location: string, resourceName: string, callback: msRest.ServiceCallback): void; + get(subscriptionId: string, providerId: string, location: string, resourceName: string, callback: msRest.ServiceCallback): void; /** * @param subscriptionId Azure subscription id. * @param providerId Azure resource Provider id. @@ -58,8 +59,8 @@ export class Quota { * @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 { + get(subscriptionId: string, providerId: string, location: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(subscriptionId: string, providerId: string, location: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { subscriptionId, @@ -68,14 +69,204 @@ export class Quota { resourceName, options }, - listStatusOperationSpec, - callback) as Promise; + getOperationSpec, + callback) 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 for the + * specific resource. This information consists of information regarding that specific resources. + * For the specific resource, if it requires an update to the quota, update the limit field in the + * response from the Get request to the new value of quota. Then, submit this updated JSON object + * to this quota request API. This will update the quota to the value specified. The location + * header in the response will be used to track the status of the quota request. Please check the + * provisioningState field in the response. The Patch operation can be used also to update the + * quota. + * @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 [options] The optional parameters + * @returns Promise + */ + createOrUpdate(subscriptionId: string, providerId: string, location: string, resourceName: string, createQuotaRequest: Models.CurrentQuotaLimitBase, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdate(subscriptionId,providerId,location,resourceName,createQuotaRequest,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 for the + * specific resource. This information consists of information regarding that specific resources. + * For the specific resource, if it requires an update to the quota, update the limit field in the + * response from the Get request to the new value of quota. Then, submit this updated JSON object + * to this quota request API. This will update the quota to the value specified. The location + * header in the response will be used to track the status of the quota request. Please check the + * provisioningState field in the response. The Put operation can be used also to update the quota. + * @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 [options] The optional parameters + * @returns Promise + */ + update(subscriptionId: string, providerId: string, location: string, resourceName: string, createQuotaRequest: Models.CurrentQuotaLimitBase, options?: msRest.RequestOptionsBase): Promise { + return this.beginUpdate(subscriptionId,providerId,location,resourceName,createQuotaRequest,options) + .then(lroPoller => lroPoller.pollUntilFinished()) 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 subscriptionId Azure subscription id. + * @param providerId Azure resource Provider id. + * @param location Azure region. + * @param [options] The optional parameters + * @returns Promise + */ + list(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 + */ + list(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 + */ + list(subscriptionId: string, providerId: string, location: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(subscriptionId: string, providerId: string, location: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + providerId, + location, + options + }, + listOperationSpec, + callback) 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 for the + * specific resource. This information consists of information regarding that specific resources. + * For the specific resource, if it requires an update to the quota, update the limit field in the + * response from the Get request to the new value of quota. Then, submit this updated JSON object + * to this quota request API. This will update the quota to the value specified. The location + * header in the response will be used to track the status of the quota request. Please check the + * provisioningState field in the response. The Patch operation can be used also to update the + * quota. + * @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 [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdate(subscriptionId: string, providerId: string, location: string, resourceName: string, createQuotaRequest: Models.CurrentQuotaLimitBase, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + subscriptionId, + providerId, + location, + resourceName, + createQuotaRequest, + options + }, + beginCreateOrUpdateOperationSpec, + 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 for the + * specific resource. This information consists of information regarding that specific resources. + * For the specific resource, if it requires an update to the quota, update the limit field in the + * response from the Get request to the new value of quota. Then, submit this updated JSON object + * to this quota request API. This will update the quota to the value specified. The location + * header in the response will be used to track the status of the quota request. Please check the + * provisioningState field in the response. The Put operation can be used also to update the quota. + * @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 [options] The optional parameters + * @returns Promise + */ + beginUpdate(subscriptionId: string, providerId: string, location: string, resourceName: string, createQuotaRequest: Models.CurrentQuotaLimitBase, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + subscriptionId, + providerId, + location, + resourceName, + createQuotaRequest, + options + }, + beginUpdateOperationSpec, + options); + } + + /** + * 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 + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(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 + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; } } // Operation Specifications const serializer = new msRest.Serializer(Mappers); -const listStatusOperationSpec: msRest.OperationSpec = { +const getOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}", urlParameters: [ @@ -93,7 +284,127 @@ const listStatusOperationSpec: msRest.OperationSpec = { responses: { 200: { bodyMapper: Mappers.CurrentQuotaLimitBase, - headersMapper: Mappers.QuotaListStatusHeaders + headersMapper: Mappers.QuotaGetHeaders + }, + default: { + bodyMapper: Mappers.ExceptionResponse + } + }, + serializer +}; + +const listOperationSpec: 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.QuotaListHeaders + }, + default: { + bodyMapper: Mappers.ExceptionResponse + } + }, + serializer +}; + +const beginCreateOrUpdateOperationSpec: 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.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.acceptLanguage + ], + requestBody: { + parameterPath: "createQuotaRequest", + mapper: { + ...Mappers.CurrentQuotaLimitBase, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.QuotaRequestOneResourceSubmitResponse + }, + 201: { + bodyMapper: Mappers.QuotaRequestSubmitResponse201 + }, + default: { + bodyMapper: Mappers.ExceptionResponse + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.QuotaLimits, + headersMapper: Mappers.QuotaListHeaders }, default: { bodyMapper: Mappers.ExceptionResponse diff --git a/sdk/reservations/arm-reservations/src/operations/quotaRequest.ts b/sdk/reservations/arm-reservations/src/operations/quotaRequest.ts deleted file mode 100644 index fd5fb8ae14fa..000000000000 --- a/sdk/reservations/arm-reservations/src/operations/quotaRequest.ts +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -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 for the - * specific resource. This information consists of information regarding that specific resources. - * For the specific resource, if it requires an update to the quota, update the limit field in the - * response from the Get request to the new value of quota. Then, submit this updated JSON object - * to this quota request API. This will update the quota to the value 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 for the - * specific resource. This information consists of information regarding that specific resources. - * For the specific resource, if it requires an update to the quota, update the limit field in the - * response from the Get request to the new value of quota. Then, submit this updated JSON object - * to this quota request API. This will update the quota to the value 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 for the - * specific resource. This information consists of information regarding that specific resources. - * For the specific resource, if it requires an update to the quota, update the limit field in the - * response from the Get request to the new value of quota. Then, submit this updated JSON object - * to this quota request API. This will update the quota to the value 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 for the - * specific resource. This information consists of information regarding that specific resources. - * For the specific resource, if it requires an update to the quota, update the limit field in the - * response from the Get request to the new value of quota. Then, submit this updated JSON object - * to this quota request API. This will update the quota to the value 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/quotaRequestStatus.ts similarity index 65% rename from sdk/reservations/arm-reservations/src/operations/quotaRequests.ts rename to sdk/reservations/arm-reservations/src/operations/quotaRequestStatus.ts index 74879e7874a4..78c040d35655 100644 --- a/sdk/reservations/arm-reservations/src/operations/quotaRequests.ts +++ b/sdk/reservations/arm-reservations/src/operations/quotaRequestStatus.ts @@ -10,16 +10,16 @@ import * as msRest from "@azure/ms-rest-js"; import * as Models from "../models"; -import * as Mappers from "../models/quotaRequestsMappers"; +import * as Mappers from "../models/quotaRequestStatusMappers"; import * as Parameters from "../models/parameters"; import { AzureReservationAPIContext } from "../azureReservationAPIContext"; -/** Class representing a QuotaRequests. */ -export class QuotaRequests { +/** Class representing a QuotaRequestStatus. */ +export class QuotaRequestStatus { private readonly client: AzureReservationAPIContext; /** - * Create a QuotaRequests. + * Create a QuotaRequestStatus. * @param {AzureReservationAPIContext} client Reference to the service client. */ constructor(client: AzureReservationAPIContext) { @@ -37,9 +37,9 @@ export class QuotaRequests { * @param location Azure region. * @param id Quota Request id. * @param [options] The optional parameters - * @returns Promise + * @returns Promise */ - getStatus(subscriptionId: string, providerId: string, location: string, id: string, options?: msRest.RequestOptionsBase): Promise; + get(subscriptionId: string, providerId: string, location: string, id: string, options?: msRest.RequestOptionsBase): Promise; /** * @param subscriptionId Azure subscription id. * @param providerId Azure resource Provider id. @@ -47,7 +47,7 @@ export class QuotaRequests { * @param id Quota Request id. * @param callback The callback */ - getStatus(subscriptionId: string, providerId: string, location: string, id: string, callback: msRest.ServiceCallback): void; + get(subscriptionId: string, providerId: string, location: string, id: string, callback: msRest.ServiceCallback): void; /** * @param subscriptionId Azure subscription id. * @param providerId Azure resource Provider id. @@ -56,8 +56,8 @@ export class QuotaRequests { * @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 { + get(subscriptionId: string, providerId: string, location: string, id: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(subscriptionId: string, providerId: string, location: string, id: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { subscriptionId, @@ -66,8 +66,8 @@ export class QuotaRequests { id, options }, - getStatusOperationSpec, - callback) as Promise; + getOperationSpec, + callback) as Promise; } /** @@ -81,16 +81,16 @@ export class QuotaRequests { * @param providerId Azure resource Provider id. * @param location Azure region. * @param [options] The optional parameters - * @returns Promise + * @returns Promise */ - listStatus(subscriptionId: string, providerId: string, location: string, options?: Models.QuotaRequestsListStatusOptionalParams): Promise; + list(subscriptionId: string, providerId: string, location: string, options?: Models.QuotaRequestStatusListOptionalParams): 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; + list(subscriptionId: string, providerId: string, location: string, callback: msRest.ServiceCallback): void; /** * @param subscriptionId Azure subscription id. * @param providerId Azure resource Provider id. @@ -98,8 +98,8 @@ export class QuotaRequests { * @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 { + list(subscriptionId: string, providerId: string, location: string, options: Models.QuotaRequestStatusListOptionalParams, callback: msRest.ServiceCallback): void; + list(subscriptionId: string, providerId: string, location: string, options?: Models.QuotaRequestStatusListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { subscriptionId, @@ -107,8 +107,8 @@ export class QuotaRequests { location, options }, - listStatusOperationSpec, - callback) as Promise; + listOperationSpec, + callback) as Promise; } /** @@ -120,34 +120,34 @@ export class QuotaRequests { * 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 + * @returns Promise */ - listStatusNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + listNext(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; + listNext(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 { + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, options }, - listStatusNextOperationSpec, - callback) as Promise; + listNextOperationSpec, + callback) as Promise; } } // Operation Specifications const serializer = new msRest.Serializer(Mappers); -const getStatusOperationSpec: msRest.OperationSpec = { +const getOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimitsRequests/{id}", urlParameters: [ @@ -173,7 +173,7 @@ const getStatusOperationSpec: msRest.OperationSpec = { serializer }; -const listStatusOperationSpec: msRest.OperationSpec = { +const listOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimitsRequests", urlParameters: [ @@ -201,7 +201,7 @@ const listStatusOperationSpec: msRest.OperationSpec = { serializer }; -const listStatusNextOperationSpec: msRest.OperationSpec = { +const listNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", baseUrl: "https://management.azure.com", path: "{nextLink}", diff --git a/sdk/reservations/arm-reservations/src/operations/quotas.ts b/sdk/reservations/arm-reservations/src/operations/quotas.ts deleted file mode 100644 index a4584d99cb8c..000000000000 --- a/sdk/reservations/arm-reservations/src/operations/quotas.ts +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -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 -};