diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index c3c5bc227ce9..9da04b2f392c 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -123,6 +123,7 @@ specifiers: '@rush-temp/arm-postgresql-flexible': file:./projects/arm-postgresql-flexible.tgz '@rush-temp/arm-powerbidedicated': file:./projects/arm-powerbidedicated.tgz '@rush-temp/arm-powerbiembedded': file:./projects/arm-powerbiembedded.tgz + '@rush-temp/arm-powerbiprivatelinks': file:./projects/arm-powerbiprivatelinks.tgz '@rush-temp/arm-privatedns': file:./projects/arm-privatedns.tgz '@rush-temp/arm-purview': file:./projects/arm-purview.tgz '@rush-temp/arm-quota': file:./projects/arm-quota.tgz @@ -395,6 +396,7 @@ dependencies: '@rush-temp/arm-postgresql-flexible': file:projects/arm-postgresql-flexible.tgz '@rush-temp/arm-powerbidedicated': file:projects/arm-powerbidedicated.tgz '@rush-temp/arm-powerbiembedded': file:projects/arm-powerbiembedded.tgz + '@rush-temp/arm-powerbiprivatelinks': file:projects/arm-powerbiprivatelinks.tgz '@rush-temp/arm-privatedns': file:projects/arm-privatedns.tgz '@rush-temp/arm-purview': file:projects/arm-purview.tgz '@rush-temp/arm-quota': file:projects/arm-quota.tgz @@ -9114,19 +9116,19 @@ packages: '@azure-tools/test-recorder': 1.0.2 '@azure/identity': 2.0.4 '@microsoft/api-extractor': 7.19.4 - '@rollup/plugin-commonjs': 21.0.1_rollup@2.67.1 - '@rollup/plugin-json': 4.1.0_rollup@2.67.1 - '@rollup/plugin-multi-entry': 4.1.0_rollup@2.67.1 - '@rollup/plugin-node-resolve': 13.1.3_rollup@2.67.1 + '@rollup/plugin-commonjs': 21.0.2_rollup@2.70.1 + '@rollup/plugin-json': 4.1.0_rollup@2.70.1 + '@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.1 + '@rollup/plugin-node-resolve': 13.1.3_rollup@2.70.1 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 rimraf: 3.0.2 - rollup: 2.67.1 - rollup-plugin-sourcemaps: 0.6.3_rollup@2.67.1 + rollup: 2.70.1 + rollup-plugin-sourcemaps: 0.6.3_rollup@2.70.1 tslib: 2.3.1 typescript: 4.2.4 - uglify-js: 3.15.1 + uglify-js: 3.15.3 transitivePeerDependencies: - '@types/node' - debug @@ -12127,6 +12129,33 @@ packages: - supports-color dev: false + file:projects/arm-powerbiprivatelinks.tgz: + resolution: {integrity: sha512-64tImh2F01qIXrv2YeuWbUvQwL9wS60Izo35Hwr+e2PRY+Psq9OneOCnSYnhNglQAvCG5ZKL5dVniBzmPfP0Ng==, tarball: file:projects/arm-powerbiprivatelinks.tgz} + name: '@rush-temp/arm-powerbiprivatelinks' + 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.3 + transitivePeerDependencies: + - debug + - encoding + - supports-color + dev: false + file:projects/arm-privatedns.tgz: resolution: {integrity: sha512-jYRkG0a7Wk4cMsYA7yWF4N2SCw51EcedFEtxMy1b9ehc31kTgIyp4UEP565sOzqd4ITrF55PExMfELXo8cQuBA==, tarball: file:projects/arm-privatedns.tgz} name: '@rush-temp/arm-privatedns' diff --git a/rush.json b/rush.json index e98c45a12572..01b08e543676 100644 --- a/rush.json +++ b/rush.json @@ -1,7 +1,7 @@ /** * This is the main configuration file for Rush. * For full documentation, please see https://rushjs.io - */ { + */{ "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json", /** * (Required) This specifies the version of the Rush engine to be used in this repo. @@ -1670,6 +1670,11 @@ "packageName": "@azure/arm-app", "projectFolder": "sdk/app/arm-app", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-powerbiprivatelinks", + "projectFolder": "sdk/powerbiprivatelinks/arm-powerbiprivatelinks", + "versionPolicyName": "management" } ] -} +} \ No newline at end of file diff --git a/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/CHANGELOG.md b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/CHANGELOG.md new file mode 100644 index 000000000000..805ac246a161 --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0 (2022-03-24) + +The package of @azure/arm-powerbiprivatelinks 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/powerbiprivatelinks/arm-powerbiprivatelinks/LICENSE b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/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/powerbiprivatelinks/arm-powerbiprivatelinks/README.md b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/README.md new file mode 100644 index 000000000000..3ef7d8daaa70 --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/README.md @@ -0,0 +1,98 @@ +# Azure PrivateLinkServicesForPowerBI client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure PrivateLinkServicesForPowerBI client. + +Client to manage Power BI Private Link Service resources and connection members. + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/powerbiprivatelinks/arm-powerbiprivatelinks) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-powerbiprivatelinks) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-powerbiprivatelinks) | +[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-powerbiprivatelinks` package + +Install the Azure PrivateLinkServicesForPowerBI client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-powerbiprivatelinks +``` + +### Create and authenticate a `PrivateLinkServicesForPowerBIClient` + +To create a client object to access the Azure PrivateLinkServicesForPowerBI API, you will need the `endpoint` of your Azure PrivateLinkServicesForPowerBI resource and a `credential`. The Azure PrivateLinkServicesForPowerBI client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure PrivateLinkServicesForPowerBI 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 Azure PrivateLinkServicesForPowerBI** 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 { PrivateLinkServicesForPowerBIClient } = require("@azure/arm-powerbiprivatelinks"); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new PrivateLinkServicesForPowerBIClient(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 + +### PrivateLinkServicesForPowerBIClient + +`PrivateLinkServicesForPowerBIClient` is the primary interface for developers using the Azure PrivateLinkServicesForPowerBI client library. Explore the methods on this client object to understand the different features of the Azure PrivateLinkServicesForPowerBI 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%2Fpowerbiprivatelinks%2Farm-powerbiprivatelinks%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/powerbiprivatelinks/arm-powerbiprivatelinks/_meta.json b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/_meta.json new file mode 100644 index 000000000000..842193d32d07 --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/_meta.json @@ -0,0 +1,8 @@ +{ + "commit": "2e161f6bd417bcbc123af6c59ff02940b05e7079", + "readme": "specification/powerbiprivatelinks/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/powerbiprivatelinks/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.2.1", + "use": "@autorest/typescript@6.0.0-alpha.16.20220105.1" +} \ No newline at end of file diff --git a/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/api-extractor.json b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/api-extractor.json new file mode 100644 index 000000000000..ac7f64135349 --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/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-powerbiprivatelinks.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/powerbiprivatelinks/arm-powerbiprivatelinks/package.json b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/package.json new file mode 100644 index 000000000000..3afe55d1086c --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/package.json @@ -0,0 +1,102 @@ +{ + "name": "@azure/arm-powerbiprivatelinks", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", + "description": "A generated SDK for PrivateLinkServicesForPowerBIClient.", + "version": "1.0.0", + "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-powerbiprivatelinks.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/powerbiprivatelinks/arm-powerbiprivatelinks", + "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/powerbiprivatelinks/arm-powerbiprivatelinks/review/arm-powerbiprivatelinks.api.md b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/review/arm-powerbiprivatelinks.api.md new file mode 100644 index 000000000000..066912a30bf0 --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/review/arm-powerbiprivatelinks.api.md @@ -0,0 +1,465 @@ +## API Report File for "@azure/arm-powerbiprivatelinks" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; + +// @public +export type ActionsRequired = string; + +// @public +export type ActionType = string; + +// @public +export interface AsyncOperationDetail { + endTime?: string; + error?: ErrorDetail; + id?: string; + name?: string; + startTime?: string; + status?: string; +} + +// @public +export interface ConnectionState { + actionsRequired?: string; + description?: string; + status?: PersistedConnectionStatus; +} + +// @public +export type CreatedByType = string; + +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +export interface GroupConnectivityInformation { + customerVisibleFqdns?: string[]; + groupId?: string; + internalFqdn?: string; + memberName?: string; + privateLinkServiceArmRegion?: string; +} + +// @public +export enum KnownActionsRequired { + // (undocumented) + None = "None", + // (undocumented) + Recreate = "Recreate" +} + +// @public +export enum KnownActionType { + // (undocumented) + Internal = "Internal" +} + +// @public +export enum KnownCreatedByType { + // (undocumented) + Application = "Application", + // (undocumented) + Key = "Key", + // (undocumented) + ManagedIdentity = "ManagedIdentity", + // (undocumented) + User = "User" +} + +// @public +export enum KnownOrigin { + // (undocumented) + System = "system", + // (undocumented) + User = "user", + // (undocumented) + UserSystem = "user,system" +} + +// @public +export enum KnownPersistedConnectionStatus { + // (undocumented) + Approved = "Approved", + // (undocumented) + Disconnected = "Disconnected", + // (undocumented) + Pending = "Pending", + // (undocumented) + Rejected = "Rejected" +} + +// @public +export enum KnownResourceProvisioningState { + // (undocumented) + Canceled = "Canceled", + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Failed = "Failed", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Updating = "Updating" +} + +// @public +export interface Operation { + readonly actionType?: ActionType; + display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationListResult { + readonly nextLink?: string; + readonly value?: Operation[]; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationListResult; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public +export type Origin = string; + +// @public +export type PersistedConnectionStatus = string; + +// @public +export interface PowerBIResources { + create(body: TenantResource, options?: PowerBIResourcesCreateOptionalParams): Promise; + delete(options?: PowerBIResourcesDeleteOptionalParams): Promise; + listByResourceName(options?: PowerBIResourcesListByResourceNameOptionalParams): Promise; + update(body: TenantResource, options?: PowerBIResourcesUpdateOptionalParams): Promise; +} + +// @public +export interface PowerBIResourcesCreateOptionalParams extends coreClient.OperationOptions { + clientTenantId?: string; +} + +// @public +export type PowerBIResourcesCreateResponse = TenantResource; + +// @public +export interface PowerBIResourcesDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface PowerBIResourcesListByResourceNameOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PowerBIResourcesListByResourceNameResponse = TenantResource[]; + +// @public +export interface PowerBIResourcesUpdateOptionalParams extends coreClient.OperationOptions { + clientTenantId?: string; +} + +// @public +export type PowerBIResourcesUpdateResponse = TenantResource; + +// @public +export interface PrivateEndpoint { + id?: string; +} + +// @public +export interface PrivateEndpointConnection { + readonly id?: string; + readonly name?: string; + privateEndpoint?: PrivateEndpoint; + privateLinkServiceConnectionState?: ConnectionState; + provisioningState?: ResourceProvisioningState; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export interface PrivateEndpointConnectionListResult { + readonly nextLink?: string; + value?: PrivateEndpointConnection[]; +} + +// @public +export interface PrivateEndpointConnections { + beginDelete(options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise; + create(privateEndpointConnection: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOptionalParams): Promise; + get(options?: PrivateEndpointConnectionsGetOptionalParams): Promise; + listByResource(resourceGroupName: string, azureResourceName: string, options?: PrivateEndpointConnectionsListByResourceOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface PrivateEndpointConnectionsCreateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsCreateResponse = PrivateEndpointConnection; + +// @public +export interface PrivateEndpointConnectionsDeleteHeaders { + azureAsyncOperation?: string; +} + +// @public +export interface PrivateEndpointConnectionsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface PrivateEndpointConnectionsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; + +// @public +export interface PrivateEndpointConnectionsListByResourceNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsListByResourceNextResponse = PrivateEndpointConnectionListResult; + +// @public +export interface PrivateEndpointConnectionsListByResourceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsListByResourceResponse = PrivateEndpointConnectionListResult; + +// @public +export interface PrivateLinkConnectionDetail { + groupId?: string; + id?: string; + linkIdentifier?: string; + memberName?: string; + privateIpAddress?: string; +} + +// @public +export interface PrivateLinkResource { + readonly groupId?: string; + id?: string; + name?: string; + readonly requiredMembers?: string[]; + requiredZoneNames?: string[]; + type?: string; +} + +// @public +export interface PrivateLinkResources { + get(privateLinkResourceName: string, options?: PrivateLinkResourcesGetOptionalParams): Promise; + listByResource(options?: PrivateLinkResourcesListByResourceOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface PrivateLinkResourcesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkResourcesGetResponse = PrivateLinkResource; + +// @public +export interface PrivateLinkResourcesListByResourceNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkResourcesListByResourceNextResponse = PrivateLinkResourcesListResult; + +// @public +export interface PrivateLinkResourcesListByResourceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkResourcesListByResourceResponse = PrivateLinkResourcesListResult; + +// @public +export interface PrivateLinkResourcesListResult { + readonly nextLink?: string; + value?: PrivateLinkResource[]; +} + +// @public +export interface PrivateLinkServiceConnection { + groupIds?: string[]; + name?: string; + requestMessage?: string; +} + +// @public +export interface PrivateLinkServiceProxy { + groupConnectivityInformation?: GroupConnectivityInformation[]; + id?: string; + remotePrivateEndpointConnection?: RemotePrivateEndpointConnection; + remotePrivateLinkServiceConnectionState?: ConnectionState; +} + +// @public +export interface PrivateLinkServiceResourceOperationResults { + beginGet(options?: PrivateLinkServiceResourceOperationResultsGetOptionalParams): Promise, PrivateLinkServiceResourceOperationResultsGetResponse>>; + beginGetAndWait(options?: PrivateLinkServiceResourceOperationResultsGetOptionalParams): Promise; +} + +// @public +export interface PrivateLinkServiceResourceOperationResultsGetOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PrivateLinkServiceResourceOperationResultsGetResponse = AsyncOperationDetail; + +// @public +export interface PrivateLinkServices { + listByResourceGroup(options?: PrivateLinkServicesListByResourceGroupOptionalParams): Promise; +} + +// @public +export interface PrivateLinkServicesForPowerBI { + listBySubscriptionId(options?: PrivateLinkServicesForPowerBIListBySubscriptionIdOptionalParams): Promise; +} + +// @public (undocumented) +export class PrivateLinkServicesForPowerBIClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, operationId: string, resourceGroupName: string, azureResourceName: string, privateEndpointName: string, options?: PrivateLinkServicesForPowerBIClientOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + azureResourceName: string; + // (undocumented) + operationId: string; + // (undocumented) + operations: Operations; + // (undocumented) + powerBIResources: PowerBIResources; + // (undocumented) + privateEndpointConnections: PrivateEndpointConnections; + // (undocumented) + privateEndpointName: string; + // (undocumented) + privateLinkResources: PrivateLinkResources; + // (undocumented) + privateLinkServiceResourceOperationResults: PrivateLinkServiceResourceOperationResults; + // (undocumented) + privateLinkServices: PrivateLinkServices; + // (undocumented) + privateLinkServicesForPowerBI: PrivateLinkServicesForPowerBI; + // (undocumented) + resourceGroupName: string; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface PrivateLinkServicesForPowerBIClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface PrivateLinkServicesForPowerBIListBySubscriptionIdOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkServicesForPowerBIListBySubscriptionIdResponse = TenantResource[]; + +// @public +export interface PrivateLinkServicesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkServicesListByResourceGroupResponse = TenantResource[]; + +// @public +export interface RemotePrivateEndpointConnection { + id?: string; +} + +// @public +export type ResourceProvisioningState = string; + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TenantResource { + readonly id?: string; + location?: string; + readonly name?: string; + privateEndpointConnections?: PrivateEndpointConnection[]; + readonly systemData?: SystemData; + tags?: { + [propertyName: string]: string; + }; + tenantId?: string; + readonly type?: string; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/rollup.config.js b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/rollup.config.js new file mode 100644 index 000000000000..9be1955eb7f1 --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/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/powerbiprivatelinks/arm-powerbiprivatelinks/src/index.ts b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/index.ts new file mode 100644 index 000000000000..98f50d914318 --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/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 { PrivateLinkServicesForPowerBIClient } from "./privateLinkServicesForPowerBIClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/lroImpl.ts b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/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/powerbiprivatelinks/arm-powerbiprivatelinks/src/models/index.ts b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/models/index.ts new file mode 100644 index 000000000000..65ffbe68b142 --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/models/index.ts @@ -0,0 +1,590 @@ +/* + * 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"; + +/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ +export interface OperationListResult { + /** + * List of operations supported by the resource provider + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Operation[]; + /** + * URL to get the next set of operation list results (if there are any). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { + /** + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplay; + /** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly origin?: Origin; + /** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly actionType?: ActionType; +} + +/** Localized display information for this particular operation. */ +export interface OperationDisplay { + /** + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provider?: string; + /** + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resource?: string; + /** + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly operation?: string; + /** + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +/** The error detail. */ +export interface ErrorDetail { + /** + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorDetail[]; + /** + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly info?: Record; +} + +/** TenantResource */ +export interface TenantResource { + /** + * Specifies the resource identifier of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * Specifies the name of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Specifies the type of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The system metadata relating to this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** Specifies the location of the resource. */ + location?: string; + /** Specifies the tags of the resource. */ + tags?: { [propertyName: string]: string }; + /** Specifies the tenant id of the resource. */ + tenantId?: string; + /** Specifies the private endpoint connections of the resource. */ + privateEndpointConnections?: PrivateEndpointConnection[]; +} + +/** 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; +} + +/** PrivateEndpointConnection */ +export interface PrivateEndpointConnection { + /** + * Specifies the id of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * Specifies the name of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Specifies the type of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The system meta data relating to this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** Specifies the private endpoint. */ + privateEndpoint?: PrivateEndpoint; + /** Specifies the connection state. */ + privateLinkServiceConnectionState?: ConnectionState; + /** Provisioning state of the Private Endpoint Connection. */ + provisioningState?: ResourceProvisioningState; +} + +/** PrivateEndpoint */ +export interface PrivateEndpoint { + /** Specifies the id of private endpoint. */ + id?: string; +} + +/** ConnectionState information. */ +export interface ConnectionState { + /** Status of the connection. */ + status?: PersistedConnectionStatus; + /** Description of the connection state. */ + description?: string; + /** Actions required (if any). */ + actionsRequired?: string; +} + +/** AsyncOperationDetail */ +export interface AsyncOperationDetail { + /** The operation id. */ + id?: string; + /** The operation name. */ + name?: string; + /** The operation status. */ + status?: string; + /** The operation start time. */ + startTime?: string; + /** The operation end time. */ + endTime?: string; + /** The error. */ + error?: ErrorDetail; +} + +/** Specifies list of the private link resource. */ +export interface PrivateLinkResourcesListResult { + /** A collection of private endpoint connection resources. */ + value?: PrivateLinkResource[]; + /** + * URL to get the next set of operation list results (if there are any). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** A private link resource */ +export interface PrivateLinkResource { + /** Fully qualified identifier of the resource. */ + id?: string; + /** Name of the resource. */ + name?: string; + /** Type of the resource. */ + type?: string; + /** + * The private link resource group id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly groupId?: string; + /** + * The private link resource required member names. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly requiredMembers?: string[]; + /** The private link resource Private link DNS zone name. */ + requiredZoneNames?: string[]; +} + +/** List of private endpoint connections. */ +export interface PrivateEndpointConnectionListResult { + /** Specifies the name of the private endpoint connection. */ + value?: PrivateEndpointConnection[]; + /** + * URL to get the next set of operation list results (if there are any). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** PrivateLinkConnectionDetail */ +export interface PrivateLinkConnectionDetail { + /** Specifies the type of the connection detail. */ + id?: string; + /** Specifies the member name of the connection detail. */ + memberName?: string; + /** Specifies the private ip address of the connection detail. */ + privateIpAddress?: string; + /** Specifies the link id of the connection detail. */ + linkIdentifier?: string; + /** Specifies the group id of the connection detail. */ + groupId?: string; +} + +/** GroupConnectivityInformation */ +export interface GroupConnectivityInformation { + /** Specifies the group id of the group connectivity information. */ + groupId?: string; + /** Specifies the member name of the group connectivity information. */ + memberName?: string; + /** Specifies the internal FQDN of the group connectivity information. */ + internalFqdn?: string; + /** Specifies the customer visible FQDNs of the group connectivity information. */ + customerVisibleFqdns?: string[]; + /** Specifies the ARM region of the group connectivity information. */ + privateLinkServiceArmRegion?: string; +} + +/** PrivateLinkServiceProxy */ +export interface PrivateLinkServiceProxy { + /** Specifies the id of the private link service proxy. */ + id?: string; + /** Specifies the group connectivity information of the private link service proxy. */ + groupConnectivityInformation?: GroupConnectivityInformation[]; + /** Specifies the connection state of the private link service proxy. */ + remotePrivateLinkServiceConnectionState?: ConnectionState; + /** Specifies the private endpoint connection of the private link service proxy. */ + remotePrivateEndpointConnection?: RemotePrivateEndpointConnection; +} + +/** RemotePrivateEndpointConnection */ +export interface RemotePrivateEndpointConnection { + /** Specifies the id of private endpoint connection. */ + id?: string; +} + +/** PrivateLinkServiceConnection */ +export interface PrivateLinkServiceConnection { + /** Specifies the name of the private link service connection. */ + name?: string; + /** Specifies the group ids of the private link service connection. */ + groupIds?: string[]; + /** Specifies the request message of the private link service connection. */ + requestMessage?: string; +} + +/** Defines headers for PrivateEndpointConnections_delete operation. */ +export interface PrivateEndpointConnectionsDeleteHeaders { + /** The Azure async operation id to poll on result. */ + azureAsyncOperation?: string; +} + +/** Known values of {@link Origin} that the service accepts. */ +export enum KnownOrigin { + User = "user", + System = "system", + UserSystem = "user,system" +} + +/** + * Defines values for Origin. \ + * {@link KnownOrigin} can be used interchangeably with Origin, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user** \ + * **system** \ + * **user,system** + */ +export type Origin = string; + +/** Known values of {@link ActionType} that the service accepts. */ +export enum KnownActionType { + Internal = "Internal" +} + +/** + * Defines values for ActionType. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal** + */ +export type ActionType = string; + +/** 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 PersistedConnectionStatus} that the service accepts. */ +export enum KnownPersistedConnectionStatus { + Pending = "Pending", + Approved = "Approved", + Rejected = "Rejected", + Disconnected = "Disconnected" +} + +/** + * Defines values for PersistedConnectionStatus. \ + * {@link KnownPersistedConnectionStatus} can be used interchangeably with PersistedConnectionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Pending** \ + * **Approved** \ + * **Rejected** \ + * **Disconnected** + */ +export type PersistedConnectionStatus = string; + +/** Known values of {@link ResourceProvisioningState} that the service accepts. */ +export enum KnownResourceProvisioningState { + Creating = "Creating", + Updating = "Updating", + Deleting = "Deleting", + Succeeded = "Succeeded", + Canceled = "Canceled", + Failed = "Failed" +} + +/** + * Defines values for ResourceProvisioningState. \ + * {@link KnownResourceProvisioningState} can be used interchangeably with ResourceProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Creating** \ + * **Updating** \ + * **Deleting** \ + * **Succeeded** \ + * **Canceled** \ + * **Failed** + */ +export type ResourceProvisioningState = string; + +/** Known values of {@link ActionsRequired} that the service accepts. */ +export enum KnownActionsRequired { + None = "None", + Recreate = "Recreate" +} + +/** + * Defines values for ActionsRequired. \ + * {@link KnownActionsRequired} can be used interchangeably with ActionsRequired, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Recreate** + */ +export type ActionsRequired = string; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; + +/** Optional parameters. */ +export interface PrivateLinkServicesForPowerBIListBySubscriptionIdOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionId operation. */ +export type PrivateLinkServicesForPowerBIListBySubscriptionIdResponse = TenantResource[]; + +/** Optional parameters. */ +export interface PrivateLinkServiceResourceOperationResultsGetOptionalParams + 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 get operation. */ +export type PrivateLinkServiceResourceOperationResultsGetResponse = AsyncOperationDetail; + +/** Optional parameters. */ +export interface PrivateLinkServicesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type PrivateLinkServicesListByResourceGroupResponse = TenantResource[]; + +/** Optional parameters. */ +export interface PowerBIResourcesListByResourceNameOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceName operation. */ +export type PowerBIResourcesListByResourceNameResponse = TenantResource[]; + +/** Optional parameters. */ +export interface PowerBIResourcesCreateOptionalParams + extends coreClient.OperationOptions { + /** The client tenant id in header. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). */ + clientTenantId?: string; +} + +/** Contains response data for the create operation. */ +export type PowerBIResourcesCreateResponse = TenantResource; + +/** Optional parameters. */ +export interface PowerBIResourcesUpdateOptionalParams + extends coreClient.OperationOptions { + /** The client tenant id in header. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). */ + clientTenantId?: string; +} + +/** Contains response data for the update operation. */ +export type PowerBIResourcesUpdateResponse = TenantResource; + +/** Optional parameters. */ +export interface PowerBIResourcesDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface PrivateLinkResourcesListByResourceOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResource operation. */ +export type PrivateLinkResourcesListByResourceResponse = PrivateLinkResourcesListResult; + +/** Optional parameters. */ +export interface PrivateLinkResourcesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type PrivateLinkResourcesGetResponse = PrivateLinkResource; + +/** Optional parameters. */ +export interface PrivateLinkResourcesListByResourceNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceNext operation. */ +export type PrivateLinkResourcesListByResourceNextResponse = PrivateLinkResourcesListResult; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsListByResourceOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResource operation. */ +export type PrivateEndpointConnectionsListByResourceResponse = PrivateEndpointConnectionListResult; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsCreateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the create operation. */ +export type PrivateEndpointConnectionsCreateResponse = PrivateEndpointConnection; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsListByResourceNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceNext operation. */ +export type PrivateEndpointConnectionsListByResourceNextResponse = PrivateEndpointConnectionListResult; + +/** Optional parameters. */ +export interface PrivateLinkServicesForPowerBIClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/models/mappers.ts b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/models/mappers.ts new file mode 100644 index 000000000000..6904b0a933fd --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/models/mappers.ts @@ -0,0 +1,772 @@ +/* + * 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", + readOnly: true, + type: { + name: "String" + } + }, + isDataAction: { + serializedName: "isDataAction", + readOnly: true, + type: { + name: "Boolean" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + serializedName: "origin", + readOnly: true, + type: { + name: "String" + } + }, + actionType: { + serializedName: "actionType", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + readOnly: true, + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + readOnly: true, + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + } +}; + +export const ErrorDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetail", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + }, + target: { + serializedName: "target", + readOnly: true, + type: { + name: "String" + } + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + } + } + } +}; + +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + info: { + serializedName: "info", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + +export const TenantResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TenantResource", + 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" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + tenantId: { + serializedName: "properties.tenantId", + type: { + name: "String" + } + }, + privateEndpointConnections: { + serializedName: "properties.privateEndpointConnections", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } + } + } + } + } +}; + +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 PrivateEndpointConnection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnection", + 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" + } + }, + privateEndpoint: { + serializedName: "properties.privateEndpoint", + type: { + name: "Composite", + className: "PrivateEndpoint" + } + }, + privateLinkServiceConnectionState: { + serializedName: "properties.privateLinkServiceConnectionState", + type: { + name: "Composite", + className: "ConnectionState" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateEndpoint: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpoint", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + } + } + } +}; + +export const ConnectionState: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConnectionState", + modelProperties: { + status: { + serializedName: "status", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + }, + actionsRequired: { + serializedName: "actionsRequired", + type: { + name: "String" + } + } + } + } +}; + +export const AsyncOperationDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AsyncOperationDetail", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + }, + startTime: { + serializedName: "startTime", + type: { + name: "String" + } + }, + endTime: { + serializedName: "endTime", + type: { + name: "String" + } + }, + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + } +}; + +export const PrivateLinkResourcesListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkResourcesListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateLinkResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const PrivateLinkResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkResource", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "String" + } + }, + groupId: { + serializedName: "properties.groupId", + readOnly: true, + type: { + name: "String" + } + }, + requiredMembers: { + serializedName: "properties.requiredMembers", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + requiredZoneNames: { + serializedName: "properties.requiredZoneNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnectionListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const PrivateLinkConnectionDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkConnectionDetail", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + memberName: { + serializedName: "memberName", + type: { + name: "String" + } + }, + privateIpAddress: { + serializedName: "privateIpAddress", + type: { + name: "String" + } + }, + linkIdentifier: { + serializedName: "linkIdentifier", + type: { + name: "String" + } + }, + groupId: { + serializedName: "groupId", + type: { + name: "String" + } + } + } + } +}; + +export const GroupConnectivityInformation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GroupConnectivityInformation", + modelProperties: { + groupId: { + serializedName: "groupId", + type: { + name: "String" + } + }, + memberName: { + serializedName: "memberName", + type: { + name: "String" + } + }, + internalFqdn: { + serializedName: "internalFqdn", + type: { + name: "String" + } + }, + customerVisibleFqdns: { + serializedName: "customerVisibleFqdns", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + privateLinkServiceArmRegion: { + serializedName: "privateLinkServiceArmRegion", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateLinkServiceProxy: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkServiceProxy", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + groupConnectivityInformation: { + serializedName: "groupConnectivityInformation", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "GroupConnectivityInformation" + } + } + } + }, + remotePrivateLinkServiceConnectionState: { + serializedName: "remotePrivateLinkServiceConnectionState", + type: { + name: "Composite", + className: "ConnectionState" + } + }, + remotePrivateEndpointConnection: { + serializedName: "remotePrivateEndpointConnection", + type: { + name: "Composite", + className: "RemotePrivateEndpointConnection" + } + } + } + } +}; + +export const RemotePrivateEndpointConnection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RemotePrivateEndpointConnection", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateLinkServiceConnection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkServiceConnection", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + groupIds: { + serializedName: "groupIds", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + requestMessage: { + serializedName: "requestMessage", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateEndpointConnectionsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnectionsDeleteHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/models/parameters.ts b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/models/parameters.ts new file mode 100644 index 000000000000..030fe26e6a69 --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/models/parameters.ts @@ -0,0 +1,185 @@ +/* + * 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 { + TenantResource as TenantResourceMapper, + PrivateEndpointConnection as PrivateEndpointConnectionMapper +} from "../models/mappers"; + +export const accept: OperationParameter = { + parameterPath: "accept", + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" + } + } +}; + +export const $host: OperationURLParameter = { + parameterPath: "$host", + mapper: { + serializedName: "$host", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2020-06-01", + 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 operationId: OperationURLParameter = { + parameterPath: "operationId", + mapper: { + serializedName: "operationId", + required: true, + type: { + name: "String" + } + } +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + serializedName: "resourceGroupName", + required: true, + type: { + name: "String" + } + } +}; + +export const azureResourceName: OperationURLParameter = { + parameterPath: "azureResourceName", + mapper: { + serializedName: "azureResourceName", + 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 body: OperationParameter = { + parameterPath: "body", + mapper: TenantResourceMapper +}; + +export const clientTenantId: OperationParameter = { + parameterPath: ["options", "clientTenantId"], + mapper: { + serializedName: "x-ms-client-tenant-id", + type: { + name: "String" + } + } +}; + +export const privateLinkResourceName: OperationURLParameter = { + parameterPath: "privateLinkResourceName", + mapper: { + serializedName: "privateLinkResourceName", + required: true, + type: { + name: "String" + } + } +}; + +export const resourceGroupName1: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + serializedName: "resourceGroupName", + required: true, + type: { + name: "String" + } + } +}; + +export const azureResourceName1: OperationURLParameter = { + parameterPath: "azureResourceName", + mapper: { + serializedName: "azureResourceName", + required: true, + type: { + name: "String" + } + } +}; + +export const privateEndpointName: OperationURLParameter = { + parameterPath: "privateEndpointName", + mapper: { + serializedName: "privateEndpointName", + required: true, + type: { + name: "String" + } + } +}; + +export const privateEndpointConnection: OperationParameter = { + parameterPath: "privateEndpointConnection", + mapper: PrivateEndpointConnectionMapper +}; diff --git a/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operations/index.ts b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operations/index.ts new file mode 100644 index 000000000000..799fdd1854c3 --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operations/index.ts @@ -0,0 +1,15 @@ +/* + * 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 "./privateLinkServicesForPowerBI"; +export * from "./privateLinkServiceResourceOperationResults"; +export * from "./privateLinkServices"; +export * from "./powerBIResources"; +export * from "./privateLinkResources"; +export * from "./privateEndpointConnections"; diff --git a/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operations/operations.ts b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operations/operations.ts new file mode 100644 index 000000000000..a16721886d6f --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/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 { PrivateLinkServicesForPowerBIClient } from "../privateLinkServicesForPowerBIClient"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; + +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: PrivateLinkServicesForPowerBIClient; + + /** + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client + */ + constructor(client: PrivateLinkServicesForPowerBIClient) { + this.client = client; + } + + /** + * Lists all of the available Power BI RP 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 Power BI RP 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.PowerBI/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/powerbiprivatelinks/arm-powerbiprivatelinks/src/operations/powerBIResources.ts b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operations/powerBIResources.ts new file mode 100644 index 000000000000..5fc8de66efe5 --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operations/powerBIResources.ts @@ -0,0 +1,200 @@ +/* + * 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 { PowerBIResources } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { PrivateLinkServicesForPowerBIClient } from "../privateLinkServicesForPowerBIClient"; +import { + PowerBIResourcesListByResourceNameOptionalParams, + PowerBIResourcesListByResourceNameResponse, + TenantResource, + PowerBIResourcesCreateOptionalParams, + PowerBIResourcesCreateResponse, + PowerBIResourcesUpdateOptionalParams, + PowerBIResourcesUpdateResponse, + PowerBIResourcesDeleteOptionalParams +} from "../models"; + +/** Class containing PowerBIResources operations. */ +export class PowerBIResourcesImpl implements PowerBIResources { + private readonly client: PrivateLinkServicesForPowerBIClient; + + /** + * Initialize a new instance of the class PowerBIResources class. + * @param client Reference to the service client + */ + constructor(client: PrivateLinkServicesForPowerBIClient) { + this.client = client; + } + + /** + * Gets all the private link resources for the given Azure resource. + * @param options The options parameters. + */ + listByResourceName( + options?: PowerBIResourcesListByResourceNameOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listByResourceNameOperationSpec + ); + } + + /** + * Creates or updates a Private Link Service Resource for Power BI. + * @param body Tenant resource to be created or updated. + * @param options The options parameters. + */ + create( + body: TenantResource, + options?: PowerBIResourcesCreateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { body, options }, + createOperationSpec + ); + } + + /** + * Creates or updates a Private Link Service Resource for Power BI. + * @param body Tenant resource to be created or updated. + * @param options The options parameters. + */ + update( + body: TenantResource, + options?: PowerBIResourcesUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { body, options }, + updateOperationSpec + ); + } + + /** + * Deletes a Private Link Service Resource for Power BI. + * @param options The options parameters. + */ + delete(options?: PowerBIResourcesDeleteOptionalParams): Promise { + return this.client.sendOperationRequest({ options }, deleteOperationSpec); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByResourceNameOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: { + type: { + name: "Sequence", + element: { type: { name: "Composite", className: "TenantResource" } } + } + } + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.azureResourceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.TenantResource + }, + 201: { + bodyMapper: Mappers.TenantResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.azureResourceName + ], + headerParameters: [ + Parameters.accept, + Parameters.contentType, + Parameters.clientTenantId + ], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.TenantResource + }, + 201: { + bodyMapper: Mappers.TenantResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.azureResourceName + ], + headerParameters: [ + Parameters.accept, + Parameters.contentType, + Parameters.clientTenantId + ], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.azureResourceName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operations/privateEndpointConnections.ts b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operations/privateEndpointConnections.ts new file mode 100644 index 000000000000..17bae90f76f4 --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operations/privateEndpointConnections.ts @@ -0,0 +1,362 @@ +/* + * 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 { PrivateEndpointConnections } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { PrivateLinkServicesForPowerBIClient } from "../privateLinkServicesForPowerBIClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + PrivateEndpointConnection, + PrivateEndpointConnectionsListByResourceNextOptionalParams, + PrivateEndpointConnectionsListByResourceOptionalParams, + PrivateEndpointConnectionsListByResourceResponse, + PrivateEndpointConnectionsGetOptionalParams, + PrivateEndpointConnectionsGetResponse, + PrivateEndpointConnectionsCreateOptionalParams, + PrivateEndpointConnectionsCreateResponse, + PrivateEndpointConnectionsDeleteOptionalParams, + PrivateEndpointConnectionsListByResourceNextResponse +} from "../models"; + +/// +/** Class containing PrivateEndpointConnections operations. */ +export class PrivateEndpointConnectionsImpl + implements PrivateEndpointConnections { + private readonly client: PrivateLinkServicesForPowerBIClient; + + /** + * Initialize a new instance of the class PrivateEndpointConnections class. + * @param client Reference to the service client + */ + constructor(client: PrivateLinkServicesForPowerBIClient) { + this.client = client; + } + + /** + * Gets private endpoint connection for Power BI. + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param azureResourceName The name of the powerbi resource. + * @param options The options parameters. + */ + public listByResource( + resourceGroupName: string, + azureResourceName: string, + options?: PrivateEndpointConnectionsListByResourceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourcePagingAll( + resourceGroupName, + azureResourceName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourcePagingPage( + resourceGroupName, + azureResourceName, + options + ); + } + }; + } + + private async *listByResourcePagingPage( + resourceGroupName: string, + azureResourceName: string, + options?: PrivateEndpointConnectionsListByResourceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResource( + resourceGroupName, + azureResourceName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceNext( + resourceGroupName, + azureResourceName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourcePagingAll( + resourceGroupName: string, + azureResourceName: string, + options?: PrivateEndpointConnectionsListByResourceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourcePagingPage( + resourceGroupName, + azureResourceName, + options + )) { + yield* page; + } + } + + /** + * Gets private endpoint connection for Power BI. + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param azureResourceName The name of the powerbi resource. + * @param options The options parameters. + */ + private _listByResource( + resourceGroupName: string, + azureResourceName: string, + options?: PrivateEndpointConnectionsListByResourceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, azureResourceName, options }, + listByResourceOperationSpec + ); + } + + /** + * Get a specific private endpoint connection for Power BI by private endpoint name. + * @param options The options parameters. + */ + get( + options?: PrivateEndpointConnectionsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, getOperationSpec); + } + + /** + * Updates the status of Private Endpoint Connection object. Used to approve or reject a connection. + * @param privateEndpointConnection Private endpoint connection object to update. + * @param options The options parameters. + */ + create( + privateEndpointConnection: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { privateEndpointConnection, options }, + createOperationSpec + ); + } + + /** + * Deletes a private endpoint connection for Power BI by private endpoint name. + * @param options The options parameters. + */ + async beginDelete( + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl(sendOperation, { options }, deleteOperationSpec); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Deletes a private endpoint connection for Power BI by private endpoint name. + * @param options The options parameters. + */ + async beginDeleteAndWait( + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete(options); + return poller.pollUntilDone(); + } + + /** + * ListByResourceNext + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param azureResourceName The name of the powerbi resource. + * @param nextLink The nextLink from the previous successful call to the ListByResource method. + * @param options The options parameters. + */ + private _listByResourceNext( + resourceGroupName: string, + azureResourceName: string, + nextLink: string, + options?: PrivateEndpointConnectionsListByResourceNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, azureResourceName, nextLink, options }, + listByResourceNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByResourceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}/privateEndpointConnections", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnectionListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName1, + Parameters.azureResourceName1 + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}/privateEndpointConnections/{privateEndpointName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.azureResourceName, + Parameters.privateEndpointName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}/privateEndpointConnections/{privateEndpointName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + 201: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.privateEndpointConnection, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.azureResourceName, + Parameters.privateEndpointName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}/privateEndpointConnections/{privateEndpointName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.azureResourceName, + Parameters.privateEndpointName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnectionListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName1, + Parameters.azureResourceName1 + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operations/privateLinkResources.ts b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operations/privateLinkResources.ts new file mode 100644 index 000000000000..971ab6452f6f --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operations/privateLinkResources.ts @@ -0,0 +1,192 @@ +/* + * 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 { PrivateLinkResources } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { PrivateLinkServicesForPowerBIClient } from "../privateLinkServicesForPowerBIClient"; +import { + PrivateLinkResource, + PrivateLinkResourcesListByResourceNextOptionalParams, + PrivateLinkResourcesListByResourceOptionalParams, + PrivateLinkResourcesListByResourceResponse, + PrivateLinkResourcesGetOptionalParams, + PrivateLinkResourcesGetResponse, + PrivateLinkResourcesListByResourceNextResponse +} from "../models"; + +/// +/** Class containing PrivateLinkResources operations. */ +export class PrivateLinkResourcesImpl implements PrivateLinkResources { + private readonly client: PrivateLinkServicesForPowerBIClient; + + /** + * Initialize a new instance of the class PrivateLinkResources class. + * @param client Reference to the service client + */ + constructor(client: PrivateLinkServicesForPowerBIClient) { + this.client = client; + } + + /** + * List private link resources under a specific Power BI resource. + * @param options The options parameters. + */ + public listByResource( + options?: PrivateLinkResourcesListByResourceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourcePagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourcePagingPage(options); + } + }; + } + + private async *listByResourcePagingPage( + options?: PrivateLinkResourcesListByResourceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResource(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourcePagingAll( + options?: PrivateLinkResourcesListByResourceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourcePagingPage(options)) { + yield* page; + } + } + + /** + * List private link resources under a specific Power BI resource. + * @param options The options parameters. + */ + private _listByResource( + options?: PrivateLinkResourcesListByResourceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listByResourceOperationSpec + ); + } + + /** + * Get properties of a private link resource. + * @param privateLinkResourceName The name of private link resource. + * @param options The options parameters. + */ + get( + privateLinkResourceName: string, + options?: PrivateLinkResourcesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { privateLinkResourceName, options }, + getOperationSpec + ); + } + + /** + * ListByResourceNext + * @param nextLink The nextLink from the previous successful call to the ListByResource method. + * @param options The options parameters. + */ + private _listByResourceNext( + nextLink: string, + options?: PrivateLinkResourcesListByResourceNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listByResourceNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByResourceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}/privateLinkResources", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateLinkResourcesListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.azureResourceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI/{azureResourceName}/privateLinkResources/{privateLinkResourceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateLinkResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.azureResourceName, + Parameters.privateLinkResourceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateLinkResourcesListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.azureResourceName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operations/privateLinkServiceResourceOperationResults.ts b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operations/privateLinkServiceResourceOperationResults.ts new file mode 100644 index 000000000000..311d6890411b --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operations/privateLinkServiceResourceOperationResults.ts @@ -0,0 +1,136 @@ +/* + * 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 { PrivateLinkServiceResourceOperationResults } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { PrivateLinkServicesForPowerBIClient } from "../privateLinkServicesForPowerBIClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + PrivateLinkServiceResourceOperationResultsGetOptionalParams, + PrivateLinkServiceResourceOperationResultsGetResponse +} from "../models"; + +/** Class containing PrivateLinkServiceResourceOperationResults operations. */ +export class PrivateLinkServiceResourceOperationResultsImpl + implements PrivateLinkServiceResourceOperationResults { + private readonly client: PrivateLinkServicesForPowerBIClient; + + /** + * Initialize a new instance of the class PrivateLinkServiceResourceOperationResults class. + * @param client Reference to the service client + */ + constructor(client: PrivateLinkServicesForPowerBIClient) { + this.client = client; + } + + /** + * Gets operation result of Private Link Service Resources for Power BI. + * @param options The options parameters. + */ + async beginGet( + options?: PrivateLinkServiceResourceOperationResultsGetOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PrivateLinkServiceResourceOperationResultsGetResponse + > + > { + 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, { options }, getOperationSpec); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Gets operation result of Private Link Service Resources for Power BI. + * @param options The options parameters. + */ + async beginGetAndWait( + options?: PrivateLinkServiceResourceOperationResultsGetOptionalParams + ): Promise { + const poller = await this.beginGet(options); + return poller.pollUntilDone(); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.PowerBI/operationResults/{operationId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AsyncOperationDetail + }, + 201: { + bodyMapper: Mappers.AsyncOperationDetail + }, + 202: { + bodyMapper: Mappers.AsyncOperationDetail + }, + 204: { + bodyMapper: Mappers.AsyncOperationDetail + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.operationId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operations/privateLinkServices.ts b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operations/privateLinkServices.ts new file mode 100644 index 000000000000..007f1e24728c --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operations/privateLinkServices.ts @@ -0,0 +1,72 @@ +/* + * 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 { PrivateLinkServices } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { PrivateLinkServicesForPowerBIClient } from "../privateLinkServicesForPowerBIClient"; +import { + PrivateLinkServicesListByResourceGroupOptionalParams, + PrivateLinkServicesListByResourceGroupResponse +} from "../models"; + +/** Class containing PrivateLinkServices operations. */ +export class PrivateLinkServicesImpl implements PrivateLinkServices { + private readonly client: PrivateLinkServicesForPowerBIClient; + + /** + * Initialize a new instance of the class PrivateLinkServices class. + * @param client Reference to the service client + */ + constructor(client: PrivateLinkServicesForPowerBIClient) { + this.client = client; + } + + /** + * Gets all the private link resources for the given resource group. + * @param options The options parameters. + */ + listByResourceGroup( + options?: PrivateLinkServicesListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listByResourceGroupOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: { + type: { + name: "Sequence", + element: { type: { name: "Composite", className: "TenantResource" } } + } + } + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operations/privateLinkServicesForPowerBI.ts b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operations/privateLinkServicesForPowerBI.ts new file mode 100644 index 000000000000..3dc7d06cb966 --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operations/privateLinkServicesForPowerBI.ts @@ -0,0 +1,69 @@ +/* + * 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 { PrivateLinkServicesForPowerBI } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { PrivateLinkServicesForPowerBIClient } from "../privateLinkServicesForPowerBIClient"; +import { + PrivateLinkServicesForPowerBIListBySubscriptionIdOptionalParams, + PrivateLinkServicesForPowerBIListBySubscriptionIdResponse +} from "../models"; + +/** Class containing PrivateLinkServicesForPowerBI operations. */ +export class PrivateLinkServicesForPowerBIImpl + implements PrivateLinkServicesForPowerBI { + private readonly client: PrivateLinkServicesForPowerBIClient; + + /** + * Initialize a new instance of the class PrivateLinkServicesForPowerBI class. + * @param client Reference to the service client + */ + constructor(client: PrivateLinkServicesForPowerBIClient) { + this.client = client; + } + + /** + * Gets all the private link resources for the given subscription id. + * @param options The options parameters. + */ + listBySubscriptionId( + options?: PrivateLinkServicesForPowerBIListBySubscriptionIdOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionIdOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionIdOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: { + type: { + name: "Sequence", + element: { type: { name: "Composite", className: "TenantResource" } } + } + } + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operationsInterfaces/index.ts b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..799fdd1854c3 --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operationsInterfaces/index.ts @@ -0,0 +1,15 @@ +/* + * 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 "./privateLinkServicesForPowerBI"; +export * from "./privateLinkServiceResourceOperationResults"; +export * from "./privateLinkServices"; +export * from "./powerBIResources"; +export * from "./privateLinkResources"; +export * from "./privateEndpointConnections"; diff --git a/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operationsInterfaces/operations.ts b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..3ad4aab8a7cd --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/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 Power BI RP operations. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operationsInterfaces/powerBIResources.ts b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operationsInterfaces/powerBIResources.ts new file mode 100644 index 000000000000..17f9f84eb0df --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operationsInterfaces/powerBIResources.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + PowerBIResourcesListByResourceNameOptionalParams, + PowerBIResourcesListByResourceNameResponse, + TenantResource, + PowerBIResourcesCreateOptionalParams, + PowerBIResourcesCreateResponse, + PowerBIResourcesUpdateOptionalParams, + PowerBIResourcesUpdateResponse, + PowerBIResourcesDeleteOptionalParams +} from "../models"; + +/** Interface representing a PowerBIResources. */ +export interface PowerBIResources { + /** + * Gets all the private link resources for the given Azure resource. + * @param options The options parameters. + */ + listByResourceName( + options?: PowerBIResourcesListByResourceNameOptionalParams + ): Promise; + /** + * Creates or updates a Private Link Service Resource for Power BI. + * @param body Tenant resource to be created or updated. + * @param options The options parameters. + */ + create( + body: TenantResource, + options?: PowerBIResourcesCreateOptionalParams + ): Promise; + /** + * Creates or updates a Private Link Service Resource for Power BI. + * @param body Tenant resource to be created or updated. + * @param options The options parameters. + */ + update( + body: TenantResource, + options?: PowerBIResourcesUpdateOptionalParams + ): Promise; + /** + * Deletes a Private Link Service Resource for Power BI. + * @param options The options parameters. + */ + delete(options?: PowerBIResourcesDeleteOptionalParams): Promise; +} diff --git a/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operationsInterfaces/privateEndpointConnections.ts new file mode 100644 index 000000000000..1e395d1294fd --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operationsInterfaces/privateEndpointConnections.ts @@ -0,0 +1,65 @@ +/* + * 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 { + PrivateEndpointConnection, + PrivateEndpointConnectionsListByResourceOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, + PrivateEndpointConnectionsGetResponse, + PrivateEndpointConnectionsCreateOptionalParams, + PrivateEndpointConnectionsCreateResponse, + PrivateEndpointConnectionsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a PrivateEndpointConnections. */ +export interface PrivateEndpointConnections { + /** + * Gets private endpoint connection for Power BI. + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param azureResourceName The name of the powerbi resource. + * @param options The options parameters. + */ + listByResource( + resourceGroupName: string, + azureResourceName: string, + options?: PrivateEndpointConnectionsListByResourceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a specific private endpoint connection for Power BI by private endpoint name. + * @param options The options parameters. + */ + get( + options?: PrivateEndpointConnectionsGetOptionalParams + ): Promise; + /** + * Updates the status of Private Endpoint Connection object. Used to approve or reject a connection. + * @param privateEndpointConnection Private endpoint connection object to update. + * @param options The options parameters. + */ + create( + privateEndpointConnection: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOptionalParams + ): Promise; + /** + * Deletes a private endpoint connection for Power BI by private endpoint name. + * @param options The options parameters. + */ + beginDelete( + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a private endpoint connection for Power BI by private endpoint name. + * @param options The options parameters. + */ + beginDeleteAndWait( + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operationsInterfaces/privateLinkResources.ts b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operationsInterfaces/privateLinkResources.ts new file mode 100644 index 000000000000..4bba6a21bbce --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operationsInterfaces/privateLinkResources.ts @@ -0,0 +1,36 @@ +/* + * 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 { + PrivateLinkResource, + PrivateLinkResourcesListByResourceOptionalParams, + PrivateLinkResourcesGetOptionalParams, + PrivateLinkResourcesGetResponse +} from "../models"; + +/// +/** Interface representing a PrivateLinkResources. */ +export interface PrivateLinkResources { + /** + * List private link resources under a specific Power BI resource. + * @param options The options parameters. + */ + listByResource( + options?: PrivateLinkResourcesListByResourceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get properties of a private link resource. + * @param privateLinkResourceName The name of private link resource. + * @param options The options parameters. + */ + get( + privateLinkResourceName: string, + options?: PrivateLinkResourcesGetOptionalParams + ): Promise; +} diff --git a/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operationsInterfaces/privateLinkServiceResourceOperationResults.ts b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operationsInterfaces/privateLinkServiceResourceOperationResults.ts new file mode 100644 index 000000000000..9385f2c6a912 --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operationsInterfaces/privateLinkServiceResourceOperationResults.ts @@ -0,0 +1,36 @@ +/* + * 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 { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + PrivateLinkServiceResourceOperationResultsGetOptionalParams, + PrivateLinkServiceResourceOperationResultsGetResponse +} from "../models"; + +/** Interface representing a PrivateLinkServiceResourceOperationResults. */ +export interface PrivateLinkServiceResourceOperationResults { + /** + * Gets operation result of Private Link Service Resources for Power BI. + * @param options The options parameters. + */ + beginGet( + options?: PrivateLinkServiceResourceOperationResultsGetOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PrivateLinkServiceResourceOperationResultsGetResponse + > + >; + /** + * Gets operation result of Private Link Service Resources for Power BI. + * @param options The options parameters. + */ + beginGetAndWait( + options?: PrivateLinkServiceResourceOperationResultsGetOptionalParams + ): Promise; +} diff --git a/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operationsInterfaces/privateLinkServices.ts b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operationsInterfaces/privateLinkServices.ts new file mode 100644 index 000000000000..686bbd2eae80 --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operationsInterfaces/privateLinkServices.ts @@ -0,0 +1,23 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + PrivateLinkServicesListByResourceGroupOptionalParams, + PrivateLinkServicesListByResourceGroupResponse +} from "../models"; + +/** Interface representing a PrivateLinkServices. */ +export interface PrivateLinkServices { + /** + * Gets all the private link resources for the given resource group. + * @param options The options parameters. + */ + listByResourceGroup( + options?: PrivateLinkServicesListByResourceGroupOptionalParams + ): Promise; +} diff --git a/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operationsInterfaces/privateLinkServicesForPowerBI.ts b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operationsInterfaces/privateLinkServicesForPowerBI.ts new file mode 100644 index 000000000000..c1341e1774aa --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/operationsInterfaces/privateLinkServicesForPowerBI.ts @@ -0,0 +1,23 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + PrivateLinkServicesForPowerBIListBySubscriptionIdOptionalParams, + PrivateLinkServicesForPowerBIListBySubscriptionIdResponse +} from "../models"; + +/** Interface representing a PrivateLinkServicesForPowerBI. */ +export interface PrivateLinkServicesForPowerBI { + /** + * Gets all the private link resources for the given subscription id. + * @param options The options parameters. + */ + listBySubscriptionId( + options?: PrivateLinkServicesForPowerBIListBySubscriptionIdOptionalParams + ): Promise; +} diff --git a/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/privateLinkServicesForPowerBIClient.ts b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/privateLinkServicesForPowerBIClient.ts new file mode 100644 index 000000000000..54a8ce4a367f --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/src/privateLinkServicesForPowerBIClient.ts @@ -0,0 +1,136 @@ +/* + * 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, + PrivateLinkServicesForPowerBIImpl, + PrivateLinkServiceResourceOperationResultsImpl, + PrivateLinkServicesImpl, + PowerBIResourcesImpl, + PrivateLinkResourcesImpl, + PrivateEndpointConnectionsImpl +} from "./operations"; +import { + Operations, + PrivateLinkServicesForPowerBI, + PrivateLinkServiceResourceOperationResults, + PrivateLinkServices, + PowerBIResources, + PrivateLinkResources, + PrivateEndpointConnections +} from "./operationsInterfaces"; +import { PrivateLinkServicesForPowerBIClientOptionalParams } from "./models"; + +export class PrivateLinkServicesForPowerBIClient extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + operationId: string; + resourceGroupName: string; + azureResourceName: string; + privateEndpointName: string; + + /** + * Initializes a new instance of the PrivateLinkServicesForPowerBIClient class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The Azure subscription ID. This is a GUID-formatted string (e.g. + * 00000000-0000-0000-0000-000000000000). + * @param operationId The id of Azure async operation. + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + operationId: string, + resourceGroupName: string, + azureResourceName: string, + privateEndpointName: string, + options?: PrivateLinkServicesForPowerBIClientOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + if (operationId === undefined) { + throw new Error("'operationId' cannot be null"); + } + if (resourceGroupName === undefined) { + throw new Error("'resourceGroupName' cannot be null"); + } + if (azureResourceName === undefined) { + throw new Error("'azureResourceName' cannot be null"); + } + if (privateEndpointName === undefined) { + throw new Error("'privateEndpointName' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: PrivateLinkServicesForPowerBIClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-powerbiprivatelinks/1.0.0`; + 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; + this.operationId = operationId; + this.resourceGroupName = resourceGroupName; + this.azureResourceName = azureResourceName; + this.privateEndpointName = privateEndpointName; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2020-06-01"; + this.operations = new OperationsImpl(this); + this.privateLinkServicesForPowerBI = new PrivateLinkServicesForPowerBIImpl( + this + ); + this.privateLinkServiceResourceOperationResults = new PrivateLinkServiceResourceOperationResultsImpl( + this + ); + this.privateLinkServices = new PrivateLinkServicesImpl(this); + this.powerBIResources = new PowerBIResourcesImpl(this); + this.privateLinkResources = new PrivateLinkResourcesImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); + } + + operations: Operations; + privateLinkServicesForPowerBI: PrivateLinkServicesForPowerBI; + privateLinkServiceResourceOperationResults: PrivateLinkServiceResourceOperationResults; + privateLinkServices: PrivateLinkServices; + powerBIResources: PowerBIResources; + privateLinkResources: PrivateLinkResources; + privateEndpointConnections: PrivateEndpointConnections; +} diff --git a/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/test/sampleTest.ts b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/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/powerbiprivatelinks/arm-powerbiprivatelinks/tsconfig.json b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/tsconfig.json new file mode 100644 index 000000000000..3e6ae96443f3 --- /dev/null +++ b/sdk/powerbiprivatelinks/arm-powerbiprivatelinks/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/powerbiprivatelinks/ci.mgmt.yml b/sdk/powerbiprivatelinks/ci.mgmt.yml new file mode 100644 index 000000000000..9e19c52d292c --- /dev/null +++ b/sdk/powerbiprivatelinks/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/powerbiprivatelinks/arm-powerbiprivatelinks + - sdk/powerbiprivatelinks/ci.mgmt.yml + +pr: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/powerbiprivatelinks/arm-powerbiprivatelinks + - sdk/powerbiprivatelinks/ci.mgmt.yml + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: powerbiprivatelinks + Artifacts: + - name: azure-arm-powerbiprivatelinks + safeName: azurearmpowerbiprivatelinks + \ No newline at end of file