diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 2e994fd64f6f..a0ab07f0b8b8 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -128,6 +128,7 @@ specifiers: '@rush-temp/arm-servicebus': file:./projects/arm-servicebus.tgz '@rush-temp/arm-servicefabric': file:./projects/arm-servicefabric.tgz '@rush-temp/arm-servicefabricmesh': file:./projects/arm-servicefabricmesh.tgz + '@rush-temp/arm-servicelinker': file:./projects/arm-servicelinker.tgz '@rush-temp/arm-servicemap': file:./projects/arm-servicemap.tgz '@rush-temp/arm-signalr': file:./projects/arm-signalr.tgz '@rush-temp/arm-sql': file:./projects/arm-sql.tgz @@ -381,6 +382,7 @@ dependencies: '@rush-temp/arm-servicebus': file:projects/arm-servicebus.tgz '@rush-temp/arm-servicefabric': file:projects/arm-servicefabric.tgz '@rush-temp/arm-servicefabricmesh': file:projects/arm-servicefabricmesh.tgz + '@rush-temp/arm-servicelinker': file:projects/arm-servicelinker.tgz '@rush-temp/arm-servicemap': file:projects/arm-servicemap.tgz '@rush-temp/arm-signalr': file:projects/arm-signalr.tgz '@rush-temp/arm-sql': file:projects/arm-sql.tgz @@ -11966,6 +11968,31 @@ packages: - supports-color dev: false + file:projects/arm-servicelinker.tgz: + resolution: {integrity: sha512-jIYpNXYt+zbZZ8grMvC3mvPzX6Rq3lNSkJ1jgDAI7yHVMLud17dwB/iKzY0KIwJWqs47+bPqk1g2CEgrqD1olg==, tarball: file:projects/arm-servicelinker.tgz} + name: '@rush-temp/arm-servicelinker' + version: 0.0.0 + dependencies: + '@azure-tools/test-recorder': 1.0.2 + '@microsoft/api-extractor': 7.19.4 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 + cross-env: 7.0.3 + mkdirp: 1.0.4 + mocha: 7.2.0 + rimraf: 3.0.2 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + tslib: 2.3.1 + typescript: 4.2.4 + uglify-js: 3.15.1 + transitivePeerDependencies: + - encoding + - supports-color + dev: false + file:projects/arm-servicemap.tgz: resolution: {integrity: sha512-Y8Q9PXQu+1Piyy9trUSdIgpFJWoPNbyg4HI2WT5Y0Dy2bOIMOGu78n1hSGenwXtBJ4KqX5U6fkZkR0k/X8mZoA==, tarball: file:projects/arm-servicemap.tgz} name: '@rush-temp/arm-servicemap' @@ -13732,7 +13759,7 @@ packages: dev: false file:projects/digital-twins-core.tgz: - resolution: {integrity: sha512-HHJexN/cUky99Na2FGl/mUweka1rPkQFFVUaBWqP6yHLcZIikBhJ9rsxOS7TGOSM7wCsEGrlRolOh+5jiHMxzw==, tarball: file:projects/digital-twins-core.tgz} + resolution: {integrity: sha512-O94bnJUDhIxxX2FnhYTmpFtSLvpe2XaNNwI3e6a7JvEuIkcHKMiN8Sh5WvA8BAhkEV+KsKKKNS8v0erLyit6TA==, tarball: file:projects/digital-twins-core.tgz} name: '@rush-temp/digital-twins-core' version: 0.0.0 dependencies: @@ -13781,7 +13808,7 @@ packages: dev: false file:projects/dtdl-parser.tgz: - resolution: {integrity: sha512-HkF/GM4awodeF184YdeRQvLU+4ZEtC14BZNKwc+K3Z08l9qb+MyNS5/M6OogfKRwL0V6T+bgYGNRciYVn4JO3Q==, tarball: file:projects/dtdl-parser.tgz} + resolution: {integrity: sha512-/Dpf2haY7btQZGQuvHBOvp+FV73jJdRtvEb9Iq2FlChhxnlxi3rnU+c5d3RiTER/V7CN2eTqZTmGqU81I5hofA==, tarball: file:projects/dtdl-parser.tgz} name: '@rush-temp/dtdl-parser' version: 0.0.0 dependencies: diff --git a/rush.json b/rush.json index e2c0acf6aa72..6d7d500ca070 100644 --- a/rush.json +++ b/rush.json @@ -1574,6 +1574,11 @@ "packageName": "@azure/core-http-compat", "projectFolder": "sdk/core/core-http-compat", "versionPolicyName": "core" + }, + { + "packageName": "@azure/arm-servicelinker", + "projectFolder": "sdk/servicelinker/arm-servicelinker", + "versionPolicyName": "management" } ] -} +} \ No newline at end of file diff --git a/sdk/servicelinker/arm-servicelinker/CHANGELOG.md b/sdk/servicelinker/arm-servicelinker/CHANGELOG.md new file mode 100644 index 000000000000..74627b715a78 --- /dev/null +++ b/sdk/servicelinker/arm-servicelinker/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-02-24) + +The package of @azure/arm-servicelinker 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/servicelinker/arm-servicelinker/LICENSE b/sdk/servicelinker/arm-servicelinker/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/servicelinker/arm-servicelinker/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/servicelinker/arm-servicelinker/README.md b/sdk/servicelinker/arm-servicelinker/README.md new file mode 100644 index 000000000000..3e8300834eac --- /dev/null +++ b/sdk/servicelinker/arm-servicelinker/README.md @@ -0,0 +1,98 @@ +# Azure Service client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Service client. + +Microsoft.ServiceLinker provider + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/servicelinker/arm-servicelinker) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-servicelinker) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-servicelinker?view=azure-node-preview) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started + +### Currently supported environments + +- [LTS versions of Node.js](https://nodejs.org/about/releases/) +- Latest versions of Safari, Chrome, Edge and Firefox. + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-servicelinker` package + +Install the Azure Service client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-servicelinker +``` + +### Create and authenticate a `MicrosoftServiceLinker` + +To create a client object to access the Azure Service API, you will need the `endpoint` of your Azure Service resource and a `credential`. The Azure Service client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure Service 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 Service** 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 { MicrosoftServiceLinker } = require("@azure/arm-servicelinker"); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new MicrosoftServiceLinker(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 + +### MicrosoftServiceLinker + +`MicrosoftServiceLinker` is the primary interface for developers using the Azure Service client library. Explore the methods on this client object to understand the different features of the Azure Service 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%2Fservicelinker%2Farm-servicelinker%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/servicelinker/arm-servicelinker/_meta.json b/sdk/servicelinker/arm-servicelinker/_meta.json new file mode 100644 index 000000000000..14b7168f2861 --- /dev/null +++ b/sdk/servicelinker/arm-servicelinker/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "9967109a9ef7b27be87d72482788a3a5649f5bec", + "readme": "specification/servicelinker/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/servicelinker/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", + "use": "@autorest/typescript@6.0.0-alpha.16.20220105.1" +} \ No newline at end of file diff --git a/sdk/servicelinker/arm-servicelinker/api-extractor.json b/sdk/servicelinker/arm-servicelinker/api-extractor.json new file mode 100644 index 000000000000..224957c0cfb8 --- /dev/null +++ b/sdk/servicelinker/arm-servicelinker/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-servicelinker.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/servicelinker/arm-servicelinker/package.json b/sdk/servicelinker/arm-servicelinker/package.json new file mode 100644 index 000000000000..8b0adda1cfa9 --- /dev/null +++ b/sdk/servicelinker/arm-servicelinker/package.json @@ -0,0 +1,102 @@ +{ + "name": "@azure/arm-servicelinker", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", + "description": "A generated SDK for MicrosoftServiceLinker.", + "version": "1.0.0-beta.1", + "engines": { + "node": ">=12.0.0" + }, + "dependencies": { + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-servicelinker.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/servicelinker/arm-servicelinker", + "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/servicelinker/arm-servicelinker/review/arm-servicelinker.api.md b/sdk/servicelinker/arm-servicelinker/review/arm-servicelinker.api.md new file mode 100644 index 000000000000..ebdb580ea8dc --- /dev/null +++ b/sdk/servicelinker/arm-servicelinker/review/arm-servicelinker.api.md @@ -0,0 +1,398 @@ +## API Report File for "@azure/arm-servicelinker" + +> 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 ActionType = string; + +// @public +export interface AuthInfoBase { + authType: "secret" | "userAssignedIdentity" | "systemAssignedIdentity" | "servicePrincipalSecret" | "servicePrincipalCertificate"; +} + +// @public (undocumented) +export type AuthInfoBaseUnion = AuthInfoBase | SecretAuthInfo | UserAssignedIdentityAuthInfo | SystemAssignedIdentityAuthInfo | ServicePrincipalSecretAuthInfo | ServicePrincipalCertificateAuthInfo; + +// @public +export type AuthType = string; + +// @public +export type ClientType = string; + +// @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 enum KnownActionType { + // (undocumented) + Internal = "Internal" +} + +// @public +export enum KnownAuthType { + // (undocumented) + Secret = "secret", + // (undocumented) + ServicePrincipalCertificate = "servicePrincipalCertificate", + // (undocumented) + ServicePrincipalSecret = "servicePrincipalSecret", + // (undocumented) + SystemAssignedIdentity = "systemAssignedIdentity", + // (undocumented) + UserAssignedIdentity = "userAssignedIdentity" +} + +// @public +export enum KnownClientType { + // (undocumented) + Django = "django", + // (undocumented) + Dotnet = "dotnet", + // (undocumented) + Go = "go", + // (undocumented) + Java = "java", + // (undocumented) + Nodejs = "nodejs", + // (undocumented) + None = "none", + // (undocumented) + Php = "php", + // (undocumented) + Python = "python", + // (undocumented) + Ruby = "ruby", + // (undocumented) + SpringBoot = "springBoot" +} + +// @public +export enum KnownCreatedByType { + // (undocumented) + Application = "Application", + // (undocumented) + Key = "Key", + // (undocumented) + ManagedIdentity = "ManagedIdentity", + // (undocumented) + User = "User" +} + +// @public +export enum KnownLinkerStatus { + // (undocumented) + Healthy = "Healthy", + // (undocumented) + NotHealthy = "Not healthy" +} + +// @public +export enum KnownOrigin { + // (undocumented) + System = "system", + // (undocumented) + User = "user", + // (undocumented) + UserSystem = "user,system" +} + +// @public +export enum KnownVNetSolutionType { + // (undocumented) + PrivateLink = "privateLink", + // (undocumented) + ServiceEndpoint = "serviceEndpoint" +} + +// @public +export interface Linker { + beginCreateOrUpdate(resourceUri: string, linkerName: string, parameters: LinkerResource, options?: LinkerCreateOrUpdateOptionalParams): Promise, LinkerCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceUri: string, linkerName: string, parameters: LinkerResource, options?: LinkerCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceUri: string, linkerName: string, options?: LinkerDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceUri: string, linkerName: string, options?: LinkerDeleteOptionalParams): Promise; + beginUpdate(resourceUri: string, linkerName: string, parameters: LinkerPatch, options?: LinkerUpdateOptionalParams): Promise, LinkerUpdateResponse>>; + beginUpdateAndWait(resourceUri: string, linkerName: string, parameters: LinkerPatch, options?: LinkerUpdateOptionalParams): Promise; + beginValidate(resourceUri: string, linkerName: string, options?: LinkerValidateOptionalParams): Promise, LinkerValidateResponse>>; + beginValidateAndWait(resourceUri: string, linkerName: string, options?: LinkerValidateOptionalParams): Promise; + get(resourceUri: string, linkerName: string, options?: LinkerGetOptionalParams): Promise; + list(resourceUri: string, options?: LinkerListOptionalParams): PagedAsyncIterableIterator; + listConfigurations(resourceUri: string, linkerName: string, options?: LinkerListConfigurationsOptionalParams): Promise; +} + +// @public +export interface LinkerCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type LinkerCreateOrUpdateResponse = LinkerResource; + +// @public +export interface LinkerDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface LinkerGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type LinkerGetResponse = LinkerResource; + +// @public +export interface LinkerList { + nextLink?: string; + value?: LinkerResource[]; +} + +// @public +export interface LinkerListConfigurationsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type LinkerListConfigurationsResponse = SourceConfigurationResult; + +// @public +export interface LinkerListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type LinkerListNextResponse = LinkerList; + +// @public +export interface LinkerListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type LinkerListResponse = LinkerList; + +// @public +export interface LinkerPatch { + authInfo?: AuthInfoBaseUnion; + clientType?: ClientType; + readonly provisioningState?: string; + secretStore?: SecretStore; + targetId?: string; + vNetSolution?: VNetSolution; +} + +// @public +export type LinkerResource = ProxyResource & { + readonly systemData?: SystemData; + targetId?: string; + authInfo?: AuthInfoBaseUnion; + clientType?: ClientType; + readonly provisioningState?: string; + vNetSolution?: VNetSolution; + secretStore?: SecretStore; +}; + +// @public +export type LinkerStatus = string; + +// @public +export interface LinkerUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type LinkerUpdateResponse = LinkerResource; + +// @public +export interface LinkerValidateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type LinkerValidateResponse = ValidateResult; + +// @public (undocumented) +export class MicrosoftServiceLinker extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, options?: MicrosoftServiceLinkerOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + linker: Linker; + // (undocumented) + operations: Operations; +} + +// @public +export interface MicrosoftServiceLinkerOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface Operation { + readonly actionType?: ActionType; + display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationListResult { + readonly nextLink?: string; + readonly value?: Operation[]; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationListResult; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public +export type Origin = string; + +// @public +export type ProxyResource = Resource & {}; + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export type SecretAuthInfo = AuthInfoBase & { + authType: "secret"; + name?: string; + secret?: string; +}; + +// @public +export interface SecretStore { + keyVaultId?: string; +} + +// @public +export type ServicePrincipalCertificateAuthInfo = AuthInfoBase & { + authType: "servicePrincipalCertificate"; + clientId: string; + principalId: string; + certificate: string; +}; + +// @public +export type ServicePrincipalSecretAuthInfo = AuthInfoBase & { + authType: "servicePrincipalSecret"; + clientId: string; + principalId: string; + secret: string; +}; + +// @public +export interface SourceConfiguration { + name?: string; + value?: string; +} + +// @public +export interface SourceConfigurationResult { + configurations?: SourceConfiguration[]; +} + +// @public +export type SystemAssignedIdentityAuthInfo = AuthInfoBase & { + authType: "systemAssignedIdentity"; +}; + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export type UserAssignedIdentityAuthInfo = AuthInfoBase & { + authType: "userAssignedIdentity"; + clientId: string; + subscriptionId: string; +}; + +// @public +export interface ValidateResult { + authType?: AuthType; + linkerStatus?: LinkerStatus; + name?: string; + reason?: string; + reportEndTimeUtc?: Date; + reportStartTimeUtc?: Date; + targetId?: string; +} + +// @public +export interface VNetSolution { + type?: VNetSolutionType; +} + +// @public +export type VNetSolutionType = string; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/servicelinker/arm-servicelinker/rollup.config.js b/sdk/servicelinker/arm-servicelinker/rollup.config.js new file mode 100644 index 000000000000..9be1955eb7f1 --- /dev/null +++ b/sdk/servicelinker/arm-servicelinker/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/servicelinker/arm-servicelinker/src/index.ts b/sdk/servicelinker/arm-servicelinker/src/index.ts new file mode 100644 index 000000000000..d2f4e0134ac5 --- /dev/null +++ b/sdk/servicelinker/arm-servicelinker/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 { MicrosoftServiceLinker } from "./microsoftServiceLinker"; +export * from "./operationsInterfaces"; diff --git a/sdk/servicelinker/arm-servicelinker/src/lroImpl.ts b/sdk/servicelinker/arm-servicelinker/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/servicelinker/arm-servicelinker/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/servicelinker/arm-servicelinker/src/microsoftServiceLinker.ts b/sdk/servicelinker/arm-servicelinker/src/microsoftServiceLinker.ts new file mode 100644 index 000000000000..488e4b294dd0 --- /dev/null +++ b/sdk/servicelinker/arm-servicelinker/src/microsoftServiceLinker.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 * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { LinkerImpl, OperationsImpl } from "./operations"; +import { Linker, Operations } from "./operationsInterfaces"; +import { MicrosoftServiceLinkerOptionalParams } from "./models"; + +export class MicrosoftServiceLinker extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + + /** + * Initializes a new instance of the MicrosoftServiceLinker class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + options?: MicrosoftServiceLinkerOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: MicrosoftServiceLinkerOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-servicelinker/1.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2021-11-01-preview"; + this.linker = new LinkerImpl(this); + this.operations = new OperationsImpl(this); + } + + linker: Linker; + operations: Operations; +} diff --git a/sdk/servicelinker/arm-servicelinker/src/models/index.ts b/sdk/servicelinker/arm-servicelinker/src/models/index.ts new file mode 100644 index 000000000000..53fbd50d4a20 --- /dev/null +++ b/sdk/servicelinker/arm-servicelinker/src/models/index.ts @@ -0,0 +1,558 @@ +/* + * 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 type AuthInfoBaseUnion = + | AuthInfoBase + | SecretAuthInfo + | UserAssignedIdentityAuthInfo + | SystemAssignedIdentityAuthInfo + | ServicePrincipalSecretAuthInfo + | ServicePrincipalCertificateAuthInfo; + +/** The list of Linker. */ +export interface LinkerList { + /** The link used to get the next page of Linker list. */ + nextLink?: string; + /** The list of Linkers. */ + value?: LinkerResource[]; +} + +/** The authentication info */ +export interface AuthInfoBase { + /** Polymorphic discriminator, which specifies the different types this object can be */ + authType: + | "secret" + | "userAssignedIdentity" + | "systemAssignedIdentity" + | "servicePrincipalSecret" + | "servicePrincipalCertificate"; +} + +/** The VNet solution for linker */ +export interface VNetSolution { + /** Type of VNet solution. */ + type?: VNetSolutionType; +} + +/** An option to store secret value in secure place */ +export interface SecretStore { + /** The key vault id to store secret */ + keyVaultId?: string; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; +} + +/** 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; +} + +/** A linker to be updated. */ +export interface LinkerPatch { + /** The resource Id of target service. */ + targetId?: string; + /** The authentication type. */ + authInfo?: AuthInfoBaseUnion; + /** The application client type */ + clientType?: ClientType; + /** + * The provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** The VNet solution. */ + vNetSolution?: VNetSolution; + /** An option to store secret value in secure place */ + secretStore?: SecretStore; +} + +/** The validation result for a linker. */ +export interface ValidateResult { + /** The linker name. */ + name?: string; + /** Specifies if the linker is healthy. */ + linkerStatus?: LinkerStatus; + /** The reason of the error. */ + reason?: string; + /** The start time of the validation report. */ + reportStartTimeUtc?: Date; + /** The end time of the validation report. */ + reportEndTimeUtc?: Date; + /** The resource Id of target service. */ + targetId?: string; + /** The authentication type. */ + authType?: AuthType; +} + +/** Configurations for source resource, include appSettings, connectionString and serviceBindings */ +export interface SourceConfigurationResult { + /** The configuration properties for source resource. */ + configurations?: SourceConfiguration[]; +} + +/** A configuration item for source resource */ +export interface SourceConfiguration { + /** The name of setting. */ + name?: string; + /** The value of setting */ + value?: string; +} + +/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ +export interface OperationListResult { + /** + * List of operations supported by the resource provider + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Operation[]; + /** + * URL to get the next set of operation list results (if there are any). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { + /** + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplay; + /** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly origin?: Origin; + /** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly actionType?: ActionType; +} + +/** Localized display information for this particular operation. */ +export interface OperationDisplay { + /** + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provider?: string; + /** + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resource?: string; + /** + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly operation?: string; + /** + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; +} + +/** The authentication info when authType is secret */ +export type SecretAuthInfo = AuthInfoBase & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + authType: "secret"; + /** Username or account name for secret auth. */ + name?: string; + /** Password or account key for secret auth. */ + secret?: string; +}; + +/** The authentication info when authType is userAssignedIdentity */ +export type UserAssignedIdentityAuthInfo = AuthInfoBase & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + authType: "userAssignedIdentity"; + /** Client Id for userAssignedIdentity. */ + clientId: string; + /** Subscription id for userAssignedIdentity. */ + subscriptionId: string; +}; + +/** The authentication info when authType is systemAssignedIdentity */ +export type SystemAssignedIdentityAuthInfo = AuthInfoBase & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + authType: "systemAssignedIdentity"; +}; + +/** The authentication info when authType is servicePrincipal secret */ +export type ServicePrincipalSecretAuthInfo = AuthInfoBase & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + authType: "servicePrincipalSecret"; + /** ServicePrincipal application clientId for servicePrincipal auth. */ + clientId: string; + /** Principal Id for servicePrincipal auth. */ + principalId: string; + /** Secret for servicePrincipal auth. */ + secret: string; +}; + +/** The authentication info when authType is servicePrincipal certificate */ +export type ServicePrincipalCertificateAuthInfo = AuthInfoBase & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + authType: "servicePrincipalCertificate"; + /** Application clientId for servicePrincipal auth. */ + clientId: string; + /** Principal Id for servicePrincipal auth. */ + principalId: string; + /** ServicePrincipal certificate for servicePrincipal auth. */ + certificate: string; +}; + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export type ProxyResource = Resource & {}; + +/** Linker of source and target resource */ +export type LinkerResource = ProxyResource & { + /** + * The system data. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** The resource Id of target service. */ + targetId?: string; + /** The authentication type. */ + authInfo?: AuthInfoBaseUnion; + /** The application client type */ + clientType?: ClientType; + /** + * The provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** The VNet solution. */ + vNetSolution?: VNetSolution; + /** An option to store secret value in secure place */ + secretStore?: SecretStore; +}; + +/** Known values of {@link AuthType} that the service accepts. */ +export enum KnownAuthType { + SystemAssignedIdentity = "systemAssignedIdentity", + UserAssignedIdentity = "userAssignedIdentity", + ServicePrincipalSecret = "servicePrincipalSecret", + ServicePrincipalCertificate = "servicePrincipalCertificate", + Secret = "secret" +} + +/** + * Defines values for AuthType. \ + * {@link KnownAuthType} can be used interchangeably with AuthType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **systemAssignedIdentity** \ + * **userAssignedIdentity** \ + * **servicePrincipalSecret** \ + * **servicePrincipalCertificate** \ + * **secret** + */ +export type AuthType = string; + +/** Known values of {@link ClientType} that the service accepts. */ +export enum KnownClientType { + None = "none", + Dotnet = "dotnet", + Java = "java", + Python = "python", + Go = "go", + Php = "php", + Ruby = "ruby", + Django = "django", + Nodejs = "nodejs", + SpringBoot = "springBoot" +} + +/** + * Defines values for ClientType. \ + * {@link KnownClientType} can be used interchangeably with ClientType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **none** \ + * **dotnet** \ + * **java** \ + * **python** \ + * **go** \ + * **php** \ + * **ruby** \ + * **django** \ + * **nodejs** \ + * **springBoot** + */ +export type ClientType = string; + +/** Known values of {@link VNetSolutionType} that the service accepts. */ +export enum KnownVNetSolutionType { + ServiceEndpoint = "serviceEndpoint", + PrivateLink = "privateLink" +} + +/** + * Defines values for VNetSolutionType. \ + * {@link KnownVNetSolutionType} can be used interchangeably with VNetSolutionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **serviceEndpoint** \ + * **privateLink** + */ +export type VNetSolutionType = 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 LinkerStatus} that the service accepts. */ +export enum KnownLinkerStatus { + Healthy = "Healthy", + NotHealthy = "Not healthy" +} + +/** + * Defines values for LinkerStatus. \ + * {@link KnownLinkerStatus} can be used interchangeably with LinkerStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Healthy** \ + * **Not healthy** + */ +export type LinkerStatus = 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; + +/** Optional parameters. */ +export interface LinkerListOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type LinkerListResponse = LinkerList; + +/** Optional parameters. */ +export interface LinkerGetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type LinkerGetResponse = LinkerResource; + +/** Optional parameters. */ +export interface LinkerCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type LinkerCreateOrUpdateResponse = LinkerResource; + +/** Optional parameters. */ +export interface LinkerDeleteOptionalParams + 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 LinkerUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type LinkerUpdateResponse = LinkerResource; + +/** Optional parameters. */ +export interface LinkerValidateOptionalParams + 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 validate operation. */ +export type LinkerValidateResponse = ValidateResult; + +/** Optional parameters. */ +export interface LinkerListConfigurationsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listConfigurations operation. */ +export type LinkerListConfigurationsResponse = SourceConfigurationResult; + +/** Optional parameters. */ +export interface LinkerListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type LinkerListNextResponse = LinkerList; + +/** 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 MicrosoftServiceLinkerOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/servicelinker/arm-servicelinker/src/models/mappers.ts b/sdk/servicelinker/arm-servicelinker/src/models/mappers.ts new file mode 100644 index 000000000000..5331a64debe8 --- /dev/null +++ b/sdk/servicelinker/arm-servicelinker/src/models/mappers.ts @@ -0,0 +1,719 @@ +/* + * 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 LinkerList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LinkerList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LinkerResource" + } + } + } + } + } + } +}; + +export const AuthInfoBase: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AuthInfoBase", + uberParent: "AuthInfoBase", + polymorphicDiscriminator: { + serializedName: "authType", + clientName: "authType" + }, + modelProperties: { + authType: { + serializedName: "authType", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const VNetSolution: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VNetSolution", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const SecretStore: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SecretStore", + modelProperties: { + keyVaultId: { + serializedName: "keyVaultId", + type: { + name: "String" + } + } + } + } +}; + +export const SystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } + } + } + } +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const 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 LinkerPatch: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LinkerPatch", + modelProperties: { + targetId: { + serializedName: "properties.targetId", + type: { + name: "String" + } + }, + authInfo: { + serializedName: "properties.authInfo", + type: { + name: "Composite", + className: "AuthInfoBase" + } + }, + clientType: { + serializedName: "properties.clientType", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + vNetSolution: { + serializedName: "properties.vNetSolution", + type: { + name: "Composite", + className: "VNetSolution" + } + }, + secretStore: { + serializedName: "properties.secretStore", + type: { + name: "Composite", + className: "SecretStore" + } + } + } + } +}; + +export const ValidateResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ValidateResult", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + linkerStatus: { + serializedName: "linkerStatus", + type: { + name: "String" + } + }, + reason: { + serializedName: "reason", + type: { + name: "String" + } + }, + reportStartTimeUtc: { + serializedName: "reportStartTimeUtc", + type: { + name: "DateTime" + } + }, + reportEndTimeUtc: { + serializedName: "reportEndTimeUtc", + type: { + name: "DateTime" + } + }, + targetId: { + serializedName: "targetId", + type: { + name: "String" + } + }, + authType: { + serializedName: "authType", + type: { + name: "String" + } + } + } + } +}; + +export const SourceConfigurationResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SourceConfigurationResult", + modelProperties: { + configurations: { + serializedName: "configurations", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SourceConfiguration" + } + } + } + } + } + } +}; + +export const SourceConfiguration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SourceConfiguration", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "String" + } + } + } + } +}; + +export const OperationListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Operation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + isDataAction: { + serializedName: "isDataAction", + readOnly: true, + type: { + name: "Boolean" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + serializedName: "origin", + readOnly: true, + type: { + name: "String" + } + }, + actionType: { + serializedName: "actionType", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + readOnly: true, + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + readOnly: true, + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const SecretAuthInfo: coreClient.CompositeMapper = { + serializedName: "secret", + type: { + name: "Composite", + className: "SecretAuthInfo", + uberParent: "AuthInfoBase", + polymorphicDiscriminator: AuthInfoBase.type.polymorphicDiscriminator, + modelProperties: { + ...AuthInfoBase.type.modelProperties, + name: { + serializedName: "name", + type: { + name: "String" + } + }, + secret: { + serializedName: "secret", + type: { + name: "String" + } + } + } + } +}; + +export const UserAssignedIdentityAuthInfo: coreClient.CompositeMapper = { + serializedName: "userAssignedIdentity", + type: { + name: "Composite", + className: "UserAssignedIdentityAuthInfo", + uberParent: "AuthInfoBase", + polymorphicDiscriminator: AuthInfoBase.type.polymorphicDiscriminator, + modelProperties: { + ...AuthInfoBase.type.modelProperties, + clientId: { + serializedName: "clientId", + required: true, + type: { + name: "String" + } + }, + subscriptionId: { + serializedName: "subscriptionId", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const SystemAssignedIdentityAuthInfo: coreClient.CompositeMapper = { + serializedName: "systemAssignedIdentity", + type: { + name: "Composite", + className: "SystemAssignedIdentityAuthInfo", + uberParent: "AuthInfoBase", + polymorphicDiscriminator: AuthInfoBase.type.polymorphicDiscriminator, + modelProperties: { + ...AuthInfoBase.type.modelProperties + } + } +}; + +export const ServicePrincipalSecretAuthInfo: coreClient.CompositeMapper = { + serializedName: "servicePrincipalSecret", + type: { + name: "Composite", + className: "ServicePrincipalSecretAuthInfo", + uberParent: "AuthInfoBase", + polymorphicDiscriminator: AuthInfoBase.type.polymorphicDiscriminator, + modelProperties: { + ...AuthInfoBase.type.modelProperties, + clientId: { + serializedName: "clientId", + required: true, + type: { + name: "String" + } + }, + principalId: { + serializedName: "principalId", + required: true, + type: { + name: "String" + } + }, + secret: { + serializedName: "secret", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const ServicePrincipalCertificateAuthInfo: coreClient.CompositeMapper = { + serializedName: "servicePrincipalCertificate", + type: { + name: "Composite", + className: "ServicePrincipalCertificateAuthInfo", + uberParent: "AuthInfoBase", + polymorphicDiscriminator: AuthInfoBase.type.polymorphicDiscriminator, + modelProperties: { + ...AuthInfoBase.type.modelProperties, + clientId: { + serializedName: "clientId", + required: true, + type: { + name: "String" + } + }, + principalId: { + serializedName: "principalId", + required: true, + type: { + name: "String" + } + }, + certificate: { + serializedName: "certificate", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties + } + } +}; + +export const LinkerResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LinkerResource", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + targetId: { + serializedName: "properties.targetId", + type: { + name: "String" + } + }, + authInfo: { + serializedName: "properties.authInfo", + type: { + name: "Composite", + className: "AuthInfoBase" + } + }, + clientType: { + serializedName: "properties.clientType", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + vNetSolution: { + serializedName: "properties.vNetSolution", + type: { + name: "Composite", + className: "VNetSolution" + } + }, + secretStore: { + serializedName: "properties.secretStore", + type: { + name: "Composite", + className: "SecretStore" + } + } + } + } +}; + +export let discriminators = { + AuthInfoBase: AuthInfoBase, + "AuthInfoBase.secret": SecretAuthInfo, + "AuthInfoBase.userAssignedIdentity": UserAssignedIdentityAuthInfo, + "AuthInfoBase.systemAssignedIdentity": SystemAssignedIdentityAuthInfo, + "AuthInfoBase.servicePrincipalSecret": ServicePrincipalSecretAuthInfo, + "AuthInfoBase.servicePrincipalCertificate": ServicePrincipalCertificateAuthInfo +}; diff --git a/sdk/servicelinker/arm-servicelinker/src/models/parameters.ts b/sdk/servicelinker/arm-servicelinker/src/models/parameters.ts new file mode 100644 index 000000000000..a3bb3163a47a --- /dev/null +++ b/sdk/servicelinker/arm-servicelinker/src/models/parameters.ts @@ -0,0 +1,110 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + LinkerResource as LinkerResourceMapper, + LinkerPatch as LinkerPatchMapper +} 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 resourceUri: OperationURLParameter = { + parameterPath: "resourceUri", + mapper: { + serializedName: "resourceUri", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2021-11-01-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const linkerName: OperationURLParameter = { + parameterPath: "linkerName", + mapper: { + serializedName: "linkerName", + 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 parameters: OperationParameter = { + parameterPath: "parameters", + mapper: LinkerResourceMapper +}; + +export const parameters1: OperationParameter = { + parameterPath: "parameters", + mapper: LinkerPatchMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; diff --git a/sdk/servicelinker/arm-servicelinker/src/operations/index.ts b/sdk/servicelinker/arm-servicelinker/src/operations/index.ts new file mode 100644 index 000000000000..8ef3ff9c3dd7 --- /dev/null +++ b/sdk/servicelinker/arm-servicelinker/src/operations/index.ts @@ -0,0 +1,10 @@ +/* + * 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 "./linker"; +export * from "./operations"; diff --git a/sdk/servicelinker/arm-servicelinker/src/operations/linker.ts b/sdk/servicelinker/arm-servicelinker/src/operations/linker.ts new file mode 100644 index 000000000000..15b897e2e2e0 --- /dev/null +++ b/sdk/servicelinker/arm-servicelinker/src/operations/linker.ts @@ -0,0 +1,705 @@ +/* + * 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 { Linker } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftServiceLinker } from "../microsoftServiceLinker"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + LinkerResource, + LinkerListNextOptionalParams, + LinkerListOptionalParams, + LinkerListResponse, + LinkerGetOptionalParams, + LinkerGetResponse, + LinkerCreateOrUpdateOptionalParams, + LinkerCreateOrUpdateResponse, + LinkerDeleteOptionalParams, + LinkerPatch, + LinkerUpdateOptionalParams, + LinkerUpdateResponse, + LinkerValidateOptionalParams, + LinkerValidateResponse, + LinkerListConfigurationsOptionalParams, + LinkerListConfigurationsResponse, + LinkerListNextResponse +} from "../models"; + +/// +/** Class containing Linker operations. */ +export class LinkerImpl implements Linker { + private readonly client: MicrosoftServiceLinker; + + /** + * Initialize a new instance of the class Linker class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftServiceLinker) { + this.client = client; + } + + /** + * Returns list of Linkers which connects to the resource. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be + * connected. + * @param options The options parameters. + */ + public list( + resourceUri: string, + options?: LinkerListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceUri, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceUri, options); + } + }; + } + + private async *listPagingPage( + resourceUri: string, + options?: LinkerListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceUri, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(resourceUri, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceUri: string, + options?: LinkerListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(resourceUri, options)) { + yield* page; + } + } + + /** + * Returns list of Linkers which connects to the resource. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be + * connected. + * @param options The options parameters. + */ + private _list( + resourceUri: string, + options?: LinkerListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceUri, options }, + listOperationSpec + ); + } + + /** + * Returns Linker resource for a given name. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be + * connected. + * @param linkerName The name Linker resource. + * @param options The options parameters. + */ + get( + resourceUri: string, + linkerName: string, + options?: LinkerGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceUri, linkerName, options }, + getOperationSpec + ); + } + + /** + * Create or update linker resource. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be + * connected. + * @param linkerName The name Linker resource. + * @param parameters Linker details. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceUri: string, + linkerName: string, + parameters: LinkerResource, + options?: LinkerCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + LinkerCreateOrUpdateResponse + > + > { + 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, + { resourceUri, linkerName, parameters, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Create or update linker resource. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be + * connected. + * @param linkerName The name Linker resource. + * @param parameters Linker details. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceUri: string, + linkerName: string, + parameters: LinkerResource, + options?: LinkerCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceUri, + linkerName, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Delete a link. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be + * connected. + * @param linkerName The name Linker resource. + * @param options The options parameters. + */ + async beginDelete( + resourceUri: string, + linkerName: string, + options?: LinkerDeleteOptionalParams + ): 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, + { resourceUri, linkerName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Delete a link. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be + * connected. + * @param linkerName The name Linker resource. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceUri: string, + linkerName: string, + options?: LinkerDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete(resourceUri, linkerName, options); + return poller.pollUntilDone(); + } + + /** + * Operation to update an existing link. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be + * connected. + * @param linkerName The name Linker resource. + * @param parameters Linker details. + * @param options The options parameters. + */ + async beginUpdate( + resourceUri: string, + linkerName: string, + parameters: LinkerPatch, + options?: LinkerUpdateOptionalParams + ): Promise< + PollerLike, LinkerUpdateResponse> + > { + 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, + { resourceUri, linkerName, parameters, options }, + updateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Operation to update an existing link. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be + * connected. + * @param linkerName The name Linker resource. + * @param parameters Linker details. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceUri: string, + linkerName: string, + parameters: LinkerPatch, + options?: LinkerUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceUri, + linkerName, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Validate a link. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be + * connected. + * @param linkerName The name Linker resource. + * @param options The options parameters. + */ + async beginValidate( + resourceUri: string, + linkerName: string, + options?: LinkerValidateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + LinkerValidateResponse + > + > { + 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, + { resourceUri, linkerName, options }, + validateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Validate a link. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be + * connected. + * @param linkerName The name Linker resource. + * @param options The options parameters. + */ + async beginValidateAndWait( + resourceUri: string, + linkerName: string, + options?: LinkerValidateOptionalParams + ): Promise { + const poller = await this.beginValidate(resourceUri, linkerName, options); + return poller.pollUntilDone(); + } + + /** + * list source configurations for a linker. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be + * connected. + * @param linkerName The name Linker resource. + * @param options The options parameters. + */ + listConfigurations( + resourceUri: string, + linkerName: string, + options?: LinkerListConfigurationsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceUri, linkerName, options }, + listConfigurationsOperationSpec + ); + } + + /** + * ListNext + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be + * connected. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceUri: string, + nextLink: string, + options?: LinkerListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceUri, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.LinkerList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.resourceUri], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.LinkerResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceUri, + Parameters.linkerName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.LinkerResource + }, + 201: { + bodyMapper: Mappers.LinkerResource + }, + 202: { + bodyMapper: Mappers.LinkerResource + }, + 204: { + bodyMapper: Mappers.LinkerResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceUri, + Parameters.linkerName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceUri, + Parameters.linkerName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.LinkerResource + }, + 201: { + bodyMapper: Mappers.LinkerResource + }, + 202: { + bodyMapper: Mappers.LinkerResource + }, + 204: { + bodyMapper: Mappers.LinkerResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceUri, + Parameters.linkerName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const validateOperationSpec: coreClient.OperationSpec = { + path: + "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/validateLinker", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.ValidateResult + }, + 201: { + bodyMapper: Mappers.ValidateResult + }, + 202: { + bodyMapper: Mappers.ValidateResult + }, + 204: { + bodyMapper: Mappers.ValidateResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceUri, + Parameters.linkerName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listConfigurationsOperationSpec: coreClient.OperationSpec = { + path: + "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/listConfigurations", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.SourceConfigurationResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceUri, + Parameters.linkerName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.LinkerList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceUri, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/servicelinker/arm-servicelinker/src/operations/operations.ts b/sdk/servicelinker/arm-servicelinker/src/operations/operations.ts new file mode 100644 index 000000000000..2b2691197567 --- /dev/null +++ b/sdk/servicelinker/arm-servicelinker/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 { MicrosoftServiceLinker } from "../microsoftServiceLinker"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; + +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: MicrosoftServiceLinker; + + /** + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftServiceLinker) { + this.client = client; + } + + /** + * Lists the available ServiceLinker REST API operations. + * @param options The options parameters. + */ + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + 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 the available ServiceLinker REST API operations. + * @param options The options parameters. + */ + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.ServiceLinker/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/servicelinker/arm-servicelinker/src/operationsInterfaces/index.ts b/sdk/servicelinker/arm-servicelinker/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..8ef3ff9c3dd7 --- /dev/null +++ b/sdk/servicelinker/arm-servicelinker/src/operationsInterfaces/index.ts @@ -0,0 +1,10 @@ +/* + * 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 "./linker"; +export * from "./operations"; diff --git a/sdk/servicelinker/arm-servicelinker/src/operationsInterfaces/linker.ts b/sdk/servicelinker/arm-servicelinker/src/operationsInterfaces/linker.ts new file mode 100644 index 000000000000..2cb2e83ee1aa --- /dev/null +++ b/sdk/servicelinker/arm-servicelinker/src/operationsInterfaces/linker.ts @@ -0,0 +1,181 @@ +/* + * 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 { + LinkerResource, + LinkerListOptionalParams, + LinkerGetOptionalParams, + LinkerGetResponse, + LinkerCreateOrUpdateOptionalParams, + LinkerCreateOrUpdateResponse, + LinkerDeleteOptionalParams, + LinkerPatch, + LinkerUpdateOptionalParams, + LinkerUpdateResponse, + LinkerValidateOptionalParams, + LinkerValidateResponse, + LinkerListConfigurationsOptionalParams, + LinkerListConfigurationsResponse +} from "../models"; + +/// +/** Interface representing a Linker. */ +export interface Linker { + /** + * Returns list of Linkers which connects to the resource. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be + * connected. + * @param options The options parameters. + */ + list( + resourceUri: string, + options?: LinkerListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns Linker resource for a given name. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be + * connected. + * @param linkerName The name Linker resource. + * @param options The options parameters. + */ + get( + resourceUri: string, + linkerName: string, + options?: LinkerGetOptionalParams + ): Promise; + /** + * Create or update linker resource. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be + * connected. + * @param linkerName The name Linker resource. + * @param parameters Linker details. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceUri: string, + linkerName: string, + parameters: LinkerResource, + options?: LinkerCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + LinkerCreateOrUpdateResponse + > + >; + /** + * Create or update linker resource. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be + * connected. + * @param linkerName The name Linker resource. + * @param parameters Linker details. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceUri: string, + linkerName: string, + parameters: LinkerResource, + options?: LinkerCreateOrUpdateOptionalParams + ): Promise; + /** + * Delete a link. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be + * connected. + * @param linkerName The name Linker resource. + * @param options The options parameters. + */ + beginDelete( + resourceUri: string, + linkerName: string, + options?: LinkerDeleteOptionalParams + ): Promise, void>>; + /** + * Delete a link. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be + * connected. + * @param linkerName The name Linker resource. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceUri: string, + linkerName: string, + options?: LinkerDeleteOptionalParams + ): Promise; + /** + * Operation to update an existing link. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be + * connected. + * @param linkerName The name Linker resource. + * @param parameters Linker details. + * @param options The options parameters. + */ + beginUpdate( + resourceUri: string, + linkerName: string, + parameters: LinkerPatch, + options?: LinkerUpdateOptionalParams + ): Promise< + PollerLike, LinkerUpdateResponse> + >; + /** + * Operation to update an existing link. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be + * connected. + * @param linkerName The name Linker resource. + * @param parameters Linker details. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceUri: string, + linkerName: string, + parameters: LinkerPatch, + options?: LinkerUpdateOptionalParams + ): Promise; + /** + * Validate a link. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be + * connected. + * @param linkerName The name Linker resource. + * @param options The options parameters. + */ + beginValidate( + resourceUri: string, + linkerName: string, + options?: LinkerValidateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + LinkerValidateResponse + > + >; + /** + * Validate a link. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be + * connected. + * @param linkerName The name Linker resource. + * @param options The options parameters. + */ + beginValidateAndWait( + resourceUri: string, + linkerName: string, + options?: LinkerValidateOptionalParams + ): Promise; + /** + * list source configurations for a linker. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be + * connected. + * @param linkerName The name Linker resource. + * @param options The options parameters. + */ + listConfigurations( + resourceUri: string, + linkerName: string, + options?: LinkerListConfigurationsOptionalParams + ): Promise; +} diff --git a/sdk/servicelinker/arm-servicelinker/src/operationsInterfaces/operations.ts b/sdk/servicelinker/arm-servicelinker/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..768cd0e6e86a --- /dev/null +++ b/sdk/servicelinker/arm-servicelinker/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 the available ServiceLinker REST API operations. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/servicelinker/arm-servicelinker/test/sampleTest.ts b/sdk/servicelinker/arm-servicelinker/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/servicelinker/arm-servicelinker/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/servicelinker/arm-servicelinker/tsconfig.json b/sdk/servicelinker/arm-servicelinker/tsconfig.json new file mode 100644 index 000000000000..3e6ae96443f3 --- /dev/null +++ b/sdk/servicelinker/arm-servicelinker/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/servicelinker/ci.yml b/sdk/servicelinker/ci.yml new file mode 100644 index 000000000000..69a2ca77a569 --- /dev/null +++ b/sdk/servicelinker/ci.yml @@ -0,0 +1,30 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/servicelinker/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/servicelinker/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: servicelinker + Artifacts: + - name: azure-arm-servicelinker + safeName: azurearmservicelinker + \ No newline at end of file