diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 819babdbf5a2..29380421063e 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -731,6 +731,7 @@ packages: /@azure/ai-form-recognizer/3.1.0-beta.3: resolution: {integrity: sha512-+4QtFKNyxAmdqpcYjuAtmWKm/MuOe9kZsbpS9jA9h0YHzngNj5gc67AA4egV9BXOq9x+1phjYTNC/rxiOUr1uQ==} engines: {node: '>=8.0.0'} + deprecated: Please migrate to a supported (non-beta) version of this package dependencies: '@azure/core-auth': 1.4.0 '@azure/core-http': 1.2.6 @@ -3893,7 +3894,7 @@ packages: dependencies: semver: 7.3.8 shelljs: 0.8.5 - typescript: 5.1.0-dev.20230320 + typescript: 5.1.0-dev.20230321 dev: false /ecdsa-sig-formatter/1.0.11: @@ -8749,8 +8750,8 @@ packages: hasBin: true dev: false - /typescript/5.1.0-dev.20230320: - resolution: {integrity: sha512-UWob7IhN/k84vqndbUwXaUNuLfzpgaD3wYm2FAKCUjXE0sMn5rf0Z+A8N2glIfqQBnBObLzIitWepn3TRF9Sjg==} + /typescript/5.1.0-dev.20230321: + resolution: {integrity: sha512-GFq3xvjbJImoKgCDJEiB7Bsa1wQdu/9tlb8Qj475ydSraETbCLzy+Ao3cqQ+KWBM6Mqo+0b1rrpe2Gj0DZz2+w==} engines: {node: '>=12.20'} hasBin: true dev: false @@ -12170,19 +12171,19 @@ packages: dev: false file:projects/arm-graphservices.tgz: - resolution: {integrity: sha512-FGMQq6BOIpb01GiMS1PDpo/y17Bb9bxNSMVtLJRoORxpGlTgbpDWB+1o65n5kZ4P2Sda2DScSr+Oml3uXoC3kg==, tarball: file:projects/arm-graphservices.tgz} + resolution: {integrity: sha512-W4Mpd/2C0oFq2ylu1h0QbdANHiy70H5DmfFjBxsY/9xE4X9IV9DlihvCO6i+VJNC0X7BTlvGmfa9JLVgFLjqxg==, tarball: file:projects/arm-graphservices.tgz} name: '@rush-temp/arm-graphservices' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 2.0.0 '@azure/identity': 2.1.0 - '@microsoft/api-extractor': 7.34.4_@types+node@14.18.37 + '@microsoft/api-extractor': 7.34.4_@types+node@14.18.38 '@rollup/plugin-commonjs': 24.0.1_rollup@2.79.1 '@rollup/plugin-json': 6.0.0_rollup@2.79.1 '@rollup/plugin-multi-entry': 6.0.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 '@types/chai': 4.3.4 - '@types/node': 14.18.37 + '@types/node': 14.18.38 chai: 4.3.7 cross-env: 7.0.3 dotenv: 16.0.3 @@ -12190,12 +12191,11 @@ packages: mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 - rollup-plugin-sourcemaps: 0.6.3_uvqxrz6xmh6o32kxhfeqlqrt5q + rollup-plugin-sourcemaps: 0.6.3_rrfo4ccoq6ga3fxzubpgdsawvq tslib: 2.5.0 typescript: 4.8.4 uglify-js: 3.17.4 transitivePeerDependencies: - - encoding - supports-color dev: false @@ -13953,7 +13953,7 @@ packages: dev: false file:projects/arm-quota.tgz: - resolution: {integrity: sha512-yZJrL3VK+kbmlfAtljxlMDzcLn5mS89l41moi7V0Fqmj+2HAvjPONgoNcNBXmJer5P/jZyM46vo3jIlYG1isnA==, tarball: file:projects/arm-quota.tgz} + resolution: {integrity: sha512-ZgS2MsewM/a3yTsbeqIAdT4/Tpz7kIe5NyapQtcnhlGIkMs4oaQ95LwqEH00HBrvyFJraqIK7gLX+Bkt/q0zuA==, tarball: file:projects/arm-quota.tgz} name: '@rush-temp/arm-quota' version: 0.0.0 dependencies: @@ -13967,7 +13967,8 @@ packages: '@types/node': 14.18.38 chai: 4.3.7 cross-env: 7.0.3 - mkdirp: 1.0.4 + dotenv: 16.0.3 + mkdirp: 2.1.5 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 diff --git a/sdk/quota/arm-quota/CHANGELOG.md b/sdk/quota/arm-quota/CHANGELOG.md index e1bb3e17e367..ebb6a1a3cdd3 100644 --- a/sdk/quota/arm-quota/CHANGELOG.md +++ b/sdk/quota/arm-quota/CHANGELOG.md @@ -1,55 +1,5 @@ # Release History - -## 1.0.0-beta.6 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 1.0.0-beta.5 (2022-12-05) - -**Features** - - - Added Interface LimitObject - -## 1.0.0-beta.4 (2022-04-28) - -**Features** - - - Bug fix - -## 1.0.0-beta.3 (2021-12-22) - -**Features** - - - Class AzureQuotaExtensionAPI has a new parameter $host - - Class AzureQuotaExtensionAPI has a new parameter apiVersion - -**Breaking Changes** - - - Deleted Class AzureQuotaExtensionAPIContext - -## 1.0.0-beta.2 (2021-11-01) - -**Features** - - - Added operation group QuotaOperation - - Added Interface QuotaOperationListNextOptionalParams - - Added Interface QuotaOperationListOptionalParams - - Added Type Alias LimitObject - - Added Type Alias QuotaOperationListNextResponse - - Added Type Alias QuotaOperationListResponse - - Class AzureQuotaExtensionAPI has a new parameter quotaOperation - -**Breaking Changes** - - - Removed operation group Operation - - Class AzureQuotaExtensionAPI no longer has parameter operation -## 1.0.0-beta.1 (2021-09-28) +## 1.0.0 (2023-03-22) - - Initial Release +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). diff --git a/sdk/quota/arm-quota/LICENSE b/sdk/quota/arm-quota/LICENSE index 5d1d36e0af80..3a1d9b6f24f7 100644 --- a/sdk/quota/arm-quota/LICENSE +++ b/sdk/quota/arm-quota/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2022 Microsoft +Copyright (c) 2023 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/quota/arm-quota/README.md b/sdk/quota/arm-quota/README.md index 62516ec73d5e..0062fa4fc99e 100644 --- a/sdk/quota/arm-quota/README.md +++ b/sdk/quota/arm-quota/README.md @@ -6,7 +6,7 @@ Microsoft Azure Quota Resource Provider [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/quota/arm-quota) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-quota) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-quota?view=azure-node-preview) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-quota) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started diff --git a/sdk/quota/arm-quota/_meta.json b/sdk/quota/arm-quota/_meta.json index 8ac45aa52360..01c5f9096c36 100644 --- a/sdk/quota/arm-quota/_meta.json +++ b/sdk/quota/arm-quota/_meta.json @@ -1,8 +1,8 @@ { - "commit": "0cd7b3e83d5e7e21222dcc4bdde4565562da0cdf", - "readme": "specification\\quota\\resource-manager\\readme.md", - "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", + "commit": "806d1616c2ce4c0a93fda266bd020903733ac326", + "readme": "specification/quota/resource-manager/readme.md", + "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", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", - "use": "@autorest/typescript@6.0.0-rc.3.20221108.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.6.2", + "use": "@autorest/typescript@6.0.0-rc.10" } \ No newline at end of file diff --git a/sdk/quota/arm-quota/package.json b/sdk/quota/arm-quota/package.json index 870fc0ed55f2..455efa5c5024 100644 --- a/sdk/quota/arm-quota/package.json +++ b/sdk/quota/arm-quota/package.json @@ -3,15 +3,15 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for AzureQuotaExtensionAPI.", - "version": "1.0.0-beta.6", + "version": "1.0.0", "engines": { "node": ">=14.0.0" }, "dependencies": { - "@azure/core-lro": "^2.2.0", + "@azure/core-lro": "^2.5.0", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.6.1", + "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.3.0", "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" @@ -33,12 +33,13 @@ "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-multi-entry": "^6.0.0", "@rollup/plugin-node-resolve": "^13.1.3", - "mkdirp": "^1.0.4", + "mkdirp": "^2.1.2", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", "typescript": "~4.8.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", + "dotenv": "^16.0.0", "@azure/identity": "^2.0.1", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.0.0", @@ -49,7 +50,6 @@ "@types/node": "^14.0.0", "@azure/dev-tool": "^1.0.0" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/quota/arm-quota", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" @@ -111,12 +111,5 @@ ] }, "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-quota?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/quota/arm-quota" +} \ No newline at end of file diff --git a/sdk/quota/arm-quota/review/arm-quota.api.md b/sdk/quota/arm-quota/review/arm-quota.api.md index 28d562f535bc..480799bad461 100644 --- a/sdk/quota/arm-quota/review/arm-quota.api.md +++ b/sdk/quota/arm-quota/review/arm-quota.api.md @@ -6,9 +6,9 @@ import * as coreAuth from '@azure/core-auth'; import * as coreClient from '@azure/core-client'; +import { OperationState } from '@azure/core-lro'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; -import { PollerLike } from '@azure/core-lro'; -import { PollOperationState } from '@azure/core-lro'; +import { SimplePollerLike } from '@azure/core-lro'; // @public (undocumented) export class AzureQuotaExtensionAPI extends coreClient.ServiceClient { @@ -141,9 +141,9 @@ export interface OperationResponse { // @public export interface Quota { - beginCreateOrUpdate(resourceName: string, scope: string, createQuotaRequest: CurrentQuotaLimitBase, options?: QuotaCreateOrUpdateOptionalParams): Promise, QuotaCreateOrUpdateResponse>>; + beginCreateOrUpdate(resourceName: string, scope: string, createQuotaRequest: CurrentQuotaLimitBase, options?: QuotaCreateOrUpdateOptionalParams): Promise, QuotaCreateOrUpdateResponse>>; beginCreateOrUpdateAndWait(resourceName: string, scope: string, createQuotaRequest: CurrentQuotaLimitBase, options?: QuotaCreateOrUpdateOptionalParams): Promise; - beginUpdate(resourceName: string, scope: string, createQuotaRequest: CurrentQuotaLimitBase, options?: QuotaUpdateOptionalParams): Promise, QuotaUpdateResponse>>; + beginUpdate(resourceName: string, scope: string, createQuotaRequest: CurrentQuotaLimitBase, options?: QuotaUpdateOptionalParams): Promise, QuotaUpdateResponse>>; beginUpdateAndWait(resourceName: string, scope: string, createQuotaRequest: CurrentQuotaLimitBase, options?: QuotaUpdateOptionalParams): Promise; get(resourceName: string, scope: string, options?: QuotaGetOptionalParams): Promise; list(scope: string, options?: QuotaListOptionalParams): PagedAsyncIterableIterator; @@ -303,9 +303,6 @@ export type QuotaRequestStatusGetResponse = QuotaRequestDetails; // @public export interface QuotaRequestStatusListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - skiptoken?: string; - top?: number; } // @public diff --git a/sdk/quota/arm-quota/src/azureQuotaExtensionAPI.ts b/sdk/quota/arm-quota/src/azureQuotaExtensionAPI.ts index 2eea16afdcf6..9bf86654fd58 100644 --- a/sdk/quota/arm-quota/src/azureQuotaExtensionAPI.ts +++ b/sdk/quota/arm-quota/src/azureQuotaExtensionAPI.ts @@ -54,7 +54,7 @@ export class AzureQuotaExtensionAPI extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-quota/1.0.0-beta.6`; + const packageDetails = `azsdk-js-arm-quota/1.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -105,7 +105,7 @@ export class AzureQuotaExtensionAPI extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-03-15-preview"; + this.apiVersion = options.apiVersion || "2023-02-01"; this.usages = new UsagesImpl(this); this.quota = new QuotaImpl(this); this.quotaRequestStatus = new QuotaRequestStatusImpl(this); diff --git a/sdk/quota/arm-quota/src/lroImpl.ts b/sdk/quota/arm-quota/src/lroImpl.ts index 518d5f053b4e..dd803cd5e28c 100644 --- a/sdk/quota/arm-quota/src/lroImpl.ts +++ b/sdk/quota/arm-quota/src/lroImpl.ts @@ -6,29 +6,37 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { AbortSignalLike } from "@azure/abort-controller"; import { LongRunningOperation, LroResponse } from "@azure/core-lro"; -export class LroImpl implements LongRunningOperation { - constructor( - private sendOperationFn: (args: any, spec: any) => Promise>, - private args: Record, - private spec: { - readonly requestBody?: unknown; - readonly path?: string; - readonly httpMethod: string; - } & Record, - public requestPath: string = spec.path!, - public requestMethod: string = spec.httpMethod - ) {} - public async sendInitialRequest(): Promise> { - return this.sendOperationFn(this.args, this.spec); - } - public async sendPollRequest(path: string): Promise> { - const { requestBody, ...restSpec } = this.spec; - return this.sendOperationFn(this.args, { - ...restSpec, - path, - httpMethod: "GET" - }); - } +export function createLroSpec(inputs: { + sendOperationFn: (args: any, spec: any) => Promise>; + args: Record; + spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record; +}): LongRunningOperation { + const { args, spec, sendOperationFn } = inputs; + return { + requestMethod: spec.httpMethod, + requestPath: spec.path!, + sendInitialRequest: () => sendOperationFn(args, spec), + sendPollRequest: ( + path: string, + options?: { abortSignal?: AbortSignalLike } + ) => { + const { requestBody, ...restSpec } = spec; + return sendOperationFn(args, { + ...restSpec, + httpMethod: "GET", + path, + abortSignal: options?.abortSignal + }); + } + }; } diff --git a/sdk/quota/arm-quota/src/models/index.ts b/sdk/quota/arm-quota/src/models/index.ts index b8fafd6bd0e6..0e0d5d8bd1de 100644 --- a/sdk/quota/arm-quota/src/models/index.ts +++ b/sdk/quota/arm-quota/src/models/index.ts @@ -42,7 +42,7 @@ export interface UsagesProperties { readonly unit?: string; /** Resource name provided by the resource provider. Use this property name when requesting quota. */ name?: ResourceName; - /** The name of the resource type. */ + /** The name of the resource type. Optional field. */ resourceType?: string; /** * The time period for the summary of the quota usage values. For example: @@ -154,7 +154,7 @@ export interface QuotaProperties { readonly unit?: string; /** Resource name provided by the resource provider. Use this property name when requesting quota. */ name?: ResourceName; - /** Resource type name. */ + /** The name of the resource type. Optional field. */ resourceType?: string; /** * The time period over which the quota usage values are summarized. For example: @@ -386,7 +386,7 @@ export interface QuotaRequestOneResourceSubmitResponse { unit?: string; /** Resource name provided by the resource provider. Use this property name when requesting quota. */ namePropertiesName?: ResourceName; - /** Resource type name. */ + /** The name of the resource type. Optional field. */ resourceType?: string; /** * The time period over which the quota usage values are summarized. For example: @@ -462,7 +462,7 @@ export interface QuotaRequestSubmitResponse202 { unit?: string; /** Resource name provided by the resource provider. Use this property name when requesting quota. */ namePropertiesName?: ResourceName; - /** Resource type name. */ + /** The name of the resource type. Optional field. */ resourceType?: string; /** * The time period over which the quota usage values are summarized. For example: @@ -693,22 +693,7 @@ export type QuotaRequestStatusListResponse = QuotaRequestDetailsList; /** Optional parameters. */ export interface QuotaRequestStatusListNextOptionalParams - extends coreClient.OperationOptions { - /** - * | Field | Supported operators - * |---------------------|------------------------ - * - * |requestSubmitTime | ge, le, eq, gt, lt - * |provisioningState eq {QuotaRequestState} - * |resourceName eq {resourceName} - * - */ - filter?: string; - /** Number of records to return. */ - top?: number; - /** The **Skiptoken** parameter is used only if a previous operation returned a partial result. If a previous response contains a **nextLink** element, its value includes a **skiptoken** parameter that specifies a starting point to use for subsequent calls. */ - skiptoken?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type QuotaRequestStatusListNextResponse = QuotaRequestDetailsList; diff --git a/sdk/quota/arm-quota/src/models/parameters.ts b/sdk/quota/arm-quota/src/models/parameters.ts index 16ad1e6b051d..7b323cb5ba39 100644 --- a/sdk/quota/arm-quota/src/models/parameters.ts +++ b/sdk/quota/arm-quota/src/models/parameters.ts @@ -51,7 +51,7 @@ export const resourceName: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-03-15-preview", + defaultValue: "2023-02-01", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/quota/arm-quota/src/operations/quota.ts b/sdk/quota/arm-quota/src/operations/quota.ts index 5b39907e90bb..6d9460f6f226 100644 --- a/sdk/quota/arm-quota/src/operations/quota.ts +++ b/sdk/quota/arm-quota/src/operations/quota.ts @@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { AzureQuotaExtensionAPI } from "../azureQuotaExtensionAPI"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { CurrentQuotaLimitBase, QuotaListNextOptionalParams, @@ -156,8 +160,8 @@ export class QuotaImpl implements Quota { createQuotaRequest: CurrentQuotaLimitBase, options?: QuotaCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, QuotaCreateOrUpdateResponse > > { @@ -167,7 +171,7 @@ export class QuotaImpl implements Quota { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -200,15 +204,18 @@ export class QuotaImpl implements Quota { }; }; - const lro = new LroImpl( - sendOperation, - { resourceName, scope, createQuotaRequest, options }, - createOrUpdateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceName, scope, createQuotaRequest, options }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + QuotaCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" + resourceLocationConfig: "original-uri" }); await poller.poll(); return poller; @@ -274,7 +281,7 @@ export class QuotaImpl implements Quota { createQuotaRequest: CurrentQuotaLimitBase, options?: QuotaUpdateOptionalParams ): Promise< - PollerLike, QuotaUpdateResponse> + SimplePollerLike, QuotaUpdateResponse> > { const directSendOperation = async ( args: coreClient.OperationArguments, @@ -282,7 +289,7 @@ export class QuotaImpl implements Quota { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -315,15 +322,18 @@ export class QuotaImpl implements Quota { }; }; - const lro = new LroImpl( - sendOperation, - { resourceName, scope, createQuotaRequest, options }, - updateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceName, scope, createQuotaRequest, options }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + QuotaUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" + resourceLocationConfig: "original-uri" }); await poller.poll(); return poller; @@ -507,7 +517,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], headerParameters: [Parameters.accept], serializer diff --git a/sdk/quota/arm-quota/src/operations/quotaOperation.ts b/sdk/quota/arm-quota/src/operations/quotaOperation.ts index 16e8d8ab3778..072e06edcf72 100644 --- a/sdk/quota/arm-quota/src/operations/quotaOperation.ts +++ b/sdk/quota/arm-quota/src/operations/quotaOperation.ts @@ -143,7 +143,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], serializer diff --git a/sdk/quota/arm-quota/src/operations/quotaRequestStatus.ts b/sdk/quota/arm-quota/src/operations/quotaRequestStatus.ts index 5892235f72d9..da9e00b836cc 100644 --- a/sdk/quota/arm-quota/src/operations/quotaRequestStatus.ts +++ b/sdk/quota/arm-quota/src/operations/quotaRequestStatus.ts @@ -214,12 +214,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.top, - Parameters.skiptoken - ], urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], headerParameters: [Parameters.accept], serializer diff --git a/sdk/quota/arm-quota/src/operations/usages.ts b/sdk/quota/arm-quota/src/operations/usages.ts index b4c6aa66c570..689911ec84f3 100644 --- a/sdk/quota/arm-quota/src/operations/usages.ts +++ b/sdk/quota/arm-quota/src/operations/usages.ts @@ -211,7 +211,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ExceptionResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], headerParameters: [Parameters.accept], serializer diff --git a/sdk/quota/arm-quota/src/operationsInterfaces/quota.ts b/sdk/quota/arm-quota/src/operationsInterfaces/quota.ts index 0818e76ebfa2..4b3e1104770c 100644 --- a/sdk/quota/arm-quota/src/operationsInterfaces/quota.ts +++ b/sdk/quota/arm-quota/src/operationsInterfaces/quota.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { CurrentQuotaLimitBase, QuotaListOptionalParams, @@ -81,8 +81,8 @@ export interface Quota { createQuotaRequest: CurrentQuotaLimitBase, options?: QuotaCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, QuotaCreateOrUpdateResponse > >; @@ -137,7 +137,7 @@ export interface Quota { createQuotaRequest: CurrentQuotaLimitBase, options?: QuotaUpdateOptionalParams ): Promise< - PollerLike, QuotaUpdateResponse> + SimplePollerLike, QuotaUpdateResponse> >; /** * Update the quota limit for a specific resource to the specified value: diff --git a/sdk/quota/arm-quota/src/pagingHelper.ts b/sdk/quota/arm-quota/src/pagingHelper.ts index d85fc13bce1e..269a2b9814b5 100644 --- a/sdk/quota/arm-quota/src/pagingHelper.ts +++ b/sdk/quota/arm-quota/src/pagingHelper.ts @@ -13,11 +13,11 @@ export interface PageInfo { const pageMap = new WeakMap(); /** - * Given a result page from a pageable operation, returns a - * continuation token that can be used to begin paging from + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from * that point later. - * @param page A result object from calling .byPage() on a paged operation. - * @returns The continuation token that can be passed into byPage(). + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. */ export function getContinuationToken(page: unknown): string | undefined { if (typeof page !== "object" || page === null) { diff --git a/sdk/quota/arm-quota/tsconfig.json b/sdk/quota/arm-quota/tsconfig.json index 32291f85971b..3e6ae96443f3 100644 --- a/sdk/quota/arm-quota/tsconfig.json +++ b/sdk/quota/arm-quota/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-quota": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"