From 568edefb33e4ee55a9ffdd344a550dc9debef3b3 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 21 Apr 2022 08:25:17 +0000 Subject: [PATCH] CodeGen from PR 18616 in Azure/azure-rest-api-specs Merge 2b74399bdea5b55abdaac69dbc203b35481ed753 into c59f463024f4baa30d4e7a77a710a6f283bb900d --- common/config/rush/pnpm-lock.yaml | 29 + rush.json | 9 +- sdk/adp/arm-adp/CHANGELOG.md | 11 + sdk/adp/arm-adp/LICENSE | 21 + sdk/adp/arm-adp/README.md | 36 + sdk/adp/arm-adp/_meta.json | 8 + sdk/adp/arm-adp/api-extractor.json | 31 + sdk/adp/arm-adp/package.json | 102 +++ sdk/adp/arm-adp/review/adp.api.md | 466 ++++++++++ sdk/adp/arm-adp/rollup.config.js | 188 ++++ sdk/adp/arm-adp/src/adpManagementClient.ts | 79 ++ sdk/adp/arm-adp/src/index.ts | 12 + sdk/adp/arm-adp/src/lroImpl.ts | 34 + sdk/adp/arm-adp/src/models/index.ts | 606 +++++++++++++ sdk/adp/arm-adp/src/models/mappers.ts | 833 ++++++++++++++++++ sdk/adp/arm-adp/src/models/parameters.ts | 164 ++++ sdk/adp/arm-adp/src/operations/accounts.ts | 698 +++++++++++++++ sdk/adp/arm-adp/src/operations/dataPools.ts | 586 ++++++++++++ sdk/adp/arm-adp/src/operations/index.ts | 11 + sdk/adp/arm-adp/src/operations/operations.ts | 137 +++ .../src/operationsInterfaces/accounts.ts | 142 +++ .../src/operationsInterfaces/dataPools.ts | 138 +++ .../arm-adp/src/operationsInterfaces/index.ts | 11 + .../src/operationsInterfaces/operations.ts | 22 + sdk/adp/arm-adp/test/sampleTest.ts | 48 + sdk/adp/arm-adp/tsconfig.json | 27 + sdk/adp/ci.mgmt.yml | 38 + 27 files changed, 4485 insertions(+), 2 deletions(-) create mode 100644 sdk/adp/arm-adp/CHANGELOG.md create mode 100644 sdk/adp/arm-adp/LICENSE create mode 100644 sdk/adp/arm-adp/README.md create mode 100644 sdk/adp/arm-adp/_meta.json create mode 100644 sdk/adp/arm-adp/api-extractor.json create mode 100644 sdk/adp/arm-adp/package.json create mode 100644 sdk/adp/arm-adp/review/adp.api.md create mode 100644 sdk/adp/arm-adp/rollup.config.js create mode 100644 sdk/adp/arm-adp/src/adpManagementClient.ts create mode 100644 sdk/adp/arm-adp/src/index.ts create mode 100644 sdk/adp/arm-adp/src/lroImpl.ts create mode 100644 sdk/adp/arm-adp/src/models/index.ts create mode 100644 sdk/adp/arm-adp/src/models/mappers.ts create mode 100644 sdk/adp/arm-adp/src/models/parameters.ts create mode 100644 sdk/adp/arm-adp/src/operations/accounts.ts create mode 100644 sdk/adp/arm-adp/src/operations/dataPools.ts create mode 100644 sdk/adp/arm-adp/src/operations/index.ts create mode 100644 sdk/adp/arm-adp/src/operations/operations.ts create mode 100644 sdk/adp/arm-adp/src/operationsInterfaces/accounts.ts create mode 100644 sdk/adp/arm-adp/src/operationsInterfaces/dataPools.ts create mode 100644 sdk/adp/arm-adp/src/operationsInterfaces/index.ts create mode 100644 sdk/adp/arm-adp/src/operationsInterfaces/operations.ts create mode 100644 sdk/adp/arm-adp/test/sampleTest.ts create mode 100644 sdk/adp/arm-adp/tsconfig.json create mode 100644 sdk/adp/ci.mgmt.yml diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index f0a9d4c49d6d..bbcd64e98b45 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -2,6 +2,7 @@ lockfileVersion: 5.3 specifiers: '@rush-temp/abort-controller': file:./projects/abort-controller.tgz + '@rush-temp/adp': file:./projects/adp.tgz '@rush-temp/agrifood-farming': file:./projects/agrifood-farming.tgz '@rush-temp/ai-anomaly-detector': file:./projects/ai-anomaly-detector.tgz '@rush-temp/ai-document-translator': file:./projects/ai-document-translator.tgz @@ -277,6 +278,7 @@ specifiers: dependencies: '@rush-temp/abort-controller': file:projects/abort-controller.tgz + '@rush-temp/adp': file:projects/adp.tgz '@rush-temp/agrifood-farming': file:projects/agrifood-farming.tgz '@rush-temp/ai-anomaly-detector': file:projects/ai-anomaly-detector.tgz '@rush-temp/ai-document-translator': file:projects/ai-document-translator.tgz @@ -8921,6 +8923,33 @@ packages: - utf-8-validate dev: false + file:projects/adp.tgz: + resolution: {integrity: sha512-RL5BVEC9ITul0eRH2prgzs7FSgbHwyX9pti3QtJHbrZjh2F5G3+IhrguIUSgGTPTXWux+NoCOw/bETtdNc4MLg==, tarball: file:projects/adp.tgz} + name: '@rush-temp/adp' + version: 0.0.0 + dependencies: + '@azure-tools/test-recorder': 1.0.2 + '@azure/identity': 2.0.4 + '@microsoft/api-extractor': 7.22.1 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 + cross-env: 7.0.3 + mkdirp: 1.0.4 + mocha: 7.2.0 + rimraf: 3.0.2 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + tslib: 2.3.1 + typescript: 4.2.4 + uglify-js: 3.15.4 + transitivePeerDependencies: + - debug + - encoding + - supports-color + dev: false + file:projects/agrifood-farming.tgz: resolution: {integrity: sha512-P04F5faQfCOBF1l6BIJKyj+LlbNHcRLPIcSU7YIFQazYLYttCAl1HiEY2UxlY2I+2+9UTtWdPR3eHlC6bhSS9g==, tarball: file:projects/agrifood-farming.tgz} name: '@rush-temp/agrifood-farming' diff --git a/rush.json b/rush.json index bd411d069611..55046b7cf66a 100644 --- a/rush.json +++ b/rush.json @@ -1,7 +1,7 @@ /** * This is the main configuration file for Rush. * For full documentation, please see https://rushjs.io - */ { + */{ "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json", /** * (Required) This specifies the version of the Rush engine to be used in this repo. @@ -1685,6 +1685,11 @@ "packageName": "@azure/arm-azureadexternalidentities", "projectFolder": "sdk/azureadexternalidentities/arm-azureadexternalidentities", "versionPolicyName": "management" + }, + { + "packageName": "adp", + "projectFolder": "sdk/adp/arm-adp", + "versionPolicyName": "management" } ] -} +} \ No newline at end of file diff --git a/sdk/adp/arm-adp/CHANGELOG.md b/sdk/adp/arm-adp/CHANGELOG.md new file mode 100644 index 000000000000..cd60c8ea41e4 --- /dev/null +++ b/sdk/adp/arm-adp/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 1.0.0-beta.1 (2022-04-21) + +The package of adp is using our next generation design principles since version 1.0.0-beta.1, which contains breaking changes. + +To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). + +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/js-track2-quickstart). diff --git a/sdk/adp/arm-adp/LICENSE b/sdk/adp/arm-adp/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/adp/arm-adp/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2022 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/adp/arm-adp/README.md b/sdk/adp/arm-adp/README.md new file mode 100644 index 000000000000..12dd3a56505a --- /dev/null +++ b/sdk/adp/arm-adp/README.md @@ -0,0 +1,36 @@ +# AdpManagement client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for AdpManagement client. + +Microsoft Autonomous Development Platform + +[Package (NPM)](https://www.npmjs.com/package/adp) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started + +### Currently supported environments + +- [LTS versions of Node.js](https://nodejs.org/about/releases/) +- Latest versions of Safari, Chrome, Edge and Firefox. + + +### Install the `adp` package + +Install the AdpManagement client library for JavaScript with `npm`: + +```bash +npm install adp +``` + + + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### AdpManagementClient + +`AdpManagementClient` is the primary interface for developers using the AdpManagement client library. Explore the methods on this client object to understand the different features of the AdpManagement service that you can access. + diff --git a/sdk/adp/arm-adp/_meta.json b/sdk/adp/arm-adp/_meta.json new file mode 100644 index 000000000000..0681aa5c98e6 --- /dev/null +++ b/sdk/adp/arm-adp/_meta.json @@ -0,0 +1,8 @@ +{ + "commit": "27f7ef754e238e83d900a27f5b02525ac5ef8358", + "readme": "specification/adp/resource-manager/readme.md", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/adp/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220105.1", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.3.0", + "use": "@autorest/typescript@6.0.0-alpha.16.20220105.1" +} \ No newline at end of file diff --git a/sdk/adp/arm-adp/api-extractor.json b/sdk/adp/arm-adp/api-extractor.json new file mode 100644 index 000000000000..ce9a845f7701 --- /dev/null +++ b/sdk/adp/arm-adp/api-extractor.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/adp.d.ts" + }, + "messages": { + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, + "extractorMessageReporting": { + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } + } + } +} \ No newline at end of file diff --git a/sdk/adp/arm-adp/package.json b/sdk/adp/arm-adp/package.json new file mode 100644 index 000000000000..2aa57f8036e7 --- /dev/null +++ b/sdk/adp/arm-adp/package.json @@ -0,0 +1,102 @@ +{ + "name": "adp", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", + "description": "A generated SDK for AdpManagementClient.", + "version": "1.0.0-beta.1", + "engines": { + "node": ">=12.0.0" + }, + "dependencies": { + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/adp.d.ts", + "devDependencies": { + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "mkdirp": "^1.0.4", + "rollup": "^1.16.3", + "rollup-plugin-sourcemaps": "^0.4.2", + "typescript": "~4.2.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^1.0.0", + "mocha": "^7.1.1", + "cross-env": "^7.0.2" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/adp/arm-adp", + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "files": [ + "dist/**/*.js", + "dist/**/*.js.map", + "dist/**/*.d.ts", + "dist/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", + "src/**/*.ts", + "README.md", + "LICENSE", + "rollup.config.js", + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" + ], + "scripts": { + "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", + "minify": "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": "api-extractor run --local", + "lint": "echo skipped", + "audit": "echo skipped", + "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "npm run integration-test", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:node": "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": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:browser": "echo skipped", + "docs": "echo skipped" + }, + "sideEffects": false, + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/adp/arm-adp/review/adp.api.md b/sdk/adp/arm-adp/review/adp.api.md new file mode 100644 index 000000000000..f13093647c48 --- /dev/null +++ b/sdk/adp/arm-adp/review/adp.api.md @@ -0,0 +1,466 @@ +## API Report File for "adp" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; + +// @public +export type Account = TrackedResource & { + readonly systemData?: SystemData; + readonly accountId?: string; + readonly provisioningState?: ProvisioningState; +}; + +// @public +export interface AccountCheckNameAvailabilityParameters { + name: string; + type: Type; +} + +// @public +export interface AccountList { + nextLink?: string; + readonly value?: Account[]; +} + +// @public +export interface AccountPatch { + readonly accountId?: string; + readonly provisioningState?: ProvisioningState; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface Accounts { + beginCreateOrUpdate(resourceGroupName: string, accountName: string, options?: AccountsCreateOrUpdateOptionalParams): Promise, AccountsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, accountName: string, options?: AccountsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, accountName: string, options?: AccountsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, accountName: string, options?: AccountsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, accountName: string, options?: AccountsUpdateOptionalParams): Promise, AccountsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, accountName: string, options?: AccountsUpdateOptionalParams): Promise; + checkNameAvailability(parameters: AccountCheckNameAvailabilityParameters, options?: AccountsCheckNameAvailabilityOptionalParams): Promise; + get(resourceGroupName: string, accountName: string, options?: AccountsGetOptionalParams): Promise; + list(options?: AccountsListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: AccountsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface AccountsCheckNameAvailabilityOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccountsCheckNameAvailabilityResponse = CheckNameAvailabilityResult; + +// @public +export interface AccountsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + parameters?: Account; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type AccountsCreateOrUpdateResponse = Account; + +// @public +export interface AccountsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface AccountsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccountsGetResponse = Account; + +// @public +export interface AccountsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccountsListByResourceGroupNextResponse = AccountList; + +// @public +export interface AccountsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccountsListByResourceGroupResponse = AccountList; + +// @public +export interface AccountsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccountsListNextResponse = AccountList; + +// @public +export interface AccountsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccountsListResponse = AccountList; + +// @public +export interface AccountsUpdateOptionalParams extends coreClient.OperationOptions { + parameters?: AccountPatch; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type AccountsUpdateResponse = Account; + +// @public (undocumented) +export class AdpManagementClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: AdpManagementClientOptionalParams); + // (undocumented) + accounts: Accounts; + // (undocumented) + apiVersion: string; + // (undocumented) + dataPools: DataPools; + // (undocumented) + operations: Operations; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface AdpManagementClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export type CheckNameAvailabilityReason = string; + +// @public +export interface CheckNameAvailabilityResult { + readonly message?: string; + readonly nameAvailable?: boolean; + readonly reason?: CheckNameAvailabilityReason; +} + +// @public +export type CreatedByType = string; + +// @public +export type DataPool = Resource & { + readonly systemData?: SystemData; + readonly dataPoolId?: string; + readonly provisioningState?: ProvisioningState; + locations?: DataPoolLocation[]; + tags?: { + [propertyName: string]: string; + }; +}; + +// @public +export interface DataPoolBaseProperties { + readonly dataPoolId?: string; + locations?: DataPoolLocation[]; + readonly provisioningState?: ProvisioningState; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface DataPoolEncryption { + keyName: string; + keyVaultUri: string; + keyVersion?: string; + userAssignedIdentity: string; +} + +// @public +export interface DataPoolList { + nextLink?: string; + readonly value?: DataPool[]; +} + +// @public +export interface DataPoolLocation { + encryption?: DataPoolEncryption; + name: string; + storageAccountCount?: number; + storageSku?: StorageSku; +} + +// @public +export type DataPoolPatch = Resource & { + readonly systemData?: SystemData; + readonly dataPoolId?: string; + readonly provisioningState?: ProvisioningState; + locations?: DataPoolLocation[]; + tags?: { + [propertyName: string]: string; + }; +}; + +// @public +export type DataPoolProperties = DataPoolBaseProperties & {}; + +// @public +export interface DataPools { + beginCreateOrUpdate(resourceGroupName: string, accountName: string, dataPoolName: string, options?: DataPoolsCreateOrUpdateOptionalParams): Promise, DataPoolsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, accountName: string, dataPoolName: string, options?: DataPoolsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, accountName: string, dataPoolName: string, options?: DataPoolsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, accountName: string, dataPoolName: string, options?: DataPoolsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, accountName: string, dataPoolName: string, options?: DataPoolsUpdateOptionalParams): Promise, DataPoolsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, accountName: string, dataPoolName: string, options?: DataPoolsUpdateOptionalParams): Promise; + get(resourceGroupName: string, accountName: string, dataPoolName: string, options?: DataPoolsGetOptionalParams): Promise; + list(resourceGroupName: string, accountName: string, options?: DataPoolsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface DataPoolsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + parameters?: DataPool; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DataPoolsCreateOrUpdateResponse = DataPool; + +// @public +export interface DataPoolsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DataPoolsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataPoolsGetResponse = DataPool; + +// @public +export interface DataPoolsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataPoolsListNextResponse = DataPoolList; + +// @public +export interface DataPoolsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataPoolsListResponse = DataPoolList; + +// @public +export interface DataPoolsUpdateOptionalParams extends coreClient.OperationOptions { + parameters?: DataPoolPatch; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DataPoolsUpdateResponse = DataPool; + +// @public +export interface ErrorDefinition { + readonly code?: string; + readonly details?: ErrorDefinition[]; + readonly message?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDefinition; +} + +// @public +export enum KnownCheckNameAvailabilityReason { + // (undocumented) + AlreadyExists = "AlreadyExists", + // (undocumented) + Invalid = "Invalid" +} + +// @public +export enum KnownCreatedByType { + // (undocumented) + Application = "Application", + // (undocumented) + Key = "Key", + // (undocumented) + ManagedIdentity = "ManagedIdentity", + // (undocumented) + User = "User" +} + +// @public +export enum KnownProvisioningState { + // (undocumented) + Accepted = "Accepted", + // (undocumented) + Canceled = "Canceled", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Failed = "Failed", + // (undocumented) + Provisioning = "Provisioning", + // (undocumented) + Succeeded = "Succeeded" +} + +// @public +export enum KnownStorageSkuName { + // (undocumented) + PremiumLRS = "Premium_LRS", + // (undocumented) + PremiumZRS = "Premium_ZRS", + // (undocumented) + StandardGRS = "Standard_GRS", + // (undocumented) + StandardGzrs = "Standard_Gzrs", + // (undocumented) + StandardLRS = "Standard_LRS", + // (undocumented) + StandardRagrs = "Standard_Ragrs", + // (undocumented) + StandardRagzrs = "Standard_Ragzrs", + // (undocumented) + StandardZRS = "Standard_ZRS" +} + +// @public +export enum KnownType { + // (undocumented) + MicrosoftAutonomousDevelopmentPlatformAccounts = "Microsoft.AutonomousDevelopmentPlatform/accounts" +} + +// @public +export interface Operation { + actionType?: string; + display?: OperationDisplay; + isDataAction?: boolean; + name?: string; + origin?: string; + serviceSpecification?: OperationServiceSpecification; +} + +// @public +export interface OperationDisplay { + description?: string; + operation?: string; + provider?: string; + resource?: string; +} + +// @public +export interface OperationListResult { + nextLink?: string; + value?: Operation[]; +} + +// @public +export interface OperationLogSpecification { + blobDuration?: string; + displayName?: string; + name?: string; +} + +// @public +export interface OperationMetricAvailability { + blobDuration?: string; + timeGrain?: string; +} + +// @public +export interface OperationMetricSpecification { + aggregationType?: string; + availabilities?: OperationMetricAvailability[]; + displayDescription?: string; + displayName?: string; + enableRegionalMdmAccount?: string; + name?: string; + sourceMdmAccount?: string; + sourceMdmNamespace?: string; + unit?: string; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationServiceSpecification { + logSpecifications?: OperationLogSpecification[]; + metricSpecifications?: OperationMetricSpecification[]; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationListResult; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public +export type ProvisioningState = string; + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export interface StorageSku { + name: StorageSkuName; +} + +// @public +export type StorageSkuName = string; + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export type TrackedResource = Resource & { + tags?: { + [propertyName: string]: string; + }; + location: string; +}; + +// @public +export type Type = string; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/adp/arm-adp/rollup.config.js b/sdk/adp/arm-adp/rollup.config.js new file mode 100644 index 000000000000..9be1955eb7f1 --- /dev/null +++ b/sdk/adp/arm-adp/rollup.config.js @@ -0,0 +1,188 @@ +/* + * 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 nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + +// #region Warning Handler + +/** + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +function ignoreNiseSinonEvalWarnings(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependencyWarnings(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] + }, + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false +}; + +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve(), cjs()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/adp/arm-adp/src/adpManagementClient.ts b/sdk/adp/arm-adp/src/adpManagementClient.ts new file mode 100644 index 000000000000..8f0810f14743 --- /dev/null +++ b/sdk/adp/arm-adp/src/adpManagementClient.ts @@ -0,0 +1,79 @@ +/* + * 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 * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { OperationsImpl, AccountsImpl, DataPoolsImpl } from "./operations"; +import { Operations, Accounts, DataPools } from "./operationsInterfaces"; +import { AdpManagementClientOptionalParams } from "./models"; + +export class AdpManagementClient extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + + /** + * Initializes a new instance of the AdpManagementClient class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The ID of the target subscription. + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: AdpManagementClientOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: AdpManagementClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-adp/1.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2021-11-01-preview"; + this.operations = new OperationsImpl(this); + this.accounts = new AccountsImpl(this); + this.dataPools = new DataPoolsImpl(this); + } + + operations: Operations; + accounts: Accounts; + dataPools: DataPools; +} diff --git a/sdk/adp/arm-adp/src/index.ts b/sdk/adp/arm-adp/src/index.ts new file mode 100644 index 000000000000..0fbc5aaf40a9 --- /dev/null +++ b/sdk/adp/arm-adp/src/index.ts @@ -0,0 +1,12 @@ +/* + * 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. + */ + +/// +export * from "./models"; +export { AdpManagementClient } from "./adpManagementClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/adp/arm-adp/src/lroImpl.ts b/sdk/adp/arm-adp/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/adp/arm-adp/src/lroImpl.ts @@ -0,0 +1,34 @@ +/* + * 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 { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export class LroImpl implements LongRunningOperation { + constructor( + private sendOperationFn: (args: any, spec: any) => Promise>, + private args: Record, + private spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record, + public requestPath: string = spec.path!, + public requestMethod: string = spec.httpMethod + ) {} + public async sendInitialRequest(): Promise> { + return this.sendOperationFn(this.args, this.spec); + } + public async sendPollRequest(path: string): Promise> { + const { requestBody, ...restSpec } = this.spec; + return this.sendOperationFn(this.args, { + ...restSpec, + path, + httpMethod: "GET" + }); + } +} diff --git a/sdk/adp/arm-adp/src/models/index.ts b/sdk/adp/arm-adp/src/models/index.ts new file mode 100644 index 000000000000..f9de57a35f27 --- /dev/null +++ b/sdk/adp/arm-adp/src/models/index.ts @@ -0,0 +1,606 @@ +/* + * 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 * as coreClient from "@azure/core-client"; + +/** Available operations of the service */ +export interface OperationListResult { + /** List of operations supported by the Resource Provider */ + value?: Operation[]; + /** URL to get the next set of operation list results if there are any */ + nextLink?: string; +} + +/** Operation detail payload */ +export interface Operation { + /** Name of the operation */ + name?: string; + /** Indicates whether the operation is a data action */ + isDataAction?: boolean; + /** Indicates the action type */ + actionType?: string; + /** Display of the operation */ + display?: OperationDisplay; + /** Origin of the operation */ + origin?: string; + /** Details about a service operation */ + serviceSpecification?: OperationServiceSpecification; +} + +/** Operation display payload */ +export interface OperationDisplay { + /** Resource provider of the operation */ + provider?: string; + /** Resource of the operation */ + resource?: string; + /** Localized friendly name for the operation */ + operation?: string; + /** Localized friendly description for the operation */ + description?: string; +} + +/** Details about a service operation */ +export interface OperationServiceSpecification { + /** Details about operations related to logs */ + logSpecifications?: OperationLogSpecification[]; + /** Details about operations related to metrics */ + metricSpecifications?: OperationMetricSpecification[]; +} + +/** Details about an operation related to logs */ +export interface OperationLogSpecification { + /** The name of the log category */ + name?: string; + /** Localized display name */ + displayName?: string; + /** Blobs created in the customer storage account, per hour */ + blobDuration?: string; +} + +/** Details about an operation related to metrics */ +export interface OperationMetricSpecification { + /** The name of the metric */ + name?: string; + /** Localized display name of the metric */ + displayName?: string; + /** The description of the metric */ + displayDescription?: string; + /** The unit that the metric is measured in */ + unit?: string; + /** The type of metric aggregation */ + aggregationType?: string; + /** Whether or not the service is using regional MDM accounts */ + enableRegionalMdmAccount?: string; + /** The name of the MDM account */ + sourceMdmAccount?: string; + /** The name of the MDM namespace */ + sourceMdmNamespace?: string; + /** Defines how often data for metrics becomes available */ + availabilities?: OperationMetricAvailability[]; +} + +/** Defines how often data for a metric becomes available */ +export interface OperationMetricAvailability { + /** The granularity for the metric */ + timeGrain?: string; + /** Blob created in the customer storage account, per hour */ + blobDuration?: string; +} + +/** Error response */ +export interface ErrorResponse { + /** The error details */ + error?: ErrorDefinition; +} + +/** Error definition */ +export interface ErrorDefinition { + /** + * Service specific error code which serves as the substatus for the HTTP error code + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * Description of the error + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * Internal error details + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorDefinition[]; +} + +/** The parameters used to check the availability of the account name */ +export interface AccountCheckNameAvailabilityParameters { + /** The account name */ + name: string; + /** The type of resource, Microsoft.AutonomousDevelopmentPlatform/accounts */ + type: Type; +} + +/** The checkNameAvailability operation response */ +export interface CheckNameAvailabilityResult { + /** + * Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or is invalid and cannot be used + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nameAvailable?: boolean; + /** + * Gets the reason that an account name could not be used. The reason element is only returned if nameAvailable is false + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly reason?: CheckNameAvailabilityReason; + /** + * Gets an error message explaining the reason value in more detail + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; +} + +/** The list operation response, that contains the data pools and their properties */ +export interface AccountList { + /** + * List of accounts and their properties + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Account[]; + /** URL to get the next set of operation list results if there are any */ + nextLink?: string; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; +} + +/** ADP account */ +export interface AccountPatch { + /** Resource tags */ + tags?: { [propertyName: string]: string }; + /** + * The account's data-plane ID + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly accountId?: string; + /** + * Gets the status of the account at the time the operation was called + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; +} + +/** The list operation response, that contains the data pools and their properties */ +export interface DataPoolList { + /** + * List of data pools and their properties + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: DataPool[]; + /** URL to get the next set of operation list results if there are any */ + nextLink?: string; +} + +/** Data Pool properties */ +export interface DataPoolBaseProperties { + /** + * The Data Pool's data-plane ID + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly dataPoolId?: string; + /** + * Gets the status of the data pool at the time the operation was called + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** Gets or sets the collection of locations where Data Pool resources should be created */ + locations?: DataPoolLocation[]; + /** Resource tags */ + tags?: { [propertyName: string]: string }; +} + +/** Location of a Data Pool */ +export interface DataPoolLocation { + /** The location name */ + name: string; + /** Encryption properties of a Data Pool location */ + encryption?: DataPoolEncryption; + /** The Storage SKU. Default: Standard_ZRS. */ + storageSku?: StorageSku; + /** The amount of storage accounts provisioned per Data Pool. Default: 5 */ + storageAccountCount?: number; +} + +/** Encryption properties of a Data Pool */ +export interface DataPoolEncryption { + /** The URI of a soft delete-enabled Key Vault that is in the same location as the Data Pool location */ + keyVaultUri: string; + /** The name of Key Vault key */ + keyName: string; + /** The version of Key Vault key */ + keyVersion?: string; + /** The resource ID of a user-assigned Managed Identity used to access the encryption key in the Key Vault. Requires access to the key operations get, wrap, unwrap, and recover */ + userAssignedIdentity: string; +} + +/** The Storage SKU. */ +export interface StorageSku { + /** The SKU name */ + name: StorageSkuName; +} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export type TrackedResource = Resource & { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +}; + +/** ADP Data Pool */ +export type DataPool = Resource & { + /** + * The system meta data relating to this resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** + * The Data Pool's data-plane ID + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly dataPoolId?: string; + /** + * Gets the status of the data pool at the time the operation was called + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** Gets or sets the collection of locations where Data Pool resources should be created */ + locations?: DataPoolLocation[]; + /** Resource tags */ + tags?: { [propertyName: string]: string }; +}; + +/** ADP Data Pool */ +export type DataPoolPatch = Resource & { + /** + * The system meta data relating to this resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** + * The Data Pool's data-plane ID + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly dataPoolId?: string; + /** + * Gets the status of the data pool at the time the operation was called + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** Gets or sets the collection of locations where Data Pool resources should be created */ + locations?: DataPoolLocation[]; + /** Resource tags */ + tags?: { [propertyName: string]: string }; +}; + +/** Data Pool properties */ +export type DataPoolProperties = DataPoolBaseProperties & {}; + +/** ADP account */ +export type Account = TrackedResource & { + /** + * The system meta data relating to this resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** + * The account's data-plane ID + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly accountId?: string; + /** + * Gets the status of the account at the time the operation was called + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; +}; + +/** Known values of {@link Type} that the service accepts. */ +export enum KnownType { + MicrosoftAutonomousDevelopmentPlatformAccounts = "Microsoft.AutonomousDevelopmentPlatform/accounts" +} + +/** + * Defines values for Type. \ + * {@link KnownType} can be used interchangeably with Type, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Microsoft.AutonomousDevelopmentPlatform\/accounts** + */ +export type Type = string; + +/** Known values of {@link CheckNameAvailabilityReason} that the service accepts. */ +export enum KnownCheckNameAvailabilityReason { + Invalid = "Invalid", + AlreadyExists = "AlreadyExists" +} + +/** + * Defines values for CheckNameAvailabilityReason. \ + * {@link KnownCheckNameAvailabilityReason} can be used interchangeably with CheckNameAvailabilityReason, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Invalid** \ + * **AlreadyExists** + */ +export type CheckNameAvailabilityReason = string; + +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + Succeeded = "Succeeded", + Failed = "Failed", + Canceled = "Canceled", + Accepted = "Accepted", + Provisioning = "Provisioning", + Deleting = "Deleting" +} + +/** + * Defines values for ProvisioningState. \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Accepted** \ + * **Provisioning** \ + * **Deleting** + */ +export type ProvisioningState = string; + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + User = "User", + Application = "Application", + ManagedIdentity = "ManagedIdentity", + Key = "Key" +} + +/** + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** + */ +export type CreatedByType = string; + +/** Known values of {@link StorageSkuName} that the service accepts. */ +export enum KnownStorageSkuName { + StandardLRS = "Standard_LRS", + StandardGRS = "Standard_GRS", + StandardRagrs = "Standard_Ragrs", + StandardZRS = "Standard_ZRS", + PremiumLRS = "Premium_LRS", + PremiumZRS = "Premium_ZRS", + StandardGzrs = "Standard_Gzrs", + StandardRagzrs = "Standard_Ragzrs" +} + +/** + * Defines values for StorageSkuName. \ + * {@link KnownStorageSkuName} can be used interchangeably with StorageSkuName, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Standard_LRS** \ + * **Standard_GRS** \ + * **Standard_Ragrs** \ + * **Standard_ZRS** \ + * **Premium_LRS** \ + * **Premium_ZRS** \ + * **Standard_Gzrs** \ + * **Standard_Ragzrs** + */ +export type StorageSkuName = string; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; + +/** Optional parameters. */ +export interface AccountsCheckNameAvailabilityOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the checkNameAvailability operation. */ +export type AccountsCheckNameAvailabilityResponse = CheckNameAvailabilityResult; + +/** Optional parameters. */ +export interface AccountsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type AccountsListResponse = AccountList; + +/** Optional parameters. */ +export interface AccountsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type AccountsListByResourceGroupResponse = AccountList; + +/** Optional parameters. */ +export interface AccountsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type AccountsGetResponse = Account; + +/** Optional parameters. */ +export interface AccountsUpdateOptionalParams + extends coreClient.OperationOptions { + /** The parameters to provide for the current ADP account */ + parameters?: AccountPatch; + /** 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 AccountsUpdateResponse = Account; + +/** Optional parameters. */ +export interface AccountsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** The parameters to provide for the ADP account */ + parameters?: Account; + /** 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 createOrUpdate operation. */ +export type AccountsCreateOrUpdateResponse = Account; + +/** Optional parameters. */ +export interface AccountsDeleteOptionalParams + 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; +} + +/** Optional parameters. */ +export interface AccountsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type AccountsListNextResponse = AccountList; + +/** Optional parameters. */ +export interface AccountsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type AccountsListByResourceGroupNextResponse = AccountList; + +/** Optional parameters. */ +export interface DataPoolsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type DataPoolsListResponse = DataPoolList; + +/** Optional parameters. */ +export interface DataPoolsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type DataPoolsGetResponse = DataPool; + +/** Optional parameters. */ +export interface DataPoolsUpdateOptionalParams + extends coreClient.OperationOptions { + /** The parameters to provide for the Data Pool */ + parameters?: DataPoolPatch; + /** 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 DataPoolsUpdateResponse = DataPool; + +/** Optional parameters. */ +export interface DataPoolsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** The parameters to provide for the Data Pool */ + parameters?: DataPool; + /** 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 createOrUpdate operation. */ +export type DataPoolsCreateOrUpdateResponse = DataPool; + +/** Optional parameters. */ +export interface DataPoolsDeleteOptionalParams + 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; +} + +/** Optional parameters. */ +export interface DataPoolsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type DataPoolsListNextResponse = DataPoolList; + +/** Optional parameters. */ +export interface AdpManagementClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/adp/arm-adp/src/models/mappers.ts b/sdk/adp/arm-adp/src/models/mappers.ts new file mode 100644 index 000000000000..7d9a06ea4826 --- /dev/null +++ b/sdk/adp/arm-adp/src/models/mappers.ts @@ -0,0 +1,833 @@ +/* + * 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 * as coreClient from "@azure/core-client"; + +export const OperationListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const Operation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + isDataAction: { + serializedName: "isDataAction", + type: { + name: "Boolean" + } + }, + actionType: { + serializedName: "actionType", + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + serializedName: "origin", + type: { + name: "String" + } + }, + serviceSpecification: { + serializedName: "properties.serviceSpecification", + type: { + name: "Composite", + className: "OperationServiceSpecification" + } + } + } + } +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const OperationServiceSpecification: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationServiceSpecification", + modelProperties: { + logSpecifications: { + serializedName: "logSpecifications", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OperationLogSpecification" + } + } + } + }, + metricSpecifications: { + serializedName: "metricSpecifications", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OperationMetricSpecification" + } + } + } + } + } + } +}; + +export const OperationLogSpecification: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationLogSpecification", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + }, + blobDuration: { + serializedName: "blobDuration", + type: { + name: "String" + } + } + } + } +}; + +export const OperationMetricSpecification: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationMetricSpecification", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + }, + displayDescription: { + serializedName: "displayDescription", + type: { + name: "String" + } + }, + unit: { + serializedName: "unit", + type: { + name: "String" + } + }, + aggregationType: { + serializedName: "aggregationType", + type: { + name: "String" + } + }, + enableRegionalMdmAccount: { + serializedName: "enableRegionalMdmAccount", + type: { + name: "String" + } + }, + sourceMdmAccount: { + serializedName: "sourceMdmAccount", + type: { + name: "String" + } + }, + sourceMdmNamespace: { + serializedName: "sourceMdmNamespace", + type: { + name: "String" + } + }, + availabilities: { + serializedName: "availabilities", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OperationMetricAvailability" + } + } + } + } + } + } +}; + +export const OperationMetricAvailability: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationMetricAvailability", + modelProperties: { + timeGrain: { + serializedName: "timeGrain", + type: { + name: "String" + } + }, + blobDuration: { + serializedName: "blobDuration", + type: { + name: "String" + } + } + } + } +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDefinition" + } + } + } + } +}; + +export const ErrorDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDefinition", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDefinition" + } + } + } + } + } + } +}; + +export const AccountCheckNameAvailabilityParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountCheckNameAvailabilityParameters", + modelProperties: { + name: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*") + }, + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const CheckNameAvailabilityResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CheckNameAvailabilityResult", + modelProperties: { + nameAvailable: { + serializedName: "nameAvailable", + readOnly: true, + type: { + name: "Boolean" + } + }, + reason: { + serializedName: "reason", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const AccountList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountList", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Account" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const SystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } + } + } + } +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const AccountPatch: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountPatch", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + accountId: { + serializedName: "properties.accountId", + readOnly: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const DataPoolList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataPoolList", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DataPool" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const DataPoolBaseProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataPoolBaseProperties", + modelProperties: { + dataPoolId: { + serializedName: "dataPoolId", + readOnly: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + locations: { + serializedName: "locations", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DataPoolLocation" + } + } + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const DataPoolLocation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataPoolLocation", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + encryption: { + serializedName: "encryption", + type: { + name: "Composite", + className: "DataPoolEncryption" + } + }, + storageSku: { + serializedName: "storageSku", + type: { + name: "Composite", + className: "StorageSku" + } + }, + storageAccountCount: { + constraints: { + InclusiveMinimum: 1 + }, + serializedName: "storageAccountCount", + type: { + name: "Number" + } + } + } + } +}; + +export const DataPoolEncryption: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataPoolEncryption", + modelProperties: { + keyVaultUri: { + serializedName: "keyVaultUri", + required: true, + type: { + name: "String" + } + }, + keyName: { + serializedName: "keyName", + required: true, + type: { + name: "String" + } + }, + keyVersion: { + serializedName: "keyVersion", + type: { + name: "String" + } + }, + userAssignedIdentity: { + serializedName: "userAssignedIdentity", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const StorageSku: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageSku", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const TrackedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const DataPool: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataPool", + modelProperties: { + ...Resource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + dataPoolId: { + serializedName: "properties.dataPoolId", + readOnly: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + locations: { + serializedName: "properties.locations", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DataPoolLocation" + } + } + } + }, + tags: { + serializedName: "properties.tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const DataPoolPatch: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataPoolPatch", + modelProperties: { + ...Resource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + dataPoolId: { + serializedName: "properties.dataPoolId", + readOnly: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + locations: { + serializedName: "properties.locations", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DataPoolLocation" + } + } + } + }, + tags: { + serializedName: "properties.tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const DataPoolProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataPoolProperties", + modelProperties: { + ...DataPoolBaseProperties.type.modelProperties + } + } +}; + +export const Account: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Account", + modelProperties: { + ...TrackedResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + accountId: { + serializedName: "properties.accountId", + readOnly: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/adp/arm-adp/src/models/parameters.ts b/sdk/adp/arm-adp/src/models/parameters.ts new file mode 100644 index 000000000000..4cc8ef5a144f --- /dev/null +++ b/sdk/adp/arm-adp/src/models/parameters.ts @@ -0,0 +1,164 @@ +/* + * 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 { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + AccountCheckNameAvailabilityParameters as AccountCheckNameAvailabilityParametersMapper, + AccountPatch as AccountPatchMapper, + Account as AccountMapper, + DataPoolPatch as DataPoolPatchMapper, + DataPool as DataPoolMapper +} from "../models/mappers"; + +export const accept: OperationParameter = { + parameterPath: "accept", + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" + } + } +}; + +export const $host: OperationURLParameter = { + parameterPath: "$host", + mapper: { + serializedName: "$host", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2021-11-01-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" + } + } +}; + +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: AccountCheckNameAvailabilityParametersMapper +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "subscriptionId", + required: true, + type: { + name: "String" + } + } +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + constraints: { + MaxLength: 90, + MinLength: 1 + }, + serializedName: "resourceGroupName", + required: true, + type: { + name: "String" + } + } +}; + +export const accountName: OperationURLParameter = { + parameterPath: "accountName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*"), + MaxLength: 50 + }, + serializedName: "accountName", + required: true, + type: { + name: "String" + } + } +}; + +export const parameters1: OperationParameter = { + parameterPath: ["options", "parameters"], + mapper: AccountPatchMapper +}; + +export const parameters2: OperationParameter = { + parameterPath: ["options", "parameters"], + mapper: AccountMapper +}; + +export const dataPoolName: OperationURLParameter = { + parameterPath: "dataPoolName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*"), + MaxLength: 50 + }, + serializedName: "dataPoolName", + required: true, + type: { + name: "String" + } + } +}; + +export const parameters3: OperationParameter = { + parameterPath: ["options", "parameters"], + mapper: DataPoolPatchMapper +}; + +export const parameters4: OperationParameter = { + parameterPath: ["options", "parameters"], + mapper: DataPoolMapper +}; diff --git a/sdk/adp/arm-adp/src/operations/accounts.ts b/sdk/adp/arm-adp/src/operations/accounts.ts new file mode 100644 index 000000000000..45971b6ca5ce --- /dev/null +++ b/sdk/adp/arm-adp/src/operations/accounts.ts @@ -0,0 +1,698 @@ +/* + * 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 { Accounts } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AdpManagementClient } from "../adpManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + Account, + AccountsListNextOptionalParams, + AccountsListOptionalParams, + AccountsListByResourceGroupNextOptionalParams, + AccountsListByResourceGroupOptionalParams, + AccountCheckNameAvailabilityParameters, + AccountsCheckNameAvailabilityOptionalParams, + AccountsCheckNameAvailabilityResponse, + AccountsListResponse, + AccountsListByResourceGroupResponse, + AccountsGetOptionalParams, + AccountsGetResponse, + AccountsUpdateOptionalParams, + AccountsUpdateResponse, + AccountsCreateOrUpdateOptionalParams, + AccountsCreateOrUpdateResponse, + AccountsDeleteOptionalParams, + AccountsListNextResponse, + AccountsListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing Accounts operations. */ +export class AccountsImpl implements Accounts { + private readonly client: AdpManagementClient; + + /** + * Initialize a new instance of the class Accounts class. + * @param client Reference to the service client + */ + constructor(client: AdpManagementClient) { + this.client = client; + } + + /** + * List all ADP accounts available under the subscription + * @param options The options parameters. + */ + public list( + options?: AccountsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: AccountsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: AccountsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * List all ADP accounts available under the resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: AccountsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: AccountsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: AccountsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Checks that the account name is valid and is not already in use + * @param parameters The checkNameAvailability parameters. + * @param options The options parameters. + */ + checkNameAvailability( + parameters: AccountCheckNameAvailabilityParameters, + options?: AccountsCheckNameAvailabilityOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { parameters, options }, + checkNameAvailabilityOperationSpec + ); + } + + /** + * List all ADP accounts available under the subscription + * @param options The options parameters. + */ + private _list( + options?: AccountsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * List all ADP accounts available under the resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: AccountsListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Gets the properties of an ADP account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + options?: AccountsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, options }, + getOperationSpec + ); + } + + /** + * Updates the properties of an existing ADP account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + accountName: string, + options?: AccountsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + AccountsUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = 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 = new LroImpl( + sendOperation, + { resourceGroupName, accountName, options }, + updateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Updates the properties of an existing ADP account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + accountName: string, + options?: AccountsUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + accountName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Creates or updates an ADP account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + accountName: string, + options?: AccountsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + AccountsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = 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 = new LroImpl( + sendOperation, + { resourceGroupName, accountName, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Creates or updates an ADP account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + accountName: string, + options?: AccountsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + accountName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes an ADP account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + accountName: string, + options?: AccountsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = 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 = new LroImpl( + sendOperation, + { resourceGroupName, accountName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Deletes an ADP account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + options?: AccountsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + accountName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: AccountsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: AccountsListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.AutonomousDevelopmentPlatform/checkNameAvailability", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.CheckNameAvailabilityResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.AutonomousDevelopmentPlatform/accounts", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccountList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AutonomousDevelopmentPlatform/accounts", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccountList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AutonomousDevelopmentPlatform/accounts/{accountName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Account + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AutonomousDevelopmentPlatform/accounts/{accountName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Account + }, + 201: { + bodyMapper: Mappers.Account + }, + 202: { + bodyMapper: Mappers.Account + }, + 204: { + bodyMapper: Mappers.Account + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AutonomousDevelopmentPlatform/accounts/{accountName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Account + }, + 201: { + bodyMapper: Mappers.Account + }, + 202: { + bodyMapper: Mappers.Account + }, + 204: { + bodyMapper: Mappers.Account + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AutonomousDevelopmentPlatform/accounts/{accountName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccountList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccountList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/adp/arm-adp/src/operations/dataPools.ts b/sdk/adp/arm-adp/src/operations/dataPools.ts new file mode 100644 index 000000000000..79b3e7e4b3d6 --- /dev/null +++ b/sdk/adp/arm-adp/src/operations/dataPools.ts @@ -0,0 +1,586 @@ +/* + * 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 { DataPools } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AdpManagementClient } from "../adpManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + DataPool, + DataPoolsListNextOptionalParams, + DataPoolsListOptionalParams, + DataPoolsListResponse, + DataPoolsGetOptionalParams, + DataPoolsGetResponse, + DataPoolsUpdateOptionalParams, + DataPoolsUpdateResponse, + DataPoolsCreateOrUpdateOptionalParams, + DataPoolsCreateOrUpdateResponse, + DataPoolsDeleteOptionalParams, + DataPoolsListNextResponse +} from "../models"; + +/// +/** Class containing DataPools operations. */ +export class DataPoolsImpl implements DataPools { + private readonly client: AdpManagementClient; + + /** + * Initialize a new instance of the class DataPools class. + * @param client Reference to the service client + */ + constructor(client: AdpManagementClient) { + this.client = client; + } + + /** + * Lists the data pools under the ADP account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + accountName: string, + options?: DataPoolsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, accountName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceGroupName, accountName, options); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + accountName: string, + options?: DataPoolsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceGroupName, accountName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + accountName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + accountName: string, + options?: DataPoolsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + accountName, + options + )) { + yield* page; + } + } + + /** + * Lists the data pools under the ADP account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + accountName: string, + options?: DataPoolsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, options }, + listOperationSpec + ); + } + + /** + * Gets the properties of a Data Pool + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param dataPoolName The name of the Data Pool + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + dataPoolName: string, + options?: DataPoolsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, dataPoolName, options }, + getOperationSpec + ); + } + + /** + * Updates the properties of an existing Data Pool + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param dataPoolName The name of the Data Pool + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + accountName: string, + dataPoolName: string, + options?: DataPoolsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DataPoolsUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = 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 = new LroImpl( + sendOperation, + { resourceGroupName, accountName, dataPoolName, options }, + updateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Updates the properties of an existing Data Pool + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param dataPoolName The name of the Data Pool + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + accountName: string, + dataPoolName: string, + options?: DataPoolsUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + accountName, + dataPoolName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Creates or updates a Data Pool + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param dataPoolName The name of the Data Pool + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + accountName: string, + dataPoolName: string, + options?: DataPoolsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DataPoolsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = 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 = new LroImpl( + sendOperation, + { resourceGroupName, accountName, dataPoolName, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Creates or updates a Data Pool + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param dataPoolName The name of the Data Pool + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + accountName: string, + dataPoolName: string, + options?: DataPoolsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + accountName, + dataPoolName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a Data Pool + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param dataPoolName The name of the Data Pool + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + accountName: string, + dataPoolName: string, + options?: DataPoolsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = 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 = new LroImpl( + sendOperation, + { resourceGroupName, accountName, dataPoolName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Deletes a Data Pool + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param dataPoolName The name of the Data Pool + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + dataPoolName: string, + options?: DataPoolsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + accountName, + dataPoolName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP 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?: DataPoolsListNextOptionalParams + ): 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.AutonomousDevelopmentPlatform/accounts/{accountName}/dataPools", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DataPoolList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AutonomousDevelopmentPlatform/accounts/{accountName}/dataPools/{dataPoolName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DataPool + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.dataPoolName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AutonomousDevelopmentPlatform/accounts/{accountName}/dataPools/{dataPoolName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.DataPool + }, + 201: { + bodyMapper: Mappers.DataPool + }, + 202: { + bodyMapper: Mappers.DataPool + }, + 204: { + bodyMapper: Mappers.DataPool + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.dataPoolName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AutonomousDevelopmentPlatform/accounts/{accountName}/dataPools/{dataPoolName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.DataPool + }, + 201: { + bodyMapper: Mappers.DataPool + }, + 202: { + bodyMapper: Mappers.DataPool + }, + 204: { + bodyMapper: Mappers.DataPool + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters4, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.dataPoolName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AutonomousDevelopmentPlatform/accounts/{accountName}/dataPools/{dataPoolName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.dataPoolName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DataPoolList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/adp/arm-adp/src/operations/index.ts b/sdk/adp/arm-adp/src/operations/index.ts new file mode 100644 index 000000000000..c4d5b8642105 --- /dev/null +++ b/sdk/adp/arm-adp/src/operations/index.ts @@ -0,0 +1,11 @@ +/* + * 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. + */ + +export * from "./operations"; +export * from "./accounts"; +export * from "./dataPools"; diff --git a/sdk/adp/arm-adp/src/operations/operations.ts b/sdk/adp/arm-adp/src/operations/operations.ts new file mode 100644 index 000000000000..2f39f9572889 --- /dev/null +++ b/sdk/adp/arm-adp/src/operations/operations.ts @@ -0,0 +1,137 @@ +/* + * 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 { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AdpManagementClient } from "../adpManagementClient"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; + +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: AdpManagementClient; + + /** + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client + */ + constructor(client: AdpManagementClient) { + this.client = client; + } + + /** + * Lists all of the available Autonomous Development Platform provider operations + * @param options The options parameters. + */ + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Lists all of the available Autonomous Development Platform provider operations + * @param options The options parameters. + */ + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ 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?: OperationsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.AutonomousDevelopmentPlatform/operations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/adp/arm-adp/src/operationsInterfaces/accounts.ts b/sdk/adp/arm-adp/src/operationsInterfaces/accounts.ts new file mode 100644 index 000000000000..62feb0284ab4 --- /dev/null +++ b/sdk/adp/arm-adp/src/operationsInterfaces/accounts.ts @@ -0,0 +1,142 @@ +/* + * 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 { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + Account, + AccountsListOptionalParams, + AccountsListByResourceGroupOptionalParams, + AccountCheckNameAvailabilityParameters, + AccountsCheckNameAvailabilityOptionalParams, + AccountsCheckNameAvailabilityResponse, + AccountsGetOptionalParams, + AccountsGetResponse, + AccountsUpdateOptionalParams, + AccountsUpdateResponse, + AccountsCreateOrUpdateOptionalParams, + AccountsCreateOrUpdateResponse, + AccountsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a Accounts. */ +export interface Accounts { + /** + * List all ADP accounts available under the subscription + * @param options The options parameters. + */ + list( + options?: AccountsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * List all ADP accounts available under the resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: AccountsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Checks that the account name is valid and is not already in use + * @param parameters The checkNameAvailability parameters. + * @param options The options parameters. + */ + checkNameAvailability( + parameters: AccountCheckNameAvailabilityParameters, + options?: AccountsCheckNameAvailabilityOptionalParams + ): Promise; + /** + * Gets the properties of an ADP account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + options?: AccountsGetOptionalParams + ): Promise; + /** + * Updates the properties of an existing ADP account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + accountName: string, + options?: AccountsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + AccountsUpdateResponse + > + >; + /** + * Updates the properties of an existing ADP account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + accountName: string, + options?: AccountsUpdateOptionalParams + ): Promise; + /** + * Creates or updates an ADP account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + accountName: string, + options?: AccountsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + AccountsCreateOrUpdateResponse + > + >; + /** + * Creates or updates an ADP account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + accountName: string, + options?: AccountsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes an ADP account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + accountName: string, + options?: AccountsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes an ADP account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + options?: AccountsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/adp/arm-adp/src/operationsInterfaces/dataPools.ts b/sdk/adp/arm-adp/src/operationsInterfaces/dataPools.ts new file mode 100644 index 000000000000..5ed57b11a82d --- /dev/null +++ b/sdk/adp/arm-adp/src/operationsInterfaces/dataPools.ts @@ -0,0 +1,138 @@ +/* + * 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 { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + DataPool, + DataPoolsListOptionalParams, + DataPoolsGetOptionalParams, + DataPoolsGetResponse, + DataPoolsUpdateOptionalParams, + DataPoolsUpdateResponse, + DataPoolsCreateOrUpdateOptionalParams, + DataPoolsCreateOrUpdateResponse, + DataPoolsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a DataPools. */ +export interface DataPools { + /** + * Lists the data pools under the ADP account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param options The options parameters. + */ + list( + resourceGroupName: string, + accountName: string, + options?: DataPoolsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the properties of a Data Pool + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param dataPoolName The name of the Data Pool + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + dataPoolName: string, + options?: DataPoolsGetOptionalParams + ): Promise; + /** + * Updates the properties of an existing Data Pool + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param dataPoolName The name of the Data Pool + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + accountName: string, + dataPoolName: string, + options?: DataPoolsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DataPoolsUpdateResponse + > + >; + /** + * Updates the properties of an existing Data Pool + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param dataPoolName The name of the Data Pool + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + accountName: string, + dataPoolName: string, + options?: DataPoolsUpdateOptionalParams + ): Promise; + /** + * Creates or updates a Data Pool + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param dataPoolName The name of the Data Pool + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + accountName: string, + dataPoolName: string, + options?: DataPoolsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DataPoolsCreateOrUpdateResponse + > + >; + /** + * Creates or updates a Data Pool + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param dataPoolName The name of the Data Pool + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + accountName: string, + dataPoolName: string, + options?: DataPoolsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes a Data Pool + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param dataPoolName The name of the Data Pool + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + accountName: string, + dataPoolName: string, + options?: DataPoolsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a Data Pool + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the ADP account + * @param dataPoolName The name of the Data Pool + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + dataPoolName: string, + options?: DataPoolsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/adp/arm-adp/src/operationsInterfaces/index.ts b/sdk/adp/arm-adp/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..c4d5b8642105 --- /dev/null +++ b/sdk/adp/arm-adp/src/operationsInterfaces/index.ts @@ -0,0 +1,11 @@ +/* + * 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. + */ + +export * from "./operations"; +export * from "./accounts"; +export * from "./dataPools"; diff --git a/sdk/adp/arm-adp/src/operationsInterfaces/operations.ts b/sdk/adp/arm-adp/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..00f872448124 --- /dev/null +++ b/sdk/adp/arm-adp/src/operationsInterfaces/operations.ts @@ -0,0 +1,22 @@ +/* + * 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 { Operation, OperationsListOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * Lists all of the available Autonomous Development Platform provider operations + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/adp/arm-adp/test/sampleTest.ts b/sdk/adp/arm-adp/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/adp/arm-adp/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/adp/arm-adp/tsconfig.json b/sdk/adp/arm-adp/tsconfig.json new file mode 100644 index 000000000000..3e6ae96443f3 --- /dev/null +++ b/sdk/adp/arm-adp/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": [ + "es6", + "dom" + ], + "declaration": true, + "outDir": "./dist-esm", + "importHelpers": true + }, + "include": [ + "./src/**/*.ts", + "./test/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/sdk/adp/ci.mgmt.yml b/sdk/adp/ci.mgmt.yml new file mode 100644 index 000000000000..9876dd93b97c --- /dev/null +++ b/sdk/adp/ci.mgmt.yml @@ -0,0 +1,38 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/adp/arm-adp + - sdk/adp/ci.mgmt.yml + +pr: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/adp/arm-adp + - sdk/adp/ci.mgmt.yml + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: adp + Artifacts: + - name: adp + safeName: adp + \ No newline at end of file