Skip to content

Commit 8d86d4d

Browse files
author
SDKAuto
committed
CodeGen from PR 22367 in Azure/azure-rest-api-specs
[Hub Generated] Review request for Microsoft.Quota to add version stable/2023-02-01 (Azure#22367) * Adds base for updating Microsoft.Quota from version preview/2021-03-15-preview to version 2023-02-01 * Updates readme * Updates API version in new specs and examples * Fix version in readme * Remove stale version, update readme * Mark parameter as optional
1 parent 941ecc0 commit 8d86d4d

File tree

18 files changed

+113
-184
lines changed

18 files changed

+113
-184
lines changed

common/config/rush/pnpm-lock.yaml

Lines changed: 11 additions & 10 deletions
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: 2 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,5 @@
11
# Release History
2-
3-
## 1.0.0-beta.6 (Unreleased)
4-
5-
### Features Added
6-
7-
### Breaking Changes
8-
9-
### Bugs Fixed
10-
11-
### Other Changes
12-
13-
## 1.0.0-beta.5 (2022-12-05)
14-
15-
**Features**
16-
17-
- Added Interface LimitObject
18-
19-
## 1.0.0-beta.4 (2022-04-28)
20-
21-
**Features**
22-
23-
- Bug fix
24-
25-
## 1.0.0-beta.3 (2021-12-22)
26-
27-
**Features**
28-
29-
- Class AzureQuotaExtensionAPI has a new parameter $host
30-
- Class AzureQuotaExtensionAPI has a new parameter apiVersion
31-
32-
**Breaking Changes**
33-
34-
- Deleted Class AzureQuotaExtensionAPIContext
35-
36-
## 1.0.0-beta.2 (2021-11-01)
37-
38-
**Features**
39-
40-
- Added operation group QuotaOperation
41-
- Added Interface QuotaOperationListNextOptionalParams
42-
- Added Interface QuotaOperationListOptionalParams
43-
- Added Type Alias LimitObject
44-
- Added Type Alias QuotaOperationListNextResponse
45-
- Added Type Alias QuotaOperationListResponse
46-
- Class AzureQuotaExtensionAPI has a new parameter quotaOperation
47-
48-
**Breaking Changes**
49-
50-
- Removed operation group Operation
51-
- Class AzureQuotaExtensionAPI no longer has parameter operation
522

53-
## 1.0.0-beta.1 (2021-09-28)
3+
## 1.0.0 (2023-03-22)
544

55-
- Initial Release
5+
The package of @azure/arm-quota is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart).

sdk/quota/arm-quota/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2022 Microsoft
3+
Copyright (c) 2023 Microsoft
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

sdk/quota/arm-quota/README.md

Lines changed: 1 addition & 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?view=azure-node-preview) |
9+
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-quota) |
1010
[Samples](https://github.com/Azure-Samples/azure-samples-js-management)
1111

1212
## Getting started

sdk/quota/arm-quota/_meta.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"commit": "0cd7b3e83d5e7e21222dcc4bdde4565562da0cdf",
3-
"readme": "specification\\quota\\resource-manager\\readme.md",
4-
"autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\quota\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.3.20221108.1 --generate-sample=true",
2+
"commit": "806d1616c2ce4c0a93fda266bd020903733ac326",
3+
"readme": "specification/quota/resource-manager/readme.md",
4+
"autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/quota/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.10",
55
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
6-
"release_tool": "@azure-tools/js-sdk-release-tools@2.4.2",
7-
"use": "@autorest/typescript@6.0.0-rc.3.20221108.1"
6+
"release_tool": "@azure-tools/js-sdk-release-tools@2.6.2",
7+
"use": "@autorest/typescript@6.0.0-rc.10"
88
}

sdk/quota/arm-quota/package.json

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
"sdk-type": "mgmt",
44
"author": "Microsoft Corporation",
55
"description": "A generated SDK for AzureQuotaExtensionAPI.",
6-
"version": "1.0.0-beta.6",
6+
"version": "1.0.0",
77
"engines": {
88
"node": ">=14.0.0"
99
},
1010
"dependencies": {
11-
"@azure/core-lro": "^2.2.0",
11+
"@azure/core-lro": "^2.5.0",
1212
"@azure/abort-controller": "^1.0.0",
1313
"@azure/core-paging": "^1.2.0",
14-
"@azure/core-client": "^1.6.1",
14+
"@azure/core-client": "^1.7.0",
1515
"@azure/core-auth": "^1.3.0",
1616
"@azure/core-rest-pipeline": "^1.8.0",
1717
"tslib": "^2.2.0"
@@ -33,12 +33,13 @@
3333
"@rollup/plugin-json": "^6.0.0",
3434
"@rollup/plugin-multi-entry": "^6.0.0",
3535
"@rollup/plugin-node-resolve": "^13.1.3",
36-
"mkdirp": "^1.0.4",
36+
"mkdirp": "^2.1.2",
3737
"rollup": "^2.66.1",
3838
"rollup-plugin-sourcemaps": "^0.6.3",
3939
"typescript": "~4.8.0",
4040
"uglify-js": "^3.4.9",
4141
"rimraf": "^3.0.0",
42+
"dotenv": "^16.0.0",
4243
"@azure/identity": "^2.0.1",
4344
"@azure-tools/test-recorder": "^3.0.0",
4445
"@azure-tools/test-credential": "^1.0.0",
@@ -49,7 +50,6 @@
4950
"@types/node": "^14.0.0",
5051
"@azure/dev-tool": "^1.0.0"
5152
},
52-
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/quota/arm-quota",
5353
"repository": {
5454
"type": "git",
5555
"url": "https://github.com/Azure/azure-sdk-for-js.git"
@@ -111,12 +111,5 @@
111111
]
112112
},
113113
"autoPublish": true,
114-
"//sampleConfiguration": {
115-
"productName": "",
116-
"productSlugs": [
117-
"azure"
118-
],
119-
"disableDocsMs": true,
120-
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-quota?view=azure-node-preview"
121-
}
122-
}
114+
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/quota/arm-quota"
115+
}

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
import * as coreAuth from '@azure/core-auth';
88
import * as coreClient from '@azure/core-client';
9+
import { OperationState } from '@azure/core-lro';
910
import { PagedAsyncIterableIterator } from '@azure/core-paging';
10-
import { PollerLike } from '@azure/core-lro';
11-
import { PollOperationState } from '@azure/core-lro';
11+
import { SimplePollerLike } from '@azure/core-lro';
1212

1313
// @public (undocumented)
1414
export class AzureQuotaExtensionAPI extends coreClient.ServiceClient {
@@ -141,9 +141,9 @@ export interface OperationResponse {
141141

142142
// @public
143143
export interface Quota {
144-
beginCreateOrUpdate(resourceName: string, scope: string, createQuotaRequest: CurrentQuotaLimitBase, options?: QuotaCreateOrUpdateOptionalParams): Promise<PollerLike<PollOperationState<QuotaCreateOrUpdateResponse>, QuotaCreateOrUpdateResponse>>;
144+
beginCreateOrUpdate(resourceName: string, scope: string, createQuotaRequest: CurrentQuotaLimitBase, options?: QuotaCreateOrUpdateOptionalParams): Promise<SimplePollerLike<OperationState<QuotaCreateOrUpdateResponse>, QuotaCreateOrUpdateResponse>>;
145145
beginCreateOrUpdateAndWait(resourceName: string, scope: string, createQuotaRequest: CurrentQuotaLimitBase, options?: QuotaCreateOrUpdateOptionalParams): Promise<QuotaCreateOrUpdateResponse>;
146-
beginUpdate(resourceName: string, scope: string, createQuotaRequest: CurrentQuotaLimitBase, options?: QuotaUpdateOptionalParams): Promise<PollerLike<PollOperationState<QuotaUpdateResponse>, QuotaUpdateResponse>>;
146+
beginUpdate(resourceName: string, scope: string, createQuotaRequest: CurrentQuotaLimitBase, options?: QuotaUpdateOptionalParams): Promise<SimplePollerLike<OperationState<QuotaUpdateResponse>, QuotaUpdateResponse>>;
147147
beginUpdateAndWait(resourceName: string, scope: string, createQuotaRequest: CurrentQuotaLimitBase, options?: QuotaUpdateOptionalParams): Promise<QuotaUpdateResponse>;
148148
get(resourceName: string, scope: string, options?: QuotaGetOptionalParams): Promise<QuotaGetResponse>;
149149
list(scope: string, options?: QuotaListOptionalParams): PagedAsyncIterableIterator<CurrentQuotaLimitBase>;
@@ -303,9 +303,6 @@ export type QuotaRequestStatusGetResponse = QuotaRequestDetails;
303303

304304
// @public
305305
export interface QuotaRequestStatusListNextOptionalParams extends coreClient.OperationOptions {
306-
filter?: string;
307-
skiptoken?: string;
308-
top?: number;
309306
}
310307

311308
// @public

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class AzureQuotaExtensionAPI extends coreClient.ServiceClient {
5454
credential: credentials
5555
};
5656

57-
const packageDetails = `azsdk-js-arm-quota/1.0.0-beta.6`;
57+
const packageDetails = `azsdk-js-arm-quota/1.0.0`;
5858
const userAgentPrefix =
5959
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
6060
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
@@ -105,7 +105,7 @@ export class AzureQuotaExtensionAPI extends coreClient.ServiceClient {
105105

106106
// Assigning values to Constant parameters
107107
this.$host = options.$host || "https://management.azure.com";
108-
this.apiVersion = options.apiVersion || "2021-03-15-preview";
108+
this.apiVersion = options.apiVersion || "2023-02-01";
109109
this.usages = new UsagesImpl(this);
110110
this.quota = new QuotaImpl(this);
111111
this.quotaRequestStatus = new QuotaRequestStatusImpl(this);

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

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

9+
// Copyright (c) Microsoft Corporation.
10+
// Licensed under the MIT license.
11+
12+
import { AbortSignalLike } from "@azure/abort-controller";
913
import { LongRunningOperation, LroResponse } from "@azure/core-lro";
1014

11-
export class LroImpl<T> implements LongRunningOperation<T> {
12-
constructor(
13-
private sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>,
14-
private args: Record<string, unknown>,
15-
private spec: {
16-
readonly requestBody?: unknown;
17-
readonly path?: string;
18-
readonly httpMethod: string;
19-
} & Record<string, any>,
20-
public requestPath: string = spec.path!,
21-
public requestMethod: string = spec.httpMethod
22-
) {}
23-
public async sendInitialRequest(): Promise<LroResponse<T>> {
24-
return this.sendOperationFn(this.args, this.spec);
25-
}
26-
public async sendPollRequest(path: string): Promise<LroResponse<T>> {
27-
const { requestBody, ...restSpec } = this.spec;
28-
return this.sendOperationFn(this.args, {
29-
...restSpec,
30-
path,
31-
httpMethod: "GET"
32-
});
33-
}
15+
export function createLroSpec<T>(inputs: {
16+
sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>;
17+
args: Record<string, unknown>;
18+
spec: {
19+
readonly requestBody?: unknown;
20+
readonly path?: string;
21+
readonly httpMethod: string;
22+
} & Record<string, any>;
23+
}): LongRunningOperation<T> {
24+
const { args, spec, sendOperationFn } = inputs;
25+
return {
26+
requestMethod: spec.httpMethod,
27+
requestPath: spec.path!,
28+
sendInitialRequest: () => sendOperationFn(args, spec),
29+
sendPollRequest: (
30+
path: string,
31+
options?: { abortSignal?: AbortSignalLike }
32+
) => {
33+
const { requestBody, ...restSpec } = spec;
34+
return sendOperationFn(args, {
35+
...restSpec,
36+
httpMethod: "GET",
37+
path,
38+
abortSignal: options?.abortSignal
39+
});
40+
}
41+
};
3442
}

0 commit comments

Comments
 (0)