diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 40055629c861..424262d9f130 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -21,6 +21,7 @@ specifiers: '@rush-temp/arm-authorization': file:./projects/arm-authorization.tgz '@rush-temp/arm-authorization-profile-2020-09-01-hybrid': file:./projects/arm-authorization-profile-2020-09-01-hybrid.tgz '@rush-temp/arm-avs': file:./projects/arm-avs.tgz + '@rush-temp/arm-azurearcdata': file:./projects/arm-azurearcdata.tgz '@rush-temp/arm-azurestack': file:./projects/arm-azurestack.tgz '@rush-temp/arm-azurestackhci': file:./projects/arm-azurestackhci.tgz '@rush-temp/arm-batch': file:./projects/arm-batch.tgz @@ -291,6 +292,7 @@ dependencies: '@rush-temp/arm-authorization': file:projects/arm-authorization.tgz '@rush-temp/arm-authorization-profile-2020-09-01-hybrid': file:projects/arm-authorization-profile-2020-09-01-hybrid.tgz '@rush-temp/arm-avs': file:projects/arm-avs.tgz + '@rush-temp/arm-azurearcdata': file:projects/arm-azurearcdata.tgz '@rush-temp/arm-azurestack': file:projects/arm-azurestack.tgz '@rush-temp/arm-azurestackhci': file:projects/arm-azurestackhci.tgz '@rush-temp/arm-batch': file:projects/arm-batch.tgz @@ -9567,6 +9569,33 @@ packages: - supports-color dev: false + file:projects/arm-azurearcdata.tgz: + resolution: {integrity: sha512-3mlI8Wb5AYDiQeKMY2q/g+PZvKI+uuk6/vj10Dfr0408z/X0vgidOwbKI0dcIQNheCxQUhXVQhD/99NPnjYZhg==, tarball: file:projects/arm-azurearcdata.tgz} + name: '@rush-temp/arm-azurearcdata' + version: 0.0.0 + dependencies: + '@azure-tools/test-recorder': 1.0.2 + '@azure/identity': 2.0.4 + '@microsoft/api-extractor': 7.19.4 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 + cross-env: 7.0.3 + mkdirp: 1.0.4 + mocha: 7.2.0 + rimraf: 3.0.2 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + tslib: 2.3.1 + typescript: 4.2.4 + uglify-js: 3.15.1 + transitivePeerDependencies: + - debug + - encoding + - supports-color + dev: false + file:projects/arm-azurestack.tgz: resolution: {integrity: sha512-4kAEOlfs1FtS+yZi3MLlDHIGpP0HmSxH3lWcZ4QUYoTH9na7FxL0n5GtWpi2CYUJqmQ9zcLvbUcGGGQ5/DtJPQ==, tarball: file:projects/arm-azurestack.tgz} name: '@rush-temp/arm-azurestack' diff --git a/rush.json b/rush.json index 94b522505085..3efd9c2ae0c7 100644 --- a/rush.json +++ b/rush.json @@ -1660,6 +1660,11 @@ "packageName": "@azure/arm-appservice-profile-2020-09-01-hybrid", "projectFolder": "sdk/appservice/arm-appservice-profile-2020-09-01-hybrid", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-azurearcdata", + "projectFolder": "sdk/azurearcdata/arm-azurearcdata", + "versionPolicyName": "management" } ] -} +} \ No newline at end of file diff --git a/sdk/azurearcdata/arm-azurearcdata/CHANGELOG.md b/sdk/azurearcdata/arm-azurearcdata/CHANGELOG.md new file mode 100644 index 000000000000..552b715c88d4 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-03-17) + +The package of @azure/arm-azurearcdata is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/azurearcdata/arm-azurearcdata/LICENSE b/sdk/azurearcdata/arm-azurearcdata/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2022 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/azurearcdata/arm-azurearcdata/README.md b/sdk/azurearcdata/arm-azurearcdata/README.md new file mode 100644 index 000000000000..8ecf2fe859a7 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/README.md @@ -0,0 +1,98 @@ +# AzureArcDataManagement client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for AzureArcDataManagement client. + +The AzureArcData management API provides a RESTful set of web APIs to manage Azure Data Services on Azure Arc Resources. + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/azurearcdata/arm-azurearcdata) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-azurearcdata) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-azurearcdata?view=azure-node-preview) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started + +### Currently supported environments + +- [LTS versions of Node.js](https://nodejs.org/about/releases/) +- Latest versions of Safari, Chrome, Edge and Firefox. + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-azurearcdata` package + +Install the AzureArcDataManagement client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-azurearcdata +``` + +### Create and authenticate a `AzureArcDataManagementClient` + +To create a client object to access the AzureArcDataManagement API, you will need the `endpoint` of your AzureArcDataManagement resource and a `credential`. The AzureArcDataManagement client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your AzureArcDataManagement resource in the [Azure Portal][azure_portal]. + +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` + +You will also need to **register a new AAD application and grant access to AzureArcDataManagement** 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 { AzureArcDataManagementClient } = require("@azure/arm-azurearcdata"); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new AzureArcDataManagementClient(new DefaultAzureCredential(), subscriptionId); +``` + + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### AzureArcDataManagementClient + +`AzureArcDataManagementClient` is the primary interface for developers using the AzureArcDataManagement client library. Explore the methods on this client object to understand the different features of the AzureArcDataManagement 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%2Fazurearcdata%2Farm-azurearcdata%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/azurearcdata/arm-azurearcdata/_meta.json b/sdk/azurearcdata/arm-azurearcdata/_meta.json new file mode 100644 index 000000000000..30d3d9ec8d10 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/_meta.json @@ -0,0 +1,8 @@ +{ + "commit": "469f1b48515d3da2efa97d5ea8a4d7c5d3bb4ae0", + "readme": "specification/azurearcdata/resource-manager/readme.md", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/azurearcdata/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220105.1", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.1.3", + "use": "@autorest/typescript@6.0.0-alpha.16.20220105.1" +} \ No newline at end of file diff --git a/sdk/azurearcdata/arm-azurearcdata/api-extractor.json b/sdk/azurearcdata/arm-azurearcdata/api-extractor.json new file mode 100644 index 000000000000..db44176accb6 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/api-extractor.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-azurearcdata.d.ts" + }, + "messages": { + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, + "extractorMessageReporting": { + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } + } + } +} \ No newline at end of file diff --git a/sdk/azurearcdata/arm-azurearcdata/package.json b/sdk/azurearcdata/arm-azurearcdata/package.json new file mode 100644 index 000000000000..7ea6d7284f9b --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/package.json @@ -0,0 +1,102 @@ +{ + "name": "@azure/arm-azurearcdata", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", + "description": "A generated SDK for AzureArcDataManagementClient.", + "version": "1.0.0-beta.1", + "engines": { + "node": ">=12.0.0" + }, + "dependencies": { + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-azurearcdata.d.ts", + "devDependencies": { + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "mkdirp": "^1.0.4", + "rollup": "^1.16.3", + "rollup-plugin-sourcemaps": "^0.4.2", + "typescript": "~4.2.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^1.0.0", + "mocha": "^7.1.1", + "cross-env": "^7.0.2" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/azurearcdata/arm-azurearcdata", + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "files": [ + "dist/**/*.js", + "dist/**/*.js.map", + "dist/**/*.d.ts", + "dist/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", + "src/**/*.ts", + "README.md", + "LICENSE", + "rollup.config.js", + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" + ], + "scripts": { + "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "api-extractor run --local", + "lint": "echo skipped", + "audit": "echo skipped", + "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "npm run integration-test", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:browser": "echo skipped", + "docs": "echo skipped" + }, + "sideEffects": false, + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/azurearcdata/arm-azurearcdata/review/arm-azurearcdata.api.md b/sdk/azurearcdata/arm-azurearcdata/review/arm-azurearcdata.api.md new file mode 100644 index 000000000000..e0339f75ce61 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/review/arm-azurearcdata.api.md @@ -0,0 +1,909 @@ +## API Report File for "@azure/arm-azurearcdata" + +> 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 ActiveDirectoryConnectorDNSDetails { + domainName?: string; + nameserverIPAddresses: string[]; + preferK8SDnsForPtrLookups?: boolean; + replicas?: number; +} + +// @public +export interface ActiveDirectoryConnectorDomainDetails { + domainControllers: ActiveDirectoryDomainControllers; + netbiosDomainName?: string; + realm: string; +} + +// @public +export interface ActiveDirectoryConnectorListResult { + readonly nextLink?: string; + readonly value?: ActiveDirectoryConnectorResource[]; +} + +// @public +export interface ActiveDirectoryConnectorProperties { + readonly provisioningState?: string; + spec: ActiveDirectoryConnectorSpec; + status?: ActiveDirectoryConnectorStatus; +} + +// @public +export type ActiveDirectoryConnectorResource = ProxyResource & { + properties: ActiveDirectoryConnectorProperties; +}; + +// @public +export interface ActiveDirectoryConnectors { + beginCreate(resourceGroupName: string, dataControllerName: string, activeDirectoryConnectorName: string, activeDirectoryConnectorResource: ActiveDirectoryConnectorResource, options?: ActiveDirectoryConnectorsCreateOptionalParams): Promise, ActiveDirectoryConnectorsCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, dataControllerName: string, activeDirectoryConnectorName: string, activeDirectoryConnectorResource: ActiveDirectoryConnectorResource, options?: ActiveDirectoryConnectorsCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, dataControllerName: string, activeDirectoryConnectorName: string, options?: ActiveDirectoryConnectorsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, dataControllerName: string, activeDirectoryConnectorName: string, options?: ActiveDirectoryConnectorsDeleteOptionalParams): Promise; + get(resourceGroupName: string, dataControllerName: string, activeDirectoryConnectorName: string, options?: ActiveDirectoryConnectorsGetOptionalParams): Promise; + list(resourceGroupName: string, dataControllerName: string, options?: ActiveDirectoryConnectorsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ActiveDirectoryConnectorsCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ActiveDirectoryConnectorsCreateResponse = ActiveDirectoryConnectorResource; + +// @public +export interface ActiveDirectoryConnectorsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ActiveDirectoryConnectorsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ActiveDirectoryConnectorsGetResponse = ActiveDirectoryConnectorResource; + +// @public +export interface ActiveDirectoryConnectorsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ActiveDirectoryConnectorsListNextResponse = ActiveDirectoryConnectorListResult; + +// @public +export interface ActiveDirectoryConnectorsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ActiveDirectoryConnectorsListResponse = ActiveDirectoryConnectorListResult; + +// @public +export interface ActiveDirectoryConnectorSpec { + activeDirectory: ActiveDirectoryConnectorDomainDetails; + dns: ActiveDirectoryConnectorDNSDetails; +} + +// @public +export interface ActiveDirectoryConnectorStatus { + [property: string]: any; + lastUpdateTime?: string; + observedGeneration?: number; + state?: string; +} + +// @public +export interface ActiveDirectoryDomainController { + hostname: string; +} + +// @public +export interface ActiveDirectoryDomainControllers { + primaryDomainController?: ActiveDirectoryDomainController; + secondaryDomainControllers?: ActiveDirectoryDomainController[]; +} + +// @public +export type ArcSqlManagedInstanceLicenseType = string; + +// @public +export type ArcSqlServerLicenseType = string; + +// @public (undocumented) +export class AzureArcDataManagementClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: AzureArcDataManagementClientOptionalParams); + // (undocumented) + activeDirectoryConnectors: ActiveDirectoryConnectors; + // (undocumented) + apiVersion: string; + // (undocumented) + dataControllers: DataControllers; + // (undocumented) + operations: Operations; + // (undocumented) + postgresInstances: PostgresInstances; + // (undocumented) + sqlManagedInstances: SqlManagedInstances; + // (undocumented) + sqlServerInstances: SqlServerInstances; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface AzureArcDataManagementClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface BasicLoginInformation { + password?: string; + username?: string; +} + +// @public +export interface CommonSku { + capacity?: number; + dev?: boolean; + family?: string; + name: string; + size?: string; +} + +// @public +export type ConnectionStatus = string; + +// @public +export type CreatedByType = string; + +// @public +export interface DataControllerProperties { + basicLoginInformation?: BasicLoginInformation; + clusterId?: string; + extensionId?: string; + infrastructure?: Infrastructure; + k8SRaw?: Record; + lastUploadedDate?: Date; + logAnalyticsWorkspaceConfig?: LogAnalyticsWorkspaceConfig; + logsDashboardCredential?: BasicLoginInformation; + metricsDashboardCredential?: BasicLoginInformation; + onPremiseProperty?: OnPremiseProperty; + readonly provisioningState?: string; + uploadServicePrincipal?: UploadServicePrincipal; + uploadWatermark?: UploadWatermark; +} + +// @public +export type DataControllerResource = TrackedResource & { + extendedLocation?: ExtendedLocation; + properties: DataControllerProperties; +}; + +// @public +export interface DataControllers { + beginDeleteDataController(resourceGroupName: string, dataControllerName: string, options?: DataControllersDeleteDataControllerOptionalParams): Promise, void>>; + beginDeleteDataControllerAndWait(resourceGroupName: string, dataControllerName: string, options?: DataControllersDeleteDataControllerOptionalParams): Promise; + beginPutDataController(resourceGroupName: string, dataControllerName: string, dataControllerResource: DataControllerResource, options?: DataControllersPutDataControllerOptionalParams): Promise, DataControllersPutDataControllerResponse>>; + beginPutDataControllerAndWait(resourceGroupName: string, dataControllerName: string, dataControllerResource: DataControllerResource, options?: DataControllersPutDataControllerOptionalParams): Promise; + getDataController(resourceGroupName: string, dataControllerName: string, options?: DataControllersGetDataControllerOptionalParams): Promise; + listInGroup(resourceGroupName: string, options?: DataControllersListInGroupOptionalParams): PagedAsyncIterableIterator; + listInSubscription(options?: DataControllersListInSubscriptionOptionalParams): PagedAsyncIterableIterator; + patchDataController(resourceGroupName: string, dataControllerName: string, dataControllerResource: DataControllerUpdate, options?: DataControllersPatchDataControllerOptionalParams): Promise; +} + +// @public +export interface DataControllersDeleteDataControllerOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DataControllersGetDataControllerOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataControllersGetDataControllerResponse = DataControllerResource; + +// @public +export interface DataControllersListInGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataControllersListInGroupNextResponse = PageOfDataControllerResource; + +// @public +export interface DataControllersListInGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataControllersListInGroupResponse = PageOfDataControllerResource; + +// @public +export interface DataControllersListInSubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataControllersListInSubscriptionNextResponse = PageOfDataControllerResource; + +// @public +export interface DataControllersListInSubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataControllersListInSubscriptionResponse = PageOfDataControllerResource; + +// @public +export interface DataControllersPatchDataControllerOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataControllersPatchDataControllerResponse = DataControllerResource; + +// @public +export interface DataControllersPutDataControllerOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DataControllersPutDataControllerResponse = DataControllerResource; + +// @public +export interface DataControllerUpdate { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type DefenderStatus = string; + +// @public +export type EditionType = string; + +// @public +export interface ErrorResponse { + error?: ErrorResponseBody; +} + +// @public +export interface ErrorResponseBody { + code?: string; + details?: ErrorResponseBody[]; + message?: string; + target?: string; +} + +// @public +export interface ExtendedLocation { + name?: string; + type?: ExtendedLocationTypes; +} + +// @public +export type ExtendedLocationTypes = string; + +// @public +export type HostType = string; + +// @public +export type Infrastructure = "azure" | "gcp" | "aws" | "alibaba" | "onpremises" | "other"; + +// @public +export interface K8SResourceRequirements { + [property: string]: any; + limits?: { + [propertyName: string]: string; + }; + requests?: { + [propertyName: string]: string; + }; +} + +// @public +export interface K8SScheduling { + [property: string]: any; + default?: K8SSchedulingOptions; +} + +// @public +export interface K8SSchedulingOptions { + [property: string]: any; + resources?: K8SResourceRequirements; +} + +// @public +export enum KnownArcSqlManagedInstanceLicenseType { + // (undocumented) + BasePrice = "BasePrice", + // (undocumented) + DisasterRecovery = "DisasterRecovery", + // (undocumented) + LicenseIncluded = "LicenseIncluded" +} + +// @public +export enum KnownArcSqlServerLicenseType { + // (undocumented) + Free = "Free", + // (undocumented) + Hadr = "HADR", + // (undocumented) + Paid = "Paid", + // (undocumented) + Undefined = "Undefined" +} + +// @public +export enum KnownConnectionStatus { + // (undocumented) + Connected = "Connected", + // (undocumented) + Disconnected = "Disconnected", + // (undocumented) + Registered = "Registered", + // (undocumented) + Unknown = "Unknown" +} + +// @public +export enum KnownCreatedByType { + // (undocumented) + Application = "Application", + // (undocumented) + Key = "Key", + // (undocumented) + ManagedIdentity = "ManagedIdentity", + // (undocumented) + User = "User" +} + +// @public +export enum KnownDefenderStatus { + // (undocumented) + Protected = "Protected", + // (undocumented) + Unknown = "Unknown", + // (undocumented) + Unprotected = "Unprotected" +} + +// @public +export enum KnownEditionType { + // (undocumented) + Developer = "Developer", + // (undocumented) + Enterprise = "Enterprise", + // (undocumented) + Evaluation = "Evaluation", + // (undocumented) + Express = "Express", + // (undocumented) + Standard = "Standard", + // (undocumented) + Web = "Web" +} + +// @public +export enum KnownExtendedLocationTypes { + // (undocumented) + CustomLocation = "CustomLocation" +} + +// @public +export enum KnownHostType { + // (undocumented) + AWSVirtualMachine = "AWS Virtual Machine", + // (undocumented) + GCPVirtualMachine = "GCP Virtual Machine", + // (undocumented) + Other = "Other", + // (undocumented) + PhysicalServer = "Physical Server", + // (undocumented) + VirtualMachine = "Virtual Machine" +} + +// @public +export enum KnownOperationOrigin { + // (undocumented) + System = "system", + // (undocumented) + User = "user" +} + +// @public +export enum KnownSqlVersion { + // (undocumented) + SQLServer2012 = "SQL Server 2012", + // (undocumented) + SQLServer2014 = "SQL Server 2014", + // (undocumented) + SQLServer2016 = "SQL Server 2016", + // (undocumented) + SQLServer2017 = "SQL Server 2017", + // (undocumented) + SQLServer2019 = "SQL Server 2019", + // (undocumented) + SQLServer2022 = "SQL Server 2022", + // (undocumented) + Unknown = "Unknown" +} + +// @public +export interface LogAnalyticsWorkspaceConfig { + primaryKey?: string; + workspaceId?: string; +} + +// @public +export interface OnPremiseProperty { + id: string; + publicSigningKey: string; + signingCertificateThumbprint?: string; +} + +// @public +export interface Operation { + display: OperationDisplay; + isDataAction: boolean; + name: string; + readonly origin?: OperationOrigin; + readonly properties?: { + [propertyName: string]: Record; + }; +} + +// @public +export interface OperationDisplay { + description: string; + operation: string; + provider: string; + resource: string; +} + +// @public +export interface OperationListResult { + readonly nextLink?: string; + readonly value?: Operation[]; +} + +// @public +export type OperationOrigin = string; + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationListResult; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public +export interface PageOfDataControllerResource { + nextLink?: string; + value?: DataControllerResource[]; +} + +// @public +export type PostgresInstance = TrackedResource & { + extendedLocation?: ExtendedLocation; + properties: PostgresInstanceProperties; + sku?: PostgresInstanceSku; +}; + +// @public +export interface PostgresInstanceListResult { + readonly nextLink?: string; + readonly value?: PostgresInstance[]; +} + +// @public +export interface PostgresInstanceProperties { + admin?: string; + basicLoginInformation?: BasicLoginInformation; + dataControllerId?: string; + k8SRaw?: Record; + lastUploadedDate?: Date; + readonly provisioningState?: string; +} + +// @public +export interface PostgresInstances { + beginCreate(resourceGroupName: string, postgresInstanceName: string, resource: PostgresInstance, options?: PostgresInstancesCreateOptionalParams): Promise, PostgresInstancesCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, postgresInstanceName: string, resource: PostgresInstance, options?: PostgresInstancesCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, postgresInstanceName: string, options?: PostgresInstancesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, postgresInstanceName: string, options?: PostgresInstancesDeleteOptionalParams): Promise; + get(resourceGroupName: string, postgresInstanceName: string, options?: PostgresInstancesGetOptionalParams): Promise; + list(options?: PostgresInstancesListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: PostgresInstancesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, postgresInstanceName: string, parameters: PostgresInstanceUpdate, options?: PostgresInstancesUpdateOptionalParams): Promise; +} + +// @public +export interface PostgresInstancesCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PostgresInstancesCreateResponse = PostgresInstance; + +// @public +export interface PostgresInstancesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface PostgresInstancesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PostgresInstancesGetResponse = PostgresInstance; + +// @public +export type PostgresInstanceSku = CommonSku & { + tier?: "Hyperscale"; +}; + +// @public +export interface PostgresInstancesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PostgresInstancesListByResourceGroupNextResponse = PostgresInstanceListResult; + +// @public +export interface PostgresInstancesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PostgresInstancesListByResourceGroupResponse = PostgresInstanceListResult; + +// @public +export interface PostgresInstancesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PostgresInstancesListNextResponse = PostgresInstanceListResult; + +// @public +export interface PostgresInstancesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PostgresInstancesListResponse = PostgresInstanceListResult; + +// @public +export interface PostgresInstancesUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PostgresInstancesUpdateResponse = PostgresInstance; + +// @public +export interface PostgresInstanceUpdate { + properties?: PostgresInstanceProperties; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type ProxyResource = Resource & {}; + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export type SqlManagedInstance = TrackedResource & { + properties: SqlManagedInstanceProperties; + extendedLocation?: ExtendedLocation; + sku?: SqlManagedInstanceSku; +}; + +// @public +export interface SqlManagedInstanceK8SRaw { + [property: string]: any; + spec?: SqlManagedInstanceK8SSpec; +} + +// @public +export interface SqlManagedInstanceK8SSpec { + [property: string]: any; + replicas?: number; + scheduling?: K8SScheduling; +} + +// @public +export interface SqlManagedInstanceListResult { + readonly nextLink?: string; + readonly value?: SqlManagedInstance[]; +} + +// @public +export interface SqlManagedInstanceProperties { + admin?: string; + basicLoginInformation?: BasicLoginInformation; + clusterId?: string; + dataControllerId?: string; + endTime?: string; + extensionId?: string; + k8SRaw?: SqlManagedInstanceK8SRaw; + keytab?: string; + lastUploadedDate?: Date; + licenseType?: ArcSqlManagedInstanceLicenseType; + readonly provisioningState?: string; + startTime?: string; +} + +// @public +export interface SqlManagedInstances { + beginCreate(resourceGroupName: string, sqlManagedInstanceName: string, sqlManagedInstance: SqlManagedInstance, options?: SqlManagedInstancesCreateOptionalParams): Promise, SqlManagedInstancesCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, sqlManagedInstanceName: string, sqlManagedInstance: SqlManagedInstance, options?: SqlManagedInstancesCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, sqlManagedInstanceName: string, options?: SqlManagedInstancesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, sqlManagedInstanceName: string, options?: SqlManagedInstancesDeleteOptionalParams): Promise; + get(resourceGroupName: string, sqlManagedInstanceName: string, options?: SqlManagedInstancesGetOptionalParams): Promise; + list(options?: SqlManagedInstancesListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: SqlManagedInstancesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, sqlManagedInstanceName: string, parameters: SqlManagedInstanceUpdate, options?: SqlManagedInstancesUpdateOptionalParams): Promise; +} + +// @public +export interface SqlManagedInstancesCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SqlManagedInstancesCreateResponse = SqlManagedInstance; + +// @public +export interface SqlManagedInstancesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface SqlManagedInstancesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SqlManagedInstancesGetResponse = SqlManagedInstance; + +// @public +export interface SqlManagedInstanceSku { + capacity?: number; + dev?: boolean; + family?: string; + name: "vCore"; + size?: string; + tier?: SqlManagedInstanceSkuTier; +} + +// @public +export type SqlManagedInstanceSkuTier = "GeneralPurpose" | "BusinessCritical"; + +// @public +export interface SqlManagedInstancesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SqlManagedInstancesListByResourceGroupNextResponse = SqlManagedInstanceListResult; + +// @public +export interface SqlManagedInstancesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SqlManagedInstancesListByResourceGroupResponse = SqlManagedInstanceListResult; + +// @public +export interface SqlManagedInstancesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SqlManagedInstancesListNextResponse = SqlManagedInstanceListResult; + +// @public +export interface SqlManagedInstancesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SqlManagedInstancesListResponse = SqlManagedInstanceListResult; + +// @public +export interface SqlManagedInstancesUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SqlManagedInstancesUpdateResponse = SqlManagedInstance; + +// @public +export interface SqlManagedInstanceUpdate { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type SqlServerInstance = TrackedResource & { + properties?: SqlServerInstanceProperties; +}; + +// @public +export interface SqlServerInstanceListResult { + readonly nextLink?: string; + readonly value?: SqlServerInstance[]; +} + +// @public +export interface SqlServerInstanceProperties { + azureDefenderStatus?: DefenderStatus; + azureDefenderStatusLastUpdated?: Date; + collation?: string; + containerResourceId: string; + readonly createTime?: string; + currentVersion?: string; + edition?: EditionType; + esuExpirationDate?: Date; + hostType?: HostType; + instanceName?: string; + licenseType?: ArcSqlServerLicenseType; + patchLevel?: string; + productId?: string; + readonly provisioningState?: string; + status: ConnectionStatus; + tcpDynamicPorts?: string; + tcpStaticPorts?: string; + vCore?: string; + version?: SqlVersion; +} + +// @public +export interface SqlServerInstances { + beginCreate(resourceGroupName: string, sqlServerInstanceName: string, sqlServerInstance: SqlServerInstance, options?: SqlServerInstancesCreateOptionalParams): Promise, SqlServerInstancesCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, sqlServerInstanceName: string, sqlServerInstance: SqlServerInstance, options?: SqlServerInstancesCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, sqlServerInstanceName: string, options?: SqlServerInstancesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, sqlServerInstanceName: string, options?: SqlServerInstancesDeleteOptionalParams): Promise; + get(resourceGroupName: string, sqlServerInstanceName: string, options?: SqlServerInstancesGetOptionalParams): Promise; + list(options?: SqlServerInstancesListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: SqlServerInstancesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, sqlServerInstanceName: string, parameters: SqlServerInstanceUpdate, options?: SqlServerInstancesUpdateOptionalParams): Promise; +} + +// @public +export interface SqlServerInstancesCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SqlServerInstancesCreateResponse = SqlServerInstance; + +// @public +export interface SqlServerInstancesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface SqlServerInstancesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SqlServerInstancesGetResponse = SqlServerInstance; + +// @public +export interface SqlServerInstancesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SqlServerInstancesListByResourceGroupNextResponse = SqlServerInstanceListResult; + +// @public +export interface SqlServerInstancesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SqlServerInstancesListByResourceGroupResponse = SqlServerInstanceListResult; + +// @public +export interface SqlServerInstancesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SqlServerInstancesListNextResponse = SqlServerInstanceListResult; + +// @public +export interface SqlServerInstancesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SqlServerInstancesListResponse = SqlServerInstanceListResult; + +// @public +export interface SqlServerInstancesUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SqlServerInstancesUpdateResponse = SqlServerInstance; + +// @public +export interface SqlServerInstanceUpdate { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type SqlVersion = string; + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export type TrackedResource = Resource & { + tags?: { + [propertyName: string]: string; + }; + location: string; +}; + +// @public +export interface UploadServicePrincipal { + authority?: string; + clientId?: string; + clientSecret?: string; + tenantId?: string; +} + +// @public +export interface UploadWatermark { + logs?: Date; + metrics?: Date; + usages?: Date; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/azurearcdata/arm-azurearcdata/rollup.config.js b/sdk/azurearcdata/arm-azurearcdata/rollup.config.js new file mode 100644 index 000000000000..9be1955eb7f1 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/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/azurearcdata/arm-azurearcdata/src/azureArcDataManagementClient.ts b/sdk/azurearcdata/arm-azurearcdata/src/azureArcDataManagementClient.ts new file mode 100644 index 000000000000..535bfb71f93b --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/azureArcDataManagementClient.ts @@ -0,0 +1,99 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + OperationsImpl, + SqlManagedInstancesImpl, + SqlServerInstancesImpl, + DataControllersImpl, + ActiveDirectoryConnectorsImpl, + PostgresInstancesImpl +} from "./operations"; +import { + Operations, + SqlManagedInstances, + SqlServerInstances, + DataControllers, + ActiveDirectoryConnectors, + PostgresInstances +} from "./operationsInterfaces"; +import { AzureArcDataManagementClientOptionalParams } from "./models"; + +export class AzureArcDataManagementClient extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + + /** + * Initializes a new instance of the AzureArcDataManagementClient class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The ID of the Azure subscription + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: AzureArcDataManagementClientOptionalParams + ) { + 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: AzureArcDataManagementClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-azurearcdata/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 || "2022-03-01-preview"; + this.operations = new OperationsImpl(this); + this.sqlManagedInstances = new SqlManagedInstancesImpl(this); + this.sqlServerInstances = new SqlServerInstancesImpl(this); + this.dataControllers = new DataControllersImpl(this); + this.activeDirectoryConnectors = new ActiveDirectoryConnectorsImpl(this); + this.postgresInstances = new PostgresInstancesImpl(this); + } + + operations: Operations; + sqlManagedInstances: SqlManagedInstances; + sqlServerInstances: SqlServerInstances; + dataControllers: DataControllers; + activeDirectoryConnectors: ActiveDirectoryConnectors; + postgresInstances: PostgresInstances; +} diff --git a/sdk/azurearcdata/arm-azurearcdata/src/index.ts b/sdk/azurearcdata/arm-azurearcdata/src/index.ts new file mode 100644 index 000000000000..c18adc5c41af --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/// +export * from "./models"; +export { AzureArcDataManagementClient } from "./azureArcDataManagementClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/azurearcdata/arm-azurearcdata/src/lroImpl.ts b/sdk/azurearcdata/arm-azurearcdata/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/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/azurearcdata/arm-azurearcdata/src/models/index.ts b/sdk/azurearcdata/arm-azurearcdata/src/models/index.ts new file mode 100644 index 000000000000..a57aff511091 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/models/index.ts @@ -0,0 +1,1117 @@ +/* + * 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"; + +/** Result of the request to list Azure Data Services on Azure Arc operations. */ +export interface OperationListResult { + /** + * Array of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Operation[]; + /** + * Link to retrieve next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Azure Data Services on Azure Arc operation definition. */ +export interface Operation { + /** The name of the operation being performed on this particular object. */ + name: string; + /** The localized display information for this particular operation / action. */ + display: OperationDisplay; + /** + * The intended executor of the operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly origin?: OperationOrigin; + /** Indicates whether the operation is a data action */ + isDataAction: boolean; + /** + * Additional descriptions for the operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly properties?: { [propertyName: string]: Record }; +} + +/** Display metadata associated with the operation. */ +export interface OperationDisplay { + /** The localized friendly form of the resource provider name. */ + provider: string; + /** The localized friendly form of the resource type related to this action/operation. */ + resource: string; + /** The localized friendly name for the operation. */ + operation: string; + /** The localized friendly description for the operation. */ + description: string; +} + +/** An error response from the Azure Data on Azure Arc service. */ +export interface ErrorResponse { + /** null */ + error?: ErrorResponseBody; +} + +/** An error response from the Batch service. */ +export interface ErrorResponseBody { + /** An identifier for the error. Codes are invariant and are intended to be consumed programmatically. */ + code?: string; + /** A message describing the error, intended to be suitable for display in a user interface. */ + message?: string; + /** The target of the particular error. For example, the name of the property in error. */ + target?: string; + /** A list of additional details about the error. */ + details?: ErrorResponseBody[]; +} + +/** A list of SqlManagedInstance. */ +export interface SqlManagedInstanceListResult { + /** + * Array of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: SqlManagedInstance[]; + /** + * Link to retrieve next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Properties of sqlManagedInstance. */ +export interface SqlManagedInstanceProperties { + /** null */ + dataControllerId?: string; + /** The instance admin user */ + admin?: string; + /** The instance start time */ + startTime?: string; + /** The instance end time */ + endTime?: string; + /** The raw kubernetes information */ + k8SRaw?: SqlManagedInstanceK8SRaw; + /** Username and password for basic authentication. */ + basicLoginInformation?: BasicLoginInformation; + /** Last uploaded date from Kubernetes cluster. Defaults to current date time */ + lastUploadedDate?: Date; + /** + * The provisioning state of the Arc-enabled SQL Managed Instance resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** A base64-encoded keytab. */ + keytab?: string; + /** The license type to apply for this managed instance. */ + licenseType?: ArcSqlManagedInstanceLicenseType; + /** If a CustomLocation is provided, this contains the ARM id of the connected cluster the custom location belongs to. */ + clusterId?: string; + /** If a CustomLocation is provided, this contains the ARM id of the extension the custom location belongs to. */ + extensionId?: string; +} + +/** The raw kubernetes information. */ +export interface SqlManagedInstanceK8SRaw { + /** Describes unknown properties. The value of an unknown property can be of "any" type. */ + [property: string]: any; + /** The kubernetes spec information. */ + spec?: SqlManagedInstanceK8SSpec; +} + +/** The kubernetes spec information. */ +export interface SqlManagedInstanceK8SSpec { + /** Describes unknown properties. The value of an unknown property can be of "any" type. */ + [property: string]: any; + /** The kubernetes scheduling information. */ + scheduling?: K8SScheduling; + /** This option specifies the number of SQL Managed Instance replicas that will be deployed in your Kubernetes cluster for high availability purposes. If sku.tier is BusinessCritical, allowed values are '2' or '3' with default of '3'. If sku.tier is GeneralPurpose, replicas must be '1'. */ + replicas?: number; +} + +/** The kubernetes scheduling information. */ +export interface K8SScheduling { + /** Describes unknown properties. The value of an unknown property can be of "any" type. */ + [property: string]: any; + /** The kubernetes scheduling options. It describes restrictions used to help Kubernetes select appropriate nodes to host the database service */ + default?: K8SSchedulingOptions; +} + +/** The kubernetes scheduling options. It describes restrictions used to help Kubernetes select appropriate nodes to host the database service */ +export interface K8SSchedulingOptions { + /** Describes unknown properties. The value of an unknown property can be of "any" type. */ + [property: string]: any; + /** The kubernetes resource limits and requests used to restrict or reserve resource usage. */ + resources?: K8SResourceRequirements; +} + +/** The kubernetes resource limits and requests used to restrict or reserve resource usage. */ +export interface K8SResourceRequirements { + /** Describes unknown properties. The value of an unknown property can be of "any" type. */ + [property: string]: any; + /** Requests for a kubernetes resource type (e.g 'cpu', 'memory'). The 'cpu' request must be less than or equal to 'cpu' limit. Default 'cpu' is 2, minimum is 1. Default 'memory' is '4Gi', minimum is '2Gi. If sku.tier is GeneralPurpose, maximum 'cpu' is 24 and maximum 'memory' is '128Gi'. */ + requests?: { [propertyName: string]: string }; + /** Limits for a kubernetes resource type (e.g 'cpu', 'memory'). The 'cpu' request must be less than or equal to 'cpu' limit. Default 'cpu' is 2, minimum is 1. Default 'memory' is '4Gi', minimum is '2Gi. If sku.tier is GeneralPurpose, maximum 'cpu' is 24 and maximum 'memory' is '128Gi'. */ + limits?: { [propertyName: string]: string }; +} + +/** Username and password for basic login authentication. */ +export interface BasicLoginInformation { + /** Login username. */ + username?: string; + /** Login password. */ + password?: string; +} + +/** The complex type of the extended location. */ +export interface ExtendedLocation { + /** The name of the extended location. */ + name?: string; + /** The type of the extended location. */ + type?: ExtendedLocationTypes; +} + +/** The resource model definition representing SKU for Azure Managed Instance - Azure Arc */ +export interface SqlManagedInstanceSku { + /** The name of the SKU. */ + name: "vCore"; + /** The pricing tier for the instance. */ + tier?: SqlManagedInstanceSkuTier; + /** Whether dev/test is enabled. When the dev field is set to true, the resource is used for dev/test purpose. */ + dev?: boolean; + /** The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. */ + size?: string; + /** The SKU family */ + family?: string; + /** The SKU capacity */ + capacity?: number; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +/** An update to a SQL Managed Instance. */ +export interface SqlManagedInstanceUpdate { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; +} + +/** A list of SqlServerInstance. */ +export interface SqlServerInstanceListResult { + /** + * Array of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: SqlServerInstance[]; + /** + * Link to retrieve next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Properties of SqlServerInstance. */ +export interface SqlServerInstanceProperties { + /** SQL Server version. */ + version?: SqlVersion; + /** SQL Server edition. */ + edition?: EditionType; + /** ARM Resource id of the container resource (Azure Arc for Servers). */ + containerResourceId: string; + /** + * The time when the resource was created. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly createTime?: string; + /** The number of logical processors used by the SQL Server instance. */ + vCore?: string; + /** The cloud connectivity status. */ + status: ConnectionStatus; + /** SQL Server update level. */ + patchLevel?: string; + /** SQL Server collation. */ + collation?: string; + /** SQL Server current version. */ + currentVersion?: string; + /** SQL Server instance name. */ + instanceName?: string; + /** Dynamic TCP ports used by SQL Server. */ + tcpDynamicPorts?: string; + /** Static TCP ports used by SQL Server. */ + tcpStaticPorts?: string; + /** SQL Server product ID. */ + productId?: string; + /** SQL Server license type. */ + licenseType?: ArcSqlServerLicenseType; + /** Timestamp of last Azure Defender status update. */ + azureDefenderStatusLastUpdated?: Date; + /** Status of Azure Defender. */ + azureDefenderStatus?: DefenderStatus; + /** + * The provisioning state of the Arc-enabled SQL Server resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** Timestamp of ESU Expiration. */ + esuExpirationDate?: Date; + /** Type of host for Azure Arc SQL Server */ + hostType?: HostType; +} + +/** An update to a SQL Server Instance. */ +export interface SqlServerInstanceUpdate { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; +} + +/** A list of data controllers. */ +export interface PageOfDataControllerResource { + /** Array of results. */ + value?: DataControllerResource[]; + /** Link to retrieve next page of results. */ + nextLink?: string; +} + +/** The data controller properties. */ +export interface DataControllerProperties { + /** The infrastructure the data controller is running on. */ + infrastructure?: Infrastructure; + /** Properties from the Kubernetes data controller */ + onPremiseProperty?: OnPremiseProperty; + /** The raw kubernetes information */ + k8SRaw?: Record; + /** Properties on upload watermark. Mostly timestamp for each upload data type */ + uploadWatermark?: UploadWatermark; + /** Last uploaded date from Kubernetes cluster. Defaults to current date time */ + lastUploadedDate?: Date; + /** Deprecated. Azure Arc Data Services data controller no longer expose any endpoint. All traffic are exposed through Kubernetes native API. */ + basicLoginInformation?: BasicLoginInformation; + /** Login credential for metrics dashboard on the Kubernetes cluster. */ + metricsDashboardCredential?: BasicLoginInformation; + /** Login credential for logs dashboard on the Kubernetes cluster. */ + logsDashboardCredential?: BasicLoginInformation; + /** Log analytics workspace id and primary key */ + logAnalyticsWorkspaceConfig?: LogAnalyticsWorkspaceConfig; + /** Deprecated. Service principal is deprecated in favor of Arc Kubernetes service extension managed identity. */ + uploadServicePrincipal?: UploadServicePrincipal; + /** + * The provisioning state of the Arc Data Controller resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** If a CustomLocation is provided, this contains the ARM id of the connected cluster the custom location belongs to. */ + clusterId?: string; + /** If a CustomLocation is provided, this contains the ARM id of the extension the custom location belongs to. */ + extensionId?: string; +} + +/** Properties from the Kubernetes data controller */ +export interface OnPremiseProperty { + /** A globally unique ID identifying the associated Kubernetes cluster */ + id: string; + /** Certificate that contains the Kubernetes cluster public key used to verify signing */ + publicSigningKey: string; + /** Unique thumbprint returned to customer to verify the certificate being uploaded */ + signingCertificateThumbprint?: string; +} + +/** Properties on upload watermark. Mostly timestamp for each upload data type */ +export interface UploadWatermark { + /** Last uploaded date for metrics from kubernetes cluster. Defaults to current date time */ + metrics?: Date; + /** Last uploaded date for logs from kubernetes cluster. Defaults to current date time */ + logs?: Date; + /** Last uploaded date for usages from kubernetes cluster. Defaults to current date time */ + usages?: Date; +} + +/** Log analytics workspace id and primary key */ +export interface LogAnalyticsWorkspaceConfig { + /** Azure Log Analytics workspace ID */ + workspaceId?: string; + /** Primary key of the workspace */ + primaryKey?: string; +} + +/** Service principal for uploading billing, metrics and logs. */ +export interface UploadServicePrincipal { + /** Client ID of the service principal for uploading data. */ + clientId?: string; + /** Tenant ID of the service principal. */ + tenantId?: string; + /** Authority for the service principal. Example: https://login.microsoftonline.com/ */ + authority?: string; + /** Secret of the service principal */ + clientSecret?: string; +} + +/** Used for updating a data controller resource. */ +export interface DataControllerUpdate { + /** Resource tags */ + tags?: { [propertyName: string]: string }; +} + +/** A list of active directory connectors */ +export interface ActiveDirectoryConnectorListResult { + /** + * Array of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: ActiveDirectoryConnectorResource[]; + /** + * Link to retrieve next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** The properties of an Active Directory connector resource */ +export interface ActiveDirectoryConnectorProperties { + /** + * The provisioning state of the Active Directory connector resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** null */ + spec: ActiveDirectoryConnectorSpec; + /** null */ + status?: ActiveDirectoryConnectorStatus; +} + +/** The specifications of the AD Kubernetes resource. */ +export interface ActiveDirectoryConnectorSpec { + /** null */ + activeDirectory: ActiveDirectoryConnectorDomainDetails; + /** null */ + dns: ActiveDirectoryConnectorDNSDetails; +} + +/** Active Directory domain details */ +export interface ActiveDirectoryConnectorDomainDetails { + /** Name (uppercase) of the Active Directory domain that this AD connector will be associated with. */ + realm: string; + /** NETBIOS name of the Active Directory domain. */ + netbiosDomainName?: string; + /** null */ + domainControllers: ActiveDirectoryDomainControllers; +} + +/** Details about the Active Directory domain controllers associated with this AD connector instance */ +export interface ActiveDirectoryDomainControllers { + /** Information about the Primary Domain Controller (PDC) in the AD domain. */ + primaryDomainController?: ActiveDirectoryDomainController; + /** null */ + secondaryDomainControllers?: ActiveDirectoryDomainController[]; +} + +/** Information about a domain controller in the AD domain. */ +export interface ActiveDirectoryDomainController { + /** Fully-qualified domain name of a domain controller in the AD domain. */ + hostname: string; +} + +/** DNS server details */ +export interface ActiveDirectoryConnectorDNSDetails { + /** DNS domain name for which DNS lookups should be forwarded to the Active Directory DNS servers. */ + domainName?: string; + /** List of Active Directory DNS server IP addresses. */ + nameserverIPAddresses: string[]; + /** Replica count for DNS proxy service. Default value is 1. */ + replicas?: number; + /** Flag indicating whether to prefer Kubernetes DNS server response over AD DNS server response for IP address lookups. */ + preferK8SDnsForPtrLookups?: boolean; +} + +/** The status of the Kubernetes custom resource. */ +export interface ActiveDirectoryConnectorStatus { + /** Describes unknown properties. The value of an unknown property can be of "any" type. */ + [property: string]: any; + /** The time that the custom resource was last updated. */ + lastUpdateTime?: string; + /** The version of the replicaSet associated with the AD connector custom resource. */ + observedGeneration?: number; + /** The state of the AD connector custom resource. */ + state?: string; +} + +/** A list of PostgresInstance. */ +export interface PostgresInstanceListResult { + /** + * Array of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: PostgresInstance[]; + /** + * Link to retrieve next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Postgres Instance properties. */ +export interface PostgresInstanceProperties { + /** The data controller id */ + dataControllerId?: string; + /** The instance admin */ + admin?: string; + /** Username and password for basic authentication. */ + basicLoginInformation?: BasicLoginInformation; + /** The raw kubernetes information */ + k8SRaw?: Record; + /** Last uploaded date from Kubernetes cluster. Defaults to current date time */ + lastUploadedDate?: Date; + /** + * The provisioning state of the Azure Arc-enabled PostgreSQL instance. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +} + +/** The resource model definition representing SKU for ARM resources */ +export interface CommonSku { + /** The name of the SKU. It is typically a letter+number code */ + name: string; + /** Whether dev/test is enabled. When the dev field is set to true, the resource is used for dev/test purpose. */ + dev?: boolean; + /** The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. */ + size?: string; + /** If the service has different generations of hardware, for the same SKU, then that can be captured here. */ + family?: string; + /** If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. */ + capacity?: number; +} + +/** An update to a Postgres Instance. */ +export interface PostgresInstanceUpdate { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** Postgres Instance properties. */ + properties?: PostgresInstanceProperties; +} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export type TrackedResource = Resource & { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +}; + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export type ProxyResource = Resource & {}; + +/** The resource model definition representing SKU for Azure Database for PostgresSQL - Azure Arc */ +export type PostgresInstanceSku = CommonSku & { + /** This field is required to be implemented by the Resource Provider if the service has more than one tier. */ + tier?: "Hyperscale"; +}; + +/** A SqlManagedInstance. */ +export type SqlManagedInstance = TrackedResource & { + /** null */ + properties: SqlManagedInstanceProperties; + /** The extendedLocation of the resource. */ + extendedLocation?: ExtendedLocation; + /** Resource sku. */ + sku?: SqlManagedInstanceSku; +}; + +/** A SqlServerInstance. */ +export type SqlServerInstance = TrackedResource & { + /** null */ + properties?: SqlServerInstanceProperties; +}; + +/** Data controller resource */ +export type DataControllerResource = TrackedResource & { + /** The extendedLocation of the resource. */ + extendedLocation?: ExtendedLocation; + /** The data controller's properties */ + properties: DataControllerProperties; +}; + +/** A Postgres Instance. */ +export type PostgresInstance = TrackedResource & { + /** The extendedLocation of the resource. */ + extendedLocation?: ExtendedLocation; + /** null */ + properties: PostgresInstanceProperties; + /** Resource sku. */ + sku?: PostgresInstanceSku; +}; + +/** Active directory connector resource */ +export type ActiveDirectoryConnectorResource = ProxyResource & { + /** null */ + properties: ActiveDirectoryConnectorProperties; +}; + +/** Known values of {@link OperationOrigin} that the service accepts. */ +export enum KnownOperationOrigin { + User = "user", + System = "system" +} + +/** + * Defines values for OperationOrigin. \ + * {@link KnownOperationOrigin} can be used interchangeably with OperationOrigin, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user** \ + * **system** + */ +export type OperationOrigin = string; + +/** Known values of {@link ArcSqlManagedInstanceLicenseType} that the service accepts. */ +export enum KnownArcSqlManagedInstanceLicenseType { + BasePrice = "BasePrice", + LicenseIncluded = "LicenseIncluded", + DisasterRecovery = "DisasterRecovery" +} + +/** + * Defines values for ArcSqlManagedInstanceLicenseType. \ + * {@link KnownArcSqlManagedInstanceLicenseType} can be used interchangeably with ArcSqlManagedInstanceLicenseType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **BasePrice** \ + * **LicenseIncluded** \ + * **DisasterRecovery** + */ +export type ArcSqlManagedInstanceLicenseType = string; + +/** Known values of {@link ExtendedLocationTypes} that the service accepts. */ +export enum KnownExtendedLocationTypes { + CustomLocation = "CustomLocation" +} + +/** + * Defines values for ExtendedLocationTypes. \ + * {@link KnownExtendedLocationTypes} can be used interchangeably with ExtendedLocationTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **CustomLocation** + */ +export type ExtendedLocationTypes = 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 SqlVersion} that the service accepts. */ +export enum KnownSqlVersion { + SQLServer2012 = "SQL Server 2012", + SQLServer2014 = "SQL Server 2014", + SQLServer2016 = "SQL Server 2016", + SQLServer2017 = "SQL Server 2017", + SQLServer2019 = "SQL Server 2019", + SQLServer2022 = "SQL Server 2022", + Unknown = "Unknown" +} + +/** + * Defines values for SqlVersion. \ + * {@link KnownSqlVersion} can be used interchangeably with SqlVersion, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **SQL Server 2012** \ + * **SQL Server 2014** \ + * **SQL Server 2016** \ + * **SQL Server 2017** \ + * **SQL Server 2019** \ + * **SQL Server 2022** \ + * **Unknown** + */ +export type SqlVersion = string; + +/** Known values of {@link EditionType} that the service accepts. */ +export enum KnownEditionType { + Evaluation = "Evaluation", + Enterprise = "Enterprise", + Standard = "Standard", + Web = "Web", + Developer = "Developer", + Express = "Express" +} + +/** + * Defines values for EditionType. \ + * {@link KnownEditionType} can be used interchangeably with EditionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Evaluation** \ + * **Enterprise** \ + * **Standard** \ + * **Web** \ + * **Developer** \ + * **Express** + */ +export type EditionType = string; + +/** Known values of {@link ConnectionStatus} that the service accepts. */ +export enum KnownConnectionStatus { + Connected = "Connected", + Disconnected = "Disconnected", + Registered = "Registered", + Unknown = "Unknown" +} + +/** + * Defines values for ConnectionStatus. \ + * {@link KnownConnectionStatus} can be used interchangeably with ConnectionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Connected** \ + * **Disconnected** \ + * **Registered** \ + * **Unknown** + */ +export type ConnectionStatus = string; + +/** Known values of {@link ArcSqlServerLicenseType} that the service accepts. */ +export enum KnownArcSqlServerLicenseType { + Paid = "Paid", + Free = "Free", + Hadr = "HADR", + Undefined = "Undefined" +} + +/** + * Defines values for ArcSqlServerLicenseType. \ + * {@link KnownArcSqlServerLicenseType} can be used interchangeably with ArcSqlServerLicenseType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Paid** \ + * **Free** \ + * **HADR** \ + * **Undefined** + */ +export type ArcSqlServerLicenseType = string; + +/** Known values of {@link DefenderStatus} that the service accepts. */ +export enum KnownDefenderStatus { + Protected = "Protected", + Unprotected = "Unprotected", + Unknown = "Unknown" +} + +/** + * Defines values for DefenderStatus. \ + * {@link KnownDefenderStatus} can be used interchangeably with DefenderStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Protected** \ + * **Unprotected** \ + * **Unknown** + */ +export type DefenderStatus = string; + +/** Known values of {@link HostType} that the service accepts. */ +export enum KnownHostType { + VirtualMachine = "Virtual Machine", + PhysicalServer = "Physical Server", + AWSVirtualMachine = "AWS Virtual Machine", + GCPVirtualMachine = "GCP Virtual Machine", + Other = "Other" +} + +/** + * Defines values for HostType. \ + * {@link KnownHostType} can be used interchangeably with HostType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Virtual Machine** \ + * **Physical Server** \ + * **AWS Virtual Machine** \ + * **GCP Virtual Machine** \ + * **Other** + */ +export type HostType = string; +/** Defines values for SqlManagedInstanceSkuTier. */ +export type SqlManagedInstanceSkuTier = "GeneralPurpose" | "BusinessCritical"; +/** Defines values for Infrastructure. */ +export type Infrastructure = + | "azure" + | "gcp" + | "aws" + | "alibaba" + | "onpremises" + | "other"; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; + +/** Optional parameters. */ +export interface SqlManagedInstancesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type SqlManagedInstancesListResponse = SqlManagedInstanceListResult; + +/** Optional parameters. */ +export interface SqlManagedInstancesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type SqlManagedInstancesListByResourceGroupResponse = SqlManagedInstanceListResult; + +/** Optional parameters. */ +export interface SqlManagedInstancesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type SqlManagedInstancesGetResponse = SqlManagedInstance; + +/** Optional parameters. */ +export interface SqlManagedInstancesCreateOptionalParams + 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 create operation. */ +export type SqlManagedInstancesCreateResponse = SqlManagedInstance; + +/** Optional parameters. */ +export interface SqlManagedInstancesDeleteOptionalParams + 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 SqlManagedInstancesUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type SqlManagedInstancesUpdateResponse = SqlManagedInstance; + +/** Optional parameters. */ +export interface SqlManagedInstancesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type SqlManagedInstancesListNextResponse = SqlManagedInstanceListResult; + +/** Optional parameters. */ +export interface SqlManagedInstancesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type SqlManagedInstancesListByResourceGroupNextResponse = SqlManagedInstanceListResult; + +/** Optional parameters. */ +export interface SqlServerInstancesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type SqlServerInstancesListResponse = SqlServerInstanceListResult; + +/** Optional parameters. */ +export interface SqlServerInstancesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type SqlServerInstancesListByResourceGroupResponse = SqlServerInstanceListResult; + +/** Optional parameters. */ +export interface SqlServerInstancesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type SqlServerInstancesGetResponse = SqlServerInstance; + +/** Optional parameters. */ +export interface SqlServerInstancesCreateOptionalParams + 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 create operation. */ +export type SqlServerInstancesCreateResponse = SqlServerInstance; + +/** Optional parameters. */ +export interface SqlServerInstancesDeleteOptionalParams + 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 SqlServerInstancesUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type SqlServerInstancesUpdateResponse = SqlServerInstance; + +/** Optional parameters. */ +export interface SqlServerInstancesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type SqlServerInstancesListNextResponse = SqlServerInstanceListResult; + +/** Optional parameters. */ +export interface SqlServerInstancesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type SqlServerInstancesListByResourceGroupNextResponse = SqlServerInstanceListResult; + +/** Optional parameters. */ +export interface DataControllersListInSubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listInSubscription operation. */ +export type DataControllersListInSubscriptionResponse = PageOfDataControllerResource; + +/** Optional parameters. */ +export interface DataControllersListInGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listInGroup operation. */ +export type DataControllersListInGroupResponse = PageOfDataControllerResource; + +/** Optional parameters. */ +export interface DataControllersPutDataControllerOptionalParams + 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 putDataController operation. */ +export type DataControllersPutDataControllerResponse = DataControllerResource; + +/** Optional parameters. */ +export interface DataControllersDeleteDataControllerOptionalParams + 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 DataControllersGetDataControllerOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getDataController operation. */ +export type DataControllersGetDataControllerResponse = DataControllerResource; + +/** Optional parameters. */ +export interface DataControllersPatchDataControllerOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the patchDataController operation. */ +export type DataControllersPatchDataControllerResponse = DataControllerResource; + +/** Optional parameters. */ +export interface DataControllersListInSubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listInSubscriptionNext operation. */ +export type DataControllersListInSubscriptionNextResponse = PageOfDataControllerResource; + +/** Optional parameters. */ +export interface DataControllersListInGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listInGroupNext operation. */ +export type DataControllersListInGroupNextResponse = PageOfDataControllerResource; + +/** Optional parameters. */ +export interface ActiveDirectoryConnectorsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type ActiveDirectoryConnectorsListResponse = ActiveDirectoryConnectorListResult; + +/** Optional parameters. */ +export interface ActiveDirectoryConnectorsCreateOptionalParams + 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 create operation. */ +export type ActiveDirectoryConnectorsCreateResponse = ActiveDirectoryConnectorResource; + +/** Optional parameters. */ +export interface ActiveDirectoryConnectorsDeleteOptionalParams + 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 ActiveDirectoryConnectorsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ActiveDirectoryConnectorsGetResponse = ActiveDirectoryConnectorResource; + +/** Optional parameters. */ +export interface ActiveDirectoryConnectorsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type ActiveDirectoryConnectorsListNextResponse = ActiveDirectoryConnectorListResult; + +/** Optional parameters. */ +export interface PostgresInstancesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type PostgresInstancesListResponse = PostgresInstanceListResult; + +/** Optional parameters. */ +export interface PostgresInstancesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type PostgresInstancesListByResourceGroupResponse = PostgresInstanceListResult; + +/** Optional parameters. */ +export interface PostgresInstancesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type PostgresInstancesGetResponse = PostgresInstance; + +/** Optional parameters. */ +export interface PostgresInstancesCreateOptionalParams + 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 create operation. */ +export type PostgresInstancesCreateResponse = PostgresInstance; + +/** Optional parameters. */ +export interface PostgresInstancesDeleteOptionalParams + 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 PostgresInstancesUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type PostgresInstancesUpdateResponse = PostgresInstance; + +/** Optional parameters. */ +export interface PostgresInstancesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type PostgresInstancesListNextResponse = PostgresInstanceListResult; + +/** Optional parameters. */ +export interface PostgresInstancesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type PostgresInstancesListByResourceGroupNextResponse = PostgresInstanceListResult; + +/** Optional parameters. */ +export interface AzureArcDataManagementClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/azurearcdata/arm-azurearcdata/src/models/mappers.ts b/sdk/azurearcdata/arm-azurearcdata/src/models/mappers.ts new file mode 100644 index 000000000000..932287317c61 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/models/mappers.ts @@ -0,0 +1,1546 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; + +export const OperationListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Operation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + serializedName: "origin", + readOnly: true, + type: { + name: "String" + } + }, + isDataAction: { + serializedName: "isDataAction", + required: true, + type: { + name: "Boolean" + } + }, + properties: { + serializedName: "properties", + readOnly: true, + type: { + name: "Dictionary", + value: { + type: { name: "Dictionary", value: { type: { name: "any" } } } + } + } + } + } + } +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + required: true, + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + required: true, + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + required: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorResponseBody" + } + } + } + } +}; + +export const ErrorResponseBody: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponseBody", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + }, + target: { + serializedName: "target", + type: { + name: "String" + } + }, + details: { + serializedName: "details", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorResponseBody" + } + } + } + } + } + } +}; + +export const SqlManagedInstanceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SqlManagedInstanceListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SqlManagedInstance" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const SqlManagedInstanceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SqlManagedInstanceProperties", + modelProperties: { + dataControllerId: { + serializedName: "dataControllerId", + type: { + name: "String" + } + }, + admin: { + serializedName: "admin", + type: { + name: "String" + } + }, + startTime: { + serializedName: "startTime", + type: { + name: "String" + } + }, + endTime: { + serializedName: "endTime", + type: { + name: "String" + } + }, + k8SRaw: { + serializedName: "k8sRaw", + type: { + name: "Composite", + className: "SqlManagedInstanceK8SRaw" + } + }, + basicLoginInformation: { + serializedName: "basicLoginInformation", + type: { + name: "Composite", + className: "BasicLoginInformation" + } + }, + lastUploadedDate: { + serializedName: "lastUploadedDate", + type: { + name: "DateTime" + } + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + keytab: { + serializedName: "keytab", + type: { + name: "String" + } + }, + licenseType: { + defaultValue: "BasePrice", + serializedName: "licenseType", + type: { + name: "String" + } + }, + clusterId: { + serializedName: "clusterId", + type: { + name: "String" + } + }, + extensionId: { + serializedName: "extensionId", + type: { + name: "String" + } + } + } + } +}; + +export const SqlManagedInstanceK8SRaw: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SqlManagedInstanceK8SRaw", + additionalProperties: { type: { name: "Object" } }, + modelProperties: { + spec: { + serializedName: "spec", + type: { + name: "Composite", + className: "SqlManagedInstanceK8SSpec" + } + } + } + } +}; + +export const SqlManagedInstanceK8SSpec: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SqlManagedInstanceK8SSpec", + additionalProperties: { type: { name: "Object" } }, + modelProperties: { + scheduling: { + serializedName: "scheduling", + type: { + name: "Composite", + className: "K8SScheduling" + } + }, + replicas: { + serializedName: "replicas", + type: { + name: "Number" + } + } + } + } +}; + +export const K8SScheduling: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "K8SScheduling", + additionalProperties: { type: { name: "Object" } }, + modelProperties: { + default: { + serializedName: "default", + type: { + name: "Composite", + className: "K8SSchedulingOptions" + } + } + } + } +}; + +export const K8SSchedulingOptions: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "K8SSchedulingOptions", + additionalProperties: { type: { name: "Object" } }, + modelProperties: { + resources: { + serializedName: "resources", + type: { + name: "Composite", + className: "K8SResourceRequirements" + } + } + } + } +}; + +export const K8SResourceRequirements: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "K8SResourceRequirements", + additionalProperties: { type: { name: "Object" } }, + modelProperties: { + requests: { + serializedName: "requests", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + limits: { + serializedName: "limits", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const BasicLoginInformation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BasicLoginInformation", + modelProperties: { + username: { + serializedName: "username", + type: { + name: "String" + } + }, + password: { + serializedName: "password", + type: { + name: "String" + } + } + } + } +}; + +export const ExtendedLocation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExtendedLocation", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const SqlManagedInstanceSku: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SqlManagedInstanceSku", + modelProperties: { + name: { + defaultValue: "vCore", + isConstant: true, + serializedName: "name", + type: { + name: "String" + } + }, + tier: { + defaultValue: "GeneralPurpose", + serializedName: "tier", + type: { + name: "Enum", + allowedValues: ["GeneralPurpose", "BusinessCritical"] + } + }, + dev: { + defaultValue: true, + serializedName: "dev", + type: { + name: "Boolean" + } + }, + size: { + serializedName: "size", + type: { + name: "String" + } + }, + family: { + serializedName: "family", + type: { + name: "String" + } + }, + capacity: { + serializedName: "capacity", + type: { + name: "Number" + } + } + } + } +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const SystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } + } + } + } +}; + +export const SqlManagedInstanceUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SqlManagedInstanceUpdate", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const SqlServerInstanceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SqlServerInstanceListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SqlServerInstance" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const SqlServerInstanceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SqlServerInstanceProperties", + modelProperties: { + version: { + serializedName: "version", + type: { + name: "String" + } + }, + edition: { + serializedName: "edition", + type: { + name: "String" + } + }, + containerResourceId: { + serializedName: "containerResourceId", + required: true, + type: { + name: "String" + } + }, + createTime: { + serializedName: "createTime", + readOnly: true, + type: { + name: "String" + } + }, + vCore: { + serializedName: "vCore", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + required: true, + type: { + name: "String" + } + }, + patchLevel: { + serializedName: "patchLevel", + type: { + name: "String" + } + }, + collation: { + serializedName: "collation", + type: { + name: "String" + } + }, + currentVersion: { + serializedName: "currentVersion", + type: { + name: "String" + } + }, + instanceName: { + serializedName: "instanceName", + type: { + name: "String" + } + }, + tcpDynamicPorts: { + serializedName: "tcpDynamicPorts", + type: { + name: "String" + } + }, + tcpStaticPorts: { + serializedName: "tcpStaticPorts", + type: { + name: "String" + } + }, + productId: { + serializedName: "productId", + type: { + name: "String" + } + }, + licenseType: { + serializedName: "licenseType", + type: { + name: "String" + } + }, + azureDefenderStatusLastUpdated: { + serializedName: "azureDefenderStatusLastUpdated", + type: { + name: "DateTime" + } + }, + azureDefenderStatus: { + serializedName: "azureDefenderStatus", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + esuExpirationDate: { + serializedName: "esuExpirationDate", + type: { + name: "DateTime" + } + }, + hostType: { + serializedName: "hostType", + type: { + name: "String" + } + } + } + } +}; + +export const SqlServerInstanceUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SqlServerInstanceUpdate", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const PageOfDataControllerResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PageOfDataControllerResource", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DataControllerResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const DataControllerProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataControllerProperties", + modelProperties: { + infrastructure: { + defaultValue: "other", + serializedName: "infrastructure", + type: { + name: "Enum", + allowedValues: [ + "azure", + "gcp", + "aws", + "alibaba", + "onpremises", + "other" + ] + } + }, + onPremiseProperty: { + serializedName: "onPremiseProperty", + type: { + name: "Composite", + className: "OnPremiseProperty" + } + }, + k8SRaw: { + serializedName: "k8sRaw", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + }, + uploadWatermark: { + serializedName: "uploadWatermark", + type: { + name: "Composite", + className: "UploadWatermark" + } + }, + lastUploadedDate: { + serializedName: "lastUploadedDate", + type: { + name: "DateTime" + } + }, + basicLoginInformation: { + serializedName: "basicLoginInformation", + type: { + name: "Composite", + className: "BasicLoginInformation" + } + }, + metricsDashboardCredential: { + serializedName: "metricsDashboardCredential", + type: { + name: "Composite", + className: "BasicLoginInformation" + } + }, + logsDashboardCredential: { + serializedName: "logsDashboardCredential", + type: { + name: "Composite", + className: "BasicLoginInformation" + } + }, + logAnalyticsWorkspaceConfig: { + serializedName: "logAnalyticsWorkspaceConfig", + type: { + name: "Composite", + className: "LogAnalyticsWorkspaceConfig" + } + }, + uploadServicePrincipal: { + serializedName: "uploadServicePrincipal", + type: { + name: "Composite", + className: "UploadServicePrincipal" + } + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + clusterId: { + serializedName: "clusterId", + type: { + name: "String" + } + }, + extensionId: { + serializedName: "extensionId", + type: { + name: "String" + } + } + } + } +}; + +export const OnPremiseProperty: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OnPremiseProperty", + modelProperties: { + id: { + serializedName: "id", + required: true, + type: { + name: "Uuid" + } + }, + publicSigningKey: { + serializedName: "publicSigningKey", + required: true, + type: { + name: "String" + } + }, + signingCertificateThumbprint: { + serializedName: "signingCertificateThumbprint", + type: { + name: "String" + } + } + } + } +}; + +export const UploadWatermark: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UploadWatermark", + modelProperties: { + metrics: { + serializedName: "metrics", + type: { + name: "DateTime" + } + }, + logs: { + serializedName: "logs", + type: { + name: "DateTime" + } + }, + usages: { + serializedName: "usages", + type: { + name: "DateTime" + } + } + } + } +}; + +export const LogAnalyticsWorkspaceConfig: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LogAnalyticsWorkspaceConfig", + modelProperties: { + workspaceId: { + serializedName: "workspaceId", + type: { + name: "Uuid" + } + }, + primaryKey: { + serializedName: "primaryKey", + type: { + name: "String" + } + } + } + } +}; + +export const UploadServicePrincipal: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UploadServicePrincipal", + modelProperties: { + clientId: { + serializedName: "clientId", + type: { + name: "Uuid" + } + }, + tenantId: { + serializedName: "tenantId", + type: { + name: "Uuid" + } + }, + authority: { + serializedName: "authority", + type: { + name: "String" + } + }, + clientSecret: { + serializedName: "clientSecret", + type: { + name: "String" + } + } + } + } +}; + +export const DataControllerUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataControllerUpdate", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const ActiveDirectoryConnectorListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ActiveDirectoryConnectorListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ActiveDirectoryConnectorResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ActiveDirectoryConnectorProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ActiveDirectoryConnectorProperties", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + spec: { + serializedName: "spec", + type: { + name: "Composite", + className: "ActiveDirectoryConnectorSpec" + } + }, + status: { + serializedName: "status", + type: { + name: "Composite", + className: "ActiveDirectoryConnectorStatus" + } + } + } + } +}; + +export const ActiveDirectoryConnectorSpec: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ActiveDirectoryConnectorSpec", + modelProperties: { + activeDirectory: { + serializedName: "activeDirectory", + type: { + name: "Composite", + className: "ActiveDirectoryConnectorDomainDetails" + } + }, + dns: { + serializedName: "dns", + type: { + name: "Composite", + className: "ActiveDirectoryConnectorDNSDetails" + } + } + } + } +}; + +export const ActiveDirectoryConnectorDomainDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ActiveDirectoryConnectorDomainDetails", + modelProperties: { + realm: { + serializedName: "realm", + required: true, + type: { + name: "String" + } + }, + netbiosDomainName: { + serializedName: "netbiosDomainName", + type: { + name: "String" + } + }, + domainControllers: { + serializedName: "domainControllers", + type: { + name: "Composite", + className: "ActiveDirectoryDomainControllers" + } + } + } + } +}; + +export const ActiveDirectoryDomainControllers: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ActiveDirectoryDomainControllers", + modelProperties: { + primaryDomainController: { + serializedName: "primaryDomainController", + type: { + name: "Composite", + className: "ActiveDirectoryDomainController" + } + }, + secondaryDomainControllers: { + serializedName: "secondaryDomainControllers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ActiveDirectoryDomainController" + } + } + } + } + } + } +}; + +export const ActiveDirectoryDomainController: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ActiveDirectoryDomainController", + modelProperties: { + hostname: { + serializedName: "hostname", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const ActiveDirectoryConnectorDNSDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ActiveDirectoryConnectorDNSDetails", + modelProperties: { + domainName: { + serializedName: "domainName", + type: { + name: "String" + } + }, + nameserverIPAddresses: { + serializedName: "nameserverIPAddresses", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + replicas: { + defaultValue: 1, + serializedName: "replicas", + type: { + name: "Number" + } + }, + preferK8SDnsForPtrLookups: { + defaultValue: true, + serializedName: "preferK8sDnsForPtrLookups", + type: { + name: "Boolean" + } + } + } + } +}; + +export const ActiveDirectoryConnectorStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ActiveDirectoryConnectorStatus", + additionalProperties: { type: { name: "Object" } }, + modelProperties: { + lastUpdateTime: { + serializedName: "lastUpdateTime", + type: { + name: "String" + } + }, + observedGeneration: { + serializedName: "observedGeneration", + type: { + name: "Number" + } + }, + state: { + serializedName: "state", + type: { + name: "String" + } + } + } + } +}; + +export const PostgresInstanceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PostgresInstanceListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PostgresInstance" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const PostgresInstanceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PostgresInstanceProperties", + modelProperties: { + dataControllerId: { + serializedName: "dataControllerId", + type: { + name: "String" + } + }, + admin: { + serializedName: "admin", + type: { + name: "String" + } + }, + basicLoginInformation: { + serializedName: "basicLoginInformation", + type: { + name: "Composite", + className: "BasicLoginInformation" + } + }, + k8SRaw: { + serializedName: "k8sRaw", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + }, + lastUploadedDate: { + serializedName: "lastUploadedDate", + type: { + name: "DateTime" + } + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const CommonSku: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CommonSku", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + dev: { + defaultValue: true, + serializedName: "dev", + type: { + name: "Boolean" + } + }, + size: { + serializedName: "size", + type: { + name: "String" + } + }, + family: { + serializedName: "family", + type: { + name: "String" + } + }, + capacity: { + serializedName: "capacity", + type: { + name: "Number" + } + } + } + } +}; + +export const PostgresInstanceUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PostgresInstanceUpdate", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "PostgresInstanceProperties" + } + } + } + } +}; + +export const TrackedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties + } + } +}; + +export const PostgresInstanceSku: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PostgresInstanceSku", + modelProperties: { + ...CommonSku.type.modelProperties, + tier: { + defaultValue: "Hyperscale", + isConstant: true, + serializedName: "tier", + type: { + name: "String" + } + } + } + } +}; + +export const SqlManagedInstance: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SqlManagedInstance", + modelProperties: { + ...TrackedResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "SqlManagedInstanceProperties" + } + }, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "SqlManagedInstanceSku" + } + } + } + } +}; + +export const SqlServerInstance: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SqlServerInstance", + modelProperties: { + ...TrackedResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "SqlServerInstanceProperties" + } + } + } + } +}; + +export const DataControllerResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataControllerResource", + modelProperties: { + ...TrackedResource.type.modelProperties, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "DataControllerProperties" + } + } + } + } +}; + +export const PostgresInstance: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PostgresInstance", + modelProperties: { + ...TrackedResource.type.modelProperties, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "PostgresInstanceProperties" + } + }, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "PostgresInstanceSku" + } + } + } + } +}; + +export const ActiveDirectoryConnectorResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ActiveDirectoryConnectorResource", + modelProperties: { + ...ProxyResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "ActiveDirectoryConnectorProperties" + } + } + } + } +}; diff --git a/sdk/azurearcdata/arm-azurearcdata/src/models/parameters.ts b/sdk/azurearcdata/arm-azurearcdata/src/models/parameters.ts new file mode 100644 index 000000000000..dbbb1717d85e --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/models/parameters.ts @@ -0,0 +1,206 @@ +/* + * 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 { + SqlManagedInstance as SqlManagedInstanceMapper, + SqlManagedInstanceUpdate as SqlManagedInstanceUpdateMapper, + SqlServerInstance as SqlServerInstanceMapper, + SqlServerInstanceUpdate as SqlServerInstanceUpdateMapper, + DataControllerResource as DataControllerResourceMapper, + DataControllerUpdate as DataControllerUpdateMapper, + ActiveDirectoryConnectorResource as ActiveDirectoryConnectorResourceMapper, + PostgresInstance as PostgresInstanceMapper, + PostgresInstanceUpdate as PostgresInstanceUpdateMapper +} from "../models/mappers"; + +export const accept: OperationParameter = { + parameterPath: "accept", + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" + } + } +}; + +export const $host: OperationURLParameter = { + parameterPath: "$host", + mapper: { + serializedName: "$host", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2022-03-01-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const 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 sqlManagedInstanceName: OperationURLParameter = { + parameterPath: "sqlManagedInstanceName", + mapper: { + serializedName: "sqlManagedInstanceName", + 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 sqlManagedInstance: OperationParameter = { + parameterPath: "sqlManagedInstance", + mapper: SqlManagedInstanceMapper +}; + +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: SqlManagedInstanceUpdateMapper +}; + +export const sqlServerInstanceName: OperationURLParameter = { + parameterPath: "sqlServerInstanceName", + mapper: { + serializedName: "sqlServerInstanceName", + required: true, + type: { + name: "String" + } + } +}; + +export const sqlServerInstance: OperationParameter = { + parameterPath: "sqlServerInstance", + mapper: SqlServerInstanceMapper +}; + +export const parameters1: OperationParameter = { + parameterPath: "parameters", + mapper: SqlServerInstanceUpdateMapper +}; + +export const dataControllerResource: OperationParameter = { + parameterPath: "dataControllerResource", + mapper: DataControllerResourceMapper +}; + +export const dataControllerName: OperationURLParameter = { + parameterPath: "dataControllerName", + mapper: { + serializedName: "dataControllerName", + required: true, + type: { + name: "String" + } + } +}; + +export const dataControllerResource1: OperationParameter = { + parameterPath: "dataControllerResource", + mapper: DataControllerUpdateMapper +}; + +export const activeDirectoryConnectorResource: OperationParameter = { + parameterPath: "activeDirectoryConnectorResource", + mapper: ActiveDirectoryConnectorResourceMapper +}; + +export const activeDirectoryConnectorName: OperationURLParameter = { + parameterPath: "activeDirectoryConnectorName", + mapper: { + serializedName: "activeDirectoryConnectorName", + required: true, + type: { + name: "String" + } + } +}; + +export const postgresInstanceName: OperationURLParameter = { + parameterPath: "postgresInstanceName", + mapper: { + serializedName: "postgresInstanceName", + required: true, + type: { + name: "String" + } + } +}; + +export const resource: OperationParameter = { + parameterPath: "resource", + mapper: PostgresInstanceMapper +}; + +export const parameters2: OperationParameter = { + parameterPath: "parameters", + mapper: PostgresInstanceUpdateMapper +}; diff --git a/sdk/azurearcdata/arm-azurearcdata/src/operations/activeDirectoryConnectors.ts b/sdk/azurearcdata/arm-azurearcdata/src/operations/activeDirectoryConnectors.ts new file mode 100644 index 000000000000..11c344e910bb --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/operations/activeDirectoryConnectors.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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { ActiveDirectoryConnectors } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureArcDataManagementClient } from "../azureArcDataManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + ActiveDirectoryConnectorResource, + ActiveDirectoryConnectorsListNextOptionalParams, + ActiveDirectoryConnectorsListOptionalParams, + ActiveDirectoryConnectorsListResponse, + ActiveDirectoryConnectorsCreateOptionalParams, + ActiveDirectoryConnectorsCreateResponse, + ActiveDirectoryConnectorsDeleteOptionalParams, + ActiveDirectoryConnectorsGetOptionalParams, + ActiveDirectoryConnectorsGetResponse, + ActiveDirectoryConnectorsListNextResponse +} from "../models"; + +/// +/** Class containing ActiveDirectoryConnectors operations. */ +export class ActiveDirectoryConnectorsImpl + implements ActiveDirectoryConnectors { + private readonly client: AzureArcDataManagementClient; + + /** + * Initialize a new instance of the class ActiveDirectoryConnectors class. + * @param client Reference to the service client + */ + constructor(client: AzureArcDataManagementClient) { + this.client = client; + } + + /** + * List the active directory connectors associated with the given data controller. + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName The name of the data controller + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + dataControllerName: string, + options?: ActiveDirectoryConnectorsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + resourceGroupName, + dataControllerName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage( + resourceGroupName, + dataControllerName, + options + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + dataControllerName: string, + options?: ActiveDirectoryConnectorsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list( + resourceGroupName, + dataControllerName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + dataControllerName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + dataControllerName: string, + options?: ActiveDirectoryConnectorsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + dataControllerName, + options + )) { + yield* page; + } + } + + /** + * List the active directory connectors associated with the given data controller. + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName The name of the data controller + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + dataControllerName: string, + options?: ActiveDirectoryConnectorsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, dataControllerName, options }, + listOperationSpec + ); + } + + /** + * Creates or replaces an Active Directory connector resource. + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName The name of the data controller + * @param activeDirectoryConnectorName The name of the Active Directory connector instance + * @param activeDirectoryConnectorResource desc + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + dataControllerName: string, + activeDirectoryConnectorName: string, + activeDirectoryConnectorResource: ActiveDirectoryConnectorResource, + options?: ActiveDirectoryConnectorsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ActiveDirectoryConnectorsCreateResponse + > + > { + 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, + dataControllerName, + activeDirectoryConnectorName, + activeDirectoryConnectorResource, + options + }, + createOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Creates or replaces an Active Directory connector resource. + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName The name of the data controller + * @param activeDirectoryConnectorName The name of the Active Directory connector instance + * @param activeDirectoryConnectorResource desc + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + dataControllerName: string, + activeDirectoryConnectorName: string, + activeDirectoryConnectorResource: ActiveDirectoryConnectorResource, + options?: ActiveDirectoryConnectorsCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + dataControllerName, + activeDirectoryConnectorName, + activeDirectoryConnectorResource, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes an Active Directory connector resource + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName The name of the data controller + * @param activeDirectoryConnectorName The name of the Active Directory connector instance + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + dataControllerName: string, + activeDirectoryConnectorName: string, + options?: ActiveDirectoryConnectorsDeleteOptionalParams + ): 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, + dataControllerName, + activeDirectoryConnectorName, + options + }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Deletes an Active Directory connector resource + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName The name of the data controller + * @param activeDirectoryConnectorName The name of the Active Directory connector instance + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + dataControllerName: string, + activeDirectoryConnectorName: string, + options?: ActiveDirectoryConnectorsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + dataControllerName, + activeDirectoryConnectorName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Retrieves an Active Directory connector resource + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName The name of the data controller + * @param activeDirectoryConnectorName The name of the Active Directory connector instance + * @param options The options parameters. + */ + get( + resourceGroupName: string, + dataControllerName: string, + activeDirectoryConnectorName: string, + options?: ActiveDirectoryConnectorsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + dataControllerName, + activeDirectoryConnectorName, + options + }, + getOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName The name of the data controller + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + dataControllerName: string, + nextLink: string, + options?: ActiveDirectoryConnectorsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, dataControllerName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}/activeDirectoryConnectors", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ActiveDirectoryConnectorListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.dataControllerName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}/activeDirectoryConnectors/{activeDirectoryConnectorName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ActiveDirectoryConnectorResource + }, + 201: { + bodyMapper: Mappers.ActiveDirectoryConnectorResource + }, + 202: { + bodyMapper: Mappers.ActiveDirectoryConnectorResource + }, + 204: { + bodyMapper: Mappers.ActiveDirectoryConnectorResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.activeDirectoryConnectorResource, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.dataControllerName, + Parameters.activeDirectoryConnectorName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}/activeDirectoryConnectors/{activeDirectoryConnectorName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.dataControllerName, + Parameters.activeDirectoryConnectorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}/activeDirectoryConnectors/{activeDirectoryConnectorName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ActiveDirectoryConnectorResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.dataControllerName, + Parameters.activeDirectoryConnectorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ActiveDirectoryConnectorListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.dataControllerName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/azurearcdata/arm-azurearcdata/src/operations/dataControllers.ts b/sdk/azurearcdata/arm-azurearcdata/src/operations/dataControllers.ts new file mode 100644 index 000000000000..f8a612667b78 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/operations/dataControllers.ts @@ -0,0 +1,605 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { DataControllers } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureArcDataManagementClient } from "../azureArcDataManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + DataControllerResource, + DataControllersListInSubscriptionNextOptionalParams, + DataControllersListInSubscriptionOptionalParams, + DataControllersListInGroupNextOptionalParams, + DataControllersListInGroupOptionalParams, + DataControllersListInSubscriptionResponse, + DataControllersListInGroupResponse, + DataControllersPutDataControllerOptionalParams, + DataControllersPutDataControllerResponse, + DataControllersDeleteDataControllerOptionalParams, + DataControllersGetDataControllerOptionalParams, + DataControllersGetDataControllerResponse, + DataControllerUpdate, + DataControllersPatchDataControllerOptionalParams, + DataControllersPatchDataControllerResponse, + DataControllersListInSubscriptionNextResponse, + DataControllersListInGroupNextResponse +} from "../models"; + +/// +/** Class containing DataControllers operations. */ +export class DataControllersImpl implements DataControllers { + private readonly client: AzureArcDataManagementClient; + + /** + * Initialize a new instance of the class DataControllers class. + * @param client Reference to the service client + */ + constructor(client: AzureArcDataManagementClient) { + this.client = client; + } + + /** + * List dataController resources in the subscription + * @param options The options parameters. + */ + public listInSubscription( + options?: DataControllersListInSubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listInSubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listInSubscriptionPagingPage(options); + } + }; + } + + private async *listInSubscriptionPagingPage( + options?: DataControllersListInSubscriptionOptionalParams + ): AsyncIterableIterator { + let result = await this._listInSubscription(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listInSubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listInSubscriptionPagingAll( + options?: DataControllersListInSubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listInSubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * List dataController resources in the resource group + * @param resourceGroupName The name of the Azure resource group + * @param options The options parameters. + */ + public listInGroup( + resourceGroupName: string, + options?: DataControllersListInGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listInGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listInGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listInGroupPagingPage( + resourceGroupName: string, + options?: DataControllersListInGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listInGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listInGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listInGroupPagingAll( + resourceGroupName: string, + options?: DataControllersListInGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listInGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * List dataController resources in the subscription + * @param options The options parameters. + */ + private _listInSubscription( + options?: DataControllersListInSubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listInSubscriptionOperationSpec + ); + } + + /** + * List dataController resources in the resource group + * @param resourceGroupName The name of the Azure resource group + * @param options The options parameters. + */ + private _listInGroup( + resourceGroupName: string, + options?: DataControllersListInGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listInGroupOperationSpec + ); + } + + /** + * Creates or replaces a dataController resource + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName The name of the data controller + * @param dataControllerResource desc + * @param options The options parameters. + */ + async beginPutDataController( + resourceGroupName: string, + dataControllerName: string, + dataControllerResource: DataControllerResource, + options?: DataControllersPutDataControllerOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DataControllersPutDataControllerResponse + > + > { + 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, + dataControllerName, + dataControllerResource, + options + }, + putDataControllerOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Creates or replaces a dataController resource + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName The name of the data controller + * @param dataControllerResource desc + * @param options The options parameters. + */ + async beginPutDataControllerAndWait( + resourceGroupName: string, + dataControllerName: string, + dataControllerResource: DataControllerResource, + options?: DataControllersPutDataControllerOptionalParams + ): Promise { + const poller = await this.beginPutDataController( + resourceGroupName, + dataControllerName, + dataControllerResource, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a dataController resource + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName The name of the data controller + * @param options The options parameters. + */ + async beginDeleteDataController( + resourceGroupName: string, + dataControllerName: string, + options?: DataControllersDeleteDataControllerOptionalParams + ): 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, dataControllerName, options }, + deleteDataControllerOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Deletes a dataController resource + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName The name of the data controller + * @param options The options parameters. + */ + async beginDeleteDataControllerAndWait( + resourceGroupName: string, + dataControllerName: string, + options?: DataControllersDeleteDataControllerOptionalParams + ): Promise { + const poller = await this.beginDeleteDataController( + resourceGroupName, + dataControllerName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Retrieves a dataController resource + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName The name of the data controller + * @param options The options parameters. + */ + getDataController( + resourceGroupName: string, + dataControllerName: string, + options?: DataControllersGetDataControllerOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, dataControllerName, options }, + getDataControllerOperationSpec + ); + } + + /** + * Updates a dataController resource + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName The name of the data controller + * @param dataControllerResource The update data controller resource + * @param options The options parameters. + */ + patchDataController( + resourceGroupName: string, + dataControllerName: string, + dataControllerResource: DataControllerUpdate, + options?: DataControllersPatchDataControllerOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + dataControllerName, + dataControllerResource, + options + }, + patchDataControllerOperationSpec + ); + } + + /** + * ListInSubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListInSubscription method. + * @param options The options parameters. + */ + private _listInSubscriptionNext( + nextLink: string, + options?: DataControllersListInSubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listInSubscriptionNextOperationSpec + ); + } + + /** + * ListInGroupNext + * @param resourceGroupName The name of the Azure resource group + * @param nextLink The nextLink from the previous successful call to the ListInGroup method. + * @param options The options parameters. + */ + private _listInGroupNext( + resourceGroupName: string, + nextLink: string, + options?: DataControllersListInGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listInGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listInSubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.AzureArcData/dataControllers", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PageOfDataControllerResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listInGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PageOfDataControllerResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const putDataControllerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.DataControllerResource + }, + 201: { + bodyMapper: Mappers.DataControllerResource + }, + 202: { + bodyMapper: Mappers.DataControllerResource + }, + 204: { + bodyMapper: Mappers.DataControllerResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.dataControllerResource, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.dataControllerName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteDataControllerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.dataControllerName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getDataControllerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DataControllerResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.dataControllerName + ], + headerParameters: [Parameters.accept], + serializer +}; +const patchDataControllerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.DataControllerResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.dataControllerResource1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.dataControllerName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listInSubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PageOfDataControllerResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listInGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PageOfDataControllerResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/azurearcdata/arm-azurearcdata/src/operations/index.ts b/sdk/azurearcdata/arm-azurearcdata/src/operations/index.ts new file mode 100644 index 000000000000..080d3a4954a5 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/operations/index.ts @@ -0,0 +1,14 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./operations"; +export * from "./sqlManagedInstances"; +export * from "./sqlServerInstances"; +export * from "./dataControllers"; +export * from "./activeDirectoryConnectors"; +export * from "./postgresInstances"; diff --git a/sdk/azurearcdata/arm-azurearcdata/src/operations/operations.ts b/sdk/azurearcdata/arm-azurearcdata/src/operations/operations.ts new file mode 100644 index 000000000000..6a51c9252104 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/operations/operations.ts @@ -0,0 +1,137 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureArcDataManagementClient } from "../azureArcDataManagementClient"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; + +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: AzureArcDataManagementClient; + + /** + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client + */ + constructor(client: AzureArcDataManagementClient) { + this.client = client; + } + + /** + * Lists all of the available Azure Data Services on Azure Arc API operations. + * @param options The options parameters. + */ + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Lists all of the available Azure Data Services on Azure Arc API operations. + * @param options The options parameters. + */ + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.AzureArcData/operations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/azurearcdata/arm-azurearcdata/src/operations/postgresInstances.ts b/sdk/azurearcdata/arm-azurearcdata/src/operations/postgresInstances.ts new file mode 100644 index 000000000000..3629d4731162 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/operations/postgresInstances.ts @@ -0,0 +1,592 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PostgresInstances } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureArcDataManagementClient } from "../azureArcDataManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + PostgresInstance, + PostgresInstancesListNextOptionalParams, + PostgresInstancesListOptionalParams, + PostgresInstancesListByResourceGroupNextOptionalParams, + PostgresInstancesListByResourceGroupOptionalParams, + PostgresInstancesListResponse, + PostgresInstancesListByResourceGroupResponse, + PostgresInstancesGetOptionalParams, + PostgresInstancesGetResponse, + PostgresInstancesCreateOptionalParams, + PostgresInstancesCreateResponse, + PostgresInstancesDeleteOptionalParams, + PostgresInstanceUpdate, + PostgresInstancesUpdateOptionalParams, + PostgresInstancesUpdateResponse, + PostgresInstancesListNextResponse, + PostgresInstancesListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing PostgresInstances operations. */ +export class PostgresInstancesImpl implements PostgresInstances { + private readonly client: AzureArcDataManagementClient; + + /** + * Initialize a new instance of the class PostgresInstances class. + * @param client Reference to the service client + */ + constructor(client: AzureArcDataManagementClient) { + this.client = client; + } + + /** + * List postgres Instance resources in the subscription + * @param options The options parameters. + */ + public list( + options?: PostgresInstancesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: PostgresInstancesListOptionalParams + ): 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?: PostgresInstancesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Get a postgres Instances list by Resource group name. + * @param resourceGroupName The name of the Azure resource group + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: PostgresInstancesListByResourceGroupOptionalParams + ): 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?: PostgresInstancesListByResourceGroupOptionalParams + ): 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?: PostgresInstancesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * List postgres Instance resources in the subscription + * @param options The options parameters. + */ + private _list( + options?: PostgresInstancesListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * Get a postgres Instances list by Resource group name. + * @param resourceGroupName The name of the Azure resource group + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: PostgresInstancesListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Retrieves a postgres Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param postgresInstanceName Name of Postgres Instance + * @param options The options parameters. + */ + get( + resourceGroupName: string, + postgresInstanceName: string, + options?: PostgresInstancesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, postgresInstanceName, options }, + getOperationSpec + ); + } + + /** + * Creates or replaces a postgres Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param postgresInstanceName Name of Postgres Instance + * @param resource The postgres instance + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + postgresInstanceName: string, + resource: PostgresInstance, + options?: PostgresInstancesCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PostgresInstancesCreateResponse + > + > { + 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, postgresInstanceName, resource, options }, + createOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Creates or replaces a postgres Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param postgresInstanceName Name of Postgres Instance + * @param resource The postgres instance + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + postgresInstanceName: string, + resource: PostgresInstance, + options?: PostgresInstancesCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + postgresInstanceName, + resource, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a postgres Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param postgresInstanceName Name of Postgres Instance + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + postgresInstanceName: string, + options?: PostgresInstancesDeleteOptionalParams + ): 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, postgresInstanceName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Deletes a postgres Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param postgresInstanceName Name of Postgres Instance + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + postgresInstanceName: string, + options?: PostgresInstancesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + postgresInstanceName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Updates a postgres Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param postgresInstanceName Name of Postgres Instance + * @param parameters The Postgres Instance. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + postgresInstanceName: string, + parameters: PostgresInstanceUpdate, + options?: PostgresInstancesUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, postgresInstanceName, parameters, options }, + updateOperationSpec + ); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: PostgresInstancesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the Azure resource group + * @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?: PostgresInstancesListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.AzureArcData/postgresInstances", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PostgresInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/postgresInstances", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PostgresInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/postgresInstances/{postgresInstanceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PostgresInstance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.postgresInstanceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/postgresInstances/{postgresInstanceName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.PostgresInstance + }, + 201: { + bodyMapper: Mappers.PostgresInstance + }, + 202: { + bodyMapper: Mappers.PostgresInstance + }, + 204: { + bodyMapper: Mappers.PostgresInstance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.resource, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.postgresInstanceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/postgresInstances/{postgresInstanceName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.postgresInstanceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/postgresInstances/{postgresInstanceName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.PostgresInstance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.postgresInstanceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PostgresInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PostgresInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/azurearcdata/arm-azurearcdata/src/operations/sqlManagedInstances.ts b/sdk/azurearcdata/arm-azurearcdata/src/operations/sqlManagedInstances.ts new file mode 100644 index 000000000000..b2b128d6a2f9 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/operations/sqlManagedInstances.ts @@ -0,0 +1,597 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SqlManagedInstances } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureArcDataManagementClient } from "../azureArcDataManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + SqlManagedInstance, + SqlManagedInstancesListNextOptionalParams, + SqlManagedInstancesListOptionalParams, + SqlManagedInstancesListByResourceGroupNextOptionalParams, + SqlManagedInstancesListByResourceGroupOptionalParams, + SqlManagedInstancesListResponse, + SqlManagedInstancesListByResourceGroupResponse, + SqlManagedInstancesGetOptionalParams, + SqlManagedInstancesGetResponse, + SqlManagedInstancesCreateOptionalParams, + SqlManagedInstancesCreateResponse, + SqlManagedInstancesDeleteOptionalParams, + SqlManagedInstanceUpdate, + SqlManagedInstancesUpdateOptionalParams, + SqlManagedInstancesUpdateResponse, + SqlManagedInstancesListNextResponse, + SqlManagedInstancesListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing SqlManagedInstances operations. */ +export class SqlManagedInstancesImpl implements SqlManagedInstances { + private readonly client: AzureArcDataManagementClient; + + /** + * Initialize a new instance of the class SqlManagedInstances class. + * @param client Reference to the service client + */ + constructor(client: AzureArcDataManagementClient) { + this.client = client; + } + + /** + * List sqlManagedInstance resources in the subscription + * @param options The options parameters. + */ + public list( + options?: SqlManagedInstancesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: SqlManagedInstancesListOptionalParams + ): 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?: SqlManagedInstancesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Gets all sqlManagedInstances in a resource group. + * @param resourceGroupName The name of the Azure resource group + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: SqlManagedInstancesListByResourceGroupOptionalParams + ): 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?: SqlManagedInstancesListByResourceGroupOptionalParams + ): 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?: SqlManagedInstancesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * List sqlManagedInstance resources in the subscription + * @param options The options parameters. + */ + private _list( + options?: SqlManagedInstancesListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * Gets all sqlManagedInstances in a resource group. + * @param resourceGroupName The name of the Azure resource group + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: SqlManagedInstancesListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Retrieves a SQL Managed Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlManagedInstanceName Name of SQL Managed Instance + * @param options The options parameters. + */ + get( + resourceGroupName: string, + sqlManagedInstanceName: string, + options?: SqlManagedInstancesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, sqlManagedInstanceName, options }, + getOperationSpec + ); + } + + /** + * Creates or replaces a SQL Managed Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlManagedInstanceName Name of SQL Managed Instance + * @param sqlManagedInstance The SQL Managed Instance to be created or updated. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + sqlManagedInstanceName: string, + sqlManagedInstance: SqlManagedInstance, + options?: SqlManagedInstancesCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SqlManagedInstancesCreateResponse + > + > { + 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, + sqlManagedInstanceName, + sqlManagedInstance, + options + }, + createOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Creates or replaces a SQL Managed Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlManagedInstanceName Name of SQL Managed Instance + * @param sqlManagedInstance The SQL Managed Instance to be created or updated. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + sqlManagedInstanceName: string, + sqlManagedInstance: SqlManagedInstance, + options?: SqlManagedInstancesCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + sqlManagedInstanceName, + sqlManagedInstance, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a SQL Managed Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlManagedInstanceName Name of SQL Managed Instance + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + sqlManagedInstanceName: string, + options?: SqlManagedInstancesDeleteOptionalParams + ): 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, sqlManagedInstanceName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Deletes a SQL Managed Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlManagedInstanceName Name of SQL Managed Instance + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + sqlManagedInstanceName: string, + options?: SqlManagedInstancesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + sqlManagedInstanceName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Updates a SQL Managed Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlManagedInstanceName Name of SQL Managed Instance + * @param parameters The SQL Managed Instance. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + sqlManagedInstanceName: string, + parameters: SqlManagedInstanceUpdate, + options?: SqlManagedInstancesUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, sqlManagedInstanceName, parameters, options }, + updateOperationSpec + ); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: SqlManagedInstancesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the Azure resource group + * @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?: SqlManagedInstancesListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.AzureArcData/sqlManagedInstances", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SqlManagedInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SqlManagedInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SqlManagedInstance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.sqlManagedInstanceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.SqlManagedInstance + }, + 201: { + bodyMapper: Mappers.SqlManagedInstance + }, + 202: { + bodyMapper: Mappers.SqlManagedInstance + }, + 204: { + bodyMapper: Mappers.SqlManagedInstance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.sqlManagedInstance, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.sqlManagedInstanceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.sqlManagedInstanceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.SqlManagedInstance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.sqlManagedInstanceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SqlManagedInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SqlManagedInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/azurearcdata/arm-azurearcdata/src/operations/sqlServerInstances.ts b/sdk/azurearcdata/arm-azurearcdata/src/operations/sqlServerInstances.ts new file mode 100644 index 000000000000..6fb556220a4e --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/operations/sqlServerInstances.ts @@ -0,0 +1,592 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SqlServerInstances } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureArcDataManagementClient } from "../azureArcDataManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + SqlServerInstance, + SqlServerInstancesListNextOptionalParams, + SqlServerInstancesListOptionalParams, + SqlServerInstancesListByResourceGroupNextOptionalParams, + SqlServerInstancesListByResourceGroupOptionalParams, + SqlServerInstancesListResponse, + SqlServerInstancesListByResourceGroupResponse, + SqlServerInstancesGetOptionalParams, + SqlServerInstancesGetResponse, + SqlServerInstancesCreateOptionalParams, + SqlServerInstancesCreateResponse, + SqlServerInstancesDeleteOptionalParams, + SqlServerInstanceUpdate, + SqlServerInstancesUpdateOptionalParams, + SqlServerInstancesUpdateResponse, + SqlServerInstancesListNextResponse, + SqlServerInstancesListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing SqlServerInstances operations. */ +export class SqlServerInstancesImpl implements SqlServerInstances { + private readonly client: AzureArcDataManagementClient; + + /** + * Initialize a new instance of the class SqlServerInstances class. + * @param client Reference to the service client + */ + constructor(client: AzureArcDataManagementClient) { + this.client = client; + } + + /** + * List sqlServerInstance resources in the subscription + * @param options The options parameters. + */ + public list( + options?: SqlServerInstancesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: SqlServerInstancesListOptionalParams + ): 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?: SqlServerInstancesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Gets all sqlServerInstances in a resource group. + * @param resourceGroupName The name of the Azure resource group + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: SqlServerInstancesListByResourceGroupOptionalParams + ): 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?: SqlServerInstancesListByResourceGroupOptionalParams + ): 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?: SqlServerInstancesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * List sqlServerInstance resources in the subscription + * @param options The options parameters. + */ + private _list( + options?: SqlServerInstancesListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * Gets all sqlServerInstances in a resource group. + * @param resourceGroupName The name of the Azure resource group + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: SqlServerInstancesListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Retrieves a SQL Server Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlServerInstanceName Name of SQL Server Instance + * @param options The options parameters. + */ + get( + resourceGroupName: string, + sqlServerInstanceName: string, + options?: SqlServerInstancesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, sqlServerInstanceName, options }, + getOperationSpec + ); + } + + /** + * Creates or replaces a SQL Server Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlServerInstanceName Name of SQL Server Instance + * @param sqlServerInstance The SQL Server Instance to be created or updated. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + sqlServerInstanceName: string, + sqlServerInstance: SqlServerInstance, + options?: SqlServerInstancesCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SqlServerInstancesCreateResponse + > + > { + 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, sqlServerInstanceName, sqlServerInstance, options }, + createOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Creates or replaces a SQL Server Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlServerInstanceName Name of SQL Server Instance + * @param sqlServerInstance The SQL Server Instance to be created or updated. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + sqlServerInstanceName: string, + sqlServerInstance: SqlServerInstance, + options?: SqlServerInstancesCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + sqlServerInstanceName, + sqlServerInstance, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a SQL Server Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlServerInstanceName Name of SQL Server Instance + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + sqlServerInstanceName: string, + options?: SqlServerInstancesDeleteOptionalParams + ): 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, sqlServerInstanceName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Deletes a SQL Server Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlServerInstanceName Name of SQL Server Instance + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + sqlServerInstanceName: string, + options?: SqlServerInstancesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + sqlServerInstanceName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Updates a SQL Server Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlServerInstanceName Name of SQL Server Instance + * @param parameters The SQL Server Instance. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + sqlServerInstanceName: string, + parameters: SqlServerInstanceUpdate, + options?: SqlServerInstancesUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, sqlServerInstanceName, parameters, options }, + updateOperationSpec + ); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: SqlServerInstancesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the Azure resource group + * @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?: SqlServerInstancesListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.AzureArcData/sqlServerInstances", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SqlServerInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SqlServerInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SqlServerInstance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.sqlServerInstanceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.SqlServerInstance + }, + 201: { + bodyMapper: Mappers.SqlServerInstance + }, + 202: { + bodyMapper: Mappers.SqlServerInstance + }, + 204: { + bodyMapper: Mappers.SqlServerInstance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.sqlServerInstance, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.sqlServerInstanceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.sqlServerInstanceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.SqlServerInstance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.sqlServerInstanceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SqlServerInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SqlServerInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/activeDirectoryConnectors.ts b/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/activeDirectoryConnectors.ts new file mode 100644 index 000000000000..879f2436d2d7 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/activeDirectoryConnectors.ts @@ -0,0 +1,109 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + ActiveDirectoryConnectorResource, + ActiveDirectoryConnectorsListOptionalParams, + ActiveDirectoryConnectorsCreateOptionalParams, + ActiveDirectoryConnectorsCreateResponse, + ActiveDirectoryConnectorsDeleteOptionalParams, + ActiveDirectoryConnectorsGetOptionalParams, + ActiveDirectoryConnectorsGetResponse +} from "../models"; + +/// +/** Interface representing a ActiveDirectoryConnectors. */ +export interface ActiveDirectoryConnectors { + /** + * List the active directory connectors associated with the given data controller. + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName The name of the data controller + * @param options The options parameters. + */ + list( + resourceGroupName: string, + dataControllerName: string, + options?: ActiveDirectoryConnectorsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Creates or replaces an Active Directory connector resource. + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName The name of the data controller + * @param activeDirectoryConnectorName The name of the Active Directory connector instance + * @param activeDirectoryConnectorResource desc + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + dataControllerName: string, + activeDirectoryConnectorName: string, + activeDirectoryConnectorResource: ActiveDirectoryConnectorResource, + options?: ActiveDirectoryConnectorsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ActiveDirectoryConnectorsCreateResponse + > + >; + /** + * Creates or replaces an Active Directory connector resource. + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName The name of the data controller + * @param activeDirectoryConnectorName The name of the Active Directory connector instance + * @param activeDirectoryConnectorResource desc + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + dataControllerName: string, + activeDirectoryConnectorName: string, + activeDirectoryConnectorResource: ActiveDirectoryConnectorResource, + options?: ActiveDirectoryConnectorsCreateOptionalParams + ): Promise; + /** + * Deletes an Active Directory connector resource + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName The name of the data controller + * @param activeDirectoryConnectorName The name of the Active Directory connector instance + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + dataControllerName: string, + activeDirectoryConnectorName: string, + options?: ActiveDirectoryConnectorsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes an Active Directory connector resource + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName The name of the data controller + * @param activeDirectoryConnectorName The name of the Active Directory connector instance + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + dataControllerName: string, + activeDirectoryConnectorName: string, + options?: ActiveDirectoryConnectorsDeleteOptionalParams + ): Promise; + /** + * Retrieves an Active Directory connector resource + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName The name of the data controller + * @param activeDirectoryConnectorName The name of the Active Directory connector instance + * @param options The options parameters. + */ + get( + resourceGroupName: string, + dataControllerName: string, + activeDirectoryConnectorName: string, + options?: ActiveDirectoryConnectorsGetOptionalParams + ): Promise; +} diff --git a/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/dataControllers.ts b/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/dataControllers.ts new file mode 100644 index 000000000000..a17ba1878394 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/dataControllers.ts @@ -0,0 +1,121 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + DataControllerResource, + DataControllersListInSubscriptionOptionalParams, + DataControllersListInGroupOptionalParams, + DataControllersPutDataControllerOptionalParams, + DataControllersPutDataControllerResponse, + DataControllersDeleteDataControllerOptionalParams, + DataControllersGetDataControllerOptionalParams, + DataControllersGetDataControllerResponse, + DataControllerUpdate, + DataControllersPatchDataControllerOptionalParams, + DataControllersPatchDataControllerResponse +} from "../models"; + +/// +/** Interface representing a DataControllers. */ +export interface DataControllers { + /** + * List dataController resources in the subscription + * @param options The options parameters. + */ + listInSubscription( + options?: DataControllersListInSubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * List dataController resources in the resource group + * @param resourceGroupName The name of the Azure resource group + * @param options The options parameters. + */ + listInGroup( + resourceGroupName: string, + options?: DataControllersListInGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Creates or replaces a dataController resource + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName The name of the data controller + * @param dataControllerResource desc + * @param options The options parameters. + */ + beginPutDataController( + resourceGroupName: string, + dataControllerName: string, + dataControllerResource: DataControllerResource, + options?: DataControllersPutDataControllerOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DataControllersPutDataControllerResponse + > + >; + /** + * Creates or replaces a dataController resource + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName The name of the data controller + * @param dataControllerResource desc + * @param options The options parameters. + */ + beginPutDataControllerAndWait( + resourceGroupName: string, + dataControllerName: string, + dataControllerResource: DataControllerResource, + options?: DataControllersPutDataControllerOptionalParams + ): Promise; + /** + * Deletes a dataController resource + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName The name of the data controller + * @param options The options parameters. + */ + beginDeleteDataController( + resourceGroupName: string, + dataControllerName: string, + options?: DataControllersDeleteDataControllerOptionalParams + ): Promise, void>>; + /** + * Deletes a dataController resource + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName The name of the data controller + * @param options The options parameters. + */ + beginDeleteDataControllerAndWait( + resourceGroupName: string, + dataControllerName: string, + options?: DataControllersDeleteDataControllerOptionalParams + ): Promise; + /** + * Retrieves a dataController resource + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName The name of the data controller + * @param options The options parameters. + */ + getDataController( + resourceGroupName: string, + dataControllerName: string, + options?: DataControllersGetDataControllerOptionalParams + ): Promise; + /** + * Updates a dataController resource + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName The name of the data controller + * @param dataControllerResource The update data controller resource + * @param options The options parameters. + */ + patchDataController( + resourceGroupName: string, + dataControllerName: string, + dataControllerResource: DataControllerUpdate, + options?: DataControllersPatchDataControllerOptionalParams + ): Promise; +} diff --git a/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/index.ts b/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..080d3a4954a5 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/index.ts @@ -0,0 +1,14 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./operations"; +export * from "./sqlManagedInstances"; +export * from "./sqlServerInstances"; +export * from "./dataControllers"; +export * from "./activeDirectoryConnectors"; +export * from "./postgresInstances"; diff --git a/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/operations.ts b/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..d96d1ced0389 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/operations.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operation, OperationsListOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * Lists all of the available Azure Data Services on Azure Arc API operations. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/postgresInstances.ts b/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/postgresInstances.ts new file mode 100644 index 000000000000..2eb04e45c064 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/postgresInstances.ts @@ -0,0 +1,121 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + PostgresInstance, + PostgresInstancesListOptionalParams, + PostgresInstancesListByResourceGroupOptionalParams, + PostgresInstancesGetOptionalParams, + PostgresInstancesGetResponse, + PostgresInstancesCreateOptionalParams, + PostgresInstancesCreateResponse, + PostgresInstancesDeleteOptionalParams, + PostgresInstanceUpdate, + PostgresInstancesUpdateOptionalParams, + PostgresInstancesUpdateResponse +} from "../models"; + +/// +/** Interface representing a PostgresInstances. */ +export interface PostgresInstances { + /** + * List postgres Instance resources in the subscription + * @param options The options parameters. + */ + list( + options?: PostgresInstancesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a postgres Instances list by Resource group name. + * @param resourceGroupName The name of the Azure resource group + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: PostgresInstancesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Retrieves a postgres Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param postgresInstanceName Name of Postgres Instance + * @param options The options parameters. + */ + get( + resourceGroupName: string, + postgresInstanceName: string, + options?: PostgresInstancesGetOptionalParams + ): Promise; + /** + * Creates or replaces a postgres Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param postgresInstanceName Name of Postgres Instance + * @param resource The postgres instance + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + postgresInstanceName: string, + resource: PostgresInstance, + options?: PostgresInstancesCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PostgresInstancesCreateResponse + > + >; + /** + * Creates or replaces a postgres Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param postgresInstanceName Name of Postgres Instance + * @param resource The postgres instance + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + postgresInstanceName: string, + resource: PostgresInstance, + options?: PostgresInstancesCreateOptionalParams + ): Promise; + /** + * Deletes a postgres Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param postgresInstanceName Name of Postgres Instance + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + postgresInstanceName: string, + options?: PostgresInstancesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a postgres Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param postgresInstanceName Name of Postgres Instance + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + postgresInstanceName: string, + options?: PostgresInstancesDeleteOptionalParams + ): Promise; + /** + * Updates a postgres Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param postgresInstanceName Name of Postgres Instance + * @param parameters The Postgres Instance. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + postgresInstanceName: string, + parameters: PostgresInstanceUpdate, + options?: PostgresInstancesUpdateOptionalParams + ): Promise; +} diff --git a/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/sqlManagedInstances.ts b/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/sqlManagedInstances.ts new file mode 100644 index 000000000000..abb8552f69a6 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/sqlManagedInstances.ts @@ -0,0 +1,121 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + SqlManagedInstance, + SqlManagedInstancesListOptionalParams, + SqlManagedInstancesListByResourceGroupOptionalParams, + SqlManagedInstancesGetOptionalParams, + SqlManagedInstancesGetResponse, + SqlManagedInstancesCreateOptionalParams, + SqlManagedInstancesCreateResponse, + SqlManagedInstancesDeleteOptionalParams, + SqlManagedInstanceUpdate, + SqlManagedInstancesUpdateOptionalParams, + SqlManagedInstancesUpdateResponse +} from "../models"; + +/// +/** Interface representing a SqlManagedInstances. */ +export interface SqlManagedInstances { + /** + * List sqlManagedInstance resources in the subscription + * @param options The options parameters. + */ + list( + options?: SqlManagedInstancesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets all sqlManagedInstances in a resource group. + * @param resourceGroupName The name of the Azure resource group + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: SqlManagedInstancesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Retrieves a SQL Managed Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlManagedInstanceName Name of SQL Managed Instance + * @param options The options parameters. + */ + get( + resourceGroupName: string, + sqlManagedInstanceName: string, + options?: SqlManagedInstancesGetOptionalParams + ): Promise; + /** + * Creates or replaces a SQL Managed Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlManagedInstanceName Name of SQL Managed Instance + * @param sqlManagedInstance The SQL Managed Instance to be created or updated. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + sqlManagedInstanceName: string, + sqlManagedInstance: SqlManagedInstance, + options?: SqlManagedInstancesCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SqlManagedInstancesCreateResponse + > + >; + /** + * Creates or replaces a SQL Managed Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlManagedInstanceName Name of SQL Managed Instance + * @param sqlManagedInstance The SQL Managed Instance to be created or updated. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + sqlManagedInstanceName: string, + sqlManagedInstance: SqlManagedInstance, + options?: SqlManagedInstancesCreateOptionalParams + ): Promise; + /** + * Deletes a SQL Managed Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlManagedInstanceName Name of SQL Managed Instance + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + sqlManagedInstanceName: string, + options?: SqlManagedInstancesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a SQL Managed Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlManagedInstanceName Name of SQL Managed Instance + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + sqlManagedInstanceName: string, + options?: SqlManagedInstancesDeleteOptionalParams + ): Promise; + /** + * Updates a SQL Managed Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlManagedInstanceName Name of SQL Managed Instance + * @param parameters The SQL Managed Instance. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + sqlManagedInstanceName: string, + parameters: SqlManagedInstanceUpdate, + options?: SqlManagedInstancesUpdateOptionalParams + ): Promise; +} diff --git a/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/sqlServerInstances.ts b/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/sqlServerInstances.ts new file mode 100644 index 000000000000..a67f1f5791fe --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/sqlServerInstances.ts @@ -0,0 +1,121 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + SqlServerInstance, + SqlServerInstancesListOptionalParams, + SqlServerInstancesListByResourceGroupOptionalParams, + SqlServerInstancesGetOptionalParams, + SqlServerInstancesGetResponse, + SqlServerInstancesCreateOptionalParams, + SqlServerInstancesCreateResponse, + SqlServerInstancesDeleteOptionalParams, + SqlServerInstanceUpdate, + SqlServerInstancesUpdateOptionalParams, + SqlServerInstancesUpdateResponse +} from "../models"; + +/// +/** Interface representing a SqlServerInstances. */ +export interface SqlServerInstances { + /** + * List sqlServerInstance resources in the subscription + * @param options The options parameters. + */ + list( + options?: SqlServerInstancesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets all sqlServerInstances in a resource group. + * @param resourceGroupName The name of the Azure resource group + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: SqlServerInstancesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Retrieves a SQL Server Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlServerInstanceName Name of SQL Server Instance + * @param options The options parameters. + */ + get( + resourceGroupName: string, + sqlServerInstanceName: string, + options?: SqlServerInstancesGetOptionalParams + ): Promise; + /** + * Creates or replaces a SQL Server Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlServerInstanceName Name of SQL Server Instance + * @param sqlServerInstance The SQL Server Instance to be created or updated. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + sqlServerInstanceName: string, + sqlServerInstance: SqlServerInstance, + options?: SqlServerInstancesCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SqlServerInstancesCreateResponse + > + >; + /** + * Creates or replaces a SQL Server Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlServerInstanceName Name of SQL Server Instance + * @param sqlServerInstance The SQL Server Instance to be created or updated. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + sqlServerInstanceName: string, + sqlServerInstance: SqlServerInstance, + options?: SqlServerInstancesCreateOptionalParams + ): Promise; + /** + * Deletes a SQL Server Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlServerInstanceName Name of SQL Server Instance + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + sqlServerInstanceName: string, + options?: SqlServerInstancesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a SQL Server Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlServerInstanceName Name of SQL Server Instance + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + sqlServerInstanceName: string, + options?: SqlServerInstancesDeleteOptionalParams + ): Promise; + /** + * Updates a SQL Server Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlServerInstanceName Name of SQL Server Instance + * @param parameters The SQL Server Instance. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + sqlServerInstanceName: string, + parameters: SqlServerInstanceUpdate, + options?: SqlServerInstancesUpdateOptionalParams + ): Promise; +} diff --git a/sdk/azurearcdata/arm-azurearcdata/test/sampleTest.ts b/sdk/azurearcdata/arm-azurearcdata/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/azurearcdata/arm-azurearcdata/tsconfig.json b/sdk/azurearcdata/arm-azurearcdata/tsconfig.json new file mode 100644 index 000000000000..3e6ae96443f3 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": [ + "es6", + "dom" + ], + "declaration": true, + "outDir": "./dist-esm", + "importHelpers": true + }, + "include": [ + "./src/**/*.ts", + "./test/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/sdk/azurearcdata/ci.mgmt.yml b/sdk/azurearcdata/ci.mgmt.yml new file mode 100644 index 000000000000..563030614fe4 --- /dev/null +++ b/sdk/azurearcdata/ci.mgmt.yml @@ -0,0 +1,38 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/azurearcdata/arm-azurearcdata + - sdk/azurearcdata/ci.mgmt.yml + +pr: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/azurearcdata/arm-azurearcdata + - sdk/azurearcdata/ci.mgmt.yml + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: azurearcdata + Artifacts: + - name: azure-arm-azurearcdata + safeName: azurearmazurearcdata + \ No newline at end of file