diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 1005004fc34f..426ba7af0af9 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -15,6 +15,7 @@ specifiers: '@rush-temp/arm-compute': file:./projects/arm-compute.tgz '@rush-temp/arm-eventgrid': file:./projects/arm-eventgrid.tgz '@rush-temp/arm-eventhub': file:./projects/arm-eventhub.tgz + '@rush-temp/arm-extendedlocation': file:./projects/arm-extendedlocation.tgz '@rush-temp/arm-features': file:./projects/arm-features.tgz '@rush-temp/arm-keyvault': file:./projects/arm-keyvault.tgz '@rush-temp/arm-links': file:./projects/arm-links.tgz @@ -146,6 +147,7 @@ dependencies: '@rush-temp/arm-compute': file:projects/arm-compute.tgz '@rush-temp/arm-eventgrid': file:projects/arm-eventgrid.tgz '@rush-temp/arm-eventhub': file:projects/arm-eventhub.tgz + '@rush-temp/arm-extendedlocation': file:projects/arm-extendedlocation.tgz '@rush-temp/arm-features': file:projects/arm-features.tgz '@rush-temp/arm-keyvault': file:projects/arm-keyvault.tgz '@rush-temp/arm-links': file:projects/arm-links.tgz @@ -8615,7 +8617,7 @@ packages: dev: false file:projects/arm-eventhub.tgz: - resolution: {integrity: sha512-XEBObSD4etC/G49Hytf9AnYtxeGc2QXcIEpLL1WaB5WT8aNSyLNM1cpCB0sXqxZPJkrZZC9d71mvucT+tSXhGQ==, tarball: file:projects/arm-eventhub.tgz} + resolution: {integrity: sha512-88PFgvsnG/19VeBi62EUvBf9VVCtDlgv3KVnAx4Nu5IQGz29cW58EAQgPk+j1IXuwNKOLTi2QSW6Sx+LzXEBGw==, tarball: file:projects/arm-eventhub.tgz} name: '@rush-temp/arm-eventhub' version: 0.0.0 dependencies: @@ -8638,6 +8640,30 @@ packages: - supports-color dev: false + file:projects/arm-extendedlocation.tgz: + resolution: {integrity: sha512-WWytW03UCehYVkMeMjAg/vfkWLVx43lVnKaxuh22XgM/fLQ+m2ToJSCKVuUsGSKaT4/1DckjJiuRi5SM4Ikw9w==, tarball: file:projects/arm-extendedlocation.tgz} + name: '@rush-temp/arm-extendedlocation' + version: 0.0.0 + dependencies: + '@azure/identity': 2.0.0-beta.6 + '@microsoft/api-extractor': 7.7.11 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 + cross-env: 7.0.3 + mkdirp: 1.0.4 + mocha: 7.2.0 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + tslib: 2.3.1 + typescript: 4.2.4 + uglify-js: 3.14.2 + transitivePeerDependencies: + - debug + - supports-color + dev: false + file:projects/arm-features.tgz: resolution: {integrity: sha512-mCciFjE3JlWC8Z2rx2nj87jDLeSH+37kGZJxt81t4od4QUsCcIJmwmVTt/bbcZSntwu57tCawTyp91nh2FlLEA==, tarball: file:projects/arm-features.tgz} name: '@rush-temp/arm-features' diff --git a/eng/ignore-links.txt b/eng/ignore-links.txt index d2c9c8adb403..b774cbacd831 100644 --- a/eng/ignore-links.txt +++ b/eng/ignore-links.txt @@ -12,3 +12,5 @@ https://docs.microsoft.com/javascript/api/@azure/arm-purview https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/purview/arm-purview https://docs.microsoft.com/javascript/api/@azure/arm-quota https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/quota/arm-quota +https://docs.microsoft.com/javascript/api/@azure/arm-extendedlocation +https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/quota/arm-extendedlocation diff --git a/rush.json b/rush.json index d1d8206e06ea..e614d667aed2 100644 --- a/rush.json +++ b/rush.json @@ -1,8 +1,7 @@ /** * This is the main configuration file for Rush. * For full documentation, please see https://rushjs.io - */ -{ + */{ "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json", /** * (Required) This specifies the version of the Rush engine to be used in this repo. @@ -966,6 +965,11 @@ "packageName": "@azure/arm-quota", "projectFolder": "sdk/quota/arm-quota", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-extendedlocation", + "projectFolder": "sdk/extendedlocation/arm-extendedlocation", + "versionPolicyName": "management" } ] -} +} \ No newline at end of file diff --git a/sdk/extendedlocation/arm-extendedlocation/CHANGELOG.md b/sdk/extendedlocation/arm-extendedlocation/CHANGELOG.md new file mode 100644 index 000000000000..99478e46f279 --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/CHANGELOG.md @@ -0,0 +1,3 @@ +## 1.0.0-beta.1 (2021-10-08) + + - Initial Release diff --git a/sdk/extendedlocation/arm-extendedlocation/LICENSE b/sdk/extendedlocation/arm-extendedlocation/LICENSE new file mode 100644 index 000000000000..ccb63b166732 --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2021 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/extendedlocation/arm-extendedlocation/README.md b/sdk/extendedlocation/arm-extendedlocation/README.md new file mode 100644 index 000000000000..d456bf3db43b --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/README.md @@ -0,0 +1,94 @@ +# Azure customLocationsManagement client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure customLocationsManagement client. + +The customLocations Rest API spec. + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/extendedlocation/arm-extendedlocation) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-extendedlocation) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-extendedlocation) | +[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-extendedlocation` package + +Install the Azure customLocationsManagement client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-extendedlocation +``` + +### Create and authenticate a `CustomLocationsManagementClient` + +To create a client object to access the Azure customLocationsManagement API, you will need the `endpoint` of your Azure customLocationsManagement resource and a `credential`. The Azure customLocationsManagement client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure customLocationsManagement 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 customLocationsManagement** 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 { CustomLocationsManagementClient } = require("@azure/arm-extendedlocation"); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new CustomLocationsManagementClient(new DefaultAzureCredential(), subscriptionId); +``` + +## Key concepts + +### CustomLocationsManagementClient + +`CustomLocationsManagementClient` is the primary interface for developers using the Azure customLocationsManagement client library. Explore the methods on this client object to understand the different features of the Azure customLocationsManagement 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%2Fextendedlocation%2Farm-extendedlocation%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/extendedlocation/arm-extendedlocation/_meta.json b/sdk/extendedlocation/arm-extendedlocation/_meta.json new file mode 100644 index 000000000000..02b0295fadcf --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "5cf3e4a0c30ad5167088ac839453578b2e8e9afc", + "readme": "specification/extendedlocation/resource-manager/readme.md", + "autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/extendedlocation/resource-manager/readme.md --use=@autorest/typescript@6.0.0-beta.13", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "use": "@autorest/typescript@6.0.0-beta.13" +} \ No newline at end of file diff --git a/sdk/extendedlocation/arm-extendedlocation/api-extractor.json b/sdk/extendedlocation/arm-extendedlocation/api-extractor.json new file mode 100644 index 000000000000..8cc49dab445d --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/api-extractor.json @@ -0,0 +1,18 @@ +{ + "$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-extendedlocation.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/extendedlocation/arm-extendedlocation/package.json b/sdk/extendedlocation/arm-extendedlocation/package.json new file mode 100644 index 000000000000..7a1dd5a509ae --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/package.json @@ -0,0 +1,92 @@ +{ + "name": "@azure/arm-extendedlocation", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", + "description": "A generated SDK for CustomLocationsManagementClient.", + "version": "1.0.0-beta.1", + "engines": { "node": ">=12.0.0" }, + "dependencies": { + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.1.1", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" + }, + "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], + "license": "MIT", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-extendedlocation.d.ts", + "devDependencies": { + "@microsoft/api-extractor": "7.7.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "mkdirp": "^1.0.4", + "rollup": "^1.16.3", + "rollup-plugin-sourcemaps": "^0.4.2", + "typescript": "~4.2.0", + "uglify-js": "^3.4.9", + "@azure/identity": "2.0.0-beta.6", + "@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/extendedlocation/arm-extendedlocation", + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, + "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, + "files": [ + "dist/**/*.js", + "dist/**/*.js.map", + "dist/**/*.d.ts", + "dist/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", + "src/**/*.ts", + "README.md", + "LICENSE", + "rollup.config.js", + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" + ], + "scripts": { + "build": "tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "api-extractor run --local", + "lint": "echo skipped", + "audit": "echo skipped", + "clean": "echo skipped", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "npm run integration-test", + "prebuild": "echo skipped", + "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", + "integration-test:browser": "echo skipped", + "docs": "echo skipped" + }, + "sideEffects": false, + "autoPublish": true +} diff --git a/sdk/extendedlocation/arm-extendedlocation/recordings/node/my_test/recording_sample_test.js b/sdk/extendedlocation/arm-extendedlocation/recordings/node/my_test/recording_sample_test.js new file mode 100644 index 000000000000..0f6ecb857acf --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/recordings/node/my_test/recording_sample_test.js @@ -0,0 +1,5 @@ +let nock = require('nock'); + +module.exports.hash = "7a6be38bb8cb644d64b4094802301751"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/extendedlocation/arm-extendedlocation/review/arm-extendedlocation.api.md b/sdk/extendedlocation/arm-extendedlocation/review/arm-extendedlocation.api.md new file mode 100644 index 000000000000..6cb1f216dbe1 --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/review/arm-extendedlocation.api.md @@ -0,0 +1,319 @@ +## API Report File for "@azure/arm-extendedlocation" + +> 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 CreatedByType = string; + +// @public +export type CustomLocation = TrackedResource & { + identity?: Identity; + readonly systemData?: SystemData; + authentication?: CustomLocationPropertiesAuthentication; + clusterExtensionIds?: string[]; + displayName?: string; + hostResourceId?: string; + hostType?: HostType; + namespace?: string; + provisioningState?: string; +}; + +// @public +export interface CustomLocationListResult { + readonly nextLink?: string; + readonly value?: CustomLocation[]; +} + +// @public +export interface CustomLocationOperation { + readonly description?: string; + readonly isDataAction?: boolean; + readonly name?: string; + readonly operation?: string; + readonly origin?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface CustomLocationOperationsList { + nextLink?: string; + value: CustomLocationOperation[]; +} + +// @public +export interface CustomLocationPropertiesAuthentication { + type?: string; + value?: string; +} + +// @public +export interface CustomLocations { + beginCreateOrUpdate(resourceGroupName: string, resourceName: string, parameters: CustomLocation, options?: CustomLocationsCreateOrUpdateOptionalParams): Promise, CustomLocationsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, resourceName: string, parameters: CustomLocation, options?: CustomLocationsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, resourceName: string, options?: CustomLocationsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, resourceName: string, options?: CustomLocationsDeleteOptionalParams): Promise; + get(resourceGroupName: string, resourceName: string, options?: CustomLocationsGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: CustomLocationsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: CustomLocationsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + listEnabledResourceTypes(resourceGroupName: string, resourceName: string, options?: CustomLocationsListEnabledResourceTypesOptionalParams): PagedAsyncIterableIterator; + listOperations(options?: CustomLocationsListOperationsOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, resourceName: string, options?: CustomLocationsUpdateOptionalParams): Promise; +} + +// @public +export interface CustomLocationsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CustomLocationsCreateOrUpdateResponse = CustomLocation; + +// @public +export interface CustomLocationsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface CustomLocationsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CustomLocationsGetResponse = CustomLocation; + +// @public +export interface CustomLocationsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CustomLocationsListByResourceGroupNextResponse = CustomLocationListResult; + +// @public +export interface CustomLocationsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CustomLocationsListByResourceGroupResponse = CustomLocationListResult; + +// @public +export interface CustomLocationsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CustomLocationsListBySubscriptionNextResponse = CustomLocationListResult; + +// @public +export interface CustomLocationsListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CustomLocationsListBySubscriptionResponse = CustomLocationListResult; + +// @public +export interface CustomLocationsListEnabledResourceTypesNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CustomLocationsListEnabledResourceTypesNextResponse = EnabledResourceTypesListResult; + +// @public +export interface CustomLocationsListEnabledResourceTypesOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CustomLocationsListEnabledResourceTypesResponse = EnabledResourceTypesListResult; + +// @public +export interface CustomLocationsListOperationsNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CustomLocationsListOperationsNextResponse = CustomLocationOperationsList; + +// @public +export interface CustomLocationsListOperationsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CustomLocationsListOperationsResponse = CustomLocationOperationsList; + +// @public (undocumented) +export class CustomLocationsManagementClient extends CustomLocationsManagementClientContext { + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: CustomLocationsManagementClientOptionalParams); + // (undocumented) + customLocations: CustomLocations; +} + +// @public (undocumented) +export class CustomLocationsManagementClientContext extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: CustomLocationsManagementClientOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface CustomLocationsManagementClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface CustomLocationsUpdateOptionalParams extends coreClient.OperationOptions { + authentication?: CustomLocationPropertiesAuthentication; + clusterExtensionIds?: string[]; + displayName?: string; + hostResourceId?: string; + hostType?: HostType; + identity?: Identity; + namespace?: string; + provisioningState?: string; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type CustomLocationsUpdateResponse = CustomLocation; + +// @public +export type EnabledResourceType = ProxyResource & { + readonly systemData?: SystemData; + clusterExtensionId?: string; + extensionType?: string; + typesMetadata?: EnabledResourceTypePropertiesTypesMetadataItem[]; +}; + +// @public +export interface EnabledResourceTypePropertiesTypesMetadataItem { + apiVersion?: string; + resourceProviderNamespace?: string; + resourceType?: string; +} + +// @public +export interface EnabledResourceTypesListResult { + readonly nextLink?: string; + readonly value?: EnabledResourceType[]; +} + +// @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 type HostType = string; + +// @public +export interface Identity { + readonly principalId?: string; + readonly tenantId?: string; + type?: ResourceIdentityType; +} + +// @public +export enum KnownCreatedByType { + // (undocumented) + Application = "Application", + // (undocumented) + Key = "Key", + // (undocumented) + ManagedIdentity = "ManagedIdentity", + // (undocumented) + User = "User" +} + +// @public +export enum KnownHostType { + // (undocumented) + Kubernetes = "Kubernetes" +} + +// @public +export enum KnownResourceIdentityType { + // (undocumented) + None = "None", + // (undocumented) + SystemAssigned = "SystemAssigned" +} + +// @public +export interface PatchableCustomLocations { + authentication?: CustomLocationPropertiesAuthentication; + clusterExtensionIds?: string[]; + displayName?: string; + hostResourceId?: string; + hostType?: HostType; + identity?: Identity; + namespace?: string; + provisioningState?: string; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type ProxyResource = Resource & {}; + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export type ResourceIdentityType = string; + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export type TrackedResource = Resource & { + tags?: { + [propertyName: string]: string; + }; + location: string; +}; + + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/extendedlocation/arm-extendedlocation/rollup.config.js b/sdk/extendedlocation/arm-extendedlocation/rollup.config.js new file mode 100644 index 000000000000..9be1955eb7f1 --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/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/extendedlocation/arm-extendedlocation/src/customLocationsManagementClient.ts b/sdk/extendedlocation/arm-extendedlocation/src/customLocationsManagementClient.ts new file mode 100644 index 000000000000..1a9cc4dbbec9 --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/src/customLocationsManagementClient.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreAuth from "@azure/core-auth"; +import { CustomLocationsImpl } from "./operations"; +import { CustomLocations } from "./operationsInterfaces"; +import { CustomLocationsManagementClientContext } from "./customLocationsManagementClientContext"; +import { CustomLocationsManagementClientOptionalParams } from "./models"; + +export class CustomLocationsManagementClient extends CustomLocationsManagementClientContext { + /** + * Initializes a new instance of the CustomLocationsManagementClient class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The ID of the target subscription. + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: CustomLocationsManagementClientOptionalParams + ) { + super(credentials, subscriptionId, options); + this.customLocations = new CustomLocationsImpl(this); + } + + customLocations: CustomLocations; +} diff --git a/sdk/extendedlocation/arm-extendedlocation/src/customLocationsManagementClientContext.ts b/sdk/extendedlocation/arm-extendedlocation/src/customLocationsManagementClientContext.ts new file mode 100644 index 000000000000..a3bc19cc2289 --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/src/customLocationsManagementClientContext.ts @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { CustomLocationsManagementClientOptionalParams } from "./models"; + +export class CustomLocationsManagementClientContext extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + + /** + * Initializes a new instance of the CustomLocationsManagementClientContext class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The ID of the target subscription. + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: CustomLocationsManagementClientOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: CustomLocationsManagementClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-extendedlocation/1.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2021-08-15"; + } +} diff --git a/sdk/extendedlocation/arm-extendedlocation/src/index.ts b/sdk/extendedlocation/arm-extendedlocation/src/index.ts new file mode 100644 index 000000000000..91e3a313133c --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/src/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/// +export * from "./models"; +export { CustomLocationsManagementClient } from "./customLocationsManagementClient"; +export { CustomLocationsManagementClientContext } from "./customLocationsManagementClientContext"; +export * from "./operationsInterfaces"; diff --git a/sdk/extendedlocation/arm-extendedlocation/src/lroImpl.ts b/sdk/extendedlocation/arm-extendedlocation/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/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/extendedlocation/arm-extendedlocation/src/models/index.ts b/sdk/extendedlocation/arm-extendedlocation/src/models/index.ts new file mode 100644 index 000000000000..83de0a370d8f --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/src/models/index.ts @@ -0,0 +1,446 @@ +/* + * 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"; + +/** Lists of Custom Locations operations. */ +export interface CustomLocationOperationsList { + /** Next page of operations. */ + nextLink?: string; + /** Array of customLocationOperation */ + value: CustomLocationOperation[]; +} + +/** Custom Locations operation. */ +export interface CustomLocationOperation { + /** + * Is this Operation a data plane operation + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isDataAction?: boolean; + /** + * The name of the compute operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The origin of the compute operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly origin?: string; + /** + * The description of the operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; + /** + * The display name of the compute operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly operation?: string; + /** + * The resource provider for the operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provider?: string; + /** + * The display name of the resource the operation applies to. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resource?: 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; +} + +/** The List Custom Locations operation response. */ +export interface CustomLocationListResult { + /** + * The URL to use for getting the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; + /** + * The list of Custom Locations. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: CustomLocation[]; +} + +/** 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; +} + +/** Identity for the resource. */ +export interface Identity { + /** + * The principal ID of resource identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The tenant ID of resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** The identity type. */ + type?: ResourceIdentityType; +} + +/** This is optional input that contains the authentication that should be used to generate the namespace. */ +export interface CustomLocationPropertiesAuthentication { + /** The type of the Custom Locations authentication */ + type?: string; + /** The kubeconfig value. */ + value?: 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; +} + +/** The Custom Locations patchable resource definition. */ +export interface PatchableCustomLocations { + /** Identity for the resource. */ + identity?: Identity; + /** Resource tags */ + tags?: { [propertyName: string]: string }; + /** This is optional input that contains the authentication that should be used to generate the namespace. */ + authentication?: CustomLocationPropertiesAuthentication; + /** Contains the reference to the add-on that contains charts to deploy CRDs and operators. */ + clusterExtensionIds?: string[]; + /** Display name for the Custom Locations location. */ + displayName?: string; + /** Connected Cluster or AKS Cluster. The Custom Locations RP will perform a checkAccess API for listAdminCredentials permissions. */ + hostResourceId?: string; + /** Type of host the Custom Locations is referencing (Kubernetes, etc...). */ + hostType?: HostType; + /** Kubernetes namespace that will be created on the specified cluster. */ + namespace?: string; + /** Provisioning State for the Custom Location. */ + provisioningState?: string; +} + +/** List of EnabledResourceTypes definition. */ +export interface EnabledResourceTypesListResult { + /** + * The URL to use for getting the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; + /** + * The list of EnabledResourceTypes available for a customLocation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: EnabledResourceType[]; +} + +/** Metadata of the Resource Type. */ +export interface EnabledResourceTypePropertiesTypesMetadataItem { + /** Api Version of Resource Type */ + apiVersion?: string; + /** Resource Provider Namespace of Resource Type */ + resourceProviderNamespace?: string; + /** Resource Type */ + resourceType?: string; +} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export type TrackedResource = Resource & { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +}; + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export type ProxyResource = Resource & {}; + +/** Custom Locations definition. */ +export type CustomLocation = TrackedResource & { + /** Identity for the resource. */ + identity?: Identity; + /** + * Metadata pertaining to creation and last modification of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** This is optional input that contains the authentication that should be used to generate the namespace. */ + authentication?: CustomLocationPropertiesAuthentication; + /** Contains the reference to the add-on that contains charts to deploy CRDs and operators. */ + clusterExtensionIds?: string[]; + /** Display name for the Custom Locations location. */ + displayName?: string; + /** Connected Cluster or AKS Cluster. The Custom Locations RP will perform a checkAccess API for listAdminCredentials permissions. */ + hostResourceId?: string; + /** Type of host the Custom Locations is referencing (Kubernetes, etc...). */ + hostType?: HostType; + /** Kubernetes namespace that will be created on the specified cluster. */ + namespace?: string; + /** Provisioning State for the Custom Location. */ + provisioningState?: string; +}; + +/** EnabledResourceType definition. */ +export type EnabledResourceType = ProxyResource & { + /** + * Metadata pertaining to creation and last modification of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** Cluster Extension ID */ + clusterExtensionId?: string; + /** Cluster Extension Type */ + extensionType?: string; + /** Metadata of the Resource Type */ + typesMetadata?: EnabledResourceTypePropertiesTypesMetadataItem[]; +}; + +/** Known values of {@link ResourceIdentityType} that the service accepts. */ +export enum KnownResourceIdentityType { + SystemAssigned = "SystemAssigned", + None = "None" +} + +/** + * Defines values for ResourceIdentityType. \ + * {@link KnownResourceIdentityType} can be used interchangeably with ResourceIdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **SystemAssigned** \ + * **None** + */ +export type ResourceIdentityType = string; + +/** Known values of {@link HostType} that the service accepts. */ +export enum KnownHostType { + Kubernetes = "Kubernetes" +} + +/** + * Defines values for HostType. \ + * {@link KnownHostType} can be used interchangeably with HostType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Kubernetes** + */ +export type HostType = 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; + +/** Optional parameters. */ +export interface CustomLocationsListOperationsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listOperations operation. */ +export type CustomLocationsListOperationsResponse = CustomLocationOperationsList; + +/** Optional parameters. */ +export interface CustomLocationsListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type CustomLocationsListBySubscriptionResponse = CustomLocationListResult; + +/** Optional parameters. */ +export interface CustomLocationsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type CustomLocationsListByResourceGroupResponse = CustomLocationListResult; + +/** Optional parameters. */ +export interface CustomLocationsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type CustomLocationsGetResponse = CustomLocation; + +/** Optional parameters. */ +export interface CustomLocationsCreateOrUpdateOptionalParams + 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 CustomLocationsCreateOrUpdateResponse = CustomLocation; + +/** Optional parameters. */ +export interface CustomLocationsDeleteOptionalParams + 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 CustomLocationsUpdateOptionalParams + extends coreClient.OperationOptions { + /** Identity for the resource. */ + identity?: Identity; + /** Resource tags */ + tags?: { [propertyName: string]: string }; + /** This is optional input that contains the authentication that should be used to generate the namespace. */ + authentication?: CustomLocationPropertiesAuthentication; + /** Contains the reference to the add-on that contains charts to deploy CRDs and operators. */ + clusterExtensionIds?: string[]; + /** Display name for the Custom Locations location. */ + displayName?: string; + /** Connected Cluster or AKS Cluster. The Custom Locations RP will perform a checkAccess API for listAdminCredentials permissions. */ + hostResourceId?: string; + /** Type of host the Custom Locations is referencing (Kubernetes, etc...). */ + hostType?: HostType; + /** Kubernetes namespace that will be created on the specified cluster. */ + namespace?: string; + /** Provisioning State for the Custom Location. */ + provisioningState?: string; +} + +/** Contains response data for the update operation. */ +export type CustomLocationsUpdateResponse = CustomLocation; + +/** Optional parameters. */ +export interface CustomLocationsListEnabledResourceTypesOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listEnabledResourceTypes operation. */ +export type CustomLocationsListEnabledResourceTypesResponse = EnabledResourceTypesListResult; + +/** Optional parameters. */ +export interface CustomLocationsListOperationsNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listOperationsNext operation. */ +export type CustomLocationsListOperationsNextResponse = CustomLocationOperationsList; + +/** Optional parameters. */ +export interface CustomLocationsListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type CustomLocationsListBySubscriptionNextResponse = CustomLocationListResult; + +/** Optional parameters. */ +export interface CustomLocationsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type CustomLocationsListByResourceGroupNextResponse = CustomLocationListResult; + +/** Optional parameters. */ +export interface CustomLocationsListEnabledResourceTypesNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listEnabledResourceTypesNext operation. */ +export type CustomLocationsListEnabledResourceTypesNextResponse = EnabledResourceTypesListResult; + +/** Optional parameters. */ +export interface CustomLocationsManagementClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/extendedlocation/arm-extendedlocation/src/models/mappers.ts b/sdk/extendedlocation/arm-extendedlocation/src/models/mappers.ts new file mode 100644 index 000000000000..032c9879f617 --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/src/models/mappers.ts @@ -0,0 +1,619 @@ +/* + * 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 CustomLocationOperationsList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomLocationOperationsList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CustomLocationOperation" + } + } + } + } + } + } +}; + +export const CustomLocationOperation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomLocationOperation", + modelProperties: { + isDataAction: { + serializedName: "isDataAction", + readOnly: true, + type: { + name: "Boolean" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + origin: { + serializedName: "origin", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "display.description", + readOnly: true, + type: { + name: "String" + } + }, + operation: { + serializedName: "display.operation", + readOnly: true, + type: { + name: "String" + } + }, + provider: { + serializedName: "display.provider", + readOnly: true, + type: { + name: "String" + } + }, + resource: { + serializedName: "display.resource", + 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 CustomLocationListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomLocationListResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CustomLocation" + } + } + } + } + } + } +}; + +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 Identity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Identity", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "String" + } + }, + tenantId: { + serializedName: "tenantId", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const CustomLocationPropertiesAuthentication: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomLocationPropertiesAuthentication", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + 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 PatchableCustomLocations: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PatchableCustomLocations", + modelProperties: { + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + authentication: { + serializedName: "properties.authentication", + type: { + name: "Composite", + className: "CustomLocationPropertiesAuthentication" + } + }, + clusterExtensionIds: { + serializedName: "properties.clusterExtensionIds", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String" + } + }, + hostResourceId: { + serializedName: "properties.hostResourceId", + type: { + name: "String" + } + }, + hostType: { + serializedName: "properties.hostType", + type: { + name: "String" + } + }, + namespace: { + serializedName: "properties.namespace", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "String" + } + } + } + } +}; + +export const EnabledResourceTypesListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnabledResourceTypesListResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EnabledResourceType" + } + } + } + } + } + } +}; + +export const EnabledResourceTypePropertiesTypesMetadataItem: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnabledResourceTypePropertiesTypesMetadataItem", + modelProperties: { + apiVersion: { + serializedName: "apiVersion", + type: { + name: "String" + } + }, + resourceProviderNamespace: { + serializedName: "resourceProviderNamespace", + type: { + name: "String" + } + }, + resourceType: { + serializedName: "resourceType", + type: { + name: "String" + } + } + } + } +}; + +export const TrackedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties + } + } +}; + +export const CustomLocation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomLocation", + modelProperties: { + ...TrackedResource.type.modelProperties, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + authentication: { + serializedName: "properties.authentication", + type: { + name: "Composite", + className: "CustomLocationPropertiesAuthentication" + } + }, + clusterExtensionIds: { + serializedName: "properties.clusterExtensionIds", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String" + } + }, + hostResourceId: { + serializedName: "properties.hostResourceId", + type: { + name: "String" + } + }, + hostType: { + serializedName: "properties.hostType", + type: { + name: "String" + } + }, + namespace: { + serializedName: "properties.namespace", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "String" + } + } + } + } +}; + +export const EnabledResourceType: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnabledResourceType", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + clusterExtensionId: { + serializedName: "properties.clusterExtensionId", + type: { + name: "String" + } + }, + extensionType: { + serializedName: "properties.extensionType", + type: { + name: "String" + } + }, + typesMetadata: { + serializedName: "properties.typesMetadata", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EnabledResourceTypePropertiesTypesMetadataItem" + } + } + } + } + } + } +}; diff --git a/sdk/extendedlocation/arm-extendedlocation/src/models/parameters.ts b/sdk/extendedlocation/arm-extendedlocation/src/models/parameters.ts new file mode 100644 index 000000000000..f024bfc9a447 --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/src/models/parameters.ts @@ -0,0 +1,174 @@ +/* + * 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 { + CustomLocation as CustomLocationMapper, + PatchableCustomLocations as PatchableCustomLocationsMapper +} from "../models/mappers"; + +export const accept: OperationParameter = { + parameterPath: "accept", + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" + } + } +}; + +export const $host: OperationURLParameter = { + parameterPath: "$host", + mapper: { + serializedName: "$host", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2021-08-15", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "subscriptionId", + required: true, + type: { + name: "String" + } + } +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + constraints: { + MaxLength: 90, + MinLength: 1 + }, + serializedName: "resourceGroupName", + required: true, + type: { + name: "String" + } + } +}; + +export const resourceName: OperationURLParameter = { + parameterPath: "resourceName", + mapper: { + constraints: { + Pattern: new RegExp( + "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$" + ), + MaxLength: 63, + MinLength: 1 + }, + serializedName: "resourceName", + 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: CustomLocationMapper +}; + +export const identity: OperationParameter = { + parameterPath: ["options", "identity"], + mapper: PatchableCustomLocationsMapper +}; + +export const tags: OperationParameter = { + parameterPath: ["options", "tags"], + mapper: PatchableCustomLocationsMapper +}; + +export const authentication: OperationParameter = { + parameterPath: ["options", "authentication"], + mapper: PatchableCustomLocationsMapper +}; + +export const clusterExtensionIds: OperationParameter = { + parameterPath: ["options", "clusterExtensionIds"], + mapper: PatchableCustomLocationsMapper +}; + +export const displayName: OperationParameter = { + parameterPath: ["options", "displayName"], + mapper: PatchableCustomLocationsMapper +}; + +export const hostResourceId: OperationParameter = { + parameterPath: ["options", "hostResourceId"], + mapper: PatchableCustomLocationsMapper +}; + +export const hostType: OperationParameter = { + parameterPath: ["options", "hostType"], + mapper: PatchableCustomLocationsMapper +}; + +export const namespace: OperationParameter = { + parameterPath: ["options", "namespace"], + mapper: PatchableCustomLocationsMapper +}; + +export const provisioningState: OperationParameter = { + parameterPath: ["options", "provisioningState"], + mapper: PatchableCustomLocationsMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; diff --git a/sdk/extendedlocation/arm-extendedlocation/src/operations/customLocations.ts b/sdk/extendedlocation/arm-extendedlocation/src/operations/customLocations.ts new file mode 100644 index 000000000000..e25a2f1fed07 --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/src/operations/customLocations.ts @@ -0,0 +1,875 @@ +/* + * 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 { CustomLocations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { CustomLocationsManagementClientContext } from "../customLocationsManagementClientContext"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + CustomLocationOperation, + CustomLocationsListOperationsNextOptionalParams, + CustomLocationsListOperationsOptionalParams, + CustomLocation, + CustomLocationsListBySubscriptionNextOptionalParams, + CustomLocationsListBySubscriptionOptionalParams, + CustomLocationsListByResourceGroupNextOptionalParams, + CustomLocationsListByResourceGroupOptionalParams, + EnabledResourceType, + CustomLocationsListEnabledResourceTypesNextOptionalParams, + CustomLocationsListEnabledResourceTypesOptionalParams, + CustomLocationsListOperationsResponse, + CustomLocationsListBySubscriptionResponse, + CustomLocationsListByResourceGroupResponse, + CustomLocationsGetOptionalParams, + CustomLocationsGetResponse, + CustomLocationsCreateOrUpdateOptionalParams, + CustomLocationsCreateOrUpdateResponse, + CustomLocationsDeleteOptionalParams, + CustomLocationsUpdateOptionalParams, + CustomLocationsUpdateResponse, + CustomLocationsListEnabledResourceTypesResponse, + CustomLocationsListOperationsNextResponse, + CustomLocationsListBySubscriptionNextResponse, + CustomLocationsListByResourceGroupNextResponse, + CustomLocationsListEnabledResourceTypesNextResponse +} from "../models"; + +/// +/** Class containing CustomLocations operations. */ +export class CustomLocationsImpl implements CustomLocations { + private readonly client: CustomLocationsManagementClientContext; + + /** + * Initialize a new instance of the class CustomLocations class. + * @param client Reference to the service client + */ + constructor(client: CustomLocationsManagementClientContext) { + this.client = client; + } + + /** + * Lists all available Custom Locations operations. + * @param options The options parameters. + */ + public listOperations( + options?: CustomLocationsListOperationsOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listOperationsPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listOperationsPagingPage(options); + } + }; + } + + private async *listOperationsPagingPage( + options?: CustomLocationsListOperationsOptionalParams + ): AsyncIterableIterator { + let result = await this._listOperations(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listOperationsNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listOperationsPagingAll( + options?: CustomLocationsListOperationsOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listOperationsPagingPage(options)) { + yield* page; + } + } + + /** + * Gets a list of Custom Locations in the specified subscription. The operation returns properties of + * each Custom Location + * @param options The options parameters. + */ + public listBySubscription( + options?: CustomLocationsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: CustomLocationsListBySubscriptionOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscription(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listBySubscriptionPagingAll( + options?: CustomLocationsListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Gets a list of Custom Locations in the specified subscription and resource group. The operation + * returns properties of each Custom Location. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: CustomLocationsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: CustomLocationsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: CustomLocationsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Gets the list of the Enabled Resource Types. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Custom Locations name. + * @param options The options parameters. + */ + public listEnabledResourceTypes( + resourceGroupName: string, + resourceName: string, + options?: CustomLocationsListEnabledResourceTypesOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listEnabledResourceTypesPagingAll( + resourceGroupName, + resourceName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listEnabledResourceTypesPagingPage( + resourceGroupName, + resourceName, + options + ); + } + }; + } + + private async *listEnabledResourceTypesPagingPage( + resourceGroupName: string, + resourceName: string, + options?: CustomLocationsListEnabledResourceTypesOptionalParams + ): AsyncIterableIterator { + let result = await this._listEnabledResourceTypes( + resourceGroupName, + resourceName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listEnabledResourceTypesNext( + resourceGroupName, + resourceName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listEnabledResourceTypesPagingAll( + resourceGroupName: string, + resourceName: string, + options?: CustomLocationsListEnabledResourceTypesOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listEnabledResourceTypesPagingPage( + resourceGroupName, + resourceName, + options + )) { + yield* page; + } + } + + /** + * Lists all available Custom Locations operations. + * @param options The options parameters. + */ + private _listOperations( + options?: CustomLocationsListOperationsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listOperationsOperationSpec + ); + } + + /** + * Gets a list of Custom Locations in the specified subscription. The operation returns properties of + * each Custom Location + * @param options The options parameters. + */ + private _listBySubscription( + options?: CustomLocationsListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * Gets a list of Custom Locations in the specified subscription and resource group. The operation + * returns properties of each Custom Location. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: CustomLocationsListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Gets the details of the customLocation with a specified resource group and name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Custom Locations name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + options?: CustomLocationsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, options }, + getOperationSpec + ); + } + + /** + * Creates or updates a Custom Location in the specified Subscription and Resource Group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Custom Locations name. + * @param parameters Parameters supplied to create or update a Custom Location. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + resourceName: string, + parameters: CustomLocation, + options?: CustomLocationsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + CustomLocationsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, resourceName, parameters, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Creates or updates a Custom Location in the specified Subscription and Resource Group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Custom Locations name. + * @param parameters Parameters supplied to create or update a Custom Location. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + resourceName: string, + parameters: CustomLocation, + options?: CustomLocationsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + resourceName, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes the Custom Location with the specified Resource Name, Resource Group, and Subscription Id. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Custom Locations name. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + resourceName: string, + options?: CustomLocationsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, resourceName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Deletes the Custom Location with the specified Resource Name, Resource Group, and Subscription Id. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Custom Locations name. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + resourceName: string, + options?: CustomLocationsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + resourceName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Updates a Custom Location with the specified Resource Name in the specified Resource Group and + * Subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Custom Locations name. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + resourceName: string, + options?: CustomLocationsUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, options }, + updateOperationSpec + ); + } + + /** + * Gets the list of the Enabled Resource Types. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Custom Locations name. + * @param options The options parameters. + */ + private _listEnabledResourceTypes( + resourceGroupName: string, + resourceName: string, + options?: CustomLocationsListEnabledResourceTypesOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, options }, + listEnabledResourceTypesOperationSpec + ); + } + + /** + * ListOperationsNext + * @param nextLink The nextLink from the previous successful call to the ListOperations method. + * @param options The options parameters. + */ + private _listOperationsNext( + nextLink: string, + options?: CustomLocationsListOperationsNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listOperationsNextOperationSpec + ); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: CustomLocationsListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: CustomLocationsListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } + + /** + * ListEnabledResourceTypesNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Custom Locations name. + * @param nextLink The nextLink from the previous successful call to the ListEnabledResourceTypes + * method. + * @param options The options parameters. + */ + private _listEnabledResourceTypesNext( + resourceGroupName: string, + resourceName: string, + nextLink: string, + options?: CustomLocationsListEnabledResourceTypesNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, nextLink, options }, + listEnabledResourceTypesNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationsOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.ExtendedLocation/operations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CustomLocationOperationsList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.ExtendedLocation/customLocations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CustomLocationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CustomLocationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CustomLocation + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.CustomLocation + }, + 201: { + bodyMapper: Mappers.CustomLocation + }, + 202: { + bodyMapper: Mappers.CustomLocation + }, + 204: { + bodyMapper: Mappers.CustomLocation + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.CustomLocation + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: { + parameterPath: { + identity: ["options", "identity"], + tags: ["options", "tags"], + authentication: ["options", "authentication"], + clusterExtensionIds: ["options", "clusterExtensionIds"], + displayName: ["options", "displayName"], + hostResourceId: ["options", "hostResourceId"], + hostType: ["options", "hostType"], + namespace: ["options", "namespace"], + provisioningState: ["options", "provisioningState"] + }, + mapper: { ...Mappers.PatchableCustomLocations, required: true } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listEnabledResourceTypesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/enabledResourceTypes", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EnabledResourceTypesListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationsNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CustomLocationOperationsList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CustomLocationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CustomLocationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listEnabledResourceTypesNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EnabledResourceTypesListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/extendedlocation/arm-extendedlocation/src/operations/index.ts b/sdk/extendedlocation/arm-extendedlocation/src/operations/index.ts new file mode 100644 index 000000000000..e08b698e64ad --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/src/operations/index.ts @@ -0,0 +1,9 @@ +/* + * 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 "./customLocations"; diff --git a/sdk/extendedlocation/arm-extendedlocation/src/operationsInterfaces/customLocations.ts b/sdk/extendedlocation/arm-extendedlocation/src/operationsInterfaces/customLocations.ts new file mode 100644 index 000000000000..05daf8bd9711 --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/src/operationsInterfaces/customLocations.ts @@ -0,0 +1,143 @@ +/* + * 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 { + CustomLocationOperation, + CustomLocationsListOperationsOptionalParams, + CustomLocation, + CustomLocationsListBySubscriptionOptionalParams, + CustomLocationsListByResourceGroupOptionalParams, + EnabledResourceType, + CustomLocationsListEnabledResourceTypesOptionalParams, + CustomLocationsGetOptionalParams, + CustomLocationsGetResponse, + CustomLocationsCreateOrUpdateOptionalParams, + CustomLocationsCreateOrUpdateResponse, + CustomLocationsDeleteOptionalParams, + CustomLocationsUpdateOptionalParams, + CustomLocationsUpdateResponse +} from "../models"; + +/// +/** Interface representing a CustomLocations. */ +export interface CustomLocations { + /** + * Lists all available Custom Locations operations. + * @param options The options parameters. + */ + listOperations( + options?: CustomLocationsListOperationsOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a list of Custom Locations in the specified subscription. The operation returns properties of + * each Custom Location + * @param options The options parameters. + */ + listBySubscription( + options?: CustomLocationsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a list of Custom Locations in the specified subscription and resource group. The operation + * returns properties of each Custom Location. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: CustomLocationsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the list of the Enabled Resource Types. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Custom Locations name. + * @param options The options parameters. + */ + listEnabledResourceTypes( + resourceGroupName: string, + resourceName: string, + options?: CustomLocationsListEnabledResourceTypesOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the details of the customLocation with a specified resource group and name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Custom Locations name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + options?: CustomLocationsGetOptionalParams + ): Promise; + /** + * Creates or updates a Custom Location in the specified Subscription and Resource Group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Custom Locations name. + * @param parameters Parameters supplied to create or update a Custom Location. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + resourceName: string, + parameters: CustomLocation, + options?: CustomLocationsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + CustomLocationsCreateOrUpdateResponse + > + >; + /** + * Creates or updates a Custom Location in the specified Subscription and Resource Group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Custom Locations name. + * @param parameters Parameters supplied to create or update a Custom Location. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + resourceName: string, + parameters: CustomLocation, + options?: CustomLocationsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the Custom Location with the specified Resource Name, Resource Group, and Subscription Id. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Custom Locations name. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + resourceName: string, + options?: CustomLocationsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the Custom Location with the specified Resource Name, Resource Group, and Subscription Id. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Custom Locations name. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + resourceName: string, + options?: CustomLocationsDeleteOptionalParams + ): Promise; + /** + * Updates a Custom Location with the specified Resource Name in the specified Resource Group and + * Subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Custom Locations name. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + resourceName: string, + options?: CustomLocationsUpdateOptionalParams + ): Promise; +} diff --git a/sdk/extendedlocation/arm-extendedlocation/src/operationsInterfaces/index.ts b/sdk/extendedlocation/arm-extendedlocation/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..e08b698e64ad --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/src/operationsInterfaces/index.ts @@ -0,0 +1,9 @@ +/* + * 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 "./customLocations"; diff --git a/sdk/extendedlocation/arm-extendedlocation/test/sampleTest.ts b/sdk/extendedlocation/arm-extendedlocation/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/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/extendedlocation/arm-extendedlocation/tsconfig.json b/sdk/extendedlocation/arm-extendedlocation/tsconfig.json new file mode 100644 index 000000000000..6e3251194117 --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": ["es6", "dom"], + "declaration": true, + "outDir": "./dist-esm", + "importHelpers": true + }, + "include": ["./src/**/*.ts", "./test/**/*.ts"], + "exclude": ["node_modules"] +} diff --git a/sdk/extendedlocation/ci.yml b/sdk/extendedlocation/ci.yml new file mode 100644 index 000000000000..aff4c1a534f2 --- /dev/null +++ b/sdk/extendedlocation/ci.yml @@ -0,0 +1,29 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. +trigger: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/extendedlocation/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/extendedlocation/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: extendedlocation + Artifacts: + - name: azure-arm-extendedlocation + safeName: azurearmextendedlocation + \ No newline at end of file