diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index b40f3bff0b10..0c82e219f416 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -18,6 +18,7 @@ dependencies: '@rush-temp/arm-managedapplications': file:projects/arm-managedapplications.tgz '@rush-temp/arm-network': file:projects/arm-network.tgz '@rush-temp/arm-policy': file:projects/arm-policy.tgz + '@rush-temp/arm-purview': file:projects/arm-purview.tgz '@rush-temp/arm-resources': file:projects/arm-resources.tgz '@rush-temp/arm-resources-subscriptions': file:projects/arm-resources-subscriptions.tgz '@rush-temp/arm-sql': file:projects/arm-sql.tgz @@ -8680,7 +8681,7 @@ packages: dev: false name: '@rush-temp/arm-network' resolution: - integrity: sha512-o4oHKd4XnbxekuGYhx80kd7HT12Up5w76XVV7bmPPkPb2gFNy2WpSLCOdGNmFKqMZPTXTuMRWryoHpd1Y1V2GA== + integrity: sha512-Q7ixqI/vd+XixRZLhqDeyeSBGkpyEW+1n0wphunRHGVUrcwHddiEGB2rdiWFXJaCP47WG/EngiRCqMGGKTr+lg== tarball: file:projects/arm-network.tgz version: 0.0.0 file:projects/arm-policy.tgz: @@ -8703,6 +8704,25 @@ packages: integrity: sha512-1cDd7l+RfNr7rAJxGMqLHW/zYV/F5tRFsA1R6RplSOTGg8yo1foORk8QvIa+oumecW/uYGC/jePfHrx55atGMQ== tarball: file:projects/arm-policy.tgz version: 0.0.0 + file:projects/arm-purview.tgz: + dependencies: + '@microsoft/api-extractor': 7.7.11 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 + mkdirp: 1.0.4 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + tslib: 2.3.1 + typescript: 4.2.4 + uglify-js: 3.14.1 + dev: false + name: '@rush-temp/arm-purview' + resolution: + integrity: sha512-oNNMNU6y5mHqW3Lg2ASVmmohPywUvskEN2oDdwQI+g/cBrpnxoiPRIgSAkPkOzRxWPRXxv7LgQIxl8AaisYCpg== + tarball: file:projects/arm-purview.tgz + version: 0.0.0 file:projects/arm-resources-subscriptions.tgz: dependencies: '@microsoft/api-extractor': 7.7.11 @@ -12684,6 +12704,7 @@ specifiers: '@rush-temp/arm-managedapplications': file:./projects/arm-managedapplications.tgz '@rush-temp/arm-network': file:./projects/arm-network.tgz '@rush-temp/arm-policy': file:./projects/arm-policy.tgz + '@rush-temp/arm-purview': file:./projects/arm-purview.tgz '@rush-temp/arm-resources': file:./projects/arm-resources.tgz '@rush-temp/arm-resources-subscriptions': file:./projects/arm-resources-subscriptions.tgz '@rush-temp/arm-sql': file:./projects/arm-sql.tgz diff --git a/eng/ignore-links.txt b/eng/ignore-links.txt index f19ea8407660..90e33914775b 100644 --- a/eng/ignore-links.txt +++ b/eng/ignore-links.txt @@ -8,7 +8,5 @@ https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storage/storage-blob-cha https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storage/storage-blob-changefeed/samples/typescript https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storage/storage-blob-changefeed/test/ https://github.com/Azure/azure-digital-twins/blob/private-preview/Documentation/how-to-manage-routes.md -https://docs.microsoft.com/javascript/api/@azure/arm-resources-subscriptions -https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources-subscriptions/arm-resources-subscriptions -https://docs.microsoft.com/javascript/api/@azure/arm-templatespecs -https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/templatespecs/arm-templatespecs +https://docs.microsoft.com/javascript/api/@azure/arm-purview +https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/purview/arm-purview diff --git a/rush.json b/rush.json index a65b1a2dfa0b..841c6e45cb25 100644 --- a/rush.json +++ b/rush.json @@ -910,6 +910,11 @@ "packageName": "@azure/arm-eventhub", "projectFolder": "sdk/eventhub/arm-eventhub", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-purview", + "projectFolder": "sdk/purview/arm-purview", + "versionPolicyName": "management" } ] } \ No newline at end of file diff --git a/sdk/purview/arm-purview/CHANGELOG.md b/sdk/purview/arm-purview/CHANGELOG.md new file mode 100644 index 000000000000..68d8df2b3e5f --- /dev/null +++ b/sdk/purview/arm-purview/CHANGELOG.md @@ -0,0 +1,14 @@ +## 1.0.0-beta.1 (2021-09-09) + +This is the first preview for the new version of the `@azure/arm-purview` package that follows the new [guidelines for TypeScript SDKs](https://azure.github.io/azure-sdk/typescript_introduction.html) for Azure services. + +While this package remains auto generated, the SDK generator itself has undergone changes to comply with the above guidelines in order to generate packages that are idiomatic to the JavaScript/TypeScript ecosystem and consistent with other packages for Azure services. For more on this, please see [State of the Azure SDK 2021](https://devblogs.microsoft.com/azure-sdk/state-of-the-azure-sdk-2021/). + +Please note that this version has breaking changes, all of which were made after careful consideration during the authoring of the guidelines and user studies. + +**Noteworthy changes and features** +- Authentication: The packages `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` are no longer supported. Use package [@azure/identity](https://www.npmjs.com/package/@azure/identity) instead. Select a credential from Azure Identity examples based on the authentication method of your choice. +- Callbacks: Method overloads that used callbacks have been removed and the use of promises is encouraged instead. +- List operations now return an iterable result that follows the `PagedAsyncIterableIterator` interface as opposed to the previous model where you had to make a new request using the link to the next page. +- Long running operations i.e. the Lro related object returned by methods whose names started with `begin`, now uses `pollUntilDone` to check whether the request is finished, instead of `pollUntilFinished`. To get the final result, use the corresponding method that will have the suffix `AndWait`. +- The SDK only supports ECMAScript 2015 (ES6) and beyond, all projects that referenced this SDK should be upgraded to use ES6. diff --git a/sdk/purview/arm-purview/LICENSE b/sdk/purview/arm-purview/LICENSE new file mode 100644 index 000000000000..ccb63b166732 --- /dev/null +++ b/sdk/purview/arm-purview/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2021 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/purview/arm-purview/README.md b/sdk/purview/arm-purview/README.md new file mode 100644 index 000000000000..78ac1980d328 --- /dev/null +++ b/sdk/purview/arm-purview/README.md @@ -0,0 +1,93 @@ +# Azure PurviewManagement client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure PurviewManagement client. + +Creates a Microsoft.Purview management client. + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/purview/arm-purview) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-purview) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-purview) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started + +### Currently supported environments + +- [LTS versions of Node.js](https://nodejs.org/about/releases/) +- Latest versions of Safari, Chrome, Edge and Firefox. + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-purview` package + +Install the Azure PurviewManagement client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-purview +``` + +### Create and authenticate a `PurviewManagementClient` + +To create a client object to access the Azure PurviewManagement API, you will need the `endpoint` of your Azure PurviewManagement resource and a `credential`. The Azure PurviewManagement client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure PurviewManagement resource in the [Azure Portal][azure_portal]. + +#### Using an Azure Active Directory Credential + +You can authenticate with Azure Active Directory using the [Azure Identity library][azure_identity]. 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 Azure PurviewManagement** 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 { PurviewManagementClient } = require("@azure/arm-purview"); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new PurviewManagementClient(new DefaultAzureCredential(), subscriptionId); +``` + +## Key concepts + +### PurviewManagementClient + +`PurviewManagementClient` is the primary interface for developers using the Azure PurviewManagement client library. Explore the methods on this client object to understand the different features of the Azure PurviewManagement 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%2Fpurview%2Farm-purview%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/purview/arm-purview/_meta.json b/sdk/purview/arm-purview/_meta.json new file mode 100644 index 000000000000..f1ae9a6bc072 --- /dev/null +++ b/sdk/purview/arm-purview/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "92b58eb71fd5eb2ce5600e9233541074ecabf851", + "readme": "specification/purview/resource-manager/readme.md", + "autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/purview/resource-manager/readme.md --use=@autorest/typescript@6.0.0-beta.12", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "use": "@autorest/typescript@6.0.0-beta.12" +} \ No newline at end of file diff --git a/sdk/purview/arm-purview/api-extractor.json b/sdk/purview/arm-purview/api-extractor.json new file mode 100644 index 000000000000..c7556ba25fda --- /dev/null +++ b/sdk/purview/arm-purview/api-extractor.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/index.d.ts", + "docModel": { "enabled": true }, + "apiReport": { "enabled": true, "reportFolder": "./review" }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-purview.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/purview/arm-purview/package.json b/sdk/purview/arm-purview/package.json new file mode 100644 index 000000000000..ea051c3376a5 --- /dev/null +++ b/sdk/purview/arm-purview/package.json @@ -0,0 +1,88 @@ +{ + "name": "@azure/arm-purview", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", + "description": "A generated SDK for PurviewManagementClient.", + "version": "1.0.0-beta.1", + "engines": { "node": ">=12.0.0" }, + "dependencies": { + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.1.1", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" + }, + "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], + "license": "MIT", + "main": "./dist/index.js", + "module": "./dist-esm/index.js", + "types": "./types/arm-purview.d.ts", + "devDependencies": { + "@microsoft/api-extractor": "7.7.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "mkdirp": "^1.0.4", + "rollup": "^1.16.3", + "rollup-plugin-sourcemaps": "^0.4.2", + "typescript": "~4.2.0", + "uglify-js": "^3.4.9" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/purview/arm-purview", + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, + "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, + "files": [ + "dist/**/*.js", + "dist/**/*.js.map", + "dist/**/*.d.ts", + "dist/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", + "src/**/*.ts", + "README.md", + "LICENSE", + "rollup.config.js", + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" + ], + "scripts": { + "build": "tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "api-extractor run --local", + "lint": "echo skipped", + "audit": "echo skipped", + "clean": "echo skipped", + "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": "echo skipped", + "prebuild": "echo skipped", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "echo skipped", + "unit-test:node": "echo skipped", + "unit-test:browser": "echo skipped", + "integration-test:browser": "echo skipped", + "integration-test:node": "echo skipped", + "integration-test": "echo skipped", + "docs": "echo skipped" + }, + "sideEffects": false, + "autoPublish": true +} diff --git a/sdk/purview/arm-purview/review/arm-purview.api.md b/sdk/purview/arm-purview/review/arm-purview.api.md new file mode 100644 index 000000000000..e9af0d50aefc --- /dev/null +++ b/sdk/purview/arm-purview/review/arm-purview.api.md @@ -0,0 +1,667 @@ +## API Report File for "@azure/arm-purview" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; + +// @public +export interface AccessKeys { + atlasKafkaPrimaryEndpoint?: string; + atlasKafkaSecondaryEndpoint?: string; +} + +// @public +export type Account = TrackedResource & { + sku?: AccountSku; + cloudConnectors?: CloudConnectors; + readonly createdAt?: Date; + readonly createdBy?: string; + readonly createdByObjectId?: string; + readonly endpoints?: AccountPropertiesEndpoints; + readonly friendlyName?: string; + managedResourceGroupName?: string; + readonly managedResources?: AccountPropertiesManagedResources; + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + readonly provisioningState?: ProvisioningState; + publicNetworkAccess?: PublicNetworkAccess; +}; + +// @public +export interface AccountEndpoints { + readonly catalog?: string; + readonly guardian?: string; + readonly scan?: string; +} + +// @public +export interface AccountList { + count?: number; + nextLink?: string; + value: Account[]; +} + +// @public +export interface AccountProperties { + cloudConnectors?: CloudConnectors; + readonly createdAt?: Date; + readonly createdBy?: string; + readonly createdByObjectId?: string; + readonly endpoints?: AccountPropertiesEndpoints; + readonly friendlyName?: string; + managedResourceGroupName?: string; + readonly managedResources?: AccountPropertiesManagedResources; + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + readonly provisioningState?: ProvisioningState; + publicNetworkAccess?: PublicNetworkAccess; +} + +// @public +export type AccountPropertiesEndpoints = AccountEndpoints & {}; + +// @public +export type AccountPropertiesManagedResources = ManagedResources & {}; + +// @public +export interface Accounts { + addRootCollectionAdmin(resourceGroupName: string, accountName: string, collectionAdminUpdate: CollectionAdminUpdate, options?: AccountsAddRootCollectionAdminOptionalParams): Promise; + beginCreateOrUpdate(resourceGroupName: string, accountName: string, account: Account, options?: AccountsCreateOrUpdateOptionalParams): Promise, AccountsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, accountName: string, account: Account, options?: AccountsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, accountName: string, options?: AccountsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, accountName: string, options?: AccountsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, accountName: string, accountUpdateParameters: AccountUpdateParameters, options?: AccountsUpdateOptionalParams): Promise, AccountsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, accountName: string, accountUpdateParameters: AccountUpdateParameters, options?: AccountsUpdateOptionalParams): Promise; + checkNameAvailability(checkNameAvailabilityRequest: CheckNameAvailabilityRequest, options?: AccountsCheckNameAvailabilityOptionalParams): Promise; + get(resourceGroupName: string, accountName: string, options?: AccountsGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: AccountsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: AccountsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + listKeys(resourceGroupName: string, accountName: string, options?: AccountsListKeysOptionalParams): Promise; +} + +// @public +export interface AccountsAddRootCollectionAdminOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface AccountsCheckNameAvailabilityOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccountsCheckNameAvailabilityResponse = CheckNameAvailabilityResult; + +// @public +export interface AccountsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type AccountsCreateOrUpdateResponse = Account; + +// @public +export interface AccountsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface AccountsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccountsGetResponse = Account; + +// @public +export interface AccountSku { + capacity?: number; + name?: Name; +} + +// @public +export interface AccountsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { + skipToken?: string; +} + +// @public +export type AccountsListByResourceGroupNextResponse = AccountList; + +// @public +export interface AccountsListByResourceGroupOptionalParams extends coreClient.OperationOptions { + skipToken?: string; +} + +// @public +export type AccountsListByResourceGroupResponse = AccountList; + +// @public +export interface AccountsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { + skipToken?: string; +} + +// @public +export type AccountsListBySubscriptionNextResponse = AccountList; + +// @public +export interface AccountsListBySubscriptionOptionalParams extends coreClient.OperationOptions { + skipToken?: string; +} + +// @public +export type AccountsListBySubscriptionResponse = AccountList; + +// @public +export interface AccountsListKeysOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccountsListKeysResponse = AccessKeys; + +// @public +export interface AccountsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type AccountsUpdateResponse = Account; + +// @public +export interface AccountUpdateParameters { + properties?: AccountProperties; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface CheckNameAvailabilityRequest { + name?: string; + type?: string; +} + +// @public +export interface CheckNameAvailabilityResult { + message?: string; + nameAvailable?: boolean; + reason?: Reason; +} + +// @public (undocumented) +export interface CloudConnectors { + readonly awsExternalId?: string; +} + +// @public +export interface CollectionAdminUpdate { + objectId?: string; +} + +// @public +export type CreatedByType = string; + +// @public +export interface DefaultAccountPayload { + accountName?: string; + resourceGroupName?: string; + scope?: string; + scopeTenantId?: string; + scopeType?: ScopeType; + subscriptionId?: string; +} + +// @public +export interface DefaultAccounts { + get(scopeTenantId: string, scopeType: ScopeType, options?: DefaultAccountsGetOptionalParams): Promise; + remove(scopeTenantId: string, scopeType: ScopeType, options?: DefaultAccountsRemoveOptionalParams): Promise; + set(defaultAccountPayload: DefaultAccountPayload, options?: DefaultAccountsSetModelOptionalParams): Promise; +} + +// @public +export interface DefaultAccountsGetOptionalParams extends coreClient.OperationOptions { + scope?: string; +} + +// @public +export type DefaultAccountsGetResponse = DefaultAccountPayload; + +// @public +export interface DefaultAccountsRemoveOptionalParams extends coreClient.OperationOptions { + scope?: string; +} + +// @public +export interface DefaultAccountsSetModelOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DefaultAccountsSetModelResponse = DefaultAccountPayload; + +// @public +export interface DimensionProperties { + displayName?: string; + name?: string; + toBeExportedForCustomer?: boolean; +} + +// @public +export interface ErrorModel { + readonly code?: string; + readonly details?: ErrorModel[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponseModel { + readonly error?: ErrorResponseModelError; +} + +// @public +export type ErrorResponseModelError = ErrorModel & {}; + +// @public +export interface Identity { + readonly principalId?: string; + readonly tenantId?: string; + type?: Type; +} + +// @public +export enum KnownCreatedByType { + // (undocumented) + Application = "Application", + // (undocumented) + Key = "Key", + // (undocumented) + ManagedIdentity = "ManagedIdentity", + // (undocumented) + User = "User" +} + +// @public +export enum KnownLastModifiedByType { + // (undocumented) + Application = "Application", + // (undocumented) + Key = "Key", + // (undocumented) + ManagedIdentity = "ManagedIdentity", + // (undocumented) + User = "User" +} + +// @public +export enum KnownName { + // (undocumented) + Standard = "Standard" +} + +// @public +export enum KnownProvisioningState { + // (undocumented) + Canceled = "Canceled", + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Failed = "Failed", + // (undocumented) + Moving = "Moving", + // (undocumented) + SoftDeleted = "SoftDeleted", + // (undocumented) + SoftDeleting = "SoftDeleting", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Unknown = "Unknown" +} + +// @public +export enum KnownPublicNetworkAccess { + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Enabled = "Enabled", + // (undocumented) + NotSpecified = "NotSpecified" +} + +// @public +export enum KnownReason { + // (undocumented) + AlreadyExists = "AlreadyExists", + // (undocumented) + Invalid = "Invalid" +} + +// @public +export enum KnownScopeType { + // (undocumented) + Subscription = "Subscription", + // (undocumented) + Tenant = "Tenant" +} + +// @public +export enum KnownStatus { + // (undocumented) + Approved = "Approved", + // (undocumented) + Disconnected = "Disconnected", + // (undocumented) + Pending = "Pending", + // (undocumented) + Rejected = "Rejected", + // (undocumented) + Unknown = "Unknown" +} + +// @public +export enum KnownType { + // (undocumented) + SystemAssigned = "SystemAssigned" +} + +// @public +export type LastModifiedByType = string; + +// @public +export interface ManagedResources { + readonly eventHubNamespace?: string; + readonly resourceGroup?: string; + readonly storageAccount?: string; +} + +// @public +export type Name = string; + +// @public +export interface Operation { + display?: OperationDisplay; + isDataAction?: boolean; + name?: string; + origin?: string; + serviceSpecification?: OperationMetaServiceSpecification; +} + +// @public +export interface OperationDisplay { + description?: string; + operation?: string; + provider?: string; + resource?: string; +} + +// @public +export interface OperationList { + count?: number; + nextLink?: string; + value: Operation[]; +} + +// @public +export interface OperationMetaLogSpecification { + blobDuration?: string; + displayName?: string; + name?: string; +} + +// @public +export interface OperationMetaMetricSpecification { + aggregationType?: string; + dimensions?: DimensionProperties[]; + displayDescription?: string; + displayName?: string; + enableRegionalMdmAccount?: string; + internalMetricName?: string; + name?: string; + resourceIdDimensionNameOverride?: string; + sourceMdmNamespace?: string; + supportedAggregationTypes?: string[]; + supportedTimeGrainTypes?: string[]; + unit?: string; +} + +// @public +export interface OperationMetaServiceSpecification { + logSpecifications?: OperationMetaLogSpecification[]; + metricSpecifications?: OperationMetaMetricSpecification[]; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationList; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationList; + +// @public +export interface PrivateEndpoint { + id?: string; +} + +// @public +export type PrivateEndpointConnection = ProxyResource & { + privateEndpoint?: PrivateEndpoint; + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; + readonly provisioningState?: string; +}; + +// @public +export interface PrivateEndpointConnectionList { + count?: number; + nextLink?: string; + value: PrivateEndpointConnection[]; +} + +// @public +export interface PrivateEndpointConnections { + beginCreateOrUpdate(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, request: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams): Promise, PrivateEndpointConnectionsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, request: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise; + get(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise; + listByAccount(resourceGroupName: string, accountName: string, options?: PrivateEndpointConnectionsListByAccountOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface PrivateEndpointConnectionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PrivateEndpointConnectionsCreateOrUpdateResponse = PrivateEndpointConnection; + +// @public +export interface PrivateEndpointConnectionsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface PrivateEndpointConnectionsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; + +// @public +export interface PrivateEndpointConnectionsListByAccountNextOptionalParams extends coreClient.OperationOptions { + skipToken?: string; +} + +// @public +export type PrivateEndpointConnectionsListByAccountNextResponse = PrivateEndpointConnectionList; + +// @public +export interface PrivateEndpointConnectionsListByAccountOptionalParams extends coreClient.OperationOptions { + skipToken?: string; +} + +// @public +export type PrivateEndpointConnectionsListByAccountResponse = PrivateEndpointConnectionList; + +// @public +export interface PrivateLinkResource { + readonly id?: string; + readonly name?: string; + readonly properties?: PrivateLinkResourceProperties; + readonly type?: string; +} + +// @public +export interface PrivateLinkResourceList { + count?: number; + nextLink?: string; + value: PrivateLinkResource[]; +} + +// @public +export interface PrivateLinkResourceProperties { + readonly groupId?: string; + readonly requiredMembers?: string[]; + readonly requiredZoneNames?: string[]; +} + +// @public +export interface PrivateLinkResources { + getByGroupId(resourceGroupName: string, accountName: string, groupId: string, options?: PrivateLinkResourcesGetByGroupIdOptionalParams): Promise; + listByAccount(resourceGroupName: string, accountName: string, options?: PrivateLinkResourcesListByAccountOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface PrivateLinkResourcesGetByGroupIdOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkResourcesGetByGroupIdResponse = PrivateLinkResource; + +// @public +export interface PrivateLinkResourcesListByAccountNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkResourcesListByAccountNextResponse = PrivateLinkResourceList; + +// @public +export interface PrivateLinkResourcesListByAccountOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkResourcesListByAccountResponse = PrivateLinkResourceList; + +// @public +export interface PrivateLinkServiceConnectionState { + actionsRequired?: string; + description?: string; + status?: Status; +} + +// @public +export type ProvisioningState = string; + +// @public +export interface ProxyResource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export type PublicNetworkAccess = string; + +// @public (undocumented) +export class PurviewManagementClient extends PurviewManagementClientContext { + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: PurviewManagementClientOptionalParams); + // (undocumented) + accounts: Accounts; + // (undocumented) + defaultAccounts: DefaultAccounts; + // (undocumented) + operations: Operations; + // (undocumented) + privateEndpointConnections: PrivateEndpointConnections; + // (undocumented) + privateLinkResources: PrivateLinkResources; +} + +// @public (undocumented) +export class PurviewManagementClientContext extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: PurviewManagementClientOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface PurviewManagementClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export type Reason = string; + +// @public +export type ScopeType = string; + +// @public +export type Status = string; + +// @public +export interface SystemData { + readonly createdAt?: Date; + readonly createdBy?: string; + readonly createdByType?: CreatedByType; + readonly lastModifiedAt?: Date; + readonly lastModifiedBy?: string; + readonly lastModifiedByType?: LastModifiedByType; +} + +// @public +export interface TrackedResource { + readonly id?: string; + identity?: Identity; + location?: string; + readonly name?: string; + readonly systemData?: TrackedResourceSystemData; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; +} + +// @public +export type TrackedResourceSystemData = SystemData & {}; + +// @public +export type Type = string; + + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/purview/arm-purview/rollup.config.js b/sdk/purview/arm-purview/rollup.config.js new file mode 100644 index 000000000000..9be1955eb7f1 --- /dev/null +++ b/sdk/purview/arm-purview/rollup.config.js @@ -0,0 +1,188 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + +// #region Warning Handler + +/** + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +function ignoreNiseSinonEvalWarnings(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependencyWarnings(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] + }, + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false +}; + +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve(), cjs()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/purview/arm-purview/src/index.ts b/sdk/purview/arm-purview/src/index.ts new file mode 100644 index 000000000000..af03fab28928 --- /dev/null +++ b/sdk/purview/arm-purview/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 * from "./models"; +export { PurviewManagementClient } from "./purviewManagementClient"; +export { PurviewManagementClientContext } from "./purviewManagementClientContext"; +export * from "./operationsInterfaces"; diff --git a/sdk/purview/arm-purview/src/lroImpl.ts b/sdk/purview/arm-purview/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/purview/arm-purview/src/lroImpl.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export class LroImpl implements LongRunningOperation { + constructor( + private sendOperationFn: (args: any, spec: any) => Promise>, + private args: Record, + private spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record, + public requestPath: string = spec.path!, + public requestMethod: string = spec.httpMethod + ) {} + public async sendInitialRequest(): Promise> { + return this.sendOperationFn(this.args, this.spec); + } + public async sendPollRequest(path: string): Promise> { + const { requestBody, ...restSpec } = this.spec; + return this.sendOperationFn(this.args, { + ...restSpec, + path, + httpMethod: "GET" + }); + } +} diff --git a/sdk/purview/arm-purview/src/models/index.ts b/sdk/purview/arm-purview/src/models/index.ts new file mode 100644 index 000000000000..9fad704ca193 --- /dev/null +++ b/sdk/purview/arm-purview/src/models/index.ts @@ -0,0 +1,956 @@ +/* + * 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"; + +/** Paged list of account resources */ +export interface AccountList { + /** Total item count. */ + count?: number; + /** The Url of next result page. */ + nextLink?: string; + /** Collection of items of type results. */ + value: Account[]; +} + +/** Azure ARM Tracked Resource */ +export interface TrackedResource { + /** + * Gets or sets the identifier. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** Identity Info on the tracked resource */ + identity?: Identity; + /** Gets or sets the location. */ + location?: string; + /** + * Gets or sets the name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: 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?: TrackedResourceSystemData; + /** Tags on the azure resource. */ + tags?: { [propertyName: string]: string }; + /** + * Gets or sets the type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; +} + +/** The Managed Identity of the resource */ +export interface Identity { + /** + * Service principal object Id + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * Tenant Id + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** Identity Type */ + type?: Type; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** + * The timestamp of resource creation (UTC). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly createdAt?: Date; + /** + * The identity that created the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly createdBy?: string; + /** + * The type of identity that created the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly createdByType?: CreatedByType; + /** + * The timestamp of the last modification the resource (UTC). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastModifiedAt?: Date; + /** + * The identity that last modified the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastModifiedBy?: string; + /** + * The type of identity that last modified the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastModifiedByType?: LastModifiedByType; +} + +/** The account properties */ +export interface AccountProperties { + /** + * Cloud connectors. + * External cloud identifier used as part of scanning configuration. + */ + cloudConnectors?: CloudConnectors; + /** + * Gets the time at which the entity was created. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly createdAt?: Date; + /** + * Gets the creator of the entity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly createdBy?: string; + /** + * Gets the creators of the entity's object id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly createdByObjectId?: string; + /** + * The URIs that are the public endpoints of the account. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly endpoints?: AccountPropertiesEndpoints; + /** + * Gets or sets the friendly name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly friendlyName?: string; + /** Gets or sets the managed resource group name */ + managedResourceGroupName?: string; + /** + * Gets the resource identifiers of the managed resources. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly managedResources?: AccountPropertiesManagedResources; + /** + * Gets the private endpoint connections information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + /** + * Gets or sets the state of the provisioning. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** Gets or sets the public network access. */ + publicNetworkAccess?: PublicNetworkAccess; +} + +export interface CloudConnectors { + /** + * AWS external identifier. + * Configured in AWS to allow use of the role arn used for scanning + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly awsExternalId?: string; +} + +/** The account endpoints */ +export interface AccountEndpoints { + /** + * Gets the catalog endpoint. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly catalog?: string; + /** + * Gets the guardian endpoint. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly guardian?: string; + /** + * Gets the scan endpoint. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly scan?: string; +} + +/** The managed resources in customer subscription. */ +export interface ManagedResources { + /** + * Gets the managed event hub namespace resource identifier. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly eventHubNamespace?: string; + /** + * Gets the managed resource group resource identifier. This resource group will host resource dependencies for the account. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceGroup?: string; + /** + * Gets the managed storage account resource identifier. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly storageAccount?: string; +} + +/** Proxy Azure Resource */ +export interface ProxyResource { + /** + * Gets or sets the identifier. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * Gets or sets the name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Gets or sets the type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; +} + +/** A private endpoint class. */ +export interface PrivateEndpoint { + /** The private endpoint identifier. */ + id?: string; +} + +/** The private link service connection state. */ +export interface PrivateLinkServiceConnectionState { + /** The required actions. */ + actionsRequired?: string; + /** The description. */ + description?: string; + /** The status. */ + status?: Status; +} + +/** The Sku */ +export interface AccountSku { + /** Gets or sets the sku capacity. Possible values include: 4, 16 */ + capacity?: number; + /** Gets or sets the sku name. */ + name?: Name; +} + +/** Default error response model */ +export interface ErrorResponseModel { + /** + * Gets or sets the error. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly error?: ErrorResponseModelError; +} + +/** Default error model */ +export interface ErrorModel { + /** + * Gets or sets the code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * Gets or sets the details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorModel[]; + /** + * Gets or sets the messages. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * Gets or sets the target. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; +} + +/** The account update properties. */ +export interface AccountUpdateParameters { + /** The account properties. */ + properties?: AccountProperties; + /** Tags on the azure resource. */ + tags?: { [propertyName: string]: string }; +} + +/** The Account access keys. */ +export interface AccessKeys { + /** Gets or sets the primary connection string. */ + atlasKafkaPrimaryEndpoint?: string; + /** Gets or sets the secondary connection string. */ + atlasKafkaSecondaryEndpoint?: string; +} + +/** Collection administrator update. */ +export interface CollectionAdminUpdate { + /** Gets or sets the object identifier of the admin. */ + objectId?: string; +} + +/** Payload to get and set the default account in the given scope */ +export interface DefaultAccountPayload { + /** The name of the account that is set as the default. */ + accountName?: string; + /** The resource group name of the account that is set as the default. */ + resourceGroupName?: string; + /** The scope object ID. For example, sub ID or tenant ID. */ + scope?: string; + /** The scope tenant in which the default account is set. */ + scopeTenantId?: string; + /** The scope where the default account is set. */ + scopeType?: ScopeType; + /** The subscription ID of the account that is set as the default. */ + subscriptionId?: string; +} + +/** Paged list of operation resources */ +export interface OperationList { + /** Total item count. */ + count?: number; + /** The Url of next result page. */ + nextLink?: string; + /** Collection of items of type results. */ + value: Operation[]; +} + +/** Operation resource */ +export interface Operation { + /** Properties on the operation */ + display?: OperationDisplay; + /** Whether operation is a data action */ + isDataAction?: boolean; + /** Operation name for display purposes */ + name?: string; + /** origin of the operation */ + origin?: string; + /** meta service specification */ + serviceSpecification?: OperationMetaServiceSpecification; +} + +/** The response model for get operation properties */ +export interface OperationDisplay { + /** Description of the operation for display purposes */ + description?: string; + /** Name of the operation for display purposes */ + operation?: string; + /** Name of the provider for display purposes */ + provider?: string; + /** Name of the resource type for display purposes */ + resource?: string; +} + +/** The operation meta service specification */ +export interface OperationMetaServiceSpecification { + /** log specifications for the operation */ + logSpecifications?: OperationMetaLogSpecification[]; + /** metric specifications for the operation */ + metricSpecifications?: OperationMetaMetricSpecification[]; +} + +/** log specifications for operation api */ +export interface OperationMetaLogSpecification { + /** blob duration of the log */ + blobDuration?: string; + /** localized name of the log category */ + displayName?: string; + /** name of the log category */ + name?: string; +} + +/** metric specifications for the operation */ +export interface OperationMetaMetricSpecification { + /** aggregation type of metric */ + aggregationType?: string; + /** properties for dimension */ + dimensions?: DimensionProperties[]; + /** description of the metric */ + displayDescription?: string; + /** localized name of the metric */ + displayName?: string; + /** enable regional mdm account */ + enableRegionalMdmAccount?: string; + /** internal metric name */ + internalMetricName?: string; + /** name of the metric */ + name?: string; + /** dimension name use to replace resource id if specified */ + resourceIdDimensionNameOverride?: string; + /** + * Metric namespace. + * Only set the namespace if different from the default value, + * leaving it empty makes it use the value from the ARM manifest. + */ + sourceMdmNamespace?: string; + /** supported aggregation types */ + supportedAggregationTypes?: string[]; + /** supported time grain types */ + supportedTimeGrainTypes?: string[]; + /** units for the metric */ + unit?: string; +} + +/** properties for dimension */ +export interface DimensionProperties { + /** localized display name of the dimension to customer */ + displayName?: string; + /** dimension name */ + name?: string; + /** flag indicating whether this dimension should be included to the customer in Azure Monitor logs (aka Shoebox) */ + toBeExportedForCustomer?: boolean; +} + +/** Paged list of private endpoint connections */ +export interface PrivateEndpointConnectionList { + /** Total item count. */ + count?: number; + /** The Url of next result page. */ + nextLink?: string; + /** Collection of items of type results. */ + value: PrivateEndpointConnection[]; +} + +/** Paged list of private link resources */ +export interface PrivateLinkResourceList { + /** Total item count. */ + count?: number; + /** The Url of next result page. */ + nextLink?: string; + /** Collection of items of type results. */ + value: PrivateLinkResource[]; +} + +/** A privately linkable resource. */ +export interface PrivateLinkResource { + /** + * The private link resource identifier. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The private link resource name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The private link resource properties. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly properties?: PrivateLinkResourceProperties; + /** + * The private link resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; +} + +/** A privately linkable resource properties. */ +export interface PrivateLinkResourceProperties { + /** + * The private link resource group identifier. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly groupId?: string; + /** + * This translates to how many Private IPs should be created for each privately linkable resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly requiredMembers?: string[]; + /** + * The required zone names for private link resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly requiredZoneNames?: string[]; +} + +/** The request payload for CheckNameAvailability API */ +export interface CheckNameAvailabilityRequest { + /** Resource name to verify for availability */ + name?: string; + /** Fully qualified resource type which includes provider namespace */ + type?: string; +} + +/** The response payload for CheckNameAvailability API */ +export interface CheckNameAvailabilityResult { + /** Error message */ + message?: string; + /** Indicates if name is valid and available. */ + nameAvailable?: boolean; + /** The reason the name is not available. */ + reason?: Reason; +} + +/** Account resource */ +export type Account = TrackedResource & { + /** Gets or sets the Sku. */ + sku?: AccountSku; + /** + * Cloud connectors. + * External cloud identifier used as part of scanning configuration. + */ + cloudConnectors?: CloudConnectors; + /** + * Gets the time at which the entity was created. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly createdAt?: Date; + /** + * Gets the creator of the entity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly createdBy?: string; + /** + * Gets the creators of the entity's object id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly createdByObjectId?: string; + /** + * The URIs that are the public endpoints of the account. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly endpoints?: AccountPropertiesEndpoints; + /** + * Gets or sets the friendly name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly friendlyName?: string; + /** Gets or sets the managed resource group name */ + managedResourceGroupName?: string; + /** + * Gets the resource identifiers of the managed resources. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly managedResources?: AccountPropertiesManagedResources; + /** + * Gets the private endpoint connections information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + /** + * Gets or sets the state of the provisioning. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** Gets or sets the public network access. */ + publicNetworkAccess?: PublicNetworkAccess; +}; + +/** Metadata pertaining to creation and last modification of the resource. */ +export type TrackedResourceSystemData = SystemData & {}; + +/** The URIs that are the public endpoints of the account. */ +export type AccountPropertiesEndpoints = AccountEndpoints & {}; + +/** Gets the resource identifiers of the managed resources. */ +export type AccountPropertiesManagedResources = ManagedResources & {}; + +/** A private endpoint connection class. */ +export type PrivateEndpointConnection = ProxyResource & { + /** The private endpoint information. */ + privateEndpoint?: PrivateEndpoint; + /** The private link service connection state. */ + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; + /** + * The provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +}; + +/** Gets or sets the error. */ +export type ErrorResponseModelError = ErrorModel & {}; + +/** Known values of {@link Type} that the service accepts. */ +export enum KnownType { + SystemAssigned = "SystemAssigned" +} + +/** + * Defines values for Type. \ + * {@link KnownType} can be used interchangeably with Type, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **SystemAssigned** + */ +export type Type = string; + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + User = "User", + Application = "Application", + ManagedIdentity = "ManagedIdentity", + Key = "Key" +} + +/** + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** + */ +export type CreatedByType = string; + +/** Known values of {@link LastModifiedByType} that the service accepts. */ +export enum KnownLastModifiedByType { + User = "User", + Application = "Application", + ManagedIdentity = "ManagedIdentity", + Key = "Key" +} + +/** + * Defines values for LastModifiedByType. \ + * {@link KnownLastModifiedByType} can be used interchangeably with LastModifiedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** + */ +export type LastModifiedByType = string; + +/** Known values of {@link Status} that the service accepts. */ +export enum KnownStatus { + Unknown = "Unknown", + Pending = "Pending", + Approved = "Approved", + Rejected = "Rejected", + Disconnected = "Disconnected" +} + +/** + * 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 + * **Unknown** \ + * **Pending** \ + * **Approved** \ + * **Rejected** \ + * **Disconnected** + */ +export type Status = string; + +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + Unknown = "Unknown", + Creating = "Creating", + Moving = "Moving", + Deleting = "Deleting", + SoftDeleting = "SoftDeleting", + SoftDeleted = "SoftDeleted", + Failed = "Failed", + Succeeded = "Succeeded", + Canceled = "Canceled" +} + +/** + * 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 + * **Unknown** \ + * **Creating** \ + * **Moving** \ + * **Deleting** \ + * **SoftDeleting** \ + * **SoftDeleted** \ + * **Failed** \ + * **Succeeded** \ + * **Canceled** + */ +export type ProvisioningState = string; + +/** Known values of {@link PublicNetworkAccess} that the service accepts. */ +export enum KnownPublicNetworkAccess { + NotSpecified = "NotSpecified", + Enabled = "Enabled", + Disabled = "Disabled" +} + +/** + * Defines values for PublicNetworkAccess. \ + * {@link KnownPublicNetworkAccess} can be used interchangeably with PublicNetworkAccess, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NotSpecified** \ + * **Enabled** \ + * **Disabled** + */ +export type PublicNetworkAccess = string; + +/** Known values of {@link Name} that the service accepts. */ +export enum KnownName { + Standard = "Standard" +} + +/** + * Defines values for Name. \ + * {@link KnownName} can be used interchangeably with Name, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Standard** + */ +export type Name = string; + +/** Known values of {@link ScopeType} that the service accepts. */ +export enum KnownScopeType { + Tenant = "Tenant", + Subscription = "Subscription" +} + +/** + * Defines values for ScopeType. \ + * {@link KnownScopeType} can be used interchangeably with ScopeType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Tenant** \ + * **Subscription** + */ +export type ScopeType = string; + +/** Known values of {@link Reason} that the service accepts. */ +export enum KnownReason { + Invalid = "Invalid", + AlreadyExists = "AlreadyExists" +} + +/** + * Defines values for Reason. \ + * {@link KnownReason} can be used interchangeably with Reason, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Invalid** \ + * **AlreadyExists** + */ +export type Reason = string; + +/** Optional parameters. */ +export interface AccountsListByResourceGroupOptionalParams + extends coreClient.OperationOptions { + /** The skip token. */ + skipToken?: string; +} + +/** Contains response data for the listByResourceGroup operation. */ +export type AccountsListByResourceGroupResponse = AccountList; + +/** Optional parameters. */ +export interface AccountsListBySubscriptionOptionalParams + extends coreClient.OperationOptions { + /** The skip token. */ + skipToken?: string; +} + +/** Contains response data for the listBySubscription operation. */ +export type AccountsListBySubscriptionResponse = AccountList; + +/** Optional parameters. */ +export interface AccountsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type AccountsGetResponse = Account; + +/** Optional parameters. */ +export interface AccountsCreateOrUpdateOptionalParams + 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 AccountsCreateOrUpdateResponse = Account; + +/** Optional parameters. */ +export interface AccountsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface AccountsUpdateOptionalParams + 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 AccountsUpdateResponse = Account; + +/** Optional parameters. */ +export interface AccountsListKeysOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listKeys operation. */ +export type AccountsListKeysResponse = AccessKeys; + +/** Optional parameters. */ +export interface AccountsAddRootCollectionAdminOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface AccountsCheckNameAvailabilityOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the checkNameAvailability operation. */ +export type AccountsCheckNameAvailabilityResponse = CheckNameAvailabilityResult; + +/** Optional parameters. */ +export interface AccountsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions { + /** The skip token. */ + skipToken?: string; +} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type AccountsListByResourceGroupNextResponse = AccountList; + +/** Optional parameters. */ +export interface AccountsListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions { + /** The skip token. */ + skipToken?: string; +} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type AccountsListBySubscriptionNextResponse = AccountList; + +/** Optional parameters. */ +export interface DefaultAccountsGetOptionalParams + extends coreClient.OperationOptions { + /** The Id of the scope object, for example if the scope is "Subscription" then it is the ID of that subscription. */ + scope?: string; +} + +/** Contains response data for the get operation. */ +export type DefaultAccountsGetResponse = DefaultAccountPayload; + +/** Optional parameters. */ +export interface DefaultAccountsSetModelOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the set operation. */ +export type DefaultAccountsSetModelResponse = DefaultAccountPayload; + +/** Optional parameters. */ +export interface DefaultAccountsRemoveOptionalParams + extends coreClient.OperationOptions { + /** The Id of the scope object, for example if the scope is "Subscription" then it is the ID of that subscription. */ + scope?: string; +} + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationList; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationList; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsListByAccountOptionalParams + extends coreClient.OperationOptions { + /** The skip token. */ + skipToken?: string; +} + +/** Contains response data for the listByAccount operation. */ +export type PrivateEndpointConnectionsListByAccountResponse = PrivateEndpointConnectionList; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsCreateOrUpdateOptionalParams + 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 PrivateEndpointConnectionsCreateOrUpdateResponse = PrivateEndpointConnection; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsListByAccountNextOptionalParams + extends coreClient.OperationOptions { + /** The skip token. */ + skipToken?: string; +} + +/** Contains response data for the listByAccountNext operation. */ +export type PrivateEndpointConnectionsListByAccountNextResponse = PrivateEndpointConnectionList; + +/** Optional parameters. */ +export interface PrivateLinkResourcesListByAccountOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByAccount operation. */ +export type PrivateLinkResourcesListByAccountResponse = PrivateLinkResourceList; + +/** Optional parameters. */ +export interface PrivateLinkResourcesGetByGroupIdOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getByGroupId operation. */ +export type PrivateLinkResourcesGetByGroupIdResponse = PrivateLinkResource; + +/** Optional parameters. */ +export interface PrivateLinkResourcesListByAccountNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByAccountNext operation. */ +export type PrivateLinkResourcesListByAccountNextResponse = PrivateLinkResourceList; + +/** Optional parameters. */ +export interface PurviewManagementClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/purview/arm-purview/src/models/mappers.ts b/sdk/purview/arm-purview/src/models/mappers.ts new file mode 100644 index 000000000000..144ecff302ca --- /dev/null +++ b/sdk/purview/arm-purview/src/models/mappers.ts @@ -0,0 +1,1258 @@ +/* + * 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 AccountList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountList", + modelProperties: { + count: { + serializedName: "count", + type: { + name: "Number" + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Account" + } + } + } + } + } + } +}; + +export const TrackedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "TrackedResourceSystemData" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Identity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Identity", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "String" + } + }, + tenantId: { + serializedName: "tenantId", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const SystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdAt: { + serializedName: "createdAt", + readOnly: true, + type: { + name: "DateTime" + } + }, + createdBy: { + serializedName: "createdBy", + readOnly: true, + type: { + name: "String" + } + }, + createdByType: { + serializedName: "createdByType", + readOnly: true, + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + readOnly: true, + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + readOnly: true, + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const AccountProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountProperties", + modelProperties: { + cloudConnectors: { + serializedName: "cloudConnectors", + type: { + name: "Composite", + className: "CloudConnectors" + } + }, + createdAt: { + serializedName: "createdAt", + readOnly: true, + type: { + name: "DateTime" + } + }, + createdBy: { + serializedName: "createdBy", + readOnly: true, + type: { + name: "String" + } + }, + createdByObjectId: { + serializedName: "createdByObjectId", + readOnly: true, + type: { + name: "String" + } + }, + endpoints: { + serializedName: "endpoints", + type: { + name: "Composite", + className: "AccountPropertiesEndpoints" + } + }, + friendlyName: { + serializedName: "friendlyName", + readOnly: true, + type: { + name: "String" + } + }, + managedResourceGroupName: { + serializedName: "managedResourceGroupName", + type: { + name: "String" + } + }, + managedResources: { + serializedName: "managedResources", + type: { + name: "Composite", + className: "AccountPropertiesManagedResources" + } + }, + privateEndpointConnections: { + serializedName: "privateEndpointConnections", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } + } + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + publicNetworkAccess: { + defaultValue: "Enabled", + serializedName: "publicNetworkAccess", + type: { + name: "String" + } + } + } + } +}; + +export const CloudConnectors: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudConnectors", + modelProperties: { + awsExternalId: { + serializedName: "awsExternalId", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const AccountEndpoints: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountEndpoints", + modelProperties: { + catalog: { + serializedName: "catalog", + readOnly: true, + type: { + name: "String" + } + }, + guardian: { + serializedName: "guardian", + readOnly: true, + type: { + name: "String" + } + }, + scan: { + serializedName: "scan", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ManagedResources: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedResources", + modelProperties: { + eventHubNamespace: { + serializedName: "eventHubNamespace", + readOnly: true, + type: { + name: "String" + } + }, + resourceGroup: { + serializedName: "resourceGroup", + readOnly: true, + type: { + name: "String" + } + }, + storageAccount: { + serializedName: "storageAccount", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const PrivateEndpoint: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpoint", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionState", + modelProperties: { + actionsRequired: { + serializedName: "actionsRequired", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + } + } + } +}; + +export const AccountSku: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountSku", + modelProperties: { + capacity: { + serializedName: "capacity", + type: { + name: "Number" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const ErrorResponseModel: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponseModel", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorResponseModelError" + } + } + } + } +}; + +export const ErrorModel: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorModel", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorModel" + } + } + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + }, + target: { + serializedName: "target", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const AccountUpdateParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountUpdateParameters", + modelProperties: { + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "AccountProperties" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const AccessKeys: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccessKeys", + modelProperties: { + atlasKafkaPrimaryEndpoint: { + serializedName: "atlasKafkaPrimaryEndpoint", + type: { + name: "String" + } + }, + atlasKafkaSecondaryEndpoint: { + serializedName: "atlasKafkaSecondaryEndpoint", + type: { + name: "String" + } + } + } + } +}; + +export const CollectionAdminUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CollectionAdminUpdate", + modelProperties: { + objectId: { + serializedName: "objectId", + type: { + name: "String" + } + } + } + } +}; + +export const DefaultAccountPayload: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DefaultAccountPayload", + modelProperties: { + accountName: { + serializedName: "accountName", + type: { + name: "String" + } + }, + resourceGroupName: { + serializedName: "resourceGroupName", + type: { + name: "String" + } + }, + scope: { + serializedName: "scope", + type: { + name: "String" + } + }, + scopeTenantId: { + serializedName: "scopeTenantId", + type: { + name: "String" + } + }, + scopeType: { + serializedName: "scopeType", + type: { + name: "String" + } + }, + subscriptionId: { + serializedName: "subscriptionId", + type: { + name: "String" + } + } + } + } +}; + +export const OperationList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationList", + modelProperties: { + count: { + serializedName: "count", + type: { + name: "Number" + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + } + } + } +}; + +export const Operation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Operation", + modelProperties: { + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + isDataAction: { + serializedName: "isDataAction", + type: { + name: "Boolean" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + }, + origin: { + serializedName: "origin", + type: { + name: "String" + } + }, + serviceSpecification: { + serializedName: "properties.serviceSpecification", + type: { + name: "Composite", + className: "OperationMetaServiceSpecification" + } + } + } + } +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + description: { + serializedName: "description", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + }, + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + } + } + } +}; + +export const OperationMetaServiceSpecification: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationMetaServiceSpecification", + modelProperties: { + logSpecifications: { + serializedName: "logSpecifications", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OperationMetaLogSpecification" + } + } + } + }, + metricSpecifications: { + serializedName: "metricSpecifications", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OperationMetaMetricSpecification" + } + } + } + } + } + } +}; + +export const OperationMetaLogSpecification: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationMetaLogSpecification", + modelProperties: { + blobDuration: { + serializedName: "blobDuration", + type: { + name: "String" + } + }, + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const OperationMetaMetricSpecification: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationMetaMetricSpecification", + modelProperties: { + aggregationType: { + serializedName: "aggregationType", + type: { + name: "String" + } + }, + dimensions: { + serializedName: "dimensions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DimensionProperties" + } + } + } + }, + displayDescription: { + serializedName: "displayDescription", + type: { + name: "String" + } + }, + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + }, + enableRegionalMdmAccount: { + serializedName: "enableRegionalMdmAccount", + type: { + name: "String" + } + }, + internalMetricName: { + serializedName: "internalMetricName", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + }, + resourceIdDimensionNameOverride: { + serializedName: "resourceIdDimensionNameOverride", + type: { + name: "String" + } + }, + sourceMdmNamespace: { + serializedName: "sourceMdmNamespace", + type: { + name: "String" + } + }, + supportedAggregationTypes: { + serializedName: "supportedAggregationTypes", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + supportedTimeGrainTypes: { + serializedName: "supportedTimeGrainTypes", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + unit: { + serializedName: "unit", + type: { + name: "String" + } + } + } + } +}; + +export const DimensionProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DimensionProperties", + modelProperties: { + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + }, + toBeExportedForCustomer: { + serializedName: "toBeExportedForCustomer", + type: { + name: "Boolean" + } + } + } + } +}; + +export const PrivateEndpointConnectionList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnectionList", + modelProperties: { + count: { + serializedName: "count", + type: { + name: "Number" + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } + } + } + } + } +}; + +export const PrivateLinkResourceList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkResourceList", + modelProperties: { + count: { + serializedName: "count", + type: { + name: "Number" + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateLinkResource" + } + } + } + } + } + } +}; + +export const PrivateLinkResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkResource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "PrivateLinkResourceProperties" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const PrivateLinkResourceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkResourceProperties", + modelProperties: { + groupId: { + serializedName: "groupId", + readOnly: true, + type: { + name: "String" + } + }, + requiredMembers: { + serializedName: "requiredMembers", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + requiredZoneNames: { + serializedName: "requiredZoneNames", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const CheckNameAvailabilityRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CheckNameAvailabilityRequest", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const CheckNameAvailabilityResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CheckNameAvailabilityResult", + modelProperties: { + message: { + serializedName: "message", + type: { + name: "String" + } + }, + nameAvailable: { + serializedName: "nameAvailable", + type: { + name: "Boolean" + } + }, + reason: { + serializedName: "reason", + type: { + name: "String" + } + } + } + } +}; + +export const Account: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Account", + modelProperties: { + ...TrackedResource.type.modelProperties, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "AccountSku" + } + }, + cloudConnectors: { + serializedName: "properties.cloudConnectors", + type: { + name: "Composite", + className: "CloudConnectors" + } + }, + createdAt: { + serializedName: "properties.createdAt", + readOnly: true, + type: { + name: "DateTime" + } + }, + createdBy: { + serializedName: "properties.createdBy", + readOnly: true, + type: { + name: "String" + } + }, + createdByObjectId: { + serializedName: "properties.createdByObjectId", + readOnly: true, + type: { + name: "String" + } + }, + endpoints: { + serializedName: "properties.endpoints", + type: { + name: "Composite", + className: "AccountPropertiesEndpoints" + } + }, + friendlyName: { + serializedName: "properties.friendlyName", + readOnly: true, + type: { + name: "String" + } + }, + managedResourceGroupName: { + serializedName: "properties.managedResourceGroupName", + type: { + name: "String" + } + }, + managedResources: { + serializedName: "properties.managedResources", + type: { + name: "Composite", + className: "AccountPropertiesManagedResources" + } + }, + privateEndpointConnections: { + serializedName: "properties.privateEndpointConnections", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + publicNetworkAccess: { + defaultValue: "Enabled", + serializedName: "properties.publicNetworkAccess", + type: { + name: "String" + } + } + } + } +}; + +export const TrackedResourceSystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResourceSystemData", + modelProperties: { + ...SystemData.type.modelProperties + } + } +}; + +export const AccountPropertiesEndpoints: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountPropertiesEndpoints", + modelProperties: { + ...AccountEndpoints.type.modelProperties + } + } +}; + +export const AccountPropertiesManagedResources: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountPropertiesManagedResources", + modelProperties: { + ...ManagedResources.type.modelProperties + } + } +}; + +export const PrivateEndpointConnection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnection", + modelProperties: { + ...ProxyResource.type.modelProperties, + privateEndpoint: { + serializedName: "properties.privateEndpoint", + type: { + name: "Composite", + className: "PrivateEndpoint" + } + }, + privateLinkServiceConnectionState: { + serializedName: "properties.privateLinkServiceConnectionState", + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionState" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ErrorResponseModelError: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponseModelError", + modelProperties: { + ...ErrorModel.type.modelProperties + } + } +}; diff --git a/sdk/purview/arm-purview/src/models/parameters.ts b/sdk/purview/arm-purview/src/models/parameters.ts new file mode 100644 index 000000000000..fd3fc9b0531d --- /dev/null +++ b/sdk/purview/arm-purview/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 { + Account as AccountMapper, + AccountUpdateParameters as AccountUpdateParametersMapper, + CollectionAdminUpdate as CollectionAdminUpdateMapper, + CheckNameAvailabilityRequest as CheckNameAvailabilityRequestMapper, + DefaultAccountPayload as DefaultAccountPayloadMapper, + PrivateEndpointConnection as PrivateEndpointConnectionMapper +} from "../models/mappers"; + +export const accept: OperationParameter = { + parameterPath: "accept", + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" + } + } +}; + +export const $host: OperationURLParameter = { + parameterPath: "$host", + mapper: { + serializedName: "$host", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + serializedName: "subscriptionId", + required: true, + type: { + name: "String" + } + } +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + serializedName: "resourceGroupName", + required: true, + type: { + name: "String" + } + } +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2021-07-01", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const skipToken: OperationQueryParameter = { + parameterPath: ["options", "skipToken"], + mapper: { + serializedName: "$skipToken", + type: { + name: "String" + } + } +}; + +export const accountName: OperationURLParameter = { + parameterPath: "accountName", + mapper: { + serializedName: "accountName", + required: true, + type: { + name: "String" + } + } +}; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" + } + } +}; + +export const account: OperationParameter = { + parameterPath: "account", + mapper: AccountMapper +}; + +export const accountUpdateParameters: OperationParameter = { + parameterPath: "accountUpdateParameters", + mapper: AccountUpdateParametersMapper +}; + +export const collectionAdminUpdate: OperationParameter = { + parameterPath: "collectionAdminUpdate", + mapper: CollectionAdminUpdateMapper +}; + +export const checkNameAvailabilityRequest: OperationParameter = { + parameterPath: "checkNameAvailabilityRequest", + mapper: CheckNameAvailabilityRequestMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const scopeTenantId: OperationQueryParameter = { + parameterPath: "scopeTenantId", + mapper: { + serializedName: "scopeTenantId", + required: true, + type: { + name: "Uuid" + } + } +}; + +export const scopeType: OperationQueryParameter = { + parameterPath: "scopeType", + mapper: { + serializedName: "scopeType", + required: true, + type: { + name: "String" + } + } +}; + +export const scope: OperationQueryParameter = { + parameterPath: ["options", "scope"], + mapper: { + serializedName: "scope", + type: { + name: "String" + } + } +}; + +export const defaultAccountPayload: OperationParameter = { + parameterPath: "defaultAccountPayload", + mapper: DefaultAccountPayloadMapper +}; + +export const privateEndpointConnectionName: OperationURLParameter = { + parameterPath: "privateEndpointConnectionName", + mapper: { + serializedName: "privateEndpointConnectionName", + required: true, + type: { + name: "String" + } + } +}; + +export const request: OperationParameter = { + parameterPath: "request", + mapper: PrivateEndpointConnectionMapper +}; + +export const groupId: OperationURLParameter = { + parameterPath: "groupId", + mapper: { + serializedName: "groupId", + required: true, + type: { + name: "String" + } + } +}; diff --git a/sdk/purview/arm-purview/src/operations/accounts.ts b/sdk/purview/arm-purview/src/operations/accounts.ts new file mode 100644 index 000000000000..f6355206d75a --- /dev/null +++ b/sdk/purview/arm-purview/src/operations/accounts.ts @@ -0,0 +1,795 @@ +/* + * 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 "@azure/core-paging"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Accounts } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { PurviewManagementClientContext } from "../purviewManagementClientContext"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + Account, + AccountsListByResourceGroupNextOptionalParams, + AccountsListByResourceGroupOptionalParams, + AccountsListBySubscriptionNextOptionalParams, + AccountsListBySubscriptionOptionalParams, + AccountsListByResourceGroupResponse, + AccountsListBySubscriptionResponse, + AccountsGetOptionalParams, + AccountsGetResponse, + AccountsCreateOrUpdateOptionalParams, + AccountsCreateOrUpdateResponse, + AccountsDeleteOptionalParams, + AccountUpdateParameters, + AccountsUpdateOptionalParams, + AccountsUpdateResponse, + AccountsListKeysOptionalParams, + AccountsListKeysResponse, + CollectionAdminUpdate, + AccountsAddRootCollectionAdminOptionalParams, + CheckNameAvailabilityRequest, + AccountsCheckNameAvailabilityOptionalParams, + AccountsCheckNameAvailabilityResponse, + AccountsListByResourceGroupNextResponse, + AccountsListBySubscriptionNextResponse +} from "../models"; + +/// +/** Class containing Accounts operations. */ +export class AccountsImpl implements Accounts { + private readonly client: PurviewManagementClientContext; + + /** + * Initialize a new instance of the class Accounts class. + * @param client Reference to the service client + */ + constructor(client: PurviewManagementClientContext) { + this.client = client; + } + + /** + * List accounts in ResourceGroup + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: AccountsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: AccountsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: AccountsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * List accounts in Subscription + * @param options The options parameters. + */ + public listBySubscription( + options?: AccountsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: AccountsListBySubscriptionOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscription(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listBySubscriptionPagingAll( + options?: AccountsListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * List accounts in ResourceGroup + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: AccountsListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * List accounts in Subscription + * @param options The options parameters. + */ + private _listBySubscription( + options?: AccountsListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * Get an account + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + options?: AccountsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, options }, + getOperationSpec + ); + } + + /** + * Creates or updates an account + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param account The account. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + accountName: string, + account: Account, + options?: AccountsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + AccountsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, accountName, account, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Creates or updates an account + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param account The account. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + accountName: string, + account: Account, + options?: AccountsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + accountName, + account, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes an account resource + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + accountName: string, + options?: AccountsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, accountName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Deletes an account resource + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + options?: AccountsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + accountName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Updates an account + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param accountUpdateParameters The account update parameters. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + accountName: string, + accountUpdateParameters: AccountUpdateParameters, + options?: AccountsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + AccountsUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, accountName, accountUpdateParameters, options }, + updateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Updates an account + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param accountUpdateParameters The account update parameters. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + accountName: string, + accountUpdateParameters: AccountUpdateParameters, + options?: AccountsUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + accountName, + accountUpdateParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * List the authorization keys associated with this account. + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param options The options parameters. + */ + listKeys( + resourceGroupName: string, + accountName: string, + options?: AccountsListKeysOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, options }, + listKeysOperationSpec + ); + } + + /** + * Add the administrator for root collection associated with this account. + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param collectionAdminUpdate The collection admin update payload. + * @param options The options parameters. + */ + addRootCollectionAdmin( + resourceGroupName: string, + accountName: string, + collectionAdminUpdate: CollectionAdminUpdate, + options?: AccountsAddRootCollectionAdminOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, collectionAdminUpdate, options }, + addRootCollectionAdminOperationSpec + ); + } + + /** + * Checks if account name is available. + * @param checkNameAvailabilityRequest The check name availability request. + * @param options The options parameters. + */ + checkNameAvailability( + checkNameAvailabilityRequest: CheckNameAvailabilityRequest, + options?: AccountsCheckNameAvailabilityOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { checkNameAvailabilityRequest, options }, + checkNameAvailabilityOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The resource group name. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: AccountsListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: AccountsListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccountList + }, + default: { + bodyMapper: Mappers.ErrorResponseModel + } + }, + queryParameters: [Parameters.apiVersion, Parameters.skipToken], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Purview/accounts", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccountList + }, + default: { + bodyMapper: Mappers.ErrorResponseModel + } + }, + queryParameters: [Parameters.apiVersion, Parameters.skipToken], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Account + }, + default: { + bodyMapper: Mappers.ErrorResponseModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Account + }, + 201: { + bodyMapper: Mappers.Account + }, + 202: { + bodyMapper: Mappers.Account + }, + 204: { + bodyMapper: Mappers.Account + }, + default: { + bodyMapper: Mappers.ErrorResponseModel + } + }, + requestBody: Parameters.account, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponseModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Account + }, + 201: { + bodyMapper: Mappers.Account + }, + 202: { + bodyMapper: Mappers.Account + }, + 204: { + bodyMapper: Mappers.Account + }, + default: { + bodyMapper: Mappers.ErrorResponseModel + } + }, + requestBody: Parameters.accountUpdateParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listKeysOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/listkeys", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.AccessKeys + }, + default: { + bodyMapper: Mappers.ErrorResponseModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const addRootCollectionAdminOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/addRootCollectionAdmin", + httpMethod: "POST", + responses: { + 200: {}, + default: { + bodyMapper: Mappers.ErrorResponseModel + } + }, + requestBody: Parameters.collectionAdminUpdate, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Purview/checkNameAvailability", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.CheckNameAvailabilityResult + }, + default: { + bodyMapper: Mappers.ErrorResponseModel + } + }, + requestBody: Parameters.checkNameAvailabilityRequest, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccountList + }, + default: { + bodyMapper: Mappers.ErrorResponseModel + } + }, + queryParameters: [Parameters.apiVersion, Parameters.skipToken], + 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.AccountList + }, + default: { + bodyMapper: Mappers.ErrorResponseModel + } + }, + queryParameters: [Parameters.apiVersion, Parameters.skipToken], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/purview/arm-purview/src/operations/defaultAccounts.ts b/sdk/purview/arm-purview/src/operations/defaultAccounts.ts new file mode 100644 index 000000000000..44c2fae135d5 --- /dev/null +++ b/sdk/purview/arm-purview/src/operations/defaultAccounts.ts @@ -0,0 +1,146 @@ +/* + * 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 { DefaultAccounts } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { PurviewManagementClientContext } from "../purviewManagementClientContext"; +import { + ScopeType, + DefaultAccountsGetOptionalParams, + DefaultAccountsGetResponse, + DefaultAccountPayload, + DefaultAccountsSetModelOptionalParams, + DefaultAccountsSetModelResponse, + DefaultAccountsRemoveOptionalParams +} from "../models"; + +/** Class containing DefaultAccounts operations. */ +export class DefaultAccountsImpl implements DefaultAccounts { + private readonly client: PurviewManagementClientContext; + + /** + * Initialize a new instance of the class DefaultAccounts class. + * @param client Reference to the service client + */ + constructor(client: PurviewManagementClientContext) { + this.client = client; + } + + /** + * Get the default account for the scope. + * @param scopeTenantId The tenant ID. + * @param scopeType The scope for the default account. + * @param options The options parameters. + */ + get( + scopeTenantId: string, + scopeType: ScopeType, + options?: DefaultAccountsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scopeTenantId, scopeType, options }, + getOperationSpec + ); + } + + /** + * Sets the default account for the scope. + * @param defaultAccountPayload The payload containing the default account information and the scope. + * @param options The options parameters. + */ + set( + defaultAccountPayload: DefaultAccountPayload, + options?: DefaultAccountsSetModelOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { defaultAccountPayload, options }, + setOperationSpec + ); + } + + /** + * Removes the default account from the scope. + * @param scopeTenantId The tenant ID. + * @param scopeType The scope for the default account. + * @param options The options parameters. + */ + remove( + scopeTenantId: string, + scopeType: ScopeType, + options?: DefaultAccountsRemoveOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scopeTenantId, scopeType, options }, + removeOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Purview/getDefaultAccount", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DefaultAccountPayload + }, + default: { + bodyMapper: Mappers.ErrorResponseModel + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.scopeTenantId, + Parameters.scopeType, + Parameters.scope + ], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer +}; +const setOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Purview/setDefaultAccount", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.DefaultAccountPayload + }, + default: { + bodyMapper: Mappers.ErrorResponseModel + } + }, + requestBody: Parameters.defaultAccountPayload, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const removeOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Purview/removeDefaultAccount", + httpMethod: "POST", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponseModel + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.scopeTenantId, + Parameters.scopeType, + Parameters.scope + ], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/purview/arm-purview/src/operations/index.ts b/sdk/purview/arm-purview/src/operations/index.ts new file mode 100644 index 000000000000..a8c4893c803d --- /dev/null +++ b/sdk/purview/arm-purview/src/operations/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 * from "./accounts"; +export * from "./defaultAccounts"; +export * from "./operations"; +export * from "./privateEndpointConnections"; +export * from "./privateLinkResources"; diff --git a/sdk/purview/arm-purview/src/operations/operations.ts b/sdk/purview/arm-purview/src/operations/operations.ts new file mode 100644 index 000000000000..1b39b77e8531 --- /dev/null +++ b/sdk/purview/arm-purview/src/operations/operations.ts @@ -0,0 +1,138 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import "@azure/core-paging"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { PurviewManagementClientContext } from "../purviewManagementClientContext"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; + +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: PurviewManagementClientContext; + + /** + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client + */ + constructor(client: PurviewManagementClientContext) { + this.client = client; + } + + /** + * List of available operations + * @param options The options parameters. + */ + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * List of available 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.Purview/operations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationList + }, + default: { + bodyMapper: Mappers.ErrorResponseModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationList + }, + default: { + bodyMapper: Mappers.ErrorResponseModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/purview/arm-purview/src/operations/privateEndpointConnections.ts b/sdk/purview/arm-purview/src/operations/privateEndpointConnections.ts new file mode 100644 index 000000000000..ac257bc5994c --- /dev/null +++ b/sdk/purview/arm-purview/src/operations/privateEndpointConnections.ts @@ -0,0 +1,494 @@ +/* + * 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 "@azure/core-paging"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PrivateEndpointConnections } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { PurviewManagementClientContext } from "../purviewManagementClientContext"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + PrivateEndpointConnection, + PrivateEndpointConnectionsListByAccountNextOptionalParams, + PrivateEndpointConnectionsListByAccountOptionalParams, + PrivateEndpointConnectionsListByAccountResponse, + PrivateEndpointConnectionsGetOptionalParams, + PrivateEndpointConnectionsGetResponse, + PrivateEndpointConnectionsCreateOrUpdateOptionalParams, + PrivateEndpointConnectionsCreateOrUpdateResponse, + PrivateEndpointConnectionsDeleteOptionalParams, + PrivateEndpointConnectionsListByAccountNextResponse +} from "../models"; + +/// +/** Class containing PrivateEndpointConnections operations. */ +export class PrivateEndpointConnectionsImpl + implements PrivateEndpointConnections { + private readonly client: PurviewManagementClientContext; + + /** + * Initialize a new instance of the class PrivateEndpointConnections class. + * @param client Reference to the service client + */ + constructor(client: PurviewManagementClientContext) { + this.client = client; + } + + /** + * Get private endpoint connections for account + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param options The options parameters. + */ + public listByAccount( + resourceGroupName: string, + accountName: string, + options?: PrivateEndpointConnectionsListByAccountOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByAccountPagingAll( + resourceGroupName, + accountName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByAccountPagingPage( + resourceGroupName, + accountName, + options + ); + } + }; + } + + private async *listByAccountPagingPage( + resourceGroupName: string, + accountName: string, + options?: PrivateEndpointConnectionsListByAccountOptionalParams + ): AsyncIterableIterator { + let result = await this._listByAccount( + resourceGroupName, + accountName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByAccountNext( + resourceGroupName, + accountName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByAccountPagingAll( + resourceGroupName: string, + accountName: string, + options?: PrivateEndpointConnectionsListByAccountOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByAccountPagingPage( + resourceGroupName, + accountName, + options + )) { + yield* page; + } + } + + /** + * Get private endpoint connections for account + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param options The options parameters. + */ + private _listByAccount( + resourceGroupName: string, + accountName: string, + options?: PrivateEndpointConnectionsListByAccountOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, options }, + listByAccountOperationSpec + ); + } + + /** + * Get a private endpoint connection + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param privateEndpointConnectionName Name of the private endpoint connection. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + privateEndpointConnectionName, + options + }, + getOperationSpec + ); + } + + /** + * Create or update a private endpoint connection + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param privateEndpointConnectionName Name of the private endpoint connection. + * @param request The request. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + request: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PrivateEndpointConnectionsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + resourceGroupName, + accountName, + privateEndpointConnectionName, + request, + options + }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Create or update a private endpoint connection + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param privateEndpointConnectionName Name of the private endpoint connection. + * @param request The request. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + request: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + accountName, + privateEndpointConnectionName, + request, + options + ); + return poller.pollUntilDone(); + } + + /** + * Delete a private endpoint connection + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param privateEndpointConnectionName Name of the private endpoint connection. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + resourceGroupName, + accountName, + privateEndpointConnectionName, + options + }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Delete a private endpoint connection + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param privateEndpointConnectionName Name of the private endpoint connection. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + accountName, + privateEndpointConnectionName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListByAccountNext + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param nextLink The nextLink from the previous successful call to the ListByAccount method. + * @param options The options parameters. + */ + private _listByAccountNext( + resourceGroupName: string, + accountName: string, + nextLink: string, + options?: PrivateEndpointConnectionsListByAccountNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, nextLink, options }, + listByAccountNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByAccountOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnectionList + }, + default: { + bodyMapper: Mappers.ErrorResponseModel + } + }, + queryParameters: [Parameters.apiVersion, Parameters.skipToken], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + default: { + bodyMapper: Mappers.ErrorResponseModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.privateEndpointConnectionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + 201: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + 202: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + 204: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + default: { + bodyMapper: Mappers.ErrorResponseModel + } + }, + requestBody: Parameters.request, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.privateEndpointConnectionName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponseModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.privateEndpointConnectionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByAccountNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnectionList + }, + default: { + bodyMapper: Mappers.ErrorResponseModel + } + }, + queryParameters: [Parameters.apiVersion, Parameters.skipToken], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/purview/arm-purview/src/operations/privateLinkResources.ts b/sdk/purview/arm-purview/src/operations/privateLinkResources.ts new file mode 100644 index 000000000000..7bc10b7004ed --- /dev/null +++ b/sdk/purview/arm-purview/src/operations/privateLinkResources.ts @@ -0,0 +1,234 @@ +/* + * 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 "@azure/core-paging"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PrivateLinkResources } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { PurviewManagementClientContext } from "../purviewManagementClientContext"; +import { + PrivateLinkResource, + PrivateLinkResourcesListByAccountNextOptionalParams, + PrivateLinkResourcesListByAccountOptionalParams, + PrivateLinkResourcesListByAccountResponse, + PrivateLinkResourcesGetByGroupIdOptionalParams, + PrivateLinkResourcesGetByGroupIdResponse, + PrivateLinkResourcesListByAccountNextResponse +} from "../models"; + +/// +/** Class containing PrivateLinkResources operations. */ +export class PrivateLinkResourcesImpl implements PrivateLinkResources { + private readonly client: PurviewManagementClientContext; + + /** + * Initialize a new instance of the class PrivateLinkResources class. + * @param client Reference to the service client + */ + constructor(client: PurviewManagementClientContext) { + this.client = client; + } + + /** + * Gets a list of privately linkable resources for an account + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param options The options parameters. + */ + public listByAccount( + resourceGroupName: string, + accountName: string, + options?: PrivateLinkResourcesListByAccountOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByAccountPagingAll( + resourceGroupName, + accountName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByAccountPagingPage( + resourceGroupName, + accountName, + options + ); + } + }; + } + + private async *listByAccountPagingPage( + resourceGroupName: string, + accountName: string, + options?: PrivateLinkResourcesListByAccountOptionalParams + ): AsyncIterableIterator { + let result = await this._listByAccount( + resourceGroupName, + accountName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByAccountNext( + resourceGroupName, + accountName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByAccountPagingAll( + resourceGroupName: string, + accountName: string, + options?: PrivateLinkResourcesListByAccountOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByAccountPagingPage( + resourceGroupName, + accountName, + options + )) { + yield* page; + } + } + + /** + * Gets a list of privately linkable resources for an account + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param options The options parameters. + */ + private _listByAccount( + resourceGroupName: string, + accountName: string, + options?: PrivateLinkResourcesListByAccountOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, options }, + listByAccountOperationSpec + ); + } + + /** + * Gets a privately linkable resources for an account with given group identifier + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param groupId The group identifier. + * @param options The options parameters. + */ + getByGroupId( + resourceGroupName: string, + accountName: string, + groupId: string, + options?: PrivateLinkResourcesGetByGroupIdOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, groupId, options }, + getByGroupIdOperationSpec + ); + } + + /** + * ListByAccountNext + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param nextLink The nextLink from the previous successful call to the ListByAccount method. + * @param options The options parameters. + */ + private _listByAccountNext( + resourceGroupName: string, + accountName: string, + nextLink: string, + options?: PrivateLinkResourcesListByAccountNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, nextLink, options }, + listByAccountNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByAccountOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateLinkResources", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateLinkResourceList + }, + default: { + bodyMapper: Mappers.ErrorResponseModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getByGroupIdOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateLinkResources/{groupId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateLinkResource + }, + default: { + bodyMapper: Mappers.ErrorResponseModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.groupId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByAccountNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateLinkResourceList + }, + default: { + bodyMapper: Mappers.ErrorResponseModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/purview/arm-purview/src/operationsInterfaces/accounts.ts b/sdk/purview/arm-purview/src/operationsInterfaces/accounts.ts new file mode 100644 index 000000000000..1dff4c432867 --- /dev/null +++ b/sdk/purview/arm-purview/src/operationsInterfaces/accounts.ts @@ -0,0 +1,180 @@ +/* + * 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 "@azure/core-paging"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + Account, + AccountsListByResourceGroupOptionalParams, + AccountsListBySubscriptionOptionalParams, + AccountsGetOptionalParams, + AccountsGetResponse, + AccountsCreateOrUpdateOptionalParams, + AccountsCreateOrUpdateResponse, + AccountsDeleteOptionalParams, + AccountUpdateParameters, + AccountsUpdateOptionalParams, + AccountsUpdateResponse, + AccountsListKeysOptionalParams, + AccountsListKeysResponse, + CollectionAdminUpdate, + AccountsAddRootCollectionAdminOptionalParams, + CheckNameAvailabilityRequest, + AccountsCheckNameAvailabilityOptionalParams, + AccountsCheckNameAvailabilityResponse +} from "../models"; + +/// +/** Interface representing a Accounts. */ +export interface Accounts { + /** + * List accounts in ResourceGroup + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: AccountsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * List accounts in Subscription + * @param options The options parameters. + */ + listBySubscription( + options?: AccountsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get an account + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + options?: AccountsGetOptionalParams + ): Promise; + /** + * Creates or updates an account + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param account The account. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + accountName: string, + account: Account, + options?: AccountsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + AccountsCreateOrUpdateResponse + > + >; + /** + * Creates or updates an account + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param account The account. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + accountName: string, + account: Account, + options?: AccountsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes an account resource + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + accountName: string, + options?: AccountsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes an account resource + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + options?: AccountsDeleteOptionalParams + ): Promise; + /** + * Updates an account + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param accountUpdateParameters The account update parameters. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + accountName: string, + accountUpdateParameters: AccountUpdateParameters, + options?: AccountsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + AccountsUpdateResponse + > + >; + /** + * Updates an account + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param accountUpdateParameters The account update parameters. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + accountName: string, + accountUpdateParameters: AccountUpdateParameters, + options?: AccountsUpdateOptionalParams + ): Promise; + /** + * List the authorization keys associated with this account. + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param options The options parameters. + */ + listKeys( + resourceGroupName: string, + accountName: string, + options?: AccountsListKeysOptionalParams + ): Promise; + /** + * Add the administrator for root collection associated with this account. + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param collectionAdminUpdate The collection admin update payload. + * @param options The options parameters. + */ + addRootCollectionAdmin( + resourceGroupName: string, + accountName: string, + collectionAdminUpdate: CollectionAdminUpdate, + options?: AccountsAddRootCollectionAdminOptionalParams + ): Promise; + /** + * Checks if account name is available. + * @param checkNameAvailabilityRequest The check name availability request. + * @param options The options parameters. + */ + checkNameAvailability( + checkNameAvailabilityRequest: CheckNameAvailabilityRequest, + options?: AccountsCheckNameAvailabilityOptionalParams + ): Promise; +} diff --git a/sdk/purview/arm-purview/src/operationsInterfaces/defaultAccounts.ts b/sdk/purview/arm-purview/src/operationsInterfaces/defaultAccounts.ts new file mode 100644 index 000000000000..9685db12a083 --- /dev/null +++ b/sdk/purview/arm-purview/src/operationsInterfaces/defaultAccounts.ts @@ -0,0 +1,52 @@ +/* + * 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 { + ScopeType, + DefaultAccountsGetOptionalParams, + DefaultAccountsGetResponse, + DefaultAccountPayload, + DefaultAccountsSetModelOptionalParams, + DefaultAccountsSetModelResponse, + DefaultAccountsRemoveOptionalParams +} from "../models"; + +/** Interface representing a DefaultAccounts. */ +export interface DefaultAccounts { + /** + * Get the default account for the scope. + * @param scopeTenantId The tenant ID. + * @param scopeType The scope for the default account. + * @param options The options parameters. + */ + get( + scopeTenantId: string, + scopeType: ScopeType, + options?: DefaultAccountsGetOptionalParams + ): Promise; + /** + * Sets the default account for the scope. + * @param defaultAccountPayload The payload containing the default account information and the scope. + * @param options The options parameters. + */ + set( + defaultAccountPayload: DefaultAccountPayload, + options?: DefaultAccountsSetModelOptionalParams + ): Promise; + /** + * Removes the default account from the scope. + * @param scopeTenantId The tenant ID. + * @param scopeType The scope for the default account. + * @param options The options parameters. + */ + remove( + scopeTenantId: string, + scopeType: ScopeType, + options?: DefaultAccountsRemoveOptionalParams + ): Promise; +} diff --git a/sdk/purview/arm-purview/src/operationsInterfaces/index.ts b/sdk/purview/arm-purview/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..a8c4893c803d --- /dev/null +++ b/sdk/purview/arm-purview/src/operationsInterfaces/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 * from "./accounts"; +export * from "./defaultAccounts"; +export * from "./operations"; +export * from "./privateEndpointConnections"; +export * from "./privateLinkResources"; diff --git a/sdk/purview/arm-purview/src/operationsInterfaces/operations.ts b/sdk/purview/arm-purview/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..0bf540e1fec8 --- /dev/null +++ b/sdk/purview/arm-purview/src/operationsInterfaces/operations.ts @@ -0,0 +1,23 @@ +/* + * 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 "@azure/core-paging"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operation, OperationsListOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * List of available operations + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/purview/arm-purview/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/purview/arm-purview/src/operationsInterfaces/privateEndpointConnections.ts new file mode 100644 index 000000000000..90956b2b836c --- /dev/null +++ b/sdk/purview/arm-purview/src/operationsInterfaces/privateEndpointConnections.ts @@ -0,0 +1,110 @@ +/* + * 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 "@azure/core-paging"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + PrivateEndpointConnection, + PrivateEndpointConnectionsListByAccountOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, + PrivateEndpointConnectionsGetResponse, + PrivateEndpointConnectionsCreateOrUpdateOptionalParams, + PrivateEndpointConnectionsCreateOrUpdateResponse, + PrivateEndpointConnectionsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a PrivateEndpointConnections. */ +export interface PrivateEndpointConnections { + /** + * Get private endpoint connections for account + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param options The options parameters. + */ + listByAccount( + resourceGroupName: string, + accountName: string, + options?: PrivateEndpointConnectionsListByAccountOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a private endpoint connection + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param privateEndpointConnectionName Name of the private endpoint connection. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams + ): Promise; + /** + * Create or update a private endpoint connection + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param privateEndpointConnectionName Name of the private endpoint connection. + * @param request The request. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + request: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PrivateEndpointConnectionsCreateOrUpdateResponse + > + >; + /** + * Create or update a private endpoint connection + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param privateEndpointConnectionName Name of the private endpoint connection. + * @param request The request. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + request: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams + ): Promise; + /** + * Delete a private endpoint connection + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param privateEndpointConnectionName Name of the private endpoint connection. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise, void>>; + /** + * Delete a private endpoint connection + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param privateEndpointConnectionName Name of the private endpoint connection. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/purview/arm-purview/src/operationsInterfaces/privateLinkResources.ts b/sdk/purview/arm-purview/src/operationsInterfaces/privateLinkResources.ts new file mode 100644 index 000000000000..86b681bae561 --- /dev/null +++ b/sdk/purview/arm-purview/src/operationsInterfaces/privateLinkResources.ts @@ -0,0 +1,45 @@ +/* + * 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 "@azure/core-paging"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + PrivateLinkResource, + PrivateLinkResourcesListByAccountOptionalParams, + PrivateLinkResourcesGetByGroupIdOptionalParams, + PrivateLinkResourcesGetByGroupIdResponse +} from "../models"; + +/// +/** Interface representing a PrivateLinkResources. */ +export interface PrivateLinkResources { + /** + * Gets a list of privately linkable resources for an account + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param options The options parameters. + */ + listByAccount( + resourceGroupName: string, + accountName: string, + options?: PrivateLinkResourcesListByAccountOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a privately linkable resources for an account with given group identifier + * @param resourceGroupName The resource group name. + * @param accountName The name of the account. + * @param groupId The group identifier. + * @param options The options parameters. + */ + getByGroupId( + resourceGroupName: string, + accountName: string, + groupId: string, + options?: PrivateLinkResourcesGetByGroupIdOptionalParams + ): Promise; +} diff --git a/sdk/purview/arm-purview/src/purviewManagementClient.ts b/sdk/purview/arm-purview/src/purviewManagementClient.ts new file mode 100644 index 000000000000..376625ecfe1d --- /dev/null +++ b/sdk/purview/arm-purview/src/purviewManagementClient.ts @@ -0,0 +1,52 @@ +/* + * 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 coreAuth from "@azure/core-auth"; +import { + AccountsImpl, + DefaultAccountsImpl, + OperationsImpl, + PrivateEndpointConnectionsImpl, + PrivateLinkResourcesImpl +} from "./operations"; +import { + Accounts, + DefaultAccounts, + Operations, + PrivateEndpointConnections, + PrivateLinkResources +} from "./operationsInterfaces"; +import { PurviewManagementClientContext } from "./purviewManagementClientContext"; +import { PurviewManagementClientOptionalParams } from "./models"; + +export class PurviewManagementClient extends PurviewManagementClientContext { + /** + * Initializes a new instance of the PurviewManagementClient class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The subscription identifier + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: PurviewManagementClientOptionalParams + ) { + super(credentials, subscriptionId, options); + this.accounts = new AccountsImpl(this); + this.defaultAccounts = new DefaultAccountsImpl(this); + this.operations = new OperationsImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); + this.privateLinkResources = new PrivateLinkResourcesImpl(this); + } + + accounts: Accounts; + defaultAccounts: DefaultAccounts; + operations: Operations; + privateEndpointConnections: PrivateEndpointConnections; + privateLinkResources: PrivateLinkResources; +} diff --git a/sdk/purview/arm-purview/src/purviewManagementClientContext.ts b/sdk/purview/arm-purview/src/purviewManagementClientContext.ts new file mode 100644 index 000000000000..f488ec7f2859 --- /dev/null +++ b/sdk/purview/arm-purview/src/purviewManagementClientContext.ts @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { PurviewManagementClientOptionalParams } from "./models"; + +export class PurviewManagementClientContext extends coreClient.ServiceClient { + $host: string; + subscriptionId: string; + apiVersion: string; + + /** + * Initializes a new instance of the PurviewManagementClientContext class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The subscription identifier + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: PurviewManagementClientOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: PurviewManagementClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-purview/1.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2021-07-01"; + } +} diff --git a/sdk/purview/arm-purview/tsconfig.json b/sdk/purview/arm-purview/tsconfig.json new file mode 100644 index 000000000000..603440b3a359 --- /dev/null +++ b/sdk/purview/arm-purview/tsconfig.json @@ -0,0 +1,19 @@ +{ + "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"], + "exclude": ["node_modules"] +} diff --git a/sdk/purview/ci.yml b/sdk/purview/ci.yml index 52b187b1ca69..a6beeb5bccb6 100644 --- a/sdk/purview/ci.yml +++ b/sdk/purview/ci.yml @@ -1,5 +1,4 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - trigger: branches: include: @@ -9,7 +8,6 @@ trigger: paths: include: - sdk/purview/ - pr: branches: include: @@ -17,10 +15,11 @@ pr: - feature/* - release/* - hotfix/* + exclude: + - feature/v4 paths: include: - sdk/purview/ - extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: @@ -32,3 +31,5 @@ extends: safeName: azurerestpurviewscanning - name: azure-rest-purview-account safeName: azurerestpurviewaccount + - name: azure-arm-purview + safeName: azurearmpurview