Skip to content

Commit cbbbcf1

Browse files
authored
quota-track2-ga (Azure#19524)
* quota-track2-ga * update readme.md
1 parent 34e1a67 commit cbbbcf1

File tree

13 files changed

+87
-123
lines changed

13 files changed

+87
-123
lines changed

common/config/rush/pnpm-lock.yaml

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/quota/arm-quota/CHANGELOG.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
## Release History
2-
3-
### 1.0.0-beta.3 (Unreleased)
4-
5-
#### Features Added
6-
7-
#### Breaking Changes
1+
# Release History
2+
3+
## 1.0.0-beta.3 (2021-12-22)
4+
5+
**Features**
86

9-
#### Bugs Fixed
7+
- Class AzureQuotaExtensionAPI has a new parameter $host
8+
- Class AzureQuotaExtensionAPI has a new parameter apiVersion
109

11-
#### Other Changes
10+
**Breaking Changes**
1211

13-
### 1.0.0-beta.2 (2021-11-01)
12+
- Deleted Class AzureQuotaExtensionAPIContext
13+
14+
## 1.0.0-beta.2 (2021-11-01)
1415

1516
**Features**
1617

@@ -27,6 +28,6 @@
2728
- Removed operation group Operation
2829
- Class AzureQuotaExtensionAPI no longer has parameter operation
2930

30-
### 1.0.0-beta.1 (2021-09-28)
31+
## 1.0.0-beta.1 (2021-09-28)
3132

3233
- Initial Release

sdk/quota/arm-quota/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Microsoft Azure Quota Resource Provider
66

77
[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/quota/arm-quota) |
88
[Package (NPM)](https://www.npmjs.com/package/@azure/arm-quota) |
9-
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-quota) |
9+
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-quota?view=azure-node-preview) |
1010
[Samples](https://github.com/Azure-Samples/azure-samples-js-management)
1111

1212
## Getting started
@@ -53,6 +53,10 @@ const subscriptionId = "00000000-0000-0000-0000-000000000000";
5353
const client = new AzureQuotaExtensionAPI(new DefaultAzureCredential(), subscriptionId);
5454
```
5555

56+
57+
### JavaScript Bundle
58+
To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling).
59+
5660
## Key concepts
5761

5862
### AzureQuotaExtensionAPI

sdk/quota/arm-quota/_meta.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"commit": "4a2c1e8f277dd11a0da89d56eab8ff1a922d3a69",
2+
"commit": "0cd7b3e83d5e7e21222dcc4bdde4565562da0cdf",
33
"readme": "specification/quota/resource-manager/readme.md",
4-
"autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/quota/resource-manager/readme.md --use=@autorest/typescript@6.0.0-beta.13",
4+
"autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/quota/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20211217.1",
55
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
6-
"use": "@autorest/typescript@6.0.0-beta.13"
6+
"use": "@autorest/typescript@6.0.0-alpha.16.20211217.1"
77
}

sdk/quota/arm-quota/package.json

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,17 @@
44
"author": "Microsoft Corporation",
55
"description": "A generated SDK for AzureQuotaExtensionAPI.",
66
"version": "1.0.0-beta.3",
7-
"engines": {
8-
"node": ">=12.0.0"
9-
},
7+
"engines": { "node": ">=12.0.0" },
108
"dependencies": {
119
"@azure/core-lro": "^2.2.0",
1210
"@azure/abort-controller": "^1.0.0",
13-
"@azure/core-paging": "^1.1.1",
11+
"@azure/core-paging": "^1.2.0",
1412
"@azure/core-client": "^1.0.0",
1513
"@azure/core-auth": "^1.3.0",
1614
"@azure/core-rest-pipeline": "^1.1.0",
1715
"tslib": "^2.2.0"
1816
},
19-
"keywords": [
20-
"node",
21-
"azure",
22-
"typescript",
23-
"browser",
24-
"isomorphic"
25-
],
17+
"keywords": ["node", "azure", "typescript", "browser", "isomorphic"],
2618
"license": "MIT",
2719
"main": "./dist/index.js",
2820
"module": "./dist-esm/src/index.js",
@@ -38,6 +30,7 @@
3830
"rollup-plugin-sourcemaps": "^0.4.2",
3931
"typescript": "~4.2.0",
4032
"uglify-js": "^3.4.9",
33+
"rimraf": "^3.0.0",
4134
"@azure/identity": "^2.0.1",
4235
"@azure-tools/test-recorder": "^1.0.0",
4336
"mocha": "^7.1.1",
@@ -48,9 +41,7 @@
4841
"type": "git",
4942
"url": "https://github.com/Azure/azure-sdk-for-js.git"
5043
},
51-
"bugs": {
52-
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
53-
},
44+
"bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" },
5445
"files": [
5546
"dist/**/*.js",
5647
"dist/**/*.js.map",
@@ -70,14 +61,14 @@
7061
"types/*"
7162
],
7263
"scripts": {
73-
"build": "tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api",
64+
"build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api",
7465
"minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js",
7566
"prepack": "npm run build",
7667
"pack": "npm pack 2>&1",
7768
"extract-api": "api-extractor run --local",
7869
"lint": "echo skipped",
7970
"audit": "echo skipped",
80-
"clean": "echo skipped",
71+
"clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log",
8172
"build:node": "echo skipped",
8273
"build:browser": "echo skipped",
8374
"build:test": "echo skipped",
@@ -86,14 +77,13 @@
8677
"execute:samples": "echo skipped",
8778
"format": "echo skipped",
8879
"test": "npm run integration-test",
89-
"prebuild": "echo skipped",
9080
"test:node": "echo skipped",
9181
"test:browser": "echo skipped",
9282
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
9383
"unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node",
9484
"unit-test:browser": "echo skipped",
9585
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
96-
"integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts",
86+
"integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js",
9787
"integration-test:browser": "echo skipped",
9888
"docs": "echo skipped"
9989
},

sdk/quota/arm-quota/review/arm-quota.api.md

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@ import { PollerLike } from '@azure/core-lro';
1111
import { PollOperationState } from '@azure/core-lro';
1212

1313
// @public (undocumented)
14-
export class AzureQuotaExtensionAPI extends AzureQuotaExtensionAPIContext {
14+
export class AzureQuotaExtensionAPI extends coreClient.ServiceClient {
15+
// (undocumented)
16+
$host: string;
1517
constructor(credentials: coreAuth.TokenCredential, options?: AzureQuotaExtensionAPIOptionalParams);
1618
// (undocumented)
19+
apiVersion: string;
20+
// (undocumented)
1721
quota: Quota;
1822
// (undocumented)
1923
quotaOperation: QuotaOperation;
@@ -23,15 +27,6 @@ export class AzureQuotaExtensionAPI extends AzureQuotaExtensionAPIContext {
2327
usages: Usages;
2428
}
2529

26-
// @public (undocumented)
27-
export class AzureQuotaExtensionAPIContext extends coreClient.ServiceClient {
28-
// (undocumented)
29-
$host: string;
30-
constructor(credentials: coreAuth.TokenCredential, options?: AzureQuotaExtensionAPIOptionalParams);
31-
// (undocumented)
32-
apiVersion: string;
33-
}
34-
3530
// @public
3631
export interface AzureQuotaExtensionAPIOptionalParams extends coreClient.ServiceClientOptions {
3732
$host?: string;
@@ -463,7 +458,6 @@ export interface UsagesProperties {
463458
// @public
464459
export type UsagesTypes = string;
465460

466-
467461
// (No @packageDocumentation comment for this package)
468462

469463
```

sdk/quota/arm-quota/src/azureQuotaExtensionAPI.ts

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
*/
88

9+
import * as coreClient from "@azure/core-client";
910
import * as coreAuth from "@azure/core-auth";
1011
import {
1112
UsagesImpl,
@@ -19,10 +20,12 @@ import {
1920
QuotaRequestStatus,
2021
QuotaOperation
2122
} from "./operationsInterfaces";
22-
import { AzureQuotaExtensionAPIContext } from "./azureQuotaExtensionAPIContext";
2323
import { AzureQuotaExtensionAPIOptionalParams } from "./models";
2424

25-
export class AzureQuotaExtensionAPI extends AzureQuotaExtensionAPIContext {
25+
export class AzureQuotaExtensionAPI extends coreClient.ServiceClient {
26+
$host: string;
27+
apiVersion: string;
28+
2629
/**
2730
* Initializes a new instance of the AzureQuotaExtensionAPI class.
2831
* @param credentials Subscription credentials which uniquely identify client subscription.
@@ -32,7 +35,41 @@ export class AzureQuotaExtensionAPI extends AzureQuotaExtensionAPIContext {
3235
credentials: coreAuth.TokenCredential,
3336
options?: AzureQuotaExtensionAPIOptionalParams
3437
) {
35-
super(credentials, options);
38+
if (credentials === undefined) {
39+
throw new Error("'credentials' cannot be null");
40+
}
41+
42+
// Initializing default values for options
43+
if (!options) {
44+
options = {};
45+
}
46+
const defaults: AzureQuotaExtensionAPIOptionalParams = {
47+
requestContentType: "application/json; charset=utf-8",
48+
credential: credentials
49+
};
50+
51+
const packageDetails = `azsdk-js-arm-quota/1.0.0-beta.1`;
52+
const userAgentPrefix =
53+
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
54+
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
55+
: `${packageDetails}`;
56+
57+
if (!options.credentialScopes) {
58+
options.credentialScopes = ["https://management.azure.com/.default"];
59+
}
60+
const optionsWithDefaults = {
61+
...defaults,
62+
...options,
63+
userAgentOptions: {
64+
userAgentPrefix
65+
},
66+
baseUri: options.endpoint || "https://management.azure.com"
67+
};
68+
super(optionsWithDefaults);
69+
70+
// Assigning values to Constant parameters
71+
this.$host = options.$host || "https://management.azure.com";
72+
this.apiVersion = options.apiVersion || "2021-03-15-preview";
3673
this.usages = new UsagesImpl(this);
3774
this.quota = new QuotaImpl(this);
3875
this.quotaRequestStatus = new QuotaRequestStatusImpl(this);

sdk/quota/arm-quota/src/azureQuotaExtensionAPIContext.ts

Lines changed: 0 additions & 62 deletions
This file was deleted.

sdk/quota/arm-quota/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@
99
/// <reference lib="esnext.asynciterable" />
1010
export * from "./models";
1111
export { AzureQuotaExtensionAPI } from "./azureQuotaExtensionAPI";
12-
export { AzureQuotaExtensionAPIContext } from "./azureQuotaExtensionAPIContext";
1312
export * from "./operationsInterfaces";

sdk/quota/arm-quota/src/operations/quota.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { Quota } from "../operationsInterfaces";
1111
import * as coreClient from "@azure/core-client";
1212
import * as Mappers from "../models/mappers";
1313
import * as Parameters from "../models/parameters";
14-
import { AzureQuotaExtensionAPIContext } from "../azureQuotaExtensionAPIContext";
14+
import { AzureQuotaExtensionAPI } from "../azureQuotaExtensionAPI";
1515
import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
1616
import { LroImpl } from "../lroImpl";
1717
import {
@@ -31,13 +31,13 @@ import {
3131
/// <reference lib="esnext.asynciterable" />
3232
/** Class containing Quota operations. */
3333
export class QuotaImpl implements Quota {
34-
private readonly client: AzureQuotaExtensionAPIContext;
34+
private readonly client: AzureQuotaExtensionAPI;
3535

3636
/**
3737
* Initialize a new instance of the class Quota class.
3838
* @param client Reference to the service client
3939
*/
40-
constructor(client: AzureQuotaExtensionAPIContext) {
40+
constructor(client: AzureQuotaExtensionAPI) {
4141
this.client = client;
4242
}
4343

0 commit comments

Comments
 (0)