diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index d73687344798..1dca56008329 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -9825,23 +9825,23 @@ packages: dev: false file:projects/arm-cognitiveservices.tgz: - resolution: {integrity: sha512-TVvxQMYtcXgUfUms4MqQHE5zcUpCzg4eZK2VJmqQ14/paJG2amXdO2+wo96DbIzy1ay8xA5UYZH5zaMtEWY6tQ==, tarball: file:projects/arm-cognitiveservices.tgz} + resolution: {integrity: sha512-+YpwpslidjKByddMf8M0s8vicU7Gooa+AAlnYVYyMcV1/GqetEcnmLG+FbAtDALDwg/HMbHfkQ+veSjKCy/4kA==, tarball: file:projects/arm-cognitiveservices.tgz} name: '@rush-temp/arm-cognitiveservices' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 '@azure/identity': 2.0.4 '@microsoft/api-extractor': 7.19.4 - '@rollup/plugin-commonjs': 21.0.1_rollup@2.67.1 - '@rollup/plugin-json': 4.1.0_rollup@2.67.1 - '@rollup/plugin-multi-entry': 3.0.1_rollup@2.67.1 - '@rollup/plugin-node-resolve': 8.4.0_rollup@2.67.1 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 rimraf: 3.0.2 - rollup: 2.67.1 - rollup-plugin-sourcemaps: 0.4.2_rollup@2.67.1 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.15.1 diff --git a/sdk/cognitiveservices/arm-cognitiveservices/CHANGELOG.md b/sdk/cognitiveservices/arm-cognitiveservices/CHANGELOG.md index 054942469b81..93b975b5f5f0 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/CHANGELOG.md +++ b/sdk/cognitiveservices/arm-cognitiveservices/CHANGELOG.md @@ -1,15 +1,23 @@ # Release History - -## 7.0.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + +## 7.1.0 (2022-03-31) + +**Features** + + - Added operation Accounts.listModels + - Added Interface AccountModelListResult + - Added Interface AccountsListModelsNextOptionalParams + - Added Interface AccountsListModelsOptionalParams + - Added Interface ModelDeprecationInfo + - Added Type Alias AccountModel + - Added Type Alias AccountsListModelsNextResponse + - Added Type Alias AccountsListModelsResponse + - Interface AccountProperties has a new optional parameter deletionDate + - Interface AccountProperties has a new optional parameter dynamicThrottlingEnabled + - Interface AccountProperties has a new optional parameter scheduledPurgeDate + - Interface DeploymentScaleSettings has a new optional parameter activeCapacity + + ## 7.0.0 (2021-12-20) The package of @azure/arm-cognitiveservices is using our next generation design principles since version 7.0.0, which contains breaking changes. diff --git a/sdk/cognitiveservices/arm-cognitiveservices/LICENSE b/sdk/cognitiveservices/arm-cognitiveservices/LICENSE index ccb63b166732..5d1d36e0af80 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/LICENSE +++ b/sdk/cognitiveservices/arm-cognitiveservices/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/cognitiveservices/arm-cognitiveservices/_meta.json b/sdk/cognitiveservices/arm-cognitiveservices/_meta.json index 5f8bb5abc3fb..7510aa48857f 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/_meta.json +++ b/sdk/cognitiveservices/arm-cognitiveservices/_meta.json @@ -1,7 +1,8 @@ { - "commit": "d967edeee8fd6af6d40bffe53cceed1bd053d7ad", + "commit": "8520add137e35205d223e8fcf1352f4540016978", "readme": "specification/cognitiveservices/resource-manager/readme.md", - "autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/cognitiveservices/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20211217.1", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --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-alpha.16.20220105.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "use": "@autorest/typescript@6.0.0-alpha.16.20211217.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.2.1", + "use": "@autorest/typescript@6.0.0-alpha.16.20220105.1" } \ No newline at end of file diff --git a/sdk/cognitiveservices/arm-cognitiveservices/api-extractor.json b/sdk/cognitiveservices/arm-cognitiveservices/api-extractor.json index c93b52f9e3ef..486163c73c91 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/api-extractor.json +++ b/sdk/cognitiveservices/arm-cognitiveservices/api-extractor.json @@ -1,18 +1,31 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", - "docModel": { "enabled": true }, - "apiReport": { "enabled": true, "reportFolder": "./review" }, + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, "dtsRollup": { "enabled": true, "untrimmedFilePath": "", "publicTrimmedFilePath": "./types/arm-cognitiveservices.d.ts" }, "messages": { - "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, "extractorMessageReporting": { - "ae-missing-release-tag": { "logLevel": "none" }, - "ae-unresolved-link": { "logLevel": "none" } + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } } } -} +} \ No newline at end of file diff --git a/sdk/cognitiveservices/arm-cognitiveservices/package.json b/sdk/cognitiveservices/arm-cognitiveservices/package.json index 8e12c3e018ae..ae845b5b395a 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/package.json +++ b/sdk/cognitiveservices/arm-cognitiveservices/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for CognitiveServicesManagementClient.", - "version": "7.0.1", + "version": "7.1.0", "engines": { "node": ">=12.0.0" }, @@ -29,12 +29,12 @@ "types": "./types/arm-cognitiveservices.d.ts", "devDependencies": { "@microsoft/api-extractor": "^7.18.11", - "@rollup/plugin-commonjs": "^21.0.1", + "@rollup/plugin-commonjs": "11.0.2", "@rollup/plugin-json": "^4.0.0", "@rollup/plugin-multi-entry": "^3.0.0", "@rollup/plugin-node-resolve": "^8.0.0", "mkdirp": "^1.0.4", - "rollup": "^2.0.0", + "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", "uglify-js": "^3.4.9", @@ -99,4 +99,4 @@ }, "sideEffects": false, "autoPublish": true -} +} \ 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 3f223a5b3e31..98a3ca0cfb09 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/review/arm-cognitiveservices.api.md +++ b/sdk/cognitiveservices/arm-cognitiveservices/review/arm-cognitiveservices.api.md @@ -29,6 +29,23 @@ export interface AccountListResult { readonly value?: Account[]; } +// @public +export type AccountModel = DeploymentModel & { + baseModel?: DeploymentModel; + maxCapacity?: number; + capabilities?: { + [propertyName: string]: string; + }; + deprecation?: ModelDeprecationInfo; + readonly systemData?: SystemData; +}; + +// @public +export interface AccountModelListResult { + nextLink?: string; + value?: AccountModel[]; +} + // @public export interface AccountProperties { // (undocumented) @@ -38,8 +55,10 @@ export interface AccountProperties { readonly capabilities?: SkuCapability[]; customSubDomainName?: string; readonly dateCreated?: string; + readonly deletionDate?: string; // (undocumented) disableLocalAuth?: boolean; + dynamicThrottlingEnabled?: boolean; encryption?: Encryption; readonly endpoint?: string; readonly endpoints?: { @@ -57,6 +76,7 @@ export interface AccountProperties { restore?: boolean; // (undocumented) restrictOutboundNetworkAccess?: boolean; + readonly scheduledPurgeDate?: string; readonly skuChangeInfo?: SkuChangeInfo; userOwnedStorage?: UserOwnedStorage[]; } @@ -73,6 +93,7 @@ export interface Accounts { list(options?: AccountsListOptionalParams): PagedAsyncIterableIterator; listByResourceGroup(resourceGroupName: string, options?: AccountsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; listKeys(resourceGroupName: string, accountName: string, options?: AccountsListKeysOptionalParams): Promise; + listModels(resourceGroupName: string, accountName: string, options?: AccountsListModelsOptionalParams): PagedAsyncIterableIterator; listSkus(resourceGroupName: string, accountName: string, options?: AccountsListSkusOptionalParams): Promise; listUsages(resourceGroupName: string, accountName: string, options?: AccountsListUsagesOptionalParams): Promise; regenerateKey(resourceGroupName: string, accountName: string, keyName: KeyName, options?: AccountsRegenerateKeyOptionalParams): Promise; @@ -132,6 +153,20 @@ export interface AccountsListKeysOptionalParams extends coreClient.OperationOpti // @public export type AccountsListKeysResponse = ApiKeys; +// @public +export interface AccountsListModelsNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccountsListModelsNextResponse = AccountModelListResult; + +// @public +export interface AccountsListModelsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccountsListModelsResponse = AccountModelListResult; + // @public export interface AccountsListNextOptionalParams extends coreClient.OperationOptions { } @@ -485,6 +520,7 @@ export interface Deployments { // @public export interface DeploymentScaleSettings { + readonly activeCapacity?: number; capacity?: number; scaleType?: DeploymentScaleType; } @@ -778,6 +814,12 @@ export interface MetricName { value?: string; } +// @public +export interface ModelDeprecationInfo { + fineTune?: string; + inference?: string; +} + // @public export type NetworkRuleAction = string; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/cognitiveServicesManagementClient.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/cognitiveServicesManagementClient.ts index 58cb9ed56c03..4ae3420916ad 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/cognitiveServicesManagementClient.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/cognitiveServicesManagementClient.ts @@ -72,7 +72,7 @@ export class CognitiveServicesManagementClient extends coreClient.ServiceClient credential: credentials }; - const packageDetails = `azsdk-js-arm-cognitiveservices/7.0.0`; + const packageDetails = `azsdk-js-arm-cognitiveservices/7.1.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -95,7 +95,7 @@ export class CognitiveServicesManagementClient extends coreClient.ServiceClient // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-10-01"; + this.apiVersion = options.apiVersion || "2022-03-01"; this.accounts = new AccountsImpl(this); this.deletedAccounts = new DeletedAccountsImpl(this); this.resourceSkus = new ResourceSkusImpl(this); diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/models/index.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/models/index.ts index a733bfd3e204..dec6c99a4c78 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/models/index.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/models/index.ts @@ -117,7 +117,7 @@ export interface AccountProperties { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly privateEndpointConnections?: PrivateEndpointConnection[]; - /** Whether or not public endpoint access is allowed for this account. Value is optional but if passed in, must be 'Enabled' or 'Disabled' */ + /** Whether or not public endpoint access is allowed for this account. */ publicNetworkAccess?: PublicNetworkAccess; /** The api properties for special APIs. */ apiProperties?: ApiProperties; @@ -131,6 +131,8 @@ export interface AccountProperties { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly callRateLimit?: CallRateLimit; + /** The flag to enable dynamic throttling. */ + dynamicThrottlingEnabled?: boolean; /** NOTE: This property will not be serialized. It can only be populated by the server. */ readonly quotaLimit?: QuotaLimit; restrictOutboundNetworkAccess?: boolean; @@ -142,6 +144,16 @@ export interface AccountProperties { */ readonly endpoints?: { [propertyName: string]: string }; restore?: boolean; + /** + * The deletion date, only available for deleted account. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly deletionDate?: string; + /** + * The scheduled purge date, only available for deleted account. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly scheduledPurgeDate?: string; } /** SkuCapability indicates the capability of a certain feature. */ @@ -485,6 +497,32 @@ export interface MetricName { localizedValue?: string; } +/** The list of cognitive services accounts operation response. */ +export interface AccountModelListResult { + /** The link used to get the next page of Model. */ + nextLink?: string; + /** Gets the list of Cognitive Services accounts Model and their properties. */ + value?: AccountModel[]; +} + +/** Properties of Cognitive Services account deployment model. */ +export interface DeploymentModel { + /** Deployment model format. */ + format?: string; + /** Deployment model name. */ + name?: string; + /** Deployment model version. */ + version?: string; +} + +/** Cognitive Services account ModelDeprecationInfo. */ +export interface ModelDeprecationInfo { + /** The datetime of deprecation of the fineTune Model. */ + fineTune?: string; + /** The datetime of deprecation of the inference Model. */ + inference?: string; +} + /** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ export interface OperationListResult { /** @@ -709,22 +747,17 @@ export interface DeploymentProperties { scaleSettings?: DeploymentScaleSettings; } -/** Properties of Cognitive Services account deployment model. */ -export interface DeploymentModel { - /** Deployment model format. */ - format?: string; - /** Deployment model name. */ - name?: string; - /** Deployment model version. */ - version?: string; -} - /** Properties of Cognitive Services account deployment model. */ export interface DeploymentScaleSettings { /** Deployment scale type. */ scaleType?: DeploymentScaleType; /** Deployment capacity. */ capacity?: number; + /** + * Deployment active capacity. This value might be different from `capacity` if customer recently updated `capacity`. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly activeCapacity?: number; } /** The list of cognitive services accounts operation response. */ @@ -798,6 +831,23 @@ export type PrivateLinkResource = Resource & { /** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ export type ProxyResource = Resource & {}; +/** Cognitive Services account Model. */ +export type AccountModel = DeploymentModel & { + /** Base Model Identifier. */ + baseModel?: DeploymentModel; + /** The max capacity. */ + maxCapacity?: number; + /** The capabilities. */ + capabilities?: { [propertyName: string]: string }; + /** Cognitive Services account ModelDeprecationInfo. */ + deprecation?: ModelDeprecationInfo; + /** + * 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. + */ + readonly systemData?: SystemData; +}; + /** The Private Endpoint Connection resource. */ export type PrivateEndpointConnection = AzureEntityResource & { /** Resource properties. */ @@ -1263,6 +1313,13 @@ export interface AccountsListUsagesOptionalParams /** Contains response data for the listUsages operation. */ export type AccountsListUsagesResponse = UsageListResult; +/** Optional parameters. */ +export interface AccountsListModelsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listModels operation. */ +export type AccountsListModelsResponse = AccountModelListResult; + /** Optional parameters. */ export interface AccountsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions {} @@ -1277,6 +1334,13 @@ export interface AccountsListNextOptionalParams /** Contains response data for the listNext operation. */ export type AccountsListNextResponse = AccountListResult; +/** Optional parameters. */ +export interface AccountsListModelsNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listModelsNext operation. */ +export type AccountsListModelsNextResponse = AccountModelListResult; + /** Optional parameters. */ export interface DeletedAccountsGetOptionalParams extends coreClient.OperationOptions {} diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/models/mappers.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/models/mappers.ts index 76015b75881b..eac00647d23c 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/models/mappers.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/models/mappers.ts @@ -291,6 +291,12 @@ export const AccountProperties: coreClient.CompositeMapper = { className: "CallRateLimit" } }, + dynamicThrottlingEnabled: { + serializedName: "dynamicThrottlingEnabled", + type: { + name: "Boolean" + } + }, quotaLimit: { serializedName: "quotaLimit", type: { @@ -334,6 +340,20 @@ export const AccountProperties: coreClient.CompositeMapper = { type: { name: "Boolean" } + }, + deletionDate: { + serializedName: "deletionDate", + readOnly: true, + type: { + name: "String" + } + }, + scheduledPurgeDate: { + serializedName: "scheduledPurgeDate", + readOnly: true, + type: { + name: "String" + } } } } @@ -1347,6 +1367,81 @@ export const MetricName: coreClient.CompositeMapper = { } }; +export const AccountModelListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountModelListResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AccountModel" + } + } + } + } + } + } +}; + +export const DeploymentModel: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DeploymentModel", + modelProperties: { + format: { + serializedName: "format", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + }, + version: { + serializedName: "version", + type: { + name: "String" + } + } + } + } +}; + +export const ModelDeprecationInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ModelDeprecationInfo", + modelProperties: { + fineTune: { + serializedName: "fineTune", + type: { + name: "String" + } + }, + inference: { + serializedName: "inference", + type: { + name: "String" + } + } + } + } +}; + export const OperationListResult: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1901,33 +1996,6 @@ export const DeploymentProperties: coreClient.CompositeMapper = { } }; -export const DeploymentModel: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DeploymentModel", - modelProperties: { - format: { - serializedName: "format", - type: { - name: "String" - } - }, - name: { - serializedName: "name", - type: { - name: "String" - } - }, - version: { - serializedName: "version", - type: { - name: "String" - } - } - } - } -}; - export const DeploymentScaleSettings: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1944,6 +2012,13 @@ export const DeploymentScaleSettings: coreClient.CompositeMapper = { type: { name: "Number" } + }, + activeCapacity: { + serializedName: "activeCapacity", + readOnly: true, + type: { + name: "Number" + } } } } @@ -2111,6 +2186,50 @@ export const ProxyResource: coreClient.CompositeMapper = { } }; +export const AccountModel: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountModel", + modelProperties: { + ...DeploymentModel.type.modelProperties, + baseModel: { + serializedName: "baseModel", + type: { + name: "Composite", + className: "DeploymentModel" + } + }, + maxCapacity: { + serializedName: "maxCapacity", + type: { + name: "Number" + } + }, + capabilities: { + serializedName: "capabilities", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + deprecation: { + serializedName: "deprecation", + type: { + name: "Composite", + className: "ModelDeprecationInfo" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + export const PrivateEndpointConnection: coreClient.CompositeMapper = { type: { name: "Composite", diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/models/parameters.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/models/parameters.ts index 3ae70b24eb75..42ef559bb3c2 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/models/parameters.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/models/parameters.ts @@ -96,7 +96,7 @@ export const accountName: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-10-01", + defaultValue: "2022-03-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 77b1b5911e4e..59783f6da62b 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/accounts.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/accounts.ts @@ -20,6 +20,9 @@ import { AccountsListByResourceGroupOptionalParams, AccountsListNextOptionalParams, AccountsListOptionalParams, + AccountModel, + AccountsListModelsNextOptionalParams, + AccountsListModelsOptionalParams, AccountsCreateOptionalParams, AccountsCreateResponse, AccountsUpdateOptionalParams, @@ -38,8 +41,10 @@ import { AccountsListSkusResponse, AccountsListUsagesOptionalParams, AccountsListUsagesResponse, + AccountsListModelsResponse, AccountsListByResourceGroupNextResponse, - AccountsListNextResponse + AccountsListNextResponse, + AccountsListModelsNextResponse } from "../models"; /// @@ -150,6 +155,77 @@ export class AccountsImpl implements Accounts { } } + /** + * List available Models for the requested Cognitive Services account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param options The options parameters. + */ + public listModels( + resourceGroupName: string, + accountName: string, + options?: AccountsListModelsOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listModelsPagingAll( + resourceGroupName, + accountName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listModelsPagingPage( + resourceGroupName, + accountName, + options + ); + } + }; + } + + private async *listModelsPagingPage( + resourceGroupName: string, + accountName: string, + options?: AccountsListModelsOptionalParams + ): AsyncIterableIterator { + let result = await this._listModels( + resourceGroupName, + accountName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listModelsNext( + resourceGroupName, + accountName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listModelsPagingAll( + resourceGroupName: string, + accountName: string, + options?: AccountsListModelsOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listModelsPagingPage( + resourceGroupName, + accountName, + options + )) { + yield* page; + } + } + /** * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the * keys for developer to access intelligent APIs. It's also the resource type for billing. @@ -524,6 +600,23 @@ export class AccountsImpl implements Accounts { ); } + /** + * List available Models for the requested Cognitive Services account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param options The options parameters. + */ + private _listModels( + resourceGroupName: string, + accountName: string, + options?: AccountsListModelsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, options }, + listModelsOperationSpec + ); + } + /** * ListByResourceGroupNext * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -555,6 +648,25 @@ export class AccountsImpl implements Accounts { listNextOperationSpec ); } + + /** + * ListModelsNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param nextLink The nextLink from the previous successful call to the ListModels method. + * @param options The options parameters. + */ + private _listModelsNext( + resourceGroupName: string, + accountName: string, + nextLink: string, + options?: AccountsListModelsNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, nextLink, options }, + listModelsNextOperationSpec + ); + } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); @@ -801,6 +913,28 @@ const listUsagesOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const listModelsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/models", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccountModelListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", @@ -842,3 +976,25 @@ const listNextOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const listModelsNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccountModelListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.nextLink + ], + 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 31d34178784c..e3d3ec126c21 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/accounts.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/accounts.ts @@ -12,6 +12,8 @@ import { Account, AccountsListByResourceGroupOptionalParams, AccountsListOptionalParams, + AccountModel, + AccountsListModelsOptionalParams, AccountsCreateOptionalParams, AccountsCreateResponse, AccountsUpdateOptionalParams, @@ -49,6 +51,17 @@ export interface Accounts { list( options?: AccountsListOptionalParams ): PagedAsyncIterableIterator; + /** + * List available Models for the requested Cognitive Services account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param options The options parameters. + */ + listModels( + resourceGroupName: string, + accountName: string, + options?: AccountsListModelsOptionalParams + ): PagedAsyncIterableIterator; /** * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the * keys for developer to access intelligent APIs. It's also the resource type for billing. diff --git a/sdk/cognitiveservices/arm-cognitiveservices/test/sampleTest.ts b/sdk/cognitiveservices/arm-cognitiveservices/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/cognitiveservices/arm-cognitiveservices/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * 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 { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + 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" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + 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 6e3251194117..3e6ae96443f3 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/tsconfig.json +++ b/sdk/cognitiveservices/arm-cognitiveservices/tsconfig.json @@ -9,11 +9,19 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6", "dom"], + "lib": [ + "es6", + "dom" + ], "declaration": true, "outDir": "./dist-esm", "importHelpers": true }, - "include": ["./src/**/*.ts", "./test/**/*.ts"], - "exclude": ["node_modules"] -} + "include": [ + "./src/**/*.ts", + "./test/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/sdk/cognitiveservices/ci.mgmt.yml b/sdk/cognitiveservices/ci.mgmt.yml index e0e0bd8e9eed..2080bb033f94 100644 --- a/sdk/cognitiveservices/ci.mgmt.yml +++ b/sdk/cognitiveservices/ci.mgmt.yml @@ -1,5 +1,5 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - + trigger: branches: include: @@ -10,6 +10,7 @@ trigger: include: - sdk/cognitiveservices/ci.mgmt.yml - sdk/cognitiveservices/arm-cognitiveservices/ + - sdk/cognitiveservices/arm-cognitiveservices pr: branches: include: @@ -23,11 +24,11 @@ pr: include: - sdk/cognitiveservices/ci.mgmt.yml - sdk/cognitiveservices/arm-cognitiveservices/ - + - sdk/cognitiveservices/arm-cognitiveservices extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: ServiceDirectory: cognitiveservices Artifacts: - name: azure-arm-cognitiveservices - safeName: azurearmcognitiveservices \ No newline at end of file + safeName: azurearmcognitiveservices