Skip to content

Commit 8b11417

Browse files
author
SDKAuto
committed
CodeGen from PR 15520 in Azure/azure-rest-api-specs
Merge 9095f017bd4089fcaf87ab9331441949385f301a into 3d6211cf28f83236cdf78e7cfc50efd3fb7cba72
1 parent a716a21 commit 8b11417

File tree

7 files changed

+378
-386
lines changed

7 files changed

+378
-386
lines changed

sdk/reservations/arm-reservations/README.md

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
## Azure AzureReservationAPI SDK for JavaScript
22

3-
This package contains an isomorphic SDK (runs both in Node.js and in browsers) for AzureReservationAPI.
3+
This package contains an isomorphic SDK (runs both in node.js and in browsers) for AzureReservationAPI.
44

55
### Currently supported environments
66

77
- [LTS versions of Node.js](https://nodejs.org/about/releases/)
8-
- Latest versions of Safari, Chrome, Edge, and Firefox.
8+
- Latest versions of Safari, Chrome, Edge and Firefox.
99

1010
### Prerequisites
1111

@@ -21,7 +21,6 @@ Install both packages using the below command:
2121
```bash
2222
npm install --save @azure/arm-reservations @azure/identity
2323
```
24-
2524
> **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features.
2625
If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options.
2726

@@ -37,8 +36,7 @@ If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/
3736

3837
In the below samples, we pass the credential and the Azure subscription id to instantiate the client.
3938
Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started.
40-
41-
#### nodejs - Authentication, client creation, and get quota as an example written in JavaScript.
39+
#### nodejs - Authentication, client creation, and list reservation as an example written in JavaScript.
4240

4341
##### Sample code
4442

@@ -51,11 +49,8 @@ const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];
5149
// Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead.
5250
const creds = new DefaultAzureCredential();
5351
const client = new AzureReservationAPI(creds, subscriptionId);
54-
const testSubscriptionId = "testsubscriptionId";
55-
const providerId = "testproviderId";
56-
const location = "westus";
57-
const resourceName = "testresourceName";
58-
client.quota.get(testSubscriptionId, providerId, location, resourceName).then((result) => {
52+
const reservationOrderId = "testreservationOrderId";
53+
client.reservation.list(reservationOrderId).then((result) => {
5954
console.log("The result is:");
6055
console.log(result);
6156
}).catch((err) => {
@@ -64,7 +59,7 @@ client.quota.get(testSubscriptionId, providerId, location, resourceName).then((r
6459
});
6560
```
6661

67-
#### browser - Authentication, client creation, and get quota as an example written in JavaScript.
62+
#### browser - Authentication, client creation, and list reservation as an example written in JavaScript.
6863

6964
In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser.
7065
- See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser.
@@ -89,14 +84,11 @@ In browser applications, we recommend using the `InteractiveBrowserCredential` t
8984
const credential = new InteractiveBrowserCredential(
9085
{
9186
clientId: "<client id for your Azure AD app>",
92-
tenantId: "<optional tenant for your organization>"
87+
tenant: "<optional tenant for your organization>"
9388
});
9489
const client = new Azure.ArmReservations.AzureReservationAPI(creds, subscriptionId);
95-
const testSubscriptionId = "testsubscriptionId";
96-
const providerId = "testproviderId";
97-
const location = "westus";
98-
const resourceName = "testresourceName";
99-
client.quota.get(testSubscriptionId, providerId, location, resourceName).then((result) => {
90+
const reservationOrderId = "testreservationOrderId";
91+
client.reservation.list(reservationOrderId).then((result) => {
10092
console.log("The result is:");
10193
console.log(result);
10294
}).catch((err) => {

sdk/reservations/arm-reservations/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"rollup-plugin-sourcemaps": "^0.4.2",
2828
"uglify-js": "^3.6.0"
2929
},
30-
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/feature/v4/sdk/reservations/arm-reservations",
30+
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/reservations/arm-reservations",
3131
"repository": {
3232
"type": "git",
3333
"url": "https://github.com/Azure/azure-sdk-for-js.git"

sdk/reservations/arm-reservations/src/azureReservationAPIContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
import * as Models from "./models";
1111
import * as msRest from "@azure/ms-rest-js";
12-
import { TokenCredential } from "@azure/core-auth";
1312
import * as msRestAzure from "@azure/ms-rest-azure-js";
13+
import { TokenCredential } from "@azure/core-auth";
1414

1515
const packageName = "@azure/arm-reservations";
1616
const packageVersion = "6.1.1";

0 commit comments

Comments
 (0)