diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index d246b7b4f807..d06638657ac3 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -116,6 +116,9 @@ dependencies: '@rush-temp/arm-azureadexternalidentities': specifier: file:./projects/arm-azureadexternalidentities.tgz version: file:projects/arm-azureadexternalidentities.tgz + '@rush-temp/arm-azuredatatransfer': + specifier: file:./projects/arm-azuredatatransfer.tgz + version: file:projects/arm-azuredatatransfer.tgz '@rush-temp/arm-azurestack': specifier: file:./projects/arm-azurestack.tgz version: file:projects/arm-azurestack.tgz @@ -11533,6 +11536,34 @@ packages: - supports-color dev: false + file:projects/arm-azuredatatransfer.tgz: + resolution: {integrity: sha512-n7qTAbPds2ZVvJOxxnPlYU56961kmqtKiJCeMXS74umYksdbYXWqXseQSLl6kKJu+gPPdRwI3V40l4UOWjpi5g==, tarball: file:projects/arm-azuredatatransfer.tgz} + name: '@rush-temp/arm-azuredatatransfer' + version: 0.0.0 + dependencies: + '@azure/abort-controller': 1.1.0 + '@azure/identity': 3.4.1 + '@microsoft/api-extractor': 7.38.5(@types/node@18.19.3) + '@types/chai': 4.3.11 + '@types/mocha': 10.0.6 + '@types/node': 18.19.3 + chai: 4.3.10 + cross-env: 7.0.3 + dotenv: 16.3.1 + esm: 3.2.25 + mkdirp: 2.1.6 + mocha: 10.2.0 + rimraf: 5.0.5 + ts-node: 10.9.2(@types/node@18.19.3)(typescript@5.2.2) + tslib: 2.6.2 + typescript: 5.2.2 + uglify-js: 3.17.4 + transitivePeerDependencies: + - '@swc/core' + - '@swc/wasm' + - supports-color + dev: false + file:projects/arm-azurestack.tgz: resolution: {integrity: sha512-6pgruPO4BB7wTq09510NaAUKNG83O47FEYf+oatOZ1gZsKbU3cq8OZC2os1D7URwULHvweMOse8hNmdmhj/A9w==, tarball: file:projects/arm-azurestack.tgz} name: '@rush-temp/arm-azurestack' diff --git a/rush.json b/rush.json index 9660cbd27016..6051df660851 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. @@ -623,7 +623,9 @@ { "packageName": "@azure/identity", "projectFolder": "sdk/identity/identity", - "decoupledLocalDependencies": ["@azure/keyvault-keys"], + "decoupledLocalDependencies": [ + "@azure/keyvault-keys" + ], "versionPolicyName": "client" }, { @@ -2150,6 +2152,11 @@ "packageName": "@azure/arm-networkanalytics", "projectFolder": "sdk/networkanalytics/arm-networkanalytics", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-azuredatatransfer", + "projectFolder": "sdk/azuredatatransfer/arm-azuredatatransfer", + "versionPolicyName": "management" } ] -} +} \ No newline at end of file diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/CHANGELOG.md b/sdk/azuredatatransfer/arm-azuredatatransfer/CHANGELOG.md new file mode 100644 index 000000000000..919d4f6fcc30 --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2023-12-20) + +The package of @azure/arm-azuredatatransfer is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/LICENSE b/sdk/azuredatatransfer/arm-azuredatatransfer/LICENSE new file mode 100644 index 000000000000..3a1d9b6f24f7 --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2023 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +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/azuredatatransfer/arm-azuredatatransfer/README.md b/sdk/azuredatatransfer/arm-azuredatatransfer/README.md new file mode 100644 index 000000000000..a349555d6f4b --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/README.md @@ -0,0 +1,109 @@ +# Azuredatatransferrp client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azuredatatransferrp client. + +Azure Data Transfer service resource provider + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/azuredatatransfer/arm-azuredatatransfer) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-azuredatatransfer) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-azuredatatransfer?view=azure-node-preview) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started + +### Currently supported environments + +- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) +- Latest versions of Safari, Chrome, Edge and Firefox. + +See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-azuredatatransfer` package + +Install the Azuredatatransferrp client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-azuredatatransfer +``` + +### Create and authenticate a `Azuredatatransferrp` + +To create a client object to access the Azuredatatransferrp API, you will need the `endpoint` of your Azuredatatransferrp resource and a `credential`. The Azuredatatransferrp client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azuredatatransferrp resource in the [Azure Portal][azure_portal]. + +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` + +You will also need to **register a new AAD application and grant access to Azuredatatransferrp** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. + +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). + +```javascript +const { Azuredatatransferrp } = require("@azure/arm-azuredatatransfer"); +const { DefaultAzureCredential } = require("@azure/identity"); +// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. + +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new Azuredatatransferrp(new DefaultAzureCredential(), subscriptionId); + +// For client-side applications running in the browser, use this code instead: +// const credential = new InteractiveBrowserCredential({ +// tenantId: "", +// clientId: "" +// }); +// const client = new Azuredatatransferrp(credential, subscriptionId); +``` + + +### 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 + +### Azuredatatransferrp + +`Azuredatatransferrp` is the primary interface for developers using the Azuredatatransferrp client library. Explore the methods on this client object to understand the different features of the Azuredatatransferrp service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); +``` + +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + +## Next steps + +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + +## Related projects + +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fazuredatatransfer%2Farm-azuredatatransfer%2FREADME.png) + +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/_meta.json b/sdk/azuredatatransfer/arm-azuredatatransfer/_meta.json new file mode 100644 index 000000000000..cd0e2c69bdb9 --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/_meta.json @@ -0,0 +1,8 @@ +{ + "commit": "3b25a2a8cb5cf5f1f6a806274acc9e44c64491bb", + "readme": "specification/azuredatatransfer/resource-manager/readme.md", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/azuredatatransfer/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.4", + "use": "@autorest/typescript@^6.0.12" +} \ No newline at end of file diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/api-extractor.json b/sdk/azuredatatransfer/arm-azuredatatransfer/api-extractor.json new file mode 100644 index 000000000000..3506d1a3540d --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/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/arm-azuredatatransfer.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/azuredatatransfer/arm-azuredatatransfer/package.json b/sdk/azuredatatransfer/arm-azuredatatransfer/package.json new file mode 100644 index 000000000000..b8c60f1cdd90 --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/package.json @@ -0,0 +1,111 @@ +{ + "name": "@azure/arm-azuredatatransfer", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", + "description": "A generated SDK for Azuredatatransferrp.", + "version": "1.0.0-beta.1", + "engines": { + "node": ">=18.0.0" + }, + "dependencies": { + "@azure/core-lro": "^2.5.4", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.7.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.12.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/arm-azuredatatransfer.d.ts", + "devDependencies": { + "@microsoft/api-extractor": "^7.31.1", + "mkdirp": "^2.1.2", + "typescript": "~5.2.0", + "uglify-js": "^3.4.9", + "rimraf": "^5.0.0", + "dotenv": "^16.0.0", + "@azure/dev-tool": "^1.0.0", + "@azure/identity": "^3.3.0", + "@azure-tools/test-recorder": "^3.0.0", + "@azure-tools/test-credential": "^1.0.0", + "mocha": "^10.0.0", + "@types/mocha": "^10.0.0", + "esm": "^3.2.18", + "@types/chai": "^4.2.8", + "chai": "^4.2.0", + "cross-env": "^7.0.2", + "@types/node": "^18.0.0", + "ts-node": "^10.0.0" + }, + "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", + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" + ], + "scripts": { + "build": "npm run clean && tsc && dev-tool run bundle && 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 --glob 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": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped" + }, + "sideEffects": false, + "//metadata": { + "constantPaths": [ + { + "path": "src/azuredatatransferrp.ts", + "prefix": "packageDetails" + } + ] + }, + "autoPublish": true, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/azuredatatransfer/arm-azuredatatransfer" +} \ No newline at end of file diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/review/arm-azuredatatransfer.api.md b/sdk/azuredatatransfer/arm-azuredatatransfer/review/arm-azuredatatransfer.api.md new file mode 100644 index 000000000000..c6f857fafaba --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/review/arm-azuredatatransfer.api.md @@ -0,0 +1,947 @@ +## API Report File for "@azure/arm-azuredatatransfer" + +> 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 { OperationState } from '@azure/core-lro'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { SimplePollerLike } from '@azure/core-lro'; + +// @public +export type ActionType = string; + +// @public +export interface AzureDataTransfer { + listApprovedSchemas(pipeline: ListApprovedSchemasRequest, options?: AzureDataTransferListApprovedSchemasOptionalParams): Promise; + validateSchema(schema: Schema, options?: AzureDataTransferValidateSchemaOptionalParams): Promise; +} + +// @public +export interface AzureDataTransferListApprovedSchemasOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AzureDataTransferListApprovedSchemasResponse = SchemasListResult; + +// @public (undocumented) +export class Azuredatatransferrp extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: AzuredatatransferrpOptionalParams); + constructor(credentials: coreAuth.TokenCredential, options?: AzuredatatransferrpOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + azureDataTransfer: AzureDataTransfer; + // (undocumented) + connections: Connections; + // (undocumented) + flows: Flows; + // (undocumented) + listPendingConnections: ListPendingConnections; + // (undocumented) + listPendingFlows: ListPendingFlows; + // (undocumented) + listSchemas: ListSchemas; + // (undocumented) + operations: Operations; + // (undocumented) + pipelines: Pipelines; + // (undocumented) + subscriptionId?: string; +} + +// @public +export interface AzuredatatransferrpOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface AzureDataTransferValidateSchemaOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AzureDataTransferValidateSchemaResponse = ValidateSchemaResult; + +// @public +export interface Connection extends TrackedResource { + properties?: ConnectionProperties; +} + +// @public +export interface ConnectionProperties { + readonly approver?: string; + readonly dateSubmitted?: Date; + direction?: Direction; + flowTypes?: FlowType[]; + justification?: string; + readonly linkedConnectionId?: string; + readonly linkStatus?: LinkStatus; + pin?: string; + pipeline: string; + policies?: string[]; + primaryContact?: string; + readonly provisioningState?: ProvisioningState; + remoteSubscriptionId?: string; + requirementId?: string; + schemas?: Schema[]; + secondaryContacts?: string[]; + readonly status?: Status; + readonly statusReason?: string; +} + +// @public +export interface Connections { + beginCreateOrUpdate(resourceGroupName: string, connectionName: string, connection: Connection, options?: ConnectionsCreateOrUpdateOptionalParams): Promise, ConnectionsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, connectionName: string, connection: Connection, options?: ConnectionsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, connectionName: string, options?: ConnectionsDeleteOptionalParams): Promise, ConnectionsDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, connectionName: string, options?: ConnectionsDeleteOptionalParams): Promise; + beginLink(resourceGroupName: string, connectionName: string, connection: ResourceBody, options?: ConnectionsLinkOptionalParams): Promise, ConnectionsLinkResponse>>; + beginLinkAndWait(resourceGroupName: string, connectionName: string, connection: ResourceBody, options?: ConnectionsLinkOptionalParams): Promise; + beginUpdate(resourceGroupName: string, connectionName: string, connection: ConnectionsPatch, options?: ConnectionsUpdateOptionalParams): Promise, ConnectionsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, connectionName: string, connection: ConnectionsPatch, options?: ConnectionsUpdateOptionalParams): Promise; + get(resourceGroupName: string, connectionName: string, options?: ConnectionsGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: ConnectionsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: ConnectionsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ConnectionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ConnectionsCreateOrUpdateResponse = Connection; + +// @public +export interface ConnectionsDeleteHeaders { + location?: string; +} + +// @public +export interface ConnectionsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ConnectionsDeleteResponse = ConnectionsDeleteHeaders; + +// @public +export interface ConnectionsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ConnectionsGetResponse = Connection; + +// @public +export interface ConnectionsLinkHeaders { + location?: string; +} + +// @public +export interface ConnectionsLinkOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ConnectionsLinkResponse = Connection; + +// @public +export interface ConnectionsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ConnectionsListByResourceGroupNextResponse = ConnectionsListResult; + +// @public +export interface ConnectionsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ConnectionsListByResourceGroupResponse = ConnectionsListResult; + +// @public +export interface ConnectionsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ConnectionsListBySubscriptionNextResponse = ConnectionsListResult; + +// @public +export interface ConnectionsListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ConnectionsListBySubscriptionResponse = ConnectionsListResult; + +// @public +export interface ConnectionsListResult { + nextLink?: string; + value?: Connection[]; +} + +// @public +export interface ConnectionsPatch { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface ConnectionsUpdateHeaders { + location?: string; +} + +// @public +export interface ConnectionsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ConnectionsUpdateResponse = Connection; + +// @public +export type CreatedByType = string; + +// @public +export type DataType = string; + +// @public +export type Direction = string; + +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +export interface Flow extends TrackedResource { + identity?: ManagedServiceIdentity; + plan?: Plan; + properties?: FlowProperties; +} + +// @public +export interface FlowProperties { + connection?: SelectedResource; + dataType?: DataType; + readonly flowId?: string; + flowType?: FlowType; + keyVaultUri?: string; + readonly linkedFlowId?: string; + readonly linkStatus?: LinkStatusFlow; + policies?: string[]; + readonly provisioningState?: ProvisioningState; + schema?: Schema; + serviceBusQueueId?: string; + status?: FlowStatus; + storageAccountId?: string; + storageAccountName?: string; + storageContainerName?: string; +} + +// @public +export interface Flows { + beginCreateOrUpdate(resourceGroupName: string, connectionName: string, flowName: string, flow: Flow, options?: FlowsCreateOrUpdateOptionalParams): Promise, FlowsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, connectionName: string, flowName: string, flow: Flow, options?: FlowsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, connectionName: string, flowName: string, options?: FlowsDeleteOptionalParams): Promise, FlowsDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, connectionName: string, flowName: string, options?: FlowsDeleteOptionalParams): Promise; + beginDisable(resourceGroupName: string, connectionName: string, flowName: string, options?: FlowsDisableOptionalParams): Promise, FlowsDisableResponse>>; + beginDisableAndWait(resourceGroupName: string, connectionName: string, flowName: string, options?: FlowsDisableOptionalParams): Promise; + beginEnable(resourceGroupName: string, connectionName: string, flowName: string, options?: FlowsEnableOptionalParams): Promise, FlowsEnableResponse>>; + beginEnableAndWait(resourceGroupName: string, connectionName: string, flowName: string, options?: FlowsEnableOptionalParams): Promise; + beginLink(resourceGroupName: string, connectionName: string, flowName: string, flow: ResourceBody, options?: FlowsLinkOptionalParams): Promise, FlowsLinkResponse>>; + beginLinkAndWait(resourceGroupName: string, connectionName: string, flowName: string, flow: ResourceBody, options?: FlowsLinkOptionalParams): Promise; + beginUpdate(resourceGroupName: string, connectionName: string, flowName: string, flow: FlowsPatch, options?: FlowsUpdateOptionalParams): Promise, FlowsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, connectionName: string, flowName: string, flow: FlowsPatch, options?: FlowsUpdateOptionalParams): Promise; + get(resourceGroupName: string, connectionName: string, flowName: string, options?: FlowsGetOptionalParams): Promise; + listByConnection(resourceGroupName: string, connectionName: string, options?: FlowsListByConnectionOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface FlowsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type FlowsCreateOrUpdateResponse = Flow; + +// @public +export interface FlowsDeleteHeaders { + location?: string; +} + +// @public +export interface FlowsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type FlowsDeleteResponse = FlowsDeleteHeaders; + +// @public +export interface FlowsDisableHeaders { + location?: string; +} + +// @public +export interface FlowsDisableOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type FlowsDisableResponse = Flow; + +// @public +export interface FlowsEnableHeaders { + location?: string; +} + +// @public +export interface FlowsEnableOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type FlowsEnableResponse = Flow; + +// @public +export interface FlowsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FlowsGetResponse = Flow; + +// @public +export interface FlowsLinkHeaders { + location?: string; +} + +// @public +export interface FlowsLinkOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type FlowsLinkResponse = Flow; + +// @public +export interface FlowsListByConnectionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FlowsListByConnectionNextResponse = FlowsListResult; + +// @public +export interface FlowsListByConnectionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FlowsListByConnectionResponse = FlowsListResult; + +// @public +export interface FlowsListResult { + nextLink?: string; + value?: Flow[]; +} + +// @public +export interface FlowsPatch { + identity?: ManagedServiceIdentity; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type FlowStatus = string; + +// @public +export interface FlowsUpdateHeaders { + location?: string; +} + +// @public +export interface FlowsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type FlowsUpdateResponse = Flow; + +// @public +export type FlowType = string; + +// @public +export function getContinuationToken(page: unknown): string | undefined; + +// @public +export interface InternalMetadataProperties { + [property: string]: any; + operationStatus?: OperationStatusProperties; + readonly statusSetBy?: string; +} + +// @public +export enum KnownActionType { + Internal = "Internal" +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownDataType { + Blob = "Blob", + Table = "Table" +} + +// @public +export enum KnownDirection { + Receive = "Receive", + Send = "Send" +} + +// @public +export enum KnownFlowStatus { + Disabled = "Disabled", + Enabled = "Enabled" +} + +// @public +export enum KnownFlowType { + BasicFiles = "BasicFiles", + Complex = "Complex", + Data = "Data", + DevSecOps = "DevSecOps", + Messaging = "Messaging", + MicrosoftInternal = "MicrosoftInternal", + Mission = "Mission", + Unknown = "Unknown" +} + +// @public +export enum KnownLinkStatus { + Linked = "Linked", + Unlinked = "Unlinked" +} + +// @public +export enum KnownLinkStatusFlow { + Linked = "Linked", + Unlinked = "Unlinked" +} + +// @public +export enum KnownListApprovedSchemasDirection { + Receive = "Receive", + Send = "Send" +} + +// @public +export enum KnownManagedServiceIdentityType { + None = "None", + SystemAssigned = "SystemAssigned", + SystemAssignedUserAssigned = "SystemAssigned,UserAssigned", + UserAssigned = "UserAssigned" +} + +// @public +export enum KnownOperationStatusEnum { + Failed = "Failed", + Succeeded = "Succeeded" +} + +// @public +export enum KnownOrigin { + System = "system", + User = "user", + UserSystem = "user,system" +} + +// @public +export enum KnownProvisioningState { + Accepted = "Accepted", + Canceled = "Canceled", + Failed = "Failed", + Succeeded = "Succeeded" +} + +// @public +export enum KnownSchemaStatus { + Approved = "Approved", + New = "New" +} + +// @public +export enum KnownStatus { + Accepted = "Accepted", + Approved = "Approved", + InReview = "InReview", + Rejected = "Rejected" +} + +// @public +export enum KnownValidateSchemaStatus { + Failed = "Failed", + Succeeded = "Succeeded" +} + +// @public +export type LinkStatus = string; + +// @public +export type LinkStatusFlow = string; + +// @public +export type ListApprovedSchemasDirection = string; + +// @public (undocumented) +export interface ListApprovedSchemasRequest { + direction?: ListApprovedSchemasDirection; + pipeline?: string; +} + +// @public +export interface ListPendingConnections { + list(resourceGroupName: string, connectionName: string, options?: ListPendingConnectionsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ListPendingConnectionsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ListPendingConnectionsListNextResponse = PendingConnectionsListResult; + +// @public +export interface ListPendingConnectionsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ListPendingConnectionsListResponse = PendingConnectionsListResult; + +// @public +export interface ListPendingFlows { + list(resourceGroupName: string, connectionName: string, options?: ListPendingFlowsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ListPendingFlowsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ListPendingFlowsListNextResponse = PendingFlowsListResult; + +// @public +export interface ListPendingFlowsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ListPendingFlowsListResponse = PendingFlowsListResult; + +// @public +export interface ListSchemas { + list(resourceGroupName: string, pipelineName: string, schema: Schema, options?: ListSchemasListOptionalParams): Promise; +} + +// @public +export interface ListSchemasListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ListSchemasListResponse = SchemasListResult; + +// @public +export interface ManagedServiceIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type: ManagedServiceIdentityType; + userAssignedIdentities?: { + [propertyName: string]: UserAssignedIdentity; + }; +} + +// @public +export type ManagedServiceIdentityType = string; + +// @public +export interface Operation { + readonly actionType?: ActionType; + display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationListResult { + readonly nextLink?: string; + readonly value?: Operation[]; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @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 OperationStatusEnum = string; + +// @public +export interface OperationStatusProperties { + readonly id?: string; + readonly message?: string; + readonly status?: OperationStatusEnum; +} + +// @public +export type Origin = string; + +// @public +export interface PendingConnection extends ConnectionProperties, TrackedResource { + readonly subscriptionId?: string; +} + +// @public +export interface PendingConnectionsListResult { + nextLink?: string; + value?: PendingConnection[]; +} + +// @public +export interface PendingFlow extends FlowProperties, TrackedResource { + readonly connectionId?: string; + readonly subscriptionId?: string; +} + +// @public +export interface PendingFlowsListResult { + nextLink?: string; + value?: PendingFlow[]; +} + +// @public +export interface Pipeline extends TrackedResource { + properties?: PipelineProperties; +} + +// @public +export interface PipelineConnection { + [property: string]: any; + readonly etag?: string; + id: string; + readonly location?: string; + readonly name?: string; + properties?: PipelineConnectionProperties; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export interface PipelineConnectionProperties { + [property: string]: any; + internalMetadata?: InternalMetadataProperties; +} + +// @public +export interface PipelineProperties { + readonly connections?: PipelineConnection[]; + displayName?: string; + flowTypes?: FlowType[]; + policies?: string[]; + readonly provisioningState?: ProvisioningState; + remoteCloud: string; + subscribers?: Subscriber[]; +} + +// @public +export interface Pipelines { + beginApproveConnection(resourceGroupName: string, pipelineName: string, connection: ResourceBody, options?: PipelinesApproveConnectionOptionalParams): Promise, PipelinesApproveConnectionResponse>>; + beginApproveConnectionAndWait(resourceGroupName: string, pipelineName: string, connection: ResourceBody, options?: PipelinesApproveConnectionOptionalParams): Promise; + beginCreateOrUpdate(resourceGroupName: string, pipelineName: string, pipeline: Pipeline, options?: PipelinesCreateOrUpdateOptionalParams): Promise, PipelinesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, pipelineName: string, pipeline: Pipeline, options?: PipelinesCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, pipelineName: string, options?: PipelinesDeleteOptionalParams): Promise, PipelinesDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, pipelineName: string, options?: PipelinesDeleteOptionalParams): Promise; + beginRejectConnection(resourceGroupName: string, pipelineName: string, connection: ResourceBody, options?: PipelinesRejectConnectionOptionalParams): Promise, PipelinesRejectConnectionResponse>>; + beginRejectConnectionAndWait(resourceGroupName: string, pipelineName: string, connection: ResourceBody, options?: PipelinesRejectConnectionOptionalParams): Promise; + beginUpdate(resourceGroupName: string, pipelineName: string, pipeline: PipelinesPatch, options?: PipelinesUpdateOptionalParams): Promise, PipelinesUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, pipelineName: string, pipeline: PipelinesPatch, options?: PipelinesUpdateOptionalParams): Promise; + get(resourceGroupName: string, pipelineName: string, options?: PipelinesGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: PipelinesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: PipelinesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface PipelinesApproveConnectionHeaders { + location?: string; +} + +// @public +export interface PipelinesApproveConnectionOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PipelinesApproveConnectionResponse = Connection; + +// @public +export interface PipelinesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PipelinesCreateOrUpdateResponse = Pipeline; + +// @public +export interface PipelinesDeleteHeaders { + location?: string; +} + +// @public +export interface PipelinesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PipelinesDeleteResponse = PipelinesDeleteHeaders; + +// @public +export interface PipelinesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PipelinesGetResponse = Pipeline; + +// @public +export interface PipelinesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PipelinesListByResourceGroupNextResponse = PipelinesListResult; + +// @public +export interface PipelinesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PipelinesListByResourceGroupResponse = PipelinesListResult; + +// @public +export interface PipelinesListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PipelinesListBySubscriptionNextResponse = PipelinesListResult; + +// @public +export interface PipelinesListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PipelinesListBySubscriptionResponse = PipelinesListResult; + +// @public +export interface PipelinesListResult { + nextLink?: string; + value?: Pipeline[]; +} + +// @public +export interface PipelinesPatch { + properties?: PipelinesPatchProperties; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface PipelinesPatchProperties { + connections?: PipelineConnection[]; + flowTypes?: FlowType[]; +} + +// @public +export interface PipelinesRejectConnectionHeaders { + location?: string; +} + +// @public +export interface PipelinesRejectConnectionOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PipelinesRejectConnectionResponse = Connection; + +// @public +export interface PipelinesUpdateHeaders { + location?: string; +} + +// @public +export interface PipelinesUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PipelinesUpdateResponse = Pipeline; + +// @public +export interface Plan { + name: string; + product: string; + promotionCode?: string; + publisher: string; + version?: string; +} + +// @public +export type ProvisioningState = string; + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export interface ResourceBody { + id: string; + statusReason?: string; +} + +// @public +export interface Schema { + connectionId?: string; + content?: string; + id?: string; + name?: string; + status?: SchemaStatus; +} + +// @public +export interface SchemasListResult { + value?: Schema[]; +} + +// @public +export type SchemaStatus = string; + +// @public +export interface SelectedResource { + id: string; + location?: string; + name?: string; + subscriptionName?: string; +} + +// @public +export type Status = string; + +// @public (undocumented) +export interface Subscriber { + email?: string; + notifications?: number; +} + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TrackedResource extends Resource { + location: string; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface UserAssignedIdentity { + readonly clientId?: string; + readonly principalId?: string; +} + +// @public +export interface ValidateSchemaResult { + message?: string; + status?: ValidateSchemaStatus; +} + +// @public +export type ValidateSchemaStatus = string; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/sample.env b/sdk/azuredatatransfer/arm-azuredatatransfer/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/src/azuredatatransferrp.ts b/sdk/azuredatatransfer/arm-azuredatatransfer/src/azuredatatransferrp.ts new file mode 100644 index 000000000000..86a435e3eb0c --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/src/azuredatatransferrp.ts @@ -0,0 +1,186 @@ +/* + * 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 coreRestPipeline from "@azure/core-rest-pipeline"; +import { + PipelineRequest, + PipelineResponse, + SendRequest +} from "@azure/core-rest-pipeline"; +import * as coreAuth from "@azure/core-auth"; +import { + AzureDataTransferImpl, + FlowsImpl, + ConnectionsImpl, + ListPendingConnectionsImpl, + ListPendingFlowsImpl, + PipelinesImpl, + ListSchemasImpl, + OperationsImpl +} from "./operations"; +import { + AzureDataTransfer, + Flows, + Connections, + ListPendingConnections, + ListPendingFlows, + Pipelines, + ListSchemas, + Operations +} from "./operationsInterfaces"; +import { AzuredatatransferrpOptionalParams } from "./models"; + +export class Azuredatatransferrp extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId?: string; + + /** + * Initializes a new instance of the Azuredatatransferrp class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: AzuredatatransferrpOptionalParams + ); + constructor( + credentials: coreAuth.TokenCredential, + options?: AzuredatatransferrpOptionalParams + ); + constructor( + credentials: coreAuth.TokenCredential, + subscriptionIdOrOptions?: AzuredatatransferrpOptionalParams | string, + options?: AzuredatatransferrpOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + + let subscriptionId: string | undefined; + + if (typeof subscriptionIdOrOptions === "string") { + subscriptionId = subscriptionIdOrOptions; + } else if (typeof subscriptionIdOrOptions === "object") { + options = subscriptionIdOrOptions; + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: AzuredatatransferrpOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-azuredatatransfer/1.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + endpoint: + options.endpoint ?? options.baseUri ?? "https://management.azure.com" + }; + super(optionsWithDefaults); + + let bearerTokenAuthenticationPolicyFound: boolean = false; + if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + (pipelinePolicy) => + pipelinePolicy.name === + coreRestPipeline.bearerTokenAuthenticationPolicyName + ); + } + if ( + !options || + !options.pipeline || + options.pipeline.getOrderedPolicies().length == 0 || + !bearerTokenAuthenticationPolicyFound + ) { + this.pipeline.removePolicy({ + name: coreRestPipeline.bearerTokenAuthenticationPolicyName + }); + this.pipeline.addPolicy( + coreRestPipeline.bearerTokenAuthenticationPolicy({ + credential: credentials, + scopes: + optionsWithDefaults.credentialScopes ?? + `${optionsWithDefaults.endpoint}/.default`, + challengeCallbacks: { + authorizeRequestOnChallenge: + coreClient.authorizeRequestOnClaimChallenge + } + }) + ); + } + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2023-10-11-preview"; + this.azureDataTransfer = new AzureDataTransferImpl(this); + this.flows = new FlowsImpl(this); + this.connections = new ConnectionsImpl(this); + this.listPendingConnections = new ListPendingConnectionsImpl(this); + this.listPendingFlows = new ListPendingFlowsImpl(this); + this.pipelines = new PipelinesImpl(this); + this.listSchemas = new ListSchemasImpl(this); + this.operations = new OperationsImpl(this); + this.addCustomApiVersionPolicy(options.apiVersion); + } + + /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ + private addCustomApiVersionPolicy(apiVersion?: string) { + if (!apiVersion) { + return; + } + const apiVersionPolicy = { + name: "CustomApiVersionPolicy", + async sendRequest( + request: PipelineRequest, + next: SendRequest + ): Promise { + const param = request.url.split("?"); + if (param.length > 1) { + const newParams = param[1].split("&").map((item) => { + if (item.indexOf("api-version") > -1) { + return "api-version=" + apiVersion; + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + } + }; + this.pipeline.addPolicy(apiVersionPolicy); + } + + azureDataTransfer: AzureDataTransfer; + flows: Flows; + connections: Connections; + listPendingConnections: ListPendingConnections; + listPendingFlows: ListPendingFlows; + pipelines: Pipelines; + listSchemas: ListSchemas; + operations: Operations; +} diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/src/index.ts b/sdk/azuredatatransfer/arm-azuredatatransfer/src/index.ts new file mode 100644 index 000000000000..067e2a8ab3f2 --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/src/index.ts @@ -0,0 +1,13 @@ +/* + * 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 { getContinuationToken } from "./pagingHelper"; +export * from "./models"; +export { Azuredatatransferrp } from "./azuredatatransferrp"; +export * from "./operationsInterfaces"; diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/src/lroImpl.ts b/sdk/azuredatatransfer/arm-azuredatatransfer/src/lroImpl.ts new file mode 100644 index 000000000000..dd803cd5e28c --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/src/lroImpl.ts @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { AbortSignalLike } from "@azure/abort-controller"; +import { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export function createLroSpec(inputs: { + sendOperationFn: (args: any, spec: any) => Promise>; + args: Record; + spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record; +}): LongRunningOperation { + const { args, spec, sendOperationFn } = inputs; + return { + requestMethod: spec.httpMethod, + requestPath: spec.path!, + sendInitialRequest: () => sendOperationFn(args, spec), + sendPollRequest: ( + path: string, + options?: { abortSignal?: AbortSignalLike } + ) => { + const { requestBody, ...restSpec } = spec; + return sendOperationFn(args, { + ...restSpec, + httpMethod: "GET", + path, + abortSignal: options?.abortSignal + }); + } + }; +} diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/src/models/index.ts b/sdk/azuredatatransfer/arm-azuredatatransfer/src/models/index.ts new file mode 100644 index 000000000000..7539df21a415 --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/src/models/index.ts @@ -0,0 +1,1343 @@ +/* + * 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"; + +/** The schema object. */ +export interface Schema { + /** ID associated with this schema */ + id?: string; + /** Connection ID associated with this schema */ + connectionId?: string; + /** Status of the schema */ + status?: SchemaStatus; + /** Name of the schema */ + name?: string; + /** Content of the schema */ + content?: string; +} + +/** Result of the schema validation. */ +export interface ValidateSchemaResult { + /** Validation status of the schema */ + status?: ValidateSchemaStatus; + /** Message describing the schema validation */ + message?: string; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +/** The error detail. */ +export interface ErrorDetail { + /** + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorDetail[]; + /** + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly info?: Record; +} + +export interface ListApprovedSchemasRequest { + /** The name of the pipeline to filter approved schemas. */ + pipeline?: string; + /** The direction pipeline to filter approved schemas. */ + direction?: ListApprovedSchemasDirection; +} + +/** The schemas list result. */ +export interface SchemasListResult { + /** Schemas array. */ + value?: Schema[]; +} + +/** Properties of flow */ +export interface FlowProperties { + /** The connection associated with this flow */ + connection?: SelectedResource; + /** + * Dataflow GUID associated with this flow + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly flowId?: string; + /** AME, PME, or TORUS only! AKV Chain Containing SAS Token */ + keyVaultUri?: string; + /** + * Link status of the current flow + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly linkStatus?: LinkStatusFlow; + /** + * Resource ID of the linked flow + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly linkedFlowId?: string; + /** Status of the current flow */ + status?: FlowStatus; + /** Storage Account */ + storageAccountName?: string; + /** Storage Account ID */ + storageAccountId?: string; + /** Storage Container Name */ + storageContainerName?: string; + /** Service Bus Queue ID */ + serviceBusQueueId?: string; + /** The flow type for this flow */ + flowType?: FlowType; + /** Transfer Storage Blobs or Tables */ + dataType?: DataType; + /** + * Provisioning state of the flow + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** The policies for this flow */ + policies?: string[]; + /** The selected schema for this flow */ + schema?: Schema; +} + +/** A resource selected from ARM */ +export interface SelectedResource { + /** Name of the connection */ + name?: string; + /** Id of the connection */ + id: string; + /** Location of the connection */ + location?: string; + /** Name of the subscription with the connection */ + subscriptionName?: string; +} + +/** Plan for the resource. */ +export interface Plan { + /** A user defined name of the 3rd Party Artifact that is being procured. */ + name: string; + /** The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic */ + publisher: string; + /** The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. */ + product: string; + /** A publisher provided promotion code as provisioned in Data Market for the said product/artifact. */ + promotionCode?: string; + /** The version of the desired product/artifact. */ + version?: string; +} + +/** Managed service identity (system assigned and/or user assigned identities) */ +export interface ManagedServiceIdentity { + /** + * The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ + type: ManagedServiceIdentityType; + /** The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. */ + userAssignedIdentities?: { [propertyName: string]: UserAssignedIdentity }; +} + +/** User assigned identity properties */ +export interface UserAssignedIdentity { + /** + * The principal ID of the assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The client ID of the assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clientId?: string; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** + * Fully qualified resource ID for the resource. E.g. "/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; + /** + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; +} + +/** 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; +} + +/** The flows resource patch definition. */ +export interface FlowsPatch { + /** The managed identity of the flow resource, if configured. */ + identity?: ManagedServiceIdentity; + /** Resource tags */ + tags?: { [propertyName: string]: string }; +} + +/** The resource to reference. */ +export interface ResourceBody { + /** ID of the resource. */ + id: string; + /** Reason for resource operation. */ + statusReason?: string; +} + +/** The flows list result. */ +export interface FlowsListResult { + /** Flows array. */ + value?: Flow[]; + /** Link to next results */ + nextLink?: string; +} + +/** Properties of connection */ +export interface ConnectionProperties { + /** Pipeline to use to transfer data */ + pipeline: string; + /** Direction of data movement */ + direction?: Direction; + /** Justification for the connection request */ + justification?: string; + /** + * Status of the connection + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: Status; + /** + * Reason for status + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly statusReason?: string; + /** + * Link status of the current connection + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly linkStatus?: LinkStatus; + /** + * Resource ID of the linked connection + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly linkedConnectionId?: string; + /** The flow types being requested for this connection */ + flowTypes?: FlowType[]; + /** Requirement ID of the connection */ + requirementId?: string; + /** Subscription ID to link cloud subscriptions together */ + remoteSubscriptionId?: string; + /** + * Approver of this connection request + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly approver?: string; + /** PIN to link requests together */ + pin?: string; + /** + * The timestamp that this connection request was submitted at + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly dateSubmitted?: Date; + /** The primary contact for this connection request */ + primaryContact?: string; + /** The secondary contacts for this connection request */ + secondaryContacts?: string[]; + /** + * Provisioning state of the connection + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** The policies for this connection */ + policies?: string[]; + /** The schemas for this connection */ + schemas?: Schema[]; +} + +/** The connections resource patch definition. */ +export interface ConnectionsPatch { + /** Resource tags */ + tags?: { [propertyName: string]: string }; +} + +/** The connections list result. */ +export interface PendingConnectionsListResult { + /** Connections array. */ + value?: PendingConnection[]; + /** Link to next results */ + nextLink?: string; +} + +/** The connections list result. */ +export interface PendingFlowsListResult { + /** flows array. */ + value?: PendingFlow[]; + /** Link to next results */ + nextLink?: string; +} + +/** The connections list result. */ +export interface ConnectionsListResult { + /** Connections array. */ + value?: Connection[]; + /** Link to next results */ + nextLink?: string; +} + +/** Properties of pipeline */ +export interface PipelineProperties { + /** Remote cloud of the data to be transferred or received */ + remoteCloud: string; + /** Display name of this pipeline */ + displayName?: string; + /** + * Connections associated with pipeline + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly connections?: PipelineConnection[]; + /** Subscribers of this resource */ + subscribers?: Subscriber[]; + /** + * Provisioning state of the pipeline + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** The policies for this pipeline */ + policies?: string[]; + /** The flow types allowed for this pipeline */ + flowTypes?: FlowType[]; +} + +/** Connection body inside a pipeline */ +export interface PipelineConnection { + /** Describes unknown properties. The value of an unknown property can be of "any" type. */ + [property: string]: any; + /** Connection id inside pipeline */ + id: string; + /** + * Connection name inside pipeline + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Connection type inside pipeline + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * Connection location inside pipeline + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly location?: string; + /** + * Connection etag inside pipeline + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly etag?: string; + /** + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** Connection properties inside pipeline */ + properties?: PipelineConnectionProperties; +} + +/** Connection properties inside pipeline */ +export interface PipelineConnectionProperties { + /** Describes unknown properties. The value of an unknown property can be of "any" type. */ + [property: string]: any; + /** Internal metadata of the connection inside pipeline. */ + internalMetadata?: InternalMetadataProperties; +} + +/** Internal metadata of the connection inside pipeline. */ +export interface InternalMetadataProperties { + /** Describes unknown properties. The value of an unknown property can be of "any" type. */ + [property: string]: any; + /** Operation status associated with the last patch request */ + operationStatus?: OperationStatusProperties; + /** + * User that last set the approved status for this connection + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly statusSetBy?: string; +} + +/** Operation status associated with the last patch request */ +export interface OperationStatusProperties { + /** + * Operation status for the last patch request for this connection. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: OperationStatusEnum; + /** + * Operation status ID of the last patch request for this connection. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * Message for the operation for the last patch request for this connection. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; +} + +export interface Subscriber { + /** Email of the subscriber */ + email?: string; + /** Number specifying what notifications to receive */ + notifications?: number; +} + +/** The pipelines resource patch definition. */ +export interface PipelinesPatch { + /** Properties of pipelines patch body. */ + properties?: PipelinesPatchProperties; + /** Resource tags */ + tags?: { [propertyName: string]: string }; +} + +/** Properties of pipelines patch body. */ +export interface PipelinesPatchProperties { + /** Connections associated with pipeline */ + connections?: PipelineConnection[]; + /** The flow types allowed for this pipeline */ + flowTypes?: FlowType[]; +} + +/** The pipelines list result. */ +export interface PipelinesListResult { + /** Pipelines array. */ + value?: Pipeline[]; + /** Link to next results */ + nextLink?: string; +} + +/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ +export interface OperationListResult { + /** + * List of operations supported by the resource provider + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Operation[]; + /** + * URL to get the next set of operation list results (if there are any). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { + /** + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplay; + /** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly origin?: Origin; + /** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly actionType?: ActionType; +} + +/** Localized display information for this particular operation. */ +export interface OperationDisplay { + /** + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provider?: string; + /** + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resource?: string; + /** + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly operation?: string; + /** + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; +} + +/** Pending flow object */ +export interface PendingFlow extends FlowProperties, TrackedResource { + /** + * Subscription ID of the pending flow. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly subscriptionId?: string; + /** + * Connection ID of the pending flow. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly connectionId?: string; +} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResource extends Resource { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +} + +/** Pending connection object */ +export interface PendingConnection + extends ConnectionProperties, + TrackedResource { + /** + * Subscription ID of the pending connection. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly subscriptionId?: string; +} + +/** The flow resource definition. */ +export interface Flow extends TrackedResource { + /** Properties of flow */ + properties?: FlowProperties; + /** Plan for the resource. */ + plan?: Plan; + /** The managed identity of the flow resource, if configured. */ + identity?: ManagedServiceIdentity; +} + +/** The connection resource definition. */ +export interface Connection extends TrackedResource { + /** Properties of connection */ + properties?: ConnectionProperties; +} + +/** The pipeline resource definition. */ +export interface Pipeline extends TrackedResource { + /** Properties of pipeline */ + properties?: PipelineProperties; +} + +/** Defines headers for Flows_delete operation. */ +export interface FlowsDeleteHeaders { + /** Location response header */ + location?: string; +} + +/** Defines headers for Flows_update operation. */ +export interface FlowsUpdateHeaders { + /** Location response header */ + location?: string; +} + +/** Defines headers for Flows_enable operation. */ +export interface FlowsEnableHeaders { + /** Location response header */ + location?: string; +} + +/** Defines headers for Flows_disable operation. */ +export interface FlowsDisableHeaders { + /** Location response header */ + location?: string; +} + +/** Defines headers for Flows_link operation. */ +export interface FlowsLinkHeaders { + /** Location response header */ + location?: string; +} + +/** Defines headers for Connections_delete operation. */ +export interface ConnectionsDeleteHeaders { + /** Location response header */ + location?: string; +} + +/** Defines headers for Connections_update operation. */ +export interface ConnectionsUpdateHeaders { + /** Location response header */ + location?: string; +} + +/** Defines headers for Connections_link operation. */ +export interface ConnectionsLinkHeaders { + /** Location response header */ + location?: string; +} + +/** Defines headers for Pipelines_delete operation. */ +export interface PipelinesDeleteHeaders { + /** Location response header */ + location?: string; +} + +/** Defines headers for Pipelines_update operation. */ +export interface PipelinesUpdateHeaders { + /** Location response header */ + location?: string; +} + +/** Defines headers for Pipelines_approveConnection operation. */ +export interface PipelinesApproveConnectionHeaders { + /** Location response header */ + location?: string; +} + +/** Defines headers for Pipelines_rejectConnection operation. */ +export interface PipelinesRejectConnectionHeaders { + /** Location response header */ + location?: string; +} + +/** Known values of {@link SchemaStatus} that the service accepts. */ +export enum KnownSchemaStatus { + /** New */ + New = "New", + /** Approved */ + Approved = "Approved" +} + +/** + * Defines values for SchemaStatus. \ + * {@link KnownSchemaStatus} can be used interchangeably with SchemaStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **New** \ + * **Approved** + */ +export type SchemaStatus = string; + +/** Known values of {@link ValidateSchemaStatus} that the service accepts. */ +export enum KnownValidateSchemaStatus { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed" +} + +/** + * Defines values for ValidateSchemaStatus. \ + * {@link KnownValidateSchemaStatus} can be used interchangeably with ValidateSchemaStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** + */ +export type ValidateSchemaStatus = string; + +/** Known values of {@link ListApprovedSchemasDirection} that the service accepts. */ +export enum KnownListApprovedSchemasDirection { + /** Send */ + Send = "Send", + /** Receive */ + Receive = "Receive" +} + +/** + * Defines values for ListApprovedSchemasDirection. \ + * {@link KnownListApprovedSchemasDirection} can be used interchangeably with ListApprovedSchemasDirection, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Send** \ + * **Receive** + */ +export type ListApprovedSchemasDirection = string; + +/** Known values of {@link LinkStatusFlow} that the service accepts. */ +export enum KnownLinkStatusFlow { + /** Linked */ + Linked = "Linked", + /** Unlinked */ + Unlinked = "Unlinked" +} + +/** + * Defines values for LinkStatusFlow. \ + * {@link KnownLinkStatusFlow} can be used interchangeably with LinkStatusFlow, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Linked** \ + * **Unlinked** + */ +export type LinkStatusFlow = string; + +/** Known values of {@link FlowStatus} that the service accepts. */ +export enum KnownFlowStatus { + /** Enabled */ + Enabled = "Enabled", + /** Disabled */ + Disabled = "Disabled" +} + +/** + * Defines values for FlowStatus. \ + * {@link KnownFlowStatus} can be used interchangeably with FlowStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** + */ +export type FlowStatus = string; + +/** Known values of {@link FlowType} that the service accepts. */ +export enum KnownFlowType { + /** Unknown */ + Unknown = "Unknown", + /** Complex */ + Complex = "Complex", + /** DevSecOps */ + DevSecOps = "DevSecOps", + /** Messaging */ + Messaging = "Messaging", + /** Mission */ + Mission = "Mission", + /** MicrosoftInternal */ + MicrosoftInternal = "MicrosoftInternal", + /** BasicFiles */ + BasicFiles = "BasicFiles", + /** Data */ + Data = "Data" +} + +/** + * Defines values for FlowType. \ + * {@link KnownFlowType} can be used interchangeably with FlowType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **Complex** \ + * **DevSecOps** \ + * **Messaging** \ + * **Mission** \ + * **MicrosoftInternal** \ + * **BasicFiles** \ + * **Data** + */ +export type FlowType = string; + +/** Known values of {@link DataType} that the service accepts. */ +export enum KnownDataType { + /** Blob */ + Blob = "Blob", + /** Table */ + Table = "Table" +} + +/** + * Defines values for DataType. \ + * {@link KnownDataType} can be used interchangeably with DataType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Blob** \ + * **Table** + */ +export type DataType = string; + +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + /** Failed */ + Failed = "Failed", + /** Succeeded */ + Succeeded = "Succeeded", + /** Canceled */ + Canceled = "Canceled", + /** Accepted */ + Accepted = "Accepted" +} + +/** + * 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 + * **Failed** \ + * **Succeeded** \ + * **Canceled** \ + * **Accepted** + */ +export type ProvisioningState = string; + +/** Known values of {@link ManagedServiceIdentityType} that the service accepts. */ +export enum KnownManagedServiceIdentityType { + /** None */ + None = "None", + /** SystemAssigned */ + SystemAssigned = "SystemAssigned", + /** UserAssigned */ + UserAssigned = "UserAssigned", + /** SystemAssignedUserAssigned */ + SystemAssignedUserAssigned = "SystemAssigned,UserAssigned" +} + +/** + * Defines values for ManagedServiceIdentityType. \ + * {@link KnownManagedServiceIdentityType} can be used interchangeably with ManagedServiceIdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **SystemAssigned** \ + * **UserAssigned** \ + * **SystemAssigned,UserAssigned** + */ +export type ManagedServiceIdentityType = string; + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + /** User */ + User = "User", + /** Application */ + Application = "Application", + /** ManagedIdentity */ + ManagedIdentity = "ManagedIdentity", + /** Key */ + 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 Direction} that the service accepts. */ +export enum KnownDirection { + /** Send */ + Send = "Send", + /** Receive */ + Receive = "Receive" +} + +/** + * Defines values for Direction. \ + * {@link KnownDirection} can be used interchangeably with Direction, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Send** \ + * **Receive** + */ +export type Direction = string; + +/** Known values of {@link Status} that the service accepts. */ +export enum KnownStatus { + /** InReview */ + InReview = "InReview", + /** Approved */ + Approved = "Approved", + /** Rejected */ + Rejected = "Rejected", + /** Accepted */ + Accepted = "Accepted" +} + +/** + * Defines values for Status. \ + * {@link KnownStatus} can be used interchangeably with Status, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **InReview** \ + * **Approved** \ + * **Rejected** \ + * **Accepted** + */ +export type Status = string; + +/** Known values of {@link LinkStatus} that the service accepts. */ +export enum KnownLinkStatus { + /** Linked */ + Linked = "Linked", + /** Unlinked */ + Unlinked = "Unlinked" +} + +/** + * Defines values for LinkStatus. \ + * {@link KnownLinkStatus} can be used interchangeably with LinkStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Linked** \ + * **Unlinked** + */ +export type LinkStatus = string; + +/** Known values of {@link OperationStatusEnum} that the service accepts. */ +export enum KnownOperationStatusEnum { + /** Failed */ + Failed = "Failed", + /** Succeeded */ + Succeeded = "Succeeded" +} + +/** + * Defines values for OperationStatusEnum. \ + * {@link KnownOperationStatusEnum} can be used interchangeably with OperationStatusEnum, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Failed** \ + * **Succeeded** + */ +export type OperationStatusEnum = string; + +/** Known values of {@link Origin} that the service accepts. */ +export enum KnownOrigin { + /** User */ + User = "user", + /** System */ + System = "system", + /** UserSystem */ + UserSystem = "user,system" +} + +/** + * Defines values for Origin. \ + * {@link KnownOrigin} can be used interchangeably with Origin, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user** \ + * **system** \ + * **user,system** + */ +export type Origin = string; + +/** Known values of {@link ActionType} that the service accepts. */ +export enum KnownActionType { + /** Internal */ + Internal = "Internal" +} + +/** + * Defines values for ActionType. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal** + */ +export type ActionType = string; + +/** Optional parameters. */ +export interface AzureDataTransferValidateSchemaOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the validateSchema operation. */ +export type AzureDataTransferValidateSchemaResponse = ValidateSchemaResult; + +/** Optional parameters. */ +export interface AzureDataTransferListApprovedSchemasOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listApprovedSchemas operation. */ +export type AzureDataTransferListApprovedSchemasResponse = SchemasListResult; + +/** Optional parameters. */ +export interface FlowsGetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type FlowsGetResponse = Flow; + +/** Optional parameters. */ +export interface FlowsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type FlowsCreateOrUpdateResponse = Flow; + +/** Optional parameters. */ +export interface FlowsDeleteOptionalParams extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type FlowsDeleteResponse = FlowsDeleteHeaders; + +/** Optional parameters. */ +export interface FlowsUpdateOptionalParams extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type FlowsUpdateResponse = Flow; + +/** Optional parameters. */ +export interface FlowsEnableOptionalParams extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the enable operation. */ +export type FlowsEnableResponse = Flow; + +/** Optional parameters. */ +export interface FlowsDisableOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the disable operation. */ +export type FlowsDisableResponse = Flow; + +/** Optional parameters. */ +export interface FlowsLinkOptionalParams extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the link operation. */ +export type FlowsLinkResponse = Flow; + +/** Optional parameters. */ +export interface FlowsListByConnectionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByConnection operation. */ +export type FlowsListByConnectionResponse = FlowsListResult; + +/** Optional parameters. */ +export interface FlowsListByConnectionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByConnectionNext operation. */ +export type FlowsListByConnectionNextResponse = FlowsListResult; + +/** Optional parameters. */ +export interface ConnectionsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ConnectionsGetResponse = Connection; + +/** Optional parameters. */ +export interface ConnectionsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type ConnectionsCreateOrUpdateResponse = Connection; + +/** Optional parameters. */ +export interface ConnectionsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type ConnectionsDeleteResponse = ConnectionsDeleteHeaders; + +/** Optional parameters. */ +export interface ConnectionsUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type ConnectionsUpdateResponse = Connection; + +/** Optional parameters. */ +export interface ConnectionsLinkOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the link operation. */ +export type ConnectionsLinkResponse = Connection; + +/** Optional parameters. */ +export interface ConnectionsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type ConnectionsListByResourceGroupResponse = ConnectionsListResult; + +/** Optional parameters. */ +export interface ConnectionsListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type ConnectionsListBySubscriptionResponse = ConnectionsListResult; + +/** Optional parameters. */ +export interface ConnectionsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type ConnectionsListByResourceGroupNextResponse = ConnectionsListResult; + +/** Optional parameters. */ +export interface ConnectionsListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type ConnectionsListBySubscriptionNextResponse = ConnectionsListResult; + +/** Optional parameters. */ +export interface ListPendingConnectionsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type ListPendingConnectionsListResponse = PendingConnectionsListResult; + +/** Optional parameters. */ +export interface ListPendingConnectionsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type ListPendingConnectionsListNextResponse = PendingConnectionsListResult; + +/** Optional parameters. */ +export interface ListPendingFlowsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type ListPendingFlowsListResponse = PendingFlowsListResult; + +/** Optional parameters. */ +export interface ListPendingFlowsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type ListPendingFlowsListNextResponse = PendingFlowsListResult; + +/** Optional parameters. */ +export interface PipelinesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type PipelinesGetResponse = Pipeline; + +/** Optional parameters. */ +export interface PipelinesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type PipelinesCreateOrUpdateResponse = Pipeline; + +/** Optional parameters. */ +export interface PipelinesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type PipelinesDeleteResponse = PipelinesDeleteHeaders; + +/** Optional parameters. */ +export interface PipelinesUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type PipelinesUpdateResponse = Pipeline; + +/** Optional parameters. */ +export interface PipelinesApproveConnectionOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the approveConnection operation. */ +export type PipelinesApproveConnectionResponse = Connection; + +/** Optional parameters. */ +export interface PipelinesRejectConnectionOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the rejectConnection operation. */ +export type PipelinesRejectConnectionResponse = Connection; + +/** Optional parameters. */ +export interface PipelinesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type PipelinesListByResourceGroupResponse = PipelinesListResult; + +/** Optional parameters. */ +export interface PipelinesListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type PipelinesListBySubscriptionResponse = PipelinesListResult; + +/** Optional parameters. */ +export interface PipelinesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type PipelinesListByResourceGroupNextResponse = PipelinesListResult; + +/** Optional parameters. */ +export interface PipelinesListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type PipelinesListBySubscriptionNextResponse = PipelinesListResult; + +/** Optional parameters. */ +export interface ListSchemasListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type ListSchemasListResponse = SchemasListResult; + +/** 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 AzuredatatransferrpOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/src/models/mappers.ts b/sdk/azuredatatransfer/arm-azuredatatransfer/src/models/mappers.ts new file mode 100644 index 000000000000..450dbbb0153d --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/src/models/mappers.ts @@ -0,0 +1,1583 @@ +/* + * 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 Schema: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Schema", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + connectionId: { + serializedName: "connectionId", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + }, + content: { + serializedName: "content", + type: { + name: "String" + } + } + } + } +}; + +export const ValidateSchemaResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ValidateSchemaResult", + modelProperties: { + status: { + serializedName: "status", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + } +}; + +export const ErrorDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetail", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + }, + target: { + serializedName: "target", + readOnly: true, + type: { + name: "String" + } + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + } + } + } +}; + +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + info: { + serializedName: "info", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + +export const ListApprovedSchemasRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ListApprovedSchemasRequest", + modelProperties: { + pipeline: { + serializedName: "pipeline", + type: { + name: "String" + } + }, + direction: { + serializedName: "direction", + type: { + name: "String" + } + } + } + } +}; + +export const SchemasListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SchemasListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Schema" + } + } + } + } + } + } +}; + +export const FlowProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FlowProperties", + modelProperties: { + connection: { + serializedName: "connection", + type: { + name: "Composite", + className: "SelectedResource" + } + }, + flowId: { + serializedName: "flowId", + readOnly: true, + type: { + name: "String" + } + }, + keyVaultUri: { + serializedName: "keyVaultUri", + type: { + name: "String" + } + }, + linkStatus: { + serializedName: "linkStatus", + readOnly: true, + type: { + name: "String" + } + }, + linkedFlowId: { + serializedName: "linkedFlowId", + readOnly: true, + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + }, + storageAccountName: { + serializedName: "storageAccountName", + type: { + name: "String" + } + }, + storageAccountId: { + serializedName: "storageAccountId", + type: { + name: "String" + } + }, + storageContainerName: { + serializedName: "storageContainerName", + type: { + name: "String" + } + }, + serviceBusQueueId: { + serializedName: "serviceBusQueueId", + type: { + name: "String" + } + }, + flowType: { + serializedName: "flowType", + type: { + name: "String" + } + }, + dataType: { + serializedName: "dataType", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + policies: { + serializedName: "policies", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + schema: { + serializedName: "schema", + type: { + name: "Composite", + className: "Schema" + } + } + } + } +}; + +export const SelectedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SelectedResource", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + id: { + serializedName: "id", + required: true, + type: { + name: "String" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + subscriptionName: { + serializedName: "subscriptionName", + type: { + name: "String" + } + } + } + } +}; + +export const Plan: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Plan", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + publisher: { + serializedName: "publisher", + required: true, + type: { + name: "String" + } + }, + product: { + serializedName: "product", + required: true, + type: { + name: "String" + } + }, + promotionCode: { + serializedName: "promotionCode", + type: { + name: "String" + } + }, + version: { + serializedName: "version", + type: { + name: "String" + } + } + } + } +}; + +export const ManagedServiceIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedServiceIdentity", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "Uuid" + } + }, + tenantId: { + serializedName: "tenantId", + readOnly: true, + type: { + name: "Uuid" + } + }, + type: { + serializedName: "type", + required: true, + type: { + name: "String" + } + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { name: "Composite", className: "UserAssignedIdentity" } + } + } + } + } + } +}; + +export const UserAssignedIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserAssignedIdentity", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "Uuid" + } + }, + clientId: { + serializedName: "clientId", + readOnly: true, + type: { + name: "Uuid" + } + } + } + } +}; + +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" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +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 FlowsPatch: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FlowsPatch", + modelProperties: { + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedServiceIdentity" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const ResourceBody: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceBody", + modelProperties: { + id: { + serializedName: "id", + required: true, + type: { + name: "String" + } + }, + statusReason: { + serializedName: "statusReason", + type: { + name: "String" + } + } + } + } +}; + +export const FlowsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FlowsListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Flow" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ConnectionProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConnectionProperties", + modelProperties: { + pipeline: { + serializedName: "pipeline", + required: true, + type: { + name: "String" + } + }, + direction: { + serializedName: "direction", + type: { + name: "String" + } + }, + justification: { + serializedName: "justification", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + readOnly: true, + type: { + name: "String" + } + }, + statusReason: { + serializedName: "statusReason", + readOnly: true, + type: { + name: "String" + } + }, + linkStatus: { + serializedName: "linkStatus", + readOnly: true, + type: { + name: "String" + } + }, + linkedConnectionId: { + serializedName: "linkedConnectionId", + readOnly: true, + type: { + name: "String" + } + }, + flowTypes: { + serializedName: "flowTypes", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + requirementId: { + serializedName: "requirementId", + type: { + name: "String" + } + }, + remoteSubscriptionId: { + serializedName: "remoteSubscriptionId", + type: { + name: "String" + } + }, + approver: { + serializedName: "approver", + readOnly: true, + type: { + name: "String" + } + }, + pin: { + serializedName: "pin", + type: { + name: "String" + } + }, + dateSubmitted: { + serializedName: "dateSubmitted", + readOnly: true, + type: { + name: "DateTime" + } + }, + primaryContact: { + serializedName: "primaryContact", + type: { + name: "String" + } + }, + secondaryContacts: { + serializedName: "secondaryContacts", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + policies: { + serializedName: "policies", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + schemas: { + serializedName: "schemas", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Schema" + } + } + } + } + } + } +}; + +export const ConnectionsPatch: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConnectionsPatch", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const PendingConnectionsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PendingConnectionsListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PendingConnection" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const PendingFlowsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PendingFlowsListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PendingFlow" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ConnectionsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConnectionsListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Connection" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const PipelineProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PipelineProperties", + modelProperties: { + remoteCloud: { + serializedName: "remoteCloud", + required: true, + type: { + name: "String" + } + }, + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + }, + connections: { + serializedName: "connections", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PipelineConnection" + } + } + } + }, + subscribers: { + serializedName: "subscribers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Subscriber" + } + } + } + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + policies: { + serializedName: "policies", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + flowTypes: { + serializedName: "flowTypes", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const PipelineConnection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PipelineConnection", + additionalProperties: { type: { name: "Object" } }, + modelProperties: { + id: { + serializedName: "id", + required: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + location: { + serializedName: "location", + readOnly: true, + type: { + name: "String" + } + }, + etag: { + serializedName: "etag", + readOnly: true, + type: { + name: "String" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "PipelineConnectionProperties" + } + } + } + } +}; + +export const PipelineConnectionProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PipelineConnectionProperties", + additionalProperties: { type: { name: "Object" } }, + modelProperties: { + internalMetadata: { + serializedName: "internalMetadata", + type: { + name: "Composite", + className: "InternalMetadataProperties" + } + } + } + } +}; + +export const InternalMetadataProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "InternalMetadataProperties", + additionalProperties: { type: { name: "Object" } }, + modelProperties: { + operationStatus: { + serializedName: "operationStatus", + type: { + name: "Composite", + className: "OperationStatusProperties" + } + }, + statusSetBy: { + serializedName: "statusSetBy", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const OperationStatusProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationStatusProperties", + modelProperties: { + status: { + serializedName: "status", + readOnly: true, + type: { + name: "String" + } + }, + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Subscriber: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Subscriber", + modelProperties: { + email: { + serializedName: "email", + type: { + name: "String" + } + }, + notifications: { + serializedName: "notifications", + type: { + name: "Number" + } + } + } + } +}; + +export const PipelinesPatch: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PipelinesPatch", + modelProperties: { + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "PipelinesPatchProperties" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const PipelinesPatchProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PipelinesPatchProperties", + modelProperties: { + connections: { + serializedName: "connections", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PipelineConnection" + } + } + } + }, + flowTypes: { + serializedName: "flowTypes", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const PipelinesListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PipelinesListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Pipeline" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const OperationListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Operation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + isDataAction: { + serializedName: "isDataAction", + readOnly: true, + type: { + name: "Boolean" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + serializedName: "origin", + readOnly: true, + type: { + name: "String" + } + }, + actionType: { + serializedName: "actionType", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + readOnly: true, + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + readOnly: true, + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + readOnly: 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 PendingFlow: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PendingFlow", + modelProperties: { + ...FlowProperties.type.modelProperties, + ...TrackedResource.type.modelProperties, + subscriptionId: { + serializedName: "subscriptionId", + readOnly: true, + type: { + name: "String" + } + }, + connectionId: { + serializedName: "connectionId", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const PendingConnection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PendingConnection", + modelProperties: { + ...ConnectionProperties.type.modelProperties, + ...TrackedResource.type.modelProperties, + subscriptionId: { + serializedName: "subscriptionId", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Flow: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Flow", + modelProperties: { + ...TrackedResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "FlowProperties" + } + }, + plan: { + serializedName: "plan", + type: { + name: "Composite", + className: "Plan" + } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedServiceIdentity" + } + } + } + } +}; + +export const Connection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Connection", + modelProperties: { + ...TrackedResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "ConnectionProperties" + } + } + } + } +}; + +export const Pipeline: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Pipeline", + modelProperties: { + ...TrackedResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "PipelineProperties" + } + } + } + } +}; + +export const FlowsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FlowsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const FlowsUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FlowsUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const FlowsEnableHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FlowsEnableHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const FlowsDisableHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FlowsDisableHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const FlowsLinkHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FlowsLinkHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ConnectionsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConnectionsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ConnectionsUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConnectionsUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ConnectionsLinkHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConnectionsLinkHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const PipelinesDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PipelinesDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const PipelinesUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PipelinesUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const PipelinesApproveConnectionHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PipelinesApproveConnectionHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const PipelinesRejectConnectionHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PipelinesRejectConnectionHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/src/models/parameters.ts b/sdk/azuredatatransfer/arm-azuredatatransfer/src/models/parameters.ts new file mode 100644 index 000000000000..781afe00fb7c --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/src/models/parameters.ts @@ -0,0 +1,208 @@ +/* + * 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 { + Schema as SchemaMapper, + ListApprovedSchemasRequest as ListApprovedSchemasRequestMapper, + Flow as FlowMapper, + FlowsPatch as FlowsPatchMapper, + ResourceBody as ResourceBodyMapper, + Connection as ConnectionMapper, + ConnectionsPatch as ConnectionsPatchMapper, + Pipeline as PipelineMapper, + PipelinesPatch as PipelinesPatchMapper +} from "../models/mappers"; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" + } + } +}; + +export const schema: OperationParameter = { + parameterPath: "schema", + mapper: SchemaMapper +}; + +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: "2023-10-11-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const pipeline: OperationParameter = { + parameterPath: "pipeline", + mapper: ListApprovedSchemasRequestMapper +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + serializedName: "subscriptionId", + required: true, + type: { + name: "Uuid" + } + } +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + constraints: { + MaxLength: 90, + MinLength: 1 + }, + serializedName: "resourceGroupName", + required: true, + type: { + name: "String" + } + } +}; + +export const connectionName: OperationURLParameter = { + parameterPath: "connectionName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9-]{3,64}$"), + MaxLength: 64, + MinLength: 3 + }, + serializedName: "connectionName", + required: true, + type: { + name: "String" + } + } +}; + +export const flowName: OperationURLParameter = { + parameterPath: "flowName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9-]{3,64}$"), + MaxLength: 64, + MinLength: 3 + }, + serializedName: "flowName", + required: true, + type: { + name: "String" + } + } +}; + +export const flow: OperationParameter = { + parameterPath: "flow", + mapper: FlowMapper +}; + +export const flow1: OperationParameter = { + parameterPath: "flow", + mapper: FlowsPatchMapper +}; + +export const flow2: OperationParameter = { + parameterPath: "flow", + mapper: ResourceBodyMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const connection: OperationParameter = { + parameterPath: "connection", + mapper: ConnectionMapper +}; + +export const connection1: OperationParameter = { + parameterPath: "connection", + mapper: ConnectionsPatchMapper +}; + +export const connection2: OperationParameter = { + parameterPath: "connection", + mapper: ResourceBodyMapper +}; + +export const pipelineName: OperationURLParameter = { + parameterPath: "pipelineName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9-]{3,64}$"), + MaxLength: 64, + MinLength: 3 + }, + serializedName: "pipelineName", + required: true, + type: { + name: "String" + } + } +}; + +export const pipeline1: OperationParameter = { + parameterPath: "pipeline", + mapper: PipelineMapper +}; + +export const pipeline2: OperationParameter = { + parameterPath: "pipeline", + mapper: PipelinesPatchMapper +}; diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/src/operations/azureDataTransfer.ts b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operations/azureDataTransfer.ts new file mode 100644 index 000000000000..20dd477a96a4 --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operations/azureDataTransfer.ts @@ -0,0 +1,103 @@ +/* + * 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 { AzureDataTransfer } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { Azuredatatransferrp } from "../azuredatatransferrp"; +import { + Schema, + AzureDataTransferValidateSchemaOptionalParams, + AzureDataTransferValidateSchemaResponse, + ListApprovedSchemasRequest, + AzureDataTransferListApprovedSchemasOptionalParams, + AzureDataTransferListApprovedSchemasResponse +} from "../models"; + +/** Class containing AzureDataTransfer operations. */ +export class AzureDataTransferImpl implements AzureDataTransfer { + private readonly client: Azuredatatransferrp; + + /** + * Initialize a new instance of the class AzureDataTransfer class. + * @param client Reference to the service client + */ + constructor(client: Azuredatatransferrp) { + this.client = client; + } + + /** + * Validates a schema for Azure Data Transfer. + * @param schema The schema to validate + * @param options The options parameters. + */ + validateSchema( + schema: Schema, + options?: AzureDataTransferValidateSchemaOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { schema, options }, + validateSchemaOperationSpec + ); + } + + /** + * Lists approved schemas for Azure Data Transfer. + * @param pipeline The request to list approved schemas. + * @param options The options parameters. + */ + listApprovedSchemas( + pipeline: ListApprovedSchemasRequest, + options?: AzureDataTransferListApprovedSchemasOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { pipeline, options }, + listApprovedSchemasOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const validateSchemaOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.AzureDataTransfer/validateSchema", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.ValidateSchemaResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.schema, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const listApprovedSchemasOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.AzureDataTransfer/listApprovedSchemas", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.SchemasListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.pipeline, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/src/operations/connections.ts b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operations/connections.ts new file mode 100644 index 000000000000..464360ed0289 --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operations/connections.ts @@ -0,0 +1,869 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Connections } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { Azuredatatransferrp } from "../azuredatatransferrp"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + Connection, + ConnectionsListByResourceGroupNextOptionalParams, + ConnectionsListByResourceGroupOptionalParams, + ConnectionsListByResourceGroupResponse, + ConnectionsListBySubscriptionNextOptionalParams, + ConnectionsListBySubscriptionOptionalParams, + ConnectionsListBySubscriptionResponse, + ConnectionsGetOptionalParams, + ConnectionsGetResponse, + ConnectionsCreateOrUpdateOptionalParams, + ConnectionsCreateOrUpdateResponse, + ConnectionsDeleteOptionalParams, + ConnectionsDeleteResponse, + ConnectionsPatch, + ConnectionsUpdateOptionalParams, + ConnectionsUpdateResponse, + ResourceBody, + ConnectionsLinkOptionalParams, + ConnectionsLinkResponse, + ConnectionsListByResourceGroupNextResponse, + ConnectionsListBySubscriptionNextResponse +} from "../models"; + +/// +/** Class containing Connections operations. */ +export class ConnectionsImpl implements Connections { + private readonly client: Azuredatatransferrp; + + /** + * Initialize a new instance of the class Connections class. + * @param client Reference to the service client + */ + constructor(client: Azuredatatransferrp) { + this.client = client; + } + + /** + * Gets connections in a 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?: ConnectionsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: ConnectionsListByResourceGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: ConnectionsListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: ConnectionsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Gets connections in a subscription. + * @param options The options parameters. + */ + public listBySubscription( + options?: ConnectionsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: ConnectionsListBySubscriptionOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: ConnectionsListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + options?: ConnectionsListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Gets connection resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + connectionName: string, + options?: ConnectionsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, connectionName, options }, + getOperationSpec + ); + } + + /** + * Creates or updates the connection resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param connection Connection body + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + connectionName: string, + connection: Connection, + options?: ConnectionsCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ConnectionsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, connectionName, connection, options }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + ConnectionsCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Creates or updates the connection resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param connection Connection body + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + connectionName: string, + connection: Connection, + options?: ConnectionsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + connectionName, + connection, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes the connection resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + connectionName: string, + options?: ConnectionsDeleteOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ConnectionsDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, connectionName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller< + ConnectionsDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Deletes the connection resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + connectionName: string, + options?: ConnectionsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + connectionName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Updates the connection resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param connection Connection body + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + connectionName: string, + connection: ConnectionsPatch, + options?: ConnectionsUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ConnectionsUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, connectionName, connection, options }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + ConnectionsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Updates the connection resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param connection Connection body + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + connectionName: string, + connection: ConnectionsPatch, + options?: ConnectionsUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + connectionName, + connection, + options + ); + return poller.pollUntilDone(); + } + + /** + * Links the connection to its pending connection. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param connection Connection body + * @param options The options parameters. + */ + async beginLink( + resourceGroupName: string, + connectionName: string, + connection: ResourceBody, + options?: ConnectionsLinkOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ConnectionsLinkResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, connectionName, connection, options }, + spec: linkOperationSpec + }); + const poller = await createHttpPoller< + ConnectionsLinkResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Links the connection to its pending connection. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param connection Connection body + * @param options The options parameters. + */ + async beginLinkAndWait( + resourceGroupName: string, + connectionName: string, + connection: ResourceBody, + options?: ConnectionsLinkOptionalParams + ): Promise { + const poller = await this.beginLink( + resourceGroupName, + connectionName, + connection, + options + ); + return poller.pollUntilDone(); + } + + /** + * Gets connections in a 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?: ConnectionsListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Gets connections in a subscription. + * @param options The options parameters. + */ + private _listBySubscription( + options?: ConnectionsListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * 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?: ConnectionsListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: ConnectionsListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Connection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.connectionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Connection + }, + 201: { + bodyMapper: Mappers.Connection + }, + 202: { + bodyMapper: Mappers.Connection + }, + 204: { + bodyMapper: Mappers.Connection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.connection, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.connectionName + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.ConnectionsDeleteHeaders + }, + 201: { + headersMapper: Mappers.ConnectionsDeleteHeaders + }, + 202: { + headersMapper: Mappers.ConnectionsDeleteHeaders + }, + 204: { + headersMapper: Mappers.ConnectionsDeleteHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.connectionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Connection + }, + 201: { + bodyMapper: Mappers.Connection + }, + 202: { + bodyMapper: Mappers.Connection + }, + 204: { + bodyMapper: Mappers.Connection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.connection1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.connectionName + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const linkOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/link", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.Connection + }, + 201: { + bodyMapper: Mappers.Connection + }, + 202: { + bodyMapper: Mappers.Connection + }, + 204: { + bodyMapper: Mappers.Connection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.connection2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.connectionName + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ConnectionsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.AzureDataTransfer/connections", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ConnectionsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ConnectionsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ConnectionsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/src/operations/flows.ts b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operations/flows.ts new file mode 100644 index 000000000000..772e017e0bd0 --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operations/flows.ts @@ -0,0 +1,1040 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Flows } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { Azuredatatransferrp } from "../azuredatatransferrp"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + Flow, + FlowsListByConnectionNextOptionalParams, + FlowsListByConnectionOptionalParams, + FlowsListByConnectionResponse, + FlowsGetOptionalParams, + FlowsGetResponse, + FlowsCreateOrUpdateOptionalParams, + FlowsCreateOrUpdateResponse, + FlowsDeleteOptionalParams, + FlowsDeleteResponse, + FlowsPatch, + FlowsUpdateOptionalParams, + FlowsUpdateResponse, + FlowsEnableOptionalParams, + FlowsEnableResponse, + FlowsDisableOptionalParams, + FlowsDisableResponse, + ResourceBody, + FlowsLinkOptionalParams, + FlowsLinkResponse, + FlowsListByConnectionNextResponse +} from "../models"; + +/// +/** Class containing Flows operations. */ +export class FlowsImpl implements Flows { + private readonly client: Azuredatatransferrp; + + /** + * Initialize a new instance of the class Flows class. + * @param client Reference to the service client + */ + constructor(client: Azuredatatransferrp) { + this.client = client; + } + + /** + * Gets flows in a connection. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param options The options parameters. + */ + public listByConnection( + resourceGroupName: string, + connectionName: string, + options?: FlowsListByConnectionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByConnectionPagingAll( + resourceGroupName, + connectionName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByConnectionPagingPage( + resourceGroupName, + connectionName, + options, + settings + ); + } + }; + } + + private async *listByConnectionPagingPage( + resourceGroupName: string, + connectionName: string, + options?: FlowsListByConnectionOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: FlowsListByConnectionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByConnection( + resourceGroupName, + connectionName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByConnectionNext( + resourceGroupName, + connectionName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByConnectionPagingAll( + resourceGroupName: string, + connectionName: string, + options?: FlowsListByConnectionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByConnectionPagingPage( + resourceGroupName, + connectionName, + options + )) { + yield* page; + } + } + + /** + * Gets flow resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + connectionName: string, + flowName: string, + options?: FlowsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, connectionName, flowName, options }, + getOperationSpec + ); + } + + /** + * Creates or updates the flow resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param flow Flow body + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + connectionName: string, + flowName: string, + flow: Flow, + options?: FlowsCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + FlowsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, connectionName, flowName, flow, options }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + FlowsCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Creates or updates the flow resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param flow Flow body + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + connectionName: string, + flowName: string, + flow: Flow, + options?: FlowsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + connectionName, + flowName, + flow, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes the flow resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + connectionName: string, + flowName: string, + options?: FlowsDeleteOptionalParams + ): Promise< + SimplePollerLike, FlowsDeleteResponse> + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, connectionName, flowName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller< + FlowsDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Deletes the flow resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + connectionName: string, + flowName: string, + options?: FlowsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + connectionName, + flowName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Updates the flow resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param flow Flow body + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + connectionName: string, + flowName: string, + flow: FlowsPatch, + options?: FlowsUpdateOptionalParams + ): Promise< + SimplePollerLike, FlowsUpdateResponse> + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, connectionName, flowName, flow, options }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + FlowsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Updates the flow resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param flow Flow body + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + connectionName: string, + flowName: string, + flow: FlowsPatch, + options?: FlowsUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + connectionName, + flowName, + flow, + options + ); + return poller.pollUntilDone(); + } + + /** + * Enables the specified flow. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param options The options parameters. + */ + async beginEnable( + resourceGroupName: string, + connectionName: string, + flowName: string, + options?: FlowsEnableOptionalParams + ): Promise< + SimplePollerLike, FlowsEnableResponse> + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, connectionName, flowName, options }, + spec: enableOperationSpec + }); + const poller = await createHttpPoller< + FlowsEnableResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Enables the specified flow. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param options The options parameters. + */ + async beginEnableAndWait( + resourceGroupName: string, + connectionName: string, + flowName: string, + options?: FlowsEnableOptionalParams + ): Promise { + const poller = await this.beginEnable( + resourceGroupName, + connectionName, + flowName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Disables the specified flow + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param options The options parameters. + */ + async beginDisable( + resourceGroupName: string, + connectionName: string, + flowName: string, + options?: FlowsDisableOptionalParams + ): Promise< + SimplePollerLike, FlowsDisableResponse> + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, connectionName, flowName, options }, + spec: disableOperationSpec + }); + const poller = await createHttpPoller< + FlowsDisableResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Disables the specified flow + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param options The options parameters. + */ + async beginDisableAndWait( + resourceGroupName: string, + connectionName: string, + flowName: string, + options?: FlowsDisableOptionalParams + ): Promise { + const poller = await this.beginDisable( + resourceGroupName, + connectionName, + flowName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Links the specified flow. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param flow Flow body + * @param options The options parameters. + */ + async beginLink( + resourceGroupName: string, + connectionName: string, + flowName: string, + flow: ResourceBody, + options?: FlowsLinkOptionalParams + ): Promise< + SimplePollerLike, FlowsLinkResponse> + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, connectionName, flowName, flow, options }, + spec: linkOperationSpec + }); + const poller = await createHttpPoller< + FlowsLinkResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Links the specified flow. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param flow Flow body + * @param options The options parameters. + */ + async beginLinkAndWait( + resourceGroupName: string, + connectionName: string, + flowName: string, + flow: ResourceBody, + options?: FlowsLinkOptionalParams + ): Promise { + const poller = await this.beginLink( + resourceGroupName, + connectionName, + flowName, + flow, + options + ); + return poller.pollUntilDone(); + } + + /** + * Gets flows in a connection. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param options The options parameters. + */ + private _listByConnection( + resourceGroupName: string, + connectionName: string, + options?: FlowsListByConnectionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, connectionName, options }, + listByConnectionOperationSpec + ); + } + + /** + * ListByConnectionNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param nextLink The nextLink from the previous successful call to the ListByConnection method. + * @param options The options parameters. + */ + private _listByConnectionNext( + resourceGroupName: string, + connectionName: string, + nextLink: string, + options?: FlowsListByConnectionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, connectionName, nextLink, options }, + listByConnectionNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Flow + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.connectionName, + Parameters.flowName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Flow + }, + 201: { + bodyMapper: Mappers.Flow + }, + 202: { + bodyMapper: Mappers.Flow + }, + 204: { + bodyMapper: Mappers.Flow + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.flow, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.connectionName, + Parameters.flowName + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.FlowsDeleteHeaders + }, + 201: { + headersMapper: Mappers.FlowsDeleteHeaders + }, + 202: { + headersMapper: Mappers.FlowsDeleteHeaders + }, + 204: { + headersMapper: Mappers.FlowsDeleteHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.connectionName, + Parameters.flowName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Flow + }, + 201: { + bodyMapper: Mappers.Flow + }, + 202: { + bodyMapper: Mappers.Flow + }, + 204: { + bodyMapper: Mappers.Flow + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.flow1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.connectionName, + Parameters.flowName + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const enableOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/enable", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.Flow + }, + 201: { + bodyMapper: Mappers.Flow + }, + 202: { + bodyMapper: Mappers.Flow + }, + 204: { + bodyMapper: Mappers.Flow + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.connectionName, + Parameters.flowName + ], + headerParameters: [Parameters.accept], + serializer +}; +const disableOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/disable", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.Flow + }, + 201: { + bodyMapper: Mappers.Flow + }, + 202: { + bodyMapper: Mappers.Flow + }, + 204: { + bodyMapper: Mappers.Flow + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.connectionName, + Parameters.flowName + ], + headerParameters: [Parameters.accept], + serializer +}; +const linkOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/link", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.Flow + }, + 201: { + bodyMapper: Mappers.Flow + }, + 202: { + bodyMapper: Mappers.Flow + }, + 204: { + bodyMapper: Mappers.Flow + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.flow2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.connectionName, + Parameters.flowName + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const listByConnectionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FlowsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.connectionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByConnectionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FlowsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.connectionName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/src/operations/index.ts b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operations/index.ts new file mode 100644 index 000000000000..39b1c089ae56 --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operations/index.ts @@ -0,0 +1,16 @@ +/* + * 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 "./azureDataTransfer"; +export * from "./flows"; +export * from "./connections"; +export * from "./listPendingConnections"; +export * from "./listPendingFlows"; +export * from "./pipelines"; +export * from "./listSchemas"; +export * from "./operations"; diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/src/operations/listPendingConnections.ts b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operations/listPendingConnections.ts new file mode 100644 index 000000000000..ddee82cc5a60 --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operations/listPendingConnections.ts @@ -0,0 +1,194 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { ListPendingConnections } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { Azuredatatransferrp } from "../azuredatatransferrp"; +import { + PendingConnection, + ListPendingConnectionsListNextOptionalParams, + ListPendingConnectionsListOptionalParams, + ListPendingConnectionsListResponse, + ListPendingConnectionsListNextResponse +} from "../models"; + +/// +/** Class containing ListPendingConnections operations. */ +export class ListPendingConnectionsImpl implements ListPendingConnections { + private readonly client: Azuredatatransferrp; + + /** + * Initialize a new instance of the class ListPendingConnections class. + * @param client Reference to the service client + */ + constructor(client: Azuredatatransferrp) { + this.client = client; + } + + /** + * Lists all pending connections for a connection. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + connectionName: string, + options?: ListPendingConnectionsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, connectionName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + connectionName, + options, + settings + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + connectionName: string, + options?: ListPendingConnectionsListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: ListPendingConnectionsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, connectionName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + connectionName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + connectionName: string, + options?: ListPendingConnectionsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + connectionName, + options + )) { + yield* page; + } + } + + /** + * Lists all pending connections for a connection. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + connectionName: string, + options?: ListPendingConnectionsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, connectionName, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + connectionName: string, + nextLink: string, + options?: ListPendingConnectionsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, connectionName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/listPendingConnections", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PendingConnectionsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.connectionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PendingConnectionsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.connectionName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/src/operations/listPendingFlows.ts b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operations/listPendingFlows.ts new file mode 100644 index 000000000000..9fc4df1e1c2d --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operations/listPendingFlows.ts @@ -0,0 +1,194 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { ListPendingFlows } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { Azuredatatransferrp } from "../azuredatatransferrp"; +import { + PendingFlow, + ListPendingFlowsListNextOptionalParams, + ListPendingFlowsListOptionalParams, + ListPendingFlowsListResponse, + ListPendingFlowsListNextResponse +} from "../models"; + +/// +/** Class containing ListPendingFlows operations. */ +export class ListPendingFlowsImpl implements ListPendingFlows { + private readonly client: Azuredatatransferrp; + + /** + * Initialize a new instance of the class ListPendingFlows class. + * @param client Reference to the service client + */ + constructor(client: Azuredatatransferrp) { + this.client = client; + } + + /** + * Lists all pending flows for a connection. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + connectionName: string, + options?: ListPendingFlowsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, connectionName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + connectionName, + options, + settings + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + connectionName: string, + options?: ListPendingFlowsListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: ListPendingFlowsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, connectionName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + connectionName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + connectionName: string, + options?: ListPendingFlowsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + connectionName, + options + )) { + yield* page; + } + } + + /** + * Lists all pending flows for a connection. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + connectionName: string, + options?: ListPendingFlowsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, connectionName, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + connectionName: string, + nextLink: string, + options?: ListPendingFlowsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, connectionName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/listPendingFlows", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PendingFlowsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.connectionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PendingFlowsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.connectionName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/src/operations/listSchemas.ts b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operations/listSchemas.ts new file mode 100644 index 000000000000..cf0f72f15501 --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operations/listSchemas.ts @@ -0,0 +1,77 @@ +/* + * 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 { ListSchemas } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { Azuredatatransferrp } from "../azuredatatransferrp"; +import { + Schema, + ListSchemasListOptionalParams, + ListSchemasListResponse +} from "../models"; + +/** Class containing ListSchemas operations. */ +export class ListSchemasImpl implements ListSchemas { + private readonly client: Azuredatatransferrp; + + /** + * Initialize a new instance of the class ListSchemas class. + * @param client Reference to the service client + */ + constructor(client: Azuredatatransferrp) { + this.client = client; + } + + /** + * Lists the schemas for the specified connection in a pipeline. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param schema Schema(s) to retrieve + * @param options The options parameters. + */ + list( + resourceGroupName: string, + pipelineName: string, + schema: Schema, + options?: ListSchemasListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, pipelineName, schema, options }, + listOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/listSchemas", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.SchemasListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.schema, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.pipelineName + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/src/operations/operations.ts b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operations/operations.ts new file mode 100644 index 000000000000..31fd708d11e4 --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operations/operations.ts @@ -0,0 +1,149 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { Azuredatatransferrp } from "../azuredatatransferrp"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; + +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: Azuredatatransferrp; + + /** + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client + */ + constructor(client: Azuredatatransferrp) { + this.client = client; + } + + /** + * Lists all of the available Microsoft.AzureDataTransfer REST API 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: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: OperationsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Lists all of the available Microsoft.AzureDataTransfer REST API 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.AzureDataTransfer/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 + } + }, + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/src/operations/pipelines.ts b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operations/pipelines.ts new file mode 100644 index 000000000000..d1fcac72210f --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operations/pipelines.ts @@ -0,0 +1,1000 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Pipelines } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { Azuredatatransferrp } from "../azuredatatransferrp"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + Pipeline, + PipelinesListByResourceGroupNextOptionalParams, + PipelinesListByResourceGroupOptionalParams, + PipelinesListByResourceGroupResponse, + PipelinesListBySubscriptionNextOptionalParams, + PipelinesListBySubscriptionOptionalParams, + PipelinesListBySubscriptionResponse, + PipelinesGetOptionalParams, + PipelinesGetResponse, + PipelinesCreateOrUpdateOptionalParams, + PipelinesCreateOrUpdateResponse, + PipelinesDeleteOptionalParams, + PipelinesDeleteResponse, + PipelinesPatch, + PipelinesUpdateOptionalParams, + PipelinesUpdateResponse, + ResourceBody, + PipelinesApproveConnectionOptionalParams, + PipelinesApproveConnectionResponse, + PipelinesRejectConnectionOptionalParams, + PipelinesRejectConnectionResponse, + PipelinesListByResourceGroupNextResponse, + PipelinesListBySubscriptionNextResponse +} from "../models"; + +/// +/** Class containing Pipelines operations. */ +export class PipelinesImpl implements Pipelines { + private readonly client: Azuredatatransferrp; + + /** + * Initialize a new instance of the class Pipelines class. + * @param client Reference to the service client + */ + constructor(client: Azuredatatransferrp) { + this.client = client; + } + + /** + * Gets pipelines in a 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?: PipelinesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: PipelinesListByResourceGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: PipelinesListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: PipelinesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Gets pipelines in a subscription. + * @param options The options parameters. + */ + public listBySubscription( + options?: PipelinesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: PipelinesListBySubscriptionOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: PipelinesListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + options?: PipelinesListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Gets pipeline resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + pipelineName: string, + options?: PipelinesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, pipelineName, options }, + getOperationSpec + ); + } + + /** + * Creates or updates the pipeline resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param pipeline Pipeline body + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + pipelineName: string, + pipeline: Pipeline, + options?: PipelinesCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + PipelinesCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, pipelineName, pipeline, options }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + PipelinesCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Creates or updates the pipeline resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param pipeline Pipeline body + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + pipelineName: string, + pipeline: Pipeline, + options?: PipelinesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + pipelineName, + pipeline, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes the pipeline resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + pipelineName: string, + options?: PipelinesDeleteOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + PipelinesDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, pipelineName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller< + PipelinesDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Deletes the pipeline resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + pipelineName: string, + options?: PipelinesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + pipelineName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Updates the pipeline resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param pipeline Pipeline body + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + pipelineName: string, + pipeline: PipelinesPatch, + options?: PipelinesUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + PipelinesUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, pipelineName, pipeline, options }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + PipelinesUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Updates the pipeline resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param pipeline Pipeline body + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + pipelineName: string, + pipeline: PipelinesPatch, + options?: PipelinesUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + pipelineName, + pipeline, + options + ); + return poller.pollUntilDone(); + } + + /** + * Approves the specified connection in a pipeline. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param connection Connection body + * @param options The options parameters. + */ + async beginApproveConnection( + resourceGroupName: string, + pipelineName: string, + connection: ResourceBody, + options?: PipelinesApproveConnectionOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + PipelinesApproveConnectionResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, pipelineName, connection, options }, + spec: approveConnectionOperationSpec + }); + const poller = await createHttpPoller< + PipelinesApproveConnectionResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Approves the specified connection in a pipeline. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param connection Connection body + * @param options The options parameters. + */ + async beginApproveConnectionAndWait( + resourceGroupName: string, + pipelineName: string, + connection: ResourceBody, + options?: PipelinesApproveConnectionOptionalParams + ): Promise { + const poller = await this.beginApproveConnection( + resourceGroupName, + pipelineName, + connection, + options + ); + return poller.pollUntilDone(); + } + + /** + * Rejects the specified connection in a pipeline. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param connection Connection body + * @param options The options parameters. + */ + async beginRejectConnection( + resourceGroupName: string, + pipelineName: string, + connection: ResourceBody, + options?: PipelinesRejectConnectionOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + PipelinesRejectConnectionResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, pipelineName, connection, options }, + spec: rejectConnectionOperationSpec + }); + const poller = await createHttpPoller< + PipelinesRejectConnectionResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Rejects the specified connection in a pipeline. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param connection Connection body + * @param options The options parameters. + */ + async beginRejectConnectionAndWait( + resourceGroupName: string, + pipelineName: string, + connection: ResourceBody, + options?: PipelinesRejectConnectionOptionalParams + ): Promise { + const poller = await this.beginRejectConnection( + resourceGroupName, + pipelineName, + connection, + options + ); + return poller.pollUntilDone(); + } + + /** + * Gets pipelines in a 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?: PipelinesListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Gets pipelines in a subscription. + * @param options The options parameters. + */ + private _listBySubscription( + options?: PipelinesListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * 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?: PipelinesListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: PipelinesListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Pipeline + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.pipelineName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Pipeline + }, + 201: { + bodyMapper: Mappers.Pipeline + }, + 202: { + bodyMapper: Mappers.Pipeline + }, + 204: { + bodyMapper: Mappers.Pipeline + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.pipeline1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.pipelineName + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.PipelinesDeleteHeaders + }, + 201: { + headersMapper: Mappers.PipelinesDeleteHeaders + }, + 202: { + headersMapper: Mappers.PipelinesDeleteHeaders + }, + 204: { + headersMapper: Mappers.PipelinesDeleteHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.pipelineName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Pipeline + }, + 201: { + bodyMapper: Mappers.Pipeline + }, + 202: { + bodyMapper: Mappers.Pipeline + }, + 204: { + bodyMapper: Mappers.Pipeline + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.pipeline2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.pipelineName + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const approveConnectionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/approveConnection", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.Connection + }, + 201: { + bodyMapper: Mappers.Connection + }, + 202: { + bodyMapper: Mappers.Connection + }, + 204: { + bodyMapper: Mappers.Connection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.connection2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.pipelineName + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const rejectConnectionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/rejectConnection", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.Connection + }, + 201: { + bodyMapper: Mappers.Connection + }, + 202: { + bodyMapper: Mappers.Connection + }, + 204: { + bodyMapper: Mappers.Connection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.connection2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.pipelineName + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PipelinesListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.AzureDataTransfer/pipelines", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PipelinesListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PipelinesListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PipelinesListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/src/operationsInterfaces/azureDataTransfer.ts b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operationsInterfaces/azureDataTransfer.ts new file mode 100644 index 000000000000..6beeda90a31b --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operationsInterfaces/azureDataTransfer.ts @@ -0,0 +1,38 @@ +/* + * 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 { + Schema, + AzureDataTransferValidateSchemaOptionalParams, + AzureDataTransferValidateSchemaResponse, + ListApprovedSchemasRequest, + AzureDataTransferListApprovedSchemasOptionalParams, + AzureDataTransferListApprovedSchemasResponse +} from "../models"; + +/** Interface representing a AzureDataTransfer. */ +export interface AzureDataTransfer { + /** + * Validates a schema for Azure Data Transfer. + * @param schema The schema to validate + * @param options The options parameters. + */ + validateSchema( + schema: Schema, + options?: AzureDataTransferValidateSchemaOptionalParams + ): Promise; + /** + * Lists approved schemas for Azure Data Transfer. + * @param pipeline The request to list approved schemas. + * @param options The options parameters. + */ + listApprovedSchemas( + pipeline: ListApprovedSchemasRequest, + options?: AzureDataTransferListApprovedSchemasOptionalParams + ): Promise; +} diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/src/operationsInterfaces/connections.ts b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operationsInterfaces/connections.ts new file mode 100644 index 000000000000..d8198a55e400 --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operationsInterfaces/connections.ts @@ -0,0 +1,179 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + Connection, + ConnectionsListByResourceGroupOptionalParams, + ConnectionsListBySubscriptionOptionalParams, + ConnectionsGetOptionalParams, + ConnectionsGetResponse, + ConnectionsCreateOrUpdateOptionalParams, + ConnectionsCreateOrUpdateResponse, + ConnectionsDeleteOptionalParams, + ConnectionsDeleteResponse, + ConnectionsPatch, + ConnectionsUpdateOptionalParams, + ConnectionsUpdateResponse, + ResourceBody, + ConnectionsLinkOptionalParams, + ConnectionsLinkResponse +} from "../models"; + +/// +/** Interface representing a Connections. */ +export interface Connections { + /** + * Gets connections in a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: ConnectionsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets connections in a subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: ConnectionsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets connection resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + connectionName: string, + options?: ConnectionsGetOptionalParams + ): Promise; + /** + * Creates or updates the connection resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param connection Connection body + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + connectionName: string, + connection: Connection, + options?: ConnectionsCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ConnectionsCreateOrUpdateResponse + > + >; + /** + * Creates or updates the connection resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param connection Connection body + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + connectionName: string, + connection: Connection, + options?: ConnectionsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the connection resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + connectionName: string, + options?: ConnectionsDeleteOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ConnectionsDeleteResponse + > + >; + /** + * Deletes the connection resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + connectionName: string, + options?: ConnectionsDeleteOptionalParams + ): Promise; + /** + * Updates the connection resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param connection Connection body + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + connectionName: string, + connection: ConnectionsPatch, + options?: ConnectionsUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ConnectionsUpdateResponse + > + >; + /** + * Updates the connection resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param connection Connection body + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + connectionName: string, + connection: ConnectionsPatch, + options?: ConnectionsUpdateOptionalParams + ): Promise; + /** + * Links the connection to its pending connection. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param connection Connection body + * @param options The options parameters. + */ + beginLink( + resourceGroupName: string, + connectionName: string, + connection: ResourceBody, + options?: ConnectionsLinkOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ConnectionsLinkResponse + > + >; + /** + * Links the connection to its pending connection. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param connection Connection body + * @param options The options parameters. + */ + beginLinkAndWait( + resourceGroupName: string, + connectionName: string, + connection: ResourceBody, + options?: ConnectionsLinkOptionalParams + ): Promise; +} diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/src/operationsInterfaces/flows.ts b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operationsInterfaces/flows.ts new file mode 100644 index 000000000000..16feb4a89570 --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operationsInterfaces/flows.ts @@ -0,0 +1,242 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + Flow, + FlowsListByConnectionOptionalParams, + FlowsGetOptionalParams, + FlowsGetResponse, + FlowsCreateOrUpdateOptionalParams, + FlowsCreateOrUpdateResponse, + FlowsDeleteOptionalParams, + FlowsDeleteResponse, + FlowsPatch, + FlowsUpdateOptionalParams, + FlowsUpdateResponse, + FlowsEnableOptionalParams, + FlowsEnableResponse, + FlowsDisableOptionalParams, + FlowsDisableResponse, + ResourceBody, + FlowsLinkOptionalParams, + FlowsLinkResponse +} from "../models"; + +/// +/** Interface representing a Flows. */ +export interface Flows { + /** + * Gets flows in a connection. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param options The options parameters. + */ + listByConnection( + resourceGroupName: string, + connectionName: string, + options?: FlowsListByConnectionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets flow resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + connectionName: string, + flowName: string, + options?: FlowsGetOptionalParams + ): Promise; + /** + * Creates or updates the flow resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param flow Flow body + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + connectionName: string, + flowName: string, + flow: Flow, + options?: FlowsCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + FlowsCreateOrUpdateResponse + > + >; + /** + * Creates or updates the flow resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param flow Flow body + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + connectionName: string, + flowName: string, + flow: Flow, + options?: FlowsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the flow resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + connectionName: string, + flowName: string, + options?: FlowsDeleteOptionalParams + ): Promise< + SimplePollerLike, FlowsDeleteResponse> + >; + /** + * Deletes the flow resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + connectionName: string, + flowName: string, + options?: FlowsDeleteOptionalParams + ): Promise; + /** + * Updates the flow resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param flow Flow body + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + connectionName: string, + flowName: string, + flow: FlowsPatch, + options?: FlowsUpdateOptionalParams + ): Promise< + SimplePollerLike, FlowsUpdateResponse> + >; + /** + * Updates the flow resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param flow Flow body + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + connectionName: string, + flowName: string, + flow: FlowsPatch, + options?: FlowsUpdateOptionalParams + ): Promise; + /** + * Enables the specified flow. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param options The options parameters. + */ + beginEnable( + resourceGroupName: string, + connectionName: string, + flowName: string, + options?: FlowsEnableOptionalParams + ): Promise< + SimplePollerLike, FlowsEnableResponse> + >; + /** + * Enables the specified flow. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param options The options parameters. + */ + beginEnableAndWait( + resourceGroupName: string, + connectionName: string, + flowName: string, + options?: FlowsEnableOptionalParams + ): Promise; + /** + * Disables the specified flow + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param options The options parameters. + */ + beginDisable( + resourceGroupName: string, + connectionName: string, + flowName: string, + options?: FlowsDisableOptionalParams + ): Promise< + SimplePollerLike, FlowsDisableResponse> + >; + /** + * Disables the specified flow + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param options The options parameters. + */ + beginDisableAndWait( + resourceGroupName: string, + connectionName: string, + flowName: string, + options?: FlowsDisableOptionalParams + ): Promise; + /** + * Links the specified flow. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param flow Flow body + * @param options The options parameters. + */ + beginLink( + resourceGroupName: string, + connectionName: string, + flowName: string, + flow: ResourceBody, + options?: FlowsLinkOptionalParams + ): Promise< + SimplePollerLike, FlowsLinkResponse> + >; + /** + * Links the specified flow. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param flow Flow body + * @param options The options parameters. + */ + beginLinkAndWait( + resourceGroupName: string, + connectionName: string, + flowName: string, + flow: ResourceBody, + options?: FlowsLinkOptionalParams + ): Promise; +} diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/src/operationsInterfaces/index.ts b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..39b1c089ae56 --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operationsInterfaces/index.ts @@ -0,0 +1,16 @@ +/* + * 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 "./azureDataTransfer"; +export * from "./flows"; +export * from "./connections"; +export * from "./listPendingConnections"; +export * from "./listPendingFlows"; +export * from "./pipelines"; +export * from "./listSchemas"; +export * from "./operations"; diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/src/operationsInterfaces/listPendingConnections.ts b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operationsInterfaces/listPendingConnections.ts new file mode 100644 index 000000000000..e23ade6d31e4 --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operationsInterfaces/listPendingConnections.ts @@ -0,0 +1,29 @@ +/* + * 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 { + PendingConnection, + ListPendingConnectionsListOptionalParams +} from "../models"; + +/// +/** Interface representing a ListPendingConnections. */ +export interface ListPendingConnections { + /** + * Lists all pending connections for a connection. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + connectionName: string, + options?: ListPendingConnectionsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/src/operationsInterfaces/listPendingFlows.ts b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operationsInterfaces/listPendingFlows.ts new file mode 100644 index 000000000000..83b5c9ec175e --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operationsInterfaces/listPendingFlows.ts @@ -0,0 +1,26 @@ +/* + * 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 { PendingFlow, ListPendingFlowsListOptionalParams } from "../models"; + +/// +/** Interface representing a ListPendingFlows. */ +export interface ListPendingFlows { + /** + * Lists all pending flows for a connection. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + connectionName: string, + options?: ListPendingFlowsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/src/operationsInterfaces/listSchemas.ts b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operationsInterfaces/listSchemas.ts new file mode 100644 index 000000000000..7e9d60ff4a6d --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operationsInterfaces/listSchemas.ts @@ -0,0 +1,30 @@ +/* + * 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 { + Schema, + ListSchemasListOptionalParams, + ListSchemasListResponse +} from "../models"; + +/** Interface representing a ListSchemas. */ +export interface ListSchemas { + /** + * Lists the schemas for the specified connection in a pipeline. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param schema Schema(s) to retrieve + * @param options The options parameters. + */ + list( + resourceGroupName: string, + pipelineName: string, + schema: Schema, + options?: ListSchemasListOptionalParams + ): Promise; +} diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/src/operationsInterfaces/operations.ts b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..bb2cf89d81f3 --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/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 Microsoft.AzureDataTransfer REST API operations. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/src/operationsInterfaces/pipelines.ts b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operationsInterfaces/pipelines.ts new file mode 100644 index 000000000000..af8511b5ffe2 --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/src/operationsInterfaces/pipelines.ts @@ -0,0 +1,212 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + Pipeline, + PipelinesListByResourceGroupOptionalParams, + PipelinesListBySubscriptionOptionalParams, + PipelinesGetOptionalParams, + PipelinesGetResponse, + PipelinesCreateOrUpdateOptionalParams, + PipelinesCreateOrUpdateResponse, + PipelinesDeleteOptionalParams, + PipelinesDeleteResponse, + PipelinesPatch, + PipelinesUpdateOptionalParams, + PipelinesUpdateResponse, + ResourceBody, + PipelinesApproveConnectionOptionalParams, + PipelinesApproveConnectionResponse, + PipelinesRejectConnectionOptionalParams, + PipelinesRejectConnectionResponse +} from "../models"; + +/// +/** Interface representing a Pipelines. */ +export interface Pipelines { + /** + * Gets pipelines in a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: PipelinesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets pipelines in a subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: PipelinesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets pipeline resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + pipelineName: string, + options?: PipelinesGetOptionalParams + ): Promise; + /** + * Creates or updates the pipeline resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param pipeline Pipeline body + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + pipelineName: string, + pipeline: Pipeline, + options?: PipelinesCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + PipelinesCreateOrUpdateResponse + > + >; + /** + * Creates or updates the pipeline resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param pipeline Pipeline body + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + pipelineName: string, + pipeline: Pipeline, + options?: PipelinesCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the pipeline resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + pipelineName: string, + options?: PipelinesDeleteOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + PipelinesDeleteResponse + > + >; + /** + * Deletes the pipeline resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + pipelineName: string, + options?: PipelinesDeleteOptionalParams + ): Promise; + /** + * Updates the pipeline resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param pipeline Pipeline body + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + pipelineName: string, + pipeline: PipelinesPatch, + options?: PipelinesUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + PipelinesUpdateResponse + > + >; + /** + * Updates the pipeline resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param pipeline Pipeline body + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + pipelineName: string, + pipeline: PipelinesPatch, + options?: PipelinesUpdateOptionalParams + ): Promise; + /** + * Approves the specified connection in a pipeline. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param connection Connection body + * @param options The options parameters. + */ + beginApproveConnection( + resourceGroupName: string, + pipelineName: string, + connection: ResourceBody, + options?: PipelinesApproveConnectionOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + PipelinesApproveConnectionResponse + > + >; + /** + * Approves the specified connection in a pipeline. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param connection Connection body + * @param options The options parameters. + */ + beginApproveConnectionAndWait( + resourceGroupName: string, + pipelineName: string, + connection: ResourceBody, + options?: PipelinesApproveConnectionOptionalParams + ): Promise; + /** + * Rejects the specified connection in a pipeline. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param connection Connection body + * @param options The options parameters. + */ + beginRejectConnection( + resourceGroupName: string, + pipelineName: string, + connection: ResourceBody, + options?: PipelinesRejectConnectionOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + PipelinesRejectConnectionResponse + > + >; + /** + * Rejects the specified connection in a pipeline. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param connection Connection body + * @param options The options parameters. + */ + beginRejectConnectionAndWait( + resourceGroupName: string, + pipelineName: string, + connection: ResourceBody, + options?: PipelinesRejectConnectionOptionalParams + ): Promise; +} diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/src/pagingHelper.ts b/sdk/azuredatatransfer/arm-azuredatatransfer/src/pagingHelper.ts new file mode 100644 index 000000000000..269a2b9814b5 --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/src/pagingHelper.ts @@ -0,0 +1,39 @@ +/* + * 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 interface PageInfo { + continuationToken?: string; +} + +const pageMap = new WeakMap(); + +/** + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from + * that point later. + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. + */ +export function getContinuationToken(page: unknown): string | undefined { + if (typeof page !== "object" || page === null) { + return undefined; + } + return pageMap.get(page)?.continuationToken; +} + +export function setContinuationToken( + page: unknown, + continuationToken: string | undefined +): void { + if (typeof page !== "object" || page === null || !continuationToken) { + return; + } + const pageInfo = pageMap.get(page) ?? {}; + pageInfo.continuationToken = continuationToken; + pageMap.set(page, pageInfo); +} diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/test/sampleTest.ts b/sdk/azuredatatransfer/arm-azuredatatransfer/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/azuredatatransfer/arm-azuredatatransfer/tsconfig.json b/sdk/azuredatatransfer/arm-azuredatatransfer/tsconfig.json new file mode 100644 index 000000000000..3e6ae96443f3 --- /dev/null +++ b/sdk/azuredatatransfer/arm-azuredatatransfer/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/azuredatatransfer/ci.mgmt.yml b/sdk/azuredatatransfer/ci.mgmt.yml new file mode 100644 index 000000000000..ddebffb7f492 --- /dev/null +++ b/sdk/azuredatatransfer/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/azuredatatransfer/arm-azuredatatransfer + - sdk/azuredatatransfer/ci.mgmt.yml + +pr: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/azuredatatransfer/arm-azuredatatransfer + - sdk/azuredatatransfer/ci.mgmt.yml + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: azuredatatransfer + Artifacts: + - name: azure-arm-azuredatatransfer + safeName: azurearmazuredatatransfer + \ No newline at end of file