diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 29c35dff55ba..a468a149e227 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -4495,7 +4495,7 @@ packages: dependencies: semver: 7.5.4 shelljs: 0.8.5 - typescript: 5.4.0-dev.20231106 + typescript: 5.4.0-dev.20231107 dev: false /eastasianwidth@0.2.0: @@ -9272,8 +9272,8 @@ packages: hasBin: true dev: false - /typescript@5.4.0-dev.20231106: - resolution: {integrity: sha512-Uxjjt7meOHOSXpQJkiObTPUXfQKqSkdcMQOV+ZAjo3U1w/D/1Qah5Pdg0x/jt/fIA6laCNWLogS+QiaT5HOohw==} + /typescript@5.4.0-dev.20231107: + resolution: {integrity: sha512-4bQlfsyFjzZMo1bSLEkFJEcvuQ64pgE0S/BpdWu16lYsQOfJZtntZIyWdED3h+e96IMtVgrC6sxzfPZhj4J/dw==} engines: {node: '>=14.17'} hasBin: true dev: false @@ -14602,19 +14602,22 @@ packages: dev: false file:projects/arm-quota.tgz: - resolution: {integrity: sha512-031okDKFAtmRbDMVkyDyaBXdYly5d5QRqyWXRINW/FqI6ZMtWcWnS8nSeUq9oTPANmgk26IJVJCXkFWZhTAdMA==, tarball: file:projects/arm-quota.tgz} + resolution: {integrity: sha512-70nAexsaTXeOhNV5rDUULQp7eaKnjywKBUNo6y0jTBLNtt24QsOU3FIStzLa8WQqir44Tkb2jYDQJvspVMuTSg==, tarball: file:projects/arm-quota.tgz} name: '@rush-temp/arm-quota' version: 0.0.0 dependencies: '@azure/identity': 3.3.2 '@microsoft/api-extractor': 7.38.2(@types/node@18.18.8) '@types/chai': 4.3.9 + '@types/mocha': 10.0.3 '@types/node': 18.18.8 chai: 4.3.10 cross-env: 7.0.3 - mkdirp: 1.0.4 + dotenv: 16.3.1 + esm: 3.2.25 + mkdirp: 2.1.6 mocha: 10.2.0 - rimraf: 3.0.2 + rimraf: 5.0.5 ts-node: 10.9.1(@types/node@18.18.8)(typescript@5.2.2) tslib: 2.6.2 typescript: 5.2.2 diff --git a/sdk/quota/arm-quota/CHANGELOG.md b/sdk/quota/arm-quota/CHANGELOG.md index e1bb3e17e367..f9cd21989580 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-11-07) - - 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..83d14adaca87 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": "a231973a4fd49f699621dd74cb1b47d9d6fdcd13", + "readme": "specification/quota/resource-manager/readme.md", + "autorest_command": "autorest --version=3.9.7 --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.12", "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.7.4", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/quota/arm-quota/package.json b/sdk/quota/arm-quota/package.json index fc1c292a27a6..f3f80f0a15d3 100644 --- a/sdk/quota/arm-quota/package.json +++ b/sdk/quota/arm-quota/package.json @@ -3,17 +3,17 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for AzureQuotaExtensionAPI.", - "version": "1.0.0-beta.6", + "version": "1.0.0", "engines": { "node": ">=18.0.0" }, "dependencies": { - "@azure/core-lro": "^2.2.0", + "@azure/core-lro": "^2.5.4", "@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", + "@azure/core-rest-pipeline": "^1.12.0", "tslib": "^2.2.0" }, "keywords": [ @@ -29,22 +29,24 @@ "types": "./types/arm-quota.d.ts", "devDependencies": { "@microsoft/api-extractor": "^7.31.1", - "mkdirp": "^1.0.4", + "mkdirp": "^2.1.2", "typescript": "~5.2.0", "uglify-js": "^3.4.9", - "rimraf": "^3.0.0", + "rimraf": "^5.0.0", + "dotenv": "^16.0.0", + "@azure/dev-tool": "^1.0.0", "@azure/identity": "^3.3.0", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.0.0", "mocha": "^10.0.0", + "@types/mocha": "^10.0.0", + "esm": "^3.2.18", "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", "@types/node": "^18.0.0", - "@azure/dev-tool": "^1.0.0", "ts-node": "^10.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" @@ -77,7 +79,7 @@ "extract-api": "api-extractor run --local", "lint": "echo skipped", "audit": "echo skipped", - "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", "build:browser": "echo skipped", "build:test": "echo skipped", @@ -105,12 +107,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/test/sampleTest.ts b/sdk/quota/arm-quota/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/quota/arm-quota/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * 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. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); 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"