From a970eee37b272185969447353fa0a06b10c80220 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 11 Dec 2024 01:45:00 +0000 Subject: [PATCH] CodeGen from PR 31831 in Azure/azure-rest-api-specs Merge 8234dfb03b984836d73ad1820e557c52a8256d70 into 494d37ef9b1ab34ebab08c00da5675302594dc78 --- common/config/rush/pnpm-lock.yaml | 23 +- .../arm-cognitiveservices/CHANGELOG.md | 190 +- .../arm-cognitiveservices/LICENSE | 2 +- .../arm-cognitiveservices/README.md | 1 - .../arm-cognitiveservices/_meta.json | 8 +- .../arm-cognitiveservices/package.json | 69 +- .../review/arm-cognitiveservices.api.md | 916 ++++- .../arm-cognitiveservices/sample.env | 5 +- .../src/cognitiveServicesManagementClient.ts | 156 +- .../arm-cognitiveservices/src/lroImpl.ts | 6 +- .../arm-cognitiveservices/src/models/index.ts | 1161 +++++- .../src/models/mappers.ts | 3625 ++++++++++++----- .../src/models/parameters.ts | 354 +- .../src/operations/accounts.ts | 354 +- .../src/operations/commitmentPlans.ts | 526 ++- .../src/operations/commitmentTiers.ts | 41 +- .../src/operations/defenderForAISettings.ts | 345 ++ .../src/operations/deletedAccounts.ts | 96 +- .../src/operations/deployments.ts | 480 ++- .../src/operations/encryptionScopes.ts | 429 ++ .../src/operations/index.ts | 9 + .../locationBasedModelCapacities.ts | 219 + .../src/operations/modelCapacities.ts | 195 + .../src/operations/models.ts | 41 +- .../networkSecurityPerimeterConfigurations.ts | 372 ++ .../src/operations/operations.ts | 32 +- .../operations/privateEndpointConnections.ts | 135 +- .../src/operations/privateLinkResources.ts | 19 +- .../src/operations/raiBlocklistItems.ts | 578 +++ .../src/operations/raiBlocklists.ts | 426 ++ .../src/operations/raiContentFilters.ts | 209 + .../src/operations/raiPolicies.ts | 420 ++ .../src/operations/resourceSkus.ts | 37 +- .../src/operations/usages.ts | 41 +- .../src/operationsInterfaces/accounts.ts | 30 +- .../operationsInterfaces/commitmentPlans.ts | 42 +- .../operationsInterfaces/commitmentTiers.ts | 2 +- .../defenderForAISettings.ts | 78 + .../operationsInterfaces/deletedAccounts.ts | 10 +- .../src/operationsInterfaces/deployments.ts | 67 +- .../operationsInterfaces/encryptionScopes.ts | 99 + .../src/operationsInterfaces/index.ts | 9 + .../locationBasedModelCapacities.ts | 33 + .../operationsInterfaces/modelCapacities.ts | 31 + .../src/operationsInterfaces/models.ts | 2 +- .../networkSecurityPerimeterConfigurations.ts | 78 + .../src/operationsInterfaces/operations.ts | 2 +- .../privateEndpointConnections.ts | 14 +- .../privateLinkResources.ts | 4 +- .../operationsInterfaces/raiBlocklistItems.ts | 139 + .../src/operationsInterfaces/raiBlocklists.ts | 95 + .../operationsInterfaces/raiContentFilters.ts | 40 + .../src/operationsInterfaces/raiPolicies.ts | 95 + .../src/operationsInterfaces/resourceSkus.ts | 2 +- .../src/operationsInterfaces/usages.ts | 2 +- .../arm-cognitiveservices/src/pagingHelper.ts | 2 +- .../arm-cognitiveservices/test/sampleTest.ts | 43 + .../arm-cognitiveservices/tsconfig.json | 12 +- 58 files changed, 10332 insertions(+), 2119 deletions(-) create mode 100644 sdk/cognitiveservices/arm-cognitiveservices/src/operations/defenderForAISettings.ts create mode 100644 sdk/cognitiveservices/arm-cognitiveservices/src/operations/encryptionScopes.ts create mode 100644 sdk/cognitiveservices/arm-cognitiveservices/src/operations/locationBasedModelCapacities.ts create mode 100644 sdk/cognitiveservices/arm-cognitiveservices/src/operations/modelCapacities.ts create mode 100644 sdk/cognitiveservices/arm-cognitiveservices/src/operations/networkSecurityPerimeterConfigurations.ts create mode 100644 sdk/cognitiveservices/arm-cognitiveservices/src/operations/raiBlocklistItems.ts create mode 100644 sdk/cognitiveservices/arm-cognitiveservices/src/operations/raiBlocklists.ts create mode 100644 sdk/cognitiveservices/arm-cognitiveservices/src/operations/raiContentFilters.ts create mode 100644 sdk/cognitiveservices/arm-cognitiveservices/src/operations/raiPolicies.ts create mode 100644 sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/defenderForAISettings.ts create mode 100644 sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/encryptionScopes.ts create mode 100644 sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/locationBasedModelCapacities.ts create mode 100644 sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/modelCapacities.ts create mode 100644 sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/networkSecurityPerimeterConfigurations.ts create mode 100644 sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/raiBlocklistItems.ts create mode 100644 sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/raiBlocklists.ts create mode 100644 sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/raiContentFilters.ts create mode 100644 sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/raiPolicies.ts create mode 100644 sdk/cognitiveservices/arm-cognitiveservices/test/sampleTest.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index fda3b79ef7dd..b91d83f379b4 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -1382,6 +1382,21 @@ packages: - supports-color dev: false + /@azure/arm-cognitiveservices@7.5.0: + resolution: {integrity: sha512-UA13hCXP1Ou3chmwLf4FoXibVn5mmstcVqOhR+f5Iwv1ScwdlocIMC4jn9vkrJnkSwHE+03SSax5upAkmr6fnw==} + engines: {node: '>=14.0.0'} + dependencies: + '@azure/abort-controller': 1.1.0 + '@azure/core-auth': 1.9.0 + '@azure/core-client': 1.9.2 + '@azure/core-lro': 2.7.2 + '@azure/core-paging': 1.6.2 + '@azure/core-rest-pipeline': 1.18.1 + tslib: 2.8.1 + transitivePeerDependencies: + - supports-color + dev: false + /@azure/arm-compute@21.6.0: resolution: {integrity: sha512-Qk6kxoqMgzOvceUBqD1WTHrPh/iaxlTLQPp241u3iNVOE4FVSTqSzTxjG1tr/UL1rBWGvoLPZExUFddo+Qd5KQ==} engines: {node: '>=18.0.0'} @@ -13413,7 +13428,7 @@ packages: dev: false file:projects/arm-cognitiveservices.tgz: - resolution: {integrity: sha512-2v6ZM1wtAQ0vU451JL+EWzD5yvWeC3YZtlADX2eQdd/c9Ukw86QvuNysXcIFyZvdDHQiSk9NCc4NO3pIiBqweg==, tarball: file:projects/arm-cognitiveservices.tgz} + resolution: {integrity: sha512-kU8dBNWUm8VGo/euxEUk12k3Wqu3sj7XQn3HbffgOVVYJCDOGR+OfhHPkL2KlvCRX2s0LnVzCWtIpKgdm54Y6g==, tarball: file:projects/arm-cognitiveservices.tgz} name: '@rush-temp/arm-cognitiveservices' version: 0.0.0 dependencies: @@ -13426,9 +13441,10 @@ packages: '@types/node': 18.19.67 chai: 4.3.10 dotenv: 16.4.5 - mocha: 11.0.2 + mocha: 10.8.2 ts-node: 10.9.2(@types/node@18.19.67)(typescript@5.6.3) tslib: 2.8.1 + tsx: 4.19.2 typescript: 5.6.3 transitivePeerDependencies: - '@swc/core' @@ -21941,10 +21957,11 @@ packages: dev: false file:projects/openai.tgz: - resolution: {integrity: sha512-HbvC8ZldtA4WQ2pLFQaqYn7GBJbve7a4L/FlCFInJL8qXMDqC0B0by+XFQRFwJNyhR16BUE4OzqLtmr0RZHi0A==, tarball: file:projects/openai.tgz} + resolution: {integrity: sha512-WBMr219FukgA/DRhVZIynuBGggV/YspVdg/gkiZgp2b7xDNfjW9wAy4bAh25GrHYtqEqeDjBqj9DMLUurVhN7A==, tarball: file:projects/openai.tgz} name: '@rush-temp/openai' version: 0.0.0 dependencies: + '@azure/arm-cognitiveservices': 7.5.0 '@types/node': 18.19.67 '@vitest/browser': 2.1.8(@types/node@18.19.67)(playwright@1.49.0)(typescript@5.6.3)(vitest@2.1.8) '@vitest/coverage-istanbul': 2.1.8(vitest@2.1.8) diff --git a/sdk/cognitiveservices/arm-cognitiveservices/CHANGELOG.md b/sdk/cognitiveservices/arm-cognitiveservices/CHANGELOG.md index fa0d53301a26..a8e698935fa0 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/CHANGELOG.md +++ b/sdk/cognitiveservices/arm-cognitiveservices/CHANGELOG.md @@ -1,5 +1,193 @@ # Release History +## 7.6.0 (2024-12-11) + +### Features Added + + - Added operation group DefenderForAISettings + - Added operation group EncryptionScopes + - Added operation group LocationBasedModelCapacities + - Added operation group ModelCapacities + - Added operation group NetworkSecurityPerimeterConfigurations + - Added operation group RaiBlocklistItems + - Added operation group RaiBlocklists + - Added operation group RaiContentFilters + - Added operation group RaiPolicies + - Added operation Deployments.beginUpdate + - Added operation Deployments.beginUpdateAndWait + - Added operation Deployments.listSkus + - Added Interface BillingMeterInfo + - Added Interface CalculateModelCapacityOptionalParams + - Added Interface CalculateModelCapacityParameter + - Added Interface CalculateModelCapacityResult + - Added Interface CalculateModelCapacityResultEstimatedCapacity + - Added Interface CustomBlocklistConfig + - Added Interface DefenderForAISetting + - Added Interface DefenderForAISettingResult + - Added Interface DefenderForAISettingsCreateOrUpdateOptionalParams + - Added Interface DefenderForAISettingsGetOptionalParams + - Added Interface DefenderForAISettingsListNextOptionalParams + - Added Interface DefenderForAISettingsListOptionalParams + - Added Interface DefenderForAISettingsUpdateOptionalParams + - Added Interface DeploymentCapacitySettings + - Added Interface DeploymentSkuListResult + - Added Interface DeploymentsListSkusNextOptionalParams + - Added Interface DeploymentsListSkusOptionalParams + - Added Interface DeploymentsUpdateHeaders + - Added Interface DeploymentsUpdateOptionalParams + - Added Interface EncryptionScope + - Added Interface EncryptionScopeListResult + - Added Interface EncryptionScopeProperties + - Added Interface EncryptionScopesCreateOrUpdateOptionalParams + - Added Interface EncryptionScopesDeleteHeaders + - Added Interface EncryptionScopesDeleteOptionalParams + - Added Interface EncryptionScopesGetOptionalParams + - Added Interface EncryptionScopesListNextOptionalParams + - Added Interface EncryptionScopesListOptionalParams + - Added Interface LocationBasedModelCapacitiesListNextOptionalParams + - Added Interface LocationBasedModelCapacitiesListOptionalParams + - Added Interface ModelCapacitiesListNextOptionalParams + - Added Interface ModelCapacitiesListOptionalParams + - Added Interface ModelCapacityCalculatorWorkload + - Added Interface ModelCapacityCalculatorWorkloadRequestParam + - Added Interface ModelCapacityListResult + - Added Interface ModelCapacityListResultValueItem + - Added Interface ModelSkuCapacityProperties + - Added Interface NetworkSecurityPerimeter + - Added Interface NetworkSecurityPerimeterAccessRule + - Added Interface NetworkSecurityPerimeterAccessRuleProperties + - Added Interface NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem + - Added Interface NetworkSecurityPerimeterConfiguration + - Added Interface NetworkSecurityPerimeterConfigurationAssociationInfo + - Added Interface NetworkSecurityPerimeterConfigurationList + - Added Interface NetworkSecurityPerimeterConfigurationProperties + - Added Interface NetworkSecurityPerimeterConfigurationsGetOptionalParams + - Added Interface NetworkSecurityPerimeterConfigurationsListNextOptionalParams + - Added Interface NetworkSecurityPerimeterConfigurationsListOptionalParams + - Added Interface NetworkSecurityPerimeterConfigurationsReconcileHeaders + - Added Interface NetworkSecurityPerimeterConfigurationsReconcileOptionalParams + - Added Interface NetworkSecurityPerimeterProfileInfo + - Added Interface ProvisioningIssue + - Added Interface ProvisioningIssueProperties + - Added Interface RaiBlocklist + - Added Interface RaiBlocklistConfig + - Added Interface RaiBlocklistItem + - Added Interface RaiBlocklistItemBulkRequest + - Added Interface RaiBlocklistItemProperties + - Added Interface RaiBlocklistItemsBatchAddOptionalParams + - Added Interface RaiBlocklistItemsBatchDeleteOptionalParams + - Added Interface RaiBlocklistItemsCreateOrUpdateOptionalParams + - Added Interface RaiBlocklistItemsDeleteHeaders + - Added Interface RaiBlocklistItemsDeleteOptionalParams + - Added Interface RaiBlocklistItemsGetOptionalParams + - Added Interface RaiBlocklistItemsListNextOptionalParams + - Added Interface RaiBlocklistItemsListOptionalParams + - Added Interface RaiBlockListItemsResult + - Added Interface RaiBlocklistProperties + - Added Interface RaiBlockListResult + - Added Interface RaiBlocklistsCreateOrUpdateOptionalParams + - Added Interface RaiBlocklistsDeleteHeaders + - Added Interface RaiBlocklistsDeleteOptionalParams + - Added Interface RaiBlocklistsGetOptionalParams + - Added Interface RaiBlocklistsListNextOptionalParams + - Added Interface RaiBlocklistsListOptionalParams + - Added Interface RaiContentFilter + - Added Interface RaiContentFilterListResult + - Added Interface RaiContentFilterProperties + - Added Interface RaiContentFiltersGetOptionalParams + - Added Interface RaiContentFiltersListNextOptionalParams + - Added Interface RaiContentFiltersListOptionalParams + - Added Interface RaiMonitorConfig + - Added Interface RaiPoliciesCreateOrUpdateOptionalParams + - Added Interface RaiPoliciesDeleteHeaders + - Added Interface RaiPoliciesDeleteOptionalParams + - Added Interface RaiPoliciesGetOptionalParams + - Added Interface RaiPoliciesListNextOptionalParams + - Added Interface RaiPoliciesListOptionalParams + - Added Interface RaiPolicy + - Added Interface RaiPolicyContentFilter + - Added Interface RaiPolicyListResult + - Added Interface RaiPolicyProperties + - Added Interface SkuResource + - Added Interface UserOwnedAmlWorkspace + - Added Type Alias ByPassSelection + - Added Type Alias CalculateModelCapacityResponse + - Added Type Alias ContentLevel + - Added Type Alias DefenderForAISettingsCreateOrUpdateResponse + - Added Type Alias DefenderForAISettingsGetResponse + - Added Type Alias DefenderForAISettingsListNextResponse + - Added Type Alias DefenderForAISettingsListResponse + - Added Type Alias DefenderForAISettingState + - Added Type Alias DefenderForAISettingsUpdateResponse + - Added Type Alias DeploymentsListSkusNextResponse + - Added Type Alias DeploymentsListSkusResponse + - Added Type Alias DeploymentsUpdateResponse + - Added Type Alias EncryptionScopeProvisioningState + - Added Type Alias EncryptionScopesCreateOrUpdateResponse + - Added Type Alias EncryptionScopesDeleteResponse + - Added Type Alias EncryptionScopesGetResponse + - Added Type Alias EncryptionScopesListNextResponse + - Added Type Alias EncryptionScopesListResponse + - Added Type Alias EncryptionScopeState + - Added Type Alias LocationBasedModelCapacitiesListNextResponse + - Added Type Alias LocationBasedModelCapacitiesListResponse + - Added Type Alias ModelCapacitiesListNextResponse + - Added Type Alias ModelCapacitiesListResponse + - Added Type Alias NetworkSecurityPerimeterConfigurationsGetResponse + - Added Type Alias NetworkSecurityPerimeterConfigurationsListNextResponse + - Added Type Alias NetworkSecurityPerimeterConfigurationsListResponse + - Added Type Alias NetworkSecurityPerimeterConfigurationsReconcileResponse + - Added Type Alias NspAccessRuleDirection + - Added Type Alias RaiBlocklistItemsBatchAddResponse + - Added Type Alias RaiBlocklistItemsCreateOrUpdateResponse + - Added Type Alias RaiBlocklistItemsDeleteResponse + - Added Type Alias RaiBlocklistItemsGetResponse + - Added Type Alias RaiBlocklistItemsListNextResponse + - Added Type Alias RaiBlocklistItemsListResponse + - Added Type Alias RaiBlocklistsCreateOrUpdateResponse + - Added Type Alias RaiBlocklistsDeleteResponse + - Added Type Alias RaiBlocklistsGetResponse + - Added Type Alias RaiBlocklistsListNextResponse + - Added Type Alias RaiBlocklistsListResponse + - Added Type Alias RaiContentFiltersGetResponse + - Added Type Alias RaiContentFiltersListNextResponse + - Added Type Alias RaiContentFiltersListResponse + - Added Type Alias RaiPoliciesCreateOrUpdateResponse + - Added Type Alias RaiPoliciesDeleteResponse + - Added Type Alias RaiPoliciesGetResponse + - Added Type Alias RaiPoliciesListNextResponse + - Added Type Alias RaiPoliciesListResponse + - Added Type Alias RaiPolicyContentSource + - Added Type Alias RaiPolicyMode + - Added Type Alias RaiPolicyType + - Interface AccountProperties has a new optional parameter amlWorkspace + - Interface AccountProperties has a new optional parameter raiMonitorConfig + - Interface CapacityConfig has a new optional parameter allowedValues + - Interface CommitmentPlanAccountAssociation has a new optional parameter tags + - Interface Deployment has a new optional parameter tags + - Interface DeploymentModel has a new optional parameter publisher + - Interface DeploymentModel has a new optional parameter sourceAccount + - Interface DeploymentProperties has a new optional parameter capacitySettings + - Interface DeploymentProperties has a new optional parameter currentCapacity + - Interface DeploymentProperties has a new optional parameter dynamicThrottlingEnabled + - Interface DeploymentProperties has a new optional parameter parentDeploymentName + - Interface Model has a new optional parameter description + - Interface ModelSku has a new optional parameter cost + - Interface NetworkRuleSet has a new optional parameter bypass + - Added Enum KnownByPassSelection + - Added Enum KnownContentLevel + - Added Enum KnownDefenderForAISettingState + - Added Enum KnownEncryptionScopeProvisioningState + - Added Enum KnownEncryptionScopeState + - Added Enum KnownNspAccessRuleDirection + - Added Enum KnownRaiPolicyContentSource + - Added Enum KnownRaiPolicyMode + - Added Enum KnownRaiPolicyType + - Enum KnownModelLifecycleStatus has a new value Deprecated + - Enum KnownModelLifecycleStatus has a new value Deprecating + - Enum KnownModelLifecycleStatus has a new value Stable + + ## 7.5.0 (2023-07-06) ### Features Added @@ -169,4 +357,4 @@ To understand the detail of the change, please refer to [Changelog](https://aka. To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). -To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ). +To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart). diff --git a/sdk/cognitiveservices/arm-cognitiveservices/LICENSE b/sdk/cognitiveservices/arm-cognitiveservices/LICENSE index 3a1d9b6f24f7..7d5934740965 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/LICENSE +++ b/sdk/cognitiveservices/arm-cognitiveservices/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2023 Microsoft +Copyright (c) 2024 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/README.md b/sdk/cognitiveservices/arm-cognitiveservices/README.md index 95420302b562..ed0ba6c302c1 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/README.md +++ b/sdk/cognitiveservices/arm-cognitiveservices/README.md @@ -44,7 +44,6 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure CognitiveServicesManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). diff --git a/sdk/cognitiveservices/arm-cognitiveservices/_meta.json b/sdk/cognitiveservices/arm-cognitiveservices/_meta.json index c14c35ec5010..09628f06f606 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/_meta.json +++ b/sdk/cognitiveservices/arm-cognitiveservices/_meta.json @@ -1,8 +1,8 @@ { - "commit": "26cac4f70e9ce0e1c2f77de8303b47d1faa9ad33", + "commit": "b5ddb840cd181e9498ef1c8cfedf72c6995c7538", "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.5 --generate-sample=true", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/cognitiveservices/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.0", - "use": "@autorest/typescript@6.0.5" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.16", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/cognitiveservices/arm-cognitiveservices/package.json b/sdk/cognitiveservices/arm-cognitiveservices/package.json index 470bc4816ed4..4eb18c8663a8 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/package.json +++ b/sdk/cognitiveservices/arm-cognitiveservices/package.json @@ -3,17 +3,17 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for CognitiveServicesManagementClient.", - "version": "7.5.0", + "version": "7.6.0", "engines": { "node": ">=18.0.0" }, "dependencies": { - "@azure/abort-controller": "^1.0.0", - "@azure/core-auth": "^1.3.0", - "@azure/core-client": "^1.7.0", - "@azure/core-lro": "^2.5.3", + "@azure/core-lro": "^2.5.4", + "@azure/abort-controller": "^2.1.2", "@azure/core-paging": "^1.2.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-client": "^1.7.0", + "@azure/core-auth": "^1.6.0", + "@azure/core-rest-pipeline": "^1.14.0", "tslib": "^2.2.0" }, "keywords": [ @@ -28,18 +28,19 @@ "module": "./dist-esm/src/index.js", "types": "./types/arm-cognitiveservices.d.ts", "devDependencies": { - "@azure-tools/test-credential": "^1.0.0", - "@azure-tools/test-recorder": "^3.0.0", + "typescript": "~5.6.2", + "dotenv": "^16.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.0.1", - "@types/chai": "^4.2.8", + "@azure/identity": "^4.2.1", + "@azure-tools/test-recorder": "^3.0.0", + "@azure-tools/test-credential": "^1.1.0", + "mocha": "^10.0.0", "@types/mocha": "^10.0.0", - "@types/node": "^18.0.0", + "tsx": "^4.7.1", + "@types/chai": "^4.2.8", "chai": "^4.2.0", - "dotenv": "^16.0.0", - "mocha": "^11.0.2", - "ts-node": "^10.0.0", - "typescript": "~5.6.2" + "@types/node": "^18.0.0", + "ts-node": "^10.0.0" }, "repository": { "type": "git", @@ -67,28 +68,28 @@ ], "scripts": { "build": "npm run clean && tsc && dev-tool run bundle && npm run minify && dev-tool run vendored mkdirp ./review && npm run extract-api", - "build:browser": "echo skipped", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "dev-tool run extract-api", + "lint": "echo skipped", + "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", - "build:samples": "echo skipped.", + "build:browser": "echo skipped", "build:test": "echo skipped", + "build:samples": "echo skipped.", "check-format": "echo skipped", - "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "execute:samples": "echo skipped", - "extract-api": "dev-tool run extract-api", "format": "echo skipped", - "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:browser": "echo skipped", - "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", - "lint": "echo skipped", - "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", - "pack": "npm pack 2>&1", - "prepack": "npm run build", "test": "npm run integration-test", - "test:browser": "echo skipped", "test:node": "echo skipped", + "test:browser": "echo skipped", "unit-test": "npm run unit-test:node && npm run unit-test:browser", - "unit-test:browser": "echo skipped", "unit-test:node": "dev-tool run vendored cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped", "update-snippets": "echo skipped" }, "sideEffects": false, @@ -101,13 +102,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 a7a3c2630b1a..6723a35d41b3 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/review/arm-cognitiveservices.api.md +++ b/sdk/cognitiveservices/arm-cognitiveservices/review/arm-cognitiveservices.api.md @@ -67,6 +67,7 @@ export interface AccountProperties { readonly abusePenalty?: AbusePenalty; // (undocumented) allowedFqdnList?: string[]; + amlWorkspace?: UserOwnedAmlWorkspace; apiProperties?: ApiProperties; readonly callRateLimit?: CallRateLimit; readonly capabilities?: SkuCapability[]; @@ -91,6 +92,7 @@ export interface AccountProperties { readonly provisioningState?: ProvisioningState; publicNetworkAccess?: PublicNetworkAccess; readonly quotaLimit?: QuotaLimit; + raiMonitorConfig?: RaiMonitorConfig; // (undocumented) restore?: boolean; // (undocumented) @@ -260,6 +262,52 @@ export interface AzureEntityResource extends Resource { readonly etag?: string; } +// @public (undocumented) +export interface BillingMeterInfo { + // (undocumented) + meterId?: string; + // (undocumented) + name?: string; + // (undocumented) + unit?: string; +} + +// @public +export type ByPassSelection = string; + +// @public +export interface CalculateModelCapacityOptionalParams extends coreClient.OperationOptions { + model?: DeploymentModel; + skuName?: string; + workloads?: ModelCapacityCalculatorWorkload[]; +} + +// @public +export interface CalculateModelCapacityParameter { + model?: DeploymentModel; + skuName?: string; + workloads?: ModelCapacityCalculatorWorkload[]; +} + +// @public +export type CalculateModelCapacityResponse = CalculateModelCapacityResult; + +// @public +export interface CalculateModelCapacityResult { + estimatedCapacity?: CalculateModelCapacityResultEstimatedCapacity; + model?: DeploymentModel; + // (undocumented) + skuName?: string; +} + +// @public +export interface CalculateModelCapacityResultEstimatedCapacity { + // (undocumented) + deployableValue?: number; + // (undocumented) + value?: number; +} + // @public export interface CallRateLimit { count?: number; @@ -270,6 +318,7 @@ export interface CallRateLimit { // @public export interface CapacityConfig { + allowedValues?: number[]; default?: number; maximum?: number; minimum?: number; @@ -314,6 +363,7 @@ export class CognitiveServicesManagementClient extends coreClient.ServiceClient accounts: Accounts; // (undocumented) apiVersion: string; + calculateModelCapacity(options?: CalculateModelCapacityOptionalParams): Promise; checkDomainAvailability(subdomainName: string, typeParam: string, options?: CheckDomainAvailabilityOptionalParams): Promise; checkSkuAvailability(location: string, skus: string[], kind: string, typeParam: string, options?: CheckSkuAvailabilityOptionalParams): Promise; // (undocumented) @@ -321,18 +371,36 @@ export class CognitiveServicesManagementClient extends coreClient.ServiceClient // (undocumented) commitmentTiers: CommitmentTiers; // (undocumented) + defenderForAISettings: DefenderForAISettings; + // (undocumented) deletedAccounts: DeletedAccounts; // (undocumented) deployments: Deployments; // (undocumented) + encryptionScopes: EncryptionScopes; + // (undocumented) + locationBasedModelCapacities: LocationBasedModelCapacities; + // (undocumented) + modelCapacities: ModelCapacities; + // (undocumented) models: Models; // (undocumented) + networkSecurityPerimeterConfigurations: NetworkSecurityPerimeterConfigurations; + // (undocumented) operations: Operations; // (undocumented) privateEndpointConnections: PrivateEndpointConnections; // (undocumented) privateLinkResources: PrivateLinkResources; // (undocumented) + raiBlocklistItems: RaiBlocklistItems; + // (undocumented) + raiBlocklists: RaiBlocklists; + // (undocumented) + raiContentFilters: RaiContentFilters; + // (undocumented) + raiPolicies: RaiPolicies; + // (undocumented) resourceSkus: ResourceSkus; // (undocumented) subscriptionId: string; @@ -380,6 +448,9 @@ export interface CommitmentPlanAccountAssociation extends ProxyResource { accountId?: string; readonly etag?: string; readonly systemData?: SystemData; + tags?: { + [propertyName: string]: string; + }; } // @public @@ -630,9 +701,79 @@ export interface CommitmentTiersListOptionalParams extends coreClient.OperationO // @public export type CommitmentTiersListResponse = CommitmentTierListResult; +// @public +export type ContentLevel = string; + // @public export type CreatedByType = string; +// @public +export interface CustomBlocklistConfig extends RaiBlocklistConfig { + source?: RaiPolicyContentSource; +} + +// @public +export interface DefenderForAISetting extends ProxyResource { + readonly etag?: string; + state?: DefenderForAISettingState; + readonly systemData?: SystemData; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface DefenderForAISettingResult { + nextLink?: string; + value?: DefenderForAISetting[]; +} + +// @public +export interface DefenderForAISettings { + createOrUpdate(resourceGroupName: string, accountName: string, defenderForAISettingName: string, defenderForAISettings: DefenderForAISetting, options?: DefenderForAISettingsCreateOrUpdateOptionalParams): Promise; + get(resourceGroupName: string, accountName: string, defenderForAISettingName: string, options?: DefenderForAISettingsGetOptionalParams): Promise; + list(resourceGroupName: string, accountName: string, options?: DefenderForAISettingsListOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, accountName: string, defenderForAISettingName: string, defenderForAISettings: DefenderForAISetting, options?: DefenderForAISettingsUpdateOptionalParams): Promise; +} + +// @public +export interface DefenderForAISettingsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DefenderForAISettingsCreateOrUpdateResponse = DefenderForAISetting; + +// @public +export interface DefenderForAISettingsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DefenderForAISettingsGetResponse = DefenderForAISetting; + +// @public +export interface DefenderForAISettingsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DefenderForAISettingsListNextResponse = DefenderForAISettingResult; + +// @public +export interface DefenderForAISettingsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DefenderForAISettingsListResponse = DefenderForAISettingResult; + +// @public +export type DefenderForAISettingState = string; + +// @public +export interface DefenderForAISettingsUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DefenderForAISettingsUpdateResponse = DefenderForAISetting; + // @public export interface DeletedAccounts { beginPurge(location: string, resourceGroupName: string, accountName: string, options?: DeletedAccountsPurgeOptionalParams): Promise, void>>; @@ -674,6 +815,15 @@ export interface Deployment extends ProxyResource { properties?: DeploymentProperties; sku?: Sku; readonly systemData?: SystemData; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface DeploymentCapacitySettings { + designatedCapacity?: number; + priority?: number; } // @public @@ -687,7 +837,9 @@ export interface DeploymentModel { readonly callRateLimit?: CallRateLimit; format?: string; name?: string; + publisher?: string; source?: string; + sourceAccount?: string; version?: string; } @@ -700,7 +852,11 @@ export interface DeploymentProperties { readonly capabilities?: { [propertyName: string]: string; }; + capacitySettings?: DeploymentCapacitySettings; + currentCapacity?: number; + readonly dynamicThrottlingEnabled?: boolean; model?: DeploymentModel; + parentDeploymentName?: string; readonly provisioningState?: DeploymentProvisioningState; raiPolicyName?: string; readonly rateLimits?: ThrottlingRule[]; @@ -717,8 +873,11 @@ export interface Deployments { beginCreateOrUpdateAndWait(resourceGroupName: string, accountName: string, deploymentName: string, deployment: Deployment, options?: DeploymentsCreateOrUpdateOptionalParams): Promise; beginDelete(resourceGroupName: string, accountName: string, deploymentName: string, options?: DeploymentsDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, accountName: string, deploymentName: string, options?: DeploymentsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, accountName: string, deploymentName: string, deployment: PatchResourceTagsAndSku, options?: DeploymentsUpdateOptionalParams): Promise, DeploymentsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, accountName: string, deploymentName: string, deployment: PatchResourceTagsAndSku, options?: DeploymentsUpdateOptionalParams): Promise; get(resourceGroupName: string, accountName: string, deploymentName: string, options?: DeploymentsGetOptionalParams): Promise; list(resourceGroupName: string, accountName: string, options?: DeploymentsListOptionalParams): PagedAsyncIterableIterator; + listSkus(resourceGroupName: string, accountName: string, deploymentName: string, options?: DeploymentsListSkusOptionalParams): PagedAsyncIterableIterator; } // @public @@ -753,6 +912,12 @@ export interface DeploymentsGetOptionalParams extends coreClient.OperationOption // @public export type DeploymentsGetResponse = Deployment; +// @public +export interface DeploymentSkuListResult { + nextLink?: string; + readonly value?: SkuResource[]; +} + // @public export interface DeploymentsListNextOptionalParams extends coreClient.OperationOptions { } @@ -767,6 +932,35 @@ export interface DeploymentsListOptionalParams extends coreClient.OperationOptio // @public export type DeploymentsListResponse = DeploymentListResult; +// @public +export interface DeploymentsListSkusNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeploymentsListSkusNextResponse = DeploymentSkuListResult; + +// @public +export interface DeploymentsListSkusOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeploymentsListSkusResponse = DeploymentSkuListResult; + +// @public +export interface DeploymentsUpdateHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface DeploymentsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DeploymentsUpdateResponse = Deployment; + // @public export interface DomainAvailability { isSubdomainAvailable?: boolean; @@ -782,6 +976,86 @@ export interface Encryption { keyVaultProperties?: KeyVaultProperties; } +// @public +export interface EncryptionScope extends ProxyResource { + readonly etag?: string; + properties?: EncryptionScopeProperties; + readonly systemData?: SystemData; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface EncryptionScopeListResult { + nextLink?: string; + value?: EncryptionScope[]; +} + +// @public +export interface EncryptionScopeProperties extends Encryption { + readonly provisioningState?: EncryptionScopeProvisioningState; + state?: EncryptionScopeState; +} + +// @public +export type EncryptionScopeProvisioningState = string; + +// @public +export interface EncryptionScopes { + beginDelete(resourceGroupName: string, accountName: string, encryptionScopeName: string, options?: EncryptionScopesDeleteOptionalParams): Promise, EncryptionScopesDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, accountName: string, encryptionScopeName: string, options?: EncryptionScopesDeleteOptionalParams): Promise; + createOrUpdate(resourceGroupName: string, accountName: string, encryptionScopeName: string, encryptionScope: EncryptionScope, options?: EncryptionScopesCreateOrUpdateOptionalParams): Promise; + get(resourceGroupName: string, accountName: string, encryptionScopeName: string, options?: EncryptionScopesGetOptionalParams): Promise; + list(resourceGroupName: string, accountName: string, options?: EncryptionScopesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface EncryptionScopesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EncryptionScopesCreateOrUpdateResponse = EncryptionScope; + +// @public +export interface EncryptionScopesDeleteHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface EncryptionScopesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type EncryptionScopesDeleteResponse = EncryptionScopesDeleteHeaders; + +// @public +export interface EncryptionScopesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EncryptionScopesGetResponse = EncryptionScope; + +// @public +export interface EncryptionScopesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EncryptionScopesListNextResponse = EncryptionScopeListResult; + +// @public +export interface EncryptionScopesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EncryptionScopesListResponse = EncryptionScopeListResult; + +// @public +export type EncryptionScopeState = string; + // @public export interface ErrorAdditionalInfo { readonly info?: Record; @@ -849,6 +1123,12 @@ export enum KnownActionType { Internal = "Internal" } +// @public +export enum KnownByPassSelection { + AzureServices = "AzureServices", + None = "None" +} + // @public export enum KnownCommitmentPlanProvisioningState { Accepted = "Accepted", @@ -860,6 +1140,13 @@ export enum KnownCommitmentPlanProvisioningState { Succeeded = "Succeeded" } +// @public +export enum KnownContentLevel { + High = "High", + Low = "Low", + Medium = "Medium" +} + // @public export enum KnownCreatedByType { Application = "Application", @@ -868,6 +1155,12 @@ export enum KnownCreatedByType { User = "User" } +// @public +export enum KnownDefenderForAISettingState { + Disabled = "Disabled", + Enabled = "Enabled" +} + // @public export enum KnownDeploymentModelVersionUpgradeOption { NoAutoUpgrade = "NoAutoUpgrade", @@ -893,6 +1186,23 @@ export enum KnownDeploymentScaleType { Standard = "Standard" } +// @public +export enum KnownEncryptionScopeProvisioningState { + Accepted = "Accepted", + Canceled = "Canceled", + Creating = "Creating", + Deleting = "Deleting", + Failed = "Failed", + Moving = "Moving", + Succeeded = "Succeeded" +} + +// @public +export enum KnownEncryptionScopeState { + Disabled = "Disabled", + Enabled = "Enabled" +} + // @public export enum KnownHostingModel { ConnectedContainer = "ConnectedContainer", @@ -909,8 +1219,11 @@ export enum KnownKeySource { // @public export enum KnownModelLifecycleStatus { + Deprecated = "Deprecated", + Deprecating = "Deprecating", GenerallyAvailable = "GenerallyAvailable", - Preview = "Preview" + Preview = "Preview", + Stable = "Stable" } // @public @@ -919,6 +1232,12 @@ export enum KnownNetworkRuleAction { Deny = "Deny" } +// @public +export enum KnownNspAccessRuleDirection { + Inbound = "Inbound", + Outbound = "Outbound" +} + // @public export enum KnownOrigin { System = "system", @@ -966,6 +1285,26 @@ export enum KnownQuotaUsageStatus { Unknown = "Unknown" } +// @public +export enum KnownRaiPolicyContentSource { + Completion = "Completion", + Prompt = "Prompt" +} + +// @public +export enum KnownRaiPolicyMode { + AsynchronousFilter = "Asynchronous_filter", + Blocking = "Blocking", + Default = "Default", + Deferred = "Deferred" +} + +// @public +export enum KnownRaiPolicyType { + SystemManaged = "SystemManaged", + UserManaged = "UserManaged" +} + // @public export enum KnownResourceSkuRestrictionsReasonCode { NotAvailableForSubscription = "NotAvailableForSubscription", @@ -999,6 +1338,25 @@ export enum KnownUnitType { Seconds = "Seconds" } +// @public +export interface LocationBasedModelCapacities { + list(location: string, modelFormat: string, modelName: string, modelVersion: string, options?: LocationBasedModelCapacitiesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface LocationBasedModelCapacitiesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type LocationBasedModelCapacitiesListNextResponse = ModelCapacityListResult; + +// @public +export interface LocationBasedModelCapacitiesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type LocationBasedModelCapacitiesListResponse = ModelCapacityListResult; + // @public export interface MetricName { localizedValue?: string; @@ -1007,53 +1365,107 @@ export interface MetricName { // @public export interface Model { + description?: string; kind?: string; model?: AccountModel; skuName?: string; } // @public -export interface ModelDeprecationInfo { - fineTune?: string; - inference?: string; +export interface ModelCapacities { + list(modelFormat: string, modelName: string, modelVersion: string, options?: ModelCapacitiesListOptionalParams): PagedAsyncIterableIterator; } // @public -export type ModelLifecycleStatus = string; +export interface ModelCapacitiesListNextOptionalParams extends coreClient.OperationOptions { +} // @public -export interface ModelListResult { - nextLink?: string; - value?: Model[]; -} +export type ModelCapacitiesListNextResponse = ModelCapacityListResult; // @public -export interface Models { - list(location: string, options?: ModelsListOptionalParams): PagedAsyncIterableIterator; +export interface ModelCapacitiesListOptionalParams extends coreClient.OperationOptions { } // @public -export interface ModelSku { - capacity?: CapacityConfig; - deprecationDate?: Date; - name?: string; - rateLimits?: CallRateLimit[]; - usageName?: string; -} +export type ModelCapacitiesListResponse = ModelCapacityListResult; // @public -export interface ModelsListNextOptionalParams extends coreClient.OperationOptions { +export interface ModelCapacityCalculatorWorkload { + requestParameters?: ModelCapacityCalculatorWorkloadRequestParam; + requestPerMinute?: number; } // @public -export type ModelsListNextResponse = ModelListResult; +export interface ModelCapacityCalculatorWorkloadRequestParam { + avgGeneratedTokens?: number; + avgPromptTokens?: number; +} // @public -export interface ModelsListOptionalParams extends coreClient.OperationOptions { +export interface ModelCapacityListResult { + nextLink?: string; + value?: ModelCapacityListResultValueItem[]; } -// @public -export type ModelsListResponse = ModelListResult; +// @public (undocumented) +export interface ModelCapacityListResultValueItem extends ProxyResource { + location?: string; + properties?: ModelSkuCapacityProperties; +} + +// @public +export interface ModelDeprecationInfo { + fineTune?: string; + inference?: string; +} + +// @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; + cost?: BillingMeterInfo[]; + deprecationDate?: Date; + name?: string; + rateLimits?: CallRateLimit[]; + usageName?: string; +} + +// @public +export interface ModelSkuCapacityProperties { + availableCapacity?: number; + availableFinetuneCapacity?: number; + model?: DeploymentModel; + // (undocumented) + skuName?: 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 { @@ -1067,11 +1479,122 @@ export type NetworkRuleAction = string; // @public export interface NetworkRuleSet { + bypass?: ByPassSelection; defaultAction?: NetworkRuleAction; ipRules?: IpRule[]; virtualNetworkRules?: VirtualNetworkRule[]; } +// @public +export interface NetworkSecurityPerimeter { + id?: string; + location?: string; + perimeterGuid?: string; +} + +// @public +export interface NetworkSecurityPerimeterAccessRule { + name?: string; + properties?: NetworkSecurityPerimeterAccessRuleProperties; +} + +// @public +export interface NetworkSecurityPerimeterAccessRuleProperties { + addressPrefixes?: string[]; + direction?: NspAccessRuleDirection; + fullyQualifiedDomainNames?: string[]; + networkSecurityPerimeters?: NetworkSecurityPerimeter[]; + subscriptions?: NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem[]; +} + +// @public +export interface NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem { + id?: string; +} + +// @public +export interface NetworkSecurityPerimeterConfiguration extends ProxyResource { + properties?: NetworkSecurityPerimeterConfigurationProperties; +} + +// @public +export interface NetworkSecurityPerimeterConfigurationAssociationInfo { + accessMode?: string; + name?: string; +} + +// @public +export interface NetworkSecurityPerimeterConfigurationList { + nextLink?: string; + value?: NetworkSecurityPerimeterConfiguration[]; +} + +// @public +export interface NetworkSecurityPerimeterConfigurationProperties { + networkSecurityPerimeter?: NetworkSecurityPerimeter; + profile?: NetworkSecurityPerimeterProfileInfo; + provisioningIssues?: ProvisioningIssue[]; + readonly provisioningState?: string; + resourceAssociation?: NetworkSecurityPerimeterConfigurationAssociationInfo; +} + +// @public +export interface NetworkSecurityPerimeterConfigurations { + beginReconcile(resourceGroupName: string, accountName: string, nspConfigurationName: string, options?: NetworkSecurityPerimeterConfigurationsReconcileOptionalParams): Promise, NetworkSecurityPerimeterConfigurationsReconcileResponse>>; + beginReconcileAndWait(resourceGroupName: string, accountName: string, nspConfigurationName: string, options?: NetworkSecurityPerimeterConfigurationsReconcileOptionalParams): Promise; + get(resourceGroupName: string, accountName: string, nspConfigurationName: string, options?: NetworkSecurityPerimeterConfigurationsGetOptionalParams): Promise; + list(resourceGroupName: string, accountName: string, options?: NetworkSecurityPerimeterConfigurationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface NetworkSecurityPerimeterConfigurationsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NetworkSecurityPerimeterConfigurationsGetResponse = NetworkSecurityPerimeterConfiguration; + +// @public +export interface NetworkSecurityPerimeterConfigurationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NetworkSecurityPerimeterConfigurationsListNextResponse = NetworkSecurityPerimeterConfigurationList; + +// @public +export interface NetworkSecurityPerimeterConfigurationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NetworkSecurityPerimeterConfigurationsListResponse = NetworkSecurityPerimeterConfigurationList; + +// @public +export interface NetworkSecurityPerimeterConfigurationsReconcileHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface NetworkSecurityPerimeterConfigurationsReconcileOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type NetworkSecurityPerimeterConfigurationsReconcileResponse = NetworkSecurityPerimeterConfiguration; + +// @public +export interface NetworkSecurityPerimeterProfileInfo { + // (undocumented) + accessRules?: NetworkSecurityPerimeterAccessRule[]; + accessRulesVersion?: number; + diagnosticSettingsVersion?: number; + enabledLogCategories?: string[]; + name?: string; +} + +// @public +export type NspAccessRuleDirection = string; + // @public export interface Operation { readonly actionType?: ActionType; @@ -1236,6 +1759,21 @@ export interface PrivateLinkServiceConnectionState { status?: PrivateEndpointServiceConnectionStatus; } +// @public (undocumented) +export interface ProvisioningIssue { + name?: string; + properties?: ProvisioningIssueProperties; +} + +// @public +export interface ProvisioningIssueProperties { + description?: string; + issueType?: string; + severity?: string; + suggestedAccessRules?: NetworkSecurityPerimeterAccessRule[]; + suggestedResourceIds?: string[]; +} + // @public export type ProvisioningState = string; @@ -1259,6 +1797,325 @@ export interface QuotaLimit { // @public export type QuotaUsageStatus = string; +// @public +export interface RaiBlocklist extends ProxyResource { + readonly etag?: string; + properties?: RaiBlocklistProperties; + readonly systemData?: SystemData; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface RaiBlocklistConfig { + blocking?: boolean; + blocklistName?: string; +} + +// @public +export interface RaiBlocklistItem extends ProxyResource { + readonly etag?: string; + properties?: RaiBlocklistItemProperties; + readonly systemData?: SystemData; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface RaiBlocklistItemBulkRequest { + // (undocumented) + name?: string; + properties?: RaiBlocklistItemProperties; +} + +// @public +export interface RaiBlocklistItemProperties { + isRegex?: boolean; + pattern?: string; +} + +// @public +export interface RaiBlocklistItems { + batchAdd(resourceGroupName: string, accountName: string, raiBlocklistName: string, raiBlocklistItems: RaiBlocklistItemBulkRequest[], options?: RaiBlocklistItemsBatchAddOptionalParams): Promise; + batchDelete(resourceGroupName: string, accountName: string, raiBlocklistName: string, raiBlocklistItemsNames: Record, options?: RaiBlocklistItemsBatchDeleteOptionalParams): Promise; + beginDelete(resourceGroupName: string, accountName: string, raiBlocklistName: string, raiBlocklistItemName: string, options?: RaiBlocklistItemsDeleteOptionalParams): Promise, RaiBlocklistItemsDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, accountName: string, raiBlocklistName: string, raiBlocklistItemName: string, options?: RaiBlocklistItemsDeleteOptionalParams): Promise; + createOrUpdate(resourceGroupName: string, accountName: string, raiBlocklistName: string, raiBlocklistItemName: string, raiBlocklistItem: RaiBlocklistItem, options?: RaiBlocklistItemsCreateOrUpdateOptionalParams): Promise; + get(resourceGroupName: string, accountName: string, raiBlocklistName: string, raiBlocklistItemName: string, options?: RaiBlocklistItemsGetOptionalParams): Promise; + list(resourceGroupName: string, accountName: string, raiBlocklistName: string, options?: RaiBlocklistItemsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface RaiBlocklistItemsBatchAddOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RaiBlocklistItemsBatchAddResponse = RaiBlocklist; + +// @public +export interface RaiBlocklistItemsBatchDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface RaiBlocklistItemsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RaiBlocklistItemsCreateOrUpdateResponse = RaiBlocklistItem; + +// @public +export interface RaiBlocklistItemsDeleteHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface RaiBlocklistItemsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type RaiBlocklistItemsDeleteResponse = RaiBlocklistItemsDeleteHeaders; + +// @public +export interface RaiBlocklistItemsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RaiBlocklistItemsGetResponse = RaiBlocklistItem; + +// @public +export interface RaiBlocklistItemsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RaiBlocklistItemsListNextResponse = RaiBlockListItemsResult; + +// @public +export interface RaiBlocklistItemsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RaiBlocklistItemsListResponse = RaiBlockListItemsResult; + +// @public +export interface RaiBlockListItemsResult { + nextLink?: string; + value?: RaiBlocklistItem[]; +} + +// @public +export interface RaiBlocklistProperties { + description?: string; +} + +// @public +export interface RaiBlockListResult { + nextLink?: string; + value?: RaiBlocklist[]; +} + +// @public +export interface RaiBlocklists { + beginDelete(resourceGroupName: string, accountName: string, raiBlocklistName: string, options?: RaiBlocklistsDeleteOptionalParams): Promise, RaiBlocklistsDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, accountName: string, raiBlocklistName: string, options?: RaiBlocklistsDeleteOptionalParams): Promise; + createOrUpdate(resourceGroupName: string, accountName: string, raiBlocklistName: string, raiBlocklist: RaiBlocklist, options?: RaiBlocklistsCreateOrUpdateOptionalParams): Promise; + get(resourceGroupName: string, accountName: string, raiBlocklistName: string, options?: RaiBlocklistsGetOptionalParams): Promise; + list(resourceGroupName: string, accountName: string, options?: RaiBlocklistsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface RaiBlocklistsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RaiBlocklistsCreateOrUpdateResponse = RaiBlocklist; + +// @public +export interface RaiBlocklistsDeleteHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface RaiBlocklistsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type RaiBlocklistsDeleteResponse = RaiBlocklistsDeleteHeaders; + +// @public +export interface RaiBlocklistsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RaiBlocklistsGetResponse = RaiBlocklist; + +// @public +export interface RaiBlocklistsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RaiBlocklistsListNextResponse = RaiBlockListResult; + +// @public +export interface RaiBlocklistsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RaiBlocklistsListResponse = RaiBlockListResult; + +// @public +export interface RaiContentFilter extends ProxyResource { + properties?: RaiContentFilterProperties; +} + +// @public +export interface RaiContentFilterListResult { + nextLink?: string; + value?: RaiContentFilter[]; +} + +// @public +export interface RaiContentFilterProperties { + isMultiLevelFilter?: boolean; + name?: string; + source?: RaiPolicyContentSource; +} + +// @public +export interface RaiContentFilters { + get(location: string, filterName: string, options?: RaiContentFiltersGetOptionalParams): Promise; + list(location: string, options?: RaiContentFiltersListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface RaiContentFiltersGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RaiContentFiltersGetResponse = RaiContentFilter; + +// @public +export interface RaiContentFiltersListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RaiContentFiltersListNextResponse = RaiContentFilterListResult; + +// @public +export interface RaiContentFiltersListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RaiContentFiltersListResponse = RaiContentFilterListResult; + +// @public +export interface RaiMonitorConfig { + adxStorageResourceId?: string; + identityClientId?: string; +} + +// @public +export interface RaiPolicies { + beginDelete(resourceGroupName: string, accountName: string, raiPolicyName: string, options?: RaiPoliciesDeleteOptionalParams): Promise, RaiPoliciesDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, accountName: string, raiPolicyName: string, options?: RaiPoliciesDeleteOptionalParams): Promise; + createOrUpdate(resourceGroupName: string, accountName: string, raiPolicyName: string, raiPolicy: RaiPolicy, options?: RaiPoliciesCreateOrUpdateOptionalParams): Promise; + get(resourceGroupName: string, accountName: string, raiPolicyName: string, options?: RaiPoliciesGetOptionalParams): Promise; + list(resourceGroupName: string, accountName: string, options?: RaiPoliciesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface RaiPoliciesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RaiPoliciesCreateOrUpdateResponse = RaiPolicy; + +// @public +export interface RaiPoliciesDeleteHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface RaiPoliciesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type RaiPoliciesDeleteResponse = RaiPoliciesDeleteHeaders; + +// @public +export interface RaiPoliciesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RaiPoliciesGetResponse = RaiPolicy; + +// @public +export interface RaiPoliciesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RaiPoliciesListNextResponse = RaiPolicyListResult; + +// @public +export interface RaiPoliciesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RaiPoliciesListResponse = RaiPolicyListResult; + +// @public +export interface RaiPolicy extends ProxyResource { + readonly etag?: string; + properties?: RaiPolicyProperties; + readonly systemData?: SystemData; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface RaiPolicyContentFilter { + blocking?: boolean; + enabled?: boolean; + name?: string; + severityThreshold?: ContentLevel; + source?: RaiPolicyContentSource; +} + +// @public +export type RaiPolicyContentSource = string; + +// @public +export interface RaiPolicyListResult { + nextLink?: string; + value?: RaiPolicy[]; +} + +// @public +export type RaiPolicyMode = string; + +// @public +export interface RaiPolicyProperties { + basePolicyName?: string; + contentFilters?: RaiPolicyContentFilter[]; + customBlocklists?: CustomBlocklistConfig[]; + mode?: RaiPolicyMode; + readonly type?: RaiPolicyType; +} + +// @public +export type RaiPolicyType = string; + // @public export interface RegenerateKeyParameters { keyName: KeyName; @@ -1384,6 +2241,13 @@ export interface SkuChangeInfo { lastChangeDate?: string; } +// @public +export interface SkuResource { + capacity?: CapacityConfig; + resourceType?: string; + sku?: Sku; +} + // @public export type SkuTier = string; @@ -1459,6 +2323,12 @@ export interface UserAssignedIdentity { readonly principalId?: string; } +// @public +export interface UserOwnedAmlWorkspace { + identityClientId?: string; + resourceId?: string; +} + // @public export interface UserOwnedStorage { // (undocumented) diff --git a/sdk/cognitiveservices/arm-cognitiveservices/sample.env b/sdk/cognitiveservices/arm-cognitiveservices/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/sample.env +++ b/sdk/cognitiveservices/arm-cognitiveservices/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/cognitiveServicesManagementClient.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/cognitiveServicesManagementClient.ts index 23eae2c48e37..e55901ff1939 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/cognitiveServicesManagementClient.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/cognitiveServicesManagementClient.ts @@ -11,7 +11,7 @@ import * as coreRestPipeline from "@azure/core-rest-pipeline"; import { PipelineRequest, PipelineResponse, - SendRequest + SendRequest, } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { @@ -22,10 +22,19 @@ import { OperationsImpl, CommitmentTiersImpl, ModelsImpl, + LocationBasedModelCapacitiesImpl, + ModelCapacitiesImpl, PrivateEndpointConnectionsImpl, PrivateLinkResourcesImpl, DeploymentsImpl, - CommitmentPlansImpl + CommitmentPlansImpl, + EncryptionScopesImpl, + RaiPoliciesImpl, + RaiBlocklistsImpl, + RaiBlocklistItemsImpl, + RaiContentFiltersImpl, + NetworkSecurityPerimeterConfigurationsImpl, + DefenderForAISettingsImpl, } from "./operations"; import { Accounts, @@ -35,10 +44,19 @@ import { Operations, CommitmentTiers, Models, + LocationBasedModelCapacities, + ModelCapacities, PrivateEndpointConnections, PrivateLinkResources, Deployments, - CommitmentPlans + CommitmentPlans, + EncryptionScopes, + RaiPolicies, + RaiBlocklists, + RaiBlocklistItems, + RaiContentFilters, + NetworkSecurityPerimeterConfigurations, + DefenderForAISettings, } from "./operationsInterfaces"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; @@ -47,7 +65,9 @@ import { CheckSkuAvailabilityOptionalParams, CheckSkuAvailabilityResponse, CheckDomainAvailabilityOptionalParams, - CheckDomainAvailabilityResponse + CheckDomainAvailabilityResponse, + CalculateModelCapacityOptionalParams, + CalculateModelCapacityResponse, } from "./models"; export class CognitiveServicesManagementClient extends coreClient.ServiceClient { @@ -64,7 +84,7 @@ export class CognitiveServicesManagementClient extends coreClient.ServiceClient constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: CognitiveServicesManagementClientOptionalParams + options?: CognitiveServicesManagementClientOptionalParams, ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); @@ -79,10 +99,10 @@ export class CognitiveServicesManagementClient extends coreClient.ServiceClient } const defaults: CognitiveServicesManagementClientOptionalParams = { requestContentType: "application/json; charset=utf-8", - credential: credentials + credential: credentials, }; - const packageDetails = `azsdk-js-arm-cognitiveservices/7.5.0`; + const packageDetails = `azsdk-js-arm-cognitiveservices/7.6.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -92,20 +112,21 @@ export class CognitiveServicesManagementClient extends coreClient.ServiceClient ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + options.endpoint ?? options.baseUri ?? "https://management.azure.com", }; super(optionsWithDefaults); let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { - const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName + coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -115,7 +136,7 @@ export class CognitiveServicesManagementClient extends coreClient.ServiceClient !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ @@ -125,9 +146,9 @@ export class CognitiveServicesManagementClient extends coreClient.ServiceClient `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -135,7 +156,7 @@ export class CognitiveServicesManagementClient extends coreClient.ServiceClient // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2023-05-01"; + this.apiVersion = options.apiVersion || "2024-10-01"; this.accounts = new AccountsImpl(this); this.deletedAccounts = new DeletedAccountsImpl(this); this.resourceSkus = new ResourceSkusImpl(this); @@ -143,10 +164,22 @@ export class CognitiveServicesManagementClient extends coreClient.ServiceClient this.operations = new OperationsImpl(this); this.commitmentTiers = new CommitmentTiersImpl(this); this.models = new ModelsImpl(this); + this.locationBasedModelCapacities = new LocationBasedModelCapacitiesImpl( + this, + ); + this.modelCapacities = new ModelCapacitiesImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); this.privateLinkResources = new PrivateLinkResourcesImpl(this); this.deployments = new DeploymentsImpl(this); this.commitmentPlans = new CommitmentPlansImpl(this); + this.encryptionScopes = new EncryptionScopesImpl(this); + this.raiPolicies = new RaiPoliciesImpl(this); + this.raiBlocklists = new RaiBlocklistsImpl(this); + this.raiBlocklistItems = new RaiBlocklistItemsImpl(this); + this.raiContentFilters = new RaiContentFiltersImpl(this); + this.networkSecurityPerimeterConfigurations = + new NetworkSecurityPerimeterConfigurationsImpl(this); + this.defenderForAISettings = new DefenderForAISettingsImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -159,7 +192,7 @@ export class CognitiveServicesManagementClient extends coreClient.ServiceClient name: "CustomApiVersionPolicy", async sendRequest( request: PipelineRequest, - next: SendRequest + next: SendRequest, ): Promise { const param = request.url.split("?"); if (param.length > 1) { @@ -173,7 +206,7 @@ export class CognitiveServicesManagementClient extends coreClient.ServiceClient request.url = param[0] + "?" + newParams.join("&"); } return next(request); - } + }, }; this.pipeline.addPolicy(apiVersionPolicy); } @@ -182,7 +215,7 @@ export class CognitiveServicesManagementClient extends coreClient.ServiceClient * Check available SKUs. * @param location Resource location. * @param skus The SKU of the resource. - * @param kind The Kind of the resource. + * @param kind The kind (type) of cognitive service account. * @param typeParam The Type of the resource. * @param options The options parameters. */ @@ -191,11 +224,11 @@ export class CognitiveServicesManagementClient extends coreClient.ServiceClient skus: string[], kind: string, typeParam: string, - options?: CheckSkuAvailabilityOptionalParams + options?: CheckSkuAvailabilityOptionalParams, ): Promise { return this.sendOperationRequest( { location, skus, kind, typeParam, options }, - checkSkuAvailabilityOperationSpec + checkSkuAvailabilityOperationSpec, ); } @@ -208,11 +241,24 @@ export class CognitiveServicesManagementClient extends coreClient.ServiceClient checkDomainAvailability( subdomainName: string, typeParam: string, - options?: CheckDomainAvailabilityOptionalParams + options?: CheckDomainAvailabilityOptionalParams, ): Promise { return this.sendOperationRequest( { subdomainName, typeParam, options }, - checkDomainAvailabilityOperationSpec + checkDomainAvailabilityOperationSpec, + ); + } + + /** + * Model capacity calculator. + * @param options The options parameters. + */ + calculateModelCapacity( + options?: CalculateModelCapacityOptionalParams, + ): Promise { + return this.sendOperationRequest( + { options }, + calculateModelCapacityOperationSpec, ); } @@ -223,63 +269,95 @@ export class CognitiveServicesManagementClient extends coreClient.ServiceClient operations: Operations; commitmentTiers: CommitmentTiers; models: Models; + locationBasedModelCapacities: LocationBasedModelCapacities; + modelCapacities: ModelCapacities; privateEndpointConnections: PrivateEndpointConnections; privateLinkResources: PrivateLinkResources; deployments: Deployments; commitmentPlans: CommitmentPlans; + encryptionScopes: EncryptionScopes; + raiPolicies: RaiPolicies; + raiBlocklists: RaiBlocklists; + raiBlocklistItems: RaiBlocklistItems; + raiContentFilters: RaiContentFilters; + networkSecurityPerimeterConfigurations: NetworkSecurityPerimeterConfigurations; + defenderForAISettings: DefenderForAISettings; } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const checkSkuAvailabilityOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/checkSkuAvailability", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/checkSkuAvailability", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.SkuAvailabilityListResult + bodyMapper: Mappers.SkuAvailabilityListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: { parameterPath: { skus: ["skus"], kind: ["kind"], typeParam: ["typeParam"] }, - mapper: { ...Mappers.CheckSkuAvailabilityParameter, required: true } + mapper: { ...Mappers.CheckSkuAvailabilityParameter, required: true }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.location + Parameters.location, ], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const checkDomainAvailabilityOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/checkDomainAvailability", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/checkDomainAvailability", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.DomainAvailability + bodyMapper: Mappers.DomainAvailability, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: { parameterPath: { subdomainName: ["subdomainName"], typeParam: ["typeParam"], - kind: ["options", "kind"] + kind: ["options", "kind"], + }, + mapper: { ...Mappers.CheckDomainAvailabilityParameter, required: true }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer, +}; +const calculateModelCapacityOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/calculateModelCapacity", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.CalculateModelCapacityResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: { + parameterPath: { + model: ["options", "model"], + skuName: ["options", "skuName"], + workloads: ["options", "workloads"], }, - mapper: { ...Mappers.CheckDomainAvailabilityParameter, required: true } + mapper: { ...Mappers.CalculateModelCapacityParameter, required: true }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/lroImpl.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/lroImpl.ts index 52f6eaacfb83..5f88efab981b 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/lroImpl.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/lroImpl.ts @@ -28,15 +28,15 @@ export function createLroSpec(inputs: { sendInitialRequest: () => sendOperationFn(args, spec), sendPollRequest: ( path: string, - options?: { abortSignal?: AbortSignalLike } + options?: { abortSignal?: AbortSignalLike }, ) => { const { requestBody, ...restSpec } = spec; return sendOperationFn(args, { ...restSpec, httpMethod: "GET", path, - abortSignal: options?.abortSignal + abortSignal: options?.abortSignal, }); - } + }, }; } diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/models/index.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/models/index.ts index 921b436e4740..e3870063ef91 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/models/index.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/models/index.ts @@ -112,6 +112,8 @@ export interface AccountProperties { encryption?: Encryption; /** The storage accounts for this resource. */ userOwnedStorage?: UserOwnedStorage[]; + /** The user owned AML workspace properties. */ + amlWorkspace?: UserOwnedAmlWorkspace; /** * The private endpoint connection associated with the Cognitive Services account. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -166,6 +168,8 @@ export interface AccountProperties { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly abusePenalty?: AbusePenalty; + /** Cognitive Services Rai Monitor Config. */ + raiMonitorConfig?: RaiMonitorConfig; } /** SkuCapability indicates the capability of a certain feature. */ @@ -190,6 +194,8 @@ export interface SkuChangeInfo { export interface NetworkRuleSet { /** The default action when no rule from ipRules and from virtualNetworkRules match. This is only used after the bypass property has been evaluated. */ defaultAction?: NetworkRuleAction; + /** Setting for trusted services. */ + bypass?: ByPassSelection; /** The list of IP address rules. */ ipRules?: IpRule[]; /** The list of virtual network rules. */ @@ -238,6 +244,14 @@ export interface UserOwnedStorage { identityClientId?: string; } +/** The user owned AML workspace for Cognitive Services account. */ +export interface UserOwnedAmlWorkspace { + /** Full resource id of a AML workspace resource. */ + resourceId?: string; + /** Identity Client id of a AML workspace resource. */ + identityClientId?: string; +} + /** Properties of the PrivateEndpointConnectProperties. */ export interface PrivateEndpointConnectionProperties { /** The resource of private end point. */ @@ -381,6 +395,14 @@ export interface AbusePenalty { expiration?: Date; } +/** Cognitive Services Rai Monitor Config. */ +export interface RaiMonitorConfig { + /** The storage resource Id. */ + adxStorageResourceId?: string; + /** The identity client Id to access the storage. */ + identityClientId?: string; +} + /** 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. */ @@ -556,6 +578,8 @@ export interface AccountModelListResult { /** Properties of Cognitive Services account deployment model. */ export interface DeploymentModel { + /** Deployment model publisher. */ + publisher?: string; /** Deployment model format. */ format?: string; /** Deployment model name. */ @@ -564,6 +588,8 @@ export interface DeploymentModel { version?: string; /** Optional. Deployment model source ARM resource ID. */ source?: string; + /** Optional. Source of the model, another Microsoft.CognitiveServices accounts ARM resource ID. */ + sourceAccount?: string; /** * The call rate limit Cognitive Services account. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -583,6 +609,8 @@ export interface ModelSku { capacity?: CapacityConfig; /** The list of rateLimit. */ rateLimits?: CallRateLimit[]; + /** The list of billing meter info. */ + cost?: BillingMeterInfo[]; } /** The capacity configuration. */ @@ -595,6 +623,14 @@ export interface CapacityConfig { step?: number; /** The default capacity. */ default?: number; + /** The array of allowed values for capacity. */ + allowedValues?: number[]; +} + +export interface BillingMeterInfo { + name?: string; + meterId?: string; + unit?: string; } /** Cognitive Services account ModelDeprecationInfo. */ @@ -673,7 +709,7 @@ export interface OperationDisplay { export interface CheckSkuAvailabilityParameter { /** The SKU of the resource. */ skus: string[]; - /** The Kind of the resource. */ + /** The kind (type) of cognitive service account. */ kind: string; /** The Type of the resource. */ type: string; @@ -758,12 +794,33 @@ export interface ModelListResult { /** Cognitive Services Model. */ export interface Model { - /** Model Metadata. */ + /** Cognitive Services account Model. */ model?: AccountModel; - /** The Kind of the Model. */ + /** The kind (type) of cognitive service account. */ kind?: string; - /** The SKU of the Model. */ + /** The name of SKU. */ + skuName?: string; + /** The description of the model. */ + description?: string; +} + +/** The list of cognitive services accounts operation response. */ +export interface ModelCapacityListResult { + /** The link used to get the next page of ModelSkuCapacity. */ + nextLink?: string; + /** Gets the list of Cognitive Services accounts ModelSkuCapacity. */ + value?: ModelCapacityListResultValueItem[]; +} + +/** Cognitive Services account ModelSkuCapacity. */ +export interface ModelSkuCapacityProperties { + /** Properties of Cognitive Services account deployment model. */ + model?: DeploymentModel; skuName?: string; + /** The available capacity for deployment with this model and sku. */ + availableCapacity?: number; + /** The available capacity for deployment with a fine-tune version of this model and sku. */ + availableFinetuneCapacity?: number; } /** Check Domain availability parameter. */ @@ -790,6 +847,47 @@ export interface DomainAvailability { kind?: string; } +/** Calculate Model Capacity parameter. */ +export interface CalculateModelCapacityParameter { + /** Properties of Cognitive Services account deployment model. */ + model?: DeploymentModel; + /** The name of SKU. */ + skuName?: string; + /** List of Model Capacity Calculator Workload. */ + workloads?: ModelCapacityCalculatorWorkload[]; +} + +/** Model Capacity Calculator Workload. */ +export interface ModelCapacityCalculatorWorkload { + /** Request per minute. */ + requestPerMinute?: number; + /** Dictionary, Model Capacity Calculator Workload Parameters. */ + requestParameters?: ModelCapacityCalculatorWorkloadRequestParam; +} + +/** Dictionary, Model Capacity Calculator Workload Parameters. */ +export interface ModelCapacityCalculatorWorkloadRequestParam { + /** Average prompt tokens. */ + avgPromptTokens?: number; + /** Average generated tokens. */ + avgGeneratedTokens?: number; +} + +/** Calculate Model Capacity result. */ +export interface CalculateModelCapacityResult { + /** Properties of Cognitive Services account deployment model. */ + model?: DeploymentModel; + skuName?: string; + /** Model Estimated Capacity. */ + estimatedCapacity?: CalculateModelCapacityResultEstimatedCapacity; +} + +/** Model Estimated Capacity. */ +export interface CalculateModelCapacityResultEstimatedCapacity { + value?: number; + deployableValue?: number; +} + /** A list of private endpoint connections */ export interface PrivateEndpointConnectionListResult { /** Array of private endpoint connections */ @@ -843,7 +941,7 @@ export interface DeploymentProperties { readonly provisioningState?: DeploymentProvisioningState; /** Properties of Cognitive Services account deployment model. */ model?: DeploymentModel; - /** Properties of Cognitive Services account deployment model. */ + /** Properties of Cognitive Services account deployment model. (Deprecated, please use Deployment.sku instead.) */ scaleSettings?: DeploymentScaleSettings; /** * The capabilities. @@ -861,9 +959,20 @@ export interface DeploymentProperties { readonly rateLimits?: ThrottlingRule[]; /** Deployment model version upgrade option. */ versionUpgradeOption?: DeploymentModelVersionUpgradeOption; + /** + * If the dynamic throttling is enabled. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly dynamicThrottlingEnabled?: boolean; + /** The current capacity. */ + currentCapacity?: number; + /** Internal use only. */ + capacitySettings?: DeploymentCapacitySettings; + /** The name of parent deployment. */ + parentDeploymentName?: string; } -/** Properties of Cognitive Services account deployment model. */ +/** Properties of Cognitive Services account deployment model. (Deprecated, please use Deployment.sku instead.) */ export interface DeploymentScaleSettings { /** Deployment scale type. */ scaleType?: DeploymentScaleType; @@ -876,6 +985,41 @@ export interface DeploymentScaleSettings { readonly activeCapacity?: number; } +/** Internal use only. */ +export interface DeploymentCapacitySettings { + /** The designated capacity. */ + designatedCapacity?: number; + /** The priority of this capacity setting. */ + priority?: number; +} + +/** The object being used to update tags of a resource, in general used for PATCH operations. */ +export interface PatchResourceTags { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; +} + +/** The list of cognitive services accounts operation response. */ +export interface DeploymentSkuListResult { + /** The link used to get the next page of deployment skus. */ + nextLink?: string; + /** + * Gets the list of Cognitive Services accounts deployment skus. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: SkuResource[]; +} + +/** Properties of Cognitive Services account resource sku resource properties. */ +export interface SkuResource { + /** The resource type name. */ + resourceType?: string; + /** The resource model definition representing SKU */ + sku?: Sku; + /** The capacity configuration. */ + capacity?: CapacityConfig; +} + /** The list of cognitive services accounts operation response. */ export interface CommitmentPlanListResult { /** The link used to get the next page of CommitmentPlan. */ @@ -941,10 +1085,114 @@ export interface CommitmentPeriod { readonly endDate?: string; } -/** The object being used to update tags of a resource, in general used for PATCH operations. */ -export interface PatchResourceTags { - /** Resource tags. */ - tags?: { [propertyName: string]: string }; +/** The list of cognitive services EncryptionScopes. */ +export interface EncryptionScopeListResult { + /** The link used to get the next page of EncryptionScope. */ + nextLink?: string; + /** The list of EncryptionScope. */ + value?: EncryptionScope[]; +} + +/** The list of cognitive services RaiPolicies. */ +export interface RaiPolicyListResult { + /** The link used to get the next page of RaiPolicy. */ + nextLink?: string; + /** The list of RaiPolicy. */ + value?: RaiPolicy[]; +} + +/** Azure OpenAI Content Filters properties. */ +export interface RaiPolicyProperties { + /** + * Content Filters policy type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: RaiPolicyType; + /** Rai policy mode. The enum value mapping is as below: Default = 0, Deferred=1, Blocking=2, Asynchronous_filter =3. Please use 'Asynchronous_filter' after 2024-10-01. It is the same as 'Deferred' in previous version. */ + mode?: RaiPolicyMode; + /** Name of Rai policy. */ + basePolicyName?: string; + /** The list of Content Filters. */ + contentFilters?: RaiPolicyContentFilter[]; + /** The list of custom Blocklist. */ + customBlocklists?: CustomBlocklistConfig[]; +} + +/** Azure OpenAI Content Filter. */ +export interface RaiPolicyContentFilter { + /** Name of ContentFilter. */ + name?: string; + /** If the ContentFilter is enabled. */ + enabled?: boolean; + /** Level at which content is filtered. */ + severityThreshold?: ContentLevel; + /** If blocking would occur. */ + blocking?: boolean; + /** Content source to apply the Content Filters. */ + source?: RaiPolicyContentSource; +} + +/** Azure OpenAI blocklist config. */ +export interface RaiBlocklistConfig { + /** Name of ContentFilter. */ + blocklistName?: string; + /** If blocking would occur. */ + blocking?: boolean; +} + +/** The list of cognitive services RAI Blocklists. */ +export interface RaiBlockListResult { + /** The link used to get the next page of RaiBlocklists. */ + nextLink?: string; + /** The list of RaiBlocklist. */ + value?: RaiBlocklist[]; +} + +/** RAI Custom Blocklist properties. */ +export interface RaiBlocklistProperties { + /** Description of the block list. */ + description?: string; +} + +/** The list of cognitive services RAI Blocklist Items. */ +export interface RaiBlockListItemsResult { + /** The link used to get the next page of RaiBlocklistItems. */ + nextLink?: string; + /** The list of RaiBlocklistItems. */ + value?: RaiBlocklistItem[]; +} + +/** RAI Custom Blocklist Item properties. */ +export interface RaiBlocklistItemProperties { + /** Pattern to match against. */ + pattern?: string; + /** If the pattern is a regex pattern. */ + isRegex?: boolean; +} + +/** The Cognitive Services RaiBlocklist Item request body. */ +export interface RaiBlocklistItemBulkRequest { + name?: string; + /** Properties of Cognitive Services RaiBlocklist Item. */ + properties?: RaiBlocklistItemProperties; +} + +/** The list of Content Filters. */ +export interface RaiContentFilterListResult { + /** The link used to get the next page of Content Filters. */ + nextLink?: string; + /** The list of RaiContentFilter. */ + value?: RaiContentFilter[]; +} + +/** Azure OpenAI Content Filter Properties. */ +export interface RaiContentFilterProperties { + /** Name of Content Filter. */ + name?: string; + /** If the Content Filter has multi severity levels(Low, Medium, or High). */ + isMultiLevelFilter?: boolean; + /** Content source to apply the Content Filters. */ + source?: RaiPolicyContentSource; } /** The list of cognitive services Commitment Plan Account Association operation response. */ @@ -958,6 +1206,130 @@ export interface CommitmentPlanAccountAssociationListResult { readonly value?: CommitmentPlanAccountAssociation[]; } +/** A list of NSP configurations for an Cognitive Services account. */ +export interface NetworkSecurityPerimeterConfigurationList { + /** Array of NSP configurations List Result for an Cognitive Services account. */ + value?: NetworkSecurityPerimeterConfiguration[]; + /** Link to retrieve next page of results. */ + nextLink?: string; +} + +/** The properties of an NSP Configuration. */ +export interface NetworkSecurityPerimeterConfigurationProperties { + /** + * Provisioning state of NetworkSecurityPerimeter configuration + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** List of Provisioning Issues */ + provisioningIssues?: ProvisioningIssue[]; + /** Information about a linked Network Security Perimeter */ + networkSecurityPerimeter?: NetworkSecurityPerimeter; + /** Network Security Perimeter Configuration Association Information */ + resourceAssociation?: NetworkSecurityPerimeterConfigurationAssociationInfo; + /** Network Security Perimeter Profile Information */ + profile?: NetworkSecurityPerimeterProfileInfo; +} + +export interface ProvisioningIssue { + /** Name of the NSP provisioning issue */ + name?: string; + /** Properties of Provisioning Issue */ + properties?: ProvisioningIssueProperties; +} + +/** Properties of Provisioning Issue */ +export interface ProvisioningIssueProperties { + /** Type of Issue */ + issueType?: string; + /** Severity of the issue */ + severity?: string; + /** Description of the issue */ + description?: string; + /** IDs of resources that can be associated to the same perimeter to remediate the issue. */ + suggestedResourceIds?: string[]; + /** Optional array, suggested access rules */ + suggestedAccessRules?: NetworkSecurityPerimeterAccessRule[]; +} + +/** Network Security Perimeter Access Rule */ +export interface NetworkSecurityPerimeterAccessRule { + /** Network Security Perimeter Access Rule Name */ + name?: string; + /** Properties of Network Security Perimeter Access Rule */ + properties?: NetworkSecurityPerimeterAccessRuleProperties; +} + +/** The Properties of Network Security Perimeter Rule */ +export interface NetworkSecurityPerimeterAccessRuleProperties { + /** Direction of Access Rule */ + direction?: NspAccessRuleDirection; + /** Address prefixes for inbound rules */ + addressPrefixes?: string[]; + /** Subscriptions for inbound rules */ + subscriptions?: NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem[]; + /** NetworkSecurityPerimeters for inbound rules */ + networkSecurityPerimeters?: NetworkSecurityPerimeter[]; + /** Fully qualified domain name for outbound rules */ + fullyQualifiedDomainNames?: string[]; +} + +/** Subscription for inbound rule */ +export interface NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem { + /** Fully qualified identifier of subscription */ + id?: string; +} + +/** Information about a linked Network Security Perimeter */ +export interface NetworkSecurityPerimeter { + /** Fully qualified identifier of the resource */ + id?: string; + /** Guid of the resource */ + perimeterGuid?: string; + /** Location of the resource */ + location?: string; +} + +/** Network Security Perimeter Configuration Association Information */ +export interface NetworkSecurityPerimeterConfigurationAssociationInfo { + /** Name of the resource association */ + name?: string; + /** Access Mode of the resource association */ + accessMode?: string; +} + +/** Network Security Perimeter Profile Information */ +export interface NetworkSecurityPerimeterProfileInfo { + /** Name of the resource profile */ + name?: string; + /** Access rules version of the resource profile */ + accessRulesVersion?: number; + accessRules?: NetworkSecurityPerimeterAccessRule[]; + /** Current diagnostic settings version */ + diagnosticSettingsVersion?: number; + /** List of enabled log categories */ + enabledLogCategories?: string[]; +} + +/** The list of cognitive services Defender for AI Settings. */ +export interface DefenderForAISettingResult { + /** The link used to get the next page of Defender for AI Settings. */ + nextLink?: string; + /** The list of Defender for AI Settings. */ + value?: DefenderForAISetting[]; +} + +/** Properties to EncryptionScope */ +export interface EncryptionScopeProperties extends Encryption { + /** + * Gets the status of the resource at the time the operation was called. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: EncryptionScopeProvisioningState; + /** The encryptionScope state. */ + state?: EncryptionScopeState; +} + /** The resource model definition for an Azure Resource Manager resource with an etag. */ export interface AzureEntityResource extends Resource { /** @@ -967,18 +1339,18 @@ export interface AzureEntityResource extends Resource { readonly etag?: string; } +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export interface ProxyResource extends Resource {} + /** A private link resource */ export interface PrivateLinkResource extends Resource { /** Resource properties. */ properties?: PrivateLinkResourceProperties; } -/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ -export interface ProxyResource extends Resource {} - /** Cognitive Services account Model. */ export interface AccountModel extends DeploymentModel { - /** Base Model Identifier. */ + /** Properties of Cognitive Services account deployment model. */ baseModel?: DeploymentModel; /** If the model is default version. */ isDefaultVersion?: boolean; @@ -1007,6 +1379,12 @@ export interface PatchResourceTagsAndSku extends PatchResourceTags { sku?: Sku; } +/** Gets or sets the source to which filter applies. */ +export interface CustomBlocklistConfig extends RaiBlocklistConfig { + /** Content source to apply the Content Filters. */ + source?: RaiPolicyContentSource; +} + /** The Private Endpoint Connection resource. */ export interface PrivateEndpointConnection extends AzureEntityResource { /** Resource properties. */ @@ -1041,6 +1419,13 @@ export interface Account extends AzureEntityResource { properties?: AccountProperties; } +export interface ModelCapacityListResultValueItem extends ProxyResource { + /** The location of the Model Sku Capacity. */ + location?: string; + /** Cognitive Services account ModelSkuCapacity. */ + properties?: ModelSkuCapacityProperties; +} + /** Cognitive Services account deployment. */ export interface Deployment extends ProxyResource { /** The resource model definition representing SKU */ @@ -1055,6 +1440,8 @@ export interface Deployment extends ProxyResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly etag?: string; + /** Resource tags. */ + tags?: { [propertyName: string]: string }; /** Properties of Cognitive Services account deployment. */ properties?: DeploymentProperties; } @@ -1083,6 +1470,84 @@ export interface CommitmentPlan extends ProxyResource { properties?: CommitmentPlanProperties; } +/** Cognitive Services EncryptionScope */ +export interface EncryptionScope extends ProxyResource { + /** + * 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; + /** + * Resource Etag. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly etag?: string; + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** Properties of Cognitive Services EncryptionScope. */ + properties?: EncryptionScopeProperties; +} + +/** Cognitive Services RaiPolicy. */ +export interface RaiPolicy extends ProxyResource { + /** + * 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; + /** + * Resource Etag. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly etag?: string; + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** Properties of Cognitive Services RaiPolicy. */ + properties?: RaiPolicyProperties; +} + +/** Cognitive Services RaiBlocklist. */ +export interface RaiBlocklist extends ProxyResource { + /** + * 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; + /** + * Resource Etag. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly etag?: string; + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** Properties of Cognitive Services RaiBlocklist. */ + properties?: RaiBlocklistProperties; +} + +/** Cognitive Services RaiBlocklist Item. */ +export interface RaiBlocklistItem extends ProxyResource { + /** + * 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; + /** + * Resource Etag. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly etag?: string; + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** Properties of Cognitive Services RaiBlocklist Item. */ + properties?: RaiBlocklistItemProperties; +} + +/** Azure OpenAI Content Filter. */ +export interface RaiContentFilter extends ProxyResource { + /** Azure OpenAI Content Filter Properties. */ + properties?: RaiContentFilterProperties; +} + /** The commitment plan association. */ export interface CommitmentPlanAccountAssociation extends ProxyResource { /** @@ -1095,10 +1560,41 @@ export interface CommitmentPlanAccountAssociation extends ProxyResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly etag?: string; + /** Resource tags. */ + tags?: { [propertyName: string]: string }; /** The Azure resource id of the account. */ accountId?: string; } +/** NSP Configuration for an Cognitive Services account. */ +export interface NetworkSecurityPerimeterConfiguration extends ProxyResource { + /** NSP Configuration properties. */ + properties?: NetworkSecurityPerimeterConfigurationProperties; +} + +/** The Defender for AI resource. */ +export interface DefenderForAISetting extends ProxyResource { + /** + * 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; + /** + * Resource Etag. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly etag?: string; + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** Defender for AI state on the AI resource. */ + state?: DefenderForAISettingState; +} + +/** Defines headers for Deployments_update operation. */ +export interface DeploymentsUpdateHeaders { + location?: string; +} + /** Defines headers for CommitmentPlans_updatePlan operation. */ export interface CommitmentPlansUpdatePlanHeaders { location?: string; @@ -1114,6 +1610,31 @@ export interface CommitmentPlansDeleteAssociationHeaders { location?: string; } +/** Defines headers for EncryptionScopes_delete operation. */ +export interface EncryptionScopesDeleteHeaders { + location?: string; +} + +/** Defines headers for RaiPolicies_delete operation. */ +export interface RaiPoliciesDeleteHeaders { + location?: string; +} + +/** Defines headers for RaiBlocklists_delete operation. */ +export interface RaiBlocklistsDeleteHeaders { + location?: string; +} + +/** Defines headers for RaiBlocklistItems_delete operation. */ +export interface RaiBlocklistItemsDeleteHeaders { + location?: string; +} + +/** Defines headers for NetworkSecurityPerimeterConfigurations_reconcile operation. */ +export interface NetworkSecurityPerimeterConfigurationsReconcileHeaders { + location?: string; +} + /** Known values of {@link SkuTier} that the service accepts. */ export enum KnownSkuTier { /** Free */ @@ -1125,7 +1646,7 @@ export enum KnownSkuTier { /** Premium */ Premium = "Premium", /** Enterprise */ - Enterprise = "Enterprise" + Enterprise = "Enterprise", } /** @@ -1150,7 +1671,7 @@ export enum KnownCreatedByType { /** ManagedIdentity */ ManagedIdentity = "ManagedIdentity", /** Key */ - Key = "Key" + Key = "Key", } /** @@ -1180,7 +1701,7 @@ export enum KnownProvisioningState { /** Succeeded */ Succeeded = "Succeeded", /** ResolvingDNS */ - ResolvingDNS = "ResolvingDNS" + ResolvingDNS = "ResolvingDNS", } /** @@ -1203,7 +1724,7 @@ export enum KnownNetworkRuleAction { /** Allow */ Allow = "Allow", /** Deny */ - Deny = "Deny" + Deny = "Deny", } /** @@ -1216,12 +1737,30 @@ export enum KnownNetworkRuleAction { */ export type NetworkRuleAction = string; +/** Known values of {@link ByPassSelection} that the service accepts. */ +export enum KnownByPassSelection { + /** None */ + None = "None", + /** AzureServices */ + AzureServices = "AzureServices", +} + +/** + * Defines values for ByPassSelection. \ + * {@link KnownByPassSelection} can be used interchangeably with ByPassSelection, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **AzureServices** + */ +export type ByPassSelection = string; + /** Known values of {@link KeySource} that the service accepts. */ export enum KnownKeySource { /** MicrosoftCognitiveServices */ MicrosoftCognitiveServices = "Microsoft.CognitiveServices", /** MicrosoftKeyVault */ - MicrosoftKeyVault = "Microsoft.KeyVault" + MicrosoftKeyVault = "Microsoft.KeyVault", } /** @@ -1241,7 +1780,7 @@ export enum KnownPrivateEndpointServiceConnectionStatus { /** Approved */ Approved = "Approved", /** Rejected */ - Rejected = "Rejected" + Rejected = "Rejected", } /** @@ -1264,7 +1803,7 @@ export enum KnownPrivateEndpointConnectionProvisioningState { /** Deleting */ Deleting = "Deleting", /** Failed */ - Failed = "Failed" + Failed = "Failed", } /** @@ -1284,7 +1823,7 @@ export enum KnownPublicNetworkAccess { /** Enabled */ Enabled = "Enabled", /** Disabled */ - Disabled = "Disabled" + Disabled = "Disabled", } /** @@ -1304,7 +1843,7 @@ export enum KnownRoutingMethods { /** Weighted */ Weighted = "Weighted", /** Performance */ - Performance = "Performance" + Performance = "Performance", } /** @@ -1323,7 +1862,7 @@ export enum KnownAbusePenaltyAction { /** Throttle */ Throttle = "Throttle", /** Block */ - Block = "Block" + Block = "Block", } /** @@ -1341,7 +1880,7 @@ export enum KnownResourceSkuRestrictionsReasonCode { /** QuotaId */ QuotaId = "QuotaId", /** NotAvailableForSubscription */ - NotAvailableForSubscription = "NotAvailableForSubscription" + NotAvailableForSubscription = "NotAvailableForSubscription", } /** @@ -1369,7 +1908,7 @@ export enum KnownUnitType { /** BytesPerSecond */ BytesPerSecond = "BytesPerSecond", /** Milliseconds */ - Milliseconds = "Milliseconds" + Milliseconds = "Milliseconds", } /** @@ -1396,7 +1935,7 @@ export enum KnownQuotaUsageStatus { /** InOverage */ InOverage = "InOverage", /** Unknown */ - Unknown = "Unknown" + Unknown = "Unknown", } /** @@ -1413,10 +1952,16 @@ export type QuotaUsageStatus = string; /** Known values of {@link ModelLifecycleStatus} that the service accepts. */ export enum KnownModelLifecycleStatus { + /** Stable */ + Stable = "Stable", + /** Preview */ + Preview = "Preview", /** GenerallyAvailable */ GenerallyAvailable = "GenerallyAvailable", - /** Preview */ - Preview = "Preview" + /** Deprecating */ + Deprecating = "Deprecating", + /** Deprecated */ + Deprecated = "Deprecated", } /** @@ -1424,8 +1969,11 @@ export enum KnownModelLifecycleStatus { * {@link KnownModelLifecycleStatus} can be used interchangeably with ModelLifecycleStatus, * this enum contains the known values that the service supports. * ### Known values supported by the service + * **Stable** \ + * **Preview** \ * **GenerallyAvailable** \ - * **Preview** + * **Deprecating** \ + * **Deprecated** */ export type ModelLifecycleStatus = string; @@ -1436,7 +1984,7 @@ export enum KnownOrigin { /** System */ System = "system", /** UserSystem */ - UserSystem = "user,system" + UserSystem = "user,system", } /** @@ -1453,7 +2001,7 @@ export type Origin = string; /** Known values of {@link ActionType} that the service accepts. */ export enum KnownActionType { /** Internal */ - Internal = "Internal" + Internal = "Internal", } /** @@ -1474,7 +2022,7 @@ export enum KnownHostingModel { /** DisconnectedContainer */ DisconnectedContainer = "DisconnectedContainer", /** ProvisionedWeb */ - ProvisionedWeb = "ProvisionedWeb" + ProvisionedWeb = "ProvisionedWeb", } /** @@ -1506,7 +2054,7 @@ export enum KnownDeploymentProvisioningState { /** Disabled */ Disabled = "Disabled", /** Canceled */ - Canceled = "Canceled" + Canceled = "Canceled", } /** @@ -1530,7 +2078,7 @@ export enum KnownDeploymentScaleType { /** Standard */ Standard = "Standard", /** Manual */ - Manual = "Manual" + Manual = "Manual", } /** @@ -1550,7 +2098,7 @@ export enum KnownDeploymentModelVersionUpgradeOption { /** OnceCurrentVersionExpired */ OnceCurrentVersionExpired = "OnceCurrentVersionExpired", /** NoAutoUpgrade */ - NoAutoUpgrade = "NoAutoUpgrade" + NoAutoUpgrade = "NoAutoUpgrade", } /** @@ -1579,7 +2127,7 @@ export enum KnownCommitmentPlanProvisioningState { /** Succeeded */ Succeeded = "Succeeded", /** Canceled */ - Canceled = "Canceled" + Canceled = "Canceled", } /** @@ -1596,10 +2144,178 @@ export enum KnownCommitmentPlanProvisioningState { * **Canceled** */ export type CommitmentPlanProvisioningState = string; -/** Defines values for ResourceIdentityType. */ -export type ResourceIdentityType = - | "None" - | "SystemAssigned" + +/** Known values of {@link EncryptionScopeProvisioningState} that the service accepts. */ +export enum KnownEncryptionScopeProvisioningState { + /** Accepted */ + Accepted = "Accepted", + /** Creating */ + Creating = "Creating", + /** Deleting */ + Deleting = "Deleting", + /** Moving */ + Moving = "Moving", + /** Failed */ + Failed = "Failed", + /** Succeeded */ + Succeeded = "Succeeded", + /** Canceled */ + Canceled = "Canceled", +} + +/** + * Defines values for EncryptionScopeProvisioningState. \ + * {@link KnownEncryptionScopeProvisioningState} can be used interchangeably with EncryptionScopeProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Accepted** \ + * **Creating** \ + * **Deleting** \ + * **Moving** \ + * **Failed** \ + * **Succeeded** \ + * **Canceled** + */ +export type EncryptionScopeProvisioningState = string; + +/** Known values of {@link EncryptionScopeState} that the service accepts. */ +export enum KnownEncryptionScopeState { + /** Disabled */ + Disabled = "Disabled", + /** Enabled */ + Enabled = "Enabled", +} + +/** + * Defines values for EncryptionScopeState. \ + * {@link KnownEncryptionScopeState} can be used interchangeably with EncryptionScopeState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Disabled** \ + * **Enabled** + */ +export type EncryptionScopeState = string; + +/** Known values of {@link RaiPolicyType} that the service accepts. */ +export enum KnownRaiPolicyType { + /** UserManaged */ + UserManaged = "UserManaged", + /** SystemManaged */ + SystemManaged = "SystemManaged", +} + +/** + * Defines values for RaiPolicyType. \ + * {@link KnownRaiPolicyType} can be used interchangeably with RaiPolicyType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **UserManaged** \ + * **SystemManaged** + */ +export type RaiPolicyType = string; + +/** Known values of {@link RaiPolicyMode} that the service accepts. */ +export enum KnownRaiPolicyMode { + /** Default */ + Default = "Default", + /** Deferred */ + Deferred = "Deferred", + /** Blocking */ + Blocking = "Blocking", + /** AsynchronousFilter */ + AsynchronousFilter = "Asynchronous_filter", +} + +/** + * Defines values for RaiPolicyMode. \ + * {@link KnownRaiPolicyMode} can be used interchangeably with RaiPolicyMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Default** \ + * **Deferred** \ + * **Blocking** \ + * **Asynchronous_filter** + */ +export type RaiPolicyMode = string; + +/** Known values of {@link ContentLevel} that the service accepts. */ +export enum KnownContentLevel { + /** Low */ + Low = "Low", + /** Medium */ + Medium = "Medium", + /** High */ + High = "High", +} + +/** + * Defines values for ContentLevel. \ + * {@link KnownContentLevel} can be used interchangeably with ContentLevel, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Low** \ + * **Medium** \ + * **High** + */ +export type ContentLevel = string; + +/** Known values of {@link RaiPolicyContentSource} that the service accepts. */ +export enum KnownRaiPolicyContentSource { + /** Prompt */ + Prompt = "Prompt", + /** Completion */ + Completion = "Completion", +} + +/** + * Defines values for RaiPolicyContentSource. \ + * {@link KnownRaiPolicyContentSource} can be used interchangeably with RaiPolicyContentSource, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Prompt** \ + * **Completion** + */ +export type RaiPolicyContentSource = string; + +/** Known values of {@link NspAccessRuleDirection} that the service accepts. */ +export enum KnownNspAccessRuleDirection { + /** Inbound */ + Inbound = "Inbound", + /** Outbound */ + Outbound = "Outbound", +} + +/** + * Defines values for NspAccessRuleDirection. \ + * {@link KnownNspAccessRuleDirection} can be used interchangeably with NspAccessRuleDirection, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Inbound** \ + * **Outbound** + */ +export type NspAccessRuleDirection = string; + +/** Known values of {@link DefenderForAISettingState} that the service accepts. */ +export enum KnownDefenderForAISettingState { + /** Disabled */ + Disabled = "Disabled", + /** Enabled */ + Enabled = "Enabled", +} + +/** + * Defines values for DefenderForAISettingState. \ + * {@link KnownDefenderForAISettingState} can be used interchangeably with DefenderForAISettingState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Disabled** \ + * **Enabled** + */ +export type DefenderForAISettingState = string; +/** Defines values for ResourceIdentityType. */ +export type ResourceIdentityType = + | "None" + | "SystemAssigned" | "UserAssigned" | "SystemAssigned, UserAssigned"; /** Defines values for KeyName. */ @@ -1811,6 +2527,20 @@ export interface CheckDomainAvailabilityOptionalParams /** Contains response data for the checkDomainAvailability operation. */ export type CheckDomainAvailabilityResponse = DomainAvailability; +/** Optional parameters. */ +export interface CalculateModelCapacityOptionalParams + extends coreClient.OperationOptions { + /** Properties of Cognitive Services account deployment model. */ + model?: DeploymentModel; + /** The name of SKU. */ + skuName?: string; + /** List of Model Capacity Calculator Workload. */ + workloads?: ModelCapacityCalculatorWorkload[]; +} + +/** Contains response data for the calculateModelCapacity operation. */ +export type CalculateModelCapacityResponse = CalculateModelCapacityResult; + /** Optional parameters. */ export interface CommitmentTiersListOptionalParams extends coreClient.OperationOptions {} @@ -1838,12 +2568,42 @@ export interface ModelsListNextOptionalParams /** Contains response data for the listNext operation. */ export type ModelsListNextResponse = ModelListResult; +/** Optional parameters. */ +export interface LocationBasedModelCapacitiesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type LocationBasedModelCapacitiesListResponse = ModelCapacityListResult; + +/** Optional parameters. */ +export interface LocationBasedModelCapacitiesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type LocationBasedModelCapacitiesListNextResponse = + ModelCapacityListResult; + +/** Optional parameters. */ +export interface ModelCapacitiesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type ModelCapacitiesListResponse = ModelCapacityListResult; + +/** Optional parameters. */ +export interface ModelCapacitiesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type ModelCapacitiesListNextResponse = ModelCapacityListResult; + /** Optional parameters. */ export interface PrivateEndpointConnectionsListOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the list operation. */ -export type PrivateEndpointConnectionsListResponse = PrivateEndpointConnectionListResult; +export type PrivateEndpointConnectionsListResponse = + PrivateEndpointConnectionListResult; /** Optional parameters. */ export interface PrivateEndpointConnectionsGetOptionalParams @@ -1862,7 +2622,8 @@ export interface PrivateEndpointConnectionsCreateOrUpdateOptionalParams } /** Contains response data for the createOrUpdate operation. */ -export type PrivateEndpointConnectionsCreateOrUpdateResponse = PrivateEndpointConnection; +export type PrivateEndpointConnectionsCreateOrUpdateResponse = + PrivateEndpointConnection; /** Optional parameters. */ export interface PrivateEndpointConnectionsDeleteOptionalParams @@ -1906,6 +2667,18 @@ export interface DeploymentsCreateOrUpdateOptionalParams /** Contains response data for the createOrUpdate operation. */ export type DeploymentsCreateOrUpdateResponse = Deployment; +/** Optional parameters. */ +export interface DeploymentsUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type DeploymentsUpdateResponse = Deployment; + /** Optional parameters. */ export interface DeploymentsDeleteOptionalParams extends coreClient.OperationOptions { @@ -1915,6 +2688,13 @@ export interface DeploymentsDeleteOptionalParams resumeFrom?: string; } +/** Optional parameters. */ +export interface DeploymentsListSkusOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listSkus operation. */ +export type DeploymentsListSkusResponse = DeploymentSkuListResult; + /** Optional parameters. */ export interface DeploymentsListNextOptionalParams extends coreClient.OperationOptions {} @@ -1922,6 +2702,13 @@ export interface DeploymentsListNextOptionalParams /** Contains response data for the listNext operation. */ export type DeploymentsListNextResponse = DeploymentListResult; +/** Optional parameters. */ +export interface DeploymentsListSkusNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listSkusNext operation. */ +export type DeploymentsListSkusNextResponse = DeploymentSkuListResult; + /** Optional parameters. */ export interface CommitmentPlansListOptionalParams extends coreClient.OperationOptions {} @@ -1997,28 +2784,32 @@ export interface CommitmentPlansListPlansByResourceGroupOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listPlansByResourceGroup operation. */ -export type CommitmentPlansListPlansByResourceGroupResponse = CommitmentPlanListResult; +export type CommitmentPlansListPlansByResourceGroupResponse = + CommitmentPlanListResult; /** Optional parameters. */ export interface CommitmentPlansListPlansBySubscriptionOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listPlansBySubscription operation. */ -export type CommitmentPlansListPlansBySubscriptionResponse = CommitmentPlanListResult; +export type CommitmentPlansListPlansBySubscriptionResponse = + CommitmentPlanListResult; /** Optional parameters. */ export interface CommitmentPlansListAssociationsOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listAssociations operation. */ -export type CommitmentPlansListAssociationsResponse = CommitmentPlanAccountAssociationListResult; +export type CommitmentPlansListAssociationsResponse = + CommitmentPlanAccountAssociationListResult; /** Optional parameters. */ export interface CommitmentPlansGetAssociationOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the getAssociation operation. */ -export type CommitmentPlansGetAssociationResponse = CommitmentPlanAccountAssociation; +export type CommitmentPlansGetAssociationResponse = + CommitmentPlanAccountAssociation; /** Optional parameters. */ export interface CommitmentPlansCreateOrUpdateAssociationOptionalParams @@ -2030,7 +2821,8 @@ export interface CommitmentPlansCreateOrUpdateAssociationOptionalParams } /** Contains response data for the createOrUpdateAssociation operation. */ -export type CommitmentPlansCreateOrUpdateAssociationResponse = CommitmentPlanAccountAssociation; +export type CommitmentPlansCreateOrUpdateAssociationResponse = + CommitmentPlanAccountAssociation; /** Optional parameters. */ export interface CommitmentPlansDeleteAssociationOptionalParams @@ -2053,21 +2845,288 @@ export interface CommitmentPlansListPlansByResourceGroupNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listPlansByResourceGroupNext operation. */ -export type CommitmentPlansListPlansByResourceGroupNextResponse = CommitmentPlanListResult; +export type CommitmentPlansListPlansByResourceGroupNextResponse = + CommitmentPlanListResult; /** Optional parameters. */ export interface CommitmentPlansListPlansBySubscriptionNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listPlansBySubscriptionNext operation. */ -export type CommitmentPlansListPlansBySubscriptionNextResponse = CommitmentPlanListResult; +export type CommitmentPlansListPlansBySubscriptionNextResponse = + CommitmentPlanListResult; /** Optional parameters. */ export interface CommitmentPlansListAssociationsNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listAssociationsNext operation. */ -export type CommitmentPlansListAssociationsNextResponse = CommitmentPlanAccountAssociationListResult; +export type CommitmentPlansListAssociationsNextResponse = + CommitmentPlanAccountAssociationListResult; + +/** Optional parameters. */ +export interface EncryptionScopesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type EncryptionScopesListResponse = EncryptionScopeListResult; + +/** Optional parameters. */ +export interface EncryptionScopesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type EncryptionScopesGetResponse = EncryptionScope; + +/** Optional parameters. */ +export interface EncryptionScopesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type EncryptionScopesCreateOrUpdateResponse = EncryptionScope; + +/** Optional parameters. */ +export interface EncryptionScopesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type EncryptionScopesDeleteResponse = EncryptionScopesDeleteHeaders; + +/** Optional parameters. */ +export interface EncryptionScopesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type EncryptionScopesListNextResponse = EncryptionScopeListResult; + +/** Optional parameters. */ +export interface RaiPoliciesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type RaiPoliciesListResponse = RaiPolicyListResult; + +/** Optional parameters. */ +export interface RaiPoliciesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type RaiPoliciesGetResponse = RaiPolicy; + +/** Optional parameters. */ +export interface RaiPoliciesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type RaiPoliciesCreateOrUpdateResponse = RaiPolicy; + +/** Optional parameters. */ +export interface RaiPoliciesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type RaiPoliciesDeleteResponse = RaiPoliciesDeleteHeaders; + +/** Optional parameters. */ +export interface RaiPoliciesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type RaiPoliciesListNextResponse = RaiPolicyListResult; + +/** Optional parameters. */ +export interface RaiBlocklistsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type RaiBlocklistsListResponse = RaiBlockListResult; + +/** Optional parameters. */ +export interface RaiBlocklistsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type RaiBlocklistsGetResponse = RaiBlocklist; + +/** Optional parameters. */ +export interface RaiBlocklistsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type RaiBlocklistsCreateOrUpdateResponse = RaiBlocklist; + +/** Optional parameters. */ +export interface RaiBlocklistsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type RaiBlocklistsDeleteResponse = RaiBlocklistsDeleteHeaders; + +/** Optional parameters. */ +export interface RaiBlocklistsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type RaiBlocklistsListNextResponse = RaiBlockListResult; + +/** Optional parameters. */ +export interface RaiBlocklistItemsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type RaiBlocklistItemsListResponse = RaiBlockListItemsResult; + +/** Optional parameters. */ +export interface RaiBlocklistItemsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type RaiBlocklistItemsGetResponse = RaiBlocklistItem; + +/** Optional parameters. */ +export interface RaiBlocklistItemsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type RaiBlocklistItemsCreateOrUpdateResponse = RaiBlocklistItem; + +/** Optional parameters. */ +export interface RaiBlocklistItemsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type RaiBlocklistItemsDeleteResponse = RaiBlocklistItemsDeleteHeaders; + +/** Optional parameters. */ +export interface RaiBlocklistItemsBatchAddOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the batchAdd operation. */ +export type RaiBlocklistItemsBatchAddResponse = RaiBlocklist; + +/** Optional parameters. */ +export interface RaiBlocklistItemsBatchDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface RaiBlocklistItemsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type RaiBlocklistItemsListNextResponse = RaiBlockListItemsResult; + +/** Optional parameters. */ +export interface RaiContentFiltersListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type RaiContentFiltersListResponse = RaiContentFilterListResult; + +/** Optional parameters. */ +export interface RaiContentFiltersGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type RaiContentFiltersGetResponse = RaiContentFilter; + +/** Optional parameters. */ +export interface RaiContentFiltersListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type RaiContentFiltersListNextResponse = RaiContentFilterListResult; + +/** Optional parameters. */ +export interface NetworkSecurityPerimeterConfigurationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type NetworkSecurityPerimeterConfigurationsListResponse = + NetworkSecurityPerimeterConfigurationList; + +/** Optional parameters. */ +export interface NetworkSecurityPerimeterConfigurationsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type NetworkSecurityPerimeterConfigurationsGetResponse = + NetworkSecurityPerimeterConfiguration; + +/** Optional parameters. */ +export interface NetworkSecurityPerimeterConfigurationsReconcileOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the reconcile operation. */ +export type NetworkSecurityPerimeterConfigurationsReconcileResponse = + NetworkSecurityPerimeterConfiguration; + +/** Optional parameters. */ +export interface NetworkSecurityPerimeterConfigurationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type NetworkSecurityPerimeterConfigurationsListNextResponse = + NetworkSecurityPerimeterConfigurationList; + +/** Optional parameters. */ +export interface DefenderForAISettingsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type DefenderForAISettingsListResponse = DefenderForAISettingResult; + +/** Optional parameters. */ +export interface DefenderForAISettingsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type DefenderForAISettingsGetResponse = DefenderForAISetting; + +/** Optional parameters. */ +export interface DefenderForAISettingsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type DefenderForAISettingsCreateOrUpdateResponse = DefenderForAISetting; + +/** Optional parameters. */ +export interface DefenderForAISettingsUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type DefenderForAISettingsUpdateResponse = DefenderForAISetting; + +/** Optional parameters. */ +export interface DefenderForAISettingsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type DefenderForAISettingsListNextResponse = DefenderForAISettingResult; /** Optional parameters. */ export interface CognitiveServicesManagementClientOptionalParams diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/models/mappers.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/models/mappers.ts index 41f0f5a2cf72..b4014aceae29 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/models/mappers.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/models/mappers.ts @@ -17,35 +17,35 @@ export const Sku: coreClient.CompositeMapper = { serializedName: "name", required: true, type: { - name: "String" - } + name: "String", + }, }, tier: { serializedName: "tier", type: { - name: "String" - } + name: "String", + }, }, size: { serializedName: "size", type: { - name: "String" - } + name: "String", + }, }, family: { serializedName: "family", type: { - name: "String" - } + name: "String", + }, }, capacity: { serializedName: "capacity", type: { - name: "Number" - } - } - } - } + name: "Number", + }, + }, + }, + }, }; export const Identity: coreClient.CompositeMapper = { @@ -61,35 +61,35 @@ export const Identity: coreClient.CompositeMapper = { "None", "SystemAssigned", "UserAssigned", - "SystemAssigned, UserAssigned" - ] - } + "SystemAssigned, UserAssigned", + ], + }, }, tenantId: { serializedName: "tenantId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, principalId: { serializedName: "principalId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, userAssignedIdentities: { serializedName: "userAssignedIdentities", type: { name: "Dictionary", value: { - type: { name: "Composite", className: "UserAssignedIdentity" } - } - } - } - } - } + type: { name: "Composite", className: "UserAssignedIdentity" }, + }, + }, + }, + }, + }, }; export const UserAssignedIdentity: coreClient.CompositeMapper = { @@ -101,18 +101,18 @@ export const UserAssignedIdentity: coreClient.CompositeMapper = { serializedName: "principalId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, clientId: { serializedName: "clientId", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const SystemData: coreClient.CompositeMapper = { @@ -123,41 +123,41 @@ export const SystemData: coreClient.CompositeMapper = { createdBy: { serializedName: "createdBy", type: { - name: "String" - } + name: "String", + }, }, createdByType: { serializedName: "createdByType", type: { - name: "String" - } + name: "String", + }, }, createdAt: { serializedName: "createdAt", type: { - name: "DateTime" - } + name: "DateTime", + }, }, lastModifiedBy: { serializedName: "lastModifiedBy", type: { - name: "String" - } + name: "String", + }, }, lastModifiedByType: { serializedName: "lastModifiedByType", type: { - name: "String" - } + name: "String", + }, }, lastModifiedAt: { serializedName: "lastModifiedAt", type: { - name: "DateTime" - } - } - } - } + name: "DateTime", + }, + }, + }, + }, }; export const AccountProperties: coreClient.CompositeMapper = { @@ -169,22 +169,22 @@ export const AccountProperties: coreClient.CompositeMapper = { serializedName: "provisioningState", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, endpoint: { serializedName: "endpoint", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, internalId: { serializedName: "internalId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, capabilities: { serializedName: "capabilities", @@ -194,50 +194,50 @@ export const AccountProperties: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "SkuCapability" - } - } - } + className: "SkuCapability", + }, + }, + }, }, isMigrated: { serializedName: "isMigrated", readOnly: true, type: { - name: "Boolean" - } + name: "Boolean", + }, }, migrationToken: { serializedName: "migrationToken", type: { - name: "String" - } + name: "String", + }, }, skuChangeInfo: { serializedName: "skuChangeInfo", type: { name: "Composite", - className: "SkuChangeInfo" - } + className: "SkuChangeInfo", + }, }, customSubDomainName: { serializedName: "customSubDomainName", type: { - name: "String" - } + name: "String", + }, }, networkAcls: { serializedName: "networkAcls", type: { name: "Composite", - className: "NetworkRuleSet" - } + className: "NetworkRuleSet", + }, }, encryption: { serializedName: "encryption", type: { name: "Composite", - className: "Encryption" - } + className: "Encryption", + }, }, userOwnedStorage: { serializedName: "userOwnedStorage", @@ -246,10 +246,17 @@ export const AccountProperties: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "UserOwnedStorage" - } - } - } + className: "UserOwnedStorage", + }, + }, + }, + }, + amlWorkspace: { + serializedName: "amlWorkspace", + type: { + name: "Composite", + className: "UserOwnedAmlWorkspace", + }, }, privateEndpointConnections: { serializedName: "privateEndpointConnections", @@ -259,56 +266,56 @@ export const AccountProperties: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "PrivateEndpointConnection" - } - } - } + className: "PrivateEndpointConnection", + }, + }, + }, }, publicNetworkAccess: { serializedName: "publicNetworkAccess", type: { - name: "String" - } + name: "String", + }, }, apiProperties: { serializedName: "apiProperties", type: { name: "Composite", - className: "ApiProperties" - } + className: "ApiProperties", + }, }, dateCreated: { serializedName: "dateCreated", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, callRateLimit: { serializedName: "callRateLimit", type: { name: "Composite", - className: "CallRateLimit" - } + className: "CallRateLimit", + }, }, dynamicThrottlingEnabled: { serializedName: "dynamicThrottlingEnabled", type: { - name: "Boolean" - } + name: "Boolean", + }, }, quotaLimit: { serializedName: "quotaLimit", type: { name: "Composite", - className: "QuotaLimit" - } + className: "QuotaLimit", + }, }, restrictOutboundNetworkAccess: { serializedName: "restrictOutboundNetworkAccess", type: { - name: "Boolean" - } + name: "Boolean", + }, }, allowedFqdnList: { serializedName: "allowedFqdnList", @@ -316,51 +323,51 @@ export const AccountProperties: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "String", + }, + }, + }, }, disableLocalAuth: { serializedName: "disableLocalAuth", type: { - name: "Boolean" - } + name: "Boolean", + }, }, endpoints: { serializedName: "endpoints", readOnly: true, type: { name: "Dictionary", - value: { type: { name: "String" } } - } + value: { type: { name: "String" } }, + }, }, restore: { serializedName: "restore", type: { - name: "Boolean" - } + name: "Boolean", + }, }, deletionDate: { serializedName: "deletionDate", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, scheduledPurgeDate: { serializedName: "scheduledPurgeDate", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, locations: { serializedName: "locations", type: { name: "Composite", - className: "MultiRegionSettings" - } + className: "MultiRegionSettings", + }, }, commitmentPlanAssociations: { serializedName: "commitmentPlanAssociations", @@ -370,20 +377,27 @@ export const AccountProperties: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "CommitmentPlanAssociation" - } - } - } + className: "CommitmentPlanAssociation", + }, + }, + }, }, abusePenalty: { serializedName: "abusePenalty", type: { name: "Composite", - className: "AbusePenalty" - } - } - } - } + className: "AbusePenalty", + }, + }, + raiMonitorConfig: { + serializedName: "raiMonitorConfig", + type: { + name: "Composite", + className: "RaiMonitorConfig", + }, + }, + }, + }, }; export const SkuCapability: coreClient.CompositeMapper = { @@ -394,17 +408,17 @@ export const SkuCapability: coreClient.CompositeMapper = { name: { serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, value: { serializedName: "value", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const SkuChangeInfo: coreClient.CompositeMapper = { @@ -415,23 +429,23 @@ export const SkuChangeInfo: coreClient.CompositeMapper = { countOfDowngrades: { serializedName: "countOfDowngrades", type: { - name: "Number" - } + name: "Number", + }, }, countOfUpgradesAfterDowngrades: { serializedName: "countOfUpgradesAfterDowngrades", type: { - name: "Number" - } + name: "Number", + }, }, lastChangeDate: { serializedName: "lastChangeDate", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const NetworkRuleSet: coreClient.CompositeMapper = { @@ -442,8 +456,14 @@ export const NetworkRuleSet: coreClient.CompositeMapper = { defaultAction: { serializedName: "defaultAction", type: { - name: "String" - } + name: "String", + }, + }, + bypass: { + serializedName: "bypass", + type: { + name: "String", + }, }, ipRules: { serializedName: "ipRules", @@ -452,10 +472,10 @@ export const NetworkRuleSet: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "IpRule" - } - } - } + className: "IpRule", + }, + }, + }, }, virtualNetworkRules: { serializedName: "virtualNetworkRules", @@ -464,13 +484,13 @@ export const NetworkRuleSet: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "VirtualNetworkRule" - } - } - } - } - } - } + className: "VirtualNetworkRule", + }, + }, + }, + }, + }, + }, }; export const IpRule: coreClient.CompositeMapper = { @@ -482,11 +502,11 @@ export const IpRule: coreClient.CompositeMapper = { serializedName: "value", required: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const VirtualNetworkRule: coreClient.CompositeMapper = { @@ -498,23 +518,23 @@ export const VirtualNetworkRule: coreClient.CompositeMapper = { serializedName: "id", required: true, type: { - name: "String" - } + name: "String", + }, }, state: { serializedName: "state", type: { - name: "String" - } + name: "String", + }, }, ignoreMissingVnetServiceEndpoint: { serializedName: "ignoreMissingVnetServiceEndpoint", type: { - name: "Boolean" - } - } - } - } + name: "Boolean", + }, + }, + }, + }, }; export const Encryption: coreClient.CompositeMapper = { @@ -526,18 +546,18 @@ export const Encryption: coreClient.CompositeMapper = { serializedName: "keyVaultProperties", type: { name: "Composite", - className: "KeyVaultProperties" - } + className: "KeyVaultProperties", + }, }, keySource: { defaultValue: "Microsoft.KeyVault", serializedName: "keySource", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const KeyVaultProperties: coreClient.CompositeMapper = { @@ -548,29 +568,29 @@ export const KeyVaultProperties: coreClient.CompositeMapper = { keyName: { serializedName: "keyName", type: { - name: "String" - } + name: "String", + }, }, keyVersion: { serializedName: "keyVersion", type: { - name: "String" - } + name: "String", + }, }, keyVaultUri: { serializedName: "keyVaultUri", type: { - name: "String" - } + name: "String", + }, }, identityClientId: { serializedName: "identityClientId", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const UserOwnedStorage: coreClient.CompositeMapper = { @@ -581,17 +601,38 @@ export const UserOwnedStorage: coreClient.CompositeMapper = { resourceId: { serializedName: "resourceId", type: { - name: "String" - } + name: "String", + }, + }, + identityClientId: { + serializedName: "identityClientId", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const UserOwnedAmlWorkspace: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserOwnedAmlWorkspace", + modelProperties: { + resourceId: { + serializedName: "resourceId", + type: { + name: "String", + }, }, identityClientId: { serializedName: "identityClientId", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const PrivateEndpointConnectionProperties: coreClient.CompositeMapper = { @@ -603,22 +644,22 @@ export const PrivateEndpointConnectionProperties: coreClient.CompositeMapper = { serializedName: "privateEndpoint", type: { name: "Composite", - className: "PrivateEndpoint" - } + className: "PrivateEndpoint", + }, }, privateLinkServiceConnectionState: { serializedName: "privateLinkServiceConnectionState", type: { name: "Composite", - className: "PrivateLinkServiceConnectionState" - } + className: "PrivateLinkServiceConnectionState", + }, }, provisioningState: { serializedName: "provisioningState", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, groupIds: { serializedName: "groupIds", @@ -626,13 +667,13 @@ export const PrivateEndpointConnectionProperties: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } - } - } - } + name: "String", + }, + }, + }, + }, + }, + }, }; export const PrivateEndpoint: coreClient.CompositeMapper = { @@ -644,11 +685,11 @@ export const PrivateEndpoint: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { @@ -659,23 +700,23 @@ export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { status: { serializedName: "status", type: { - name: "String" - } + name: "String", + }, }, description: { serializedName: "description", type: { - name: "String" - } + name: "String", + }, }, actionsRequired: { serializedName: "actionsRequired", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Resource: coreClient.CompositeMapper = { @@ -687,25 +728,25 @@ export const Resource: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ApiProperties: coreClient.CompositeMapper = { @@ -717,89 +758,89 @@ export const ApiProperties: coreClient.CompositeMapper = { qnaRuntimeEndpoint: { serializedName: "qnaRuntimeEndpoint", type: { - name: "String" - } + name: "String", + }, }, qnaAzureSearchEndpointKey: { serializedName: "qnaAzureSearchEndpointKey", type: { - name: "String" - } + name: "String", + }, }, qnaAzureSearchEndpointId: { serializedName: "qnaAzureSearchEndpointId", type: { - name: "String" - } + name: "String", + }, }, statisticsEnabled: { serializedName: "statisticsEnabled", type: { - name: "Boolean" - } + name: "Boolean", + }, }, eventHubConnectionString: { constraints: { Pattern: new RegExp( - "^( *)Endpoint=sb:\\/\\/(.*);( *)SharedAccessKeyName=(.*);( *)SharedAccessKey=(.*)$" + "^( *)Endpoint=sb:\\/\\/(.*);( *)SharedAccessKeyName=(.*);( *)SharedAccessKey=(.*)$", ), - MaxLength: 1000 + MaxLength: 1000, }, serializedName: "eventHubConnectionString", type: { - name: "String" - } + name: "String", + }, }, storageAccountConnectionString: { constraints: { Pattern: new RegExp( - "^(( *)DefaultEndpointsProtocol=(http|https)( *);( *))?AccountName=(.*)AccountKey=(.*)EndpointSuffix=(.*)$" + "^(( *)DefaultEndpointsProtocol=(http|https)( *);( *))?AccountName=(.*)AccountKey=(.*)EndpointSuffix=(.*)$", ), - MaxLength: 1000 + MaxLength: 1000, }, serializedName: "storageAccountConnectionString", type: { - name: "String" - } + name: "String", + }, }, aadClientId: { constraints: { - MaxLength: 500 + MaxLength: 500, }, serializedName: "aadClientId", type: { - name: "String" - } + name: "String", + }, }, aadTenantId: { constraints: { - MaxLength: 500 + MaxLength: 500, }, serializedName: "aadTenantId", type: { - name: "String" - } + name: "String", + }, }, superUser: { constraints: { - MaxLength: 500 + MaxLength: 500, }, serializedName: "superUser", type: { - name: "String" - } + name: "String", + }, }, websiteName: { constraints: { - MaxLength: 500 + MaxLength: 500, }, serializedName: "websiteName", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const CallRateLimit: coreClient.CompositeMapper = { @@ -810,14 +851,14 @@ export const CallRateLimit: coreClient.CompositeMapper = { count: { serializedName: "count", type: { - name: "Number" - } + name: "Number", + }, }, renewalPeriod: { serializedName: "renewalPeriod", type: { - name: "Number" - } + name: "Number", + }, }, rules: { serializedName: "rules", @@ -826,13 +867,13 @@ export const CallRateLimit: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ThrottlingRule" - } - } - } - } - } - } + className: "ThrottlingRule", + }, + }, + }, + }, + }, + }, }; export const ThrottlingRule: coreClient.CompositeMapper = { @@ -843,32 +884,32 @@ export const ThrottlingRule: coreClient.CompositeMapper = { key: { serializedName: "key", type: { - name: "String" - } + name: "String", + }, }, renewalPeriod: { serializedName: "renewalPeriod", type: { - name: "Number" - } + name: "Number", + }, }, count: { serializedName: "count", type: { - name: "Number" - } + name: "Number", + }, }, minCount: { serializedName: "minCount", type: { - name: "Number" - } + name: "Number", + }, }, dynamicThrottlingEnabled: { serializedName: "dynamicThrottlingEnabled", type: { - name: "Boolean" - } + name: "Boolean", + }, }, matchPatterns: { serializedName: "matchPatterns", @@ -877,13 +918,13 @@ export const ThrottlingRule: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "RequestMatchPattern" - } - } - } - } - } - } + className: "RequestMatchPattern", + }, + }, + }, + }, + }, + }, }; export const RequestMatchPattern: coreClient.CompositeMapper = { @@ -894,17 +935,17 @@ export const RequestMatchPattern: coreClient.CompositeMapper = { path: { serializedName: "path", type: { - name: "String" - } + name: "String", + }, }, method: { serializedName: "method", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const QuotaLimit: coreClient.CompositeMapper = { @@ -915,14 +956,14 @@ export const QuotaLimit: coreClient.CompositeMapper = { count: { serializedName: "count", type: { - name: "Number" - } + name: "Number", + }, }, renewalPeriod: { serializedName: "renewalPeriod", type: { - name: "Number" - } + name: "Number", + }, }, rules: { serializedName: "rules", @@ -931,13 +972,13 @@ export const QuotaLimit: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ThrottlingRule" - } - } - } - } - } - } + className: "ThrottlingRule", + }, + }, + }, + }, + }, + }, }; export const MultiRegionSettings: coreClient.CompositeMapper = { @@ -948,8 +989,8 @@ export const MultiRegionSettings: coreClient.CompositeMapper = { routingMethod: { serializedName: "routingMethod", type: { - name: "String" - } + name: "String", + }, }, regions: { serializedName: "regions", @@ -958,13 +999,13 @@ export const MultiRegionSettings: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "RegionSetting" - } - } - } - } - } - } + className: "RegionSetting", + }, + }, + }, + }, + }, + }, }; export const RegionSetting: coreClient.CompositeMapper = { @@ -975,23 +1016,23 @@ export const RegionSetting: coreClient.CompositeMapper = { name: { serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, value: { serializedName: "value", type: { - name: "Number" - } + name: "Number", + }, }, customsubdomain: { serializedName: "customsubdomain", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const CommitmentPlanAssociation: coreClient.CompositeMapper = { @@ -1002,17 +1043,17 @@ export const CommitmentPlanAssociation: coreClient.CompositeMapper = { commitmentPlanId: { serializedName: "commitmentPlanId", type: { - name: "String" - } + name: "String", + }, }, commitmentPlanLocation: { serializedName: "commitmentPlanLocation", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const AbusePenalty: coreClient.CompositeMapper = { @@ -1023,23 +1064,44 @@ export const AbusePenalty: coreClient.CompositeMapper = { action: { serializedName: "action", type: { - name: "String" - } + name: "String", + }, }, rateLimitPercentage: { serializedName: "rateLimitPercentage", type: { - name: "Number" - } + name: "Number", + }, }, expiration: { serializedName: "expiration", type: { - name: "DateTime" - } - } - } - } + name: "DateTime", + }, + }, + }, + }, +}; + +export const RaiMonitorConfig: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RaiMonitorConfig", + modelProperties: { + adxStorageResourceId: { + serializedName: "adxStorageResourceId", + type: { + name: "String", + }, + }, + identityClientId: { + serializedName: "identityClientId", + type: { + name: "String", + }, + }, + }, + }, }; export const ErrorResponse: coreClient.CompositeMapper = { @@ -1051,11 +1113,11 @@ export const ErrorResponse: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorDetail" - } - } - } - } + className: "ErrorDetail", + }, + }, + }, + }, }; export const ErrorDetail: coreClient.CompositeMapper = { @@ -1067,22 +1129,22 @@ export const ErrorDetail: coreClient.CompositeMapper = { serializedName: "code", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, message: { serializedName: "message", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, target: { serializedName: "target", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, details: { serializedName: "details", @@ -1092,10 +1154,10 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorDetail" - } - } - } + className: "ErrorDetail", + }, + }, + }, }, additionalInfo: { serializedName: "additionalInfo", @@ -1105,13 +1167,13 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorAdditionalInfo" - } - } - } - } - } - } + className: "ErrorAdditionalInfo", + }, + }, + }, + }, + }, + }, }; export const ErrorAdditionalInfo: coreClient.CompositeMapper = { @@ -1123,19 +1185,19 @@ export const ErrorAdditionalInfo: coreClient.CompositeMapper = { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, info: { serializedName: "info", readOnly: true, type: { name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } + value: { type: { name: "any" } }, + }, + }, + }, + }, }; export const AccountListResult: coreClient.CompositeMapper = { @@ -1146,8 +1208,8 @@ export const AccountListResult: coreClient.CompositeMapper = { nextLink: { serializedName: "nextLink", type: { - name: "String" - } + name: "String", + }, }, value: { serializedName: "value", @@ -1157,13 +1219,13 @@ export const AccountListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Account" - } - } - } - } - } - } + className: "Account", + }, + }, + }, + }, + }, + }, }; export const ApiKeys: coreClient.CompositeMapper = { @@ -1174,17 +1236,17 @@ export const ApiKeys: coreClient.CompositeMapper = { key1: { serializedName: "key1", type: { - name: "String" - } + name: "String", + }, }, key2: { serializedName: "key2", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const RegenerateKeyParameters: coreClient.CompositeMapper = { @@ -1197,11 +1259,11 @@ export const RegenerateKeyParameters: coreClient.CompositeMapper = { required: true, type: { name: "Enum", - allowedValues: ["Key1", "Key2"] - } - } - } - } + allowedValues: ["Key1", "Key2"], + }, + }, + }, + }, }; export const ResourceSkuListResult: coreClient.CompositeMapper = { @@ -1217,19 +1279,19 @@ export const ResourceSkuListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ResourceSku" - } - } - } + className: "ResourceSku", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ResourceSku: coreClient.CompositeMapper = { @@ -1240,26 +1302,26 @@ export const ResourceSku: coreClient.CompositeMapper = { resourceType: { serializedName: "resourceType", type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, tier: { serializedName: "tier", type: { - name: "String" - } + name: "String", + }, }, kind: { serializedName: "kind", type: { - name: "String" - } + name: "String", + }, }, locations: { serializedName: "locations", @@ -1267,10 +1329,10 @@ export const ResourceSku: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "String", + }, + }, + }, }, restrictions: { serializedName: "restrictions", @@ -1279,13 +1341,13 @@ export const ResourceSku: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ResourceSkuRestrictions" - } - } - } - } - } - } + className: "ResourceSkuRestrictions", + }, + }, + }, + }, + }, + }, }; export const ResourceSkuRestrictions: coreClient.CompositeMapper = { @@ -1297,8 +1359,8 @@ export const ResourceSkuRestrictions: coreClient.CompositeMapper = { serializedName: "type", type: { name: "Enum", - allowedValues: ["Location", "Zone"] - } + allowedValues: ["Location", "Zone"], + }, }, values: { serializedName: "values", @@ -1306,26 +1368,26 @@ export const ResourceSkuRestrictions: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "String", + }, + }, + }, }, restrictionInfo: { serializedName: "restrictionInfo", type: { name: "Composite", - className: "ResourceSkuRestrictionInfo" - } + className: "ResourceSkuRestrictionInfo", + }, }, reasonCode: { serializedName: "reasonCode", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ResourceSkuRestrictionInfo: coreClient.CompositeMapper = { @@ -1339,10 +1401,10 @@ export const ResourceSkuRestrictionInfo: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "String", + }, + }, + }, }, zones: { serializedName: "zones", @@ -1350,13 +1412,13 @@ export const ResourceSkuRestrictionInfo: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } - } - } - } + name: "String", + }, + }, + }, + }, + }, + }, }; export const AccountSkuListResult: coreClient.CompositeMapper = { @@ -1371,13 +1433,13 @@ export const AccountSkuListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "AccountSku" - } - } - } - } - } - } + className: "AccountSku", + }, + }, + }, + }, + }, + }, }; export const AccountSku: coreClient.CompositeMapper = { @@ -1388,18 +1450,18 @@ export const AccountSku: coreClient.CompositeMapper = { resourceType: { serializedName: "resourceType", type: { - name: "String" - } + name: "String", + }, }, sku: { serializedName: "sku", type: { name: "Composite", - className: "Sku" - } - } - } - } + className: "Sku", + }, + }, + }, + }, }; export const UsageListResult: coreClient.CompositeMapper = { @@ -1410,8 +1472,8 @@ export const UsageListResult: coreClient.CompositeMapper = { nextLink: { serializedName: "nextLink", type: { - name: "String" - } + name: "String", + }, }, value: { serializedName: "value", @@ -1420,13 +1482,13 @@ export const UsageListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Usage" - } - } - } - } - } - } + className: "Usage", + }, + }, + }, + }, + }, + }, }; export const Usage: coreClient.CompositeMapper = { @@ -1437,48 +1499,48 @@ export const Usage: coreClient.CompositeMapper = { unit: { serializedName: "unit", type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", type: { name: "Composite", - className: "MetricName" - } + className: "MetricName", + }, }, quotaPeriod: { serializedName: "quotaPeriod", type: { - name: "String" - } + name: "String", + }, }, limit: { serializedName: "limit", type: { - name: "Number" - } + name: "Number", + }, }, currentValue: { serializedName: "currentValue", type: { - name: "Number" - } + name: "Number", + }, }, nextResetTime: { serializedName: "nextResetTime", type: { - name: "String" - } + name: "String", + }, }, status: { serializedName: "status", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const MetricName: coreClient.CompositeMapper = { @@ -1489,17 +1551,17 @@ export const MetricName: coreClient.CompositeMapper = { value: { serializedName: "value", type: { - name: "String" - } + name: "String", + }, }, localizedValue: { serializedName: "localizedValue", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const AccountModelListResult: coreClient.CompositeMapper = { @@ -1510,8 +1572,8 @@ export const AccountModelListResult: coreClient.CompositeMapper = { nextLink: { serializedName: "nextLink", type: { - name: "String" - } + name: "String", + }, }, value: { serializedName: "value", @@ -1520,13 +1582,13 @@ export const AccountModelListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "AccountModel" - } - } - } - } - } - } + className: "AccountModel", + }, + }, + }, + }, + }, + }, }; export const DeploymentModel: coreClient.CompositeMapper = { @@ -1534,39 +1596,51 @@ export const DeploymentModel: coreClient.CompositeMapper = { name: "Composite", className: "DeploymentModel", modelProperties: { + publisher: { + serializedName: "publisher", + type: { + name: "String", + }, + }, format: { serializedName: "format", type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, version: { serializedName: "version", type: { - name: "String" - } + name: "String", + }, }, source: { serializedName: "source", type: { - name: "String" - } + name: "String", + }, + }, + sourceAccount: { + serializedName: "sourceAccount", + type: { + name: "String", + }, }, callRateLimit: { serializedName: "callRateLimit", type: { name: "Composite", - className: "CallRateLimit" - } - } - } - } + className: "CallRateLimit", + }, + }, + }, + }, }; export const ModelSku: coreClient.CompositeMapper = { @@ -1577,27 +1651,27 @@ export const ModelSku: coreClient.CompositeMapper = { name: { serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, usageName: { serializedName: "usageName", type: { - name: "String" - } + name: "String", + }, }, deprecationDate: { serializedName: "deprecationDate", type: { - name: "DateTime" - } + name: "DateTime", + }, }, capacity: { serializedName: "capacity", type: { name: "Composite", - className: "CapacityConfig" - } + className: "CapacityConfig", + }, }, rateLimits: { serializedName: "rateLimits", @@ -1606,46 +1680,96 @@ export const ModelSku: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "CallRateLimit" - } - } - } - } - } - } -}; - -export const CapacityConfig: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CapacityConfig", + className: "CallRateLimit", + }, + }, + }, + }, + cost: { + serializedName: "cost", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BillingMeterInfo", + }, + }, + }, + }, + }, + }, +}; + +export const CapacityConfig: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CapacityConfig", modelProperties: { minimum: { serializedName: "minimum", type: { - name: "Number" - } + name: "Number", + }, }, maximum: { serializedName: "maximum", type: { - name: "Number" - } + name: "Number", + }, }, step: { serializedName: "step", type: { - name: "Number" - } + name: "Number", + }, }, default: { serializedName: "default", type: { - name: "Number" - } - } - } - } + name: "Number", + }, + }, + allowedValues: { + serializedName: "allowedValues", + type: { + name: "Sequence", + element: { + type: { + name: "Number", + }, + }, + }, + }, + }, + }, +}; + +export const BillingMeterInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingMeterInfo", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String", + }, + }, + meterId: { + serializedName: "meterId", + type: { + name: "String", + }, + }, + unit: { + serializedName: "unit", + type: { + name: "String", + }, + }, + }, + }, }; export const ModelDeprecationInfo: coreClient.CompositeMapper = { @@ -1656,17 +1780,17 @@ export const ModelDeprecationInfo: coreClient.CompositeMapper = { fineTune: { serializedName: "fineTune", type: { - name: "String" - } + name: "String", + }, }, inference: { serializedName: "inference", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const OperationListResult: coreClient.CompositeMapper = { @@ -1682,20 +1806,20 @@ export const OperationListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Operation" - } - } - } + className: "Operation", + }, + }, + }, }, nextLink: { serializedName: "nextLink", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Operation: coreClient.CompositeMapper = { @@ -1707,39 +1831,39 @@ export const Operation: coreClient.CompositeMapper = { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, isDataAction: { serializedName: "isDataAction", readOnly: true, type: { - name: "Boolean" - } + name: "Boolean", + }, }, display: { serializedName: "display", type: { name: "Composite", - className: "OperationDisplay" - } + className: "OperationDisplay", + }, }, origin: { serializedName: "origin", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, actionType: { serializedName: "actionType", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const OperationDisplay: coreClient.CompositeMapper = { @@ -1751,32 +1875,32 @@ export const OperationDisplay: coreClient.CompositeMapper = { serializedName: "provider", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, resource: { serializedName: "resource", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, operation: { serializedName: "operation", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, description: { serializedName: "description", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const CheckSkuAvailabilityParameter: coreClient.CompositeMapper = { @@ -1791,27 +1915,27 @@ export const CheckSkuAvailabilityParameter: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "String", + }, + }, + }, }, kind: { serializedName: "kind", required: true, type: { - name: "String" - } + name: "String", + }, }, typeParam: { serializedName: "type", required: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const SkuAvailabilityListResult: coreClient.CompositeMapper = { @@ -1826,13 +1950,13 @@ export const SkuAvailabilityListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "SkuAvailability" - } - } - } - } - } - } + className: "SkuAvailability", + }, + }, + }, + }, + }, + }, }; export const SkuAvailability: coreClient.CompositeMapper = { @@ -1843,41 +1967,41 @@ export const SkuAvailability: coreClient.CompositeMapper = { kind: { serializedName: "kind", type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", type: { - name: "String" - } + name: "String", + }, }, skuName: { serializedName: "skuName", type: { - name: "String" - } + name: "String", + }, }, skuAvailable: { serializedName: "skuAvailable", type: { - name: "Boolean" - } + name: "Boolean", + }, }, reason: { serializedName: "reason", type: { - name: "String" - } + name: "String", + }, }, message: { serializedName: "message", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const CommitmentTierListResult: coreClient.CompositeMapper = { @@ -1888,8 +2012,8 @@ export const CommitmentTierListResult: coreClient.CompositeMapper = { nextLink: { serializedName: "nextLink", type: { - name: "String" - } + name: "String", + }, }, value: { serializedName: "value", @@ -1899,13 +2023,13 @@ export const CommitmentTierListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "CommitmentTier" - } - } - } - } - } - } + className: "CommitmentTier", + }, + }, + }, + }, + }, + }, }; export const CommitmentTier: coreClient.CompositeMapper = { @@ -1916,55 +2040,55 @@ export const CommitmentTier: coreClient.CompositeMapper = { kind: { serializedName: "kind", type: { - name: "String" - } + name: "String", + }, }, skuName: { serializedName: "skuName", type: { - name: "String" - } + name: "String", + }, }, hostingModel: { serializedName: "hostingModel", type: { - name: "String" - } + name: "String", + }, }, planType: { serializedName: "planType", type: { - name: "String" - } + name: "String", + }, }, tier: { serializedName: "tier", type: { - name: "String" - } + name: "String", + }, }, maxCount: { serializedName: "maxCount", type: { - name: "Number" - } + name: "Number", + }, }, quota: { serializedName: "quota", type: { name: "Composite", - className: "CommitmentQuota" - } + className: "CommitmentQuota", + }, }, cost: { serializedName: "cost", type: { name: "Composite", - className: "CommitmentCost" - } - } - } - } + className: "CommitmentCost", + }, + }, + }, + }, }; export const CommitmentQuota: coreClient.CompositeMapper = { @@ -1975,17 +2099,17 @@ export const CommitmentQuota: coreClient.CompositeMapper = { quantity: { serializedName: "quantity", type: { - name: "Number" - } + name: "Number", + }, }, unit: { serializedName: "unit", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const CommitmentCost: coreClient.CompositeMapper = { @@ -1996,17 +2120,17 @@ export const CommitmentCost: coreClient.CompositeMapper = { commitmentMeterId: { serializedName: "commitmentMeterId", type: { - name: "String" - } + name: "String", + }, }, overageMeterId: { serializedName: "overageMeterId", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ModelListResult: coreClient.CompositeMapper = { @@ -2017,8 +2141,8 @@ export const ModelListResult: coreClient.CompositeMapper = { nextLink: { serializedName: "nextLink", type: { - name: "String" - } + name: "String", + }, }, value: { serializedName: "value", @@ -2027,13 +2151,13 @@ export const ModelListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Model" - } - } - } - } - } - } + className: "Model", + }, + }, + }, + }, + }, + }, }; export const Model: coreClient.CompositeMapper = { @@ -2045,23 +2169,90 @@ export const Model: coreClient.CompositeMapper = { serializedName: "model", type: { name: "Composite", - className: "AccountModel" - } + className: "AccountModel", + }, }, kind: { serializedName: "kind", type: { - name: "String" - } + name: "String", + }, + }, + skuName: { + serializedName: "skuName", + type: { + name: "String", + }, + }, + description: { + serializedName: "description", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ModelCapacityListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ModelCapacityListResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ModelCapacityListResultValueItem", + }, + }, + }, + }, + }, + }, +}; + +export const ModelSkuCapacityProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ModelSkuCapacityProperties", + modelProperties: { + model: { + serializedName: "model", + type: { + name: "Composite", + className: "DeploymentModel", + }, }, skuName: { serializedName: "skuName", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + availableCapacity: { + serializedName: "availableCapacity", + type: { + name: "Number", + }, + }, + availableFinetuneCapacity: { + serializedName: "availableFinetuneCapacity", + type: { + name: "Number", + }, + }, + }, + }, }; export const CheckDomainAvailabilityParameter: coreClient.CompositeMapper = { @@ -2073,24 +2264,24 @@ export const CheckDomainAvailabilityParameter: coreClient.CompositeMapper = { serializedName: "subdomainName", required: true, type: { - name: "String" - } + name: "String", + }, }, typeParam: { serializedName: "type", required: true, type: { - name: "String" - } + name: "String", + }, }, kind: { serializedName: "kind", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const DomainAvailability: coreClient.CompositeMapper = { @@ -2101,37 +2292,166 @@ export const DomainAvailability: coreClient.CompositeMapper = { isSubdomainAvailable: { serializedName: "isSubdomainAvailable", type: { - name: "Boolean" - } + name: "Boolean", + }, }, reason: { serializedName: "reason", type: { - name: "String" - } + name: "String", + }, }, subdomainName: { serializedName: "subdomainName", type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", type: { - name: "String" - } + name: "String", + }, }, kind: { serializedName: "kind", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, +}; + +export const CalculateModelCapacityParameter: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CalculateModelCapacityParameter", + modelProperties: { + model: { + serializedName: "model", + type: { + name: "Composite", + className: "DeploymentModel", + }, + }, + skuName: { + serializedName: "skuName", + type: { + name: "String", + }, + }, + workloads: { + serializedName: "workloads", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ModelCapacityCalculatorWorkload", + }, + }, + }, + }, + }, + }, +}; + +export const ModelCapacityCalculatorWorkload: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ModelCapacityCalculatorWorkload", + modelProperties: { + requestPerMinute: { + serializedName: "requestPerMinute", + type: { + name: "Number", + }, + }, + requestParameters: { + serializedName: "requestParameters", + type: { + name: "Composite", + className: "ModelCapacityCalculatorWorkloadRequestParam", + }, + }, + }, + }, +}; + +export const ModelCapacityCalculatorWorkloadRequestParam: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "ModelCapacityCalculatorWorkloadRequestParam", + modelProperties: { + avgPromptTokens: { + serializedName: "avgPromptTokens", + type: { + name: "Number", + }, + }, + avgGeneratedTokens: { + serializedName: "avgGeneratedTokens", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const CalculateModelCapacityResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CalculateModelCapacityResult", + modelProperties: { + model: { + serializedName: "model", + type: { + name: "Composite", + className: "DeploymentModel", + }, + }, + skuName: { + serializedName: "skuName", + type: { + name: "String", + }, + }, + estimatedCapacity: { + serializedName: "estimatedCapacity", + type: { + name: "Composite", + className: "CalculateModelCapacityResultEstimatedCapacity", + }, + }, + }, + }, }; +export const CalculateModelCapacityResultEstimatedCapacity: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "CalculateModelCapacityResultEstimatedCapacity", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Number", + }, + }, + deployableValue: { + serializedName: "deployableValue", + type: { + name: "Number", + }, + }, + }, + }, + }; + export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2144,13 +2464,13 @@ export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "PrivateEndpointConnection" - } - } - } - } - } - } + className: "PrivateEndpointConnection", + }, + }, + }, + }, + }, + }, }; export const PrivateLinkResourceListResult: coreClient.CompositeMapper = { @@ -2165,13 +2485,13 @@ export const PrivateLinkResourceListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "PrivateLinkResource" - } - } - } - } - } - } + className: "PrivateLinkResource", + }, + }, + }, + }, + }, + }, }; export const PrivateLinkResourceProperties: coreClient.CompositeMapper = { @@ -2183,8 +2503,8 @@ export const PrivateLinkResourceProperties: coreClient.CompositeMapper = { serializedName: "groupId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, requiredMembers: { serializedName: "requiredMembers", @@ -2193,10 +2513,10 @@ export const PrivateLinkResourceProperties: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "String", + }, + }, + }, }, requiredZoneNames: { serializedName: "requiredZoneNames", @@ -2204,20 +2524,20 @@ export const PrivateLinkResourceProperties: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "String", + }, + }, + }, }, displayName: { serializedName: "displayName", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const DeploymentListResult: coreClient.CompositeMapper = { @@ -2228,8 +2548,8 @@ export const DeploymentListResult: coreClient.CompositeMapper = { nextLink: { serializedName: "nextLink", type: { - name: "String" - } + name: "String", + }, }, value: { serializedName: "value", @@ -2239,13 +2559,13 @@ export const DeploymentListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Deployment" - } - } - } - } - } - } + className: "Deployment", + }, + }, + }, + }, + }, + }, }; export const DeploymentProperties: coreClient.CompositeMapper = { @@ -2257,43 +2577,43 @@ export const DeploymentProperties: coreClient.CompositeMapper = { serializedName: "provisioningState", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, model: { serializedName: "model", type: { name: "Composite", - className: "DeploymentModel" - } + className: "DeploymentModel", + }, }, scaleSettings: { serializedName: "scaleSettings", type: { name: "Composite", - className: "DeploymentScaleSettings" - } + className: "DeploymentScaleSettings", + }, }, capabilities: { serializedName: "capabilities", readOnly: true, type: { name: "Dictionary", - value: { type: { name: "String" } } - } + value: { type: { name: "String" } }, + }, }, raiPolicyName: { serializedName: "raiPolicyName", type: { - name: "String" - } + name: "String", + }, }, callRateLimit: { serializedName: "callRateLimit", type: { name: "Composite", - className: "CallRateLimit" - } + className: "CallRateLimit", + }, }, rateLimits: { serializedName: "rateLimits", @@ -2303,47 +2623,173 @@ export const DeploymentProperties: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ThrottlingRule" - } - } - } + className: "ThrottlingRule", + }, + }, + }, }, versionUpgradeOption: { serializedName: "versionUpgradeOption", type: { - name: "String" - } - } - } - } -}; - -export const DeploymentScaleSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DeploymentScaleSettings", - modelProperties: { - scaleType: { - serializedName: "scaleType", - type: { - name: "String" - } + name: "String", + }, }, - capacity: { - serializedName: "capacity", + dynamicThrottlingEnabled: { + serializedName: "dynamicThrottlingEnabled", + readOnly: true, type: { - name: "Number" - } + name: "Boolean", + }, + }, + currentCapacity: { + serializedName: "currentCapacity", + type: { + name: "Number", + }, + }, + capacitySettings: { + serializedName: "capacitySettings", + type: { + name: "Composite", + className: "DeploymentCapacitySettings", + }, + }, + parentDeploymentName: { + serializedName: "parentDeploymentName", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const DeploymentScaleSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DeploymentScaleSettings", + modelProperties: { + scaleType: { + serializedName: "scaleType", + type: { + name: "String", + }, + }, + capacity: { + serializedName: "capacity", + type: { + name: "Number", + }, }, activeCapacity: { serializedName: "activeCapacity", readOnly: true, type: { - name: "Number" - } - } - } - } + name: "Number", + }, + }, + }, + }, +}; + +export const DeploymentCapacitySettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DeploymentCapacitySettings", + modelProperties: { + designatedCapacity: { + constraints: { + InclusiveMinimum: 0, + }, + serializedName: "designatedCapacity", + type: { + name: "Number", + }, + }, + priority: { + constraints: { + InclusiveMinimum: 0, + }, + serializedName: "priority", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const PatchResourceTags: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PatchResourceTags", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + }, + }, +}; + +export const DeploymentSkuListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DeploymentSkuListResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SkuResource", + }, + }, + }, + }, + }, + }, +}; + +export const SkuResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SkuResource", + modelProperties: { + resourceType: { + serializedName: "resourceType", + type: { + name: "String", + }, + }, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku", + }, + }, + capacity: { + serializedName: "capacity", + type: { + name: "Composite", + className: "CapacityConfig", + }, + }, + }, + }, }; export const CommitmentPlanListResult: coreClient.CompositeMapper = { @@ -2354,8 +2800,8 @@ export const CommitmentPlanListResult: coreClient.CompositeMapper = { nextLink: { serializedName: "nextLink", type: { - name: "String" - } + name: "String", + }, }, value: { serializedName: "value", @@ -2365,13 +2811,13 @@ export const CommitmentPlanListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "CommitmentPlan" - } - } - } - } - } - } + className: "CommitmentPlan", + }, + }, + }, + }, + }, + }, }; export const CommitmentPlanProperties: coreClient.CompositeMapper = { @@ -2383,53 +2829,53 @@ export const CommitmentPlanProperties: coreClient.CompositeMapper = { serializedName: "provisioningState", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, commitmentPlanGuid: { serializedName: "commitmentPlanGuid", type: { - name: "String" - } + name: "String", + }, }, hostingModel: { serializedName: "hostingModel", type: { - name: "String" - } + name: "String", + }, }, planType: { serializedName: "planType", type: { - name: "String" - } + name: "String", + }, }, current: { serializedName: "current", type: { name: "Composite", - className: "CommitmentPeriod" - } + className: "CommitmentPeriod", + }, }, autoRenew: { serializedName: "autoRenew", type: { - name: "Boolean" - } + name: "Boolean", + }, }, next: { serializedName: "next", type: { name: "Composite", - className: "CommitmentPeriod" - } + className: "CommitmentPeriod", + }, }, last: { serializedName: "last", type: { name: "Composite", - className: "CommitmentPeriod" - } + className: "CommitmentPeriod", + }, }, provisioningIssues: { serializedName: "provisioningIssues", @@ -2438,13 +2884,13 @@ export const CommitmentPlanProperties: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } - } - } - } + name: "String", + }, + }, + }, + }, + }, + }, }; export const CommitmentPeriod: coreClient.CompositeMapper = { @@ -2455,251 +2901,985 @@ export const CommitmentPeriod: coreClient.CompositeMapper = { tier: { serializedName: "tier", type: { - name: "String" - } + name: "String", + }, }, count: { serializedName: "count", type: { - name: "Number" - } + name: "Number", + }, }, quota: { serializedName: "quota", type: { name: "Composite", - className: "CommitmentQuota" - } + className: "CommitmentQuota", + }, }, startDate: { serializedName: "startDate", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, endDate: { serializedName: "endDate", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const PatchResourceTags: coreClient.CompositeMapper = { +export const EncryptionScopeListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PatchResourceTags", + className: "EncryptionScopeListResult", modelProperties: { - tags: { - serializedName: "tags", + nextLink: { + serializedName: "nextLink", type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } + name: "String", + }, + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EncryptionScope", + }, + }, + }, + }, + }, + }, }; -export const CommitmentPlanAccountAssociationListResult: coreClient.CompositeMapper = { +export const RaiPolicyListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CommitmentPlanAccountAssociationListResult", + className: "RaiPolicyListResult", modelProperties: { nextLink: { serializedName: "nextLink", type: { - name: "String" - } + name: "String", + }, }, value: { serializedName: "value", - readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "CommitmentPlanAccountAssociation" - } - } - } - } - } - } + className: "RaiPolicy", + }, + }, + }, + }, + }, + }, }; -export const AzureEntityResource: coreClient.CompositeMapper = { +export const RaiPolicyProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureEntityResource", + className: "RaiPolicyProperties", modelProperties: { - ...Resource.type.modelProperties, - etag: { - serializedName: "etag", + type: { + serializedName: "type", readOnly: true, type: { - name: "String" - } - } - } - } -}; - -export const PrivateLinkResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateLinkResource", - modelProperties: { - ...Resource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "PrivateLinkResourceProperties" - } - } - } - } -}; - -export const ProxyResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ProxyResource", - modelProperties: { - ...Resource.type.modelProperties - } - } -}; - -export const AccountModel: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AccountModel", - modelProperties: { - ...DeploymentModel.type.modelProperties, - baseModel: { - serializedName: "baseModel", + name: "String", + }, + }, + mode: { + serializedName: "mode", type: { - name: "Composite", - className: "DeploymentModel" - } + name: "String", + }, }, - isDefaultVersion: { - serializedName: "isDefaultVersion", + basePolicyName: { + serializedName: "basePolicyName", type: { - name: "Boolean" - } + name: "String", + }, }, - skus: { - serializedName: "skus", + contentFilters: { + serializedName: "contentFilters", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ModelSku" - } - } - } + className: "RaiPolicyContentFilter", + }, + }, + }, }, - maxCapacity: { - serializedName: "maxCapacity", + customBlocklists: { + serializedName: "customBlocklists", type: { - name: "Number" - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CustomBlocklistConfig", + }, + }, + }, }, - capabilities: { - serializedName: "capabilities", + }, + }, +}; + +export const RaiPolicyContentFilter: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RaiPolicyContentFilter", + modelProperties: { + name: { + serializedName: "name", type: { - name: "Dictionary", - value: { type: { name: "String" } } - } + name: "String", + }, }, - finetuneCapabilities: { - serializedName: "finetuneCapabilities", + enabled: { + serializedName: "enabled", type: { - name: "Dictionary", - value: { type: { name: "String" } } - } + name: "Boolean", + }, }, - deprecation: { - serializedName: "deprecation", + severityThreshold: { + serializedName: "severityThreshold", type: { - name: "Composite", - className: "ModelDeprecationInfo" - } + name: "String", + }, }, - lifecycleStatus: { - serializedName: "lifecycleStatus", + blocking: { + serializedName: "blocking", type: { - name: "String" - } + name: "Boolean", + }, }, - systemData: { - serializedName: "systemData", + source: { + serializedName: "source", type: { - name: "Composite", - className: "SystemData" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const PatchResourceTagsAndSku: coreClient.CompositeMapper = { +export const RaiBlocklistConfig: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PatchResourceTagsAndSku", + className: "RaiBlocklistConfig", modelProperties: { - ...PatchResourceTags.type.modelProperties, - sku: { - serializedName: "sku", + blocklistName: { + serializedName: "blocklistName", type: { - name: "Composite", - className: "Sku" - } - } - } - } + name: "String", + }, + }, + blocking: { + serializedName: "blocking", + type: { + name: "Boolean", + }, + }, + }, + }, }; -export const PrivateEndpointConnection: coreClient.CompositeMapper = { +export const RaiBlockListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateEndpointConnection", + className: "RaiBlockListResult", modelProperties: { - ...AzureEntityResource.type.modelProperties, - properties: { - serializedName: "properties", + nextLink: { + serializedName: "nextLink", type: { - name: "Composite", - className: "PrivateEndpointConnectionProperties" - } + name: "String", + }, }, - systemData: { - serializedName: "systemData", + value: { + serializedName: "value", type: { - name: "Composite", - className: "SystemData" - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RaiBlocklist", + }, + }, + }, }, - location: { - serializedName: "location", - type: { - name: "String" - } - } - } - } + }, + }, }; -export const Account: coreClient.CompositeMapper = { +export const RaiBlocklistProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RaiBlocklistProperties", + modelProperties: { + description: { + serializedName: "description", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const RaiBlockListItemsResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RaiBlockListItemsResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RaiBlocklistItem", + }, + }, + }, + }, + }, + }, +}; + +export const RaiBlocklistItemProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RaiBlocklistItemProperties", + modelProperties: { + pattern: { + serializedName: "pattern", + type: { + name: "String", + }, + }, + isRegex: { + serializedName: "isRegex", + type: { + name: "Boolean", + }, + }, + }, + }, +}; + +export const RaiBlocklistItemBulkRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RaiBlocklistItemBulkRequest", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String", + }, + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "RaiBlocklistItemProperties", + }, + }, + }, + }, +}; + +export const RaiContentFilterListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RaiContentFilterListResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RaiContentFilter", + }, + }, + }, + }, + }, + }, +}; + +export const RaiContentFilterProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RaiContentFilterProperties", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String", + }, + }, + isMultiLevelFilter: { + serializedName: "isMultiLevelFilter", + type: { + name: "Boolean", + }, + }, + source: { + serializedName: "source", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const CommitmentPlanAccountAssociationListResult: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "CommitmentPlanAccountAssociationListResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CommitmentPlanAccountAssociation", + }, + }, + }, + }, + }, + }, + }; + +export const NetworkSecurityPerimeterConfigurationList: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "NetworkSecurityPerimeterConfigurationList", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkSecurityPerimeterConfiguration", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const NetworkSecurityPerimeterConfigurationProperties: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "NetworkSecurityPerimeterConfigurationProperties", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + provisioningIssues: { + serializedName: "provisioningIssues", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ProvisioningIssue", + }, + }, + }, + }, + networkSecurityPerimeter: { + serializedName: "networkSecurityPerimeter", + type: { + name: "Composite", + className: "NetworkSecurityPerimeter", + }, + }, + resourceAssociation: { + serializedName: "resourceAssociation", + type: { + name: "Composite", + className: "NetworkSecurityPerimeterConfigurationAssociationInfo", + }, + }, + profile: { + serializedName: "profile", + type: { + name: "Composite", + className: "NetworkSecurityPerimeterProfileInfo", + }, + }, + }, + }, + }; + +export const ProvisioningIssue: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProvisioningIssue", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String", + }, + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "ProvisioningIssueProperties", + }, + }, + }, + }, +}; + +export const ProvisioningIssueProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProvisioningIssueProperties", + modelProperties: { + issueType: { + serializedName: "issueType", + type: { + name: "String", + }, + }, + severity: { + serializedName: "severity", + type: { + name: "String", + }, + }, + description: { + serializedName: "description", + type: { + name: "String", + }, + }, + suggestedResourceIds: { + serializedName: "suggestedResourceIds", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + suggestedAccessRules: { + serializedName: "suggestedAccessRules", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkSecurityPerimeterAccessRule", + }, + }, + }, + }, + }, + }, +}; + +export const NetworkSecurityPerimeterAccessRule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkSecurityPerimeterAccessRule", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String", + }, + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "NetworkSecurityPerimeterAccessRuleProperties", + }, + }, + }, + }, +}; + +export const NetworkSecurityPerimeterAccessRuleProperties: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "NetworkSecurityPerimeterAccessRuleProperties", + modelProperties: { + direction: { + serializedName: "direction", + type: { + name: "String", + }, + }, + addressPrefixes: { + serializedName: "addressPrefixes", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + subscriptions: { + serializedName: "subscriptions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: + "NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem", + }, + }, + }, + }, + networkSecurityPerimeters: { + serializedName: "networkSecurityPerimeters", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkSecurityPerimeter", + }, + }, + }, + }, + fullyQualifiedDomainNames: { + serializedName: "fullyQualifiedDomainNames", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, + }; + +export const NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: + "NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const NetworkSecurityPerimeter: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkSecurityPerimeter", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String", + }, + }, + perimeterGuid: { + serializedName: "perimeterGuid", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const NetworkSecurityPerimeterConfigurationAssociationInfo: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "NetworkSecurityPerimeterConfigurationAssociationInfo", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String", + }, + }, + accessMode: { + serializedName: "accessMode", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const NetworkSecurityPerimeterProfileInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkSecurityPerimeterProfileInfo", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String", + }, + }, + accessRulesVersion: { + serializedName: "accessRulesVersion", + type: { + name: "Number", + }, + }, + accessRules: { + serializedName: "accessRules", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkSecurityPerimeterAccessRule", + }, + }, + }, + }, + diagnosticSettingsVersion: { + serializedName: "diagnosticSettingsVersion", + type: { + name: "Number", + }, + }, + enabledLogCategories: { + serializedName: "enabledLogCategories", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, +}; + +export const DefenderForAISettingResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DefenderForAISettingResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DefenderForAISetting", + }, + }, + }, + }, + }, + }, +}; + +export const EncryptionScopeProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EncryptionScopeProperties", + modelProperties: { + ...Encryption.type.modelProperties, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + state: { + serializedName: "state", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const AzureEntityResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AzureEntityResource", + modelProperties: { + ...Resource.type.modelProperties, + etag: { + serializedName: "etag", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties, + }, + }, +}; + +export const PrivateLinkResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkResource", + modelProperties: { + ...Resource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "PrivateLinkResourceProperties", + }, + }, + }, + }, +}; + +export const AccountModel: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountModel", + modelProperties: { + ...DeploymentModel.type.modelProperties, + baseModel: { + serializedName: "baseModel", + type: { + name: "Composite", + className: "DeploymentModel", + }, + }, + isDefaultVersion: { + serializedName: "isDefaultVersion", + type: { + name: "Boolean", + }, + }, + skus: { + serializedName: "skus", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ModelSku", + }, + }, + }, + }, + maxCapacity: { + serializedName: "maxCapacity", + type: { + name: "Number", + }, + }, + capabilities: { + serializedName: "capabilities", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + finetuneCapabilities: { + serializedName: "finetuneCapabilities", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + deprecation: { + serializedName: "deprecation", + type: { + name: "Composite", + className: "ModelDeprecationInfo", + }, + }, + lifecycleStatus: { + serializedName: "lifecycleStatus", + type: { + name: "String", + }, + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData", + }, + }, + }, + }, +}; + +export const PatchResourceTagsAndSku: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PatchResourceTagsAndSku", + modelProperties: { + ...PatchResourceTags.type.modelProperties, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku", + }, + }, + }, + }, +}; + +export const CustomBlocklistConfig: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomBlocklistConfig", + modelProperties: { + ...RaiBlocklistConfig.type.modelProperties, + source: { + serializedName: "source", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const PrivateEndpointConnection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnection", + modelProperties: { + ...AzureEntityResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "PrivateEndpointConnectionProperties", + }, + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const Account: coreClient.CompositeMapper = { type: { name: "Composite", className: "Account", @@ -2708,147 +3888,346 @@ export const Account: coreClient.CompositeMapper = { kind: { serializedName: "kind", type: { - name: "String" - } + name: "String", + }, + }, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku", + }, + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity", + }, + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData", + }, + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "AccountProperties", + }, + }, + }, + }, +}; + +export const ModelCapacityListResultValueItem: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ModelCapacityListResultValueItem", + modelProperties: { + ...ProxyResource.type.modelProperties, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "ModelSkuCapacityProperties", + }, }, + }, + }, +}; + +export const Deployment: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Deployment", + modelProperties: { + ...ProxyResource.type.modelProperties, sku: { serializedName: "sku", type: { name: "Composite", - className: "Sku" - } + className: "Sku", + }, }, - identity: { - serializedName: "identity", + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData", + }, + }, + etag: { + serializedName: "etag", + readOnly: true, + type: { + name: "String", + }, + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + properties: { + serializedName: "properties", type: { name: "Composite", - className: "Identity" - } + className: "DeploymentProperties", + }, }, + }, + }, +}; + +export const CommitmentPlan: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CommitmentPlan", + modelProperties: { + ...ProxyResource.type.modelProperties, systemData: { serializedName: "systemData", type: { name: "Composite", - className: "SystemData" - } + className: "SystemData", + }, + }, + etag: { + serializedName: "etag", + readOnly: true, + type: { + name: "String", + }, + }, + kind: { + serializedName: "kind", + type: { + name: "String", + }, + }, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku", + }, }, tags: { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } + value: { type: { name: "String" } }, + }, }, location: { serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, properties: { serializedName: "properties", type: { name: "Composite", - className: "AccountProperties" - } - } - } - } + className: "CommitmentPlanProperties", + }, + }, + }, + }, }; -export const Deployment: coreClient.CompositeMapper = { +export const EncryptionScope: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Deployment", + className: "EncryptionScope", modelProperties: { ...ProxyResource.type.modelProperties, - sku: { - serializedName: "sku", + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData", + }, + }, + etag: { + serializedName: "etag", + readOnly: true, + type: { + name: "String", + }, + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + properties: { + serializedName: "properties", type: { name: "Composite", - className: "Sku" - } + className: "EncryptionScopeProperties", + }, }, + }, + }, +}; + +export const RaiPolicy: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RaiPolicy", + modelProperties: { + ...ProxyResource.type.modelProperties, systemData: { serializedName: "systemData", type: { name: "Composite", - className: "SystemData" - } + className: "SystemData", + }, }, etag: { serializedName: "etag", readOnly: true, type: { - name: "String" - } + name: "String", + }, + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, }, properties: { serializedName: "properties", type: { name: "Composite", - className: "DeploymentProperties" - } - } - } - } + className: "RaiPolicyProperties", + }, + }, + }, + }, }; -export const CommitmentPlan: coreClient.CompositeMapper = { +export const RaiBlocklist: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CommitmentPlan", + className: "RaiBlocklist", modelProperties: { ...ProxyResource.type.modelProperties, systemData: { serializedName: "systemData", type: { name: "Composite", - className: "SystemData" - } + className: "SystemData", + }, }, etag: { serializedName: "etag", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - kind: { - serializedName: "kind", + tags: { + serializedName: "tags", type: { - name: "String" - } + name: "Dictionary", + value: { type: { name: "String" } }, + }, }, - sku: { - serializedName: "sku", + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "RaiBlocklistProperties", + }, + }, + }, + }, +}; + +export const RaiBlocklistItem: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RaiBlocklistItem", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", type: { name: "Composite", - className: "Sku" - } + className: "SystemData", + }, + }, + etag: { + serializedName: "etag", + readOnly: true, + type: { + name: "String", + }, }, tags: { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } + value: { type: { name: "String" } }, + }, }, - location: { - serializedName: "location", + properties: { + serializedName: "properties", type: { - name: "String" - } + name: "Composite", + className: "RaiBlocklistItemProperties", + }, }, + }, + }, +}; + +export const RaiContentFilter: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RaiContentFilter", + modelProperties: { + ...ProxyResource.type.modelProperties, properties: { serializedName: "properties", type: { name: "Composite", - className: "CommitmentPlanProperties" - } - } - } - } + className: "RaiContentFilterProperties", + }, + }, + }, + }, }; export const CommitmentPlanAccountAssociation: coreClient.CompositeMapper = { @@ -2861,24 +4240,101 @@ export const CommitmentPlanAccountAssociation: coreClient.CompositeMapper = { serializedName: "systemData", type: { name: "Composite", - className: "SystemData" - } + className: "SystemData", + }, }, etag: { serializedName: "etag", readOnly: true, type: { - name: "String" - } + name: "String", + }, + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, }, accountId: { serializedName: "properties.accountId", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, +}; + +export const NetworkSecurityPerimeterConfiguration: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "NetworkSecurityPerimeterConfiguration", + modelProperties: { + ...ProxyResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "NetworkSecurityPerimeterConfigurationProperties", + }, + }, + }, + }, + }; + +export const DefenderForAISetting: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DefenderForAISetting", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData", + }, + }, + etag: { + serializedName: "etag", + readOnly: true, + type: { + name: "String", + }, + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + state: { + serializedName: "properties.state", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const DeploymentsUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DeploymentsUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, }; export const CommitmentPlansUpdatePlanHeaders: coreClient.CompositeMapper = { @@ -2889,11 +4345,11 @@ export const CommitmentPlansUpdatePlanHeaders: coreClient.CompositeMapper = { location: { serializedName: "location", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const CommitmentPlansDeletePlanHeaders: coreClient.CompositeMapper = { @@ -2904,24 +4360,101 @@ export const CommitmentPlansDeletePlanHeaders: coreClient.CompositeMapper = { location: { serializedName: "location", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, +}; + +export const CommitmentPlansDeleteAssociationHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "CommitmentPlansDeleteAssociationHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const EncryptionScopesDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EncryptionScopesDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const RaiPoliciesDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RaiPoliciesDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const RaiBlocklistsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RaiBlocklistsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, }; -export const CommitmentPlansDeleteAssociationHeaders: coreClient.CompositeMapper = { +export const RaiBlocklistItemsDeleteHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CommitmentPlansDeleteAssociationHeaders", + className: "RaiBlocklistItemsDeleteHeaders", modelProperties: { location: { serializedName: "location", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; + +export const NetworkSecurityPerimeterConfigurationsReconcileHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "NetworkSecurityPerimeterConfigurationsReconcileHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, + }; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/models/parameters.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/models/parameters.ts index 00b143d9d26d..6c70469346f9 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/models/parameters.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/models/parameters.ts @@ -9,18 +9,24 @@ import { OperationParameter, OperationURLParameter, - OperationQueryParameter + OperationQueryParameter, } from "@azure/core-client"; import { Account as AccountMapper, RegenerateKeyParameters as RegenerateKeyParametersMapper, CheckSkuAvailabilityParameter as CheckSkuAvailabilityParameterMapper, CheckDomainAvailabilityParameter as CheckDomainAvailabilityParameterMapper, + CalculateModelCapacityParameter as CalculateModelCapacityParameterMapper, PrivateEndpointConnection as PrivateEndpointConnectionMapper, Deployment as DeploymentMapper, - CommitmentPlan as CommitmentPlanMapper, PatchResourceTagsAndSku as PatchResourceTagsAndSkuMapper, - CommitmentPlanAccountAssociation as CommitmentPlanAccountAssociationMapper + CommitmentPlan as CommitmentPlanMapper, + CommitmentPlanAccountAssociation as CommitmentPlanAccountAssociationMapper, + EncryptionScope as EncryptionScopeMapper, + RaiPolicy as RaiPolicyMapper, + RaiBlocklist as RaiBlocklistMapper, + RaiBlocklistItem as RaiBlocklistItemMapper, + DefenderForAISetting as DefenderForAISettingMapper, } from "../models/mappers"; export const contentType: OperationParameter = { @@ -30,14 +36,14 @@ export const contentType: OperationParameter = { isConstant: true, serializedName: "Content-Type", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const account: OperationParameter = { parameterPath: "account", - mapper: AccountMapper + mapper: AccountMapper, }; export const accept: OperationParameter = { @@ -47,9 +53,9 @@ export const accept: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const $host: OperationURLParameter = { @@ -58,10 +64,10 @@ export const $host: OperationURLParameter = { serializedName: "$host", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const resourceGroupName: OperationURLParameter = { @@ -69,14 +75,14 @@ export const resourceGroupName: OperationURLParameter = { mapper: { constraints: { MaxLength: 90, - MinLength: 1 + MinLength: 1, }, serializedName: "resourceGroupName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const accountName: OperationURLParameter = { @@ -85,45 +91,45 @@ export const accountName: OperationURLParameter = { constraints: { Pattern: new RegExp("^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"), MaxLength: 64, - MinLength: 2 + MinLength: 2, }, serializedName: "accountName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2023-05-01", + defaultValue: "2024-10-01", isConstant: true, serializedName: "api-version", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const subscriptionId: OperationURLParameter = { parameterPath: "subscriptionId", mapper: { constraints: { - MinLength: 1 + MinLength: 1, }, serializedName: "subscriptionId", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const keyName: OperationParameter = { parameterPath: "keyName", - mapper: RegenerateKeyParametersMapper + mapper: RegenerateKeyParametersMapper, }; export const filter: OperationQueryParameter = { @@ -131,9 +137,9 @@ export const filter: OperationQueryParameter = { mapper: { serializedName: "$filter", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const nextLink: OperationURLParameter = { @@ -142,10 +148,10 @@ export const nextLink: OperationURLParameter = { serializedName: "nextLink", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const location: OperationURLParameter = { @@ -154,39 +160,96 @@ export const location: OperationURLParameter = { serializedName: "location", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const skus: OperationParameter = { parameterPath: "skus", - mapper: CheckSkuAvailabilityParameterMapper + mapper: CheckSkuAvailabilityParameterMapper, }; export const kind: OperationParameter = { parameterPath: "kind", - mapper: CheckSkuAvailabilityParameterMapper + mapper: CheckSkuAvailabilityParameterMapper, }; export const typeParam: OperationParameter = { parameterPath: "typeParam", - mapper: CheckSkuAvailabilityParameterMapper + mapper: CheckSkuAvailabilityParameterMapper, }; export const subdomainName: OperationParameter = { parameterPath: "subdomainName", - mapper: CheckDomainAvailabilityParameterMapper + mapper: CheckDomainAvailabilityParameterMapper, }; export const typeParam1: OperationParameter = { parameterPath: "typeParam", - mapper: CheckDomainAvailabilityParameterMapper + mapper: CheckDomainAvailabilityParameterMapper, }; export const kind1: OperationParameter = { parameterPath: ["options", "kind"], - mapper: CheckDomainAvailabilityParameterMapper + mapper: CheckDomainAvailabilityParameterMapper, +}; + +export const model: OperationParameter = { + parameterPath: ["options", "model"], + mapper: CalculateModelCapacityParameterMapper, +}; + +export const skuName: OperationParameter = { + parameterPath: ["options", "skuName"], + mapper: CalculateModelCapacityParameterMapper, +}; + +export const workloads: OperationParameter = { + parameterPath: ["options", "workloads"], + mapper: CalculateModelCapacityParameterMapper, +}; + +export const modelFormat: OperationQueryParameter = { + parameterPath: "modelFormat", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"), + }, + serializedName: "modelFormat", + required: true, + type: { + name: "String", + }, + }, +}; + +export const modelName: OperationQueryParameter = { + parameterPath: "modelName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"), + }, + serializedName: "modelName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const modelVersion: OperationQueryParameter = { + parameterPath: "modelVersion", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"), + }, + serializedName: "modelVersion", + required: true, + type: { + name: "String", + }, + }, }; export const privateEndpointConnectionName: OperationURLParameter = { @@ -195,14 +258,14 @@ export const privateEndpointConnectionName: OperationURLParameter = { serializedName: "privateEndpointConnectionName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const properties: OperationParameter = { parameterPath: "properties", - mapper: PrivateEndpointConnectionMapper + mapper: PrivateEndpointConnectionMapper, }; export const deploymentName: OperationURLParameter = { @@ -211,14 +274,19 @@ export const deploymentName: OperationURLParameter = { serializedName: "deploymentName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const deployment: OperationParameter = { parameterPath: "deployment", - mapper: DeploymentMapper + mapper: DeploymentMapper, +}; + +export const deployment1: OperationParameter = { + parameterPath: "deployment", + mapper: PatchResourceTagsAndSkuMapper, }; export const commitmentPlanName: OperationURLParameter = { @@ -227,50 +295,202 @@ export const commitmentPlanName: OperationURLParameter = { serializedName: "commitmentPlanName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const commitmentPlan: OperationParameter = { parameterPath: "commitmentPlan", - mapper: CommitmentPlanMapper + mapper: CommitmentPlanMapper, }; export const commitmentPlanName1: OperationURLParameter = { parameterPath: "commitmentPlanName", mapper: { constraints: { - Pattern: new RegExp("^[a-zA-Z0-9][a-zA-Z0-9_.-]*$") + Pattern: new RegExp("^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"), }, serializedName: "commitmentPlanName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const commitmentPlan1: OperationParameter = { parameterPath: "commitmentPlan", - mapper: PatchResourceTagsAndSkuMapper + mapper: PatchResourceTagsAndSkuMapper, }; export const commitmentPlanAssociationName: OperationURLParameter = { parameterPath: "commitmentPlanAssociationName", mapper: { constraints: { - Pattern: new RegExp("^[a-zA-Z0-9][a-zA-Z0-9_.-]*$") + Pattern: new RegExp("^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"), }, serializedName: "commitmentPlanAssociationName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const association: OperationParameter = { parameterPath: "association", - mapper: CommitmentPlanAccountAssociationMapper + mapper: CommitmentPlanAccountAssociationMapper, +}; + +export const encryptionScopeName: OperationURLParameter = { + parameterPath: "encryptionScopeName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"), + }, + serializedName: "encryptionScopeName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const encryptionScope: OperationParameter = { + parameterPath: "encryptionScope", + mapper: EncryptionScopeMapper, +}; + +export const raiPolicyName: OperationURLParameter = { + parameterPath: "raiPolicyName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"), + }, + serializedName: "raiPolicyName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const raiPolicy: OperationParameter = { + parameterPath: "raiPolicy", + mapper: RaiPolicyMapper, +}; + +export const raiBlocklistName: OperationURLParameter = { + parameterPath: "raiBlocklistName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"), + }, + serializedName: "raiBlocklistName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const raiBlocklist: OperationParameter = { + parameterPath: "raiBlocklist", + mapper: RaiBlocklistMapper, +}; + +export const raiBlocklistItemName: OperationURLParameter = { + parameterPath: "raiBlocklistItemName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"), + }, + serializedName: "raiBlocklistItemName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const raiBlocklistItem: OperationParameter = { + parameterPath: "raiBlocklistItem", + mapper: RaiBlocklistItemMapper, +}; + +export const raiBlocklistItems: OperationParameter = { + parameterPath: "raiBlocklistItems", + mapper: { + serializedName: "raiBlocklistItems", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RaiBlocklistItemBulkRequest", + }, + }, + }, + }, +}; + +export const raiBlocklistItemsNames: OperationParameter = { + parameterPath: "raiBlocklistItemsNames", + mapper: { + serializedName: "raiBlocklistItemsNames", + required: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } }, + }, + }, +}; + +export const filterName: OperationURLParameter = { + parameterPath: "filterName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"), + }, + serializedName: "filterName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const nspConfigurationName: OperationURLParameter = { + parameterPath: "nspConfigurationName", + mapper: { + constraints: { + Pattern: new RegExp("^.*$"), + }, + serializedName: "nspConfigurationName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const defenderForAISettingName: OperationURLParameter = { + parameterPath: "defenderForAISettingName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"), + }, + serializedName: "defenderForAISettingName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const defenderForAISettings: OperationParameter = { + parameterPath: "defenderForAISettings", + mapper: DefenderForAISettingMapper, }; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/accounts.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/accounts.ts index 3aea87fd2ba7..2ccda665f87b 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/accounts.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/accounts.ts @@ -16,7 +16,7 @@ import { CognitiveServicesManagementClient } from "../cognitiveServicesManagemen import { SimplePollerLike, OperationState, - createHttpPoller + createHttpPoller, } from "@azure/core-lro"; import { createLroSpec } from "../lroImpl"; import { @@ -49,7 +49,7 @@ import { AccountsListUsagesResponse, AccountsListByResourceGroupNextResponse, AccountsListNextResponse, - AccountsListModelsNextResponse + AccountsListModelsNextResponse, } from "../models"; /// @@ -72,7 +72,7 @@ export class AccountsImpl implements Accounts { */ public listByResourceGroup( resourceGroupName: string, - options?: AccountsListByResourceGroupOptionalParams + options?: AccountsListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); return { @@ -89,16 +89,16 @@ export class AccountsImpl implements Accounts { return this.listByResourceGroupPagingPage( resourceGroupName, options, - settings + settings, ); - } + }, }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, options?: AccountsListByResourceGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: AccountsListByResourceGroupResponse; let continuationToken = settings?.continuationToken; @@ -113,7 +113,7 @@ export class AccountsImpl implements Accounts { result = await this._listByResourceGroupNext( resourceGroupName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -124,11 +124,11 @@ export class AccountsImpl implements Accounts { private async *listByResourceGroupPagingAll( resourceGroupName: string, - options?: AccountsListByResourceGroupOptionalParams + options?: AccountsListByResourceGroupOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByResourceGroupPagingPage( resourceGroupName, - options + options, )) { yield* page; } @@ -139,7 +139,7 @@ export class AccountsImpl implements Accounts { * @param options The options parameters. */ public list( - options?: AccountsListOptionalParams + options?: AccountsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -154,13 +154,13 @@ export class AccountsImpl implements Accounts { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: AccountsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: AccountsListResponse; let continuationToken = settings?.continuationToken; @@ -181,7 +181,7 @@ export class AccountsImpl implements Accounts { } private async *listPagingAll( - options?: AccountsListOptionalParams + options?: AccountsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -197,12 +197,12 @@ export class AccountsImpl implements Accounts { public listModels( resourceGroupName: string, accountName: string, - options?: AccountsListModelsOptionalParams + options?: AccountsListModelsOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listModelsPagingAll( resourceGroupName, accountName, - options + options, ); return { next() { @@ -219,9 +219,9 @@ export class AccountsImpl implements Accounts { resourceGroupName, accountName, options, - settings + settings, ); - } + }, }; } @@ -229,7 +229,7 @@ export class AccountsImpl implements Accounts { resourceGroupName: string, accountName: string, options?: AccountsListModelsOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: AccountsListModelsResponse; let continuationToken = settings?.continuationToken; @@ -245,7 +245,7 @@ export class AccountsImpl implements Accounts { resourceGroupName, accountName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -257,12 +257,12 @@ export class AccountsImpl implements Accounts { private async *listModelsPagingAll( resourceGroupName: string, accountName: string, - options?: AccountsListModelsOptionalParams + options?: AccountsListModelsOptionalParams, ): AsyncIterableIterator { for await (const page of this.listModelsPagingPage( resourceGroupName, accountName, - options + options, )) { yield* page; } @@ -280,7 +280,7 @@ export class AccountsImpl implements Accounts { resourceGroupName: string, accountName: string, account: Account, - options?: AccountsCreateOptionalParams + options?: AccountsCreateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -289,21 +289,20 @@ export class AccountsImpl implements Accounts { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -312,8 +311,8 @@ export class AccountsImpl implements Accounts { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -321,22 +320,22 @@ export class AccountsImpl implements Accounts { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceGroupName, accountName, account, options }, - spec: createOperationSpec + spec: createOperationSpec, }); const poller = await createHttpPoller< AccountsCreateResponse, OperationState >(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -354,13 +353,13 @@ export class AccountsImpl implements Accounts { resourceGroupName: string, accountName: string, account: Account, - options?: AccountsCreateOptionalParams + options?: AccountsCreateOptionalParams, ): Promise { const poller = await this.beginCreate( resourceGroupName, accountName, account, - options + options, ); return poller.pollUntilDone(); } @@ -376,7 +375,7 @@ export class AccountsImpl implements Accounts { resourceGroupName: string, accountName: string, account: Account, - options?: AccountsUpdateOptionalParams + options?: AccountsUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -385,21 +384,20 @@ export class AccountsImpl implements Accounts { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -408,8 +406,8 @@ export class AccountsImpl implements Accounts { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -417,22 +415,22 @@ export class AccountsImpl implements Accounts { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceGroupName, accountName, account, options }, - spec: updateOperationSpec + spec: updateOperationSpec, }); const poller = await createHttpPoller< AccountsUpdateResponse, OperationState >(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -449,13 +447,13 @@ export class AccountsImpl implements Accounts { resourceGroupName: string, accountName: string, account: Account, - options?: AccountsUpdateOptionalParams + options?: AccountsUpdateOptionalParams, ): Promise { const poller = await this.beginUpdate( resourceGroupName, accountName, account, - options + options, ); return poller.pollUntilDone(); } @@ -469,25 +467,24 @@ export class AccountsImpl implements Accounts { async beginDelete( resourceGroupName: string, accountName: string, - options?: AccountsDeleteOptionalParams + options?: AccountsDeleteOptionalParams, ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -496,8 +493,8 @@ export class AccountsImpl implements Accounts { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -505,19 +502,19 @@ export class AccountsImpl implements Accounts { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceGroupName, accountName, options }, - spec: deleteOperationSpec + spec: deleteOperationSpec, }); const poller = await createHttpPoller>(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -532,12 +529,12 @@ export class AccountsImpl implements Accounts { async beginDeleteAndWait( resourceGroupName: string, accountName: string, - options?: AccountsDeleteOptionalParams + options?: AccountsDeleteOptionalParams, ): Promise { const poller = await this.beginDelete( resourceGroupName, accountName, - options + options, ); return poller.pollUntilDone(); } @@ -551,11 +548,11 @@ export class AccountsImpl implements Accounts { get( resourceGroupName: string, accountName: string, - options?: AccountsGetOptionalParams + options?: AccountsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, accountName, options }, - getOperationSpec + getOperationSpec, ); } @@ -566,11 +563,11 @@ export class AccountsImpl implements Accounts { */ private _listByResourceGroup( resourceGroupName: string, - options?: AccountsListByResourceGroupOptionalParams + options?: AccountsListByResourceGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, options }, - listByResourceGroupOperationSpec + listByResourceGroupOperationSpec, ); } @@ -579,7 +576,7 @@ export class AccountsImpl implements Accounts { * @param options The options parameters. */ private _list( - options?: AccountsListOptionalParams + options?: AccountsListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -593,11 +590,11 @@ export class AccountsImpl implements Accounts { listKeys( resourceGroupName: string, accountName: string, - options?: AccountsListKeysOptionalParams + options?: AccountsListKeysOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, accountName, options }, - listKeysOperationSpec + listKeysOperationSpec, ); } @@ -612,11 +609,11 @@ export class AccountsImpl implements Accounts { resourceGroupName: string, accountName: string, keyName: KeyName, - options?: AccountsRegenerateKeyOptionalParams + options?: AccountsRegenerateKeyOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, accountName, keyName, options }, - regenerateKeyOperationSpec + regenerateKeyOperationSpec, ); } @@ -629,11 +626,11 @@ export class AccountsImpl implements Accounts { listSkus( resourceGroupName: string, accountName: string, - options?: AccountsListSkusOptionalParams + options?: AccountsListSkusOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, accountName, options }, - listSkusOperationSpec + listSkusOperationSpec, ); } @@ -646,11 +643,11 @@ export class AccountsImpl implements Accounts { listUsages( resourceGroupName: string, accountName: string, - options?: AccountsListUsagesOptionalParams + options?: AccountsListUsagesOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, accountName, options }, - listUsagesOperationSpec + listUsagesOperationSpec, ); } @@ -663,11 +660,11 @@ export class AccountsImpl implements Accounts { private _listModels( resourceGroupName: string, accountName: string, - options?: AccountsListModelsOptionalParams + options?: AccountsListModelsOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, accountName, options }, - listModelsOperationSpec + listModelsOperationSpec, ); } @@ -680,11 +677,11 @@ export class AccountsImpl implements Accounts { private _listByResourceGroupNext( resourceGroupName: string, nextLink: string, - options?: AccountsListByResourceGroupNextOptionalParams + options?: AccountsListByResourceGroupNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec + listByResourceGroupNextOperationSpec, ); } @@ -695,11 +692,11 @@ export class AccountsImpl implements Accounts { */ private _listNext( nextLink: string, - options?: AccountsListNextOptionalParams + options?: AccountsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } @@ -714,11 +711,11 @@ export class AccountsImpl implements Accounts { resourceGroupName: string, accountName: string, nextLink: string, - options?: AccountsListModelsNextOptionalParams + options?: AccountsListModelsNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, accountName, nextLink, options }, - listModelsNextOperationSpec + listModelsNextOperationSpec, ); } } @@ -726,25 +723,24 @@ export class AccountsImpl implements Accounts { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const createOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.Account + bodyMapper: Mappers.Account, }, 201: { - bodyMapper: Mappers.Account + bodyMapper: Mappers.Account, }, 202: { - bodyMapper: Mappers.Account + bodyMapper: Mappers.Account, }, 204: { - bodyMapper: Mappers.Account + bodyMapper: Mappers.Account, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.account, queryParameters: [Parameters.apiVersion], @@ -752,32 +748,31 @@ const createOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.resourceGroupName, Parameters.accountName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.Account + bodyMapper: Mappers.Account, }, 201: { - bodyMapper: Mappers.Account + bodyMapper: Mappers.Account, }, 202: { - bodyMapper: Mappers.Account + bodyMapper: Mappers.Account, }, 204: { - bodyMapper: Mappers.Account + bodyMapper: Mappers.Account, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.account, queryParameters: [Parameters.apiVersion], @@ -785,15 +780,14 @@ const updateOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.resourceGroupName, Parameters.accountName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}", httpMethod: "DELETE", responses: { 200: {}, @@ -801,251 +795,243 @@ const deleteOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.accountName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.Account + bodyMapper: Mappers.Account, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.accountName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.AccountListResult + bodyMapper: Mappers.AccountListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/accounts", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/accounts", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.AccountListResult + bodyMapper: Mappers.AccountListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listKeysOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/listKeys", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/listKeys", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.ApiKeys + bodyMapper: Mappers.ApiKeys, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.accountName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const regenerateKeyOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/regenerateKey", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/regenerateKey", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.ApiKeys + bodyMapper: Mappers.ApiKeys, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: { parameterPath: { keyName: ["keyName"] }, - mapper: { ...Mappers.RegenerateKeyParameters, required: true } + mapper: { ...Mappers.RegenerateKeyParameters, required: true }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.accountName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const listSkusOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/skus", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/skus", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.AccountSkuListResult + bodyMapper: Mappers.AccountSkuListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.accountName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listUsagesOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/usages", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/usages", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.UsageListResult + bodyMapper: Mappers.UsageListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.accountName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listModelsOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/models", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/models", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.AccountModelListResult + bodyMapper: Mappers.AccountModelListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.accountName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.AccountListResult + bodyMapper: Mappers.AccountListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.AccountListResult + bodyMapper: Mappers.AccountListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listModelsNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.AccountModelListResult + bodyMapper: Mappers.AccountModelListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.accountName, Parameters.subscriptionId, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/commitmentPlans.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/commitmentPlans.ts index b7af0d95fc75..c4152401f592 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/commitmentPlans.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/commitmentPlans.ts @@ -16,7 +16,7 @@ import { CognitiveServicesManagementClient } from "../cognitiveServicesManagemen import { SimplePollerLike, OperationState, - createHttpPoller + createHttpPoller, } from "@azure/core-lro"; import { createLroSpec } from "../lroImpl"; import { @@ -55,7 +55,7 @@ import { CommitmentPlansListNextResponse, CommitmentPlansListPlansByResourceGroupNextResponse, CommitmentPlansListPlansBySubscriptionNextResponse, - CommitmentPlansListAssociationsNextResponse + CommitmentPlansListAssociationsNextResponse, } from "../models"; /// @@ -80,7 +80,7 @@ export class CommitmentPlansImpl implements CommitmentPlans { public list( resourceGroupName: string, accountName: string, - options?: CommitmentPlansListOptionalParams + options?: CommitmentPlansListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(resourceGroupName, accountName, options); return { @@ -98,9 +98,9 @@ export class CommitmentPlansImpl implements CommitmentPlans { resourceGroupName, accountName, options, - settings + settings, ); - } + }, }; } @@ -108,7 +108,7 @@ export class CommitmentPlansImpl implements CommitmentPlans { resourceGroupName: string, accountName: string, options?: CommitmentPlansListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: CommitmentPlansListResponse; let continuationToken = settings?.continuationToken; @@ -124,7 +124,7 @@ export class CommitmentPlansImpl implements CommitmentPlans { resourceGroupName, accountName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -136,12 +136,12 @@ export class CommitmentPlansImpl implements CommitmentPlans { private async *listPagingAll( resourceGroupName: string, accountName: string, - options?: CommitmentPlansListOptionalParams + options?: CommitmentPlansListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage( resourceGroupName, accountName, - options + options, )) { yield* page; } @@ -154,11 +154,11 @@ export class CommitmentPlansImpl implements CommitmentPlans { */ public listPlansByResourceGroup( resourceGroupName: string, - options?: CommitmentPlansListPlansByResourceGroupOptionalParams + options?: CommitmentPlansListPlansByResourceGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPlansByResourceGroupPagingAll( resourceGroupName, - options + options, ); return { next() { @@ -174,16 +174,16 @@ export class CommitmentPlansImpl implements CommitmentPlans { return this.listPlansByResourceGroupPagingPage( resourceGroupName, options, - settings + settings, ); - } + }, }; } private async *listPlansByResourceGroupPagingPage( resourceGroupName: string, options?: CommitmentPlansListPlansByResourceGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: CommitmentPlansListPlansByResourceGroupResponse; let continuationToken = settings?.continuationToken; @@ -198,7 +198,7 @@ export class CommitmentPlansImpl implements CommitmentPlans { result = await this._listPlansByResourceGroupNext( resourceGroupName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -209,11 +209,11 @@ export class CommitmentPlansImpl implements CommitmentPlans { private async *listPlansByResourceGroupPagingAll( resourceGroupName: string, - options?: CommitmentPlansListPlansByResourceGroupOptionalParams + options?: CommitmentPlansListPlansByResourceGroupOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPlansByResourceGroupPagingPage( resourceGroupName, - options + options, )) { yield* page; } @@ -224,7 +224,7 @@ export class CommitmentPlansImpl implements CommitmentPlans { * @param options The options parameters. */ public listPlansBySubscription( - options?: CommitmentPlansListPlansBySubscriptionOptionalParams + options?: CommitmentPlansListPlansBySubscriptionOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPlansBySubscriptionPagingAll(options); return { @@ -239,13 +239,13 @@ export class CommitmentPlansImpl implements CommitmentPlans { throw new Error("maxPageSize is not supported by this operation."); } return this.listPlansBySubscriptionPagingPage(options, settings); - } + }, }; } private async *listPlansBySubscriptionPagingPage( options?: CommitmentPlansListPlansBySubscriptionOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: CommitmentPlansListPlansBySubscriptionResponse; let continuationToken = settings?.continuationToken; @@ -259,7 +259,7 @@ export class CommitmentPlansImpl implements CommitmentPlans { while (continuationToken) { result = await this._listPlansBySubscriptionNext( continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -269,7 +269,7 @@ export class CommitmentPlansImpl implements CommitmentPlans { } private async *listPlansBySubscriptionPagingAll( - options?: CommitmentPlansListPlansBySubscriptionOptionalParams + options?: CommitmentPlansListPlansBySubscriptionOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPlansBySubscriptionPagingPage(options)) { yield* page; @@ -286,12 +286,12 @@ export class CommitmentPlansImpl implements CommitmentPlans { public listAssociations( resourceGroupName: string, commitmentPlanName: string, - options?: CommitmentPlansListAssociationsOptionalParams + options?: CommitmentPlansListAssociationsOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listAssociationsPagingAll( resourceGroupName, commitmentPlanName, - options + options, ); return { next() { @@ -308,9 +308,9 @@ export class CommitmentPlansImpl implements CommitmentPlans { resourceGroupName, commitmentPlanName, options, - settings + settings, ); - } + }, }; } @@ -318,7 +318,7 @@ export class CommitmentPlansImpl implements CommitmentPlans { resourceGroupName: string, commitmentPlanName: string, options?: CommitmentPlansListAssociationsOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: CommitmentPlansListAssociationsResponse; let continuationToken = settings?.continuationToken; @@ -326,7 +326,7 @@ export class CommitmentPlansImpl implements CommitmentPlans { result = await this._listAssociations( resourceGroupName, commitmentPlanName, - options + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -338,7 +338,7 @@ export class CommitmentPlansImpl implements CommitmentPlans { resourceGroupName, commitmentPlanName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -350,12 +350,12 @@ export class CommitmentPlansImpl implements CommitmentPlans { private async *listAssociationsPagingAll( resourceGroupName: string, commitmentPlanName: string, - options?: CommitmentPlansListAssociationsOptionalParams + options?: CommitmentPlansListAssociationsOptionalParams, ): AsyncIterableIterator { for await (const page of this.listAssociationsPagingPage( resourceGroupName, commitmentPlanName, - options + options, )) { yield* page; } @@ -370,11 +370,11 @@ export class CommitmentPlansImpl implements CommitmentPlans { private _list( resourceGroupName: string, accountName: string, - options?: CommitmentPlansListOptionalParams + options?: CommitmentPlansListOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, accountName, options }, - listOperationSpec + listOperationSpec, ); } @@ -390,11 +390,11 @@ export class CommitmentPlansImpl implements CommitmentPlans { resourceGroupName: string, accountName: string, commitmentPlanName: string, - options?: CommitmentPlansGetOptionalParams + options?: CommitmentPlansGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, accountName, commitmentPlanName, options }, - getOperationSpec + getOperationSpec, ); } @@ -412,7 +412,7 @@ export class CommitmentPlansImpl implements CommitmentPlans { accountName: string, commitmentPlanName: string, commitmentPlan: CommitmentPlan, - options?: CommitmentPlansCreateOrUpdateOptionalParams + options?: CommitmentPlansCreateOrUpdateOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -420,9 +420,9 @@ export class CommitmentPlansImpl implements CommitmentPlans { accountName, commitmentPlanName, commitmentPlan, - options + options, }, - createOrUpdateOperationSpec + createOrUpdateOperationSpec, ); } @@ -438,25 +438,24 @@ export class CommitmentPlansImpl implements CommitmentPlans { resourceGroupName: string, accountName: string, commitmentPlanName: string, - options?: CommitmentPlansDeleteOptionalParams + options?: CommitmentPlansDeleteOptionalParams, ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -465,8 +464,8 @@ export class CommitmentPlansImpl implements CommitmentPlans { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -474,19 +473,19 @@ export class CommitmentPlansImpl implements CommitmentPlans { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceGroupName, accountName, commitmentPlanName, options }, - spec: deleteOperationSpec + spec: deleteOperationSpec, }); const poller = await createHttpPoller>(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -504,13 +503,13 @@ export class CommitmentPlansImpl implements CommitmentPlans { resourceGroupName: string, accountName: string, commitmentPlanName: string, - options?: CommitmentPlansDeleteOptionalParams + options?: CommitmentPlansDeleteOptionalParams, ): Promise { const poller = await this.beginDelete( resourceGroupName, accountName, commitmentPlanName, - options + options, ); return poller.pollUntilDone(); } @@ -527,7 +526,7 @@ export class CommitmentPlansImpl implements CommitmentPlans { resourceGroupName: string, commitmentPlanName: string, commitmentPlan: CommitmentPlan, - options?: CommitmentPlansCreateOrUpdatePlanOptionalParams + options?: CommitmentPlansCreateOrUpdatePlanOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -536,21 +535,20 @@ export class CommitmentPlansImpl implements CommitmentPlans { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -559,8 +557,8 @@ export class CommitmentPlansImpl implements CommitmentPlans { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -568,15 +566,15 @@ export class CommitmentPlansImpl implements CommitmentPlans { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceGroupName, commitmentPlanName, commitmentPlan, options }, - spec: createOrUpdatePlanOperationSpec + spec: createOrUpdatePlanOperationSpec, }); const poller = await createHttpPoller< CommitmentPlansCreateOrUpdatePlanResponse, @@ -584,7 +582,7 @@ export class CommitmentPlansImpl implements CommitmentPlans { >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation", }); await poller.poll(); return poller; @@ -602,13 +600,13 @@ export class CommitmentPlansImpl implements CommitmentPlans { resourceGroupName: string, commitmentPlanName: string, commitmentPlan: CommitmentPlan, - options?: CommitmentPlansCreateOrUpdatePlanOptionalParams + options?: CommitmentPlansCreateOrUpdatePlanOptionalParams, ): Promise { const poller = await this.beginCreateOrUpdatePlan( resourceGroupName, commitmentPlanName, commitmentPlan, - options + options, ); return poller.pollUntilDone(); } @@ -625,7 +623,7 @@ export class CommitmentPlansImpl implements CommitmentPlans { resourceGroupName: string, commitmentPlanName: string, commitmentPlan: PatchResourceTagsAndSku, - options?: CommitmentPlansUpdatePlanOptionalParams + options?: CommitmentPlansUpdatePlanOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -634,21 +632,20 @@ export class CommitmentPlansImpl implements CommitmentPlans { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -657,8 +654,8 @@ export class CommitmentPlansImpl implements CommitmentPlans { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -666,15 +663,15 @@ export class CommitmentPlansImpl implements CommitmentPlans { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceGroupName, commitmentPlanName, commitmentPlan, options }, - spec: updatePlanOperationSpec + spec: updatePlanOperationSpec, }); const poller = await createHttpPoller< CommitmentPlansUpdatePlanResponse, @@ -682,7 +679,7 @@ export class CommitmentPlansImpl implements CommitmentPlans { >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location" + resourceLocationConfig: "location", }); await poller.poll(); return poller; @@ -700,13 +697,13 @@ export class CommitmentPlansImpl implements CommitmentPlans { resourceGroupName: string, commitmentPlanName: string, commitmentPlan: PatchResourceTagsAndSku, - options?: CommitmentPlansUpdatePlanOptionalParams + options?: CommitmentPlansUpdatePlanOptionalParams, ): Promise { const poller = await this.beginUpdatePlan( resourceGroupName, commitmentPlanName, commitmentPlan, - options + options, ); return poller.pollUntilDone(); } @@ -721,25 +718,24 @@ export class CommitmentPlansImpl implements CommitmentPlans { async beginDeletePlan( resourceGroupName: string, commitmentPlanName: string, - options?: CommitmentPlansDeletePlanOptionalParams + options?: CommitmentPlansDeletePlanOptionalParams, ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -748,8 +744,8 @@ export class CommitmentPlansImpl implements CommitmentPlans { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -757,20 +753,20 @@ export class CommitmentPlansImpl implements CommitmentPlans { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceGroupName, commitmentPlanName, options }, - spec: deletePlanOperationSpec + spec: deletePlanOperationSpec, }); const poller = await createHttpPoller>(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location" + resourceLocationConfig: "location", }); await poller.poll(); return poller; @@ -786,12 +782,12 @@ export class CommitmentPlansImpl implements CommitmentPlans { async beginDeletePlanAndWait( resourceGroupName: string, commitmentPlanName: string, - options?: CommitmentPlansDeletePlanOptionalParams + options?: CommitmentPlansDeletePlanOptionalParams, ): Promise { const poller = await this.beginDeletePlan( resourceGroupName, commitmentPlanName, - options + options, ); return poller.pollUntilDone(); } @@ -806,11 +802,11 @@ export class CommitmentPlansImpl implements CommitmentPlans { getPlan( resourceGroupName: string, commitmentPlanName: string, - options?: CommitmentPlansGetPlanOptionalParams + options?: CommitmentPlansGetPlanOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, commitmentPlanName, options }, - getPlanOperationSpec + getPlanOperationSpec, ); } @@ -821,11 +817,11 @@ export class CommitmentPlansImpl implements CommitmentPlans { */ private _listPlansByResourceGroup( resourceGroupName: string, - options?: CommitmentPlansListPlansByResourceGroupOptionalParams + options?: CommitmentPlansListPlansByResourceGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, options }, - listPlansByResourceGroupOperationSpec + listPlansByResourceGroupOperationSpec, ); } @@ -834,11 +830,11 @@ export class CommitmentPlansImpl implements CommitmentPlans { * @param options The options parameters. */ private _listPlansBySubscription( - options?: CommitmentPlansListPlansBySubscriptionOptionalParams + options?: CommitmentPlansListPlansBySubscriptionOptionalParams, ): Promise { return this.client.sendOperationRequest( { options }, - listPlansBySubscriptionOperationSpec + listPlansBySubscriptionOperationSpec, ); } @@ -852,11 +848,11 @@ export class CommitmentPlansImpl implements CommitmentPlans { private _listAssociations( resourceGroupName: string, commitmentPlanName: string, - options?: CommitmentPlansListAssociationsOptionalParams + options?: CommitmentPlansListAssociationsOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, commitmentPlanName, options }, - listAssociationsOperationSpec + listAssociationsOperationSpec, ); } @@ -873,16 +869,16 @@ export class CommitmentPlansImpl implements CommitmentPlans { resourceGroupName: string, commitmentPlanName: string, commitmentPlanAssociationName: string, - options?: CommitmentPlansGetAssociationOptionalParams + options?: CommitmentPlansGetAssociationOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, - options + options, }, - getAssociationOperationSpec + getAssociationOperationSpec, ); } @@ -901,7 +897,7 @@ export class CommitmentPlansImpl implements CommitmentPlans { commitmentPlanName: string, commitmentPlanAssociationName: string, association: CommitmentPlanAccountAssociation, - options?: CommitmentPlansCreateOrUpdateAssociationOptionalParams + options?: CommitmentPlansCreateOrUpdateAssociationOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -910,21 +906,20 @@ export class CommitmentPlansImpl implements CommitmentPlans { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -933,8 +928,8 @@ export class CommitmentPlansImpl implements CommitmentPlans { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -942,8 +937,8 @@ export class CommitmentPlansImpl implements CommitmentPlans { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; @@ -954,9 +949,9 @@ export class CommitmentPlansImpl implements CommitmentPlans { commitmentPlanName, commitmentPlanAssociationName, association, - options + options, }, - spec: createOrUpdateAssociationOperationSpec + spec: createOrUpdateAssociationOperationSpec, }); const poller = await createHttpPoller< CommitmentPlansCreateOrUpdateAssociationResponse, @@ -964,7 +959,7 @@ export class CommitmentPlansImpl implements CommitmentPlans { >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation", }); await poller.poll(); return poller; @@ -985,14 +980,14 @@ export class CommitmentPlansImpl implements CommitmentPlans { commitmentPlanName: string, commitmentPlanAssociationName: string, association: CommitmentPlanAccountAssociation, - options?: CommitmentPlansCreateOrUpdateAssociationOptionalParams + options?: CommitmentPlansCreateOrUpdateAssociationOptionalParams, ): Promise { const poller = await this.beginCreateOrUpdateAssociation( resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, association, - options + options, ); return poller.pollUntilDone(); } @@ -1010,25 +1005,24 @@ export class CommitmentPlansImpl implements CommitmentPlans { resourceGroupName: string, commitmentPlanName: string, commitmentPlanAssociationName: string, - options?: CommitmentPlansDeleteAssociationOptionalParams + options?: CommitmentPlansDeleteAssociationOptionalParams, ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -1037,8 +1031,8 @@ export class CommitmentPlansImpl implements CommitmentPlans { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -1046,8 +1040,8 @@ export class CommitmentPlansImpl implements CommitmentPlans { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; @@ -1057,14 +1051,14 @@ export class CommitmentPlansImpl implements CommitmentPlans { resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, - options + options, }, - spec: deleteAssociationOperationSpec + spec: deleteAssociationOperationSpec, }); const poller = await createHttpPoller>(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location" + resourceLocationConfig: "location", }); await poller.poll(); return poller; @@ -1083,13 +1077,13 @@ export class CommitmentPlansImpl implements CommitmentPlans { resourceGroupName: string, commitmentPlanName: string, commitmentPlanAssociationName: string, - options?: CommitmentPlansDeleteAssociationOptionalParams + options?: CommitmentPlansDeleteAssociationOptionalParams, ): Promise { const poller = await this.beginDeleteAssociation( resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, - options + options, ); return poller.pollUntilDone(); } @@ -1105,11 +1099,11 @@ export class CommitmentPlansImpl implements CommitmentPlans { resourceGroupName: string, accountName: string, nextLink: string, - options?: CommitmentPlansListNextOptionalParams + options?: CommitmentPlansListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, accountName, nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } @@ -1123,11 +1117,11 @@ export class CommitmentPlansImpl implements CommitmentPlans { private _listPlansByResourceGroupNext( resourceGroupName: string, nextLink: string, - options?: CommitmentPlansListPlansByResourceGroupNextOptionalParams + options?: CommitmentPlansListPlansByResourceGroupNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, nextLink, options }, - listPlansByResourceGroupNextOperationSpec + listPlansByResourceGroupNextOperationSpec, ); } @@ -1139,11 +1133,11 @@ export class CommitmentPlansImpl implements CommitmentPlans { */ private _listPlansBySubscriptionNext( nextLink: string, - options?: CommitmentPlansListPlansBySubscriptionNextOptionalParams + options?: CommitmentPlansListPlansBySubscriptionNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listPlansBySubscriptionNextOperationSpec + listPlansBySubscriptionNextOperationSpec, ); } @@ -1159,11 +1153,11 @@ export class CommitmentPlansImpl implements CommitmentPlans { resourceGroupName: string, commitmentPlanName: string, nextLink: string, - options?: CommitmentPlansListAssociationsNextOptionalParams + options?: CommitmentPlansListAssociationsNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, commitmentPlanName, nextLink, options }, - listAssociationsNextOperationSpec + listAssociationsNextOperationSpec, ); } } @@ -1171,38 +1165,36 @@ export class CommitmentPlansImpl implements CommitmentPlans { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CommitmentPlanListResult + bodyMapper: Mappers.CommitmentPlanListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.accountName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CommitmentPlan + bodyMapper: Mappers.CommitmentPlan, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -1210,25 +1202,24 @@ const getOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.accountName, Parameters.subscriptionId, - Parameters.commitmentPlanName + Parameters.commitmentPlanName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.CommitmentPlan + bodyMapper: Mappers.CommitmentPlan, }, 201: { - bodyMapper: Mappers.CommitmentPlan + bodyMapper: Mappers.CommitmentPlan, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.commitmentPlan, queryParameters: [Parameters.apiVersion], @@ -1237,15 +1228,14 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.accountName, Parameters.subscriptionId, - Parameters.commitmentPlanName + Parameters.commitmentPlanName, ], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}", httpMethod: "DELETE", responses: { 200: {}, @@ -1253,8 +1243,8 @@ const deleteOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -1262,31 +1252,30 @@ const deleteOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.accountName, Parameters.subscriptionId, - Parameters.commitmentPlanName + Parameters.commitmentPlanName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdatePlanOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.CommitmentPlan + bodyMapper: Mappers.CommitmentPlan, }, 201: { - bodyMapper: Mappers.CommitmentPlan + bodyMapper: Mappers.CommitmentPlan, }, 202: { - bodyMapper: Mappers.CommitmentPlan + bodyMapper: Mappers.CommitmentPlan, }, 204: { - bodyMapper: Mappers.CommitmentPlan + bodyMapper: Mappers.CommitmentPlan, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.commitmentPlan, queryParameters: [Parameters.apiVersion], @@ -1294,32 +1283,31 @@ const createOrUpdatePlanOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, - Parameters.commitmentPlanName1 + Parameters.commitmentPlanName1, ], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const updatePlanOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.CommitmentPlan + bodyMapper: Mappers.CommitmentPlan, }, 201: { - bodyMapper: Mappers.CommitmentPlan + bodyMapper: Mappers.CommitmentPlan, }, 202: { - bodyMapper: Mappers.CommitmentPlan + bodyMapper: Mappers.CommitmentPlan, }, 204: { - bodyMapper: Mappers.CommitmentPlan + bodyMapper: Mappers.CommitmentPlan, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.commitmentPlan1, queryParameters: [Parameters.apiVersion], @@ -1327,15 +1315,14 @@ const updatePlanOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, - Parameters.commitmentPlanName1 + Parameters.commitmentPlanName1, ], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const deletePlanOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}", httpMethod: "DELETE", responses: { 200: {}, @@ -1343,112 +1330,107 @@ const deletePlanOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, - Parameters.commitmentPlanName1 + Parameters.commitmentPlanName1, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getPlanOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CommitmentPlan + bodyMapper: Mappers.CommitmentPlan, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, - Parameters.commitmentPlanName1 + Parameters.commitmentPlanName1, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listPlansByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CommitmentPlanListResult + bodyMapper: Mappers.CommitmentPlanListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listPlansBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/commitmentPlans", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/commitmentPlans", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CommitmentPlanListResult + bodyMapper: Mappers.CommitmentPlanListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAssociationsOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CommitmentPlanAccountAssociationListResult + bodyMapper: Mappers.CommitmentPlanAccountAssociationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, - Parameters.commitmentPlanName1 + Parameters.commitmentPlanName1, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getAssociationOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CommitmentPlanAccountAssociation + bodyMapper: Mappers.CommitmentPlanAccountAssociation, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -1456,31 +1438,30 @@ const getAssociationOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.commitmentPlanName1, - Parameters.commitmentPlanAssociationName + Parameters.commitmentPlanAssociationName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateAssociationOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.CommitmentPlanAccountAssociation + bodyMapper: Mappers.CommitmentPlanAccountAssociation, }, 201: { - bodyMapper: Mappers.CommitmentPlanAccountAssociation + bodyMapper: Mappers.CommitmentPlanAccountAssociation, }, 202: { - bodyMapper: Mappers.CommitmentPlanAccountAssociation + bodyMapper: Mappers.CommitmentPlanAccountAssociation, }, 204: { - bodyMapper: Mappers.CommitmentPlanAccountAssociation + bodyMapper: Mappers.CommitmentPlanAccountAssociation, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.association, queryParameters: [Parameters.apiVersion], @@ -1489,15 +1470,14 @@ const createOrUpdateAssociationOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.commitmentPlanName1, - Parameters.commitmentPlanAssociationName + Parameters.commitmentPlanAssociationName, ], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const deleteAssociationOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}", httpMethod: "DELETE", responses: { 200: {}, @@ -1505,8 +1485,8 @@ const deleteAssociationOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -1514,89 +1494,89 @@ const deleteAssociationOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.commitmentPlanName1, - Parameters.commitmentPlanAssociationName + Parameters.commitmentPlanAssociationName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CommitmentPlanListResult + bodyMapper: Mappers.CommitmentPlanListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.accountName, Parameters.subscriptionId, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listPlansByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CommitmentPlanListResult + bodyMapper: Mappers.CommitmentPlanListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listPlansBySubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CommitmentPlanListResult + bodyMapper: Mappers.CommitmentPlanListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAssociationsNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CommitmentPlanAccountAssociationListResult + bodyMapper: Mappers.CommitmentPlanAccountAssociationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.nextLink, - Parameters.commitmentPlanName1 + Parameters.commitmentPlanName1, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/commitmentTiers.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/commitmentTiers.ts index 022362d89bc4..c160c1af803d 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/commitmentTiers.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/commitmentTiers.ts @@ -18,7 +18,7 @@ import { CommitmentTiersListNextOptionalParams, CommitmentTiersListOptionalParams, CommitmentTiersListResponse, - CommitmentTiersListNextResponse + CommitmentTiersListNextResponse, } from "../models"; /// @@ -41,7 +41,7 @@ export class CommitmentTiersImpl implements CommitmentTiers { */ public list( location: string, - options?: CommitmentTiersListOptionalParams + options?: CommitmentTiersListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(location, options); return { @@ -56,14 +56,14 @@ export class CommitmentTiersImpl implements CommitmentTiers { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(location, options, settings); - } + }, }; } private async *listPagingPage( location: string, options?: CommitmentTiersListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: CommitmentTiersListResponse; let continuationToken = settings?.continuationToken; @@ -85,7 +85,7 @@ export class CommitmentTiersImpl implements CommitmentTiers { private async *listPagingAll( location: string, - options?: CommitmentTiersListOptionalParams + options?: CommitmentTiersListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(location, options)) { yield* page; @@ -99,11 +99,11 @@ export class CommitmentTiersImpl implements CommitmentTiers { */ private _list( location: string, - options?: CommitmentTiersListOptionalParams + options?: CommitmentTiersListOptionalParams, ): Promise { return this.client.sendOperationRequest( { location, options }, - listOperationSpec + listOperationSpec, ); } @@ -116,11 +116,11 @@ export class CommitmentTiersImpl implements CommitmentTiers { private _listNext( location: string, nextLink: string, - options?: CommitmentTiersListNextOptionalParams + options?: CommitmentTiersListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { location, nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -128,43 +128,42 @@ export class CommitmentTiersImpl implements CommitmentTiers { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/commitmentTiers", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/commitmentTiers", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CommitmentTierListResult + bodyMapper: Mappers.CommitmentTierListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.location + Parameters.location, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CommitmentTierListResult + bodyMapper: Mappers.CommitmentTierListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.nextLink, - Parameters.location + Parameters.location, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/defenderForAISettings.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/defenderForAISettings.ts new file mode 100644 index 000000000000..fd228c3e325d --- /dev/null +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/defenderForAISettings.ts @@ -0,0 +1,345 @@ +/* + * 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 { DefenderForAISettings } 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 { + DefenderForAISetting, + DefenderForAISettingsListNextOptionalParams, + DefenderForAISettingsListOptionalParams, + DefenderForAISettingsListResponse, + DefenderForAISettingsGetOptionalParams, + DefenderForAISettingsGetResponse, + DefenderForAISettingsCreateOrUpdateOptionalParams, + DefenderForAISettingsCreateOrUpdateResponse, + DefenderForAISettingsUpdateOptionalParams, + DefenderForAISettingsUpdateResponse, + DefenderForAISettingsListNextResponse, +} from "../models"; + +/// +/** Class containing DefenderForAISettings operations. */ +export class DefenderForAISettingsImpl implements DefenderForAISettings { + private readonly client: CognitiveServicesManagementClient; + + /** + * Initialize a new instance of the class DefenderForAISettings class. + * @param client Reference to the service client + */ + constructor(client: CognitiveServicesManagementClient) { + this.client = client; + } + + /** + * Lists the Defender for AI settings. + * @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 list( + resourceGroupName: string, + accountName: string, + options?: DefenderForAISettingsListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, accountName, 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( + resourceGroupName, + accountName, + options, + settings, + ); + }, + }; + } + + private async *listPagingPage( + resourceGroupName: string, + accountName: string, + options?: DefenderForAISettingsListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: DefenderForAISettingsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, accountName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + accountName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + accountName: string, + options?: DefenderForAISettingsListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + accountName, + options, + )) { + yield* page; + } + } + + /** + * Lists the Defender for AI settings. + * @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 _list( + resourceGroupName: string, + accountName: string, + options?: DefenderForAISettingsListOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, options }, + listOperationSpec, + ); + } + + /** + * Gets the specified Defender for AI setting by name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param defenderForAISettingName The name of the defender for AI setting. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + defenderForAISettingName: string, + options?: DefenderForAISettingsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, defenderForAISettingName, options }, + getOperationSpec, + ); + } + + /** + * Creates or Updates the specified Defender for AI setting. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param defenderForAISettingName The name of the defender for AI setting. + * @param defenderForAISettings Properties describing the Defender for AI setting. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + accountName: string, + defenderForAISettingName: string, + defenderForAISettings: DefenderForAISetting, + options?: DefenderForAISettingsCreateOrUpdateOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + defenderForAISettingName, + defenderForAISettings, + options, + }, + createOrUpdateOperationSpec, + ); + } + + /** + * Updates the specified Defender for AI setting. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param defenderForAISettingName The name of the defender for AI setting. + * @param defenderForAISettings Properties describing the Defender for AI setting. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + accountName: string, + defenderForAISettingName: string, + defenderForAISettings: DefenderForAISetting, + options?: DefenderForAISettingsUpdateOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + defenderForAISettingName, + defenderForAISettings, + options, + }, + updateOperationSpec, + ); + } + + /** + * ListNext + * @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 List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + accountName: string, + nextLink: string, + options?: DefenderForAISettingsListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, nextLink, options }, + listNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/defenderForAISettings", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DefenderForAISettingResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/defenderForAISettings/{defenderForAISettingName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DefenderForAISetting, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.defenderForAISettingName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/defenderForAISettings/{defenderForAISettingName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.DefenderForAISetting, + }, + 201: { + bodyMapper: Mappers.DefenderForAISetting, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.defenderForAISettings, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.defenderForAISettingName, + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer, +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/defenderForAISettings/{defenderForAISettingName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.DefenderForAISetting, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.defenderForAISettings, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.defenderForAISettingName, + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DefenderForAISettingResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/deletedAccounts.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/deletedAccounts.ts index 2860c81ddbc0..99baec5a3943 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/deletedAccounts.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/deletedAccounts.ts @@ -16,7 +16,7 @@ import { CognitiveServicesManagementClient } from "../cognitiveServicesManagemen import { SimplePollerLike, OperationState, - createHttpPoller + createHttpPoller, } from "@azure/core-lro"; import { createLroSpec } from "../lroImpl"; import { @@ -27,7 +27,7 @@ import { DeletedAccountsGetOptionalParams, DeletedAccountsGetResponse, DeletedAccountsPurgeOptionalParams, - DeletedAccountsListNextResponse + DeletedAccountsListNextResponse, } from "../models"; /// @@ -48,7 +48,7 @@ export class DeletedAccountsImpl implements DeletedAccounts { * @param options The options parameters. */ public list( - options?: DeletedAccountsListOptionalParams + options?: DeletedAccountsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -63,13 +63,13 @@ export class DeletedAccountsImpl implements DeletedAccounts { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: DeletedAccountsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: DeletedAccountsListResponse; let continuationToken = settings?.continuationToken; @@ -90,7 +90,7 @@ export class DeletedAccountsImpl implements DeletedAccounts { } private async *listPagingAll( - options?: DeletedAccountsListOptionalParams + options?: DeletedAccountsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -108,11 +108,11 @@ export class DeletedAccountsImpl implements DeletedAccounts { location: string, resourceGroupName: string, accountName: string, - options?: DeletedAccountsGetOptionalParams + options?: DeletedAccountsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { location, resourceGroupName, accountName, options }, - getOperationSpec + getOperationSpec, ); } @@ -127,25 +127,24 @@ export class DeletedAccountsImpl implements DeletedAccounts { location: string, resourceGroupName: string, accountName: string, - options?: DeletedAccountsPurgeOptionalParams + options?: DeletedAccountsPurgeOptionalParams, ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -154,8 +153,8 @@ export class DeletedAccountsImpl implements DeletedAccounts { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -163,19 +162,19 @@ export class DeletedAccountsImpl implements DeletedAccounts { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { location, resourceGroupName, accountName, options }, - spec: purgeOperationSpec + spec: purgeOperationSpec, }); const poller = await createHttpPoller>(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -192,13 +191,13 @@ export class DeletedAccountsImpl implements DeletedAccounts { location: string, resourceGroupName: string, accountName: string, - options?: DeletedAccountsPurgeOptionalParams + options?: DeletedAccountsPurgeOptionalParams, ): Promise { const poller = await this.beginPurge( location, resourceGroupName, accountName, - options + options, ); return poller.pollUntilDone(); } @@ -208,7 +207,7 @@ export class DeletedAccountsImpl implements DeletedAccounts { * @param options The options parameters. */ private _list( - options?: DeletedAccountsListOptionalParams + options?: DeletedAccountsListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -220,11 +219,11 @@ export class DeletedAccountsImpl implements DeletedAccounts { */ private _listNext( nextLink: string, - options?: DeletedAccountsListNextOptionalParams + options?: DeletedAccountsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -232,16 +231,15 @@ export class DeletedAccountsImpl implements DeletedAccounts { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/resourceGroups/{resourceGroupName}/deletedAccounts/{accountName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/resourceGroups/{resourceGroupName}/deletedAccounts/{accountName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.Account + bodyMapper: Mappers.Account, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -249,14 +247,13 @@ const getOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.accountName, Parameters.subscriptionId, - Parameters.location + Parameters.location, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const purgeOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/resourceGroups/{resourceGroupName}/deletedAccounts/{accountName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/resourceGroups/{resourceGroupName}/deletedAccounts/{accountName}", httpMethod: "DELETE", responses: { 200: {}, @@ -264,8 +261,8 @@ const purgeOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -273,44 +270,43 @@ const purgeOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.accountName, Parameters.subscriptionId, - Parameters.location + Parameters.location, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/deletedAccounts", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/deletedAccounts", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.AccountListResult + bodyMapper: Mappers.AccountListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.AccountListResult + bodyMapper: Mappers.AccountListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/deployments.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/deployments.ts index a825c082e106..f92e27b14e75 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/deployments.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/deployments.ts @@ -16,7 +16,7 @@ import { CognitiveServicesManagementClient } from "../cognitiveServicesManagemen import { SimplePollerLike, OperationState, - createHttpPoller + createHttpPoller, } from "@azure/core-lro"; import { createLroSpec } from "../lroImpl"; import { @@ -24,12 +24,20 @@ import { DeploymentsListNextOptionalParams, DeploymentsListOptionalParams, DeploymentsListResponse, + SkuResource, + DeploymentsListSkusNextOptionalParams, + DeploymentsListSkusOptionalParams, + DeploymentsListSkusResponse, DeploymentsGetOptionalParams, DeploymentsGetResponse, DeploymentsCreateOrUpdateOptionalParams, DeploymentsCreateOrUpdateResponse, + PatchResourceTagsAndSku, + DeploymentsUpdateOptionalParams, + DeploymentsUpdateResponse, DeploymentsDeleteOptionalParams, - DeploymentsListNextResponse + DeploymentsListNextResponse, + DeploymentsListSkusNextResponse, } from "../models"; /// @@ -54,7 +62,7 @@ export class DeploymentsImpl implements Deployments { public list( resourceGroupName: string, accountName: string, - options?: DeploymentsListOptionalParams + options?: DeploymentsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(resourceGroupName, accountName, options); return { @@ -72,9 +80,9 @@ export class DeploymentsImpl implements Deployments { resourceGroupName, accountName, options, - settings + settings, ); - } + }, }; } @@ -82,7 +90,7 @@ export class DeploymentsImpl implements Deployments { resourceGroupName: string, accountName: string, options?: DeploymentsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: DeploymentsListResponse; let continuationToken = settings?.continuationToken; @@ -98,7 +106,7 @@ export class DeploymentsImpl implements Deployments { resourceGroupName, accountName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -110,12 +118,105 @@ export class DeploymentsImpl implements Deployments { private async *listPagingAll( resourceGroupName: string, accountName: string, - options?: DeploymentsListOptionalParams + options?: DeploymentsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage( resourceGroupName, accountName, - options + options, + )) { + yield* page; + } + } + + /** + * Lists the specified deployments skus associated with the 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 deploymentName The name of the deployment associated with the Cognitive Services Account + * @param options The options parameters. + */ + public listSkus( + resourceGroupName: string, + accountName: string, + deploymentName: string, + options?: DeploymentsListSkusOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listSkusPagingAll( + resourceGroupName, + accountName, + deploymentName, + 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.listSkusPagingPage( + resourceGroupName, + accountName, + deploymentName, + options, + settings, + ); + }, + }; + } + + private async *listSkusPagingPage( + resourceGroupName: string, + accountName: string, + deploymentName: string, + options?: DeploymentsListSkusOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: DeploymentsListSkusResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listSkus( + resourceGroupName, + accountName, + deploymentName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listSkusNext( + resourceGroupName, + accountName, + deploymentName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listSkusPagingAll( + resourceGroupName: string, + accountName: string, + deploymentName: string, + options?: DeploymentsListSkusOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listSkusPagingPage( + resourceGroupName, + accountName, + deploymentName, + options, )) { yield* page; } @@ -130,11 +231,11 @@ export class DeploymentsImpl implements Deployments { private _list( resourceGroupName: string, accountName: string, - options?: DeploymentsListOptionalParams + options?: DeploymentsListOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, accountName, options }, - listOperationSpec + listOperationSpec, ); } @@ -149,11 +250,11 @@ export class DeploymentsImpl implements Deployments { resourceGroupName: string, accountName: string, deploymentName: string, - options?: DeploymentsGetOptionalParams + options?: DeploymentsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, accountName, deploymentName, options }, - getOperationSpec + getOperationSpec, ); } @@ -170,7 +271,7 @@ export class DeploymentsImpl implements Deployments { accountName: string, deploymentName: string, deployment: Deployment, - options?: DeploymentsCreateOrUpdateOptionalParams + options?: DeploymentsCreateOrUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -179,21 +280,20 @@ export class DeploymentsImpl implements Deployments { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -202,8 +302,8 @@ export class DeploymentsImpl implements Deployments { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -211,8 +311,8 @@ export class DeploymentsImpl implements Deployments { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; @@ -223,9 +323,9 @@ export class DeploymentsImpl implements Deployments { accountName, deploymentName, deployment, - options + options, }, - spec: createOrUpdateOperationSpec + spec: createOrUpdateOperationSpec, }); const poller = await createHttpPoller< DeploymentsCreateOrUpdateResponse, @@ -233,7 +333,7 @@ export class DeploymentsImpl implements Deployments { >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation", }); await poller.poll(); return poller; @@ -252,14 +352,120 @@ export class DeploymentsImpl implements Deployments { accountName: string, deploymentName: string, deployment: Deployment, - options?: DeploymentsCreateOrUpdateOptionalParams + options?: DeploymentsCreateOrUpdateOptionalParams, ): Promise { const poller = await this.beginCreateOrUpdate( resourceGroupName, accountName, deploymentName, deployment, - options + options, + ); + return poller.pollUntilDone(); + } + + /** + * Update specified deployments associated with the 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 deploymentName The name of the deployment associated with the Cognitive Services Account + * @param deployment The deployment properties. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + accountName: string, + deploymentName: string, + deployment: PatchResourceTagsAndSku, + options?: DeploymentsUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + DeploymentsUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + accountName, + deploymentName, + deployment, + options, + }, + spec: updateOperationSpec, + }); + const poller = await createHttpPoller< + DeploymentsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Update specified deployments associated with the 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 deploymentName The name of the deployment associated with the Cognitive Services Account + * @param deployment The deployment properties. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + accountName: string, + deploymentName: string, + deployment: PatchResourceTagsAndSku, + options?: DeploymentsUpdateOptionalParams, + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + accountName, + deploymentName, + deployment, + options, ); return poller.pollUntilDone(); } @@ -275,25 +481,24 @@ export class DeploymentsImpl implements Deployments { resourceGroupName: string, accountName: string, deploymentName: string, - options?: DeploymentsDeleteOptionalParams + options?: DeploymentsDeleteOptionalParams, ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -302,8 +507,8 @@ export class DeploymentsImpl implements Deployments { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -311,19 +516,19 @@ export class DeploymentsImpl implements Deployments { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceGroupName, accountName, deploymentName, options }, - spec: deleteOperationSpec + spec: deleteOperationSpec, }); const poller = await createHttpPoller>(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -340,17 +545,36 @@ export class DeploymentsImpl implements Deployments { resourceGroupName: string, accountName: string, deploymentName: string, - options?: DeploymentsDeleteOptionalParams + options?: DeploymentsDeleteOptionalParams, ): Promise { const poller = await this.beginDelete( resourceGroupName, accountName, deploymentName, - options + options, ); return poller.pollUntilDone(); } + /** + * Lists the specified deployments skus associated with the 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 deploymentName The name of the deployment associated with the Cognitive Services Account + * @param options The options parameters. + */ + private _listSkus( + resourceGroupName: string, + accountName: string, + deploymentName: string, + options?: DeploymentsListSkusOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, deploymentName, options }, + listSkusOperationSpec, + ); + } + /** * ListNext * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -362,11 +586,32 @@ export class DeploymentsImpl implements Deployments { resourceGroupName: string, accountName: string, nextLink: string, - options?: DeploymentsListNextOptionalParams + options?: DeploymentsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, accountName, nextLink, options }, - listNextOperationSpec + listNextOperationSpec, + ); + } + + /** + * ListSkusNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account + * @param nextLink The nextLink from the previous successful call to the ListSkus method. + * @param options The options parameters. + */ + private _listSkusNext( + resourceGroupName: string, + accountName: string, + deploymentName: string, + nextLink: string, + options?: DeploymentsListSkusNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, deploymentName, nextLink, options }, + listSkusNextOperationSpec, ); } } @@ -374,38 +619,36 @@ export class DeploymentsImpl implements Deployments { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentListResult + bodyMapper: Mappers.DeploymentListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.accountName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.Deployment + bodyMapper: Mappers.Deployment, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -413,31 +656,30 @@ const getOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.accountName, Parameters.subscriptionId, - Parameters.deploymentName + Parameters.deploymentName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.Deployment + bodyMapper: Mappers.Deployment, }, 201: { - bodyMapper: Mappers.Deployment + bodyMapper: Mappers.Deployment, }, 202: { - bodyMapper: Mappers.Deployment + bodyMapper: Mappers.Deployment, }, 204: { - bodyMapper: Mappers.Deployment + bodyMapper: Mappers.Deployment, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.deployment, queryParameters: [Parameters.apiVersion], @@ -446,15 +688,47 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.accountName, Parameters.subscriptionId, - Parameters.deploymentName + Parameters.deploymentName, ], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Deployment, + }, + 201: { + bodyMapper: Mappers.Deployment, + }, + 202: { + bodyMapper: Mappers.Deployment, + }, + 204: { + bodyMapper: Mappers.Deployment, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.deployment1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.deploymentName, + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}", httpMethod: "DELETE", responses: { 200: {}, @@ -462,8 +736,30 @@ const deleteOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.deploymentName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listSkusOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}/skus", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DeploymentSkuListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -471,29 +767,51 @@ const deleteOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.accountName, Parameters.subscriptionId, - Parameters.deploymentName + Parameters.deploymentName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentListResult + bodyMapper: Mappers.DeploymentListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listSkusNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DeploymentSkuListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.accountName, Parameters.subscriptionId, - Parameters.nextLink + Parameters.nextLink, + Parameters.deploymentName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/encryptionScopes.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/encryptionScopes.ts new file mode 100644 index 000000000000..88aa5d1dcc94 --- /dev/null +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/encryptionScopes.ts @@ -0,0 +1,429 @@ +/* + * 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 { EncryptionScopes } 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 { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + EncryptionScope, + EncryptionScopesListNextOptionalParams, + EncryptionScopesListOptionalParams, + EncryptionScopesListResponse, + EncryptionScopesGetOptionalParams, + EncryptionScopesGetResponse, + EncryptionScopesCreateOrUpdateOptionalParams, + EncryptionScopesCreateOrUpdateResponse, + EncryptionScopesDeleteOptionalParams, + EncryptionScopesDeleteResponse, + EncryptionScopesListNextResponse, +} from "../models"; + +/// +/** Class containing EncryptionScopes operations. */ +export class EncryptionScopesImpl implements EncryptionScopes { + private readonly client: CognitiveServicesManagementClient; + + /** + * Initialize a new instance of the class EncryptionScopes class. + * @param client Reference to the service client + */ + constructor(client: CognitiveServicesManagementClient) { + this.client = client; + } + + /** + * Gets the content filters associated with the Azure OpenAI 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 list( + resourceGroupName: string, + accountName: string, + options?: EncryptionScopesListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, accountName, 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( + resourceGroupName, + accountName, + options, + settings, + ); + }, + }; + } + + private async *listPagingPage( + resourceGroupName: string, + accountName: string, + options?: EncryptionScopesListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: EncryptionScopesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, accountName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + accountName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + accountName: string, + options?: EncryptionScopesListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + accountName, + options, + )) { + yield* page; + } + } + + /** + * Gets the content filters associated with the Azure OpenAI 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 _list( + resourceGroupName: string, + accountName: string, + options?: EncryptionScopesListOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, options }, + listOperationSpec, + ); + } + + /** + * Gets the specified EncryptionScope associated with the 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 encryptionScopeName The name of the encryptionScope associated with the Cognitive Services + * Account + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + encryptionScopeName: string, + options?: EncryptionScopesGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, encryptionScopeName, options }, + getOperationSpec, + ); + } + + /** + * Update the state of specified encryptionScope associated with the 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 encryptionScopeName The name of the encryptionScope associated with the Cognitive Services + * Account + * @param encryptionScope The encryptionScope properties. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + accountName: string, + encryptionScopeName: string, + encryptionScope: EncryptionScope, + options?: EncryptionScopesCreateOrUpdateOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + encryptionScopeName, + encryptionScope, + options, + }, + createOrUpdateOperationSpec, + ); + } + + /** + * Deletes the specified encryptionScope associated with the 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 encryptionScopeName The name of the encryptionScope associated with the Cognitive Services + * Account + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + accountName: string, + encryptionScopeName: string, + options?: EncryptionScopesDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + EncryptionScopesDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, encryptionScopeName, options }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller< + EncryptionScopesDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Deletes the specified encryptionScope associated with the 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 encryptionScopeName The name of the encryptionScope associated with the Cognitive Services + * Account + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + encryptionScopeName: string, + options?: EncryptionScopesDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + accountName, + encryptionScopeName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * ListNext + * @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 List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + accountName: string, + nextLink: string, + options?: EncryptionScopesListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, nextLink, options }, + listNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/encryptionScopes", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EncryptionScopeListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/encryptionScopes/{encryptionScopeName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EncryptionScope, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.encryptionScopeName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/encryptionScopes/{encryptionScopeName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.EncryptionScope, + }, + 201: { + bodyMapper: Mappers.EncryptionScope, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.encryptionScope, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.encryptionScopeName, + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/encryptionScopes/{encryptionScopeName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.EncryptionScopesDeleteHeaders, + }, + 201: { + headersMapper: Mappers.EncryptionScopesDeleteHeaders, + }, + 202: { + headersMapper: Mappers.EncryptionScopesDeleteHeaders, + }, + 204: { + headersMapper: Mappers.EncryptionScopesDeleteHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.encryptionScopeName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EncryptionScopeListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/index.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/index.ts index c3aa6d8c5dcd..17996d460adc 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/index.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/index.ts @@ -13,7 +13,16 @@ export * from "./usages"; export * from "./operations"; export * from "./commitmentTiers"; export * from "./models"; +export * from "./locationBasedModelCapacities"; +export * from "./modelCapacities"; export * from "./privateEndpointConnections"; export * from "./privateLinkResources"; export * from "./deployments"; export * from "./commitmentPlans"; +export * from "./encryptionScopes"; +export * from "./raiPolicies"; +export * from "./raiBlocklists"; +export * from "./raiBlocklistItems"; +export * from "./raiContentFilters"; +export * from "./networkSecurityPerimeterConfigurations"; +export * from "./defenderForAISettings"; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/locationBasedModelCapacities.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/locationBasedModelCapacities.ts new file mode 100644 index 000000000000..9479cc3431bb --- /dev/null +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/locationBasedModelCapacities.ts @@ -0,0 +1,219 @@ +/* + * 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 { LocationBasedModelCapacities } 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 { + ModelCapacityListResultValueItem, + LocationBasedModelCapacitiesListNextOptionalParams, + LocationBasedModelCapacitiesListOptionalParams, + LocationBasedModelCapacitiesListResponse, + LocationBasedModelCapacitiesListNextResponse, +} from "../models"; + +/// +/** Class containing LocationBasedModelCapacities operations. */ +export class LocationBasedModelCapacitiesImpl + implements LocationBasedModelCapacities +{ + private readonly client: CognitiveServicesManagementClient; + + /** + * Initialize a new instance of the class LocationBasedModelCapacities class. + * @param client Reference to the service client + */ + constructor(client: CognitiveServicesManagementClient) { + this.client = client; + } + + /** + * List Location Based ModelCapacities. + * @param location Resource location. + * @param modelFormat The format of the Model + * @param modelName The name of the Model + * @param modelVersion The version of the Model + * @param options The options parameters. + */ + public list( + location: string, + modelFormat: string, + modelName: string, + modelVersion: string, + options?: LocationBasedModelCapacitiesListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + location, + modelFormat, + modelName, + modelVersion, + 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, + modelFormat, + modelName, + modelVersion, + options, + settings, + ); + }, + }; + } + + private async *listPagingPage( + location: string, + modelFormat: string, + modelName: string, + modelVersion: string, + options?: LocationBasedModelCapacitiesListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: LocationBasedModelCapacitiesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + location, + modelFormat, + modelName, + modelVersion, + 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, + modelFormat: string, + modelName: string, + modelVersion: string, + options?: LocationBasedModelCapacitiesListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + location, + modelFormat, + modelName, + modelVersion, + options, + )) { + yield* page; + } + } + + /** + * List Location Based ModelCapacities. + * @param location Resource location. + * @param modelFormat The format of the Model + * @param modelName The name of the Model + * @param modelVersion The version of the Model + * @param options The options parameters. + */ + private _list( + location: string, + modelFormat: string, + modelName: string, + modelVersion: string, + options?: LocationBasedModelCapacitiesListOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { location, modelFormat, modelName, modelVersion, 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?: LocationBasedModelCapacitiesListNextOptionalParams, + ): 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}/modelCapacities", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ModelCapacityListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.modelFormat, + Parameters.modelName, + Parameters.modelVersion, + ], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.location, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ModelCapacityListResult, + }, + 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/modelCapacities.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/modelCapacities.ts new file mode 100644 index 000000000000..da1e15efc500 --- /dev/null +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/modelCapacities.ts @@ -0,0 +1,195 @@ +/* + * 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 { ModelCapacities } 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 { + ModelCapacityListResultValueItem, + ModelCapacitiesListNextOptionalParams, + ModelCapacitiesListOptionalParams, + ModelCapacitiesListResponse, + ModelCapacitiesListNextResponse, +} from "../models"; + +/// +/** Class containing ModelCapacities operations. */ +export class ModelCapacitiesImpl implements ModelCapacities { + private readonly client: CognitiveServicesManagementClient; + + /** + * Initialize a new instance of the class ModelCapacities class. + * @param client Reference to the service client + */ + constructor(client: CognitiveServicesManagementClient) { + this.client = client; + } + + /** + * List ModelCapacities. + * @param modelFormat The format of the Model + * @param modelName The name of the Model + * @param modelVersion The version of the Model + * @param options The options parameters. + */ + public list( + modelFormat: string, + modelName: string, + modelVersion: string, + options?: ModelCapacitiesListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + modelFormat, + modelName, + modelVersion, + 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( + modelFormat, + modelName, + modelVersion, + options, + settings, + ); + }, + }; + } + + private async *listPagingPage( + modelFormat: string, + modelName: string, + modelVersion: string, + options?: ModelCapacitiesListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: ModelCapacitiesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(modelFormat, modelName, modelVersion, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + modelFormat: string, + modelName: string, + modelVersion: string, + options?: ModelCapacitiesListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + modelFormat, + modelName, + modelVersion, + options, + )) { + yield* page; + } + } + + /** + * List ModelCapacities. + * @param modelFormat The format of the Model + * @param modelName The name of the Model + * @param modelVersion The version of the Model + * @param options The options parameters. + */ + private _list( + modelFormat: string, + modelName: string, + modelVersion: string, + options?: ModelCapacitiesListOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { modelFormat, modelName, modelVersion, options }, + listOperationSpec, + ); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: ModelCapacitiesListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/modelCapacities", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ModelCapacityListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.modelFormat, + Parameters.modelName, + Parameters.modelVersion, + ], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ModelCapacityListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/models.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/models.ts index 77aef58beeb4..5b60bc519681 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/models.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/models.ts @@ -18,7 +18,7 @@ import { ModelsListNextOptionalParams, ModelsListOptionalParams, ModelsListResponse, - ModelsListNextResponse + ModelsListNextResponse, } from "../models"; /// @@ -41,7 +41,7 @@ export class ModelsImpl implements Models { */ public list( location: string, - options?: ModelsListOptionalParams + options?: ModelsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(location, options); return { @@ -56,14 +56,14 @@ export class ModelsImpl implements Models { 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 + settings?: PageSettings, ): AsyncIterableIterator { let result: ModelsListResponse; let continuationToken = settings?.continuationToken; @@ -85,7 +85,7 @@ export class ModelsImpl implements Models { private async *listPagingAll( location: string, - options?: ModelsListOptionalParams + options?: ModelsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(location, options)) { yield* page; @@ -99,11 +99,11 @@ export class ModelsImpl implements Models { */ private _list( location: string, - options?: ModelsListOptionalParams + options?: ModelsListOptionalParams, ): Promise { return this.client.sendOperationRequest( { location, options }, - listOperationSpec + listOperationSpec, ); } @@ -116,11 +116,11 @@ export class ModelsImpl implements Models { private _listNext( location: string, nextLink: string, - options?: ModelsListNextOptionalParams + options?: ModelsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { location, nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -128,43 +128,42 @@ export class ModelsImpl implements Models { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/models", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/models", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ModelListResult + bodyMapper: Mappers.ModelListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.location + Parameters.location, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ModelListResult + bodyMapper: Mappers.ModelListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.nextLink, - Parameters.location + Parameters.location, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/networkSecurityPerimeterConfigurations.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/networkSecurityPerimeterConfigurations.ts new file mode 100644 index 000000000000..eac730db0ee3 --- /dev/null +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/networkSecurityPerimeterConfigurations.ts @@ -0,0 +1,372 @@ +/* + * 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 { NetworkSecurityPerimeterConfigurations } 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 { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + NetworkSecurityPerimeterConfiguration, + NetworkSecurityPerimeterConfigurationsListNextOptionalParams, + NetworkSecurityPerimeterConfigurationsListOptionalParams, + NetworkSecurityPerimeterConfigurationsListResponse, + NetworkSecurityPerimeterConfigurationsGetOptionalParams, + NetworkSecurityPerimeterConfigurationsGetResponse, + NetworkSecurityPerimeterConfigurationsReconcileOptionalParams, + NetworkSecurityPerimeterConfigurationsReconcileResponse, + NetworkSecurityPerimeterConfigurationsListNextResponse, +} from "../models"; + +/// +/** Class containing NetworkSecurityPerimeterConfigurations operations. */ +export class NetworkSecurityPerimeterConfigurationsImpl + implements NetworkSecurityPerimeterConfigurations +{ + private readonly client: CognitiveServicesManagementClient; + + /** + * Initialize a new instance of the class NetworkSecurityPerimeterConfigurations class. + * @param client Reference to the service client + */ + constructor(client: CognitiveServicesManagementClient) { + this.client = client; + } + + /** + * Gets a list of NSP configurations for an 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 list( + resourceGroupName: string, + accountName: string, + options?: NetworkSecurityPerimeterConfigurationsListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, accountName, 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( + resourceGroupName, + accountName, + options, + settings, + ); + }, + }; + } + + private async *listPagingPage( + resourceGroupName: string, + accountName: string, + options?: NetworkSecurityPerimeterConfigurationsListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: NetworkSecurityPerimeterConfigurationsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, accountName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + accountName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + accountName: string, + options?: NetworkSecurityPerimeterConfigurationsListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + accountName, + options, + )) { + yield* page; + } + } + + /** + * Gets a list of NSP configurations for an 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 _list( + resourceGroupName: string, + accountName: string, + options?: NetworkSecurityPerimeterConfigurationsListOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, options }, + listOperationSpec, + ); + } + + /** + * Gets the specified NSP configurations for an account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param nspConfigurationName The name of the NSP Configuration. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + nspConfigurationName: string, + options?: NetworkSecurityPerimeterConfigurationsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, nspConfigurationName, options }, + getOperationSpec, + ); + } + + /** + * Reconcile the NSP configuration for an account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param nspConfigurationName The name of the NSP Configuration. + * @param options The options parameters. + */ + async beginReconcile( + resourceGroupName: string, + accountName: string, + nspConfigurationName: string, + options?: NetworkSecurityPerimeterConfigurationsReconcileOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + NetworkSecurityPerimeterConfigurationsReconcileResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, nspConfigurationName, options }, + spec: reconcileOperationSpec, + }); + const poller = await createHttpPoller< + NetworkSecurityPerimeterConfigurationsReconcileResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Reconcile the NSP configuration for an account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param nspConfigurationName The name of the NSP Configuration. + * @param options The options parameters. + */ + async beginReconcileAndWait( + resourceGroupName: string, + accountName: string, + nspConfigurationName: string, + options?: NetworkSecurityPerimeterConfigurationsReconcileOptionalParams, + ): Promise { + const poller = await this.beginReconcile( + resourceGroupName, + accountName, + nspConfigurationName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * ListNext + * @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 List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + accountName: string, + nextLink: string, + options?: NetworkSecurityPerimeterConfigurationsListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, nextLink, options }, + listNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/networkSecurityPerimeterConfigurations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.NetworkSecurityPerimeterConfigurationList, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/networkSecurityPerimeterConfigurations/{nspConfigurationName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.NetworkSecurityPerimeterConfiguration, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.nspConfigurationName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const reconcileOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/networkSecurityPerimeterConfigurations/{nspConfigurationName}/reconcile", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.NetworkSecurityPerimeterConfiguration, + }, + 201: { + bodyMapper: Mappers.NetworkSecurityPerimeterConfiguration, + }, + 202: { + bodyMapper: Mappers.NetworkSecurityPerimeterConfiguration, + }, + 204: { + bodyMapper: Mappers.NetworkSecurityPerimeterConfiguration, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.nspConfigurationName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.NetworkSecurityPerimeterConfigurationList, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/operations.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/operations.ts index dbfe2ecc9bb2..8cd44eed2fa8 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/operations.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/operations.ts @@ -18,7 +18,7 @@ import { OperationsListNextOptionalParams, OperationsListOptionalParams, OperationsListResponse, - OperationsListNextResponse + OperationsListNextResponse, } from "../models"; /// @@ -39,7 +39,7 @@ export class OperationsImpl implements Operations { * @param options The options parameters. */ public list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -54,13 +54,13 @@ export class OperationsImpl implements Operations { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: OperationsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: OperationsListResponse; let continuationToken = settings?.continuationToken; @@ -81,7 +81,7 @@ export class OperationsImpl implements Operations { } private async *listPagingAll( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -93,7 +93,7 @@ export class OperationsImpl implements Operations { * @param options The options parameters. */ private _list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -105,11 +105,11 @@ export class OperationsImpl implements Operations { */ private _listNext( nextLink: string, - options?: OperationsListNextOptionalParams + options?: OperationsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -121,29 +121,29 @@ const listOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/privateEndpointConnections.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/privateEndpointConnections.ts index 759419bef9c8..e96e65a2a562 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/privateEndpointConnections.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/privateEndpointConnections.ts @@ -14,7 +14,7 @@ import { CognitiveServicesManagementClient } from "../cognitiveServicesManagemen import { SimplePollerLike, OperationState, - createHttpPoller + createHttpPoller, } from "@azure/core-lro"; import { createLroSpec } from "../lroImpl"; import { @@ -25,12 +25,13 @@ import { PrivateEndpointConnection, PrivateEndpointConnectionsCreateOrUpdateOptionalParams, PrivateEndpointConnectionsCreateOrUpdateResponse, - PrivateEndpointConnectionsDeleteOptionalParams + PrivateEndpointConnectionsDeleteOptionalParams, } from "../models"; /** Class containing PrivateEndpointConnections operations. */ export class PrivateEndpointConnectionsImpl - implements PrivateEndpointConnections { + implements PrivateEndpointConnections +{ private readonly client: CognitiveServicesManagementClient; /** @@ -50,11 +51,11 @@ export class PrivateEndpointConnectionsImpl list( resourceGroupName: string, accountName: string, - options?: PrivateEndpointConnectionsListOptionalParams + options?: PrivateEndpointConnectionsListOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, accountName, options }, - listOperationSpec + listOperationSpec, ); } @@ -70,16 +71,16 @@ export class PrivateEndpointConnectionsImpl resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsGetOptionalParams + options?: PrivateEndpointConnectionsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, accountName, privateEndpointConnectionName, - options + options, }, - getOperationSpec + getOperationSpec, ); } @@ -98,7 +99,7 @@ export class PrivateEndpointConnectionsImpl accountName: string, privateEndpointConnectionName: string, properties: PrivateEndpointConnection, - options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams + options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -107,21 +108,20 @@ export class PrivateEndpointConnectionsImpl > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -130,8 +130,8 @@ export class PrivateEndpointConnectionsImpl ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -139,8 +139,8 @@ export class PrivateEndpointConnectionsImpl rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; @@ -151,16 +151,16 @@ export class PrivateEndpointConnectionsImpl accountName, privateEndpointConnectionName, properties, - options + options, }, - spec: createOrUpdateOperationSpec + spec: createOrUpdateOperationSpec, }); const poller = await createHttpPoller< PrivateEndpointConnectionsCreateOrUpdateResponse, OperationState >(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -181,14 +181,14 @@ export class PrivateEndpointConnectionsImpl accountName: string, privateEndpointConnectionName: string, properties: PrivateEndpointConnection, - options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams + options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams, ): Promise { const poller = await this.beginCreateOrUpdate( resourceGroupName, accountName, privateEndpointConnectionName, properties, - options + options, ); return poller.pollUntilDone(); } @@ -205,25 +205,24 @@ export class PrivateEndpointConnectionsImpl resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsDeleteOptionalParams + options?: PrivateEndpointConnectionsDeleteOptionalParams, ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -232,8 +231,8 @@ export class PrivateEndpointConnectionsImpl ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -241,8 +240,8 @@ export class PrivateEndpointConnectionsImpl rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; @@ -252,13 +251,13 @@ export class PrivateEndpointConnectionsImpl resourceGroupName, accountName, privateEndpointConnectionName, - options + options, }, - spec: deleteOperationSpec + spec: deleteOperationSpec, }); const poller = await createHttpPoller>(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, }); await poller.poll(); return poller; @@ -276,13 +275,13 @@ export class PrivateEndpointConnectionsImpl resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsDeleteOptionalParams + options?: PrivateEndpointConnectionsDeleteOptionalParams, ): Promise { const poller = await this.beginDelete( resourceGroupName, accountName, privateEndpointConnectionName, - options + options, ); return poller.pollUntilDone(); } @@ -291,38 +290,36 @@ export class PrivateEndpointConnectionsImpl const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PrivateEndpointConnectionListResult + bodyMapper: Mappers.PrivateEndpointConnectionListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.accountName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PrivateEndpointConnection + bodyMapper: Mappers.PrivateEndpointConnection, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -330,31 +327,30 @@ const getOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.accountName, Parameters.subscriptionId, - Parameters.privateEndpointConnectionName + Parameters.privateEndpointConnectionName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.PrivateEndpointConnection + bodyMapper: Mappers.PrivateEndpointConnection, }, 201: { - bodyMapper: Mappers.PrivateEndpointConnection + bodyMapper: Mappers.PrivateEndpointConnection, }, 202: { - bodyMapper: Mappers.PrivateEndpointConnection + bodyMapper: Mappers.PrivateEndpointConnection, }, 204: { - bodyMapper: Mappers.PrivateEndpointConnection + bodyMapper: Mappers.PrivateEndpointConnection, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.properties, queryParameters: [Parameters.apiVersion], @@ -363,15 +359,14 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.accountName, Parameters.subscriptionId, - Parameters.privateEndpointConnectionName + Parameters.privateEndpointConnectionName, ], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", httpMethod: "DELETE", responses: { 200: {}, @@ -379,8 +374,8 @@ const deleteOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -388,8 +383,8 @@ const deleteOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.accountName, Parameters.subscriptionId, - Parameters.privateEndpointConnectionName + Parameters.privateEndpointConnectionName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/privateLinkResources.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/privateLinkResources.ts index df560f3e3a52..3e95afb14214 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/privateLinkResources.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/privateLinkResources.ts @@ -13,7 +13,7 @@ import * as Parameters from "../models/parameters"; import { CognitiveServicesManagementClient } from "../cognitiveServicesManagementClient"; import { PrivateLinkResourcesListOptionalParams, - PrivateLinkResourcesListResponse + PrivateLinkResourcesListResponse, } from "../models"; /** Class containing PrivateLinkResources operations. */ @@ -37,11 +37,11 @@ export class PrivateLinkResourcesImpl implements PrivateLinkResources { list( resourceGroupName: string, accountName: string, - options?: PrivateLinkResourcesListOptionalParams + options?: PrivateLinkResourcesListOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, accountName, options }, - listOperationSpec + listOperationSpec, ); } } @@ -49,24 +49,23 @@ export class PrivateLinkResourcesImpl implements PrivateLinkResources { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateLinkResources", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateLinkResources", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PrivateLinkResourceListResult + bodyMapper: Mappers.PrivateLinkResourceListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.accountName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/raiBlocklistItems.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/raiBlocklistItems.ts new file mode 100644 index 000000000000..43a3be3638f5 --- /dev/null +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/raiBlocklistItems.ts @@ -0,0 +1,578 @@ +/* + * 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 { RaiBlocklistItems } 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 { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + RaiBlocklistItem, + RaiBlocklistItemsListNextOptionalParams, + RaiBlocklistItemsListOptionalParams, + RaiBlocklistItemsListResponse, + RaiBlocklistItemsGetOptionalParams, + RaiBlocklistItemsGetResponse, + RaiBlocklistItemsCreateOrUpdateOptionalParams, + RaiBlocklistItemsCreateOrUpdateResponse, + RaiBlocklistItemsDeleteOptionalParams, + RaiBlocklistItemsDeleteResponse, + RaiBlocklistItemBulkRequest, + RaiBlocklistItemsBatchAddOptionalParams, + RaiBlocklistItemsBatchAddResponse, + RaiBlocklistItemsBatchDeleteOptionalParams, + RaiBlocklistItemsListNextResponse, +} from "../models"; + +/// +/** Class containing RaiBlocklistItems operations. */ +export class RaiBlocklistItemsImpl implements RaiBlocklistItems { + private readonly client: CognitiveServicesManagementClient; + + /** + * Initialize a new instance of the class RaiBlocklistItems class. + * @param client Reference to the service client + */ + constructor(client: CognitiveServicesManagementClient) { + this.client = client; + } + + /** + * Gets the blocklist items associated with the custom blocklist. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + accountName: string, + raiBlocklistName: string, + options?: RaiBlocklistItemsListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + resourceGroupName, + accountName, + raiBlocklistName, + 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( + resourceGroupName, + accountName, + raiBlocklistName, + options, + settings, + ); + }, + }; + } + + private async *listPagingPage( + resourceGroupName: string, + accountName: string, + raiBlocklistName: string, + options?: RaiBlocklistItemsListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: RaiBlocklistItemsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + resourceGroupName, + accountName, + raiBlocklistName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + accountName, + raiBlocklistName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + accountName: string, + raiBlocklistName: string, + options?: RaiBlocklistItemsListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + accountName, + raiBlocklistName, + options, + )) { + yield* page; + } + } + + /** + * Gets the blocklist items associated with the custom blocklist. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + accountName: string, + raiBlocklistName: string, + options?: RaiBlocklistItemsListOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, raiBlocklistName, options }, + listOperationSpec, + ); + } + + /** + * Gets the specified custom blocklist Item associated with the custom blocklist. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account + * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + raiBlocklistName: string, + raiBlocklistItemName: string, + options?: RaiBlocklistItemsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + raiBlocklistName, + raiBlocklistItemName, + options, + }, + getOperationSpec, + ); + } + + /** + * Update the state of specified blocklist item associated with the Azure OpenAI account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account + * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist + * @param raiBlocklistItem Properties describing the custom blocklist. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + accountName: string, + raiBlocklistName: string, + raiBlocklistItemName: string, + raiBlocklistItem: RaiBlocklistItem, + options?: RaiBlocklistItemsCreateOrUpdateOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + raiBlocklistName, + raiBlocklistItemName, + raiBlocklistItem, + options, + }, + createOrUpdateOperationSpec, + ); + } + + /** + * Deletes the specified blocklist Item associated with the custom blocklist. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account + * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + accountName: string, + raiBlocklistName: string, + raiBlocklistItemName: string, + options?: RaiBlocklistItemsDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + RaiBlocklistItemsDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + accountName, + raiBlocklistName, + raiBlocklistItemName, + options, + }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller< + RaiBlocklistItemsDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Deletes the specified blocklist Item associated with the custom blocklist. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account + * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + raiBlocklistName: string, + raiBlocklistItemName: string, + options?: RaiBlocklistItemsDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + accountName, + raiBlocklistName, + raiBlocklistItemName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Batch operation to add blocklist items. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account + * @param raiBlocklistItems Properties describing the custom blocklist items. + * @param options The options parameters. + */ + batchAdd( + resourceGroupName: string, + accountName: string, + raiBlocklistName: string, + raiBlocklistItems: RaiBlocklistItemBulkRequest[], + options?: RaiBlocklistItemsBatchAddOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + raiBlocklistName, + raiBlocklistItems, + options, + }, + batchAddOperationSpec, + ); + } + + /** + * Batch operation to delete blocklist items. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account + * @param raiBlocklistItemsNames List of RAI Blocklist Items Names. + * @param options The options parameters. + */ + batchDelete( + resourceGroupName: string, + accountName: string, + raiBlocklistName: string, + raiBlocklistItemsNames: Record, + options?: RaiBlocklistItemsBatchDeleteOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + raiBlocklistName, + raiBlocklistItemsNames, + options, + }, + batchDeleteOperationSpec, + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + accountName: string, + raiBlocklistName: string, + nextLink: string, + options?: RaiBlocklistItemsListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, raiBlocklistName, nextLink, options }, + listNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RaiBlockListItemsResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.raiBlocklistName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RaiBlocklistItem, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.raiBlocklistName, + Parameters.raiBlocklistItemName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.RaiBlocklistItem, + }, + 201: { + bodyMapper: Mappers.RaiBlocklistItem, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.raiBlocklistItem, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.raiBlocklistName, + Parameters.raiBlocklistItemName, + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.RaiBlocklistItemsDeleteHeaders, + }, + 201: { + headersMapper: Mappers.RaiBlocklistItemsDeleteHeaders, + }, + 202: { + headersMapper: Mappers.RaiBlocklistItemsDeleteHeaders, + }, + 204: { + headersMapper: Mappers.RaiBlocklistItemsDeleteHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.raiBlocklistName, + Parameters.raiBlocklistItemName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const batchAddOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/addRaiBlocklistItems", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.RaiBlocklist, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.raiBlocklistItems, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.raiBlocklistName, + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer, +}; +const batchDeleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/deleteRaiBlocklistItems", + httpMethod: "POST", + responses: { + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.raiBlocklistItemsNames, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.raiBlocklistName, + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RaiBlockListItemsResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.raiBlocklistName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/raiBlocklists.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/raiBlocklists.ts new file mode 100644 index 000000000000..07b9614fa442 --- /dev/null +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/raiBlocklists.ts @@ -0,0 +1,426 @@ +/* + * 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 { RaiBlocklists } 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 { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + RaiBlocklist, + RaiBlocklistsListNextOptionalParams, + RaiBlocklistsListOptionalParams, + RaiBlocklistsListResponse, + RaiBlocklistsGetOptionalParams, + RaiBlocklistsGetResponse, + RaiBlocklistsCreateOrUpdateOptionalParams, + RaiBlocklistsCreateOrUpdateResponse, + RaiBlocklistsDeleteOptionalParams, + RaiBlocklistsDeleteResponse, + RaiBlocklistsListNextResponse, +} from "../models"; + +/// +/** Class containing RaiBlocklists operations. */ +export class RaiBlocklistsImpl implements RaiBlocklists { + private readonly client: CognitiveServicesManagementClient; + + /** + * Initialize a new instance of the class RaiBlocklists class. + * @param client Reference to the service client + */ + constructor(client: CognitiveServicesManagementClient) { + this.client = client; + } + + /** + * Gets the custom blocklists associated with the Azure OpenAI 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 list( + resourceGroupName: string, + accountName: string, + options?: RaiBlocklistsListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, accountName, 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( + resourceGroupName, + accountName, + options, + settings, + ); + }, + }; + } + + private async *listPagingPage( + resourceGroupName: string, + accountName: string, + options?: RaiBlocklistsListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: RaiBlocklistsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, accountName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + accountName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + accountName: string, + options?: RaiBlocklistsListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + accountName, + options, + )) { + yield* page; + } + } + + /** + * Gets the custom blocklists associated with the Azure OpenAI 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 _list( + resourceGroupName: string, + accountName: string, + options?: RaiBlocklistsListOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, options }, + listOperationSpec, + ); + } + + /** + * Gets the specified custom blocklist associated with the Azure OpenAI account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + raiBlocklistName: string, + options?: RaiBlocklistsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, raiBlocklistName, options }, + getOperationSpec, + ); + } + + /** + * Update the state of specified blocklist associated with the Azure OpenAI account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account + * @param raiBlocklist Properties describing the custom blocklist. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + accountName: string, + raiBlocklistName: string, + raiBlocklist: RaiBlocklist, + options?: RaiBlocklistsCreateOrUpdateOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + raiBlocklistName, + raiBlocklist, + options, + }, + createOrUpdateOperationSpec, + ); + } + + /** + * Deletes the specified custom blocklist associated with the Azure OpenAI account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + accountName: string, + raiBlocklistName: string, + options?: RaiBlocklistsDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + RaiBlocklistsDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, raiBlocklistName, options }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller< + RaiBlocklistsDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Deletes the specified custom blocklist associated with the Azure OpenAI account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + raiBlocklistName: string, + options?: RaiBlocklistsDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + accountName, + raiBlocklistName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * ListNext + * @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 List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + accountName: string, + nextLink: string, + options?: RaiBlocklistsListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, nextLink, options }, + listNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RaiBlockListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RaiBlocklist, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.raiBlocklistName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.RaiBlocklist, + }, + 201: { + bodyMapper: Mappers.RaiBlocklist, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.raiBlocklist, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.raiBlocklistName, + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.RaiBlocklistsDeleteHeaders, + }, + 201: { + headersMapper: Mappers.RaiBlocklistsDeleteHeaders, + }, + 202: { + headersMapper: Mappers.RaiBlocklistsDeleteHeaders, + }, + 204: { + headersMapper: Mappers.RaiBlocklistsDeleteHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.raiBlocklistName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RaiBlockListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/raiContentFilters.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/raiContentFilters.ts new file mode 100644 index 000000000000..10ff7e1d8bfc --- /dev/null +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/raiContentFilters.ts @@ -0,0 +1,209 @@ +/* + * 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 { RaiContentFilters } 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 { + RaiContentFilter, + RaiContentFiltersListNextOptionalParams, + RaiContentFiltersListOptionalParams, + RaiContentFiltersListResponse, + RaiContentFiltersGetOptionalParams, + RaiContentFiltersGetResponse, + RaiContentFiltersListNextResponse, +} from "../models"; + +/// +/** Class containing RaiContentFilters operations. */ +export class RaiContentFiltersImpl implements RaiContentFilters { + private readonly client: CognitiveServicesManagementClient; + + /** + * Initialize a new instance of the class RaiContentFilters class. + * @param client Reference to the service client + */ + constructor(client: CognitiveServicesManagementClient) { + this.client = client; + } + + /** + * List Content Filters types. + * @param location Resource location. + * @param options The options parameters. + */ + public list( + location: string, + options?: RaiContentFiltersListOptionalParams, + ): 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?: RaiContentFiltersListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: RaiContentFiltersListResponse; + 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?: RaiContentFiltersListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(location, options)) { + yield* page; + } + } + + /** + * List Content Filters types. + * @param location Resource location. + * @param options The options parameters. + */ + private _list( + location: string, + options?: RaiContentFiltersListOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { location, options }, + listOperationSpec, + ); + } + + /** + * Get Content Filters by Name. + * @param location Resource location. + * @param filterName The name of the RAI Content Filter. + * @param options The options parameters. + */ + get( + location: string, + filterName: string, + options?: RaiContentFiltersGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { location, filterName, options }, + getOperationSpec, + ); + } + + /** + * 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?: RaiContentFiltersListNextOptionalParams, + ): 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}/raiContentFilters", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RaiContentFilterListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.location, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/raiContentFilters/{filterName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RaiContentFilter, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.location, + Parameters.filterName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RaiContentFilterListResult, + }, + 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/raiPolicies.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/raiPolicies.ts new file mode 100644 index 000000000000..6925efc5ea42 --- /dev/null +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/raiPolicies.ts @@ -0,0 +1,420 @@ +/* + * 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 { RaiPolicies } 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 { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + RaiPolicy, + RaiPoliciesListNextOptionalParams, + RaiPoliciesListOptionalParams, + RaiPoliciesListResponse, + RaiPoliciesGetOptionalParams, + RaiPoliciesGetResponse, + RaiPoliciesCreateOrUpdateOptionalParams, + RaiPoliciesCreateOrUpdateResponse, + RaiPoliciesDeleteOptionalParams, + RaiPoliciesDeleteResponse, + RaiPoliciesListNextResponse, +} from "../models"; + +/// +/** Class containing RaiPolicies operations. */ +export class RaiPoliciesImpl implements RaiPolicies { + private readonly client: CognitiveServicesManagementClient; + + /** + * Initialize a new instance of the class RaiPolicies class. + * @param client Reference to the service client + */ + constructor(client: CognitiveServicesManagementClient) { + this.client = client; + } + + /** + * Gets the content filters associated with the Azure OpenAI 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 list( + resourceGroupName: string, + accountName: string, + options?: RaiPoliciesListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, accountName, 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( + resourceGroupName, + accountName, + options, + settings, + ); + }, + }; + } + + private async *listPagingPage( + resourceGroupName: string, + accountName: string, + options?: RaiPoliciesListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: RaiPoliciesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, accountName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + accountName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + accountName: string, + options?: RaiPoliciesListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + accountName, + options, + )) { + yield* page; + } + } + + /** + * Gets the content filters associated with the Azure OpenAI 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 _list( + resourceGroupName: string, + accountName: string, + options?: RaiPoliciesListOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, options }, + listOperationSpec, + ); + } + + /** + * Gets the specified Content Filters associated with the Azure OpenAI account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + raiPolicyName: string, + options?: RaiPoliciesGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, raiPolicyName, options }, + getOperationSpec, + ); + } + + /** + * Update the state of specified Content Filters associated with the Azure OpenAI account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account + * @param raiPolicy Properties describing the Content Filters. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + accountName: string, + raiPolicyName: string, + raiPolicy: RaiPolicy, + options?: RaiPoliciesCreateOrUpdateOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, raiPolicyName, raiPolicy, options }, + createOrUpdateOperationSpec, + ); + } + + /** + * Deletes the specified Content Filters associated with the Azure OpenAI account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + accountName: string, + raiPolicyName: string, + options?: RaiPoliciesDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + RaiPoliciesDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, raiPolicyName, options }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller< + RaiPoliciesDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Deletes the specified Content Filters associated with the Azure OpenAI account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + raiPolicyName: string, + options?: RaiPoliciesDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + accountName, + raiPolicyName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * ListNext + * @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 List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + accountName: string, + nextLink: string, + options?: RaiPoliciesListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, nextLink, options }, + listNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiPolicies", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RaiPolicyListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiPolicies/{raiPolicyName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RaiPolicy, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.raiPolicyName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiPolicies/{raiPolicyName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.RaiPolicy, + }, + 201: { + bodyMapper: Mappers.RaiPolicy, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.raiPolicy, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.raiPolicyName, + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiPolicies/{raiPolicyName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.RaiPoliciesDeleteHeaders, + }, + 201: { + headersMapper: Mappers.RaiPoliciesDeleteHeaders, + }, + 202: { + headersMapper: Mappers.RaiPoliciesDeleteHeaders, + }, + 204: { + headersMapper: Mappers.RaiPoliciesDeleteHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.raiPolicyName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RaiPolicyListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/resourceSkus.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/resourceSkus.ts index 89446e18c6b6..7bd85291ad33 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/resourceSkus.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/resourceSkus.ts @@ -18,7 +18,7 @@ import { ResourceSkusListNextOptionalParams, ResourceSkusListOptionalParams, ResourceSkusListResponse, - ResourceSkusListNextResponse + ResourceSkusListNextResponse, } from "../models"; /// @@ -39,7 +39,7 @@ export class ResourceSkusImpl implements ResourceSkus { * @param options The options parameters. */ public list( - options?: ResourceSkusListOptionalParams + options?: ResourceSkusListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -54,13 +54,13 @@ export class ResourceSkusImpl implements ResourceSkus { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: ResourceSkusListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ResourceSkusListResponse; let continuationToken = settings?.continuationToken; @@ -81,7 +81,7 @@ export class ResourceSkusImpl implements ResourceSkus { } private async *listPagingAll( - options?: ResourceSkusListOptionalParams + options?: ResourceSkusListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -93,7 +93,7 @@ export class ResourceSkusImpl implements ResourceSkus { * @param options The options parameters. */ private _list( - options?: ResourceSkusListOptionalParams + options?: ResourceSkusListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -105,11 +105,11 @@ export class ResourceSkusImpl implements ResourceSkus { */ private _listNext( nextLink: string, - options?: ResourceSkusListNextOptionalParams + options?: ResourceSkusListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -117,38 +117,37 @@ export class ResourceSkusImpl implements ResourceSkus { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/skus", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/skus", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ResourceSkuListResult + bodyMapper: Mappers.ResourceSkuListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ResourceSkuListResult + bodyMapper: Mappers.ResourceSkuListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/usages.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/usages.ts index ec10148fc5ef..0b9d0b08327c 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/usages.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/usages.ts @@ -18,7 +18,7 @@ import { UsagesListNextOptionalParams, UsagesListOptionalParams, UsagesListResponse, - UsagesListNextResponse + UsagesListNextResponse, } from "../models"; /// @@ -41,7 +41,7 @@ export class UsagesImpl implements Usages { */ public list( location: string, - options?: UsagesListOptionalParams + options?: UsagesListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(location, options); return { @@ -56,14 +56,14 @@ export class UsagesImpl implements Usages { 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 + settings?: PageSettings, ): AsyncIterableIterator { let result: UsagesListResponse; let continuationToken = settings?.continuationToken; @@ -85,7 +85,7 @@ export class UsagesImpl implements Usages { private async *listPagingAll( location: string, - options?: UsagesListOptionalParams + options?: UsagesListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(location, options)) { yield* page; @@ -99,11 +99,11 @@ export class UsagesImpl implements Usages { */ private _list( location: string, - options?: UsagesListOptionalParams + options?: UsagesListOptionalParams, ): Promise { return this.client.sendOperationRequest( { location, options }, - listOperationSpec + listOperationSpec, ); } @@ -116,11 +116,11 @@ export class UsagesImpl implements Usages { private _listNext( location: string, nextLink: string, - options?: UsagesListNextOptionalParams + options?: UsagesListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { location, nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -128,43 +128,42 @@ export class UsagesImpl implements Usages { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/usages", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/usages", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.UsageListResult + bodyMapper: Mappers.UsageListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.location + Parameters.location, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.UsageListResult + bodyMapper: Mappers.UsageListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.nextLink, - Parameters.location + Parameters.location, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/accounts.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/accounts.ts index cc8efb0dd054..a4b971be0ed6 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/accounts.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/accounts.ts @@ -29,7 +29,7 @@ import { AccountsListSkusOptionalParams, AccountsListSkusResponse, AccountsListUsagesOptionalParams, - AccountsListUsagesResponse + AccountsListUsagesResponse, } from "../models"; /// @@ -42,14 +42,14 @@ export interface Accounts { */ listByResourceGroup( resourceGroupName: string, - options?: AccountsListByResourceGroupOptionalParams + options?: AccountsListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator; /** * Returns all the resources of a particular type belonging to a subscription. * @param options The options parameters. */ list( - options?: AccountsListOptionalParams + options?: AccountsListOptionalParams, ): PagedAsyncIterableIterator; /** * List available Models for the requested Cognitive Services account @@ -60,7 +60,7 @@ export interface Accounts { listModels( resourceGroupName: string, accountName: string, - options?: AccountsListModelsOptionalParams + options?: AccountsListModelsOptionalParams, ): PagedAsyncIterableIterator; /** * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the @@ -74,7 +74,7 @@ export interface Accounts { resourceGroupName: string, accountName: string, account: Account, - options?: AccountsCreateOptionalParams + options?: AccountsCreateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -93,7 +93,7 @@ export interface Accounts { resourceGroupName: string, accountName: string, account: Account, - options?: AccountsCreateOptionalParams + options?: AccountsCreateOptionalParams, ): Promise; /** * Updates a Cognitive Services account @@ -106,7 +106,7 @@ export interface Accounts { resourceGroupName: string, accountName: string, account: Account, - options?: AccountsUpdateOptionalParams + options?: AccountsUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -124,7 +124,7 @@ export interface Accounts { resourceGroupName: string, accountName: string, account: Account, - options?: AccountsUpdateOptionalParams + options?: AccountsUpdateOptionalParams, ): Promise; /** * Deletes a Cognitive Services account from the resource group. @@ -135,7 +135,7 @@ export interface Accounts { beginDelete( resourceGroupName: string, accountName: string, - options?: AccountsDeleteOptionalParams + options?: AccountsDeleteOptionalParams, ): Promise, void>>; /** * Deletes a Cognitive Services account from the resource group. @@ -146,7 +146,7 @@ export interface Accounts { beginDeleteAndWait( resourceGroupName: string, accountName: string, - options?: AccountsDeleteOptionalParams + options?: AccountsDeleteOptionalParams, ): Promise; /** * Returns a Cognitive Services account specified by the parameters. @@ -157,7 +157,7 @@ export interface Accounts { get( resourceGroupName: string, accountName: string, - options?: AccountsGetOptionalParams + options?: AccountsGetOptionalParams, ): Promise; /** * Lists the account keys for the specified Cognitive Services account. @@ -168,7 +168,7 @@ export interface Accounts { listKeys( resourceGroupName: string, accountName: string, - options?: AccountsListKeysOptionalParams + options?: AccountsListKeysOptionalParams, ): Promise; /** * Regenerates the specified account key for the specified Cognitive Services account. @@ -181,7 +181,7 @@ export interface Accounts { resourceGroupName: string, accountName: string, keyName: KeyName, - options?: AccountsRegenerateKeyOptionalParams + options?: AccountsRegenerateKeyOptionalParams, ): Promise; /** * List available SKUs for the requested Cognitive Services account @@ -192,7 +192,7 @@ export interface Accounts { listSkus( resourceGroupName: string, accountName: string, - options?: AccountsListSkusOptionalParams + options?: AccountsListSkusOptionalParams, ): Promise; /** * Get usages for the requested Cognitive Services account @@ -203,6 +203,6 @@ export interface Accounts { listUsages( resourceGroupName: string, accountName: string, - options?: AccountsListUsagesOptionalParams + options?: AccountsListUsagesOptionalParams, ): Promise; } diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/commitmentPlans.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/commitmentPlans.ts index 89fe161fd982..95e8757ac336 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/commitmentPlans.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/commitmentPlans.ts @@ -32,7 +32,7 @@ import { CommitmentPlansGetAssociationResponse, CommitmentPlansCreateOrUpdateAssociationOptionalParams, CommitmentPlansCreateOrUpdateAssociationResponse, - CommitmentPlansDeleteAssociationOptionalParams + CommitmentPlansDeleteAssociationOptionalParams, } from "../models"; /// @@ -47,7 +47,7 @@ export interface CommitmentPlans { list( resourceGroupName: string, accountName: string, - options?: CommitmentPlansListOptionalParams + options?: CommitmentPlansListOptionalParams, ): PagedAsyncIterableIterator; /** * Returns all the resources of a particular type belonging to a resource group @@ -56,14 +56,14 @@ export interface CommitmentPlans { */ listPlansByResourceGroup( resourceGroupName: string, - options?: CommitmentPlansListPlansByResourceGroupOptionalParams + options?: CommitmentPlansListPlansByResourceGroupOptionalParams, ): PagedAsyncIterableIterator; /** * Returns all the resources of a particular type belonging to a subscription. * @param options The options parameters. */ listPlansBySubscription( - options?: CommitmentPlansListPlansBySubscriptionOptionalParams + options?: CommitmentPlansListPlansBySubscriptionOptionalParams, ): PagedAsyncIterableIterator; /** * Gets the associations of the Cognitive Services commitment plan. @@ -75,7 +75,7 @@ export interface CommitmentPlans { listAssociations( resourceGroupName: string, commitmentPlanName: string, - options?: CommitmentPlansListAssociationsOptionalParams + options?: CommitmentPlansListAssociationsOptionalParams, ): PagedAsyncIterableIterator; /** * Gets the specified commitmentPlans associated with the Cognitive Services account. @@ -89,7 +89,7 @@ export interface CommitmentPlans { resourceGroupName: string, accountName: string, commitmentPlanName: string, - options?: CommitmentPlansGetOptionalParams + options?: CommitmentPlansGetOptionalParams, ): Promise; /** * Update the state of specified commitmentPlans associated with the Cognitive Services account. @@ -105,7 +105,7 @@ export interface CommitmentPlans { accountName: string, commitmentPlanName: string, commitmentPlan: CommitmentPlan, - options?: CommitmentPlansCreateOrUpdateOptionalParams + options?: CommitmentPlansCreateOrUpdateOptionalParams, ): Promise; /** * Deletes the specified commitmentPlan associated with the Cognitive Services account. @@ -119,7 +119,7 @@ export interface CommitmentPlans { resourceGroupName: string, accountName: string, commitmentPlanName: string, - options?: CommitmentPlansDeleteOptionalParams + options?: CommitmentPlansDeleteOptionalParams, ): Promise, void>>; /** * Deletes the specified commitmentPlan associated with the Cognitive Services account. @@ -133,7 +133,7 @@ export interface CommitmentPlans { resourceGroupName: string, accountName: string, commitmentPlanName: string, - options?: CommitmentPlansDeleteOptionalParams + options?: CommitmentPlansDeleteOptionalParams, ): Promise; /** * Create Cognitive Services commitment plan. @@ -147,7 +147,7 @@ export interface CommitmentPlans { resourceGroupName: string, commitmentPlanName: string, commitmentPlan: CommitmentPlan, - options?: CommitmentPlansCreateOrUpdatePlanOptionalParams + options?: CommitmentPlansCreateOrUpdatePlanOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -166,7 +166,7 @@ export interface CommitmentPlans { resourceGroupName: string, commitmentPlanName: string, commitmentPlan: CommitmentPlan, - options?: CommitmentPlansCreateOrUpdatePlanOptionalParams + options?: CommitmentPlansCreateOrUpdatePlanOptionalParams, ): Promise; /** * Create Cognitive Services commitment plan. @@ -180,7 +180,7 @@ export interface CommitmentPlans { resourceGroupName: string, commitmentPlanName: string, commitmentPlan: PatchResourceTagsAndSku, - options?: CommitmentPlansUpdatePlanOptionalParams + options?: CommitmentPlansUpdatePlanOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -199,7 +199,7 @@ export interface CommitmentPlans { resourceGroupName: string, commitmentPlanName: string, commitmentPlan: PatchResourceTagsAndSku, - options?: CommitmentPlansUpdatePlanOptionalParams + options?: CommitmentPlansUpdatePlanOptionalParams, ): Promise; /** * Deletes a Cognitive Services commitment plan from the resource group. @@ -211,7 +211,7 @@ export interface CommitmentPlans { beginDeletePlan( resourceGroupName: string, commitmentPlanName: string, - options?: CommitmentPlansDeletePlanOptionalParams + options?: CommitmentPlansDeletePlanOptionalParams, ): Promise, void>>; /** * Deletes a Cognitive Services commitment plan from the resource group. @@ -223,7 +223,7 @@ export interface CommitmentPlans { beginDeletePlanAndWait( resourceGroupName: string, commitmentPlanName: string, - options?: CommitmentPlansDeletePlanOptionalParams + options?: CommitmentPlansDeletePlanOptionalParams, ): Promise; /** * Returns a Cognitive Services commitment plan specified by the parameters. @@ -235,7 +235,7 @@ export interface CommitmentPlans { getPlan( resourceGroupName: string, commitmentPlanName: string, - options?: CommitmentPlansGetPlanOptionalParams + options?: CommitmentPlansGetPlanOptionalParams, ): Promise; /** * Gets the association of the Cognitive Services commitment plan. @@ -250,7 +250,7 @@ export interface CommitmentPlans { resourceGroupName: string, commitmentPlanName: string, commitmentPlanAssociationName: string, - options?: CommitmentPlansGetAssociationOptionalParams + options?: CommitmentPlansGetAssociationOptionalParams, ): Promise; /** * Create or update the association of the Cognitive Services commitment plan. @@ -267,7 +267,7 @@ export interface CommitmentPlans { commitmentPlanName: string, commitmentPlanAssociationName: string, association: CommitmentPlanAccountAssociation, - options?: CommitmentPlansCreateOrUpdateAssociationOptionalParams + options?: CommitmentPlansCreateOrUpdateAssociationOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -289,7 +289,7 @@ export interface CommitmentPlans { commitmentPlanName: string, commitmentPlanAssociationName: string, association: CommitmentPlanAccountAssociation, - options?: CommitmentPlansCreateOrUpdateAssociationOptionalParams + options?: CommitmentPlansCreateOrUpdateAssociationOptionalParams, ): Promise; /** * Deletes the association of the Cognitive Services commitment plan. @@ -304,7 +304,7 @@ export interface CommitmentPlans { resourceGroupName: string, commitmentPlanName: string, commitmentPlanAssociationName: string, - options?: CommitmentPlansDeleteAssociationOptionalParams + options?: CommitmentPlansDeleteAssociationOptionalParams, ): Promise, void>>; /** * Deletes the association of the Cognitive Services commitment plan. @@ -319,6 +319,6 @@ export interface CommitmentPlans { resourceGroupName: string, commitmentPlanName: string, commitmentPlanAssociationName: string, - options?: CommitmentPlansDeleteAssociationOptionalParams + options?: CommitmentPlansDeleteAssociationOptionalParams, ): Promise; } diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/commitmentTiers.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/commitmentTiers.ts index 4fa258a3ba24..0fd1639b5160 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/commitmentTiers.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/commitmentTiers.ts @@ -19,6 +19,6 @@ export interface CommitmentTiers { */ list( location: string, - options?: CommitmentTiersListOptionalParams + options?: CommitmentTiersListOptionalParams, ): PagedAsyncIterableIterator; } diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/defenderForAISettings.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/defenderForAISettings.ts new file mode 100644 index 000000000000..a6d4ae17e7eb --- /dev/null +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/defenderForAISettings.ts @@ -0,0 +1,78 @@ +/* + * 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 { + DefenderForAISetting, + DefenderForAISettingsListOptionalParams, + DefenderForAISettingsGetOptionalParams, + DefenderForAISettingsGetResponse, + DefenderForAISettingsCreateOrUpdateOptionalParams, + DefenderForAISettingsCreateOrUpdateResponse, + DefenderForAISettingsUpdateOptionalParams, + DefenderForAISettingsUpdateResponse, +} from "../models"; + +/// +/** Interface representing a DefenderForAISettings. */ +export interface DefenderForAISettings { + /** + * Lists the Defender for AI settings. + * @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. + */ + list( + resourceGroupName: string, + accountName: string, + options?: DefenderForAISettingsListOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Gets the specified Defender for AI setting by name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param defenderForAISettingName The name of the defender for AI setting. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + defenderForAISettingName: string, + options?: DefenderForAISettingsGetOptionalParams, + ): Promise; + /** + * Creates or Updates the specified Defender for AI setting. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param defenderForAISettingName The name of the defender for AI setting. + * @param defenderForAISettings Properties describing the Defender for AI setting. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + accountName: string, + defenderForAISettingName: string, + defenderForAISettings: DefenderForAISetting, + options?: DefenderForAISettingsCreateOrUpdateOptionalParams, + ): Promise; + /** + * Updates the specified Defender for AI setting. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param defenderForAISettingName The name of the defender for AI setting. + * @param defenderForAISettings Properties describing the Defender for AI setting. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + accountName: string, + defenderForAISettingName: string, + defenderForAISettings: DefenderForAISetting, + options?: DefenderForAISettingsUpdateOptionalParams, + ): Promise; +} diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/deletedAccounts.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/deletedAccounts.ts index 734a023282a6..95c9ba43af09 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/deletedAccounts.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/deletedAccounts.ts @@ -13,7 +13,7 @@ import { DeletedAccountsListOptionalParams, DeletedAccountsGetOptionalParams, DeletedAccountsGetResponse, - DeletedAccountsPurgeOptionalParams + DeletedAccountsPurgeOptionalParams, } from "../models"; /// @@ -24,7 +24,7 @@ export interface DeletedAccounts { * @param options The options parameters. */ list( - options?: DeletedAccountsListOptionalParams + options?: DeletedAccountsListOptionalParams, ): PagedAsyncIterableIterator; /** * Returns a Cognitive Services account specified by the parameters. @@ -37,7 +37,7 @@ export interface DeletedAccounts { location: string, resourceGroupName: string, accountName: string, - options?: DeletedAccountsGetOptionalParams + options?: DeletedAccountsGetOptionalParams, ): Promise; /** * Deletes a Cognitive Services account from the resource group. @@ -50,7 +50,7 @@ export interface DeletedAccounts { location: string, resourceGroupName: string, accountName: string, - options?: DeletedAccountsPurgeOptionalParams + options?: DeletedAccountsPurgeOptionalParams, ): Promise, void>>; /** * Deletes a Cognitive Services account from the resource group. @@ -63,6 +63,6 @@ export interface DeletedAccounts { location: string, resourceGroupName: string, accountName: string, - options?: DeletedAccountsPurgeOptionalParams + options?: DeletedAccountsPurgeOptionalParams, ): Promise; } diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/deployments.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/deployments.ts index a5aaae0be728..e03d9a5780c3 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/deployments.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/deployments.ts @@ -11,11 +11,16 @@ import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { Deployment, DeploymentsListOptionalParams, + SkuResource, + DeploymentsListSkusOptionalParams, DeploymentsGetOptionalParams, DeploymentsGetResponse, DeploymentsCreateOrUpdateOptionalParams, DeploymentsCreateOrUpdateResponse, - DeploymentsDeleteOptionalParams + PatchResourceTagsAndSku, + DeploymentsUpdateOptionalParams, + DeploymentsUpdateResponse, + DeploymentsDeleteOptionalParams, } from "../models"; /// @@ -30,8 +35,21 @@ export interface Deployments { list( resourceGroupName: string, accountName: string, - options?: DeploymentsListOptionalParams + options?: DeploymentsListOptionalParams, ): PagedAsyncIterableIterator; + /** + * Lists the specified deployments skus associated with the 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 deploymentName The name of the deployment associated with the Cognitive Services Account + * @param options The options parameters. + */ + listSkus( + resourceGroupName: string, + accountName: string, + deploymentName: string, + options?: DeploymentsListSkusOptionalParams, + ): PagedAsyncIterableIterator; /** * Gets the specified deployments associated with the Cognitive Services account. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -43,7 +61,7 @@ export interface Deployments { resourceGroupName: string, accountName: string, deploymentName: string, - options?: DeploymentsGetOptionalParams + options?: DeploymentsGetOptionalParams, ): Promise; /** * Update the state of specified deployments associated with the Cognitive Services account. @@ -58,7 +76,7 @@ export interface Deployments { accountName: string, deploymentName: string, deployment: Deployment, - options?: DeploymentsCreateOrUpdateOptionalParams + options?: DeploymentsCreateOrUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -78,8 +96,43 @@ export interface Deployments { accountName: string, deploymentName: string, deployment: Deployment, - options?: DeploymentsCreateOrUpdateOptionalParams + options?: DeploymentsCreateOrUpdateOptionalParams, ): Promise; + /** + * Update specified deployments associated with the 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 deploymentName The name of the deployment associated with the Cognitive Services Account + * @param deployment The deployment properties. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + accountName: string, + deploymentName: string, + deployment: PatchResourceTagsAndSku, + options?: DeploymentsUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + DeploymentsUpdateResponse + > + >; + /** + * Update specified deployments associated with the 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 deploymentName The name of the deployment associated with the Cognitive Services Account + * @param deployment The deployment properties. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + accountName: string, + deploymentName: string, + deployment: PatchResourceTagsAndSku, + options?: DeploymentsUpdateOptionalParams, + ): Promise; /** * Deletes the specified deployment associated with the Cognitive Services account. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -91,7 +144,7 @@ export interface Deployments { resourceGroupName: string, accountName: string, deploymentName: string, - options?: DeploymentsDeleteOptionalParams + options?: DeploymentsDeleteOptionalParams, ): Promise, void>>; /** * Deletes the specified deployment associated with the Cognitive Services account. @@ -104,6 +157,6 @@ export interface Deployments { resourceGroupName: string, accountName: string, deploymentName: string, - options?: DeploymentsDeleteOptionalParams + options?: DeploymentsDeleteOptionalParams, ): Promise; } diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/encryptionScopes.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/encryptionScopes.ts new file mode 100644 index 000000000000..6eddc917938d --- /dev/null +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/encryptionScopes.ts @@ -0,0 +1,99 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + EncryptionScope, + EncryptionScopesListOptionalParams, + EncryptionScopesGetOptionalParams, + EncryptionScopesGetResponse, + EncryptionScopesCreateOrUpdateOptionalParams, + EncryptionScopesCreateOrUpdateResponse, + EncryptionScopesDeleteOptionalParams, + EncryptionScopesDeleteResponse, +} from "../models"; + +/// +/** Interface representing a EncryptionScopes. */ +export interface EncryptionScopes { + /** + * Gets the content filters associated with the Azure OpenAI 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. + */ + list( + resourceGroupName: string, + accountName: string, + options?: EncryptionScopesListOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Gets the specified EncryptionScope associated with the 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 encryptionScopeName The name of the encryptionScope associated with the Cognitive Services + * Account + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + encryptionScopeName: string, + options?: EncryptionScopesGetOptionalParams, + ): Promise; + /** + * Update the state of specified encryptionScope associated with the 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 encryptionScopeName The name of the encryptionScope associated with the Cognitive Services + * Account + * @param encryptionScope The encryptionScope properties. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + accountName: string, + encryptionScopeName: string, + encryptionScope: EncryptionScope, + options?: EncryptionScopesCreateOrUpdateOptionalParams, + ): Promise; + /** + * Deletes the specified encryptionScope associated with the 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 encryptionScopeName The name of the encryptionScope associated with the Cognitive Services + * Account + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + accountName: string, + encryptionScopeName: string, + options?: EncryptionScopesDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + EncryptionScopesDeleteResponse + > + >; + /** + * Deletes the specified encryptionScope associated with the 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 encryptionScopeName The name of the encryptionScope associated with the Cognitive Services + * Account + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + encryptionScopeName: string, + options?: EncryptionScopesDeleteOptionalParams, + ): Promise; +} diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/index.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/index.ts index c3aa6d8c5dcd..17996d460adc 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/index.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/index.ts @@ -13,7 +13,16 @@ export * from "./usages"; export * from "./operations"; export * from "./commitmentTiers"; export * from "./models"; +export * from "./locationBasedModelCapacities"; +export * from "./modelCapacities"; export * from "./privateEndpointConnections"; export * from "./privateLinkResources"; export * from "./deployments"; export * from "./commitmentPlans"; +export * from "./encryptionScopes"; +export * from "./raiPolicies"; +export * from "./raiBlocklists"; +export * from "./raiBlocklistItems"; +export * from "./raiContentFilters"; +export * from "./networkSecurityPerimeterConfigurations"; +export * from "./defenderForAISettings"; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/locationBasedModelCapacities.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/locationBasedModelCapacities.ts new file mode 100644 index 000000000000..36725cb7a543 --- /dev/null +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/locationBasedModelCapacities.ts @@ -0,0 +1,33 @@ +/* + * 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 { + ModelCapacityListResultValueItem, + LocationBasedModelCapacitiesListOptionalParams, +} from "../models"; + +/// +/** Interface representing a LocationBasedModelCapacities. */ +export interface LocationBasedModelCapacities { + /** + * List Location Based ModelCapacities. + * @param location Resource location. + * @param modelFormat The format of the Model + * @param modelName The name of the Model + * @param modelVersion The version of the Model + * @param options The options parameters. + */ + list( + location: string, + modelFormat: string, + modelName: string, + modelVersion: string, + options?: LocationBasedModelCapacitiesListOptionalParams, + ): PagedAsyncIterableIterator; +} diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/modelCapacities.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/modelCapacities.ts new file mode 100644 index 000000000000..083b55723c71 --- /dev/null +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/modelCapacities.ts @@ -0,0 +1,31 @@ +/* + * 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 { + ModelCapacityListResultValueItem, + ModelCapacitiesListOptionalParams, +} from "../models"; + +/// +/** Interface representing a ModelCapacities. */ +export interface ModelCapacities { + /** + * List ModelCapacities. + * @param modelFormat The format of the Model + * @param modelName The name of the Model + * @param modelVersion The version of the Model + * @param options The options parameters. + */ + list( + modelFormat: string, + modelName: string, + modelVersion: string, + options?: ModelCapacitiesListOptionalParams, + ): PagedAsyncIterableIterator; +} diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/models.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/models.ts index 8d877f373b01..e068d3e9b962 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/models.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/models.ts @@ -19,6 +19,6 @@ export interface Models { */ list( location: string, - options?: ModelsListOptionalParams + options?: ModelsListOptionalParams, ): PagedAsyncIterableIterator; } diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/networkSecurityPerimeterConfigurations.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/networkSecurityPerimeterConfigurations.ts new file mode 100644 index 000000000000..13d2aee27add --- /dev/null +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/networkSecurityPerimeterConfigurations.ts @@ -0,0 +1,78 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + NetworkSecurityPerimeterConfiguration, + NetworkSecurityPerimeterConfigurationsListOptionalParams, + NetworkSecurityPerimeterConfigurationsGetOptionalParams, + NetworkSecurityPerimeterConfigurationsGetResponse, + NetworkSecurityPerimeterConfigurationsReconcileOptionalParams, + NetworkSecurityPerimeterConfigurationsReconcileResponse, +} from "../models"; + +/// +/** Interface representing a NetworkSecurityPerimeterConfigurations. */ +export interface NetworkSecurityPerimeterConfigurations { + /** + * Gets a list of NSP configurations for an 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. + */ + list( + resourceGroupName: string, + accountName: string, + options?: NetworkSecurityPerimeterConfigurationsListOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Gets the specified NSP configurations for an account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param nspConfigurationName The name of the NSP Configuration. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + nspConfigurationName: string, + options?: NetworkSecurityPerimeterConfigurationsGetOptionalParams, + ): Promise; + /** + * Reconcile the NSP configuration for an account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param nspConfigurationName The name of the NSP Configuration. + * @param options The options parameters. + */ + beginReconcile( + resourceGroupName: string, + accountName: string, + nspConfigurationName: string, + options?: NetworkSecurityPerimeterConfigurationsReconcileOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + NetworkSecurityPerimeterConfigurationsReconcileResponse + > + >; + /** + * Reconcile the NSP configuration for an account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param nspConfigurationName The name of the NSP Configuration. + * @param options The options parameters. + */ + beginReconcileAndWait( + resourceGroupName: string, + accountName: string, + nspConfigurationName: string, + options?: NetworkSecurityPerimeterConfigurationsReconcileOptionalParams, + ): Promise; +} diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/operations.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/operations.ts index 69234864c1e9..7e6f6f4ab337 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/operations.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/operations.ts @@ -17,6 +17,6 @@ export interface Operations { * @param options The options parameters. */ list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): PagedAsyncIterableIterator; } diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/privateEndpointConnections.ts index ea78dacbcad7..812ef256f956 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/privateEndpointConnections.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/privateEndpointConnections.ts @@ -15,7 +15,7 @@ import { PrivateEndpointConnection, PrivateEndpointConnectionsCreateOrUpdateOptionalParams, PrivateEndpointConnectionsCreateOrUpdateResponse, - PrivateEndpointConnectionsDeleteOptionalParams + PrivateEndpointConnectionsDeleteOptionalParams, } from "../models"; /** Interface representing a PrivateEndpointConnections. */ @@ -29,7 +29,7 @@ export interface PrivateEndpointConnections { list( resourceGroupName: string, accountName: string, - options?: PrivateEndpointConnectionsListOptionalParams + options?: PrivateEndpointConnectionsListOptionalParams, ): Promise; /** * Gets the specified private endpoint connection associated with the Cognitive Services account. @@ -43,7 +43,7 @@ export interface PrivateEndpointConnections { resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsGetOptionalParams + options?: PrivateEndpointConnectionsGetOptionalParams, ): Promise; /** * Update the state of specified private endpoint connection associated with the Cognitive Services @@ -60,7 +60,7 @@ export interface PrivateEndpointConnections { accountName: string, privateEndpointConnectionName: string, properties: PrivateEndpointConnection, - options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams + options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -82,7 +82,7 @@ export interface PrivateEndpointConnections { accountName: string, privateEndpointConnectionName: string, properties: PrivateEndpointConnection, - options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams + options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams, ): Promise; /** * Deletes the specified private endpoint connection associated with the Cognitive Services account. @@ -96,7 +96,7 @@ export interface PrivateEndpointConnections { resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsDeleteOptionalParams + options?: PrivateEndpointConnectionsDeleteOptionalParams, ): Promise, void>>; /** * Deletes the specified private endpoint connection associated with the Cognitive Services account. @@ -110,6 +110,6 @@ export interface PrivateEndpointConnections { resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsDeleteOptionalParams + options?: PrivateEndpointConnectionsDeleteOptionalParams, ): Promise; } diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/privateLinkResources.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/privateLinkResources.ts index b43ba11d0b5d..8f2562c64719 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/privateLinkResources.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/privateLinkResources.ts @@ -8,7 +8,7 @@ import { PrivateLinkResourcesListOptionalParams, - PrivateLinkResourcesListResponse + PrivateLinkResourcesListResponse, } from "../models"; /** Interface representing a PrivateLinkResources. */ @@ -22,6 +22,6 @@ export interface PrivateLinkResources { list( resourceGroupName: string, accountName: string, - options?: PrivateLinkResourcesListOptionalParams + options?: PrivateLinkResourcesListOptionalParams, ): Promise; } diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/raiBlocklistItems.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/raiBlocklistItems.ts new file mode 100644 index 000000000000..e576cb006ec2 --- /dev/null +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/raiBlocklistItems.ts @@ -0,0 +1,139 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + RaiBlocklistItem, + RaiBlocklistItemsListOptionalParams, + RaiBlocklistItemsGetOptionalParams, + RaiBlocklistItemsGetResponse, + RaiBlocklistItemsCreateOrUpdateOptionalParams, + RaiBlocklistItemsCreateOrUpdateResponse, + RaiBlocklistItemsDeleteOptionalParams, + RaiBlocklistItemsDeleteResponse, + RaiBlocklistItemBulkRequest, + RaiBlocklistItemsBatchAddOptionalParams, + RaiBlocklistItemsBatchAddResponse, + RaiBlocklistItemsBatchDeleteOptionalParams, +} from "../models"; + +/// +/** Interface representing a RaiBlocklistItems. */ +export interface RaiBlocklistItems { + /** + * Gets the blocklist items associated with the custom blocklist. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account + * @param options The options parameters. + */ + list( + resourceGroupName: string, + accountName: string, + raiBlocklistName: string, + options?: RaiBlocklistItemsListOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Gets the specified custom blocklist Item associated with the custom blocklist. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account + * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + raiBlocklistName: string, + raiBlocklistItemName: string, + options?: RaiBlocklistItemsGetOptionalParams, + ): Promise; + /** + * Update the state of specified blocklist item associated with the Azure OpenAI account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account + * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist + * @param raiBlocklistItem Properties describing the custom blocklist. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + accountName: string, + raiBlocklistName: string, + raiBlocklistItemName: string, + raiBlocklistItem: RaiBlocklistItem, + options?: RaiBlocklistItemsCreateOrUpdateOptionalParams, + ): Promise; + /** + * Deletes the specified blocklist Item associated with the custom blocklist. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account + * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + accountName: string, + raiBlocklistName: string, + raiBlocklistItemName: string, + options?: RaiBlocklistItemsDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + RaiBlocklistItemsDeleteResponse + > + >; + /** + * Deletes the specified blocklist Item associated with the custom blocklist. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account + * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + raiBlocklistName: string, + raiBlocklistItemName: string, + options?: RaiBlocklistItemsDeleteOptionalParams, + ): Promise; + /** + * Batch operation to add blocklist items. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account + * @param raiBlocklistItems Properties describing the custom blocklist items. + * @param options The options parameters. + */ + batchAdd( + resourceGroupName: string, + accountName: string, + raiBlocklistName: string, + raiBlocklistItems: RaiBlocklistItemBulkRequest[], + options?: RaiBlocklistItemsBatchAddOptionalParams, + ): Promise; + /** + * Batch operation to delete blocklist items. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account + * @param raiBlocklistItemsNames List of RAI Blocklist Items Names. + * @param options The options parameters. + */ + batchDelete( + resourceGroupName: string, + accountName: string, + raiBlocklistName: string, + raiBlocklistItemsNames: Record, + options?: RaiBlocklistItemsBatchDeleteOptionalParams, + ): Promise; +} diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/raiBlocklists.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/raiBlocklists.ts new file mode 100644 index 000000000000..987f447f5b62 --- /dev/null +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/raiBlocklists.ts @@ -0,0 +1,95 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + RaiBlocklist, + RaiBlocklistsListOptionalParams, + RaiBlocklistsGetOptionalParams, + RaiBlocklistsGetResponse, + RaiBlocklistsCreateOrUpdateOptionalParams, + RaiBlocklistsCreateOrUpdateResponse, + RaiBlocklistsDeleteOptionalParams, + RaiBlocklistsDeleteResponse, +} from "../models"; + +/// +/** Interface representing a RaiBlocklists. */ +export interface RaiBlocklists { + /** + * Gets the custom blocklists associated with the Azure OpenAI 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. + */ + list( + resourceGroupName: string, + accountName: string, + options?: RaiBlocklistsListOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Gets the specified custom blocklist associated with the Azure OpenAI account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + raiBlocklistName: string, + options?: RaiBlocklistsGetOptionalParams, + ): Promise; + /** + * Update the state of specified blocklist associated with the Azure OpenAI account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account + * @param raiBlocklist Properties describing the custom blocklist. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + accountName: string, + raiBlocklistName: string, + raiBlocklist: RaiBlocklist, + options?: RaiBlocklistsCreateOrUpdateOptionalParams, + ): Promise; + /** + * Deletes the specified custom blocklist associated with the Azure OpenAI account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + accountName: string, + raiBlocklistName: string, + options?: RaiBlocklistsDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + RaiBlocklistsDeleteResponse + > + >; + /** + * Deletes the specified custom blocklist associated with the Azure OpenAI account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + raiBlocklistName: string, + options?: RaiBlocklistsDeleteOptionalParams, + ): Promise; +} diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/raiContentFilters.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/raiContentFilters.ts new file mode 100644 index 000000000000..3ef03551662a --- /dev/null +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/raiContentFilters.ts @@ -0,0 +1,40 @@ +/* + * 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 { + RaiContentFilter, + RaiContentFiltersListOptionalParams, + RaiContentFiltersGetOptionalParams, + RaiContentFiltersGetResponse, +} from "../models"; + +/// +/** Interface representing a RaiContentFilters. */ +export interface RaiContentFilters { + /** + * List Content Filters types. + * @param location Resource location. + * @param options The options parameters. + */ + list( + location: string, + options?: RaiContentFiltersListOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Get Content Filters by Name. + * @param location Resource location. + * @param filterName The name of the RAI Content Filter. + * @param options The options parameters. + */ + get( + location: string, + filterName: string, + options?: RaiContentFiltersGetOptionalParams, + ): Promise; +} diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/raiPolicies.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/raiPolicies.ts new file mode 100644 index 000000000000..436a4e9c3a1d --- /dev/null +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/raiPolicies.ts @@ -0,0 +1,95 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + RaiPolicy, + RaiPoliciesListOptionalParams, + RaiPoliciesGetOptionalParams, + RaiPoliciesGetResponse, + RaiPoliciesCreateOrUpdateOptionalParams, + RaiPoliciesCreateOrUpdateResponse, + RaiPoliciesDeleteOptionalParams, + RaiPoliciesDeleteResponse, +} from "../models"; + +/// +/** Interface representing a RaiPolicies. */ +export interface RaiPolicies { + /** + * Gets the content filters associated with the Azure OpenAI 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. + */ + list( + resourceGroupName: string, + accountName: string, + options?: RaiPoliciesListOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Gets the specified Content Filters associated with the Azure OpenAI account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + raiPolicyName: string, + options?: RaiPoliciesGetOptionalParams, + ): Promise; + /** + * Update the state of specified Content Filters associated with the Azure OpenAI account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account + * @param raiPolicy Properties describing the Content Filters. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + accountName: string, + raiPolicyName: string, + raiPolicy: RaiPolicy, + options?: RaiPoliciesCreateOrUpdateOptionalParams, + ): Promise; + /** + * Deletes the specified Content Filters associated with the Azure OpenAI account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + accountName: string, + raiPolicyName: string, + options?: RaiPoliciesDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + RaiPoliciesDeleteResponse + > + >; + /** + * Deletes the specified Content Filters associated with the Azure OpenAI account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + raiPolicyName: string, + options?: RaiPoliciesDeleteOptionalParams, + ): Promise; +} diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/resourceSkus.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/resourceSkus.ts index e15d4756086b..97e00392fce2 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/resourceSkus.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/resourceSkus.ts @@ -17,6 +17,6 @@ export interface ResourceSkus { * @param options The options parameters. */ list( - options?: ResourceSkusListOptionalParams + options?: ResourceSkusListOptionalParams, ): PagedAsyncIterableIterator; } diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/usages.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/usages.ts index f6c9919671a5..149a992347fc 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/usages.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operationsInterfaces/usages.ts @@ -19,6 +19,6 @@ export interface Usages { */ list( location: string, - options?: UsagesListOptionalParams + options?: UsagesListOptionalParams, ): PagedAsyncIterableIterator; } diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/pagingHelper.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/pagingHelper.ts index 269a2b9814b5..205cccc26592 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/pagingHelper.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/pagingHelper.ts @@ -28,7 +28,7 @@ export function getContinuationToken(page: unknown): string | undefined { export function setContinuationToken( page: unknown, - continuationToken: string | undefined + continuationToken: string | undefined, ): void { if (typeof page !== "object" || page === null || !continuationToken) { return; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/test/sampleTest.ts b/sdk/cognitiveservices/arm-cognitiveservices/test/sampleTest.ts new file mode 100644 index 000000000000..d64be981b694 --- /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..b35d05ad6e9d 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" + "src/**/*.ts", + "test/**/*.ts" ], "exclude": [ "node_modules"