diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 20e4fb98ce6b..aea2d1a63669 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -12,6 +12,7 @@ specifiers: '@rush-temp/arm-advisor': file:./projects/arm-advisor.tgz '@rush-temp/arm-analysisservices': file:./projects/arm-analysisservices.tgz '@rush-temp/arm-apimanagement': file:./projects/arm-apimanagement.tgz + '@rush-temp/arm-appconfiguration': file:./projects/arm-appconfiguration.tgz '@rush-temp/arm-appplatform': file:./projects/arm-appplatform.tgz '@rush-temp/arm-appservice': file:./projects/arm-appservice.tgz '@rush-temp/arm-attestation': file:./projects/arm-attestation.tgz @@ -197,6 +198,7 @@ dependencies: '@rush-temp/arm-advisor': file:projects/arm-advisor.tgz '@rush-temp/arm-analysisservices': file:projects/arm-analysisservices.tgz '@rush-temp/arm-apimanagement': file:projects/arm-apimanagement.tgz + '@rush-temp/arm-appconfiguration': file:projects/arm-appconfiguration.tgz '@rush-temp/arm-appplatform': file:projects/arm-appplatform.tgz '@rush-temp/arm-appservice': file:projects/arm-appservice.tgz '@rush-temp/arm-attestation': file:projects/arm-attestation.tgz @@ -8042,6 +8044,27 @@ packages: uglify-js: 3.14.5 dev: false + file:projects/arm-appconfiguration.tgz: + resolution: {integrity: sha512-uPEV3pZMXMZQyQ7wCpm16uQfLLjAW/JOVzRX/HOU4VfHw3YPpj0U09oo9jt0ihSuYD28/Jb8hyphiAoQyc4jvw==, tarball: file:projects/arm-appconfiguration.tgz} + name: '@rush-temp/arm-appconfiguration' + version: 0.0.0 + dependencies: + '@microsoft/api-extractor': 7.19.2 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 + cross-env: 7.0.3 + mkdirp: 1.0.4 + mocha: 7.2.0 + rimraf: 3.0.2 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + tslib: 2.3.1 + typescript: 4.2.4 + uglify-js: 3.14.5 + dev: false + file:projects/arm-appplatform.tgz: resolution: {integrity: sha512-Pel4tu/SIfuYKVrehY87LfAoYBiwyuraQp2/PdUzhmuX6p0wXK6BUGEjZj7vC2IAAaI4k/Cnh4QLdMLvRdZUuw==, tarball: file:projects/arm-appplatform.tgz} name: '@rush-temp/arm-appplatform' diff --git a/eng/ignore-links.txt b/eng/ignore-links.txt index a37736d17d20..9d1121484144 100644 --- a/eng/ignore-links.txt +++ b/eng/ignore-links.txt @@ -13,3 +13,4 @@ https://docs.microsoft.com/javascript/api/@azure/arm-imagebuilder https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/imagebuilder/arm-imagebuilder https://docs.microsoft.com/javascript/api/@azure/arm-avs https://docs.microsoft.com/javascript/api/@azure/arm-communication +https://docs.microsoft.com/javascript/api/@azure/arm-appconfiguration diff --git a/rush.json b/rush.json index e5d119f4a5b6..77f97540c795 100644 --- a/rush.json +++ b/rush.json @@ -1235,6 +1235,11 @@ "packageName": "@azure/arm-communication", "projectFolder": "sdk/communication/arm-communication", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-appconfiguration", + "projectFolder": "sdk/appconfiguration/arm-appconfiguration", + "versionPolicyName": "management" } ] -} +} \ No newline at end of file diff --git a/sdk/appconfiguration/arm-appconfiguration/CHANGELOG.md b/sdk/appconfiguration/arm-appconfiguration/CHANGELOG.md new file mode 100644 index 000000000000..d332b0abb3cd --- /dev/null +++ b/sdk/appconfiguration/arm-appconfiguration/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 3.0.0-beta.1 (2022-01-11) + +The package of @azure/arm-appconfiguration is using our next generation design principles since version 3.0.0-beta.1, which contains breaking changes. + +To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). + +To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). + +To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/appconfiguration/arm-appconfiguration/LICENSE b/sdk/appconfiguration/arm-appconfiguration/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/appconfiguration/arm-appconfiguration/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2022 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/appconfiguration/arm-appconfiguration/README.md b/sdk/appconfiguration/arm-appconfiguration/README.md index 69b807098b23..ee8a4001d477 100644 --- a/sdk/appconfiguration/arm-appconfiguration/README.md +++ b/sdk/appconfiguration/arm-appconfiguration/README.md @@ -1,110 +1,98 @@ -## Azure AppConfigurationManagementClient SDK for JavaScript +# Azure AppConfigurationManagement client library for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for AppConfigurationManagementClient. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure AppConfigurationManagement client. + + + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/appconfiguration/arm-appconfiguration) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-appconfiguration) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-appconfiguration?view=azure-node-preview) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. ### Prerequisites -You must have an [Azure subscription](https://azure.microsoft.com/free/). +- An [Azure subscription][azure_sub]. -### How to install +### Install the `@azure/arm-appconfiguration` package -To use this SDK in your project, you will need to install two packages. -- `@azure/arm-appconfiguration` that contains the client. -- `@azure/identity` that provides different mechanisms for the client to authenticate your requests using Azure Active Directory. +Install the Azure AppConfigurationManagement client library for JavaScript with `npm`: -Install both packages using the below command: ```bash -npm install --save @azure/arm-appconfiguration @azure/identity +npm install @azure/arm-appconfiguration ``` -> **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features. -If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options. +### Create and authenticate a `AppConfigurationManagementClient` + +To create a client object to access the Azure AppConfigurationManagement API, you will need the `endpoint` of your Azure AppConfigurationManagement resource and a `credential`. The Azure AppConfigurationManagement client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure AppConfigurationManagement resource in the [Azure Portal][azure_portal]. -### How to use +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). -- If you are writing a client side browser application, - - Follow the instructions in the section on Authenticating client side browser applications in [Azure Identity examples](https://aka.ms/azsdk/js/identity/examples) to register your application in the Microsoft identity platform and set the right permissions. - - Copy the client ID and tenant ID from the Overview section of your app registration in Azure portal and use it in the browser sample below. -- If you are writing a server side application, - - [Select a credential from `@azure/identity` based on the authentication method of your choice](https://aka.ms/azsdk/js/identity/examples) - - Complete the set up steps required by the credential if any. - - Use the credential you picked in the place of `DefaultAzureCredential` in the Node.js sample below. +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: -In the below samples, we pass the credential and the Azure subscription id to instantiate the client. -Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started. +```bash +npm install @azure/identity +``` -#### nodejs - Authentication, client creation, and list configurationStores as an example written in JavaScript. +You will also need to **register a new AAD application and grant access to Azure AppConfigurationManagement** 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`. -##### Sample code +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 { DefaultAzureCredential } = require("@azure/identity"); const { AppConfigurationManagementClient } = require("@azure/arm-appconfiguration"); -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -// Use `DefaultAzureCredential` or any other credential of your choice based on https://aka.ms/azsdk/js/identity/examples -// Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead. -const creds = new DefaultAzureCredential(); -const client = new AppConfigurationManagementClient(creds, subscriptionId); -const skipToken = "testskipToken"; -client.configurationStores.list(skipToken).then((result) => { - console.log("The result is:"); - console.log(result); -}).catch((err) => { - console.log("An error occurred:"); - console.error(err); -}); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new AppConfigurationManagementClient(new DefaultAzureCredential(), subscriptionId); ``` -#### browser - Authentication, client creation, and list configurationStores as an example written in JavaScript. - -In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser. - - See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser. - - Note down the client Id from the previous step and use it in the browser sample below. - -##### Sample code - -- index.html - -```html - - - - @azure/arm-appconfiguration sample - - - - - - - + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### AppConfigurationManagementClient + +`AppConfigurationManagementClient` is the primary interface for developers using the Azure AppConfigurationManagement client library. Explore the methods on this client object to understand the different features of the Azure AppConfigurationManagement 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) +- [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%2Fappconfiguration%2Farm-appconfiguration%2FREADME.png) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/appconfiguration/arm-appconfiguration/README.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/appconfiguration/arm-appconfiguration/_meta.json b/sdk/appconfiguration/arm-appconfiguration/_meta.json new file mode 100644 index 000000000000..dfe465051dd9 --- /dev/null +++ b/sdk/appconfiguration/arm-appconfiguration/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "e6a2296d02ec6c4b2c32479198bfbcb9b16ea247", + "readme": "specification/appconfiguration/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/appconfiguration/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20211217.1", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "use": "@autorest/typescript@6.0.0-alpha.16.20211217.1" +} \ No newline at end of file diff --git a/sdk/appconfiguration/arm-appconfiguration/api-extractor.json b/sdk/appconfiguration/arm-appconfiguration/api-extractor.json new file mode 100644 index 000000000000..08be32d6b7cc --- /dev/null +++ b/sdk/appconfiguration/arm-appconfiguration/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-appconfiguration.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/appconfiguration/arm-appconfiguration/package.json b/sdk/appconfiguration/arm-appconfiguration/package.json index b7c97791c578..6ac59b96d722 100644 --- a/sdk/appconfiguration/arm-appconfiguration/package.json +++ b/sdk/appconfiguration/arm-appconfiguration/package.json @@ -1,58 +1,91 @@ { "name": "@azure/arm-appconfiguration", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "AppConfigurationManagementClient Library with typescript type definitions for node.js and browser.", - "version": "1.4.0", + "description": "A generated SDK for AppConfigurationManagementClient.", + "version": "3.0.0-beta.1", + "engines": { "node": ">=12.0.0" }, "dependencies": { - "@azure/ms-rest-azure-js": "^2.1.0", - "@azure/ms-rest-js": "^2.2.0", - "@azure/core-auth": "^1.1.4", - "tslib": "^1.10.0" + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], + "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], "license": "MIT", - "main": "./dist/arm-appconfiguration.js", - "module": "./esm/appConfigurationManagementClient.js", - "types": "./esm/appConfigurationManagementClient.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-appconfiguration.d.ts", "devDependencies": { - "typescript": "^3.6.0", - "rollup": "^1.18.0", - "rollup-plugin-node-resolve": "^5.2.0", + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "mkdirp": "^1.0.4", + "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", - "uglify-js": "^3.6.0" + "typescript": "~4.2.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^1.0.0", + "mocha": "^7.1.1", + "cross-env": "^7.0.2" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/appconfiguration/arm-appconfiguration", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" }, - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, + "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "files": [ "dist/**/*.js", "dist/**/*.js.map", "dist/**/*.d.ts", "dist/**/*.d.ts.map", - "esm/**/*.js", - "esm/**/*.js.map", - "esm/**/*.d.ts", - "esm/**/*.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" + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" ], "scripts": { - "build": "tsc && rollup -c rollup.config.js && npm run minify", - "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-appconfiguration.js.map'\" -o ./dist/arm-appconfiguration.min.js ./dist/arm-appconfiguration.js", - "prepack": "npm install && npm run build" + "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "api-extractor run --local", + "lint": "echo skipped", + "audit": "echo skipped", + "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "npm run integration-test", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:browser": "echo skipped", + "docs": "echo skipped" }, "sideEffects": false, "autoPublish": true diff --git a/sdk/appconfiguration/arm-appconfiguration/recordings/node/my_test/recording_sample_test.js b/sdk/appconfiguration/arm-appconfiguration/recordings/node/my_test/recording_sample_test.js new file mode 100644 index 000000000000..0f6ecb857acf --- /dev/null +++ b/sdk/appconfiguration/arm-appconfiguration/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/appconfiguration/arm-appconfiguration/review/arm-appconfiguration.api.md b/sdk/appconfiguration/arm-appconfiguration/review/arm-appconfiguration.api.md new file mode 100644 index 000000000000..641684e9aee3 --- /dev/null +++ b/sdk/appconfiguration/arm-appconfiguration/review/arm-appconfiguration.api.md @@ -0,0 +1,665 @@ +## API Report File for "@azure/arm-appconfiguration" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; + +// @public +export type ActionsRequired = string; + +// @public +export interface ApiKey { + readonly connectionString?: string; + readonly id?: string; + readonly lastModified?: Date; + readonly name?: string; + readonly readOnly?: boolean; + readonly value?: string; +} + +// @public +export interface ApiKeyListResult { + nextLink?: string; + value?: ApiKey[]; +} + +// @public (undocumented) +export class AppConfigurationManagementClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: AppConfigurationManagementClientOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + configurationStores: ConfigurationStores; + // (undocumented) + keyValues: KeyValues; + // (undocumented) + operations: Operations; + // (undocumented) + privateEndpointConnections: PrivateEndpointConnections; + // (undocumented) + privateLinkResources: PrivateLinkResources; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface AppConfigurationManagementClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface CheckNameAvailabilityParameters { + name: string; + type: ConfigurationResourceType; +} + +// @public +export type ConfigurationResourceType = string; + +// @public +export type ConfigurationStore = TrackedResource & { + identity?: ResourceIdentity; + sku: Sku; + readonly systemData?: SystemData; + readonly provisioningState?: ProvisioningState; + readonly creationDate?: Date; + readonly endpoint?: string; + encryption?: EncryptionProperties; + readonly privateEndpointConnections?: PrivateEndpointConnectionReference[]; + publicNetworkAccess?: PublicNetworkAccess; + disableLocalAuth?: boolean; +}; + +// @public +export interface ConfigurationStoreListResult { + nextLink?: string; + value?: ConfigurationStore[]; +} + +// @public +export interface ConfigurationStores { + beginCreate(resourceGroupName: string, configStoreName: string, configStoreCreationParameters: ConfigurationStore, options?: ConfigurationStoresCreateOptionalParams): Promise, ConfigurationStoresCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, configStoreName: string, configStoreCreationParameters: ConfigurationStore, options?: ConfigurationStoresCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, configStoreName: string, options?: ConfigurationStoresDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, configStoreName: string, options?: ConfigurationStoresDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, configStoreName: string, configStoreUpdateParameters: ConfigurationStoreUpdateParameters, options?: ConfigurationStoresUpdateOptionalParams): Promise, ConfigurationStoresUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, configStoreName: string, configStoreUpdateParameters: ConfigurationStoreUpdateParameters, options?: ConfigurationStoresUpdateOptionalParams): Promise; + get(resourceGroupName: string, configStoreName: string, options?: ConfigurationStoresGetOptionalParams): Promise; + list(options?: ConfigurationStoresListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: ConfigurationStoresListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listKeys(resourceGroupName: string, configStoreName: string, options?: ConfigurationStoresListKeysOptionalParams): PagedAsyncIterableIterator; + regenerateKey(resourceGroupName: string, configStoreName: string, regenerateKeyParameters: RegenerateKeyParameters, options?: ConfigurationStoresRegenerateKeyOptionalParams): Promise; +} + +// @public +export interface ConfigurationStoresCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ConfigurationStoresCreateResponse = ConfigurationStore; + +// @public +export interface ConfigurationStoresDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ConfigurationStoresGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ConfigurationStoresGetResponse = ConfigurationStore; + +// @public +export interface ConfigurationStoresListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { + skipToken?: string; +} + +// @public +export type ConfigurationStoresListByResourceGroupNextResponse = ConfigurationStoreListResult; + +// @public +export interface ConfigurationStoresListByResourceGroupOptionalParams extends coreClient.OperationOptions { + skipToken?: string; +} + +// @public +export type ConfigurationStoresListByResourceGroupResponse = ConfigurationStoreListResult; + +// @public +export interface ConfigurationStoresListKeysNextOptionalParams extends coreClient.OperationOptions { + skipToken?: string; +} + +// @public +export type ConfigurationStoresListKeysNextResponse = ApiKeyListResult; + +// @public +export interface ConfigurationStoresListKeysOptionalParams extends coreClient.OperationOptions { + skipToken?: string; +} + +// @public +export type ConfigurationStoresListKeysResponse = ApiKeyListResult; + +// @public +export interface ConfigurationStoresListNextOptionalParams extends coreClient.OperationOptions { + skipToken?: string; +} + +// @public +export type ConfigurationStoresListNextResponse = ConfigurationStoreListResult; + +// @public +export interface ConfigurationStoresListOptionalParams extends coreClient.OperationOptions { + skipToken?: string; +} + +// @public +export type ConfigurationStoresListResponse = ConfigurationStoreListResult; + +// @public +export interface ConfigurationStoresRegenerateKeyOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ConfigurationStoresRegenerateKeyResponse = ApiKey; + +// @public +export interface ConfigurationStoresUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ConfigurationStoresUpdateResponse = ConfigurationStore; + +// @public +export interface ConfigurationStoreUpdateParameters { + disableLocalAuth?: boolean; + encryption?: EncryptionProperties; + identity?: ResourceIdentity; + publicNetworkAccess?: PublicNetworkAccess; + sku?: Sku; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type ConnectionStatus = string; + +// @public +export type CreatedByType = string; + +// @public +export interface EncryptionProperties { + keyVaultProperties?: KeyVaultProperties; +} + +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + +// @public +export interface ErrorDetails { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly message?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetails; +} + +// @public +export type IdentityType = string; + +// @public +export interface KeyValue { + contentType?: string; + readonly eTag?: string; + readonly id?: string; + readonly key?: string; + readonly label?: string; + readonly lastModified?: Date; + readonly locked?: boolean; + readonly name?: string; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; + value?: string; +} + +// @public +export interface KeyValueListResult { + nextLink?: string; + value?: KeyValue[]; +} + +// @public +export interface KeyValues { + beginDelete(resourceGroupName: string, configStoreName: string, keyValueName: string, options?: KeyValuesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, configStoreName: string, keyValueName: string, options?: KeyValuesDeleteOptionalParams): Promise; + createOrUpdate(resourceGroupName: string, configStoreName: string, keyValueName: string, options?: KeyValuesCreateOrUpdateOptionalParams): Promise; + get(resourceGroupName: string, configStoreName: string, keyValueName: string, options?: KeyValuesGetOptionalParams): Promise; + listByConfigurationStore(resourceGroupName: string, configStoreName: string, options?: KeyValuesListByConfigurationStoreOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface KeyValuesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + keyValueParameters?: KeyValue; +} + +// @public +export type KeyValuesCreateOrUpdateResponse = KeyValue; + +// @public +export interface KeyValuesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface KeyValuesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type KeyValuesGetResponse = KeyValue; + +// @public +export interface KeyValuesListByConfigurationStoreNextOptionalParams extends coreClient.OperationOptions { + skipToken?: string; +} + +// @public +export type KeyValuesListByConfigurationStoreNextResponse = KeyValueListResult; + +// @public +export interface KeyValuesListByConfigurationStoreOptionalParams extends coreClient.OperationOptions { + skipToken?: string; +} + +// @public +export type KeyValuesListByConfigurationStoreResponse = KeyValueListResult; + +// @public +export interface KeyVaultProperties { + identityClientId?: string; + keyIdentifier?: string; +} + +// @public +export enum KnownActionsRequired { + // (undocumented) + None = "None", + // (undocumented) + Recreate = "Recreate" +} + +// @public +export enum KnownConfigurationResourceType { + // (undocumented) + MicrosoftAppConfigurationConfigurationStores = "Microsoft.AppConfiguration/configurationStores" +} + +// @public +export enum KnownConnectionStatus { + // (undocumented) + Approved = "Approved", + // (undocumented) + Disconnected = "Disconnected", + // (undocumented) + Pending = "Pending", + // (undocumented) + Rejected = "Rejected" +} + +// @public +export enum KnownCreatedByType { + // (undocumented) + Application = "Application", + // (undocumented) + Key = "Key", + // (undocumented) + ManagedIdentity = "ManagedIdentity", + // (undocumented) + User = "User" +} + +// @public +export enum KnownIdentityType { + // (undocumented) + None = "None", + // (undocumented) + SystemAssigned = "SystemAssigned", + // (undocumented) + SystemAssignedUserAssigned = "SystemAssigned, UserAssigned", + // (undocumented) + UserAssigned = "UserAssigned" +} + +// @public +export enum KnownProvisioningState { + // (undocumented) + Canceled = "Canceled", + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Failed = "Failed", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Updating = "Updating" +} + +// @public +export enum KnownPublicNetworkAccess { + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Enabled = "Enabled" +} + +// @public +export interface LogSpecification { + blobDuration?: string; + displayName?: string; + name?: string; +} + +// @public +export interface MetricDimension { + displayName?: string; + internalName?: string; + name?: string; +} + +// @public +export interface MetricSpecification { + aggregationType?: string; + dimensions?: MetricDimension[]; + displayDescription?: string; + displayName?: string; + fillGapWithZero?: boolean; + internalMetricName?: string; + name?: string; + unit?: string; +} + +// @public +export interface NameAvailabilityStatus { + readonly message?: string; + readonly nameAvailable?: boolean; + readonly reason?: string; +} + +// @public +export interface OperationDefinition { + display?: OperationDefinitionDisplay; + isDataAction?: boolean; + name?: string; + origin?: string; + properties?: OperationProperties; +} + +// @public +export interface OperationDefinitionDisplay { + description?: string; + operation?: string; + readonly provider?: string; + resource?: string; +} + +// @public +export interface OperationDefinitionListResult { + nextLink?: string; + value?: OperationDefinition[]; +} + +// @public +export interface OperationProperties { + serviceSpecification?: ServiceSpecification; +} + +// @public +export interface Operations { + checkNameAvailability(checkNameAvailabilityParameters: CheckNameAvailabilityParameters, options?: OperationsCheckNameAvailabilityOptionalParams): Promise; + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsCheckNameAvailabilityOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsCheckNameAvailabilityResponse = NameAvailabilityStatus; + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { + skipToken?: string; +} + +// @public +export type OperationsListNextResponse = OperationDefinitionListResult; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { + skipToken?: string; +} + +// @public +export type OperationsListResponse = OperationDefinitionListResult; + +// @public +export interface PrivateEndpoint { + id?: string; +} + +// @public +export interface PrivateEndpointConnection { + readonly id?: string; + readonly name?: string; + privateEndpoint?: PrivateEndpoint; + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; + readonly provisioningState?: ProvisioningState; + readonly type?: string; +} + +// @public +export interface PrivateEndpointConnectionListResult { + nextLink?: string; + value?: PrivateEndpointConnection[]; +} + +// @public +export interface PrivateEndpointConnectionReference { + readonly id?: string; + readonly name?: string; + privateEndpoint?: PrivateEndpoint; + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; + readonly provisioningState?: ProvisioningState; + readonly type?: string; +} + +// @public +export interface PrivateEndpointConnections { + beginCreateOrUpdate(resourceGroupName: string, configStoreName: string, privateEndpointConnectionName: string, privateEndpointConnection: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams): Promise, PrivateEndpointConnectionsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, configStoreName: string, privateEndpointConnectionName: string, privateEndpointConnection: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, configStoreName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, configStoreName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise; + get(resourceGroupName: string, configStoreName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise; + listByConfigurationStore(resourceGroupName: string, configStoreName: string, options?: PrivateEndpointConnectionsListByConfigurationStoreOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface PrivateEndpointConnectionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PrivateEndpointConnectionsCreateOrUpdateResponse = PrivateEndpointConnection; + +// @public +export interface PrivateEndpointConnectionsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface PrivateEndpointConnectionsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; + +// @public +export interface PrivateEndpointConnectionsListByConfigurationStoreNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsListByConfigurationStoreNextResponse = PrivateEndpointConnectionListResult; + +// @public +export interface PrivateEndpointConnectionsListByConfigurationStoreOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsListByConfigurationStoreResponse = PrivateEndpointConnectionListResult; + +// @public +export interface PrivateLinkResource { + readonly groupId?: string; + readonly id?: string; + readonly name?: string; + readonly requiredMembers?: string[]; + readonly requiredZoneNames?: string[]; + readonly type?: string; +} + +// @public +export interface PrivateLinkResourceListResult { + nextLink?: string; + value?: PrivateLinkResource[]; +} + +// @public +export interface PrivateLinkResources { + get(resourceGroupName: string, configStoreName: string, groupName: string, options?: PrivateLinkResourcesGetOptionalParams): Promise; + listByConfigurationStore(resourceGroupName: string, configStoreName: string, options?: PrivateLinkResourcesListByConfigurationStoreOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface PrivateLinkResourcesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkResourcesGetResponse = PrivateLinkResource; + +// @public +export interface PrivateLinkResourcesListByConfigurationStoreNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkResourcesListByConfigurationStoreNextResponse = PrivateLinkResourceListResult; + +// @public +export interface PrivateLinkResourcesListByConfigurationStoreOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkResourcesListByConfigurationStoreResponse = PrivateLinkResourceListResult; + +// @public +export interface PrivateLinkServiceConnectionState { + readonly actionsRequired?: ActionsRequired; + description?: string; + status?: ConnectionStatus; +} + +// @public +export type ProvisioningState = string; + +// @public +export type PublicNetworkAccess = string; + +// @public +export interface RegenerateKeyParameters { + id?: string; +} + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export interface ResourceIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type?: IdentityType; + userAssignedIdentities?: { + [propertyName: string]: UserIdentity; + }; +} + +// @public +export interface ServiceSpecification { + logSpecifications?: LogSpecification[]; + metricSpecifications?: MetricSpecification[]; +} + +// @public +export interface Sku { + name: string; +} + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export type TrackedResource = Resource & { + tags?: { + [propertyName: string]: string; + }; + location: string; +}; + +// @public +export interface UserIdentity { + readonly clientId?: string; + readonly principalId?: string; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/appconfiguration/arm-appconfiguration/rollup.config.js b/sdk/appconfiguration/arm-appconfiguration/rollup.config.js index f2f46a79cc4c..9be1955eb7f1 100644 --- a/sdk/appconfiguration/arm-appconfiguration/rollup.config.js +++ b/sdk/appconfiguration/arm-appconfiguration/rollup.config.js @@ -1,37 +1,188 @@ -import rollup from "rollup"; -import nodeResolve from "rollup-plugin-node-resolve"; +/* + * 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 /** - * @type {rollup.RollupFileOptions} + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. */ -const config = { - input: "./esm/appConfigurationManagementClient.js", - external: [ - "@azure/ms-rest-js", - "@azure/ms-rest-azure-js" - ], - output: { - file: "./dist/arm-appconfiguration.js", - format: "umd", - name: "Azure.ArmAppconfiguration", - sourcemap: true, - globals: { - "@azure/ms-rest-js": "msRest", - "@azure/ms-rest-azure-js": "msRestAzure" + +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/**"] }, - banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */` - }, - plugins: [ - nodeResolve({ mainFields: ['module', 'main'] }), - sourcemaps() - ] + 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 default config; +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/appconfiguration/arm-appconfiguration/src/appConfigurationManagementClient.ts b/sdk/appconfiguration/arm-appconfiguration/src/appConfigurationManagementClient.ts index b58eabc6d21f..7cd72daee525 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/appConfigurationManagementClient.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/appConfigurationManagementClient.ts @@ -1,54 +1,95 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; -import * as operations from "./operations"; -import { AppConfigurationManagementClientContext } from "./appConfigurationManagementClientContext"; +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + ConfigurationStoresImpl, + OperationsImpl, + PrivateEndpointConnectionsImpl, + PrivateLinkResourcesImpl, + KeyValuesImpl +} from "./operations"; +import { + ConfigurationStores, + Operations, + PrivateEndpointConnections, + PrivateLinkResources, + KeyValues +} from "./operationsInterfaces"; +import { AppConfigurationManagementClientOptionalParams } from "./models"; - -class AppConfigurationManagementClient extends AppConfigurationManagementClientContext { - // Operation groups - configurationStores: operations.ConfigurationStores; - operations: operations.Operations; - privateEndpointConnections: operations.PrivateEndpointConnections; - privateLinkResources: operations.PrivateLinkResources; +export class AppConfigurationManagementClient extends coreClient.ServiceClient { + $host: string; + subscriptionId: string; + apiVersion: string; /** * Initializes a new instance of the AppConfigurationManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. Credentials - * implementing the TokenCredential interface from the @azure/identity package are recommended. For - * more information about these credentials, see - * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the - * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and - * @azure/ms-rest-browserauth are also supported. + * @param credentials Subscription credentials which uniquely identify client subscription. * @param subscriptionId The Microsoft Azure subscription ID. - * @param [options] The parameter options + * @param options The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.AppConfigurationManagementClientOptions) { - super(credentials, subscriptionId, options); - this.configurationStores = new operations.ConfigurationStores(this); - this.operations = new operations.Operations(this); - this.privateEndpointConnections = new operations.PrivateEndpointConnections(this); - this.privateLinkResources = new operations.PrivateLinkResources(this); - } -} + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: AppConfigurationManagementClientOptionalParams + ) { + 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: AppConfigurationManagementClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; -// Operation Specifications + const packageDetails = `azsdk-js-arm-appconfiguration/3.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; -export { - AppConfigurationManagementClient, - AppConfigurationManagementClientContext, - Models as AppConfigurationManagementModels, - Mappers as AppConfigurationManagementMappers -}; -export * from "./operations"; + 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-03-01-preview"; + this.configurationStores = new ConfigurationStoresImpl(this); + this.operations = new OperationsImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); + this.privateLinkResources = new PrivateLinkResourcesImpl(this); + this.keyValues = new KeyValuesImpl(this); + } + + configurationStores: ConfigurationStores; + operations: Operations; + privateEndpointConnections: PrivateEndpointConnections; + privateLinkResources: PrivateLinkResources; + keyValues: KeyValues; +} diff --git a/sdk/appconfiguration/arm-appconfiguration/src/appConfigurationManagementClientContext.ts b/sdk/appconfiguration/arm-appconfiguration/src/appConfigurationManagementClientContext.ts deleted file mode 100644 index 72641b89d50e..000000000000 --- a/sdk/appconfiguration/arm-appconfiguration/src/appConfigurationManagementClientContext.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as Models from "./models"; -import * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; - -const packageName = "@azure/arm-appconfiguration"; -const packageVersion = "1.4.0"; - -export class AppConfigurationManagementClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials | TokenCredential; - subscriptionId: string; - apiVersion?: string; - - /** - * Initializes a new instance of the AppConfigurationManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. Credentials - * implementing the TokenCredential interface from the @azure/identity package are recommended. For - * more information about these credentials, see - * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the - * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and - * @azure/ms-rest-browserauth are also supported. - * @param subscriptionId The Microsoft Azure subscription ID. - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.AppConfigurationManagementClientOptions) { - if (credentials == undefined) { - throw new Error('\'credentials\' cannot be null.'); - } - if (subscriptionId == undefined) { - throw new Error('\'subscriptionId\' cannot be null.'); - } - - if (!options) { - options = {}; - } - if (!options.userAgent) { - const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); - options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; - } - - super(credentials, options); - - this.apiVersion = '2020-06-01'; - this.acceptLanguage = 'en-US'; - this.longRunningOperationRetryTimeout = 30; - this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; - this.requestContentType = "application/json; charset=utf-8"; - this.credentials = credentials; - this.subscriptionId = subscriptionId; - - if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) { - this.acceptLanguage = options.acceptLanguage; - } - if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { - this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; - } - } -} diff --git a/sdk/appconfiguration/arm-appconfiguration/src/index.ts b/sdk/appconfiguration/arm-appconfiguration/src/index.ts new file mode 100644 index 000000000000..e92a68026cad --- /dev/null +++ b/sdk/appconfiguration/arm-appconfiguration/src/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/// +export * from "./models"; +export { AppConfigurationManagementClient } from "./appConfigurationManagementClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/appconfiguration/arm-appconfiguration/src/lroImpl.ts b/sdk/appconfiguration/arm-appconfiguration/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/appconfiguration/arm-appconfiguration/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/appconfiguration/arm-appconfiguration/src/models/configurationStoresMappers.ts b/sdk/appconfiguration/arm-appconfiguration/src/models/configurationStoresMappers.ts deleted file mode 100644 index d882c951bb98..000000000000 --- a/sdk/appconfiguration/arm-appconfiguration/src/models/configurationStoresMappers.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ApiKey, - ApiKeyListResult, - BaseResource, - ConfigurationStore, - ConfigurationStoreListResult, - ConfigurationStoreUpdateParameters, - EncryptionProperties, - ErrorModel, - KeyValue, - KeyVaultProperties, - ListKeyValueParameters, - PrivateEndpoint, - PrivateEndpointConnection, - PrivateEndpointConnectionReference, - PrivateLinkServiceConnectionState, - RegenerateKeyParameters, - Resource, - ResourceIdentity, - Sku, - UserIdentity -} from "../models/mappers"; diff --git a/sdk/appconfiguration/arm-appconfiguration/src/models/index.ts b/sdk/appconfiguration/arm-appconfiguration/src/models/index.ts index abd3af6a199f..ec23c1ed4936 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/models/index.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/models/index.ts @@ -1,1163 +1,945 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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 { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export { BaseResource, CloudError }; - -/** - * A resource identity that is managed by the user of the service. - */ -export interface UserIdentity { - /** - * The principal ID of the user-assigned identity. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly principalId?: string; - /** - * The client ID of the user-assigned identity. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly clientId?: string; +/** The result of a request to list configuration stores. */ +export interface ConfigurationStoreListResult { + /** The collection value. */ + value?: ConfigurationStore[]; + /** The URI that can be used to request the next set of paged results. */ + nextLink?: string; } -/** - * An identity that can be associated with a resource. - */ +/** An identity that can be associated with a resource. */ export interface ResourceIdentity { - /** - * The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an - * implicitly created identity and a set of user-assigned identities. The type 'None' will remove - * any identities. Possible values include: 'None', 'SystemAssigned', 'UserAssigned', - * 'SystemAssigned, UserAssigned' - */ + /** The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identities. */ type?: IdentityType; - /** - * The list of user-assigned identities associated with the resource. The user-assigned identity - * dictionary keys will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - */ + /** The list of user-assigned identities associated with the resource. The user-assigned identity dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ userAssignedIdentities?: { [propertyName: string]: UserIdentity }; /** - * The principal id of the identity. This property will only be provided for a system-assigned - * identity. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The principal id of the identity. This property will only be provided for a system-assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly principalId?: string; /** - * The tenant id associated with the resource's identity. This property will only be provided for - * a system-assigned identity. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The tenant id associated with the resource's identity. This property will only be provided for a system-assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly tenantId?: string; } -/** - * Settings concerning key vault encryption for a configuration store. - */ -export interface KeyVaultProperties { +/** A resource identity that is managed by the user of the service. */ +export interface UserIdentity { /** - * The URI of the key vault key used to encrypt data. + * The principal ID of the user-assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - keyIdentifier?: string; + readonly principalId?: string; /** - * The client id of the identity which will be used to access key vault. + * The client ID of the user-assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - identityClientId?: string; + readonly clientId?: string; } -/** - * The encryption settings for a configuration store. - */ +/** The encryption settings for a configuration store. */ export interface EncryptionProperties { - /** - * Key vault properties. - */ + /** Key vault properties. */ keyVaultProperties?: KeyVaultProperties; } -/** - * Private endpoint which a connection belongs to. - */ -export interface PrivateEndpoint { - /** - * The resource Id for private endpoint - */ - id?: string; -} - -/** - * The state of a private link service connection. - */ -export interface PrivateLinkServiceConnectionState { - /** - * The private link service connection status. Possible values include: 'Pending', 'Approved', - * 'Rejected', 'Disconnected' - */ - status?: ConnectionStatus; - /** - * The private link service connection description. - */ - description?: string; - /** - * Any action that is required beyond basic workflow (approve/ reject/ disconnect). Possible - * values include: 'None', 'Recreate' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly actionsRequired?: ActionsRequired; +/** Settings concerning key vault encryption for a configuration store. */ +export interface KeyVaultProperties { + /** The URI of the key vault key used to encrypt data. */ + keyIdentifier?: string; + /** The client id of the identity which will be used to access key vault. */ + identityClientId?: string; } -/** - * A reference to a related private endpoint connection. - */ +/** A reference to a related private endpoint connection. */ export interface PrivateEndpointConnectionReference { /** * The resource ID. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * 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.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** * The type of the resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; /** - * The provisioning status of the private endpoint connection. Possible values include: - * 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The provisioning status of the private endpoint connection. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; - /** - * The resource of private endpoint. - */ + /** The resource of private endpoint. */ privateEndpoint?: PrivateEndpoint; + /** A collection of information about the state of the connection between service consumer and provider. */ + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; +} + +/** Private endpoint which a connection belongs to. */ +export interface PrivateEndpoint { + /** The resource Id for private endpoint */ + id?: string; +} + +/** The state of a private link service connection. */ +export interface PrivateLinkServiceConnectionState { + /** The private link service connection status. */ + status?: ConnectionStatus; + /** The private link service connection description. */ + description?: string; /** - * A collection of information about the state of the connection between service consumer and - * provider. + * Any action that is required beyond basic workflow (approve/ reject/ disconnect) + * NOTE: This property will not be serialized. It can only be populated by the server. */ - privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; + readonly actionsRequired?: ActionsRequired; } -/** - * Describes a configuration store SKU. - */ +/** Describes a configuration store SKU. */ export interface Sku { - /** - * The SKU name of the configuration store. - */ + /** The SKU name of the configuration store. */ name: string; } -/** - * An Azure resource. - */ -export interface Resource extends BaseResource { +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { /** - * The resource ID. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * 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.** + * 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. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * 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; - /** - * The location of the resource. This cannot be changed after the resource is created. - */ - location: string; - /** - * The tags of the resource. - */ - tags?: { [propertyName: string]: string }; } -/** - * The configuration store along with all resource properties. The Configuration Store will have - * all information to begin utilizing it. - */ -export interface ConfigurationStore extends Resource { - /** - * The managed identity information, if configured. - */ - identity?: ResourceIdentity; - /** - * The provisioning state of the configuration store. Possible values include: 'Creating', - * 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly provisioningState?: ProvisioningState; - /** - * The creation date of configuration store. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly creationDate?: Date; +/** Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. */ +export interface ErrorResponse { + /** The details of the error. */ + error?: ErrorDetails; +} + +/** The details of the error. */ +export interface ErrorDetails { /** - * The DNS endpoint where the configuration store API will be available. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Error code. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly endpoint?: string; + readonly code?: string; /** - * The encryption settings of the configuration store. + * Error message indicating why the operation failed. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - encryption?: EncryptionProperties; + readonly message?: string; /** - * The list of private endpoint connections that are set up for this resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly privateEndpointConnections?: PrivateEndpointConnectionReference[]; + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { /** - * Control permission for data plane traffic coming from public networks while private endpoint - * is enabled. Possible values include: 'Enabled', 'Disabled' + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - publicNetworkAccess?: PublicNetworkAccess; + readonly type?: string; /** - * The sku of the configuration store. + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - sku: Sku; + readonly info?: Record; } -/** - * The parameters for updating a configuration store. - */ +/** The parameters for updating a configuration store. */ export interface ConfigurationStoreUpdateParameters { - /** - * The encryption settings of the configuration store. - */ - encryption?: EncryptionProperties; - /** - * Control permission for data plane traffic coming from public networks while private endpoint - * is enabled. Possible values include: 'Enabled', 'Disabled' - */ - publicNetworkAccess?: PublicNetworkAccess; - /** - * The managed identity information for the configuration store. - */ + /** The managed identity information for the configuration store. */ identity?: ResourceIdentity; - /** - * The SKU of the configuration store. - */ + /** The SKU of the configuration store. */ sku?: Sku; - /** - * The ARM resource tags. - */ + /** The ARM resource tags. */ tags?: { [propertyName: string]: string }; + /** The encryption settings of the configuration store. */ + encryption?: EncryptionProperties; + /** Disables all authentication methods other than AAD authentication. */ + disableLocalAuth?: boolean; + /** Control permission for data plane traffic coming from public networks while private endpoint is enabled. */ + publicNetworkAccess?: PublicNetworkAccess; } -/** - * Parameters used for checking whether a resource name is available. - */ +/** Parameters used for checking whether a resource name is available. */ export interface CheckNameAvailabilityParameters { - /** - * The name to check for availability. - */ + /** The name to check for availability. */ name: string; + /** The resource type to check for name availability. */ + type: ConfigurationResourceType; } -/** - * The result of a request to check the availability of a resource name. - */ +/** The result of a request to check the availability of a resource name. */ export interface NameAvailabilityStatus { /** * The value indicating whether the resource name is available. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly nameAvailable?: boolean; /** - * If any, the error message that provides more detail for the reason that the name is not - * available. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * If any, the error message that provides more detail for the reason that the name is not available. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly message?: string; /** * If any, the reason that the name is not available. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly reason?: string; } -/** - * An API key used for authenticating with a configuration store endpoint. - */ +/** The result of a request to list API keys. */ +export interface ApiKeyListResult { + /** The collection value. */ + value?: ApiKey[]; + /** The URI that can be used to request the next set of paged results. */ + nextLink?: string; +} + +/** An API key used for authenticating with a configuration store endpoint. */ export interface ApiKey { /** * The key ID. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** * A name for the key describing its usage. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** * The value of the key that is used for authentication purposes. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly value?: string; /** * A connection string that can be used by supporting clients for authentication. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly connectionString?: string; /** * The last time any of the key's properties were modified. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly lastModified?: Date; /** * Whether this key can only be used for read operations. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly readOnly?: boolean; } -/** - * The parameters used to regenerate an API key. - */ +/** The parameters used to regenerate an API key. */ export interface RegenerateKeyParameters { - /** - * The id of the key to regenerate. - */ + /** The id of the key to regenerate. */ id?: string; } -/** - * The parameters used to list a configuration store key-value - */ -export interface ListKeyValueParameters { - /** - * The key to retrieve. - */ - key: string; - /** - * The label of the key. - */ - label?: string; +/** The result of a request to list configuration store operations. */ +export interface OperationDefinitionListResult { + /** The collection value. */ + value?: OperationDefinition[]; + /** The URI that can be used to request the next set of paged results. */ + nextLink?: string; } -/** - * The result of a request to retrieve a key-value from the specified configuration store. - */ -export interface KeyValue { - /** - * The primary identifier of a key-value. - * The key is used in unison with the label to uniquely identify a key-value. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly key?: string; - /** - * A value used to group key-values. - * The label is used in unison with the key to uniquely identify a key-value. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly label?: string; - /** - * The value of the key-value. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly value?: string; - /** - * The content type of the key-value's value. - * Providing a proper content-type can enable transformations of values when they are retrieved - * by applications. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly contentType?: string; - /** - * An ETag indicating the state of a key-value within a configuration store. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly eTag?: string; - /** - * The last time a modifying operation was performed on the given key-value. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly lastModified?: Date; - /** - * A value indicating whether the key-value is locked. - * A locked key-value may not be modified until it is unlocked. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly locked?: boolean; - /** - * A dictionary of tags that can help identify what a key-value may be applicable for. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly tags?: { [propertyName: string]: string }; +/** The definition of a configuration store operation. */ +export interface OperationDefinition { + /** Operation name: {provider}/{resource}/{operation}. */ + name?: string; + /** Indicates whether the operation is a data action */ + isDataAction?: boolean; + /** The display information for the configuration store operation. */ + display?: OperationDefinitionDisplay; + /** Origin of the operation */ + origin?: string; + /** Properties of the operation */ + properties?: OperationProperties; } -/** - * The display information for a configuration store operation. - */ +/** The display information for a configuration store operation. */ export interface OperationDefinitionDisplay { /** * The resource provider name: Microsoft App Configuration." - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provider?: string; - /** - * The resource on which the operation is performed. - */ + /** The resource on which the operation is performed. */ resource?: string; - /** - * The operation that users can perform. - */ + /** The operation that users can perform. */ operation?: string; - /** - * The description for the operation. - */ + /** The description for the operation. */ description?: string; } -/** - * The definition of a configuration store operation. - */ -export interface OperationDefinition { - /** - * Operation name: {provider}/{resource}/{operation}. - */ +/** Extra Operation properties */ +export interface OperationProperties { + /** Service specifications of the operation */ + serviceSpecification?: ServiceSpecification; +} + +/** Service specification payload */ +export interface ServiceSpecification { + /** Specifications of the Log for Azure Monitoring */ + logSpecifications?: LogSpecification[]; + /** Specifications of the Metrics for Azure Monitoring */ + metricSpecifications?: MetricSpecification[]; +} + +/** Specifications of the Log for Azure Monitoring */ +export interface LogSpecification { + /** Name of the log */ name?: string; - /** - * The display information for the configuration store operation. - */ - display?: OperationDefinitionDisplay; + /** Localized friendly display name of the log */ + displayName?: string; + /** Blob duration of the log */ + blobDuration?: string; } -/** - * AppConfiguration error object. - */ -export interface ErrorModel { - /** - * Error code. - */ - code?: string; - /** - * Error message. - */ - message?: string; +/** Specifications of the Metrics for Azure Monitoring */ +export interface MetricSpecification { + /** Name of the metric */ + name?: string; + /** Localized friendly display name of the metric */ + displayName?: string; + /** Localized friendly description of the metric */ + displayDescription?: string; + /** Unit that makes sense for the metric */ + unit?: string; + /** Only provide one value for this field. Valid values: Average, Minimum, Maximum, Total, Count. */ + aggregationType?: string; + /** Internal metric name. */ + internalMetricName?: string; + /** Dimensions of the metric */ + dimensions?: MetricDimension[]; + /** Optional. If set to true, then zero will be returned for time duration where no metric is emitted/published. */ + fillGapWithZero?: boolean; +} + +/** Specifications of the Dimension of metrics */ +export interface MetricDimension { + /** Name of the dimension */ + name?: string; + /** Localized friendly display name of the dimension */ + displayName?: string; + /** Internal name of the dimension. */ + internalName?: string; } -/** - * A private endpoint connection - */ -export interface PrivateEndpointConnection extends BaseResource { +/** A list of private endpoint connections */ +export interface PrivateEndpointConnectionListResult { + /** The collection value. */ + value?: PrivateEndpointConnection[]; + /** The URI that can be used to request the next set of paged results. */ + nextLink?: string; +} + +/** A private endpoint connection */ +export interface PrivateEndpointConnection { /** * The resource ID. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * 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.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** * The type of the resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; /** - * The provisioning status of the private endpoint connection. Possible values include: - * 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The provisioning status of the private endpoint connection. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; - /** - * The resource of private endpoint. - */ + /** The resource of private endpoint. */ privateEndpoint?: PrivateEndpoint; - /** - * A collection of information about the state of the connection between service consumer and - * provider. - */ - privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; + /** A collection of information about the state of the connection between service consumer and provider. */ + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; } -/** - * A resource that supports private link capabilities. - */ +/** A list of private link resources. */ +export interface PrivateLinkResourceListResult { + /** The collection value. */ + value?: PrivateLinkResource[]; + /** The URI that can be used to request the next set of paged results. */ + nextLink?: string; +} + +/** A resource that supports private link capabilities. */ export interface PrivateLinkResource { /** * The resource ID. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * 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.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** * The type of the resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; /** * The private link resource group id. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly groupId?: string; /** * The private link resource required member names. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly requiredMembers?: string[]; /** * The list of required DNS zone names of the private link resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly requiredZoneNames?: string[]; } -/** - * Optional Parameters. - */ -export interface ConfigurationStoresListOptionalParams extends msRest.RequestOptionsBase { - /** - * A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will - * include a skipToken parameter that specifies a starting point to use for subsequent calls. - */ - skipToken?: string; +/** The result of a request to list key-values. */ +export interface KeyValueListResult { + /** The collection value. */ + value?: KeyValue[]; + /** The URI that can be used to request the next set of paged results. */ + nextLink?: string; } -/** - * Optional Parameters. - */ -export interface ConfigurationStoresListByResourceGroupOptionalParams extends msRest.RequestOptionsBase { +/** The key-value resource along with all resource properties. */ +export interface KeyValue { /** - * A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will - * include a skipToken parameter that specifies a starting point to use for subsequent calls. + * The resource ID. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skipToken?: string; -} - -/** - * Optional Parameters. - */ -export interface ConfigurationStoresListKeysOptionalParams extends msRest.RequestOptionsBase { + readonly id?: string; /** - * A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will - * include a skipToken parameter that specifies a starting point to use for subsequent calls. + * The name of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skipToken?: string; + readonly name?: string; + /** + * The type of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The primary identifier of a key-value. + * The key is used in unison with the label to uniquely identify a key-value. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly key?: string; + /** + * A value used to group key-values. + * The label is used in unison with the key to uniquely identify a key-value. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly label?: string; + /** The value of the key-value. */ + value?: string; + /** + * The content type of the key-value's value. + * Providing a proper content-type can enable transformations of values when they are retrieved by applications. + */ + contentType?: string; + /** + * An ETag indicating the state of a key-value within a configuration store. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly eTag?: string; + /** + * The last time a modifying operation was performed on the given key-value. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastModified?: Date; + /** + * A value indicating whether the key-value is locked. + * A locked key-value may not be modified until it is unlocked. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly locked?: boolean; + /** A dictionary of tags that can help identify what a key-value may be applicable for. */ + tags?: { [propertyName: string]: string }; } -/** - * Optional Parameters. - */ -export interface OperationsListOptionalParams extends msRest.RequestOptionsBase { +/** 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 configuration store along with all resource properties. The Configuration Store will have all information to begin utilizing it. */ +export type ConfigurationStore = TrackedResource & { + /** The managed identity information, if configured. */ + identity?: ResourceIdentity; + /** The sku of the configuration store. */ + sku: Sku; /** - * A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will - * include a skipToken parameter that specifies a starting point to use for subsequent calls. + * Resource system metadata. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skipToken?: string; + readonly systemData?: SystemData; + /** + * The provisioning state of the configuration store. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** + * The creation date of configuration store. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly creationDate?: Date; + /** + * The DNS endpoint where the configuration store API will be available. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly endpoint?: string; + /** The encryption settings of the configuration store. */ + encryption?: EncryptionProperties; + /** + * The list of private endpoint connections that are set up for this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateEndpointConnections?: PrivateEndpointConnectionReference[]; + /** Control permission for data plane traffic coming from public networks while private endpoint is enabled. */ + publicNetworkAccess?: PublicNetworkAccess; + /** Disables all authentication methods other than AAD authentication. */ + disableLocalAuth?: boolean; +}; + +/** Known values of {@link IdentityType} that the service accepts. */ +export enum KnownIdentityType { + None = "None", + SystemAssigned = "SystemAssigned", + UserAssigned = "UserAssigned", + SystemAssignedUserAssigned = "SystemAssigned, UserAssigned" } /** - * An interface representing AppConfigurationManagementClientOptions. + * Defines values for IdentityType. \ + * {@link KnownIdentityType} can be used interchangeably with IdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **SystemAssigned** \ + * **UserAssigned** \ + * **SystemAssigned, UserAssigned** */ -export interface AppConfigurationManagementClientOptions extends AzureServiceClientOptions { - baseUri?: string; +export type IdentityType = string; + +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + Creating = "Creating", + Updating = "Updating", + Deleting = "Deleting", + Succeeded = "Succeeded", + Failed = "Failed", + Canceled = "Canceled" } /** - * @interface - * The result of a request to list configuration stores. - * @extends Array + * Defines values for ProvisioningState. \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Creating** \ + * **Updating** \ + * **Deleting** \ + * **Succeeded** \ + * **Failed** \ + * **Canceled** */ -export interface ConfigurationStoreListResult extends Array { - /** - * The URI that can be used to request the next set of paged results. - */ - nextLink?: string; +export type ProvisioningState = string; + +/** Known values of {@link ConnectionStatus} that the service accepts. */ +export enum KnownConnectionStatus { + Pending = "Pending", + Approved = "Approved", + Rejected = "Rejected", + Disconnected = "Disconnected" } /** - * @interface - * The result of a request to list API keys. - * @extends Array + * Defines values for ConnectionStatus. \ + * {@link KnownConnectionStatus} can be used interchangeably with ConnectionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Pending** \ + * **Approved** \ + * **Rejected** \ + * **Disconnected** */ -export interface ApiKeyListResult extends Array { - /** - * The URI that can be used to request the next set of paged results. - */ - nextLink?: string; +export type ConnectionStatus = string; + +/** Known values of {@link ActionsRequired} that the service accepts. */ +export enum KnownActionsRequired { + None = "None", + Recreate = "Recreate" } /** - * @interface - * The result of a request to list configuration store operations. - * @extends Array + * Defines values for ActionsRequired. \ + * {@link KnownActionsRequired} can be used interchangeably with ActionsRequired, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Recreate** */ -export interface OperationDefinitionListResult extends Array { - /** - * The URI that can be used to request the next set of paged results. - */ - nextLink?: string; +export type ActionsRequired = string; + +/** Known values of {@link PublicNetworkAccess} that the service accepts. */ +export enum KnownPublicNetworkAccess { + Enabled = "Enabled", + Disabled = "Disabled" } /** - * @interface - * A list of private endpoint connections - * @extends Array + * Defines values for PublicNetworkAccess. \ + * {@link KnownPublicNetworkAccess} can be used interchangeably with PublicNetworkAccess, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** */ -export interface PrivateEndpointConnectionListResult extends Array { - /** - * The URI that can be used to request the next set of paged results. - */ - nextLink?: string; +export type PublicNetworkAccess = string; + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + User = "User", + Application = "Application", + ManagedIdentity = "ManagedIdentity", + Key = "Key" } /** - * @interface - * A list of private link resources. - * @extends Array + * 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 interface PrivateLinkResourceListResult extends Array { - /** - * The URI that can be used to request the next set of paged results. - */ - nextLink?: string; +export type CreatedByType = string; + +/** Known values of {@link ConfigurationResourceType} that the service accepts. */ +export enum KnownConfigurationResourceType { + MicrosoftAppConfigurationConfigurationStores = "Microsoft.AppConfiguration/configurationStores" } /** - * Defines values for IdentityType. - * Possible values include: 'None', 'SystemAssigned', 'UserAssigned', 'SystemAssigned, - * UserAssigned' - * @readonly - * @enum {string} + * Defines values for ConfigurationResourceType. \ + * {@link KnownConfigurationResourceType} can be used interchangeably with ConfigurationResourceType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Microsoft.AppConfiguration\/configurationStores** */ -export type IdentityType = 'None' | 'SystemAssigned' | 'UserAssigned' | 'SystemAssigned, UserAssigned'; +export type ConfigurationResourceType = string; -/** - * Defines values for ProvisioningState. - * Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' - * @readonly - * @enum {string} - */ -export type ProvisioningState = 'Creating' | 'Updating' | 'Deleting' | 'Succeeded' | 'Failed' | 'Canceled'; +/** Optional parameters. */ +export interface ConfigurationStoresListOptionalParams + extends coreClient.OperationOptions { + /** A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. */ + skipToken?: string; +} -/** - * Defines values for ConnectionStatus. - * Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected' - * @readonly - * @enum {string} - */ -export type ConnectionStatus = 'Pending' | 'Approved' | 'Rejected' | 'Disconnected'; +/** Contains response data for the list operation. */ +export type ConfigurationStoresListResponse = ConfigurationStoreListResult; -/** - * Defines values for ActionsRequired. - * Possible values include: 'None', 'Recreate' - * @readonly - * @enum {string} - */ -export type ActionsRequired = 'None' | 'Recreate'; +/** Optional parameters. */ +export interface ConfigurationStoresListByResourceGroupOptionalParams + extends coreClient.OperationOptions { + /** A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. */ + skipToken?: string; +} -/** - * Defines values for PublicNetworkAccess. - * Possible values include: 'Enabled', 'Disabled' - * @readonly - * @enum {string} - */ -export type PublicNetworkAccess = 'Enabled' | 'Disabled'; +/** Contains response data for the listByResourceGroup operation. */ +export type ConfigurationStoresListByResourceGroupResponse = ConfigurationStoreListResult; -/** - * Contains response data for the list operation. - */ -export type ConfigurationStoresListResponse = ConfigurationStoreListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ConfigurationStoreListResult; - }; -}; +/** Optional parameters. */ +export interface ConfigurationStoresGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByResourceGroup operation. - */ -export type ConfigurationStoresListByResourceGroupResponse = ConfigurationStoreListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ConfigurationStoreListResult; - }; -}; +/** Contains response data for the get operation. */ +export type ConfigurationStoresGetResponse = ConfigurationStore; -/** - * Contains response data for the get operation. - */ -export type ConfigurationStoresGetResponse = ConfigurationStore & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ConfigurationStore; - }; -}; +/** Optional parameters. */ +export interface ConfigurationStoresCreateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the create operation. - */ -export type ConfigurationStoresCreateResponse = ConfigurationStore & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ConfigurationStore; - }; -}; +/** Contains response data for the create operation. */ +export type ConfigurationStoresCreateResponse = ConfigurationStore; -/** - * Contains response data for the update operation. - */ -export type ConfigurationStoresUpdateResponse = ConfigurationStore & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ConfigurationStore; - }; -}; +/** Optional parameters. */ +export interface ConfigurationStoresDeleteOptionalParams + 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 listKeys operation. - */ -export type ConfigurationStoresListKeysResponse = ApiKeyListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApiKeyListResult; - }; -}; +/** Optional parameters. */ +export interface ConfigurationStoresUpdateOptionalParams + 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 regenerateKey operation. - */ -export type ConfigurationStoresRegenerateKeyResponse = ApiKey & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApiKey; - }; -}; +/** Contains response data for the update operation. */ +export type ConfigurationStoresUpdateResponse = ConfigurationStore; -/** - * Contains response data for the listKeyValue operation. - */ -export type ConfigurationStoresListKeyValueResponse = KeyValue & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: KeyValue; - }; -}; +/** Optional parameters. */ +export interface ConfigurationStoresListKeysOptionalParams + extends coreClient.OperationOptions { + /** A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. */ + skipToken?: string; +} -/** - * Contains response data for the beginCreate operation. - */ -export type ConfigurationStoresBeginCreateResponse = ConfigurationStore & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ConfigurationStore; - }; -}; +/** Contains response data for the listKeys operation. */ +export type ConfigurationStoresListKeysResponse = ApiKeyListResult; -/** - * Contains response data for the beginUpdate operation. - */ -export type ConfigurationStoresBeginUpdateResponse = ConfigurationStore & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ConfigurationStore; - }; -}; +/** Optional parameters. */ +export interface ConfigurationStoresRegenerateKeyOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listNext operation. - */ -export type ConfigurationStoresListNextResponse = ConfigurationStoreListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ConfigurationStoreListResult; - }; -}; +/** Contains response data for the regenerateKey operation. */ +export type ConfigurationStoresRegenerateKeyResponse = ApiKey; -/** - * Contains response data for the listByResourceGroupNext operation. - */ -export type ConfigurationStoresListByResourceGroupNextResponse = ConfigurationStoreListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ConfigurationStoreListResult; - }; -}; +/** Optional parameters. */ +export interface ConfigurationStoresListNextOptionalParams + extends coreClient.OperationOptions { + /** A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. */ + skipToken?: string; +} -/** - * Contains response data for the listKeysNext operation. - */ -export type ConfigurationStoresListKeysNextResponse = ApiKeyListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApiKeyListResult; - }; -}; +/** Contains response data for the listNext operation. */ +export type ConfigurationStoresListNextResponse = ConfigurationStoreListResult; -/** - * Contains response data for the checkNameAvailability operation. - */ -export type OperationsCheckNameAvailabilityResponse = NameAvailabilityStatus & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: NameAvailabilityStatus; - }; -}; +/** Optional parameters. */ +export interface ConfigurationStoresListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions { + /** A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. */ + skipToken?: string; +} -/** - * Contains response data for the list operation. - */ -export type OperationsListResponse = OperationDefinitionListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationDefinitionListResult; - }; -}; +/** Contains response data for the listByResourceGroupNext operation. */ +export type ConfigurationStoresListByResourceGroupNextResponse = ConfigurationStoreListResult; -/** - * Contains response data for the listNext operation. - */ -export type OperationsListNextResponse = OperationDefinitionListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationDefinitionListResult; - }; -}; +/** Optional parameters. */ +export interface ConfigurationStoresListKeysNextOptionalParams + extends coreClient.OperationOptions { + /** A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. */ + skipToken?: string; +} -/** - * Contains response data for the listByConfigurationStore operation. - */ -export type PrivateEndpointConnectionsListByConfigurationStoreResponse = PrivateEndpointConnectionListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateEndpointConnectionListResult; - }; -}; +/** Contains response data for the listKeysNext operation. */ +export type ConfigurationStoresListKeysNextResponse = ApiKeyListResult; -/** - * Contains response data for the get operation. - */ -export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateEndpointConnection; - }; -}; +/** Optional parameters. */ +export interface OperationsCheckNameAvailabilityOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdate operation. - */ -export type PrivateEndpointConnectionsCreateOrUpdateResponse = PrivateEndpointConnection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateEndpointConnection; - }; -}; +/** Contains response data for the checkNameAvailability operation. */ +export type OperationsCheckNameAvailabilityResponse = NameAvailabilityStatus; -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type PrivateEndpointConnectionsBeginCreateOrUpdateResponse = PrivateEndpointConnection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateEndpointConnection; - }; -}; +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions { + /** A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. */ + skipToken?: string; +} -/** - * Contains response data for the listByConfigurationStoreNext operation. - */ -export type PrivateEndpointConnectionsListByConfigurationStoreNextResponse = PrivateEndpointConnectionListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateEndpointConnectionListResult; - }; -}; +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationDefinitionListResult; -/** - * Contains response data for the listByConfigurationStore operation. - */ -export type PrivateLinkResourcesListByConfigurationStoreResponse = PrivateLinkResourceListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateLinkResourceListResult; - }; -}; +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions { + /** A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. */ + skipToken?: string; +} -/** - * Contains response data for the get operation. - */ -export type PrivateLinkResourcesGetResponse = PrivateLinkResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateLinkResource; - }; -}; +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationDefinitionListResult; -/** - * Contains response data for the listByConfigurationStoreNext operation. - */ -export type PrivateLinkResourcesListByConfigurationStoreNextResponse = PrivateLinkResourceListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateLinkResourceListResult; - }; -}; +/** Optional parameters. */ +export interface PrivateEndpointConnectionsListByConfigurationStoreOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByConfigurationStore operation. */ +export type PrivateEndpointConnectionsListByConfigurationStoreResponse = PrivateEndpointConnectionListResult; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type PrivateEndpointConnectionsCreateOrUpdateResponse = PrivateEndpointConnection; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsListByConfigurationStoreNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByConfigurationStoreNext operation. */ +export type PrivateEndpointConnectionsListByConfigurationStoreNextResponse = PrivateEndpointConnectionListResult; + +/** Optional parameters. */ +export interface PrivateLinkResourcesListByConfigurationStoreOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByConfigurationStore operation. */ +export type PrivateLinkResourcesListByConfigurationStoreResponse = PrivateLinkResourceListResult; + +/** Optional parameters. */ +export interface PrivateLinkResourcesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type PrivateLinkResourcesGetResponse = PrivateLinkResource; + +/** Optional parameters. */ +export interface PrivateLinkResourcesListByConfigurationStoreNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByConfigurationStoreNext operation. */ +export type PrivateLinkResourcesListByConfigurationStoreNextResponse = PrivateLinkResourceListResult; + +/** Optional parameters. */ +export interface KeyValuesListByConfigurationStoreOptionalParams + extends coreClient.OperationOptions { + /** A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. */ + skipToken?: string; +} + +/** Contains response data for the listByConfigurationStore operation. */ +export type KeyValuesListByConfigurationStoreResponse = KeyValueListResult; + +/** Optional parameters. */ +export interface KeyValuesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type KeyValuesGetResponse = KeyValue; + +/** Optional parameters. */ +export interface KeyValuesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** The parameters for creating a key-value. */ + keyValueParameters?: KeyValue; +} + +/** Contains response data for the createOrUpdate operation. */ +export type KeyValuesCreateOrUpdateResponse = KeyValue; + +/** Optional parameters. */ +export interface KeyValuesDeleteOptionalParams + 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 KeyValuesListByConfigurationStoreNextOptionalParams + extends coreClient.OperationOptions { + /** A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. */ + skipToken?: string; +} + +/** Contains response data for the listByConfigurationStoreNext operation. */ +export type KeyValuesListByConfigurationStoreNextResponse = KeyValueListResult; + +/** Optional parameters. */ +export interface AppConfigurationManagementClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/appconfiguration/arm-appconfiguration/src/models/mappers.ts b/sdk/appconfiguration/arm-appconfiguration/src/models/mappers.ts index 0cfebe6dbc46..05f8e7237862 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/models/mappers.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/models/mappers.ts @@ -1,33 +1,32 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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 { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export const CloudError = CloudErrorMapper; -export const BaseResource = BaseResourceMapper; - -export const UserIdentity: msRest.CompositeMapper = { - serializedName: "UserIdentity", +export const ConfigurationStoreListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "UserIdentity", + className: "ConfigurationStoreListResult", modelProperties: { - principalId: { - readOnly: true, - serializedName: "principalId", + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ConfigurationStore" + } + } } }, - clientId: { - readOnly: true, - serializedName: "clientId", + nextLink: { + serializedName: "nextLink", type: { name: "String" } @@ -36,8 +35,7 @@ export const UserIdentity: msRest.CompositeMapper = { } }; -export const ResourceIdentity: msRest.CompositeMapper = { - serializedName: "ResourceIdentity", +export const ResourceIdentity: coreClient.CompositeMapper = { type: { name: "Composite", className: "ResourceIdentity", @@ -52,24 +50,19 @@ export const ResourceIdentity: msRest.CompositeMapper = { serializedName: "userAssignedIdentities", type: { name: "Dictionary", - value: { - type: { - name: "Composite", - className: "UserIdentity" - } - } + value: { type: { name: "Composite", className: "UserIdentity" } } } }, principalId: { - readOnly: true, serializedName: "principalId", + readOnly: true, type: { name: "String" } }, tenantId: { - readOnly: true, serializedName: "tenantId", + readOnly: true, type: { name: "String" } @@ -78,20 +71,21 @@ export const ResourceIdentity: msRest.CompositeMapper = { } }; -export const KeyVaultProperties: msRest.CompositeMapper = { - serializedName: "KeyVaultProperties", +export const UserIdentity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "KeyVaultProperties", + className: "UserIdentity", modelProperties: { - keyIdentifier: { - serializedName: "keyIdentifier", + principalId: { + serializedName: "principalId", + readOnly: true, type: { name: "String" } }, - identityClientId: { - serializedName: "identityClientId", + clientId: { + serializedName: "clientId", + readOnly: true, type: { name: "String" } @@ -100,8 +94,7 @@ export const KeyVaultProperties: msRest.CompositeMapper = { } }; -export const EncryptionProperties: msRest.CompositeMapper = { - serializedName: "EncryptionProperties", +export const EncryptionProperties: coreClient.CompositeMapper = { type: { name: "Composite", className: "EncryptionProperties", @@ -117,43 +110,19 @@ export const EncryptionProperties: msRest.CompositeMapper = { } }; -export const PrivateEndpoint: msRest.CompositeMapper = { - serializedName: "PrivateEndpoint", - type: { - name: "Composite", - className: "PrivateEndpoint", - modelProperties: { - id: { - serializedName: "id", - type: { - name: "String" - } - } - } - } -}; - -export const PrivateLinkServiceConnectionState: msRest.CompositeMapper = { - serializedName: "PrivateLinkServiceConnectionState", +export const KeyVaultProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateLinkServiceConnectionState", + className: "KeyVaultProperties", modelProperties: { - status: { - serializedName: "status", - type: { - name: "String" - } - }, - description: { - serializedName: "description", + keyIdentifier: { + serializedName: "keyIdentifier", type: { name: "String" } }, - actionsRequired: { - readOnly: true, - serializedName: "actionsRequired", + identityClientId: { + serializedName: "identityClientId", type: { name: "String" } @@ -162,36 +131,35 @@ export const PrivateLinkServiceConnectionState: msRest.CompositeMapper = { } }; -export const PrivateEndpointConnectionReference: msRest.CompositeMapper = { - serializedName: "PrivateEndpointConnectionReference", +export const PrivateEndpointConnectionReference: coreClient.CompositeMapper = { type: { name: "Composite", className: "PrivateEndpointConnectionReference", modelProperties: { id: { - readOnly: true, serializedName: "id", + readOnly: true, type: { name: "String" } }, name: { - readOnly: true, serializedName: "name", + readOnly: true, type: { name: "String" } }, type: { - readOnly: true, serializedName: "type", + readOnly: true, type: { name: "String" } }, provisioningState: { - readOnly: true, serializedName: "properties.provisioningState", + readOnly: true, type: { name: "String" } @@ -204,7 +172,6 @@ export const PrivateEndpointConnectionReference: msRest.CompositeMapper = { } }, privateLinkServiceConnectionState: { - required: true, serializedName: "properties.privateLinkServiceConnectionState", type: { name: "Composite", @@ -215,15 +182,13 @@ export const PrivateEndpointConnectionReference: msRest.CompositeMapper = { } }; -export const Sku: msRest.CompositeMapper = { - serializedName: "Sku", +export const PrivateEndpoint: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Sku", + className: "PrivateEndpoint", modelProperties: { - name: { - required: true, - serializedName: "name", + id: { + serializedName: "id", type: { name: "String" } @@ -232,277 +197,373 @@ export const Sku: msRest.CompositeMapper = { } }; -export const Resource: msRest.CompositeMapper = { - serializedName: "Resource", +export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "PrivateLinkServiceConnectionState", modelProperties: { - id: { - readOnly: true, - serializedName: "id", + status: { + serializedName: "status", type: { name: "String" } }, - name: { - readOnly: true, - serializedName: "name", + description: { + serializedName: "description", type: { name: "String" } }, - type: { + actionsRequired: { + serializedName: "actionsRequired", readOnly: true, - serializedName: "type", type: { name: "String" } - }, - location: { + } + } + } +}; + +export const Sku: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Sku", + modelProperties: { + name: { + serializedName: "name", required: true, - serializedName: "location", type: { name: "String" } - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - } } } } }; -export const ConfigurationStore: msRest.CompositeMapper = { - serializedName: "ConfigurationStore", +export const SystemData: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ConfigurationStore", + className: "SystemData", modelProperties: { - ...Resource.type.modelProperties, - identity: { - serializedName: "identity", + createdBy: { + serializedName: "createdBy", type: { - name: "Composite", - className: "ResourceIdentity" + name: "String" } }, - provisioningState: { - readOnly: true, - serializedName: "properties.provisioningState", + createdByType: { + serializedName: "createdByType", type: { name: "String" } }, - creationDate: { - readOnly: true, - serializedName: "properties.creationDate", + createdAt: { + serializedName: "createdAt", type: { name: "DateTime" } }, - endpoint: { - readOnly: true, - serializedName: "properties.endpoint", + lastModifiedBy: { + serializedName: "lastModifiedBy", type: { name: "String" } }, - encryption: { - serializedName: "properties.encryption", - type: { - name: "Composite", - className: "EncryptionProperties" - } - }, - privateEndpointConnections: { - readOnly: true, - serializedName: "properties.privateEndpointConnections", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateEndpointConnectionReference" - } - } - } - }, - publicNetworkAccess: { - serializedName: "properties.publicNetworkAccess", + lastModifiedByType: { + serializedName: "lastModifiedByType", type: { name: "String" } }, - sku: { - required: true, - serializedName: "sku", + lastModifiedAt: { + serializedName: "lastModifiedAt", type: { - name: "Composite", - className: "Sku" + name: "DateTime" } } } } }; -export const ConfigurationStoreUpdateParameters: msRest.CompositeMapper = { - serializedName: "ConfigurationStoreUpdateParameters", +export const Resource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ConfigurationStoreUpdateParameters", + className: "Resource", modelProperties: { - encryption: { - serializedName: "properties.encryption", - type: { - name: "Composite", - className: "EncryptionProperties" - } - }, - publicNetworkAccess: { - serializedName: "properties.publicNetworkAccess", + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "ResourceIdentity" - } - }, - sku: { - serializedName: "sku", + name: { + serializedName: "name", + readOnly: true, type: { - name: "Composite", - className: "Sku" + name: "String" } }, - tags: { - serializedName: "tags", + type: { + serializedName: "type", + readOnly: true, type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "String" } } } } }; -export const CheckNameAvailabilityParameters: msRest.CompositeMapper = { - serializedName: "CheckNameAvailabilityParameters", +export const ErrorResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CheckNameAvailabilityParameters", + className: "ErrorResponse", modelProperties: { - name: { - required: true, - serializedName: "name", + error: { + serializedName: "error", type: { - name: "String" - } - }, - type: { - required: true, - isConstant: true, - serializedName: "type", - defaultValue: 'Microsoft.AppConfiguration/configurationStores', - type: { - name: "String" + name: "Composite", + className: "ErrorDetails" } } } } }; -export const NameAvailabilityStatus: msRest.CompositeMapper = { - serializedName: "NameAvailabilityStatus", +export const ErrorDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NameAvailabilityStatus", + className: "ErrorDetails", modelProperties: { - nameAvailable: { + code: { + serializedName: "code", readOnly: true, - serializedName: "nameAvailable", type: { - name: "Boolean" + name: "String" } }, message: { - readOnly: true, serializedName: "message", + readOnly: true, type: { name: "String" } }, - reason: { + additionalInfo: { + serializedName: "additionalInfo", readOnly: true, - serializedName: "reason", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } } } } } }; -export const ApiKey: msRest.CompositeMapper = { - serializedName: "ApiKey", +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ApiKey", + className: "ErrorAdditionalInfo", modelProperties: { - id: { + type: { + serializedName: "type", readOnly: true, - serializedName: "id", type: { name: "String" } }, - name: { + info: { + serializedName: "info", readOnly: true, - serializedName: "name", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "any" } } } - }, - value: { - readOnly: true, - serializedName: "value", + } + } + } +}; + +export const ConfigurationStoreUpdateParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConfigurationStoreUpdateParameters", + modelProperties: { + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ResourceIdentity" + } + }, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + encryption: { + serializedName: "properties.encryption", + type: { + name: "Composite", + className: "EncryptionProperties" + } + }, + disableLocalAuth: { + serializedName: "properties.disableLocalAuth", + type: { + name: "Boolean" + } + }, + publicNetworkAccess: { + serializedName: "properties.publicNetworkAccess", + type: { + name: "String" + } + } + } + } +}; + +export const CheckNameAvailabilityParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CheckNameAvailabilityParameters", + modelProperties: { + name: { + serializedName: "name", + required: true, type: { name: "String" } }, - connectionString: { + type: { + serializedName: "type", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const NameAvailabilityStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NameAvailabilityStatus", + modelProperties: { + nameAvailable: { + serializedName: "nameAvailable", + readOnly: true, + type: { + name: "Boolean" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + }, + reason: { + serializedName: "reason", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ApiKeyListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApiKeyListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ApiKey" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ApiKey: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApiKey", + modelProperties: { + id: { + serializedName: "id", readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "String" + } + }, + connectionString: { serializedName: "connectionString", + readOnly: true, type: { name: "String" } }, lastModified: { - readOnly: true, serializedName: "lastModified", + readOnly: true, type: { name: "DateTime" } }, readOnly: { - readOnly: true, serializedName: "readOnly", + readOnly: true, type: { name: "Boolean" } @@ -511,8 +572,7 @@ export const ApiKey: msRest.CompositeMapper = { } }; -export const RegenerateKeyParameters: msRest.CompositeMapper = { - serializedName: "RegenerateKeyParameters", +export const RegenerateKeyParameters: coreClient.CompositeMapper = { type: { name: "Composite", className: "RegenerateKeyParameters", @@ -527,21 +587,25 @@ export const RegenerateKeyParameters: msRest.CompositeMapper = { } }; -export const ListKeyValueParameters: msRest.CompositeMapper = { - serializedName: "ListKeyValueParameters", +export const OperationDefinitionListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ListKeyValueParameters", + className: "OperationDefinitionListResult", modelProperties: { - key: { - required: true, - serializedName: "key", + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OperationDefinition" + } + } } }, - label: { - serializedName: "label", + nextLink: { + serializedName: "nextLink", type: { name: "String" } @@ -550,69 +614,122 @@ export const ListKeyValueParameters: msRest.CompositeMapper = { } }; -export const KeyValue: msRest.CompositeMapper = { - serializedName: "KeyValue", +export const OperationDefinition: coreClient.CompositeMapper = { type: { name: "Composite", - className: "KeyValue", + className: "OperationDefinition", modelProperties: { - key: { - readOnly: true, - serializedName: "key", + name: { + serializedName: "name", type: { name: "String" } }, - label: { - readOnly: true, - serializedName: "label", + isDataAction: { + serializedName: "isDataAction", type: { - name: "String" + name: "Boolean" } }, - value: { - readOnly: true, - serializedName: "value", + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDefinitionDisplay" + } + }, + origin: { + serializedName: "origin", type: { name: "String" } }, - contentType: { + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "OperationProperties" + } + } + } + } +}; + +export const OperationDefinitionDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDefinitionDisplay", + modelProperties: { + provider: { + serializedName: "provider", readOnly: true, - serializedName: "contentType", type: { name: "String" } }, - eTag: { - readOnly: true, - serializedName: "eTag", + resource: { + serializedName: "resource", type: { name: "String" } }, - lastModified: { - readOnly: true, - serializedName: "lastModified", + operation: { + serializedName: "operation", type: { - name: "DateTime" + name: "String" } }, - locked: { - readOnly: true, - serializedName: "locked", + description: { + serializedName: "description", type: { - name: "Boolean" + name: "String" + } + } + } + } +}; + +export const OperationProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationProperties", + modelProperties: { + serviceSpecification: { + serializedName: "serviceSpecification", + type: { + name: "Composite", + className: "ServiceSpecification" + } + } + } + } +}; + +export const ServiceSpecification: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServiceSpecification", + modelProperties: { + logSpecifications: { + serializedName: "logSpecifications", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LogSpecification" + } + } } }, - tags: { - readOnly: true, - serializedName: "tags", + metricSpecifications: { + serializedName: "metricSpecifications", type: { - name: "Dictionary", - value: { + name: "Sequence", + element: { type: { - name: "String" + name: "Composite", + className: "MetricSpecification" } } } @@ -621,46 +738,100 @@ export const KeyValue: msRest.CompositeMapper = { } }; -export const OperationDefinitionDisplay: msRest.CompositeMapper = { - serializedName: "OperationDefinitionDisplay", +export const LogSpecification: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationDefinitionDisplay", + className: "LogSpecification", modelProperties: { - provider: { - readOnly: true, - serializedName: "provider", + name: { + serializedName: "name", + type: { + name: "String" + } + }, + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + }, + blobDuration: { + serializedName: "blobDuration", + type: { + name: "String" + } + } + } + } +}; + +export const MetricSpecification: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricSpecification", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + }, + displayDescription: { + serializedName: "displayDescription", + type: { + name: "String" + } + }, + unit: { + serializedName: "unit", type: { name: "String" } }, - resource: { - serializedName: "resource", + aggregationType: { + serializedName: "aggregationType", type: { name: "String" } }, - operation: { - serializedName: "operation", + internalMetricName: { + serializedName: "internalMetricName", type: { name: "String" } }, - description: { - serializedName: "description", + dimensions: { + serializedName: "dimensions", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricDimension" + } + } + } + }, + fillGapWithZero: { + serializedName: "fillGapWithZero", + type: { + name: "Boolean" } } } } }; -export const OperationDefinition: msRest.CompositeMapper = { - serializedName: "OperationDefinition", +export const MetricDimension: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationDefinition", + className: "MetricDimension", modelProperties: { name: { serializedName: "name", @@ -668,31 +839,41 @@ export const OperationDefinition: msRest.CompositeMapper = { name: "String" } }, - display: { - serializedName: "display", + displayName: { + serializedName: "displayName", type: { - name: "Composite", - className: "OperationDefinitionDisplay" + name: "String" + } + }, + internalName: { + serializedName: "internalName", + type: { + name: "String" } } } } }; -export const ErrorModel: msRest.CompositeMapper = { - serializedName: "Error", +export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorModel", + className: "PrivateEndpointConnectionListResult", modelProperties: { - code: { - serializedName: "code", + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } } }, - message: { - serializedName: "message", + nextLink: { + serializedName: "nextLink", type: { name: "String" } @@ -701,36 +882,35 @@ export const ErrorModel: msRest.CompositeMapper = { } }; -export const PrivateEndpointConnection: msRest.CompositeMapper = { - serializedName: "PrivateEndpointConnection", +export const PrivateEndpointConnection: coreClient.CompositeMapper = { type: { name: "Composite", className: "PrivateEndpointConnection", modelProperties: { id: { - readOnly: true, serializedName: "id", + readOnly: true, type: { name: "String" } }, name: { - readOnly: true, serializedName: "name", + readOnly: true, type: { name: "String" } }, type: { - readOnly: true, serializedName: "type", + readOnly: true, type: { name: "String" } }, provisioningState: { - readOnly: true, serializedName: "properties.provisioningState", + readOnly: true, type: { name: "String" } @@ -743,7 +923,6 @@ export const PrivateEndpointConnection: msRest.CompositeMapper = { } }, privateLinkServiceConnectionState: { - required: true, serializedName: "properties.privateLinkServiceConnectionState", type: { name: "Composite", @@ -754,43 +933,69 @@ export const PrivateEndpointConnection: msRest.CompositeMapper = { } }; -export const PrivateLinkResource: msRest.CompositeMapper = { - serializedName: "PrivateLinkResource", +export const PrivateLinkResourceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkResourceListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateLinkResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateLinkResource: coreClient.CompositeMapper = { type: { name: "Composite", className: "PrivateLinkResource", modelProperties: { id: { - readOnly: true, serializedName: "id", + readOnly: true, type: { name: "String" } }, name: { - readOnly: true, serializedName: "name", + readOnly: true, type: { name: "String" } }, type: { - readOnly: true, serializedName: "type", + readOnly: true, type: { name: "String" } }, groupId: { - readOnly: true, serializedName: "properties.groupId", + readOnly: true, type: { name: "String" } }, requiredMembers: { - readOnly: true, serializedName: "properties.requiredMembers", + readOnly: true, type: { name: "Sequence", element: { @@ -801,8 +1006,8 @@ export const PrivateLinkResource: msRest.CompositeMapper = { } }, requiredZoneNames: { - readOnly: true, serializedName: "properties.requiredZoneNames", + readOnly: true, type: { name: "Sequence", element: { @@ -816,20 +1021,19 @@ export const PrivateLinkResource: msRest.CompositeMapper = { } }; -export const ConfigurationStoreListResult: msRest.CompositeMapper = { - serializedName: "ConfigurationStoreListResult", +export const KeyValueListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ConfigurationStoreListResult", + className: "KeyValueListResult", modelProperties: { value: { - serializedName: "", + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ConfigurationStore" + className: "KeyValue" } } } @@ -844,82 +1048,106 @@ export const ConfigurationStoreListResult: msRest.CompositeMapper = { } }; -export const ApiKeyListResult: msRest.CompositeMapper = { - serializedName: "ApiKeyListResult", +export const KeyValue: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ApiKeyListResult", + className: "KeyValue", modelProperties: { - value: { - serializedName: "", + id: { + serializedName: "id", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ApiKey" - } - } + name: "String" } }, - nextLink: { - serializedName: "nextLink", + name: { + serializedName: "name", + readOnly: true, type: { name: "String" } - } - } - } -}; - -export const OperationDefinitionListResult: msRest.CompositeMapper = { - serializedName: "OperationDefinitionListResult", - type: { - name: "Composite", - className: "OperationDefinitionListResult", - modelProperties: { + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + key: { + serializedName: "properties.key", + readOnly: true, + type: { + name: "String" + } + }, + label: { + serializedName: "properties.label", + readOnly: true, + type: { + name: "String" + } + }, value: { - serializedName: "", + serializedName: "properties.value", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "OperationDefinition" - } - } + name: "String" } }, - nextLink: { - serializedName: "nextLink", + contentType: { + serializedName: "properties.contentType", + type: { + name: "String" + } + }, + eTag: { + serializedName: "properties.eTag", + readOnly: true, type: { name: "String" } + }, + lastModified: { + serializedName: "properties.lastModified", + readOnly: true, + type: { + name: "DateTime" + } + }, + locked: { + serializedName: "properties.locked", + readOnly: true, + type: { + name: "Boolean" + } + }, + tags: { + serializedName: "properties.tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } } } } }; -export const PrivateEndpointConnectionListResult: msRest.CompositeMapper = { - serializedName: "PrivateEndpointConnectionListResult", +export const TrackedResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateEndpointConnectionListResult", + className: "TrackedResource", modelProperties: { - value: { - serializedName: "", + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateEndpointConnection" - } - } + name: "Dictionary", + value: { type: { name: "String" } } } }, - nextLink: { - serializedName: "nextLink", + location: { + serializedName: "location", + required: true, type: { name: "String" } @@ -928,29 +1156,85 @@ export const PrivateEndpointConnectionListResult: msRest.CompositeMapper = { } }; -export const PrivateLinkResourceListResult: msRest.CompositeMapper = { - serializedName: "PrivateLinkResourceListResult", +export const ConfigurationStore: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateLinkResourceListResult", + className: "ConfigurationStore", modelProperties: { - value: { - serializedName: "", + ...TrackedResource.type.modelProperties, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ResourceIdentity" + } + }, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + creationDate: { + serializedName: "properties.creationDate", + readOnly: true, + type: { + name: "DateTime" + } + }, + endpoint: { + serializedName: "properties.endpoint", + readOnly: true, + type: { + name: "String" + } + }, + encryption: { + serializedName: "properties.encryption", + type: { + name: "Composite", + className: "EncryptionProperties" + } + }, + privateEndpointConnections: { + serializedName: "properties.privateEndpointConnections", + readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "PrivateLinkResource" + className: "PrivateEndpointConnectionReference" } } } }, - nextLink: { - serializedName: "nextLink", + publicNetworkAccess: { + serializedName: "properties.publicNetworkAccess", type: { name: "String" } + }, + disableLocalAuth: { + serializedName: "properties.disableLocalAuth", + type: { + name: "Boolean" + } } } } diff --git a/sdk/appconfiguration/arm-appconfiguration/src/models/operationsMappers.ts b/sdk/appconfiguration/arm-appconfiguration/src/models/operationsMappers.ts deleted file mode 100644 index 0c4c87228850..000000000000 --- a/sdk/appconfiguration/arm-appconfiguration/src/models/operationsMappers.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - CheckNameAvailabilityParameters, - ErrorModel, - NameAvailabilityStatus, - OperationDefinition, - OperationDefinitionDisplay, - OperationDefinitionListResult -} from "../models/mappers"; diff --git a/sdk/appconfiguration/arm-appconfiguration/src/models/parameters.ts b/sdk/appconfiguration/arm-appconfiguration/src/models/parameters.ts index d098b569c352..4d6607498f79 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/models/parameters.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/models/parameters.ts @@ -1,110 +1,192 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + ConfigurationStore as ConfigurationStoreMapper, + ConfigurationStoreUpdateParameters as ConfigurationStoreUpdateParametersMapper, + RegenerateKeyParameters as RegenerateKeyParametersMapper, + CheckNameAvailabilityParameters as CheckNameAvailabilityParametersMapper, + PrivateEndpointConnection as PrivateEndpointConnectionMapper, + KeyValue as KeyValueMapper +} from "../models/mappers"; -export const acceptLanguage: msRest.OperationParameter = { - parameterPath: "acceptLanguage", +export const accept: OperationParameter = { + parameterPath: "accept", mapper: { - serializedName: "accept-language", - defaultValue: 'en-US', + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", type: { name: "String" } } }; -export const apiVersion: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const $host: OperationURLParameter = { + parameterPath: "$host", mapper: { + serializedName: "$host", required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + serializedName: "subscriptionId", + required: true, + type: { + name: "String" + } + } +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2021-03-01-preview", + isConstant: true, serializedName: "api-version", type: { name: "String" } } }; -export const configStoreName: msRest.OperationURLParameter = { - parameterPath: "configStoreName", + +export const skipToken: OperationQueryParameter = { + parameterPath: ["options", "skipToken"], + mapper: { + serializedName: "$skipToken", + type: { + name: "String" + } + } +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", mapper: { + serializedName: "resourceGroupName", required: true, - serializedName: "configStoreName", + type: { + name: "String" + } + } +}; + +export const configStoreName: OperationURLParameter = { + parameterPath: "configStoreName", + mapper: { constraints: { + Pattern: new RegExp("^[a-zA-Z0-9_-]*$"), MaxLength: 50, - MinLength: 5, - Pattern: /^[a-zA-Z0-9_-]*$/ + MinLength: 5 }, + serializedName: "configStoreName", + required: true, type: { name: "String" } } }; -export const groupName: msRest.OperationURLParameter = { - parameterPath: "groupName", + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], mapper: { - required: true, - serializedName: "groupName", + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", type: { name: "String" } } }; -export const nextPageLink: msRest.OperationURLParameter = { - parameterPath: "nextPageLink", + +export const configStoreCreationParameters: OperationParameter = { + parameterPath: "configStoreCreationParameters", + mapper: ConfigurationStoreMapper +}; + +export const configStoreUpdateParameters: OperationParameter = { + parameterPath: "configStoreUpdateParameters", + mapper: ConfigurationStoreUpdateParametersMapper +}; + +export const regenerateKeyParameters: OperationParameter = { + parameterPath: "regenerateKeyParameters", + mapper: RegenerateKeyParametersMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", mapper: { - required: true, serializedName: "nextLink", + required: true, type: { name: "String" } }, skipEncoding: true }; -export const privateEndpointConnectionName: msRest.OperationURLParameter = { + +export const checkNameAvailabilityParameters: OperationParameter = { + parameterPath: "checkNameAvailabilityParameters", + mapper: CheckNameAvailabilityParametersMapper +}; + +export const privateEndpointConnectionName: OperationURLParameter = { parameterPath: "privateEndpointConnectionName", mapper: { - required: true, serializedName: "privateEndpointConnectionName", - type: { - name: "String" - } - } -}; -export const resourceGroupName: msRest.OperationURLParameter = { - parameterPath: "resourceGroupName", - mapper: { required: true, - serializedName: "resourceGroupName", type: { name: "String" } } }; -export const skipToken: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "skipToken" - ], + +export const privateEndpointConnection: OperationParameter = { + parameterPath: "privateEndpointConnection", + mapper: PrivateEndpointConnectionMapper +}; + +export const groupName: OperationURLParameter = { + parameterPath: "groupName", mapper: { - serializedName: "$skipToken", + serializedName: "groupName", + required: true, type: { name: "String" } } }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +export const keyValueName: OperationURLParameter = { + parameterPath: "keyValueName", mapper: { + serializedName: "keyValueName", required: true, - serializedName: "subscriptionId", type: { name: "String" } } }; + +export const keyValueParameters: OperationParameter = { + parameterPath: ["options", "keyValueParameters"], + mapper: KeyValueMapper +}; diff --git a/sdk/appconfiguration/arm-appconfiguration/src/models/privateEndpointConnectionsMappers.ts b/sdk/appconfiguration/arm-appconfiguration/src/models/privateEndpointConnectionsMappers.ts deleted file mode 100644 index 1f38807af79d..000000000000 --- a/sdk/appconfiguration/arm-appconfiguration/src/models/privateEndpointConnectionsMappers.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - BaseResource, - ConfigurationStore, - EncryptionProperties, - ErrorModel, - KeyVaultProperties, - PrivateEndpoint, - PrivateEndpointConnection, - PrivateEndpointConnectionListResult, - PrivateEndpointConnectionReference, - PrivateLinkServiceConnectionState, - Resource, - ResourceIdentity, - Sku, - UserIdentity -} from "../models/mappers"; diff --git a/sdk/appconfiguration/arm-appconfiguration/src/models/privateLinkResourcesMappers.ts b/sdk/appconfiguration/arm-appconfiguration/src/models/privateLinkResourcesMappers.ts deleted file mode 100644 index 618676a35470..000000000000 --- a/sdk/appconfiguration/arm-appconfiguration/src/models/privateLinkResourcesMappers.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ErrorModel, - PrivateLinkResource, - PrivateLinkResourceListResult -} from "../models/mappers"; diff --git a/sdk/appconfiguration/arm-appconfiguration/src/operations/configurationStores.ts b/sdk/appconfiguration/arm-appconfiguration/src/operations/configurationStores.ts index 668188671197..6da143d3dc98 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/operations/configurationStores.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/operations/configurationStores.ts @@ -1,588 +1,748 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/configurationStoresMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { ConfigurationStores } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AppConfigurationManagementClientContext } from "../appConfigurationManagementClientContext"; +import { AppConfigurationManagementClient } from "../appConfigurationManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + ConfigurationStore, + ConfigurationStoresListNextOptionalParams, + ConfigurationStoresListOptionalParams, + ConfigurationStoresListByResourceGroupNextOptionalParams, + ConfigurationStoresListByResourceGroupOptionalParams, + ApiKey, + ConfigurationStoresListKeysNextOptionalParams, + ConfigurationStoresListKeysOptionalParams, + ConfigurationStoresListResponse, + ConfigurationStoresListByResourceGroupResponse, + ConfigurationStoresGetOptionalParams, + ConfigurationStoresGetResponse, + ConfigurationStoresCreateOptionalParams, + ConfigurationStoresCreateResponse, + ConfigurationStoresDeleteOptionalParams, + ConfigurationStoreUpdateParameters, + ConfigurationStoresUpdateOptionalParams, + ConfigurationStoresUpdateResponse, + ConfigurationStoresListKeysResponse, + RegenerateKeyParameters, + ConfigurationStoresRegenerateKeyOptionalParams, + ConfigurationStoresRegenerateKeyResponse, + ConfigurationStoresListNextResponse, + ConfigurationStoresListByResourceGroupNextResponse, + ConfigurationStoresListKeysNextResponse +} from "../models"; -/** Class representing a ConfigurationStores. */ -export class ConfigurationStores { - private readonly client: AppConfigurationManagementClientContext; +/// +/** Class containing ConfigurationStores operations. */ +export class ConfigurationStoresImpl implements ConfigurationStores { + private readonly client: AppConfigurationManagementClient; /** - * Create a ConfigurationStores. - * @param {AppConfigurationManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class ConfigurationStores class. + * @param client Reference to the service client */ - constructor(client: AppConfigurationManagementClientContext) { + constructor(client: AppConfigurationManagementClient) { this.client = client; } /** * Lists the configuration stores for a given subscription. - * @param [options] The optional parameters - * @returns Promise - */ - list(options?: Models.ConfigurationStoresListOptionalParams): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list(options: Models.ConfigurationStoresListOptionalParams, callback: msRest.ServiceCallback): void; - list(options?: Models.ConfigurationStoresListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options + * @param options The options parameters. + */ + public list( + options?: ConfigurationStoresListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listOperationSpec, - callback) as Promise; + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: ConfigurationStoresListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: ConfigurationStoresListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } } /** * Lists the configuration stores for a given resource group. * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroup(resourceGroupName: string, options?: Models.ConfigurationStoresListByResourceGroupOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param options The optional parameters - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, options: Models.ConfigurationStoresListByResourceGroupOptionalParams, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options?: Models.ConfigurationStoresListByResourceGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: ConfigurationStoresListByResourceGroupOptionalParams + ): 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?: ConfigurationStoresListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( resourceGroupName, + continuationToken, options - }, - listByResourceGroupOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: ConfigurationStoresListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } } /** - * Gets the properties of the specified configuration store. - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param configStoreName The name of the configuration store. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, configStoreName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param configStoreName The name of the configuration store. - * @param callback The callback - */ - get(resourceGroupName: string, configStoreName: string, callback: msRest.ServiceCallback): void; - /** + * Lists the access key for the specified configuration store. * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, configStoreName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, configStoreName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + * @param options The options parameters. + */ + public listKeys( + resourceGroupName: string, + configStoreName: string, + options?: ConfigurationStoresListKeysOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listKeysPagingAll( + resourceGroupName, + configStoreName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listKeysPagingPage( + resourceGroupName, + configStoreName, + options + ); + } + }; + } + + private async *listKeysPagingPage( + resourceGroupName: string, + configStoreName: string, + options?: ConfigurationStoresListKeysOptionalParams + ): AsyncIterableIterator { + let result = await this._listKeys( + resourceGroupName, + configStoreName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listKeysNext( resourceGroupName, configStoreName, + continuationToken, options - }, - getOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } } - /** - * Creates a configuration store with the specified parameters. - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param configStoreName The name of the configuration store. - * @param configStoreCreationParameters The parameters for creating a configuration store. - * @param [options] The optional parameters - * @returns Promise - */ - create(resourceGroupName: string, configStoreName: string, configStoreCreationParameters: Models.ConfigurationStore, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreate(resourceGroupName,configStoreName,configStoreCreationParameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + private async *listKeysPagingAll( + resourceGroupName: string, + configStoreName: string, + options?: ConfigurationStoresListKeysOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listKeysPagingPage( + resourceGroupName, + configStoreName, + options + )) { + yield* page; + } } /** - * Deletes a configuration store. - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param configStoreName The name of the configuration store. - * @param [options] The optional parameters - * @returns Promise + * Lists the configuration stores for a given subscription. + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, configStoreName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(resourceGroupName,configStoreName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + private _list( + options?: ConfigurationStoresListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); } /** - * Updates a configuration store with the specified parameters. + * Lists the configuration stores for a given resource group. * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param configStoreName The name of the configuration store. - * @param configStoreUpdateParameters The parameters for updating a configuration store. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - update(resourceGroupName: string, configStoreName: string, configStoreUpdateParameters: Models.ConfigurationStoreUpdateParameters, options?: msRest.RequestOptionsBase): Promise { - return this.beginUpdate(resourceGroupName,configStoreName,configStoreUpdateParameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + private _listByResourceGroup( + resourceGroupName: string, + options?: ConfigurationStoresListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); } /** - * Lists the access key for the specified configuration store. - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param configStoreName The name of the configuration store. - * @param [options] The optional parameters - * @returns Promise - */ - listKeys(resourceGroupName: string, configStoreName: string, options?: Models.ConfigurationStoresListKeysOptionalParams): Promise; - /** + * Gets the properties of the specified configuration store. * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. - * @param callback The callback + * @param options The options parameters. */ - listKeys(resourceGroupName: string, configStoreName: string, callback: msRest.ServiceCallback): void; + get( + resourceGroupName: string, + configStoreName: string, + options?: ConfigurationStoresGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, configStoreName, options }, + getOperationSpec + ); + } + /** + * Creates a configuration store with the specified parameters. * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. - * @param options The optional parameters - * @param callback The callback - */ - listKeys(resourceGroupName: string, configStoreName: string, options: Models.ConfigurationStoresListKeysOptionalParams, callback: msRest.ServiceCallback): void; - listKeys(resourceGroupName: string, configStoreName: string, options?: Models.ConfigurationStoresListKeysOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + * @param configStoreCreationParameters The parameters for creating a configuration store. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + configStoreName: string, + configStoreCreationParameters: ConfigurationStore, + options?: ConfigurationStoresCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ConfigurationStoresCreateResponse + > + > { + 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, configStoreName, + configStoreCreationParameters, options }, - listKeysOperationSpec, - callback) as Promise; + createOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Regenerates an access key for the specified configuration store. - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param configStoreName The name of the configuration store. - * @param regenerateKeyParameters The parameters for regenerating an access key. - * @param [options] The optional parameters - * @returns Promise - */ - regenerateKey(resourceGroupName: string, configStoreName: string, regenerateKeyParameters: Models.RegenerateKeyParameters, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param configStoreName The name of the configuration store. - * @param regenerateKeyParameters The parameters for regenerating an access key. - * @param callback The callback - */ - regenerateKey(resourceGroupName: string, configStoreName: string, regenerateKeyParameters: Models.RegenerateKeyParameters, callback: msRest.ServiceCallback): void; - /** + * Creates a configuration store with the specified parameters. * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. - * @param regenerateKeyParameters The parameters for regenerating an access key. - * @param options The optional parameters - * @param callback The callback - */ - regenerateKey(resourceGroupName: string, configStoreName: string, regenerateKeyParameters: Models.RegenerateKeyParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - regenerateKey(resourceGroupName: string, configStoreName: string, regenerateKeyParameters: Models.RegenerateKeyParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - configStoreName, - regenerateKeyParameters, - options - }, - regenerateKeyOperationSpec, - callback) as Promise; + * @param configStoreCreationParameters The parameters for creating a configuration store. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + configStoreName: string, + configStoreCreationParameters: ConfigurationStore, + options?: ConfigurationStoresCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + configStoreName, + configStoreCreationParameters, + options + ); + return poller.pollUntilDone(); } /** - * Lists a configuration store key-value. + * Deletes a configuration store. * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. - * @param listKeyValueParameters The parameters for retrieving a key-value. - * @param [options] The optional parameters - * @returns Promise - */ - listKeyValue(resourceGroupName: string, configStoreName: string, listKeyValueParameters: Models.ListKeyValueParameters, options?: msRest.RequestOptionsBase): Promise; + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + configStoreName: string, + options?: ConfigurationStoresDeleteOptionalParams + ): 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, configStoreName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + /** + * Deletes a configuration store. * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. - * @param listKeyValueParameters The parameters for retrieving a key-value. - * @param callback The callback - */ - listKeyValue(resourceGroupName: string, configStoreName: string, listKeyValueParameters: Models.ListKeyValueParameters, callback: msRest.ServiceCallback): void; + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + configStoreName: string, + options?: ConfigurationStoresDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + configStoreName, + options + ); + return poller.pollUntilDone(); + } + /** + * Updates a configuration store with the specified parameters. * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. - * @param listKeyValueParameters The parameters for retrieving a key-value. - * @param options The optional parameters - * @param callback The callback - */ - listKeyValue(resourceGroupName: string, configStoreName: string, listKeyValueParameters: Models.ListKeyValueParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listKeyValue(resourceGroupName: string, configStoreName: string, listKeyValueParameters: Models.ListKeyValueParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + * @param configStoreUpdateParameters The parameters for updating a configuration store. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + configStoreName: string, + configStoreUpdateParameters: ConfigurationStoreUpdateParameters, + options?: ConfigurationStoresUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ConfigurationStoresUpdateResponse + > + > { + 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, configStoreName, - listKeyValueParameters, + configStoreUpdateParameters, options }, - listKeyValueOperationSpec, - callback) as Promise; + updateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Creates a configuration store with the specified parameters. + * Updates a configuration store with the specified parameters. * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. - * @param configStoreCreationParameters The parameters for creating a configuration store. - * @param [options] The optional parameters - * @returns Promise - */ - beginCreate(resourceGroupName: string, configStoreName: string, configStoreCreationParameters: Models.ConfigurationStore, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - configStoreName, - configStoreCreationParameters, - options - }, - beginCreateOperationSpec, - options); + * @param configStoreUpdateParameters The parameters for updating a configuration store. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + configStoreName: string, + configStoreUpdateParameters: ConfigurationStoreUpdateParameters, + options?: ConfigurationStoresUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + configStoreName, + configStoreUpdateParameters, + options + ); + return poller.pollUntilDone(); } /** - * Deletes a configuration store. + * Lists the access key for the specified configuration store. * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(resourceGroupName: string, configStoreName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - configStoreName, - options - }, - beginDeleteMethodOperationSpec, - options); + private _listKeys( + resourceGroupName: string, + configStoreName: string, + options?: ConfigurationStoresListKeysOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, configStoreName, options }, + listKeysOperationSpec + ); } /** - * Updates a configuration store with the specified parameters. + * Regenerates an access key for the specified configuration store. * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. - * @param configStoreUpdateParameters The parameters for updating a configuration store. - * @param [options] The optional parameters - * @returns Promise - */ - beginUpdate(resourceGroupName: string, configStoreName: string, configStoreUpdateParameters: Models.ConfigurationStoreUpdateParameters, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - configStoreName, - configStoreUpdateParameters, - options - }, - beginUpdateOperationSpec, - options); + * @param regenerateKeyParameters The parameters for regenerating an access key. + * @param options The options parameters. + */ + regenerateKey( + resourceGroupName: string, + configStoreName: string, + regenerateKeyParameters: RegenerateKeyParameters, + options?: ConfigurationStoresRegenerateKeyOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, configStoreName, regenerateKeyParameters, options }, + regenerateKeyOperationSpec + ); } /** - * Lists the configuration stores for a given subscription. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listNext( + nextLink: string, + options?: ConfigurationStoresListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { nextLink, options }, + listNextOperationSpec + ); } /** - * Lists the configuration stores for a given resource group. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @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?: ConfigurationStoresListByResourceGroupNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByResourceGroupNextOperationSpec, - callback) as Promise; + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); } /** - * Lists the access key for the specified configuration store. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listKeysNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listKeysNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listKeysNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listKeysNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * ListKeysNext + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param nextLink The nextLink from the previous successful call to the ListKeys method. + * @param options The options parameters. + */ + private _listKeysNext( + resourceGroupName: string, + configStoreName: string, + nextLink: string, + options?: ConfigurationStoresListKeysNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listKeysNextOperationSpec, - callback) as Promise; + { resourceGroupName, configStoreName, nextLink, options }, + listKeysNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/configurationStores", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/configurationStores", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion, - Parameters.skipToken - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ConfigurationStoreListResult }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion, Parameters.skipToken], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion, - Parameters.skipToken - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ConfigurationStoreListResult }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}", + queryParameters: [Parameters.apiVersion, Parameters.skipToken], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.configStoreName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ConfigurationStore }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listKeysOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/ListKeys", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.configStoreName ], - queryParameters: [ - Parameters.apiVersion, - Parameters.skipToken - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.ApiKeyListResult - }, - default: { - bodyMapper: Mappers.ErrorModel - } - }, + headerParameters: [Parameters.accept], serializer }; - -const regenerateKeyOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/RegenerateKey", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.configStoreName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "regenerateKeyParameters", - mapper: { - ...Mappers.RegenerateKeyParameters, - required: true - } - }, +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}", + httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.ApiKey + bodyMapper: Mappers.ConfigurationStore + }, + 201: { + bodyMapper: Mappers.ConfigurationStore + }, + 202: { + bodyMapper: Mappers.ConfigurationStore + }, + 204: { + bodyMapper: Mappers.ConfigurationStore }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listKeyValueOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/listKeyValue", + requestBody: Parameters.configStoreCreationParameters, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.configStoreName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "listKeyValueParameters", - mapper: { - ...Mappers.ListKeyValueParameters, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}", + httpMethod: "DELETE", responses: { - 200: { - bodyMapper: Mappers.KeyValue - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginCreateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.configStoreName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "configStoreCreationParameters", - mapper: { - ...Mappers.ConfigurationStore, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.ConfigurationStore @@ -590,132 +750,134 @@ const beginCreateOperationSpec: msRest.OperationSpec = { 201: { bodyMapper: Mappers.ConfigurationStore }, + 202: { + bodyMapper: Mappers.ConfigurationStore + }, + 204: { + bodyMapper: Mappers.ConfigurationStore + }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}", + requestBody: Parameters.configStoreUpdateParameters, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.configStoreName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listKeysOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/listKeys", + httpMethod: "POST", responses: { - 200: {}, - 202: {}, - 204: {}, + 200: { + bodyMapper: Mappers.ApiKeyListResult + }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}", + queryParameters: [Parameters.apiVersion, Parameters.skipToken], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.configStoreName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "configStoreUpdateParameters", - mapper: { - ...Mappers.ConfigurationStoreUpdateParameters, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const regenerateKeyOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/regenerateKey", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.ConfigurationStore - }, - 201: { - bodyMapper: Mappers.ConfigurationStore + bodyMapper: Mappers.ApiKey }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, + requestBody: Parameters.regenerateKeyParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.configStoreName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ConfigurationStoreListResult }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion, Parameters.skipToken], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ConfigurationStoreListResult }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion, Parameters.skipToken], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; - -const listKeysNextOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - baseUrl: "https://management.azure.com", +const listKeysNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ApiKeyListResult }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion, Parameters.skipToken], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.configStoreName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/appconfiguration/arm-appconfiguration/src/operations/index.ts b/sdk/appconfiguration/arm-appconfiguration/src/operations/index.ts index f578b9c95302..56947745f7da 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/operations/index.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/operations/index.ts @@ -1,14 +1,13 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export * from "./configurationStores"; export * from "./operations"; export * from "./privateEndpointConnections"; export * from "./privateLinkResources"; +export * from "./keyValues"; diff --git a/sdk/appconfiguration/arm-appconfiguration/src/operations/keyValues.ts b/sdk/appconfiguration/arm-appconfiguration/src/operations/keyValues.ts new file mode 100644 index 000000000000..ec57d7308888 --- /dev/null +++ b/sdk/appconfiguration/arm-appconfiguration/src/operations/keyValues.ts @@ -0,0 +1,396 @@ +/* + * 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 { KeyValues } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AppConfigurationManagementClient } from "../appConfigurationManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + KeyValue, + KeyValuesListByConfigurationStoreNextOptionalParams, + KeyValuesListByConfigurationStoreOptionalParams, + KeyValuesListByConfigurationStoreResponse, + KeyValuesGetOptionalParams, + KeyValuesGetResponse, + KeyValuesCreateOrUpdateOptionalParams, + KeyValuesCreateOrUpdateResponse, + KeyValuesDeleteOptionalParams, + KeyValuesListByConfigurationStoreNextResponse +} from "../models"; + +/// +/** Class containing KeyValues operations. */ +export class KeyValuesImpl implements KeyValues { + private readonly client: AppConfigurationManagementClient; + + /** + * Initialize a new instance of the class KeyValues class. + * @param client Reference to the service client + */ + constructor(client: AppConfigurationManagementClient) { + this.client = client; + } + + /** + * Lists the key-values for a given configuration store. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param options The options parameters. + */ + public listByConfigurationStore( + resourceGroupName: string, + configStoreName: string, + options?: KeyValuesListByConfigurationStoreOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByConfigurationStorePagingAll( + resourceGroupName, + configStoreName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByConfigurationStorePagingPage( + resourceGroupName, + configStoreName, + options + ); + } + }; + } + + private async *listByConfigurationStorePagingPage( + resourceGroupName: string, + configStoreName: string, + options?: KeyValuesListByConfigurationStoreOptionalParams + ): AsyncIterableIterator { + let result = await this._listByConfigurationStore( + resourceGroupName, + configStoreName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByConfigurationStoreNext( + resourceGroupName, + configStoreName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByConfigurationStorePagingAll( + resourceGroupName: string, + configStoreName: string, + options?: KeyValuesListByConfigurationStoreOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByConfigurationStorePagingPage( + resourceGroupName, + configStoreName, + options + )) { + yield* page; + } + } + + /** + * Lists the key-values for a given configuration store. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param options The options parameters. + */ + private _listByConfigurationStore( + resourceGroupName: string, + configStoreName: string, + options?: KeyValuesListByConfigurationStoreOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, configStoreName, options }, + listByConfigurationStoreOperationSpec + ); + } + + /** + * Gets the properties of the specified key-value. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ + * character. Label is optional. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + configStoreName: string, + keyValueName: string, + options?: KeyValuesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, configStoreName, keyValueName, options }, + getOperationSpec + ); + } + + /** + * Creates a key-value. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ + * character. Label is optional. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + configStoreName: string, + keyValueName: string, + options?: KeyValuesCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, configStoreName, keyValueName, options }, + createOrUpdateOperationSpec + ); + } + + /** + * Deletes a key-value. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ + * character. Label is optional. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + configStoreName: string, + keyValueName: string, + options?: KeyValuesDeleteOptionalParams + ): 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, configStoreName, keyValueName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Deletes a key-value. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ + * character. Label is optional. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + configStoreName: string, + keyValueName: string, + options?: KeyValuesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + configStoreName, + keyValueName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListByConfigurationStoreNext + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param nextLink The nextLink from the previous successful call to the ListByConfigurationStore + * method. + * @param options The options parameters. + */ + private _listByConfigurationStoreNext( + resourceGroupName: string, + configStoreName: string, + nextLink: string, + options?: KeyValuesListByConfigurationStoreNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, configStoreName, nextLink, options }, + listByConfigurationStoreNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByConfigurationStoreOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.KeyValueListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.skipToken], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.configStoreName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.KeyValue + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.configStoreName, + Parameters.keyValueName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.KeyValue + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.keyValueParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.configStoreName, + Parameters.keyValueName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.configStoreName, + Parameters.keyValueName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByConfigurationStoreNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.KeyValueListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.skipToken], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.configStoreName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/appconfiguration/arm-appconfiguration/src/operations/operations.ts b/sdk/appconfiguration/arm-appconfiguration/src/operations/operations.ts index 725134a5871b..a44919fd4300 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/operations/operations.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/operations/operations.ts @@ -1,185 +1,175 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/operationsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AppConfigurationManagementClientContext } from "../appConfigurationManagementClientContext"; +import { AppConfigurationManagementClient } from "../appConfigurationManagementClient"; +import { + OperationDefinition, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + CheckNameAvailabilityParameters, + OperationsCheckNameAvailabilityOptionalParams, + OperationsCheckNameAvailabilityResponse, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; -/** Class representing a Operations. */ -export class Operations { - private readonly client: AppConfigurationManagementClientContext; +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: AppConfigurationManagementClient; /** - * Create a Operations. - * @param {AppConfigurationManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client */ - constructor(client: AppConfigurationManagementClientContext) { + constructor(client: AppConfigurationManagementClient) { this.client = client; } /** - * Checks whether the configuration store name is available for use. - * @param checkNameAvailabilityParameters The object containing information for the availability - * request. - * @param [options] The optional parameters - * @returns Promise - */ - checkNameAvailability(checkNameAvailabilityParameters: Models.CheckNameAvailabilityParameters, options?: msRest.RequestOptionsBase): Promise; - /** - * @param checkNameAvailabilityParameters The object containing information for the availability - * request. - * @param callback The callback - */ - checkNameAvailability(checkNameAvailabilityParameters: Models.CheckNameAvailabilityParameters, callback: msRest.ServiceCallback): void; - /** - * @param checkNameAvailabilityParameters The object containing information for the availability - * request. - * @param options The optional parameters - * @param callback The callback + * Lists the operations available from this provider. + * @param options The options parameters. */ - checkNameAvailability(checkNameAvailabilityParameters: Models.CheckNameAvailabilityParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - checkNameAvailability(checkNameAvailabilityParameters: Models.CheckNameAvailabilityParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - checkNameAvailabilityParameters, - options + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); }, - checkNameAvailabilityOperationSpec, - callback) as Promise; + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } } /** - * Lists the operations available from this provider. - * @param [options] The optional parameters - * @returns Promise - */ - list(options?: Models.OperationsListOptionalParams): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback + * Checks whether the configuration store name is available for use. + * @param checkNameAvailabilityParameters The object containing information for the availability + * request. + * @param options The options parameters. */ - list(options: Models.OperationsListOptionalParams, callback: msRest.ServiceCallback): void; - list(options?: Models.OperationsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + checkNameAvailability( + checkNameAvailabilityParameters: CheckNameAvailabilityParameters, + options?: OperationsCheckNameAvailabilityOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback) as Promise; + { checkNameAvailabilityParameters, options }, + checkNameAvailabilityOperationSpec + ); } /** * Lists the operations available from this provider. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * @param options The options parameters. */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const checkNameAvailabilityOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/checkNameAvailability", httpMethod: "POST", - path: "subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/checkNameAvailability", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "checkNameAvailabilityParameters", - mapper: { - ...Mappers.CheckNameAvailabilityParameters, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.NameAvailabilityStatus }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, + requestBody: Parameters.checkNameAvailabilityParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listOperationSpec: msRest.OperationSpec = { +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.AppConfiguration/operations", httpMethod: "GET", - path: "providers/Microsoft.AppConfiguration/operations", - queryParameters: [ - Parameters.apiVersion, - Parameters.skipToken - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.OperationDefinitionListResult }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion, Parameters.skipToken], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.OperationDefinitionListResult }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion, Parameters.skipToken], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/appconfiguration/arm-appconfiguration/src/operations/privateEndpointConnections.ts b/sdk/appconfiguration/arm-appconfiguration/src/operations/privateEndpointConnections.ts index 1e14a2cb5512..d8dcac6ed9f0 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/operations/privateEndpointConnections.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/operations/privateEndpointConnections.ts @@ -1,29 +1,43 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/privateEndpointConnectionsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PrivateEndpointConnections } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AppConfigurationManagementClientContext } from "../appConfigurationManagementClientContext"; +import { AppConfigurationManagementClient } from "../appConfigurationManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + PrivateEndpointConnection, + PrivateEndpointConnectionsListByConfigurationStoreNextOptionalParams, + PrivateEndpointConnectionsListByConfigurationStoreOptionalParams, + PrivateEndpointConnectionsListByConfigurationStoreResponse, + PrivateEndpointConnectionsGetOptionalParams, + PrivateEndpointConnectionsGetResponse, + PrivateEndpointConnectionsCreateOrUpdateOptionalParams, + PrivateEndpointConnectionsCreateOrUpdateResponse, + PrivateEndpointConnectionsDeleteOptionalParams, + PrivateEndpointConnectionsListByConfigurationStoreNextResponse +} from "../models"; -/** Class representing a PrivateEndpointConnections. */ -export class PrivateEndpointConnections { - private readonly client: AppConfigurationManagementClientContext; +/// +/** Class containing PrivateEndpointConnections operations. */ +export class PrivateEndpointConnectionsImpl + implements PrivateEndpointConnections { + private readonly client: AppConfigurationManagementClient; /** - * Create a PrivateEndpointConnections. - * @param {AppConfigurationManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class PrivateEndpointConnections class. + * @param client Reference to the service client */ - constructor(client: AppConfigurationManagementClientContext) { + constructor(client: AppConfigurationManagementClient) { this.client = client; } @@ -31,68 +45,189 @@ export class PrivateEndpointConnections { * Lists all private endpoint connections for a configuration store. * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByConfigurationStore(resourceGroupName: string, configStoreName: string, options?: msRest.RequestOptionsBase): Promise; + public listByConfigurationStore( + resourceGroupName: string, + configStoreName: string, + options?: PrivateEndpointConnectionsListByConfigurationStoreOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByConfigurationStorePagingAll( + resourceGroupName, + configStoreName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByConfigurationStorePagingPage( + resourceGroupName, + configStoreName, + options + ); + } + }; + } + + private async *listByConfigurationStorePagingPage( + resourceGroupName: string, + configStoreName: string, + options?: PrivateEndpointConnectionsListByConfigurationStoreOptionalParams + ): AsyncIterableIterator { + let result = await this._listByConfigurationStore( + resourceGroupName, + configStoreName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByConfigurationStoreNext( + resourceGroupName, + configStoreName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByConfigurationStorePagingAll( + resourceGroupName: string, + configStoreName: string, + options?: PrivateEndpointConnectionsListByConfigurationStoreOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByConfigurationStorePagingPage( + resourceGroupName, + configStoreName, + options + )) { + yield* page; + } + } + /** + * Lists all private endpoint connections for a configuration store. * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. - * @param callback The callback + * @param options The options parameters. */ - listByConfigurationStore(resourceGroupName: string, configStoreName: string, callback: msRest.ServiceCallback): void; + private _listByConfigurationStore( + resourceGroupName: string, + configStoreName: string, + options?: PrivateEndpointConnectionsListByConfigurationStoreOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, configStoreName, options }, + listByConfigurationStoreOperationSpec + ); + } + /** + * Gets the specified private endpoint connection associated with the configuration store. * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. - * @param options The optional parameters - * @param callback The callback + * @param privateEndpointConnectionName Private endpoint connection name + * @param options The options parameters. */ - listByConfigurationStore(resourceGroupName: string, configStoreName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByConfigurationStore(resourceGroupName: string, configStoreName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + configStoreName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, configStoreName, + privateEndpointConnectionName, options }, - listByConfigurationStoreOperationSpec, - callback) as Promise; + getOperationSpec + ); } /** - * Gets the specified private endpoint connection associated with the configuration store. - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param configStoreName The name of the configuration store. - * @param privateEndpointConnectionName Private endpoint connection name - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, configStoreName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param configStoreName The name of the configuration store. - * @param privateEndpointConnectionName Private endpoint connection name - * @param callback The callback - */ - get(resourceGroupName: string, configStoreName: string, privateEndpointConnectionName: string, callback: msRest.ServiceCallback): void; - /** + * Update the state of the specified private endpoint connection associated with the configuration + * store. * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name - * @param options The optional parameters - * @param callback The callback + * @param privateEndpointConnection The private endpoint connection properties. + * @param options The options parameters. */ - get(resourceGroupName: string, configStoreName: string, privateEndpointConnectionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, configStoreName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + async beginCreateOrUpdate( + resourceGroupName: string, + configStoreName: string, + privateEndpointConnectionName: string, + privateEndpointConnection: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PrivateEndpointConnectionsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { resourceGroupName, configStoreName, privateEndpointConnectionName, + privateEndpointConnection, options }, - getOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** @@ -102,12 +237,23 @@ export class PrivateEndpointConnections { * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name * @param privateEndpointConnection The private endpoint connection properties. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, configStoreName: string, privateEndpointConnectionName: string, privateEndpointConnection: Models.PrivateEndpointConnection, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(resourceGroupName,configStoreName,privateEndpointConnectionName,privateEndpointConnection,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + configStoreName: string, + privateEndpointConnectionName: string, + privateEndpointConnection: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + configStoreName, + privateEndpointConnectionName, + privateEndpointConnection, + options + ); + return poller.pollUntilDone(); } /** @@ -115,35 +261,67 @@ export class PrivateEndpointConnections { * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, configStoreName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(resourceGroupName,configStoreName,privateEndpointConnectionName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } + async beginDelete( + resourceGroupName: string, + configStoreName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; - /** - * Update the state of the specified private endpoint connection associated with the configuration - * store. - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param configStoreName The name of the configuration store. - * @param privateEndpointConnectionName Private endpoint connection name - * @param privateEndpointConnection The private endpoint connection properties. - * @param [options] The optional parameters - * @returns Promise - */ - beginCreateOrUpdate(resourceGroupName: string, configStoreName: string, privateEndpointConnectionName: string, privateEndpointConnection: Models.PrivateEndpointConnection, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + const lro = new LroImpl( + sendOperation, { resourceGroupName, configStoreName, privateEndpointConnectionName, - privateEndpointConnection, options }, - beginCreateOrUpdateOperationSpec, - options); + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** @@ -151,125 +329,95 @@ export class PrivateEndpointConnections { * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(resourceGroupName: string, configStoreName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - configStoreName, - privateEndpointConnectionName, - options - }, - beginDeleteMethodOperationSpec, - options); + async beginDeleteAndWait( + resourceGroupName: string, + configStoreName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + configStoreName, + privateEndpointConnectionName, + options + ); + return poller.pollUntilDone(); } /** - * Lists all private endpoint connections for a configuration store. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByConfigurationStoreNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByConfigurationStoreNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListByConfigurationStoreNext + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param nextLink The nextLink from the previous successful call to the ListByConfigurationStore + * method. + * @param options The options parameters. */ - listByConfigurationStoreNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByConfigurationStoreNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByConfigurationStoreNext( + resourceGroupName: string, + configStoreName: string, + nextLink: string, + options?: PrivateEndpointConnectionsListByConfigurationStoreNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByConfigurationStoreNextOperationSpec, - callback) as Promise; + { resourceGroupName, configStoreName, nextLink, options }, + listByConfigurationStoreNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByConfigurationStoreOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByConfigurationStoreOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.configStoreName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.PrivateEndpointConnectionListResult }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.configStoreName, - Parameters.privateEndpointConnectionName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.configStoreName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.PrivateEndpointConnection }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.configStoreName, Parameters.privateEndpointConnectionName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "privateEndpointConnection", - mapper: { - ...Mappers.PrivateEndpointConnection, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.PrivateEndpointConnection @@ -277,56 +425,72 @@ const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { 201: { bodyMapper: Mappers.PrivateEndpointConnection }, + 202: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + 204: { + bodyMapper: Mappers.PrivateEndpointConnection + }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}", + requestBody: Parameters.privateEndpointConnection, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.configStoreName, Parameters.privateEndpointConnectionName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "DELETE", responses: { 200: {}, + 201: {}, 202: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.configStoreName, + Parameters.privateEndpointConnectionName + ], + headerParameters: [Parameters.accept], serializer }; - -const listByConfigurationStoreNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByConfigurationStoreNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.PrivateEndpointConnectionListResult }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.configStoreName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/appconfiguration/arm-appconfiguration/src/operations/privateLinkResources.ts b/sdk/appconfiguration/arm-appconfiguration/src/operations/privateLinkResources.ts index 190cce104e87..4357ff59789e 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/operations/privateLinkResources.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/operations/privateLinkResources.ts @@ -1,28 +1,37 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/privateLinkResourcesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PrivateLinkResources } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AppConfigurationManagementClientContext } from "../appConfigurationManagementClientContext"; +import { AppConfigurationManagementClient } from "../appConfigurationManagementClient"; +import { + PrivateLinkResource, + PrivateLinkResourcesListByConfigurationStoreNextOptionalParams, + PrivateLinkResourcesListByConfigurationStoreOptionalParams, + PrivateLinkResourcesListByConfigurationStoreResponse, + PrivateLinkResourcesGetOptionalParams, + PrivateLinkResourcesGetResponse, + PrivateLinkResourcesListByConfigurationStoreNextResponse +} from "../models"; -/** Class representing a PrivateLinkResources. */ -export class PrivateLinkResources { - private readonly client: AppConfigurationManagementClientContext; +/// +/** Class containing PrivateLinkResources operations. */ +export class PrivateLinkResourcesImpl implements PrivateLinkResources { + private readonly client: AppConfigurationManagementClient; /** - * Create a PrivateLinkResources. - * @param {AppConfigurationManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class PrivateLinkResources class. + * @param client Reference to the service client */ - constructor(client: AppConfigurationManagementClientContext) { + constructor(client: AppConfigurationManagementClient) { this.client = client; } @@ -30,169 +39,196 @@ export class PrivateLinkResources { * Gets the private link resources that need to be created for a configuration store. * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByConfigurationStore(resourceGroupName: string, configStoreName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param configStoreName The name of the configuration store. - * @param callback The callback - */ - listByConfigurationStore(resourceGroupName: string, configStoreName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param configStoreName The name of the configuration store. - * @param options The optional parameters - * @param callback The callback - */ - listByConfigurationStore(resourceGroupName: string, configStoreName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByConfigurationStore(resourceGroupName: string, configStoreName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listByConfigurationStore( + resourceGroupName: string, + configStoreName: string, + options?: PrivateLinkResourcesListByConfigurationStoreOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByConfigurationStorePagingAll( + resourceGroupName, + configStoreName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByConfigurationStorePagingPage( + resourceGroupName, + configStoreName, + options + ); + } + }; + } + + private async *listByConfigurationStorePagingPage( + resourceGroupName: string, + configStoreName: string, + options?: PrivateLinkResourcesListByConfigurationStoreOptionalParams + ): AsyncIterableIterator { + let result = await this._listByConfigurationStore( + resourceGroupName, + configStoreName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByConfigurationStoreNext( resourceGroupName, configStoreName, + continuationToken, options - }, - listByConfigurationStoreOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByConfigurationStorePagingAll( + resourceGroupName: string, + configStoreName: string, + options?: PrivateLinkResourcesListByConfigurationStoreOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByConfigurationStorePagingPage( + resourceGroupName, + configStoreName, + options + )) { + yield* page; + } } /** - * Gets a private link resource that need to be created for a configuration store. - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param configStoreName The name of the configuration store. - * @param groupName The name of the private link resource group. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, configStoreName: string, groupName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * Gets the private link resources that need to be created for a configuration store. * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. - * @param groupName The name of the private link resource group. - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, configStoreName: string, groupName: string, callback: msRest.ServiceCallback): void; + private _listByConfigurationStore( + resourceGroupName: string, + configStoreName: string, + options?: PrivateLinkResourcesListByConfigurationStoreOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, configStoreName, options }, + listByConfigurationStoreOperationSpec + ); + } + /** + * Gets a private link resource that need to be created for a configuration store. * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param groupName The name of the private link resource group. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, configStoreName: string, groupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, configStoreName: string, groupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + configStoreName: string, + groupName: string, + options?: PrivateLinkResourcesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - configStoreName, - groupName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, configStoreName, groupName, options }, + getOperationSpec + ); } /** - * Gets the private link resources that need to be created for a configuration store. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByConfigurationStoreNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByConfigurationStoreNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListByConfigurationStoreNext + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param nextLink The nextLink from the previous successful call to the ListByConfigurationStore + * method. + * @param options The options parameters. */ - listByConfigurationStoreNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByConfigurationStoreNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByConfigurationStoreNext( + resourceGroupName: string, + configStoreName: string, + nextLink: string, + options?: PrivateLinkResourcesListByConfigurationStoreNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByConfigurationStoreNextOperationSpec, - callback) as Promise; + { resourceGroupName, configStoreName, nextLink, options }, + listByConfigurationStoreNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByConfigurationStoreOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByConfigurationStoreOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateLinkResources", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateLinkResources", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.configStoreName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.PrivateLinkResourceListResult }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateLinkResources/{groupName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.configStoreName, - Parameters.groupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.configStoreName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateLinkResources/{groupName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.PrivateLinkResource }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.configStoreName, + Parameters.groupName + ], + headerParameters: [Parameters.accept], serializer }; - -const listByConfigurationStoreNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByConfigurationStoreNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.PrivateLinkResourceListResult }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.configStoreName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/appconfiguration/arm-appconfiguration/src/operationsInterfaces/configurationStores.ts b/sdk/appconfiguration/arm-appconfiguration/src/operationsInterfaces/configurationStores.ts new file mode 100644 index 000000000000..cf46c2643e61 --- /dev/null +++ b/sdk/appconfiguration/arm-appconfiguration/src/operationsInterfaces/configurationStores.ts @@ -0,0 +1,168 @@ +/* + * 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 { + ConfigurationStore, + ConfigurationStoresListOptionalParams, + ConfigurationStoresListByResourceGroupOptionalParams, + ApiKey, + ConfigurationStoresListKeysOptionalParams, + ConfigurationStoresGetOptionalParams, + ConfigurationStoresGetResponse, + ConfigurationStoresCreateOptionalParams, + ConfigurationStoresCreateResponse, + ConfigurationStoresDeleteOptionalParams, + ConfigurationStoreUpdateParameters, + ConfigurationStoresUpdateOptionalParams, + ConfigurationStoresUpdateResponse, + RegenerateKeyParameters, + ConfigurationStoresRegenerateKeyOptionalParams, + ConfigurationStoresRegenerateKeyResponse +} from "../models"; + +/// +/** Interface representing a ConfigurationStores. */ +export interface ConfigurationStores { + /** + * Lists the configuration stores for a given subscription. + * @param options The options parameters. + */ + list( + options?: ConfigurationStoresListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists the configuration stores for a given resource group. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: ConfigurationStoresListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists the access key for the specified configuration store. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param options The options parameters. + */ + listKeys( + resourceGroupName: string, + configStoreName: string, + options?: ConfigurationStoresListKeysOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the properties of the specified configuration store. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + configStoreName: string, + options?: ConfigurationStoresGetOptionalParams + ): Promise; + /** + * Creates a configuration store with the specified parameters. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param configStoreCreationParameters The parameters for creating a configuration store. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + configStoreName: string, + configStoreCreationParameters: ConfigurationStore, + options?: ConfigurationStoresCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ConfigurationStoresCreateResponse + > + >; + /** + * Creates a configuration store with the specified parameters. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param configStoreCreationParameters The parameters for creating a configuration store. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + configStoreName: string, + configStoreCreationParameters: ConfigurationStore, + options?: ConfigurationStoresCreateOptionalParams + ): Promise; + /** + * Deletes a configuration store. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + configStoreName: string, + options?: ConfigurationStoresDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a configuration store. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + configStoreName: string, + options?: ConfigurationStoresDeleteOptionalParams + ): Promise; + /** + * Updates a configuration store with the specified parameters. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param configStoreUpdateParameters The parameters for updating a configuration store. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + configStoreName: string, + configStoreUpdateParameters: ConfigurationStoreUpdateParameters, + options?: ConfigurationStoresUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ConfigurationStoresUpdateResponse + > + >; + /** + * Updates a configuration store with the specified parameters. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param configStoreUpdateParameters The parameters for updating a configuration store. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + configStoreName: string, + configStoreUpdateParameters: ConfigurationStoreUpdateParameters, + options?: ConfigurationStoresUpdateOptionalParams + ): Promise; + /** + * Regenerates an access key for the specified configuration store. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param regenerateKeyParameters The parameters for regenerating an access key. + * @param options The options parameters. + */ + regenerateKey( + resourceGroupName: string, + configStoreName: string, + regenerateKeyParameters: RegenerateKeyParameters, + options?: ConfigurationStoresRegenerateKeyOptionalParams + ): Promise; +} diff --git a/sdk/appconfiguration/arm-appconfiguration/src/operationsInterfaces/index.ts b/sdk/appconfiguration/arm-appconfiguration/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..56947745f7da --- /dev/null +++ b/sdk/appconfiguration/arm-appconfiguration/src/operationsInterfaces/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./configurationStores"; +export * from "./operations"; +export * from "./privateEndpointConnections"; +export * from "./privateLinkResources"; +export * from "./keyValues"; diff --git a/sdk/appconfiguration/arm-appconfiguration/src/operationsInterfaces/keyValues.ts b/sdk/appconfiguration/arm-appconfiguration/src/operationsInterfaces/keyValues.ts new file mode 100644 index 000000000000..7d07b5f91321 --- /dev/null +++ b/sdk/appconfiguration/arm-appconfiguration/src/operationsInterfaces/keyValues.ts @@ -0,0 +1,91 @@ +/* + * 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 { + KeyValue, + KeyValuesListByConfigurationStoreOptionalParams, + KeyValuesGetOptionalParams, + KeyValuesGetResponse, + KeyValuesCreateOrUpdateOptionalParams, + KeyValuesCreateOrUpdateResponse, + KeyValuesDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a KeyValues. */ +export interface KeyValues { + /** + * Lists the key-values for a given configuration store. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param options The options parameters. + */ + listByConfigurationStore( + resourceGroupName: string, + configStoreName: string, + options?: KeyValuesListByConfigurationStoreOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the properties of the specified key-value. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ + * character. Label is optional. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + configStoreName: string, + keyValueName: string, + options?: KeyValuesGetOptionalParams + ): Promise; + /** + * Creates a key-value. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ + * character. Label is optional. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + configStoreName: string, + keyValueName: string, + options?: KeyValuesCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes a key-value. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ + * character. Label is optional. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + configStoreName: string, + keyValueName: string, + options?: KeyValuesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a key-value. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ + * character. Label is optional. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + configStoreName: string, + keyValueName: string, + options?: KeyValuesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/appconfiguration/arm-appconfiguration/src/operationsInterfaces/operations.ts b/sdk/appconfiguration/arm-appconfiguration/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..b40e214aff49 --- /dev/null +++ b/sdk/appconfiguration/arm-appconfiguration/src/operationsInterfaces/operations.ts @@ -0,0 +1,38 @@ +/* + * 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 { + OperationDefinition, + OperationsListOptionalParams, + CheckNameAvailabilityParameters, + OperationsCheckNameAvailabilityOptionalParams, + OperationsCheckNameAvailabilityResponse +} from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * Lists the operations available from this provider. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Checks whether the configuration store name is available for use. + * @param checkNameAvailabilityParameters The object containing information for the availability + * request. + * @param options The options parameters. + */ + checkNameAvailability( + checkNameAvailabilityParameters: CheckNameAvailabilityParameters, + options?: OperationsCheckNameAvailabilityOptionalParams + ): Promise; +} diff --git a/sdk/appconfiguration/arm-appconfiguration/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/appconfiguration/arm-appconfiguration/src/operationsInterfaces/privateEndpointConnections.ts new file mode 100644 index 000000000000..a2a73234e51a --- /dev/null +++ b/sdk/appconfiguration/arm-appconfiguration/src/operationsInterfaces/privateEndpointConnections.ts @@ -0,0 +1,111 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + PrivateEndpointConnection, + PrivateEndpointConnectionsListByConfigurationStoreOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, + PrivateEndpointConnectionsGetResponse, + PrivateEndpointConnectionsCreateOrUpdateOptionalParams, + PrivateEndpointConnectionsCreateOrUpdateResponse, + PrivateEndpointConnectionsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a PrivateEndpointConnections. */ +export interface PrivateEndpointConnections { + /** + * Lists all private endpoint connections for a configuration store. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param options The options parameters. + */ + listByConfigurationStore( + resourceGroupName: string, + configStoreName: string, + options?: PrivateEndpointConnectionsListByConfigurationStoreOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the specified private endpoint connection associated with the configuration store. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param privateEndpointConnectionName Private endpoint connection name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + configStoreName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams + ): Promise; + /** + * Update the state of the specified private endpoint connection associated with the configuration + * store. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param privateEndpointConnectionName Private endpoint connection name + * @param privateEndpointConnection The private endpoint connection properties. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + configStoreName: string, + privateEndpointConnectionName: string, + privateEndpointConnection: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PrivateEndpointConnectionsCreateOrUpdateResponse + > + >; + /** + * Update the state of the specified private endpoint connection associated with the configuration + * store. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param privateEndpointConnectionName Private endpoint connection name + * @param privateEndpointConnection The private endpoint connection properties. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + configStoreName: string, + privateEndpointConnectionName: string, + privateEndpointConnection: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes a private endpoint connection. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param privateEndpointConnectionName Private endpoint connection name + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + configStoreName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a private endpoint connection. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param privateEndpointConnectionName Private endpoint connection name + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + configStoreName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/appconfiguration/arm-appconfiguration/src/operationsInterfaces/privateLinkResources.ts b/sdk/appconfiguration/arm-appconfiguration/src/operationsInterfaces/privateLinkResources.ts new file mode 100644 index 000000000000..c9c528826c87 --- /dev/null +++ b/sdk/appconfiguration/arm-appconfiguration/src/operationsInterfaces/privateLinkResources.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + PrivateLinkResource, + PrivateLinkResourcesListByConfigurationStoreOptionalParams, + PrivateLinkResourcesGetOptionalParams, + PrivateLinkResourcesGetResponse +} from "../models"; + +/// +/** Interface representing a PrivateLinkResources. */ +export interface PrivateLinkResources { + /** + * Gets the private link resources that need to be created for a configuration store. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param options The options parameters. + */ + listByConfigurationStore( + resourceGroupName: string, + configStoreName: string, + options?: PrivateLinkResourcesListByConfigurationStoreOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a private link resource that need to be created for a configuration store. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param groupName The name of the private link resource group. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + configStoreName: string, + groupName: string, + options?: PrivateLinkResourcesGetOptionalParams + ): Promise; +} diff --git a/sdk/appconfiguration/arm-appconfiguration/test/sampleTest.ts b/sdk/appconfiguration/arm-appconfiguration/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/appconfiguration/arm-appconfiguration/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/appconfiguration/arm-appconfiguration/tsconfig.json b/sdk/appconfiguration/arm-appconfiguration/tsconfig.json index 422b584abd5e..6e3251194117 100644 --- a/sdk/appconfiguration/arm-appconfiguration/tsconfig.json +++ b/sdk/appconfiguration/arm-appconfiguration/tsconfig.json @@ -3,7 +3,7 @@ "module": "es6", "moduleResolution": "node", "strict": true, - "target": "es5", + "target": "es6", "sourceMap": true, "declarationMap": true, "esModuleInterop": true, @@ -11,9 +11,9 @@ "forceConsistentCasingInFileNames": true, "lib": ["es6", "dom"], "declaration": true, - "outDir": "./esm", + "outDir": "./dist-esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], + "include": ["./src/**/*.ts", "./test/**/*.ts"], "exclude": ["node_modules"] } diff --git a/sdk/appconfiguration/ci.yml b/sdk/appconfiguration/ci.yml index 78672bcbe0a1..81f8ecf2a299 100644 --- a/sdk/appconfiguration/ci.yml +++ b/sdk/appconfiguration/ci.yml @@ -1,5 +1,3 @@ -# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - trigger: branches: include: @@ -9,7 +7,6 @@ trigger: paths: include: - sdk/appconfiguration/ - pr: branches: include: @@ -17,10 +14,11 @@ pr: - feature/* - release/* - hotfix/* + exclude: + - feature/v4 paths: include: - sdk/appconfiguration/ - extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: @@ -28,3 +26,5 @@ extends: Artifacts: - name: azure-app-configuration safeName: azureappconfiguration + - name: azure-arm-appconfiguration + safeName: azurearmappconfiguration