diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index a0121f606644..4dad076addbc 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -2188,7 +2188,7 @@ packages: resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} dependencies: '@types/connect': 3.4.35 - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/chai-as-promised/7.1.5: @@ -2210,7 +2210,7 @@ packages: /@types/connect/3.4.35: resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/cookie/0.4.1: @@ -2220,7 +2220,7 @@ packages: /@types/cors/2.8.13: resolution: {integrity: sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/debug/4.1.7: @@ -2232,7 +2232,7 @@ packages: /@types/decompress/4.2.4: resolution: {integrity: sha512-/C8kTMRTNiNuWGl5nEyKbPiMv6HA+0RbEXzFhFBEzASM6+oa4tJro9b8nj7eRlOFfuLdzUU+DS/GPDlvvzMOhA==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/eslint/8.4.10: @@ -2253,7 +2253,7 @@ packages: /@types/express-serve-static-core/4.17.34: resolution: {integrity: sha512-fvr49XlCGoUj2Pp730AItckfjat4WNb0lb3kfrLWffd+RLeoGAMsq7UOy04PAPtoL01uKwcp6u8nhzpgpDYr3w==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 '@types/qs': 6.9.7 '@types/range-parser': 1.2.4 '@types/send': 0.17.1 @@ -2271,13 +2271,13 @@ packages: /@types/fs-extra/8.1.2: resolution: {integrity: sha512-SvSrYXfWSc7R4eqnOzbQF4TZmfpNSM9FrSWLU3EUnWBuyZqNBOrv1B1JA3byUDPUl9z4Ab3jeZG2eDdySlgNMg==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/fs-extra/9.0.13: resolution: {integrity: sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/inquirer/8.2.6: @@ -2290,7 +2290,7 @@ packages: /@types/is-buffer/2.0.0: resolution: {integrity: sha512-0f7N/e3BAz32qDYvgB4d2cqv1DqUwvGxHkXsrucICn8la1Vb6Yl6Eg8mPScGwUiqHJeE7diXlzaK+QMA9m4Gxw==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/json-schema/7.0.11: @@ -2304,13 +2304,13 @@ packages: /@types/jsonwebtoken/9.0.2: resolution: {integrity: sha512-drE6uz7QBKq1fYqqoFKTDRdFCPHd5TCub75BM+D+cMx7NU9hUz7SESLfC2fSCXVFMO5Yj8sOWHuGqPgjc+fz0Q==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/jws/3.2.5: resolution: {integrity: sha512-xGTxZH34xOryaTN8CMsvhh9lfNqFuHiMoRvsLYWQdBJHqiECyfInXVl2eK8Jz2emxZWMIn5RBlmr3oDVPeWujw==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/linkify-it/3.0.2: @@ -2361,13 +2361,13 @@ packages: /@types/mysql/2.15.19: resolution: {integrity: sha512-wSRg2QZv14CWcZXkgdvHbbV2ACufNy5EgI8mBBxnJIptchv7DBy/h53VMa2jDhyo0C9MO4iowE6z9vF8Ja1DkQ==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/node-fetch/2.6.3: resolution: {integrity: sha512-ETTL1mOEdq/sxUtgtOhKjyB2Irra4cjxksvcMUR5Zr4n+PxVhsCD9WS46oPbHL3et9Zde7CNRr+WUNlcHvsX+w==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 form-data: 3.0.1 dev: false @@ -2392,7 +2392,7 @@ packages: /@types/pg/8.6.1: resolution: {integrity: sha512-1Kc4oAGzAl7uqUStZCDvaLFqZrW9qWSjXOmBfdgyBP5La7Us6Mg4GBvRlSoaZMhQF/zSj1C8CtKMBkoiT8eL8w==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 pg-protocol: 1.6.0 pg-types: 2.2.0 dev: false @@ -2420,7 +2420,7 @@ packages: /@types/resolve/1.17.1: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/semaphore/1.1.1: @@ -2439,14 +2439,14 @@ packages: resolution: {integrity: sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==} dependencies: '@types/mime': 1.3.2 - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/serve-static/1.15.1: resolution: {integrity: sha512-NUo5XNiAdULrJENtJXZZ3fHtfMolzZwczzBbnAeBbqBwG+LaG6YaJtuwzwGSQZ2wsCrxjEhNNjAkKigy3n8teQ==} dependencies: '@types/mime': 3.0.1 - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/sinon/10.0.14: @@ -2468,13 +2468,13 @@ packages: /@types/stoppable/1.1.1: resolution: {integrity: sha512-b8N+fCADRIYYrGZOcmOR8ZNBOqhktWTB/bMUl5LvGtT201QKJZOOH5UsFyI3qtteM6ZAJbJqZoBcLqqxKIwjhw==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/through/0.0.30: resolution: {integrity: sha512-FvnCJljyxhPM3gkRgWmxmDZyAQSiBQQWLI0A0VFL0K7W1oRUrPJSqNO0NvTnLkBcotdlp3lKvaT0JrnyRDkzOg==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/tough-cookie/4.0.2: @@ -2488,7 +2488,7 @@ packages: /@types/tunnel/0.0.3: resolution: {integrity: sha512-sOUTGn6h1SfQ+gbgqC364jLFBw2lnFqkgF3q0WovEHRLMrVD1sd5aufqi/aJObLekJO+Aq5z646U4Oxy6shXMA==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/underscore/1.11.4: @@ -2506,19 +2506,19 @@ packages: /@types/ws/7.4.7: resolution: {integrity: sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/ws/8.5.4: resolution: {integrity: sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/xml2js/0.4.11: resolution: {integrity: sha512-JdigeAKmCyoJUiQljjr7tQG3if9NkqGUgwEUqBvV0N7LM4HyQk7UXCnusRa1lnvXAEYJ8mw8GtZWioagNztOwA==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/yargs-parser/21.0.0: @@ -2535,7 +2535,7 @@ packages: resolution: {integrity: sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==} requiresBuild: true dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false optional: true @@ -3540,7 +3540,7 @@ packages: resolution: {integrity: sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==} deprecated: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797) dependencies: - ms: 2.1.1 + ms: 2.1.3 dev: false /debug/3.2.7: @@ -3771,7 +3771,7 @@ packages: dependencies: semver: 7.5.0 shelljs: 0.8.5 - typescript: 5.1.0-dev.20230511 + typescript: 5.2.0-dev.20230516 dev: false /ecdsa-sig-formatter/1.0.11: @@ -3822,7 +3822,7 @@ packages: dependencies: '@types/cookie': 0.4.1 '@types/cors': 2.8.13 - '@types/node': 14.18.46 + '@types/node': 16.18.28 accepts: 1.3.8 base64id: 2.0.0 cookie: 0.4.2 @@ -4746,7 +4746,7 @@ packages: fs.realpath: 1.0.0 inflight: 1.0.6 inherits: 2.0.4 - minimatch: 3.0.4 + minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 dev: false @@ -7043,7 +7043,7 @@ packages: '@protobufjs/path': 1.1.2 '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 - '@types/node': 14.18.46 + '@types/node': 16.18.28 long: 5.2.3 dev: false @@ -8315,8 +8315,8 @@ packages: hasBin: true dev: false - /typescript/5.1.0-dev.20230511: - resolution: {integrity: sha512-T/GsNgbl4YWUZwSxCrj9uq2aIj7OC/5EyXqj4exIhRbwZEpjPIflv2TEqm6K5fFQhqKQpFATE8OBvY0Qzu8D1A==} + /typescript/5.2.0-dev.20230516: + resolution: {integrity: sha512-DGK8md4PQgA6QG9JnvC6LecNnBstc1h6zrg71isrlZTsRFVl3EsID6D2Exrh4ULbxynA61PE13M+uOmLFWOu4w==} engines: {node: '>=14.17'} hasBin: true dev: false @@ -10288,7 +10288,7 @@ packages: dev: false file:projects/arm-cognitiveservices.tgz: - resolution: {integrity: sha512-ksox1tAbGPW1iipqh0nL53eF0Dx/lFuJj3U6s1D6sC8g0boGLprzf5GPLoArEnf0NbK17t7hM5W6GGAj1C3GIw==, tarball: file:projects/arm-cognitiveservices.tgz} + resolution: {integrity: sha512-CAGPA0r4/jkCg6Eukphyd3OLUuHJHlG2FcjIf+azJbVB2kVbe55kg6ItwGmVE82OKKUUlXEzYKAHdx8MANMWqQ==, tarball: file:projects/arm-cognitiveservices.tgz} name: '@rush-temp/arm-cognitiveservices' version: 0.0.0 dependencies: @@ -10302,14 +10302,14 @@ packages: '@types/node': 14.18.46 chai: 4.3.7 cross-env: 7.0.3 - dotenv: 8.6.0 - mkdirp: 1.0.4 + dotenv: 16.0.3 + mkdirp: 2.1.6 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 rollup-plugin-sourcemaps: 0.6.3_m742s5qpci6ulntpyriekwplh4 tslib: 2.5.0 - typescript: 5.0.4 + typescript: 4.8.4 uglify-js: 3.17.4 transitivePeerDependencies: - supports-color diff --git a/sdk/cognitiveservices/arm-cognitiveservices/CHANGELOG.md b/sdk/cognitiveservices/arm-cognitiveservices/CHANGELOG.md index c6f1706bb6bf..39661a31dd93 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/CHANGELOG.md +++ b/sdk/cognitiveservices/arm-cognitiveservices/CHANGELOG.md @@ -1,15 +1,42 @@ # Release History + +## 7.5.0 (2023-05-17) + +**Features** -## 7.4.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added operation group Models + - Added operation group Usages + - Added Interface AbusePenalty + - Added Interface CapacityConfig + - Added Interface Model + - Added Interface ModelListResult + - Added Interface ModelSku + - Added Interface ModelsListNextOptionalParams + - Added Interface ModelsListOptionalParams + - Added Interface UsagesListNextOptionalParams + - Added Interface UsagesListOptionalParams + - Added Type Alias AbusePenaltyAction + - Added Type Alias DeploymentModelVersionUpgradeOption + - Added Type Alias ModelsListNextResponse + - Added Type Alias ModelsListResponse + - Added Type Alias UsagesListNextResponse + - Added Type Alias UsagesListResponse + - Interface AccountModel has a new optional parameter isDefaultVersion + - Interface AccountModel has a new optional parameter skus + - Interface AccountProperties has a new optional parameter abusePenalty + - Interface CommitmentPlanProperties has a new optional parameter provisioningIssues + - Interface Deployment has a new optional parameter sku + - Interface DeploymentModel has a new optional parameter source + - Interface DeploymentProperties has a new optional parameter rateLimits + - Interface DeploymentProperties has a new optional parameter versionUpgradeOption + - Interface UsageListResult has a new optional parameter nextLink + - Added Enum KnownAbusePenaltyAction + - Added Enum KnownDeploymentModelVersionUpgradeOption + - Enum KnownDeploymentProvisioningState has a new value Canceled + - Enum KnownDeploymentProvisioningState has a new value Disabled + - Enum KnownHostingModel has a new value ProvisionedWeb + + ## 7.4.0 (2023-02-06) **Features** diff --git a/sdk/cognitiveservices/arm-cognitiveservices/_meta.json b/sdk/cognitiveservices/arm-cognitiveservices/_meta.json index 94577a3ca33a..d0e5bf12a153 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/_meta.json +++ b/sdk/cognitiveservices/arm-cognitiveservices/_meta.json @@ -1,8 +1,8 @@ { - "commit": "e217fd77475710b4a48542f433e3b9782f26f229", + "commit": "f19fe4d284229130f8bc3262fab6bb1cacf9c69a", "readme": "specification/cognitiveservices/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=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\cognitiveservices\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.7 --generate-sample=true", + "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/cognitiveservices/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.6.1", - "use": "@autorest/typescript@6.0.0-rc.7" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.0", + "use": "@autorest/typescript@6.0.0-rc.10" } \ No newline at end of file diff --git a/sdk/cognitiveservices/arm-cognitiveservices/package.json b/sdk/cognitiveservices/arm-cognitiveservices/package.json index b59a8e86d029..e2fed65df442 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/package.json +++ b/sdk/cognitiveservices/arm-cognitiveservices/package.json @@ -3,15 +3,15 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for CognitiveServicesManagementClient.", - "version": "7.4.1", + "version": "7.5.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,13 +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": "~5.0.0", + "typescript": "~4.8.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", - "dotenv": "^8.2.0", + "dotenv": "^16.0.0", "@azure/identity": "^2.0.1", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.0.0", @@ -111,13 +111,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/cognitiveservices/arm-cognitiveservices", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-cognitiveservices?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/cognitiveservices/arm-cognitiveservices" +} \ No newline at end of file diff --git a/sdk/cognitiveservices/arm-cognitiveservices/review/arm-cognitiveservices.api.md b/sdk/cognitiveservices/arm-cognitiveservices/review/arm-cognitiveservices.api.md index 88032507e30d..a7a3c2630b1a 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/review/arm-cognitiveservices.api.md +++ b/sdk/cognitiveservices/arm-cognitiveservices/review/arm-cognitiveservices.api.md @@ -6,9 +6,19 @@ 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 +export interface AbusePenalty { + action?: AbusePenaltyAction; + expiration?: Date; + rateLimitPercentage?: number; +} + +// @public +export type AbusePenaltyAction = string; // @public export interface Account extends AzureEntityResource { @@ -39,8 +49,10 @@ export interface AccountModel extends DeploymentModel { finetuneCapabilities?: { [propertyName: string]: string; }; + isDefaultVersion?: boolean; lifecycleStatus?: ModelLifecycleStatus; maxCapacity?: number; + skus?: ModelSku[]; readonly systemData?: SystemData; } @@ -52,6 +64,7 @@ export interface AccountModelListResult { // @public export interface AccountProperties { + readonly abusePenalty?: AbusePenalty; // (undocumented) allowedFqdnList?: string[]; apiProperties?: ApiProperties; @@ -89,11 +102,11 @@ export interface AccountProperties { // @public export interface Accounts { - beginCreate(resourceGroupName: string, accountName: string, account: Account, options?: AccountsCreateOptionalParams): Promise, AccountsCreateResponse>>; + beginCreate(resourceGroupName: string, accountName: string, account: Account, options?: AccountsCreateOptionalParams): Promise, AccountsCreateResponse>>; beginCreateAndWait(resourceGroupName: string, accountName: string, account: Account, options?: AccountsCreateOptionalParams): Promise; - beginDelete(resourceGroupName: string, accountName: string, options?: AccountsDeleteOptionalParams): Promise, void>>; + beginDelete(resourceGroupName: string, accountName: string, options?: AccountsDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, accountName: string, options?: AccountsDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, accountName: string, account: Account, options?: AccountsUpdateOptionalParams): Promise, AccountsUpdateResponse>>; + beginUpdate(resourceGroupName: string, accountName: string, account: Account, options?: AccountsUpdateOptionalParams): Promise, AccountsUpdateResponse>>; beginUpdateAndWait(resourceGroupName: string, accountName: string, account: Account, options?: AccountsUpdateOptionalParams): Promise; get(resourceGroupName: string, accountName: string, options?: AccountsGetOptionalParams): Promise; list(options?: AccountsListOptionalParams): PagedAsyncIterableIterator; @@ -255,6 +268,14 @@ export interface CallRateLimit { rules?: ThrottlingRule[]; } +// @public +export interface CapacityConfig { + default?: number; + maximum?: number; + minimum?: number; + step?: number; +} + // @public export interface CheckDomainAvailabilityOptionalParams extends coreClient.OperationOptions { kind?: string; @@ -304,6 +325,8 @@ export class CognitiveServicesManagementClient extends coreClient.ServiceClient // (undocumented) deployments: Deployments; // (undocumented) + models: Models; + // (undocumented) operations: Operations; // (undocumented) privateEndpointConnections: PrivateEndpointConnections; @@ -313,6 +336,8 @@ export class CognitiveServicesManagementClient extends coreClient.ServiceClient resourceSkus: ResourceSkus; // (undocumented) subscriptionId: string; + // (undocumented) + usages: Usages; } // @public @@ -384,6 +409,7 @@ export interface CommitmentPlanProperties { readonly last?: CommitmentPeriod; next?: CommitmentPeriod; planType?: string; + readonly provisioningIssues?: string[]; readonly provisioningState?: CommitmentPlanProvisioningState; } @@ -392,17 +418,17 @@ export type CommitmentPlanProvisioningState = string; // @public export interface CommitmentPlans { - beginCreateOrUpdateAssociation(resourceGroupName: string, commitmentPlanName: string, commitmentPlanAssociationName: string, association: CommitmentPlanAccountAssociation, options?: CommitmentPlansCreateOrUpdateAssociationOptionalParams): Promise, CommitmentPlansCreateOrUpdateAssociationResponse>>; + beginCreateOrUpdateAssociation(resourceGroupName: string, commitmentPlanName: string, commitmentPlanAssociationName: string, association: CommitmentPlanAccountAssociation, options?: CommitmentPlansCreateOrUpdateAssociationOptionalParams): Promise, CommitmentPlansCreateOrUpdateAssociationResponse>>; beginCreateOrUpdateAssociationAndWait(resourceGroupName: string, commitmentPlanName: string, commitmentPlanAssociationName: string, association: CommitmentPlanAccountAssociation, options?: CommitmentPlansCreateOrUpdateAssociationOptionalParams): Promise; - beginCreateOrUpdatePlan(resourceGroupName: string, commitmentPlanName: string, commitmentPlan: CommitmentPlan, options?: CommitmentPlansCreateOrUpdatePlanOptionalParams): Promise, CommitmentPlansCreateOrUpdatePlanResponse>>; + beginCreateOrUpdatePlan(resourceGroupName: string, commitmentPlanName: string, commitmentPlan: CommitmentPlan, options?: CommitmentPlansCreateOrUpdatePlanOptionalParams): Promise, CommitmentPlansCreateOrUpdatePlanResponse>>; beginCreateOrUpdatePlanAndWait(resourceGroupName: string, commitmentPlanName: string, commitmentPlan: CommitmentPlan, options?: CommitmentPlansCreateOrUpdatePlanOptionalParams): Promise; - beginDelete(resourceGroupName: string, accountName: string, commitmentPlanName: string, options?: CommitmentPlansDeleteOptionalParams): Promise, void>>; + beginDelete(resourceGroupName: string, accountName: string, commitmentPlanName: string, options?: CommitmentPlansDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, accountName: string, commitmentPlanName: string, options?: CommitmentPlansDeleteOptionalParams): Promise; - beginDeleteAssociation(resourceGroupName: string, commitmentPlanName: string, commitmentPlanAssociationName: string, options?: CommitmentPlansDeleteAssociationOptionalParams): Promise, void>>; + beginDeleteAssociation(resourceGroupName: string, commitmentPlanName: string, commitmentPlanAssociationName: string, options?: CommitmentPlansDeleteAssociationOptionalParams): Promise, void>>; beginDeleteAssociationAndWait(resourceGroupName: string, commitmentPlanName: string, commitmentPlanAssociationName: string, options?: CommitmentPlansDeleteAssociationOptionalParams): Promise; - beginDeletePlan(resourceGroupName: string, commitmentPlanName: string, options?: CommitmentPlansDeletePlanOptionalParams): Promise, void>>; + beginDeletePlan(resourceGroupName: string, commitmentPlanName: string, options?: CommitmentPlansDeletePlanOptionalParams): Promise, void>>; beginDeletePlanAndWait(resourceGroupName: string, commitmentPlanName: string, options?: CommitmentPlansDeletePlanOptionalParams): Promise; - beginUpdatePlan(resourceGroupName: string, commitmentPlanName: string, commitmentPlan: PatchResourceTagsAndSku, options?: CommitmentPlansUpdatePlanOptionalParams): Promise, CommitmentPlansUpdatePlanResponse>>; + beginUpdatePlan(resourceGroupName: string, commitmentPlanName: string, commitmentPlan: PatchResourceTagsAndSku, options?: CommitmentPlansUpdatePlanOptionalParams): Promise, CommitmentPlansUpdatePlanResponse>>; beginUpdatePlanAndWait(resourceGroupName: string, commitmentPlanName: string, commitmentPlan: PatchResourceTagsAndSku, options?: CommitmentPlansUpdatePlanOptionalParams): Promise; createOrUpdate(resourceGroupName: string, accountName: string, commitmentPlanName: string, commitmentPlan: CommitmentPlan, options?: CommitmentPlansCreateOrUpdateOptionalParams): Promise; get(resourceGroupName: string, accountName: string, commitmentPlanName: string, options?: CommitmentPlansGetOptionalParams): Promise; @@ -609,7 +635,7 @@ export type CreatedByType = string; // @public export interface DeletedAccounts { - beginPurge(location: string, resourceGroupName: string, accountName: string, options?: DeletedAccountsPurgeOptionalParams): Promise, void>>; + beginPurge(location: string, resourceGroupName: string, accountName: string, options?: DeletedAccountsPurgeOptionalParams): Promise, void>>; beginPurgeAndWait(location: string, resourceGroupName: string, accountName: string, options?: DeletedAccountsPurgeOptionalParams): Promise; get(location: string, resourceGroupName: string, accountName: string, options?: DeletedAccountsGetOptionalParams): Promise; list(options?: DeletedAccountsListOptionalParams): PagedAsyncIterableIterator; @@ -646,6 +672,7 @@ export interface DeletedAccountsPurgeOptionalParams extends coreClient.Operation export interface Deployment extends ProxyResource { readonly etag?: string; properties?: DeploymentProperties; + sku?: Sku; readonly systemData?: SystemData; } @@ -660,9 +687,13 @@ export interface DeploymentModel { readonly callRateLimit?: CallRateLimit; format?: string; name?: string; + source?: string; version?: string; } +// @public +export type DeploymentModelVersionUpgradeOption = string; + // @public export interface DeploymentProperties { readonly callRateLimit?: CallRateLimit; @@ -672,7 +703,9 @@ export interface DeploymentProperties { model?: DeploymentModel; readonly provisioningState?: DeploymentProvisioningState; raiPolicyName?: string; + readonly rateLimits?: ThrottlingRule[]; scaleSettings?: DeploymentScaleSettings; + versionUpgradeOption?: DeploymentModelVersionUpgradeOption; } // @public @@ -680,9 +713,9 @@ export type DeploymentProvisioningState = string; // @public export interface Deployments { - beginCreateOrUpdate(resourceGroupName: string, accountName: string, deploymentName: string, deployment: Deployment, options?: DeploymentsCreateOrUpdateOptionalParams): Promise, DeploymentsCreateOrUpdateResponse>>; + beginCreateOrUpdate(resourceGroupName: string, accountName: string, deploymentName: string, deployment: Deployment, options?: DeploymentsCreateOrUpdateOptionalParams): Promise, DeploymentsCreateOrUpdateResponse>>; beginCreateOrUpdateAndWait(resourceGroupName: string, accountName: string, deploymentName: string, deployment: Deployment, options?: DeploymentsCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, accountName: string, deploymentName: string, options?: DeploymentsDeleteOptionalParams): Promise, void>>; + beginDelete(resourceGroupName: string, accountName: string, deploymentName: string, options?: DeploymentsDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, accountName: string, deploymentName: string, options?: DeploymentsDeleteOptionalParams): Promise; get(resourceGroupName: string, accountName: string, deploymentName: string, options?: DeploymentsGetOptionalParams): Promise; list(resourceGroupName: string, accountName: string, options?: DeploymentsListOptionalParams): PagedAsyncIterableIterator; @@ -805,6 +838,12 @@ export interface KeyVaultProperties { keyVersion?: string; } +// @public +export enum KnownAbusePenaltyAction { + Block = "Block", + Throttle = "Throttle" +} + // @public export enum KnownActionType { Internal = "Internal" @@ -829,11 +868,20 @@ export enum KnownCreatedByType { User = "User" } +// @public +export enum KnownDeploymentModelVersionUpgradeOption { + NoAutoUpgrade = "NoAutoUpgrade", + OnceCurrentVersionExpired = "OnceCurrentVersionExpired", + OnceNewDefaultVersionAvailable = "OnceNewDefaultVersionAvailable" +} + // @public export enum KnownDeploymentProvisioningState { Accepted = "Accepted", + Canceled = "Canceled", Creating = "Creating", Deleting = "Deleting", + Disabled = "Disabled", Failed = "Failed", Moving = "Moving", Succeeded = "Succeeded" @@ -849,6 +897,7 @@ export enum KnownDeploymentScaleType { export enum KnownHostingModel { ConnectedContainer = "ConnectedContainer", DisconnectedContainer = "DisconnectedContainer", + ProvisionedWeb = "ProvisionedWeb", Web = "Web" } @@ -956,6 +1005,13 @@ export interface MetricName { value?: string; } +// @public +export interface Model { + kind?: string; + model?: AccountModel; + skuName?: string; +} + // @public export interface ModelDeprecationInfo { fineTune?: string; @@ -965,6 +1021,40 @@ export interface ModelDeprecationInfo { // @public export type ModelLifecycleStatus = string; +// @public +export interface ModelListResult { + nextLink?: string; + value?: Model[]; +} + +// @public +export interface Models { + list(location: string, options?: ModelsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ModelSku { + capacity?: CapacityConfig; + deprecationDate?: Date; + name?: string; + rateLimits?: CallRateLimit[]; + usageName?: string; +} + +// @public +export interface ModelsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ModelsListNextResponse = ModelListResult; + +// @public +export interface ModelsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ModelsListResponse = ModelListResult; + // @public export interface MultiRegionSettings { // (undocumented) @@ -1069,9 +1159,9 @@ export type PrivateEndpointConnectionProvisioningState = string; // @public export interface PrivateEndpointConnections { - beginCreateOrUpdate(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, properties: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams): Promise, PrivateEndpointConnectionsCreateOrUpdateResponse>>; + beginCreateOrUpdate(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, properties: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams): Promise, PrivateEndpointConnectionsCreateOrUpdateResponse>>; beginCreateOrUpdateAndWait(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, properties: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise, void>>; + beginDelete(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise; get(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise; list(resourceGroupName: string, accountName: string, options?: PrivateEndpointConnectionsListOptionalParams): Promise; @@ -1339,9 +1429,30 @@ export interface Usage { // @public export interface UsageListResult { + nextLink?: string; value?: Usage[]; } +// @public +export interface Usages { + list(location: string, options?: UsagesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface UsagesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type UsagesListNextResponse = UsageListResult; + +// @public +export interface UsagesListOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type UsagesListResponse = UsageListResult; + // @public export interface UserAssignedIdentity { readonly clientId?: string; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/cognitiveServicesManagementClient.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/cognitiveServicesManagementClient.ts index e1c4b10d9299..23eae2c48e37 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/cognitiveServicesManagementClient.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/cognitiveServicesManagementClient.ts @@ -18,8 +18,10 @@ import { AccountsImpl, DeletedAccountsImpl, ResourceSkusImpl, + UsagesImpl, OperationsImpl, CommitmentTiersImpl, + ModelsImpl, PrivateEndpointConnectionsImpl, PrivateLinkResourcesImpl, DeploymentsImpl, @@ -29,8 +31,10 @@ import { Accounts, DeletedAccounts, ResourceSkus, + Usages, Operations, CommitmentTiers, + Models, PrivateEndpointConnections, PrivateLinkResources, Deployments, @@ -78,7 +82,7 @@ export class CognitiveServicesManagementClient extends coreClient.ServiceClient credential: credentials }; - const packageDetails = `azsdk-js-arm-cognitiveservices/7.4.1`; + const packageDetails = `azsdk-js-arm-cognitiveservices/7.5.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -131,12 +135,14 @@ export class CognitiveServicesManagementClient extends coreClient.ServiceClient // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-12-01"; + this.apiVersion = options.apiVersion || "2023-05-01"; this.accounts = new AccountsImpl(this); this.deletedAccounts = new DeletedAccountsImpl(this); this.resourceSkus = new ResourceSkusImpl(this); + this.usages = new UsagesImpl(this); this.operations = new OperationsImpl(this); this.commitmentTiers = new CommitmentTiersImpl(this); + this.models = new ModelsImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); this.privateLinkResources = new PrivateLinkResourcesImpl(this); this.deployments = new DeploymentsImpl(this); @@ -213,8 +219,10 @@ export class CognitiveServicesManagementClient extends coreClient.ServiceClient accounts: Accounts; deletedAccounts: DeletedAccounts; resourceSkus: ResourceSkus; + usages: Usages; operations: Operations; commitmentTiers: CommitmentTiers; + models: Models; privateEndpointConnections: PrivateEndpointConnections; privateLinkResources: PrivateLinkResources; deployments: Deployments; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/lroImpl.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/lroImpl.ts index 518d5f053b4e..dd803cd5e28c 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/lroImpl.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/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/cognitiveservices/arm-cognitiveservices/src/models/index.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/models/index.ts index 2a771ba51ab2..921b436e4740 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/models/index.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/models/index.ts @@ -161,6 +161,11 @@ export interface AccountProperties { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly commitmentPlanAssociations?: CommitmentPlanAssociation[]; + /** + * The abuse penalty. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly abusePenalty?: AbusePenalty; } /** SkuCapability indicates the capability of a certain feature. */ @@ -366,6 +371,16 @@ export interface CommitmentPlanAssociation { commitmentPlanLocation?: string; } +/** The abuse penalty. */ +export interface AbusePenalty { + /** The action of AbusePenalty. */ + action?: AbusePenaltyAction; + /** The percentage of rate limit. */ + rateLimitPercentage?: number; + /** The datetime of expiration of the AbusePenalty. */ + expiration?: Date; +} + /** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ export interface ErrorResponse { /** The error object. */ @@ -499,6 +514,8 @@ export interface AccountSku { /** The response to a list usage request. */ export interface UsageListResult { + /** The link used to get the next page of Usages. */ + nextLink?: string; /** The list of usages for Cognitive Service account. */ value?: Usage[]; } @@ -543,8 +560,10 @@ export interface DeploymentModel { format?: string; /** Deployment model name. */ name?: string; - /** Deployment model version. */ + /** Optional. Deployment model version. If version is not specified, a default version will be assigned. The default version is different for different models and might change when there is new version available for a model. Default version for a model could be found from list models API. */ version?: string; + /** Optional. Deployment model source ARM resource ID. */ + source?: string; /** * The call rate limit Cognitive Services account. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -552,6 +571,32 @@ export interface DeploymentModel { readonly callRateLimit?: CallRateLimit; } +/** Describes an available Cognitive Services Model SKU. */ +export interface ModelSku { + /** The name of the model SKU. */ + name?: string; + /** The usage name of the model SKU. */ + usageName?: string; + /** The datetime of deprecation of the model SKU. */ + deprecationDate?: Date; + /** The capacity configuration. */ + capacity?: CapacityConfig; + /** The list of rateLimit. */ + rateLimits?: CallRateLimit[]; +} + +/** The capacity configuration. */ +export interface CapacityConfig { + /** The minimum capacity. */ + minimum?: number; + /** The maximum capacity. */ + maximum?: number; + /** The minimal incremental between allowed values for capacity. */ + step?: number; + /** The default capacity. */ + default?: number; +} + /** Cognitive Services account ModelDeprecationInfo. */ export interface ModelDeprecationInfo { /** The datetime of deprecation of the fineTune Model. */ @@ -703,6 +748,24 @@ export interface CommitmentCost { overageMeterId?: string; } +/** The list of cognitive services models. */ +export interface ModelListResult { + /** The link used to get the next page of Model. */ + nextLink?: string; + /** Gets the list of Cognitive Services accounts Model and their properties. */ + value?: Model[]; +} + +/** Cognitive Services Model. */ +export interface Model { + /** Model Metadata. */ + model?: AccountModel; + /** The Kind of the Model. */ + kind?: string; + /** The SKU of the Model. */ + skuName?: string; +} + /** Check Domain availability parameter. */ export interface CheckDomainAvailabilityParameter { /** The subdomain name to use. */ @@ -794,6 +857,10 @@ export interface DeploymentProperties { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly callRateLimit?: CallRateLimit; + /** NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly rateLimits?: ThrottlingRule[]; + /** Deployment model version upgrade option. */ + versionUpgradeOption?: DeploymentModelVersionUpgradeOption; } /** Properties of Cognitive Services account deployment model. */ @@ -844,6 +911,11 @@ export interface CommitmentPlanProperties { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly last?: CommitmentPeriod; + /** + * The list of ProvisioningIssue. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningIssues?: string[]; } /** Cognitive Services account commitment period. */ @@ -908,6 +980,10 @@ export interface ProxyResource extends Resource {} export interface AccountModel extends DeploymentModel { /** Base Model Identifier. */ baseModel?: DeploymentModel; + /** If the model is default version. */ + isDefaultVersion?: boolean; + /** The list of Model Sku. */ + skus?: ModelSku[]; /** The max capacity. */ maxCapacity?: number; /** The capabilities. */ @@ -967,6 +1043,8 @@ export interface Account extends AzureEntityResource { /** Cognitive Services account deployment. */ export interface Deployment extends ProxyResource { + /** The resource model definition representing SKU */ + sku?: Sku; /** * Metadata pertaining to creation and last modification of the resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1240,6 +1318,24 @@ export enum KnownRoutingMethods { */ export type RoutingMethods = string; +/** Known values of {@link AbusePenaltyAction} that the service accepts. */ +export enum KnownAbusePenaltyAction { + /** Throttle */ + Throttle = "Throttle", + /** Block */ + Block = "Block" +} + +/** + * Defines values for AbusePenaltyAction. \ + * {@link KnownAbusePenaltyAction} can be used interchangeably with AbusePenaltyAction, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Throttle** \ + * **Block** + */ +export type AbusePenaltyAction = string; + /** Known values of {@link ResourceSkuRestrictionsReasonCode} that the service accepts. */ export enum KnownResourceSkuRestrictionsReasonCode { /** QuotaId */ @@ -1376,7 +1472,9 @@ export enum KnownHostingModel { /** ConnectedContainer */ ConnectedContainer = "ConnectedContainer", /** DisconnectedContainer */ - DisconnectedContainer = "DisconnectedContainer" + DisconnectedContainer = "DisconnectedContainer", + /** ProvisionedWeb */ + ProvisionedWeb = "ProvisionedWeb" } /** @@ -1386,7 +1484,8 @@ export enum KnownHostingModel { * ### Known values supported by the service * **Web** \ * **ConnectedContainer** \ - * **DisconnectedContainer** + * **DisconnectedContainer** \ + * **ProvisionedWeb** */ export type HostingModel = string; @@ -1403,7 +1502,11 @@ export enum KnownDeploymentProvisioningState { /** Failed */ Failed = "Failed", /** Succeeded */ - Succeeded = "Succeeded" + Succeeded = "Succeeded", + /** Disabled */ + Disabled = "Disabled", + /** Canceled */ + Canceled = "Canceled" } /** @@ -1416,7 +1519,9 @@ export enum KnownDeploymentProvisioningState { * **Deleting** \ * **Moving** \ * **Failed** \ - * **Succeeded** + * **Succeeded** \ + * **Disabled** \ + * **Canceled** */ export type DeploymentProvisioningState = string; @@ -1438,6 +1543,27 @@ export enum KnownDeploymentScaleType { */ export type DeploymentScaleType = string; +/** Known values of {@link DeploymentModelVersionUpgradeOption} that the service accepts. */ +export enum KnownDeploymentModelVersionUpgradeOption { + /** OnceNewDefaultVersionAvailable */ + OnceNewDefaultVersionAvailable = "OnceNewDefaultVersionAvailable", + /** OnceCurrentVersionExpired */ + OnceCurrentVersionExpired = "OnceCurrentVersionExpired", + /** NoAutoUpgrade */ + NoAutoUpgrade = "NoAutoUpgrade" +} + +/** + * Defines values for DeploymentModelVersionUpgradeOption. \ + * {@link KnownDeploymentModelVersionUpgradeOption} can be used interchangeably with DeploymentModelVersionUpgradeOption, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **OnceNewDefaultVersionAvailable** \ + * **OnceCurrentVersionExpired** \ + * **NoAutoUpgrade** + */ +export type DeploymentModelVersionUpgradeOption = string; + /** Known values of {@link CommitmentPlanProvisioningState} that the service accepts. */ export enum KnownCommitmentPlanProvisioningState { /** Accepted */ @@ -1638,6 +1764,22 @@ export interface ResourceSkusListNextOptionalParams /** Contains response data for the listNext operation. */ export type ResourceSkusListNextResponse = ResourceSkuListResult; +/** Optional parameters. */ +export interface UsagesListOptionalParams extends coreClient.OperationOptions { + /** An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). */ + filter?: string; +} + +/** Contains response data for the list operation. */ +export type UsagesListResponse = UsageListResult; + +/** Optional parameters. */ +export interface UsagesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type UsagesListNextResponse = UsageListResult; + /** Optional parameters. */ export interface OperationsListOptionalParams extends coreClient.OperationOptions {} @@ -1683,6 +1825,19 @@ export interface CommitmentTiersListNextOptionalParams /** Contains response data for the listNext operation. */ export type CommitmentTiersListNextResponse = CommitmentTierListResult; +/** Optional parameters. */ +export interface ModelsListOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type ModelsListResponse = ModelListResult; + +/** Optional parameters. */ +export interface ModelsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type ModelsListNextResponse = ModelListResult; + /** Optional parameters. */ export interface PrivateEndpointConnectionsListOptionalParams extends coreClient.OperationOptions {} diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/models/mappers.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/models/mappers.ts index 9050f103f755..41f0f5a2cf72 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/models/mappers.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/models/mappers.ts @@ -374,6 +374,13 @@ export const AccountProperties: coreClient.CompositeMapper = { } } } + }, + abusePenalty: { + serializedName: "abusePenalty", + type: { + name: "Composite", + className: "AbusePenalty" + } } } } @@ -1008,6 +1015,33 @@ export const CommitmentPlanAssociation: coreClient.CompositeMapper = { } }; +export const AbusePenalty: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AbusePenalty", + modelProperties: { + action: { + serializedName: "action", + type: { + name: "String" + } + }, + rateLimitPercentage: { + serializedName: "rateLimitPercentage", + type: { + name: "Number" + } + }, + expiration: { + serializedName: "expiration", + type: { + name: "DateTime" + } + } + } + } +}; + export const ErrorResponse: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1373,6 +1407,12 @@ export const UsageListResult: coreClient.CompositeMapper = { name: "Composite", className: "UsageListResult", modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, value: { serializedName: "value", type: { @@ -1512,6 +1552,12 @@ export const DeploymentModel: coreClient.CompositeMapper = { name: "String" } }, + source: { + serializedName: "source", + type: { + name: "String" + } + }, callRateLimit: { serializedName: "callRateLimit", type: { @@ -1523,6 +1569,85 @@ export const DeploymentModel: coreClient.CompositeMapper = { } }; +export const ModelSku: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ModelSku", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + usageName: { + serializedName: "usageName", + type: { + name: "String" + } + }, + deprecationDate: { + serializedName: "deprecationDate", + type: { + name: "DateTime" + } + }, + capacity: { + serializedName: "capacity", + type: { + name: "Composite", + className: "CapacityConfig" + } + }, + rateLimits: { + serializedName: "rateLimits", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CallRateLimit" + } + } + } + } + } + } +}; + +export const CapacityConfig: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CapacityConfig", + modelProperties: { + minimum: { + serializedName: "minimum", + type: { + name: "Number" + } + }, + maximum: { + serializedName: "maximum", + type: { + name: "Number" + } + }, + step: { + serializedName: "step", + type: { + name: "Number" + } + }, + default: { + serializedName: "default", + type: { + name: "Number" + } + } + } + } +}; + export const ModelDeprecationInfo: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1884,6 +2009,61 @@ export const CommitmentCost: coreClient.CompositeMapper = { } }; +export const ModelListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ModelListResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Model" + } + } + } + } + } + } +}; + +export const Model: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Model", + modelProperties: { + model: { + serializedName: "model", + type: { + name: "Composite", + className: "AccountModel" + } + }, + kind: { + serializedName: "kind", + type: { + name: "String" + } + }, + skuName: { + serializedName: "skuName", + type: { + name: "String" + } + } + } + } +}; + export const CheckDomainAvailabilityParameter: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2114,6 +2294,25 @@ export const DeploymentProperties: coreClient.CompositeMapper = { name: "Composite", className: "CallRateLimit" } + }, + rateLimits: { + serializedName: "rateLimits", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ThrottlingRule" + } + } + } + }, + versionUpgradeOption: { + serializedName: "versionUpgradeOption", + type: { + name: "String" + } } } } @@ -2231,6 +2430,18 @@ export const CommitmentPlanProperties: coreClient.CompositeMapper = { name: "Composite", className: "CommitmentPeriod" } + }, + provisioningIssues: { + serializedName: "provisioningIssues", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } } } } @@ -2379,6 +2590,24 @@ export const AccountModel: coreClient.CompositeMapper = { className: "DeploymentModel" } }, + isDefaultVersion: { + serializedName: "isDefaultVersion", + type: { + name: "Boolean" + } + }, + skus: { + serializedName: "skus", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ModelSku" + } + } + } + }, maxCapacity: { serializedName: "maxCapacity", type: { @@ -2533,6 +2762,13 @@ export const Deployment: coreClient.CompositeMapper = { className: "Deployment", modelProperties: { ...ProxyResource.type.modelProperties, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku" + } + }, systemData: { serializedName: "systemData", type: { diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/models/parameters.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/models/parameters.ts index 9fbcf58fd1c6..00b143d9d26d 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/models/parameters.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/models/parameters.ts @@ -98,7 +98,7 @@ export const accountName: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-12-01", + defaultValue: "2023-05-01", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/accounts.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/accounts.ts index d53c4ad2c27e..3aea87fd2ba7 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/accounts.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/accounts.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 { CognitiveServicesManagementClient } from "../cognitiveServicesManagementClient"; -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 { Account, AccountsListByResourceGroupNextOptionalParams, @@ -278,8 +282,8 @@ export class AccountsImpl implements Accounts { account: Account, options?: AccountsCreateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, AccountsCreateResponse > > { @@ -289,7 +293,7 @@ export class AccountsImpl implements Accounts { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -322,13 +326,16 @@ export class AccountsImpl implements Accounts { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, accountName, account, options }, - createOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, account, options }, + spec: createOperationSpec + }); + const poller = await createHttpPoller< + AccountsCreateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); @@ -371,8 +378,8 @@ export class AccountsImpl implements Accounts { account: Account, options?: AccountsUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, AccountsUpdateResponse > > { @@ -382,7 +389,7 @@ export class AccountsImpl implements Accounts { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -415,13 +422,16 @@ export class AccountsImpl implements Accounts { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, accountName, account, options }, - updateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, account, options }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + AccountsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); @@ -460,14 +470,14 @@ export class AccountsImpl implements Accounts { resourceGroupName: string, accountName: string, options?: AccountsDeleteOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -500,13 +510,13 @@ export class AccountsImpl implements Accounts { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, accountName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/commitmentPlans.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/commitmentPlans.ts index 2030a347fdb9..b7af0d95fc75 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/commitmentPlans.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/commitmentPlans.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 { CognitiveServicesManagementClient } from "../cognitiveServicesManagementClient"; -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 { CommitmentPlan, CommitmentPlansListNextOptionalParams, @@ -435,14 +439,14 @@ export class CommitmentPlansImpl implements CommitmentPlans { accountName: string, commitmentPlanName: string, options?: CommitmentPlansDeleteOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -475,13 +479,13 @@ export class CommitmentPlansImpl implements CommitmentPlans { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, accountName, commitmentPlanName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, commitmentPlanName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); @@ -525,8 +529,8 @@ export class CommitmentPlansImpl implements CommitmentPlans { commitmentPlan: CommitmentPlan, options?: CommitmentPlansCreateOrUpdatePlanOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, CommitmentPlansCreateOrUpdatePlanResponse > > { @@ -536,7 +540,7 @@ export class CommitmentPlansImpl implements CommitmentPlans { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -569,15 +573,18 @@ export class CommitmentPlansImpl implements CommitmentPlans { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, commitmentPlanName, commitmentPlan, options }, - createOrUpdatePlanOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, commitmentPlanName, commitmentPlan, options }, + spec: createOrUpdatePlanOperationSpec + }); + const poller = await createHttpPoller< + CommitmentPlansCreateOrUpdatePlanResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -620,8 +627,8 @@ export class CommitmentPlansImpl implements CommitmentPlans { commitmentPlan: PatchResourceTagsAndSku, options?: CommitmentPlansUpdatePlanOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, CommitmentPlansUpdatePlanResponse > > { @@ -631,7 +638,7 @@ export class CommitmentPlansImpl implements CommitmentPlans { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -664,15 +671,18 @@ export class CommitmentPlansImpl implements CommitmentPlans { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, commitmentPlanName, commitmentPlan, options }, - updatePlanOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, commitmentPlanName, commitmentPlan, options }, + spec: updatePlanOperationSpec + }); + const poller = await createHttpPoller< + CommitmentPlansUpdatePlanResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" + resourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -712,14 +722,14 @@ export class CommitmentPlansImpl implements CommitmentPlans { resourceGroupName: string, commitmentPlanName: string, options?: CommitmentPlansDeletePlanOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -752,15 +762,15 @@ export class CommitmentPlansImpl implements CommitmentPlans { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, commitmentPlanName, options }, - deletePlanOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, commitmentPlanName, options }, + spec: deletePlanOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" + resourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -893,8 +903,8 @@ export class CommitmentPlansImpl implements CommitmentPlans { association: CommitmentPlanAccountAssociation, options?: CommitmentPlansCreateOrUpdateAssociationOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, CommitmentPlansCreateOrUpdateAssociationResponse > > { @@ -904,7 +914,7 @@ export class CommitmentPlansImpl implements CommitmentPlans { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -937,21 +947,24 @@ export class CommitmentPlansImpl implements CommitmentPlans { }; }; - const lro = new LroImpl( - sendOperation, - { + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, association, options }, - createOrUpdateAssociationOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + spec: createOrUpdateAssociationOperationSpec + }); + const poller = await createHttpPoller< + CommitmentPlansCreateOrUpdateAssociationResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -998,14 +1011,14 @@ export class CommitmentPlansImpl implements CommitmentPlans { commitmentPlanName: string, commitmentPlanAssociationName: string, options?: CommitmentPlansDeleteAssociationOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -1038,20 +1051,20 @@ export class CommitmentPlansImpl implements CommitmentPlans { }; }; - const lro = new LroImpl( - sendOperation, - { + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, options }, - deleteAssociationOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + spec: deleteAssociationOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" + resourceLocationConfig: "location" }); await poller.poll(); return poller; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/deletedAccounts.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/deletedAccounts.ts index 91f7022d2db9..2860c81ddbc0 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/deletedAccounts.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/deletedAccounts.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 { CognitiveServicesManagementClient } from "../cognitiveServicesManagementClient"; -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 { Account, DeletedAccountsListNextOptionalParams, @@ -124,14 +128,14 @@ export class DeletedAccountsImpl implements DeletedAccounts { resourceGroupName: string, accountName: string, options?: DeletedAccountsPurgeOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -164,13 +168,13 @@ export class DeletedAccountsImpl implements DeletedAccounts { }; }; - const lro = new LroImpl( - sendOperation, - { location, resourceGroupName, accountName, options }, - purgeOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { location, resourceGroupName, accountName, options }, + spec: purgeOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/deployments.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/deployments.ts index d64ffdbd1b66..a825c082e106 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/deployments.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/deployments.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 { CognitiveServicesManagementClient } from "../cognitiveServicesManagementClient"; -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 { Deployment, DeploymentsListNextOptionalParams, @@ -168,8 +172,8 @@ export class DeploymentsImpl implements Deployments { deployment: Deployment, options?: DeploymentsCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, DeploymentsCreateOrUpdateResponse > > { @@ -179,7 +183,7 @@ export class DeploymentsImpl implements Deployments { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -212,14 +216,24 @@ export class DeploymentsImpl implements Deployments { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, accountName, deploymentName, deployment, options }, - createOrUpdateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + accountName, + deploymentName, + deployment, + options + }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + DeploymentsCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -262,14 +276,14 @@ export class DeploymentsImpl implements Deployments { accountName: string, deploymentName: string, options?: DeploymentsDeleteOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -302,13 +316,13 @@ export class DeploymentsImpl implements Deployments { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, accountName, deploymentName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, deploymentName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/index.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/index.ts index 36be2f74afb3..c3aa6d8c5dcd 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/index.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/index.ts @@ -9,8 +9,10 @@ export * from "./accounts"; export * from "./deletedAccounts"; export * from "./resourceSkus"; +export * from "./usages"; export * from "./operations"; export * from "./commitmentTiers"; +export * from "./models"; export * from "./privateEndpointConnections"; export * from "./privateLinkResources"; export * from "./deployments"; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/models.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/models.ts new file mode 100644 index 000000000000..77aef58beeb4 --- /dev/null +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/models.ts @@ -0,0 +1,170 @@ +/* + * 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 { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Models } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { CognitiveServicesManagementClient } from "../cognitiveServicesManagementClient"; +import { + Model, + ModelsListNextOptionalParams, + ModelsListOptionalParams, + ModelsListResponse, + ModelsListNextResponse +} from "../models"; + +/// +/** Class containing Models operations. */ +export class ModelsImpl implements Models { + private readonly client: CognitiveServicesManagementClient; + + /** + * Initialize a new instance of the class Models class. + * @param client Reference to the service client + */ + constructor(client: CognitiveServicesManagementClient) { + this.client = client; + } + + /** + * List Models. + * @param location Resource location. + * @param options The options parameters. + */ + public list( + location: string, + options?: ModelsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(location, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(location, options, settings); + } + }; + } + + private async *listPagingPage( + location: string, + options?: ModelsListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: ModelsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(location, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(location, continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + location: string, + options?: ModelsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(location, options)) { + yield* page; + } + } + + /** + * List Models. + * @param location Resource location. + * @param options The options parameters. + */ + private _list( + location: string, + options?: ModelsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { location, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param location Resource location. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + location: string, + nextLink: string, + options?: ModelsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { location, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/models", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ModelListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.location + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ModelListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.location + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/privateEndpointConnections.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/privateEndpointConnections.ts index 04c0df21aa39..759419bef9c8 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/privateEndpointConnections.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/privateEndpointConnections.ts @@ -11,8 +11,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { CognitiveServicesManagementClient } from "../cognitiveServicesManagementClient"; -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 { PrivateEndpointConnectionsListOptionalParams, PrivateEndpointConnectionsListResponse, @@ -96,8 +100,8 @@ export class PrivateEndpointConnectionsImpl properties: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, PrivateEndpointConnectionsCreateOrUpdateResponse > > { @@ -107,7 +111,7 @@ export class PrivateEndpointConnectionsImpl ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -140,19 +144,22 @@ export class PrivateEndpointConnectionsImpl }; }; - const lro = new LroImpl( - sendOperation, - { + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, privateEndpointConnectionName, properties, options }, - createOrUpdateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + PrivateEndpointConnectionsCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); @@ -199,14 +206,14 @@ export class PrivateEndpointConnectionsImpl accountName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -239,18 +246,18 @@ export class PrivateEndpointConnectionsImpl }; }; - const lro = new LroImpl( - sendOperation, - { + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, privateEndpointConnectionName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/usages.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/usages.ts new file mode 100644 index 000000000000..ec10148fc5ef --- /dev/null +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/usages.ts @@ -0,0 +1,170 @@ +/* + * 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 { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Usages } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { CognitiveServicesManagementClient } from "../cognitiveServicesManagementClient"; +import { + Usage, + UsagesListNextOptionalParams, + UsagesListOptionalParams, + UsagesListResponse, + UsagesListNextResponse +} from "../models"; + +/// +/** Class containing Usages operations. */ +export class UsagesImpl implements Usages { + private readonly client: CognitiveServicesManagementClient; + + /** + * Initialize a new instance of the class Usages class. + * @param client Reference to the service client + */ + constructor(client: CognitiveServicesManagementClient) { + this.client = client; + } + + /** + * Get usages for the requested subscription + * @param location Resource location. + * @param options The options parameters. + */ + public list( + location: string, + options?: UsagesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(location, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(location, options, settings); + } + }; + } + + private async *listPagingPage( + location: string, + options?: UsagesListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: UsagesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(location, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(location, continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + location: string, + options?: UsagesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(location, options)) { + yield* page; + } + } + + /** + * Get usages for the requested subscription + * @param location Resource location. + * @param options The options parameters. + */ + private _list( + location: string, + options?: UsagesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { location, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param location Resource location. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + location: string, + nextLink: string, + options?: UsagesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { location, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/usages", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.UsageListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.location + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.UsageListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.location + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/accounts.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/accounts.ts index e3d3ec126c21..cc8efb0dd054 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/accounts.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/accounts.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 { Account, AccountsListByResourceGroupOptionalParams, @@ -76,8 +76,8 @@ export interface Accounts { account: Account, options?: AccountsCreateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, AccountsCreateResponse > >; @@ -108,8 +108,8 @@ export interface Accounts { account: Account, options?: AccountsUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, AccountsUpdateResponse > >; @@ -136,7 +136,7 @@ export interface Accounts { resourceGroupName: string, accountName: string, options?: AccountsDeleteOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Deletes a Cognitive Services account from the resource group. * @param resourceGroupName The name of the resource group. The name is case insensitive. diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/commitmentPlans.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/commitmentPlans.ts index a90a96fad841..89fe161fd982 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/commitmentPlans.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/commitmentPlans.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 { CommitmentPlan, CommitmentPlansListOptionalParams, @@ -120,7 +120,7 @@ export interface CommitmentPlans { accountName: string, commitmentPlanName: string, options?: CommitmentPlansDeleteOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Deletes the specified commitmentPlan associated with the Cognitive Services account. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -149,8 +149,8 @@ export interface CommitmentPlans { commitmentPlan: CommitmentPlan, options?: CommitmentPlansCreateOrUpdatePlanOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, CommitmentPlansCreateOrUpdatePlanResponse > >; @@ -182,8 +182,8 @@ export interface CommitmentPlans { commitmentPlan: PatchResourceTagsAndSku, options?: CommitmentPlansUpdatePlanOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, CommitmentPlansUpdatePlanResponse > >; @@ -212,7 +212,7 @@ export interface CommitmentPlans { resourceGroupName: string, commitmentPlanName: string, options?: CommitmentPlansDeletePlanOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Deletes a Cognitive Services commitment plan from the resource group. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -269,8 +269,8 @@ export interface CommitmentPlans { association: CommitmentPlanAccountAssociation, options?: CommitmentPlansCreateOrUpdateAssociationOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, CommitmentPlansCreateOrUpdateAssociationResponse > >; @@ -305,7 +305,7 @@ export interface CommitmentPlans { commitmentPlanName: string, commitmentPlanAssociationName: string, options?: CommitmentPlansDeleteAssociationOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Deletes the association of the Cognitive Services commitment plan. * @param resourceGroupName The name of the resource group. The name is case insensitive. diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/deletedAccounts.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/deletedAccounts.ts index 2ee8166d2368..734a023282a6 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/deletedAccounts.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/deletedAccounts.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 { Account, DeletedAccountsListOptionalParams, @@ -51,7 +51,7 @@ export interface DeletedAccounts { resourceGroupName: string, accountName: string, options?: DeletedAccountsPurgeOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Deletes a Cognitive Services account from the resource group. * @param location Resource location. diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/deployments.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/deployments.ts index 1ebb39331a99..a5aaae0be728 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/deployments.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/deployments.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 { Deployment, DeploymentsListOptionalParams, @@ -60,8 +60,8 @@ export interface Deployments { deployment: Deployment, options?: DeploymentsCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, DeploymentsCreateOrUpdateResponse > >; @@ -92,7 +92,7 @@ export interface Deployments { accountName: string, deploymentName: string, options?: DeploymentsDeleteOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Deletes the specified deployment associated with the Cognitive Services account. * @param resourceGroupName The name of the resource group. The name is case insensitive. diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/index.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/index.ts index 36be2f74afb3..c3aa6d8c5dcd 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/index.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/index.ts @@ -9,8 +9,10 @@ export * from "./accounts"; export * from "./deletedAccounts"; export * from "./resourceSkus"; +export * from "./usages"; export * from "./operations"; export * from "./commitmentTiers"; +export * from "./models"; export * from "./privateEndpointConnections"; export * from "./privateLinkResources"; export * from "./deployments"; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/models.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/models.ts new file mode 100644 index 000000000000..8d877f373b01 --- /dev/null +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/models.ts @@ -0,0 +1,24 @@ +/* + * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Model, ModelsListOptionalParams } from "../models"; + +/// +/** Interface representing a Models. */ +export interface Models { + /** + * List Models. + * @param location Resource location. + * @param options The options parameters. + */ + list( + location: string, + options?: ModelsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/privateEndpointConnections.ts index a4014f276638..ea78dacbcad7 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/privateEndpointConnections.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/privateEndpointConnections.ts @@ -6,7 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { PrivateEndpointConnectionsListOptionalParams, PrivateEndpointConnectionsListResponse, @@ -62,8 +62,8 @@ export interface PrivateEndpointConnections { properties: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, PrivateEndpointConnectionsCreateOrUpdateResponse > >; @@ -97,7 +97,7 @@ export interface PrivateEndpointConnections { accountName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Deletes the specified private endpoint connection associated with the Cognitive Services account. * @param resourceGroupName The name of the resource group. The name is case insensitive. diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/usages.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/usages.ts new file mode 100644 index 000000000000..f6c9919671a5 --- /dev/null +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/usages.ts @@ -0,0 +1,24 @@ +/* + * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Usage, UsagesListOptionalParams } from "../models"; + +/// +/** Interface representing a Usages. */ +export interface Usages { + /** + * Get usages for the requested subscription + * @param location Resource location. + * @param options The options parameters. + */ + list( + location: string, + options?: UsagesListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/cognitiveservices/arm-cognitiveservices/test/sampleTest.ts b/sdk/cognitiveservices/arm-cognitiveservices/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/cognitiveservices/arm-cognitiveservices/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/cognitiveservices/arm-cognitiveservices/tsconfig.json b/sdk/cognitiveservices/arm-cognitiveservices/tsconfig.json index 67e8e46df416..3e6ae96443f3 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/tsconfig.json +++ b/sdk/cognitiveservices/arm-cognitiveservices/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-cognitiveservices": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"