From 76e1baea8893986a9b62101b4f4daac7f03904c8 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Sat, 12 Dec 2020 00:08:43 +0000 Subject: [PATCH] CodeGen from PR 12080 in Azure/azure-rest-api-specs Merge 132bac8447d72537c883bb0c045544799a78c8f6 into 88aae44f2ca08a5bf249f5cb64f9ce01d3429ec6 --- sdk/reservations/arm-reservations/README.md | 15 +- .../arm-reservations/rollup.config.js | 4 +- .../src/azureReservationAPI.ts | 9 +- .../src/azureReservationAPIContext.ts | 5 +- .../src/models/autoQuotaIncreaseMappers.ts | 4 +- .../src/models/calculateExchangeMappers.ts | 28 + .../src/models/exchangeMappers.ts | 24 + .../arm-reservations/src/models/index.ts | 655 ++++++++++-- .../arm-reservations/src/models/mappers.ts | 986 +++++++++++++++--- .../src/models/operationMappers.ts | 4 +- .../arm-reservations/src/models/parameters.ts | 19 +- .../src/models/quotaMappers.ts | 4 +- .../src/models/quotaRequestStatusMappers.ts | 4 +- .../src/models/reservationMappers.ts | 8 +- .../src/models/reservationOrderMappers.ts | 7 +- .../src/operations/autoQuotaIncrease.ts | 5 +- .../src/operations/calculateExchange.ts | 91 ++ .../src/operations/exchange.ts | 91 ++ .../arm-reservations/src/operations/index.ts | 7 +- .../src/operations/operation.ts | 8 +- .../arm-reservations/src/operations/quota.ts | 8 +- .../src/operations/quotaRequestStatus.ts | 17 +- .../src/operations/reservation.ts | 29 +- .../src/operations/reservationOrder.ts | 72 +- 24 files changed, 1804 insertions(+), 300 deletions(-) create mode 100644 sdk/reservations/arm-reservations/src/models/calculateExchangeMappers.ts create mode 100644 sdk/reservations/arm-reservations/src/models/exchangeMappers.ts create mode 100644 sdk/reservations/arm-reservations/src/operations/calculateExchange.ts create mode 100644 sdk/reservations/arm-reservations/src/operations/exchange.ts diff --git a/sdk/reservations/arm-reservations/README.md b/sdk/reservations/arm-reservations/README.md index 156ab2e58ad8..e75981e8de0f 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 get quota as an example written in TypeScript. +#### nodejs - client creation and get quota as an example written in TypeScript. ##### Install @azure/ms-rest-nodeauth @@ -26,12 +26,14 @@ npm install @azure/ms-rest-nodeauth@"^3.0.0" ##### Sample code -```javascript +While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package +```typescript +const msRestNodeAuth = require("@azure/ms-rest-nodeauth"); const { AzureReservationAPI } = require("@azure/arm-reservations"); -const { interactiveLogin } = require("@azure/ms-rest-nodeauth"); +const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; -interactiveLogin().then((creds) => { - const client = new AzureReservationAPI(creds); +msRestNodeAuth.interactiveLogin().then((creds) => { + const client = new AzureReservationAPI(creds, subscriptionId); const subscriptionId = "testsubscriptionId"; const providerId = "testproviderId"; const location = "westus"; @@ -68,6 +70,7 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to