Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR @azure/arm-reservations] Adding Azure-AsyncOperation header #2956

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions sdk/reservations/arm-reservations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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";
Expand Down Expand Up @@ -68,6 +70,7 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
<script src="node_modules/@azure/ms-rest-browserauth/dist/msAuth.js"></script>
<script src="node_modules/@azure/arm-reservations/dist/arm-reservations.js"></script>
<script type="text/javascript">
const subscriptionId = "<Subscription_Id>";
const authManager = new msAuth.AuthManager({
clientId: "<client id for your Azure AD app>",
tenant: "<optional tenant for your organization>"
Expand All @@ -77,7 +80,7 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
// may cause redirects
authManager.login();
}
const client = new Azure.ArmReservations.AzureReservationAPI(res.creds);
const client = new Azure.ArmReservations.AzureReservationAPI(res.creds, subscriptionId);
const subscriptionId = "testsubscriptionId";
const providerId = "testproviderId";
const location = "westus";
Expand Down
4 changes: 2 additions & 2 deletions sdk/reservations/arm-reservations/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const config = {
"@azure/ms-rest-azure-js": "msRestAzure"
},
banner: `/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
Expand All @@ -24,6 +23,8 @@ class AzureReservationAPI extends AzureReservationAPIContext {
reservation: operations.Reservation;
reservationOrder: operations.ReservationOrder;
operation: operations.Operation;
calculateExchange: operations.CalculateExchange;
exchange: operations.Exchange;

/**
* Initializes a new instance of the AzureReservationAPI class.
Expand All @@ -38,6 +39,8 @@ class AzureReservationAPI extends AzureReservationAPIContext {
this.reservation = new operations.Reservation(this);
this.reservationOrder = new operations.ReservationOrder(this);
this.operation = new operations.Operation(this);
this.calculateExchange = new operations.CalculateExchange(this);
this.exchange = new operations.Exchange(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/

export {
BillingInformation,
CalculateExchangeOperationResultResponse,
CalculateExchangePostHeaders,
CalculateExchangeRequest,
CalculateExchangeRequestProperties,
CalculateExchangeResponseProperties,
ErrorModel,
ExchangePolicyError,
ExchangePolicyErrors,
ExtendedErrorInfo,
OperationResultError,
Price,
PurchaseRequest,
PurchaseRequestPropertiesReservedResourceProperties,
ReservationToExchange,
ReservationToPurchaseCalculateExchange,
ReservationToReturn,
SkuName
} from "../models/mappers";
24 changes: 24 additions & 0 deletions sdk/reservations/arm-reservations/src/models/exchangeMappers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/

export {
BillingInformation,
ErrorModel,
ExchangeOperationResultResponse,
ExchangePolicyError,
ExchangePolicyErrors,
ExchangePostHeaders,
ExchangeRequest,
ExchangeRequestProperties,
ExchangeResponseProperties,
ExtendedErrorInfo,
OperationResultError,
Price,
ReservationToPurchaseExchange,
ReservationToReturnForExchange
} from "../models/mappers";
Loading