diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 402c2f25fdde..5bdef03c39c6 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -11,6 +11,7 @@ dependencies: '@rush-temp/arm-links': file:projects/arm-links.tgz '@rush-temp/arm-locks': file:projects/arm-locks.tgz '@rush-temp/arm-policy': file:projects/arm-policy.tgz + '@rush-temp/arm-resources': file:projects/arm-resources.tgz '@rush-temp/attestation': file:projects/attestation.tgz '@rush-temp/communication-chat': file:projects/communication-chat.tgz '@rush-temp/communication-common': file:projects/communication-common.tgz @@ -8570,6 +8571,26 @@ packages: integrity: sha512-1cDd7l+RfNr7rAJxGMqLHW/zYV/F5tRFsA1R6RplSOTGg8yo1foORk8QvIa+oumecW/uYGC/jePfHrx55atGMQ== tarball: file:projects/arm-policy.tgz version: 0.0.0 + file:projects/arm-resources.tgz: + dependencies: + '@microsoft/api-extractor': 7.7.11 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 + mkdirp: 1.0.4 + rollup: 1.32.1 + rollup-plugin-node-resolve: 3.4.0 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + tslib: 2.3.0 + typescript: 4.2.4 + uglify-js: 3.13.10 + dev: false + name: '@rush-temp/arm-resources' + resolution: + integrity: sha512-2hxU6L3DjE0C5J0qM4e9m5U+rsuzripArOYgDhM2gb37GbOXnsjf8PlCvyWBOpLZ+3MuvgMPRC22UfVjwNl02w== + tarball: file:projects/arm-resources.tgz + version: 0.0.0 file:projects/attestation.tgz: dependencies: '@azure/core-tracing': 1.0.0-preview.12 @@ -12128,6 +12149,7 @@ specifiers: '@rush-temp/arm-links': file:./projects/arm-links.tgz '@rush-temp/arm-locks': file:./projects/arm-locks.tgz '@rush-temp/arm-policy': file:./projects/arm-policy.tgz + '@rush-temp/arm-resources': file:./projects/arm-resources.tgz '@rush-temp/attestation': file:./projects/attestation.tgz '@rush-temp/communication-chat': file:./projects/communication-chat.tgz '@rush-temp/communication-common': file:./projects/communication-common.tgz diff --git a/rush.json b/rush.json index 84742f6dab08..1c5053707a22 100644 --- a/rush.json +++ b/rush.json @@ -794,6 +794,11 @@ "projectFolder": "sdk/remoterendering/mixed-reality-remote-rendering", "versionPolicyName": "client" }, + { + "packageName": "@azure/arm-resources", + "projectFolder": "sdk/resources/arm-resources", + "versionPolicyName": "management" + }, { "packageName": "@azure/arm-links", "projectFolder": "sdk/links/arm-links", diff --git a/sdk/resources/arm-resources/CHANGELOG.md b/sdk/resources/arm-resources/CHANGELOG.md new file mode 100644 index 000000000000..ed0a87984f28 --- /dev/null +++ b/sdk/resources/arm-resources/CHANGELOG.md @@ -0,0 +1,14 @@ +## 30.0.0-beta.1 (2021-07-15) + +This is the first preview for the new version of the `@azure/arm-resources` package that follows the new [guidelines for TypeScript SDKs](https://azure.github.io/azure-sdk/typescript_introduction.html) for Azure services. + +While this package remains auto generated, the SDK generator itself has undergone changes to comply with the above guidelines in order to generate packages that are idiomatic to the JavaScript/TypeScript ecosystem and consistent with other packages for Azure services. For more on this, please see [State of the Azure SDK 2021](https://devblogs.microsoft.com/azure-sdk/state-of-the-azure-sdk-2021/). + +Please note that this version has breaking changes, all of which were made after careful consideration during the authoring of the guidelines and user studies. + +**Noteworthy changes and features** +- Authentication: The packages `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` are no longer supported. Use package [@azure/identity](https://www.npmjs.com/package/@azure/identity) instead. Select a credential from Azure Identity examples based on the authentication method of your choice. +- Callbacks: Method overloads that used callbacks have been removed and the use of promises is encouraged instead. +- List operations now return an iterable result that follows the `PagedAsyncIterableIterator` interface as opposed to the previous model where you had to make a new request using the link to the next page. +- Long running operations i.e. the methods whose names started with `begin` now return a poller object that gives you a better control over the operation. To get the final result like before use the corresponding method that will have the suffix `AndWait`. +- The SDK only supports ECMAScript 2015 (ES6) and beyond, all projects that referenced this SDK should be upgraded to use ES6. diff --git a/sdk/resources/arm-resources/LICENSE.txt b/sdk/resources/arm-resources/LICENSE similarity index 99% rename from sdk/resources/arm-resources/LICENSE.txt rename to sdk/resources/arm-resources/LICENSE index 2d3163745319..ccb63b166732 100644 --- a/sdk/resources/arm-resources/LICENSE.txt +++ b/sdk/resources/arm-resources/LICENSE @@ -18,4 +18,4 @@ 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. +SOFTWARE. \ No newline at end of file diff --git a/sdk/resources/arm-resources/README.md b/sdk/resources/arm-resources/README.md index 54cbc3054cc7..4bafd5b788c3 100644 --- a/sdk/resources/arm-resources/README.md +++ b/sdk/resources/arm-resources/README.md @@ -1,109 +1,91 @@ -## Azure ResourceManagementClient SDK for JavaScript +# Azure ResourceManagement client library for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for ResourceManagementClient. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure ResourceManagement client. + +Provides operations for working with resources and resource groups. + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/resources/arm-resources) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-resources) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-resources) | +[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-resources` package -To use this SDK in your project, you will need to install two packages. -- `@azure/arm-resources` that contains the client. -- `@azure/identity` that provides different mechanisms for the client to authenticate your requests using Azure Active Directory. +Install the Azure ResourceManagement client library for JavaScript with `npm`: -Install both packages using the below command: ```bash -npm install --save @azure/arm-resources @azure/identity +npm install @azure/arm-resources ``` -> **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 `ResourceManagementClient` -### How to use +To create a client object to access the Azure ResourceManagement API, you will need the `endpoint` of your Azure ResourceManagement resource and a `credential`. The Azure ResourceManagement client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure ResourceManagement resource in the [Azure Portal][azure_portal]. -- 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. +#### Using an Azure Active Directory Credential -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. +You can authenticate with Azure Active Directory using the [Azure Identity library][azure_identity]. To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: -#### nodejs - Authentication, client creation, and list operations as an example written in JavaScript. +```bash +npm install @azure/identity +``` -##### Sample code +You will also need to register a new AAD application and grant access to Azure ResourceManagement 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`. ```javascript -const { DefaultAzureCredential } = require("@azure/identity"); const { ResourceManagementClient } = require("@azure/arm-resources"); -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 ResourceManagementClient(creds, subscriptionId); - -client.operations.list().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 client = new ResourceManagementClient("", new DefaultAzureCredential()); ``` -#### browser - Authentication, client creation, and list operations 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-resources sample - - - - - - - +## Key concepts + +### ResourceManagementClient + +`ResourceManagementClient` is the primary interface for developers using the Azure ResourceManagement client library. Explore the methods on this client object to understand the different features of the Azure ResourceManagement 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 +import { setLogLevel } from "@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/master/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/master/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%2Fresources%2Farm-resources%2FREADME.png) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/.\sdk\resources\arm-resources\/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/master/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity#defaultazurecredential diff --git a/sdk/resources/arm-resources/_meta.json b/sdk/resources/arm-resources/_meta.json new file mode 100644 index 000000000000..27a262438288 --- /dev/null +++ b/sdk/resources/arm-resources/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "3935b824b74ef0ae98a86068e048a08f19849ad2", + "readme": "specification/resources/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 --typescript-sdks-folder=/Users/zhangqiaoqiao/work/code/azure-sdk-for-js ../azure-rest-api-specs/specification/resources/resource-manager/readme.md --use=@autorest/typescript@6.0.0-beta.7", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "use": "@autorest/typescript@6.0.0-beta.7" +} \ No newline at end of file diff --git a/sdk/resources/arm-resources/api-extractor.json b/sdk/resources/arm-resources/api-extractor.json new file mode 100644 index 000000000000..5fb5b21b56f2 --- /dev/null +++ b/sdk/resources/arm-resources/api-extractor.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./esm/index.d.ts", + "docModel": { "enabled": true }, + "apiReport": { "enabled": true, "reportFolder": "./review" }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./esm/index.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/resources/arm-resources/package.json b/sdk/resources/arm-resources/package.json index 65ef4026fa64..d5580b9e7f12 100644 --- a/sdk/resources/arm-resources/package.json +++ b/sdk/resources/arm-resources/package.json @@ -1,13 +1,20 @@ { "name": "@azure/arm-resources", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "ResourceManagementClient Library with typescript type definitions for node.js and browser.", - "version": "4.2.0", + "description": "A generated SDK for ResourceManagementClient.", + "version": "30.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.0.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.1.1", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" }, "keywords": [ "node", @@ -17,15 +24,21 @@ "isomorphic" ], "license": "MIT", - "main": "./dist/arm-resources.js", - "module": "./esm/resourceManagementClient.js", - "types": "./esm/resourceManagementClient.d.ts", + "main": "./dist/index.js", + "module": "./esm/index.js", + "types": "./esm/index.d.ts", "devDependencies": { - "typescript": "^3.6.0", - "rollup": "^1.18.0", - "rollup-plugin-node-resolve": "^5.2.0", + "@microsoft/api-extractor": "7.7.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "mkdirp": "^1.0.4", + "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", - "uglify-js": "^3.6.0" + "rollup-plugin-node-resolve": "^3.4.0", + "typescript": "~4.2.0", + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources/arm-resources", "repository": { @@ -46,14 +59,40 @@ "esm/**/*.d.ts.map", "src/**/*.ts", "README.md", + "LICENSE", "rollup.config.js", - "tsconfig.json" + "tsconfig.json", + "review/*", + "CHANGELOG.md" ], "scripts": { - "build": "tsc && rollup -c rollup.config.js && npm run minify", - "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-resources.js.map'\" -o ./dist/arm-resources.min.js ./dist/arm-resources.js", - "prepack": "npm install && npm run build" + "build": "tsc && rollup -c rollup.config.js && 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": "mkdirp ./review && api-extractor run --local", + "lint": "echo skipped", + "audit": "echo skipped", + "clean": "echo skipped", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "echo skipped", + "prebuild": "echo skipped", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "echo skipped", + "unit-test:node": "echo skipped", + "unit-test:browser": "echo skipped", + "integration-test:browser": "echo skipped", + "integration-test:node": "echo skipped", + "integration-test": "echo skipped", + "docs": "echo skipped" }, "sideEffects": false, "autoPublish": true -} +} \ No newline at end of file diff --git a/sdk/resources/arm-resources/review/arm-resources.api.md b/sdk/resources/arm-resources/review/arm-resources.api.md new file mode 100644 index 000000000000..a377afeed802 --- /dev/null +++ b/sdk/resources/arm-resources/review/arm-resources.api.md @@ -0,0 +1,1994 @@ +## API Report File for "@azure/arm-resources" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; + +// @public +export interface Alias { + readonly defaultMetadata?: AliasPathMetadata; + defaultPath?: string; + defaultPattern?: AliasPattern; + name?: string; + paths?: AliasPath[]; + type?: AliasType; +} + +// @public +export interface AliasPath { + apiVersions?: string[]; + readonly metadata?: AliasPathMetadata; + path?: string; + pattern?: AliasPattern; +} + +// @public +export type AliasPathAttributes = string; + +// @public (undocumented) +export interface AliasPathMetadata { + readonly attributes?: AliasPathAttributes; + readonly type?: AliasPathTokenType; +} + +// @public +export type AliasPathTokenType = string; + +// @public +export interface AliasPattern { + phrase?: string; + type?: AliasPatternType; + variable?: string; +} + +// @public +export type AliasPatternType = "NotSpecified" | "Extract"; + +// @public +export type AliasType = "NotSpecified" | "PlainText" | "Mask"; + +// @public (undocumented) +export interface ApiProfile { + readonly apiVersion?: string; + readonly profileVersion?: string; +} + +// @public +export interface BasicDependency { + id?: string; + resourceName?: string; + resourceType?: string; +} + +// @public +export type ChangeType = "Create" | "Delete" | "Ignore" | "Deploy" | "NoChange" | "Modify" | "Unsupported"; + +// @public +export interface CloudError { + error?: ErrorResponse; +} + +// @public +export interface DebugSetting { + detailLevel?: string; +} + +// @public +export interface Dependency { + dependsOn?: BasicDependency[]; + id?: string; + resourceName?: string; + resourceType?: string; +} + +// @public +export interface Deployment { + location?: string; + properties: DeploymentProperties; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface DeploymentExportResult { + template?: Record; +} + +// @public +export interface DeploymentExtended { + readonly id?: string; + location?: string; + readonly name?: string; + properties?: DeploymentPropertiesExtended; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; +} + +// @public +export interface DeploymentExtendedFilter { + provisioningState?: string; +} + +// @public +export interface DeploymentListResult { + readonly nextLink?: string; + value?: DeploymentExtended[]; +} + +// @public +export type DeploymentMode = "Incremental" | "Complete"; + +// @public +export interface DeploymentOperation { + readonly id?: string; + readonly operationId?: string; + properties?: DeploymentOperationProperties; +} + +// @public +export interface DeploymentOperationProperties { + readonly duration?: string; + readonly provisioningOperation?: ProvisioningOperation; + readonly provisioningState?: string; + readonly request?: HttpMessage; + readonly response?: HttpMessage; + readonly serviceRequestId?: string; + readonly statusCode?: string; + readonly statusMessage?: StatusMessage; + readonly targetResource?: TargetResource; + readonly timestamp?: Date; +} + +// @public +export interface DeploymentOperations { + get(resourceGroupName: string, deploymentName: string, operationId: string, options?: DeploymentOperationsGetOptionalParams): Promise; + getAtManagementGroupScope(groupId: string, deploymentName: string, operationId: string, options?: DeploymentOperationsGetAtManagementGroupScopeOptionalParams): Promise; + getAtScope(scope: string, deploymentName: string, operationId: string, options?: DeploymentOperationsGetAtScopeOptionalParams): Promise; + getAtSubscriptionScope(deploymentName: string, operationId: string, options?: DeploymentOperationsGetAtSubscriptionScopeOptionalParams): Promise; + getAtTenantScope(deploymentName: string, operationId: string, options?: DeploymentOperationsGetAtTenantScopeOptionalParams): Promise; + list(resourceGroupName: string, deploymentName: string, options?: DeploymentOperationsListOptionalParams): PagedAsyncIterableIterator; + listAtManagementGroupScope(groupId: string, deploymentName: string, options?: DeploymentOperationsListAtManagementGroupScopeOptionalParams): PagedAsyncIterableIterator; + listAtManagementGroupScopeNext(groupId: string, deploymentName: string, nextLink: string, options?: DeploymentOperationsListAtManagementGroupScopeNextOptionalParams): PagedAsyncIterableIterator; + listAtScope(scope: string, deploymentName: string, options?: DeploymentOperationsListAtScopeOptionalParams): PagedAsyncIterableIterator; + listAtScopeNext(scope: string, deploymentName: string, nextLink: string, options?: DeploymentOperationsListAtScopeNextOptionalParams): PagedAsyncIterableIterator; + listAtSubscriptionScope(deploymentName: string, options?: DeploymentOperationsListAtSubscriptionScopeOptionalParams): PagedAsyncIterableIterator; + listAtSubscriptionScopeNext(deploymentName: string, nextLink: string, options?: DeploymentOperationsListAtSubscriptionScopeNextOptionalParams): PagedAsyncIterableIterator; + listAtTenantScope(deploymentName: string, options?: DeploymentOperationsListAtTenantScopeOptionalParams): PagedAsyncIterableIterator; + listAtTenantScopeNext(deploymentName: string, nextLink: string, options?: DeploymentOperationsListAtTenantScopeNextOptionalParams): PagedAsyncIterableIterator; + listNext(resourceGroupName: string, deploymentName: string, nextLink: string, options?: DeploymentOperationsListNextOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface DeploymentOperationsGetAtManagementGroupScopeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeploymentOperationsGetAtManagementGroupScopeResponse = DeploymentOperation; + +// @public +export interface DeploymentOperationsGetAtScopeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeploymentOperationsGetAtScopeResponse = DeploymentOperation; + +// @public +export interface DeploymentOperationsGetAtSubscriptionScopeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeploymentOperationsGetAtSubscriptionScopeResponse = DeploymentOperation; + +// @public +export interface DeploymentOperationsGetAtTenantScopeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeploymentOperationsGetAtTenantScopeResponse = DeploymentOperation; + +// @public +export interface DeploymentOperationsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeploymentOperationsGetResponse = DeploymentOperation; + +// @public +export interface DeploymentOperationsListAtManagementGroupScopeNextNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type DeploymentOperationsListAtManagementGroupScopeNextNextResponse = DeploymentOperationsListResult; + +// @public +export interface DeploymentOperationsListAtManagementGroupScopeNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type DeploymentOperationsListAtManagementGroupScopeNextResponse = DeploymentOperationsListResult; + +// @public +export interface DeploymentOperationsListAtManagementGroupScopeOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type DeploymentOperationsListAtManagementGroupScopeResponse = DeploymentOperationsListResult; + +// @public +export interface DeploymentOperationsListAtScopeNextNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type DeploymentOperationsListAtScopeNextNextResponse = DeploymentOperationsListResult; + +// @public +export interface DeploymentOperationsListAtScopeNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type DeploymentOperationsListAtScopeNextResponse = DeploymentOperationsListResult; + +// @public +export interface DeploymentOperationsListAtScopeOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type DeploymentOperationsListAtScopeResponse = DeploymentOperationsListResult; + +// @public +export interface DeploymentOperationsListAtSubscriptionScopeNextNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type DeploymentOperationsListAtSubscriptionScopeNextNextResponse = DeploymentOperationsListResult; + +// @public +export interface DeploymentOperationsListAtSubscriptionScopeNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type DeploymentOperationsListAtSubscriptionScopeNextResponse = DeploymentOperationsListResult; + +// @public +export interface DeploymentOperationsListAtSubscriptionScopeOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type DeploymentOperationsListAtSubscriptionScopeResponse = DeploymentOperationsListResult; + +// @public +export interface DeploymentOperationsListAtTenantScopeNextNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type DeploymentOperationsListAtTenantScopeNextNextResponse = DeploymentOperationsListResult; + +// @public +export interface DeploymentOperationsListAtTenantScopeNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type DeploymentOperationsListAtTenantScopeNextResponse = DeploymentOperationsListResult; + +// @public +export interface DeploymentOperationsListAtTenantScopeOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type DeploymentOperationsListAtTenantScopeResponse = DeploymentOperationsListResult; + +// @public +export interface DeploymentOperationsListNextNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type DeploymentOperationsListNextNextResponse = DeploymentOperationsListResult; + +// @public +export interface DeploymentOperationsListNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type DeploymentOperationsListNextResponse = DeploymentOperationsListResult; + +// @public +export interface DeploymentOperationsListOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type DeploymentOperationsListResponse = DeploymentOperationsListResult; + +// @public +export interface DeploymentOperationsListResult { + readonly nextLink?: string; + value?: DeploymentOperation[]; +} + +// @public +export interface DeploymentProperties { + debugSetting?: DebugSetting; + expressionEvaluationOptions?: ExpressionEvaluationOptions; + mode: DeploymentMode; + onErrorDeployment?: OnErrorDeployment; + parameters?: Record; + parametersLink?: ParametersLink; + template?: Record; + templateLink?: TemplateLink; +} + +// @public +export interface DeploymentPropertiesExtended { + readonly correlationId?: string; + readonly debugSetting?: DebugSetting; + readonly dependencies?: Dependency[]; + readonly duration?: string; + readonly error?: ErrorResponse; + readonly mode?: DeploymentMode; + readonly onErrorDeployment?: OnErrorDeploymentExtended; + readonly outputResources?: ResourceReference[]; + readonly outputs?: Record; + readonly parameters?: Record; + readonly parametersLink?: ParametersLink; + readonly providers?: Provider[]; + readonly provisioningState?: ProvisioningState; + readonly templateHash?: string; + readonly templateLink?: TemplateLink; + readonly timestamp?: Date; + readonly validatedResources?: ResourceReference[]; +} + +// @public +export interface Deployments { + beginCreateOrUpdate(resourceGroupName: string, deploymentName: string, parameters: Deployment, options?: DeploymentsCreateOrUpdateOptionalParams): Promise, DeploymentsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, deploymentName: string, parameters: Deployment, options?: DeploymentsCreateOrUpdateOptionalParams): Promise; + beginCreateOrUpdateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: ScopedDeployment, options?: DeploymentsCreateOrUpdateAtManagementGroupScopeOptionalParams): Promise, DeploymentsCreateOrUpdateAtManagementGroupScopeResponse>>; + beginCreateOrUpdateAtManagementGroupScopeAndWait(groupId: string, deploymentName: string, parameters: ScopedDeployment, options?: DeploymentsCreateOrUpdateAtManagementGroupScopeOptionalParams): Promise; + beginCreateOrUpdateAtScope(scope: string, deploymentName: string, parameters: Deployment, options?: DeploymentsCreateOrUpdateAtScopeOptionalParams): Promise, DeploymentsCreateOrUpdateAtScopeResponse>>; + beginCreateOrUpdateAtScopeAndWait(scope: string, deploymentName: string, parameters: Deployment, options?: DeploymentsCreateOrUpdateAtScopeOptionalParams): Promise; + beginCreateOrUpdateAtSubscriptionScope(deploymentName: string, parameters: Deployment, options?: DeploymentsCreateOrUpdateAtSubscriptionScopeOptionalParams): Promise, DeploymentsCreateOrUpdateAtSubscriptionScopeResponse>>; + beginCreateOrUpdateAtSubscriptionScopeAndWait(deploymentName: string, parameters: Deployment, options?: DeploymentsCreateOrUpdateAtSubscriptionScopeOptionalParams): Promise; + beginCreateOrUpdateAtTenantScope(deploymentName: string, parameters: ScopedDeployment, options?: DeploymentsCreateOrUpdateAtTenantScopeOptionalParams): Promise, DeploymentsCreateOrUpdateAtTenantScopeResponse>>; + beginCreateOrUpdateAtTenantScopeAndWait(deploymentName: string, parameters: ScopedDeployment, options?: DeploymentsCreateOrUpdateAtTenantScopeOptionalParams): Promise; + beginDelete(resourceGroupName: string, deploymentName: string, options?: DeploymentsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, deploymentName: string, options?: DeploymentsDeleteOptionalParams): Promise; + beginDeleteAtManagementGroupScope(groupId: string, deploymentName: string, options?: DeploymentsDeleteAtManagementGroupScopeOptionalParams): Promise, void>>; + beginDeleteAtManagementGroupScopeAndWait(groupId: string, deploymentName: string, options?: DeploymentsDeleteAtManagementGroupScopeOptionalParams): Promise; + beginDeleteAtScope(scope: string, deploymentName: string, options?: DeploymentsDeleteAtScopeOptionalParams): Promise, void>>; + beginDeleteAtScopeAndWait(scope: string, deploymentName: string, options?: DeploymentsDeleteAtScopeOptionalParams): Promise; + beginDeleteAtSubscriptionScope(deploymentName: string, options?: DeploymentsDeleteAtSubscriptionScopeOptionalParams): Promise, void>>; + beginDeleteAtSubscriptionScopeAndWait(deploymentName: string, options?: DeploymentsDeleteAtSubscriptionScopeOptionalParams): Promise; + beginDeleteAtTenantScope(deploymentName: string, options?: DeploymentsDeleteAtTenantScopeOptionalParams): Promise, void>>; + beginDeleteAtTenantScopeAndWait(deploymentName: string, options?: DeploymentsDeleteAtTenantScopeOptionalParams): Promise; + beginValidate(resourceGroupName: string, deploymentName: string, parameters: Deployment, options?: DeploymentsValidateOptionalParams): Promise, DeploymentsValidateResponse>>; + beginValidateAndWait(resourceGroupName: string, deploymentName: string, parameters: Deployment, options?: DeploymentsValidateOptionalParams): Promise; + beginValidateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: ScopedDeployment, options?: DeploymentsValidateAtManagementGroupScopeOptionalParams): Promise, DeploymentsValidateAtManagementGroupScopeResponse>>; + beginValidateAtManagementGroupScopeAndWait(groupId: string, deploymentName: string, parameters: ScopedDeployment, options?: DeploymentsValidateAtManagementGroupScopeOptionalParams): Promise; + beginValidateAtScope(scope: string, deploymentName: string, parameters: Deployment, options?: DeploymentsValidateAtScopeOptionalParams): Promise, DeploymentsValidateAtScopeResponse>>; + beginValidateAtScopeAndWait(scope: string, deploymentName: string, parameters: Deployment, options?: DeploymentsValidateAtScopeOptionalParams): Promise; + beginValidateAtSubscriptionScope(deploymentName: string, parameters: Deployment, options?: DeploymentsValidateAtSubscriptionScopeOptionalParams): Promise, DeploymentsValidateAtSubscriptionScopeResponse>>; + beginValidateAtSubscriptionScopeAndWait(deploymentName: string, parameters: Deployment, options?: DeploymentsValidateAtSubscriptionScopeOptionalParams): Promise; + beginValidateAtTenantScope(deploymentName: string, parameters: ScopedDeployment, options?: DeploymentsValidateAtTenantScopeOptionalParams): Promise, DeploymentsValidateAtTenantScopeResponse>>; + beginValidateAtTenantScopeAndWait(deploymentName: string, parameters: ScopedDeployment, options?: DeploymentsValidateAtTenantScopeOptionalParams): Promise; + beginWhatIf(resourceGroupName: string, deploymentName: string, parameters: DeploymentWhatIf, options?: DeploymentsWhatIfOptionalParams): Promise, DeploymentsWhatIfResponse>>; + beginWhatIfAndWait(resourceGroupName: string, deploymentName: string, parameters: DeploymentWhatIf, options?: DeploymentsWhatIfOptionalParams): Promise; + beginWhatIfAtManagementGroupScope(groupId: string, deploymentName: string, parameters: ScopedDeploymentWhatIf, options?: DeploymentsWhatIfAtManagementGroupScopeOptionalParams): Promise, DeploymentsWhatIfAtManagementGroupScopeResponse>>; + beginWhatIfAtManagementGroupScopeAndWait(groupId: string, deploymentName: string, parameters: ScopedDeploymentWhatIf, options?: DeploymentsWhatIfAtManagementGroupScopeOptionalParams): Promise; + beginWhatIfAtSubscriptionScope(deploymentName: string, parameters: DeploymentWhatIf, options?: DeploymentsWhatIfAtSubscriptionScopeOptionalParams): Promise, DeploymentsWhatIfAtSubscriptionScopeResponse>>; + beginWhatIfAtSubscriptionScopeAndWait(deploymentName: string, parameters: DeploymentWhatIf, options?: DeploymentsWhatIfAtSubscriptionScopeOptionalParams): Promise; + beginWhatIfAtTenantScope(deploymentName: string, parameters: ScopedDeploymentWhatIf, options?: DeploymentsWhatIfAtTenantScopeOptionalParams): Promise, DeploymentsWhatIfAtTenantScopeResponse>>; + beginWhatIfAtTenantScopeAndWait(deploymentName: string, parameters: ScopedDeploymentWhatIf, options?: DeploymentsWhatIfAtTenantScopeOptionalParams): Promise; + calculateTemplateHash(template: Record, options?: DeploymentsCalculateTemplateHashOptionalParams): Promise; + cancel(resourceGroupName: string, deploymentName: string, options?: DeploymentsCancelOptionalParams): Promise; + cancelAtManagementGroupScope(groupId: string, deploymentName: string, options?: DeploymentsCancelAtManagementGroupScopeOptionalParams): Promise; + cancelAtScope(scope: string, deploymentName: string, options?: DeploymentsCancelAtScopeOptionalParams): Promise; + cancelAtSubscriptionScope(deploymentName: string, options?: DeploymentsCancelAtSubscriptionScopeOptionalParams): Promise; + cancelAtTenantScope(deploymentName: string, options?: DeploymentsCancelAtTenantScopeOptionalParams): Promise; + checkExistence(resourceGroupName: string, deploymentName: string, options?: DeploymentsCheckExistenceOptionalParams): Promise; + checkExistenceAtManagementGroupScope(groupId: string, deploymentName: string, options?: DeploymentsCheckExistenceAtManagementGroupScopeOptionalParams): Promise; + checkExistenceAtScope(scope: string, deploymentName: string, options?: DeploymentsCheckExistenceAtScopeOptionalParams): Promise; + checkExistenceAtSubscriptionScope(deploymentName: string, options?: DeploymentsCheckExistenceAtSubscriptionScopeOptionalParams): Promise; + checkExistenceAtTenantScope(deploymentName: string, options?: DeploymentsCheckExistenceAtTenantScopeOptionalParams): Promise; + exportTemplate(resourceGroupName: string, deploymentName: string, options?: DeploymentsExportTemplateOptionalParams): Promise; + exportTemplateAtManagementGroupScope(groupId: string, deploymentName: string, options?: DeploymentsExportTemplateAtManagementGroupScopeOptionalParams): Promise; + exportTemplateAtScope(scope: string, deploymentName: string, options?: DeploymentsExportTemplateAtScopeOptionalParams): Promise; + exportTemplateAtSubscriptionScope(deploymentName: string, options?: DeploymentsExportTemplateAtSubscriptionScopeOptionalParams): Promise; + exportTemplateAtTenantScope(deploymentName: string, options?: DeploymentsExportTemplateAtTenantScopeOptionalParams): Promise; + get(resourceGroupName: string, deploymentName: string, options?: DeploymentsGetOptionalParams): Promise; + getAtManagementGroupScope(groupId: string, deploymentName: string, options?: DeploymentsGetAtManagementGroupScopeOptionalParams): Promise; + getAtScope(scope: string, deploymentName: string, options?: DeploymentsGetAtScopeOptionalParams): Promise; + getAtSubscriptionScope(deploymentName: string, options?: DeploymentsGetAtSubscriptionScopeOptionalParams): Promise; + getAtTenantScope(deploymentName: string, options?: DeploymentsGetAtTenantScopeOptionalParams): Promise; + listAtManagementGroupScope(groupId: string, options?: DeploymentsListAtManagementGroupScopeOptionalParams): PagedAsyncIterableIterator; + listAtManagementGroupScopeNext(groupId: string, nextLink: string, options?: DeploymentsListAtManagementGroupScopeNextOptionalParams): PagedAsyncIterableIterator; + listAtScope(scope: string, options?: DeploymentsListAtScopeOptionalParams): PagedAsyncIterableIterator; + listAtScopeNext(scope: string, nextLink: string, options?: DeploymentsListAtScopeNextOptionalParams): PagedAsyncIterableIterator; + listAtSubscriptionScope(options?: DeploymentsListAtSubscriptionScopeOptionalParams): PagedAsyncIterableIterator; + listAtSubscriptionScopeNext(nextLink: string, options?: DeploymentsListAtSubscriptionScopeNextOptionalParams): PagedAsyncIterableIterator; + listAtTenantScope(options?: DeploymentsListAtTenantScopeOptionalParams): PagedAsyncIterableIterator; + listAtTenantScopeNext(nextLink: string, options?: DeploymentsListAtTenantScopeNextOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: DeploymentsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listByResourceGroupNext(resourceGroupName: string, nextLink: string, options?: DeploymentsListByResourceGroupNextOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface DeploymentsCalculateTemplateHashOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeploymentsCalculateTemplateHashResponse = TemplateHashResult; + +// @public +export interface DeploymentsCancelAtManagementGroupScopeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface DeploymentsCancelAtScopeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface DeploymentsCancelAtSubscriptionScopeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface DeploymentsCancelAtTenantScopeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface DeploymentsCancelOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface DeploymentsCheckExistenceAtManagementGroupScopeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeploymentsCheckExistenceAtManagementGroupScopeResponse = { + body: boolean; +}; + +// @public +export interface DeploymentsCheckExistenceAtScopeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeploymentsCheckExistenceAtScopeResponse = { + body: boolean; +}; + +// @public +export interface DeploymentsCheckExistenceAtSubscriptionScopeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeploymentsCheckExistenceAtSubscriptionScopeResponse = { + body: boolean; +}; + +// @public +export interface DeploymentsCheckExistenceAtTenantScopeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeploymentsCheckExistenceAtTenantScopeResponse = { + body: boolean; +}; + +// @public +export interface DeploymentsCheckExistenceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeploymentsCheckExistenceResponse = { + body: boolean; +}; + +// @public +export interface DeploymentsCreateOrUpdateAtManagementGroupScopeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DeploymentsCreateOrUpdateAtManagementGroupScopeResponse = DeploymentExtended; + +// @public +export interface DeploymentsCreateOrUpdateAtScopeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DeploymentsCreateOrUpdateAtScopeResponse = DeploymentExtended; + +// @public +export interface DeploymentsCreateOrUpdateAtSubscriptionScopeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DeploymentsCreateOrUpdateAtSubscriptionScopeResponse = DeploymentExtended; + +// @public +export interface DeploymentsCreateOrUpdateAtTenantScopeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DeploymentsCreateOrUpdateAtTenantScopeResponse = DeploymentExtended; + +// @public +export interface DeploymentsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DeploymentsCreateOrUpdateResponse = DeploymentExtended; + +// @public +export interface DeploymentsDeleteAtManagementGroupScopeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DeploymentsDeleteAtScopeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DeploymentsDeleteAtSubscriptionScopeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DeploymentsDeleteAtTenantScopeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DeploymentsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DeploymentsExportTemplateAtManagementGroupScopeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeploymentsExportTemplateAtManagementGroupScopeResponse = DeploymentExportResult; + +// @public +export interface DeploymentsExportTemplateAtScopeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeploymentsExportTemplateAtScopeResponse = DeploymentExportResult; + +// @public +export interface DeploymentsExportTemplateAtSubscriptionScopeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeploymentsExportTemplateAtSubscriptionScopeResponse = DeploymentExportResult; + +// @public +export interface DeploymentsExportTemplateAtTenantScopeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeploymentsExportTemplateAtTenantScopeResponse = DeploymentExportResult; + +// @public +export interface DeploymentsExportTemplateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeploymentsExportTemplateResponse = DeploymentExportResult; + +// @public +export interface DeploymentsGetAtManagementGroupScopeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeploymentsGetAtManagementGroupScopeResponse = DeploymentExtended; + +// @public +export interface DeploymentsGetAtScopeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeploymentsGetAtScopeResponse = DeploymentExtended; + +// @public +export interface DeploymentsGetAtSubscriptionScopeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeploymentsGetAtSubscriptionScopeResponse = DeploymentExtended; + +// @public +export interface DeploymentsGetAtTenantScopeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeploymentsGetAtTenantScopeResponse = DeploymentExtended; + +// @public +export interface DeploymentsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeploymentsGetResponse = DeploymentExtended; + +// @public +export interface DeploymentsListAtManagementGroupScopeNextNextOptionalParams extends coreClient.OperationOptions { + filter?: string; + top?: number; +} + +// @public +export type DeploymentsListAtManagementGroupScopeNextNextResponse = DeploymentListResult; + +// @public +export interface DeploymentsListAtManagementGroupScopeNextOptionalParams extends coreClient.OperationOptions { + filter?: string; + top?: number; +} + +// @public +export type DeploymentsListAtManagementGroupScopeNextResponse = DeploymentListResult; + +// @public +export interface DeploymentsListAtManagementGroupScopeOptionalParams extends coreClient.OperationOptions { + filter?: string; + top?: number; +} + +// @public +export type DeploymentsListAtManagementGroupScopeResponse = DeploymentListResult; + +// @public +export interface DeploymentsListAtScopeNextNextOptionalParams extends coreClient.OperationOptions { + filter?: string; + top?: number; +} + +// @public +export type DeploymentsListAtScopeNextNextResponse = DeploymentListResult; + +// @public +export interface DeploymentsListAtScopeNextOptionalParams extends coreClient.OperationOptions { + filter?: string; + top?: number; +} + +// @public +export type DeploymentsListAtScopeNextResponse = DeploymentListResult; + +// @public +export interface DeploymentsListAtScopeOptionalParams extends coreClient.OperationOptions { + filter?: string; + top?: number; +} + +// @public +export type DeploymentsListAtScopeResponse = DeploymentListResult; + +// @public +export interface DeploymentsListAtSubscriptionScopeNextNextOptionalParams extends coreClient.OperationOptions { + filter?: string; + top?: number; +} + +// @public +export type DeploymentsListAtSubscriptionScopeNextNextResponse = DeploymentListResult; + +// @public +export interface DeploymentsListAtSubscriptionScopeNextOptionalParams extends coreClient.OperationOptions { + filter?: string; + top?: number; +} + +// @public +export type DeploymentsListAtSubscriptionScopeNextResponse = DeploymentListResult; + +// @public +export interface DeploymentsListAtSubscriptionScopeOptionalParams extends coreClient.OperationOptions { + filter?: string; + top?: number; +} + +// @public +export type DeploymentsListAtSubscriptionScopeResponse = DeploymentListResult; + +// @public +export interface DeploymentsListAtTenantScopeNextNextOptionalParams extends coreClient.OperationOptions { + filter?: string; + top?: number; +} + +// @public +export type DeploymentsListAtTenantScopeNextNextResponse = DeploymentListResult; + +// @public +export interface DeploymentsListAtTenantScopeNextOptionalParams extends coreClient.OperationOptions { + filter?: string; + top?: number; +} + +// @public +export type DeploymentsListAtTenantScopeNextResponse = DeploymentListResult; + +// @public +export interface DeploymentsListAtTenantScopeOptionalParams extends coreClient.OperationOptions { + filter?: string; + top?: number; +} + +// @public +export type DeploymentsListAtTenantScopeResponse = DeploymentListResult; + +// @public +export interface DeploymentsListByResourceGroupNextNextOptionalParams extends coreClient.OperationOptions { + filter?: string; + top?: number; +} + +// @public +export type DeploymentsListByResourceGroupNextNextResponse = DeploymentListResult; + +// @public +export interface DeploymentsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { + filter?: string; + top?: number; +} + +// @public +export type DeploymentsListByResourceGroupNextResponse = DeploymentListResult; + +// @public +export interface DeploymentsListByResourceGroupOptionalParams extends coreClient.OperationOptions { + filter?: string; + top?: number; +} + +// @public +export type DeploymentsListByResourceGroupResponse = DeploymentListResult; + +// @public +export interface DeploymentsValidateAtManagementGroupScopeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DeploymentsValidateAtManagementGroupScopeResponse = DeploymentValidateResult; + +// @public +export interface DeploymentsValidateAtScopeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DeploymentsValidateAtScopeResponse = DeploymentValidateResult; + +// @public +export interface DeploymentsValidateAtSubscriptionScopeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DeploymentsValidateAtSubscriptionScopeResponse = DeploymentValidateResult; + +// @public +export interface DeploymentsValidateAtTenantScopeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DeploymentsValidateAtTenantScopeResponse = DeploymentValidateResult; + +// @public +export interface DeploymentsValidateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DeploymentsValidateResponse = DeploymentValidateResult; + +// @public +export interface DeploymentsWhatIfAtManagementGroupScopeHeaders { + location?: string; + retryAfter?: string; +} + +// @public +export interface DeploymentsWhatIfAtManagementGroupScopeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DeploymentsWhatIfAtManagementGroupScopeResponse = WhatIfOperationResult; + +// @public +export interface DeploymentsWhatIfAtSubscriptionScopeHeaders { + location?: string; + retryAfter?: string; +} + +// @public +export interface DeploymentsWhatIfAtSubscriptionScopeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DeploymentsWhatIfAtSubscriptionScopeResponse = WhatIfOperationResult; + +// @public +export interface DeploymentsWhatIfAtTenantScopeHeaders { + location?: string; + retryAfter?: string; +} + +// @public +export interface DeploymentsWhatIfAtTenantScopeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DeploymentsWhatIfAtTenantScopeResponse = WhatIfOperationResult; + +// @public +export interface DeploymentsWhatIfHeaders { + location?: string; + retryAfter?: string; +} + +// @public +export interface DeploymentsWhatIfOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DeploymentsWhatIfResponse = WhatIfOperationResult; + +// @public +export interface DeploymentValidateResult { + readonly error?: ErrorResponse; + properties?: DeploymentPropertiesExtended; +} + +// @public +export interface DeploymentWhatIf { + location?: string; + properties: DeploymentWhatIfProperties; +} + +// @public +export type DeploymentWhatIfProperties = DeploymentProperties & { + whatIfSettings?: DeploymentWhatIfSettings; +}; + +// @public +export interface DeploymentWhatIfSettings { + resultFormat?: WhatIfResultFormat; +} + +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + +// @public +export interface ErrorResponse { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorResponse[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ExportTemplateRequest { + options?: string; + resources?: string[]; +} + +// @public +export interface ExpressionEvaluationOptions { + scope?: ExpressionEvaluationOptionsScopeType; +} + +// @public +export type ExpressionEvaluationOptionsScopeType = string; + +// @public +export interface ExtendedLocation { + name?: string; + type?: ExtendedLocationType; +} + +// @public +export type ExtendedLocationType = string; + +// @public +export type GenericResource = Resource & { + plan?: Plan; + properties?: Record; + kind?: string; + managedBy?: string; + sku?: Sku; + identity?: Identity; +}; + +// @public +export type GenericResourceExpanded = GenericResource & { + readonly createdTime?: Date; + readonly changedTime?: Date; + readonly provisioningState?: string; +}; + +// @public +export interface GenericResourceFilter { + resourceType?: string; + tagname?: string; + tagvalue?: string; +} + +// @public +export interface HttpMessage { + content?: Record; +} + +// @public +export interface Identity { + readonly principalId?: string; + readonly tenantId?: string; + type?: ResourceIdentityType; + userAssignedIdentities?: { + [propertyName: string]: IdentityUserAssignedIdentitiesValue; + }; +} + +// @public (undocumented) +export interface IdentityUserAssignedIdentitiesValue { + readonly clientId?: string; + readonly principalId?: string; +} + +// @public +export enum KnownAliasPathAttributes { + Modifiable = "Modifiable", + None = "None" +} + +// @public +export enum KnownAliasPathTokenType { + Any = "Any", + Array = "Array", + Boolean = "Boolean", + Integer = "Integer", + NotSpecified = "NotSpecified", + Number = "Number", + Object = "Object", + String = "String" +} + +// @public +export enum KnownExpressionEvaluationOptionsScopeType { + // (undocumented) + Inner = "Inner", + // (undocumented) + NotSpecified = "NotSpecified", + // (undocumented) + Outer = "Outer" +} + +// @public +export enum KnownExtendedLocationType { + // (undocumented) + EdgeZone = "EdgeZone" +} + +// @public +export enum KnownProviderAuthorizationConsentState { + // (undocumented) + Consented = "Consented", + // (undocumented) + NotRequired = "NotRequired", + // (undocumented) + NotSpecified = "NotSpecified", + // (undocumented) + Required = "Required" +} + +// @public +export enum KnownProvisioningState { + // (undocumented) + Accepted = "Accepted", + // (undocumented) + Canceled = "Canceled", + // (undocumented) + Created = "Created", + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleted = "Deleted", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Failed = "Failed", + // (undocumented) + NotSpecified = "NotSpecified", + // (undocumented) + Ready = "Ready", + // (undocumented) + Running = "Running", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Updating = "Updating" +} + +// @public +export enum KnownTagsPatchOperation { + Delete = "Delete", + Merge = "Merge", + Replace = "Replace" +} + +// @public +export interface OnErrorDeployment { + deploymentName?: string; + type?: OnErrorDeploymentType; +} + +// @public +export interface OnErrorDeploymentExtended { + deploymentName?: string; + readonly provisioningState?: string; + type?: OnErrorDeploymentType; +} + +// @public +export type OnErrorDeploymentType = "LastSuccessful" | "SpecificDeployment"; + +// @public +export interface Operation { + display?: OperationDisplay; + name?: string; +} + +// @public +export interface OperationDisplay { + description?: string; + operation?: string; + provider?: string; + resource?: string; +} + +// @public +export interface OperationListResult { + nextLink?: string; + value?: Operation[]; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; + listNext(nextLink: string, options?: OperationsListNextOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextNextResponse = OperationListResult; + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationListResult; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public +export interface ParametersLink { + contentVersion?: string; + uri: string; +} + +// @public +export interface Permission { + actions?: string[]; + dataActions?: string[]; + notActions?: string[]; + notDataActions?: string[]; +} + +// @public +export interface Plan { + name?: string; + product?: string; + promotionCode?: string; + publisher?: string; + version?: string; +} + +// @public +export type PropertyChangeType = "Create" | "Delete" | "Modify" | "Array" | "NoEffect"; + +// @public +export interface Provider { + readonly id?: string; + namespace?: string; + providerAuthorizationConsentState?: ProviderAuthorizationConsentState; + readonly registrationPolicy?: string; + readonly registrationState?: string; + readonly resourceTypes?: ProviderResourceType[]; +} + +// @public +export type ProviderAuthorizationConsentState = string; + +// @public +export interface ProviderConsentDefinition { + consentToAuthorization?: boolean; +} + +// @public +export interface ProviderExtendedLocation { + extendedLocations?: string[]; + location?: string; + type?: string; +} + +// @public +export interface ProviderListResult { + readonly nextLink?: string; + value?: Provider[]; +} + +// @public +export interface ProviderPermission { + applicationId?: string; + managedByRoleDefinition?: RoleDefinition; + providerAuthorizationConsentState?: ProviderAuthorizationConsentState; + roleDefinition?: RoleDefinition; +} + +// @public +export interface ProviderPermissionListResult { + readonly nextLink?: string; + value?: ProviderPermission[]; +} + +// @public +export interface ProviderRegistrationRequest { + thirdPartyProviderConsent?: ProviderConsentDefinition; +} + +// @public +export interface ProviderResourceType { + aliases?: Alias[]; + readonly apiProfiles?: ApiProfile[]; + apiVersions?: string[]; + capabilities?: string; + readonly defaultApiVersion?: string; + locationMappings?: ProviderExtendedLocation[]; + locations?: string[]; + properties?: { + [propertyName: string]: string; + }; + resourceType?: string; +} + +// @public +export interface ProviderResourceTypeListResult { + readonly nextLink?: string; + value?: ProviderResourceType[]; +} + +// @public +export interface ProviderResourceTypes { + list(resourceProviderNamespace: string, options?: ProviderResourceTypesListOptionalParams): Promise; +} + +// @public +export interface ProviderResourceTypesListOptionalParams extends coreClient.OperationOptions { + expand?: string; +} + +// @public +export type ProviderResourceTypesListResponse = ProviderResourceTypeListResult; + +// @public +export interface Providers { + get(resourceProviderNamespace: string, options?: ProvidersGetOptionalParams): Promise; + getAtTenantScope(resourceProviderNamespace: string, options?: ProvidersGetAtTenantScopeOptionalParams): Promise; + list(options?: ProvidersListOptionalParams): PagedAsyncIterableIterator; + listAtTenantScope(options?: ProvidersListAtTenantScopeOptionalParams): PagedAsyncIterableIterator; + listAtTenantScopeNext(nextLink: string, options?: ProvidersListAtTenantScopeNextOptionalParams): PagedAsyncIterableIterator; + listNext(nextLink: string, options?: ProvidersListNextOptionalParams): PagedAsyncIterableIterator; + providerPermissions(resourceProviderNamespace: string, options?: ProvidersProviderPermissionsOptionalParams): Promise; + register(resourceProviderNamespace: string, options?: ProvidersRegisterOptionalParams): Promise; + registerAtManagementGroupScope(resourceProviderNamespace: string, groupId: string, options?: ProvidersRegisterAtManagementGroupScopeOptionalParams): Promise; + unregister(resourceProviderNamespace: string, options?: ProvidersUnregisterOptionalParams): Promise; +} + +// @public +export interface ProvidersGetAtTenantScopeOptionalParams extends coreClient.OperationOptions { + expand?: string; +} + +// @public +export type ProvidersGetAtTenantScopeResponse = Provider; + +// @public +export interface ProvidersGetOptionalParams extends coreClient.OperationOptions { + expand?: string; +} + +// @public +export type ProvidersGetResponse = Provider; + +// @public +export interface ProvidersListAtTenantScopeNextNextOptionalParams extends coreClient.OperationOptions { + expand?: string; + top?: number; +} + +// @public +export type ProvidersListAtTenantScopeNextNextResponse = ProviderListResult; + +// @public +export interface ProvidersListAtTenantScopeNextOptionalParams extends coreClient.OperationOptions { + expand?: string; + top?: number; +} + +// @public +export type ProvidersListAtTenantScopeNextResponse = ProviderListResult; + +// @public +export interface ProvidersListAtTenantScopeOptionalParams extends coreClient.OperationOptions { + expand?: string; + top?: number; +} + +// @public +export type ProvidersListAtTenantScopeResponse = ProviderListResult; + +// @public +export interface ProvidersListNextNextOptionalParams extends coreClient.OperationOptions { + expand?: string; + top?: number; +} + +// @public +export type ProvidersListNextNextResponse = ProviderListResult; + +// @public +export interface ProvidersListNextOptionalParams extends coreClient.OperationOptions { + expand?: string; + top?: number; +} + +// @public +export type ProvidersListNextResponse = ProviderListResult; + +// @public +export interface ProvidersListOptionalParams extends coreClient.OperationOptions { + expand?: string; + top?: number; +} + +// @public +export type ProvidersListResponse = ProviderListResult; + +// @public +export interface ProvidersProviderPermissionsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProvidersProviderPermissionsResponse = ProviderPermissionListResult; + +// @public +export interface ProvidersRegisterAtManagementGroupScopeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ProvidersRegisterOptionalParams extends coreClient.OperationOptions { + properties?: ProviderRegistrationRequest; +} + +// @public +export type ProvidersRegisterResponse = Provider; + +// @public +export interface ProvidersUnregisterOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProvidersUnregisterResponse = Provider; + +// @public +export type ProvisioningOperation = "NotSpecified" | "Create" | "Delete" | "Waiting" | "AzureAsyncOperationWaiting" | "ResourceCacheWaiting" | "Action" | "Read" | "EvaluateDeploymentOutput" | "DeploymentCleanup"; + +// @public +export type ProvisioningState = string; + +// @public +export interface Resource { + extendedLocation?: ExtendedLocation; + readonly id?: string; + location?: string; + readonly name?: string; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; +} + +// @public +export interface ResourceGroup { + readonly id?: string; + location: string; + managedBy?: string; + readonly name?: string; + properties?: ResourceGroupProperties; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; +} + +// @public +export interface ResourceGroupExportResult { + error?: ErrorResponse; + template?: Record; +} + +// @public +export interface ResourceGroupFilter { + tagName?: string; + tagValue?: string; +} + +// @public +export interface ResourceGroupListResult { + readonly nextLink?: string; + value?: ResourceGroup[]; +} + +// @public +export interface ResourceGroupPatchable { + managedBy?: string; + name?: string; + properties?: ResourceGroupProperties; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface ResourceGroupProperties { + readonly provisioningState?: string; +} + +// @public +export interface ResourceGroups { + beginDelete(resourceGroupName: string, options?: ResourceGroupsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, options?: ResourceGroupsDeleteOptionalParams): Promise; + beginExportTemplate(resourceGroupName: string, parameters: ExportTemplateRequest, options?: ResourceGroupsExportTemplateOptionalParams): Promise, ResourceGroupsExportTemplateResponse>>; + beginExportTemplateAndWait(resourceGroupName: string, parameters: ExportTemplateRequest, options?: ResourceGroupsExportTemplateOptionalParams): Promise; + checkExistence(resourceGroupName: string, options?: ResourceGroupsCheckExistenceOptionalParams): Promise; + createOrUpdate(resourceGroupName: string, parameters: ResourceGroup, options?: ResourceGroupsCreateOrUpdateOptionalParams): Promise; + get(resourceGroupName: string, options?: ResourceGroupsGetOptionalParams): Promise; + list(options?: ResourceGroupsListOptionalParams): PagedAsyncIterableIterator; + listNext(nextLink: string, options?: ResourceGroupsListNextOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, parameters: ResourceGroupPatchable, options?: ResourceGroupsUpdateOptionalParams): Promise; +} + +// @public +export interface ResourceGroupsCheckExistenceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ResourceGroupsCheckExistenceResponse = { + body: boolean; +}; + +// @public +export interface ResourceGroupsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ResourceGroupsCreateOrUpdateResponse = ResourceGroup; + +// @public +export interface ResourceGroupsDeleteOptionalParams extends coreClient.OperationOptions { + forceDeletionTypes?: string; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ResourceGroupsExportTemplateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ResourceGroupsExportTemplateResponse = ResourceGroupExportResult; + +// @public +export interface ResourceGroupsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ResourceGroupsGetResponse = ResourceGroup; + +// @public +export interface ResourceGroupsListNextNextOptionalParams extends coreClient.OperationOptions { + filter?: string; + top?: number; +} + +// @public +export type ResourceGroupsListNextNextResponse = ResourceGroupListResult; + +// @public +export interface ResourceGroupsListNextOptionalParams extends coreClient.OperationOptions { + filter?: string; + top?: number; +} + +// @public +export type ResourceGroupsListNextResponse = ResourceGroupListResult; + +// @public +export interface ResourceGroupsListOptionalParams extends coreClient.OperationOptions { + filter?: string; + top?: number; +} + +// @public +export type ResourceGroupsListResponse = ResourceGroupListResult; + +// @public +export interface ResourceGroupsUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ResourceGroupsUpdateResponse = ResourceGroup; + +// @public +export type ResourceIdentityType = "SystemAssigned" | "UserAssigned" | "SystemAssigned, UserAssigned" | "None"; + +// @public +export interface ResourceListResult { + readonly nextLink?: string; + value?: GenericResourceExpanded[]; +} + +// @public (undocumented) +export class ResourceManagementClient extends ResourceManagementClientContext { + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ResourceManagementClientOptionalParams); + // (undocumented) + deploymentOperations: DeploymentOperations; + // (undocumented) + deployments: Deployments; + // (undocumented) + operations: Operations; + // (undocumented) + providerResourceTypes: ProviderResourceTypes; + // (undocumented) + providers: Providers; + // (undocumented) + resourceGroups: ResourceGroups; + // (undocumented) + resources: Resources; + // (undocumented) + tagsOperations: TagsOperations; +} + +// @public (undocumented) +export class ResourceManagementClientContext extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ResourceManagementClientOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface ResourceManagementClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface ResourceProviderOperationDisplayProperties { + description?: string; + operation?: string; + provider?: string; + publisher?: string; + resource?: string; +} + +// @public +export interface ResourceReference { + readonly id?: string; +} + +// @public +export interface Resources { + beginCreateOrUpdate(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, parameters: GenericResource, options?: ResourcesCreateOrUpdateOptionalParams): Promise, ResourcesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, parameters: GenericResource, options?: ResourcesCreateOrUpdateOptionalParams): Promise; + beginCreateOrUpdateById(resourceId: string, apiVersion: string, parameters: GenericResource, options?: ResourcesCreateOrUpdateByIdOptionalParams): Promise, ResourcesCreateOrUpdateByIdResponse>>; + beginCreateOrUpdateByIdAndWait(resourceId: string, apiVersion: string, parameters: GenericResource, options?: ResourcesCreateOrUpdateByIdOptionalParams): Promise; + beginDelete(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, options?: ResourcesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, options?: ResourcesDeleteOptionalParams): Promise; + beginDeleteById(resourceId: string, apiVersion: string, options?: ResourcesDeleteByIdOptionalParams): Promise, void>>; + beginDeleteByIdAndWait(resourceId: string, apiVersion: string, options?: ResourcesDeleteByIdOptionalParams): Promise; + beginMoveResources(sourceResourceGroupName: string, parameters: ResourcesMoveInfo, options?: ResourcesMoveResourcesOptionalParams): Promise, void>>; + beginMoveResourcesAndWait(sourceResourceGroupName: string, parameters: ResourcesMoveInfo, options?: ResourcesMoveResourcesOptionalParams): Promise; + beginUpdate(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, parameters: GenericResource, options?: ResourcesUpdateOptionalParams): Promise, ResourcesUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, parameters: GenericResource, options?: ResourcesUpdateOptionalParams): Promise; + beginUpdateById(resourceId: string, apiVersion: string, parameters: GenericResource, options?: ResourcesUpdateByIdOptionalParams): Promise, ResourcesUpdateByIdResponse>>; + beginUpdateByIdAndWait(resourceId: string, apiVersion: string, parameters: GenericResource, options?: ResourcesUpdateByIdOptionalParams): Promise; + beginValidateMoveResources(sourceResourceGroupName: string, parameters: ResourcesMoveInfo, options?: ResourcesValidateMoveResourcesOptionalParams): Promise, void>>; + beginValidateMoveResourcesAndWait(sourceResourceGroupName: string, parameters: ResourcesMoveInfo, options?: ResourcesValidateMoveResourcesOptionalParams): Promise; + checkExistence(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, options?: ResourcesCheckExistenceOptionalParams): Promise; + checkExistenceById(resourceId: string, apiVersion: string, options?: ResourcesCheckExistenceByIdOptionalParams): Promise; + get(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, options?: ResourcesGetOptionalParams): Promise; + getById(resourceId: string, apiVersion: string, options?: ResourcesGetByIdOptionalParams): Promise; + list(options?: ResourcesListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: ResourcesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listByResourceGroupNext(resourceGroupName: string, nextLink: string, options?: ResourcesListByResourceGroupNextOptionalParams): PagedAsyncIterableIterator; + listNext(nextLink: string, options?: ResourcesListNextOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ResourcesCheckExistenceByIdOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ResourcesCheckExistenceByIdResponse = { + body: boolean; +}; + +// @public +export interface ResourcesCheckExistenceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ResourcesCheckExistenceResponse = { + body: boolean; +}; + +// @public +export interface ResourcesCreateOrUpdateByIdOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ResourcesCreateOrUpdateByIdResponse = GenericResource; + +// @public +export interface ResourcesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ResourcesCreateOrUpdateResponse = GenericResource; + +// @public +export interface ResourcesDeleteByIdOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ResourcesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ResourcesGetByIdOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ResourcesGetByIdResponse = GenericResource; + +// @public +export interface ResourcesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ResourcesGetResponse = GenericResource; + +// @public +export interface ResourcesListByResourceGroupNextNextOptionalParams extends coreClient.OperationOptions { + expand?: string; + filter?: string; + top?: number; +} + +// @public +export type ResourcesListByResourceGroupNextNextResponse = ResourceListResult; + +// @public +export interface ResourcesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { + expand?: string; + filter?: string; + top?: number; +} + +// @public +export type ResourcesListByResourceGroupNextResponse = ResourceListResult; + +// @public +export interface ResourcesListByResourceGroupOptionalParams extends coreClient.OperationOptions { + expand?: string; + filter?: string; + top?: number; +} + +// @public +export type ResourcesListByResourceGroupResponse = ResourceListResult; + +// @public +export interface ResourcesListNextNextOptionalParams extends coreClient.OperationOptions { + expand?: string; + filter?: string; + top?: number; +} + +// @public +export type ResourcesListNextNextResponse = ResourceListResult; + +// @public +export interface ResourcesListNextOptionalParams extends coreClient.OperationOptions { + expand?: string; + filter?: string; + top?: number; +} + +// @public +export type ResourcesListNextResponse = ResourceListResult; + +// @public +export interface ResourcesListOptionalParams extends coreClient.OperationOptions { + expand?: string; + filter?: string; + top?: number; +} + +// @public +export type ResourcesListResponse = ResourceListResult; + +// @public +export interface ResourcesMoveInfo { + resources?: string[]; + targetResourceGroup?: string; +} + +// @public +export interface ResourcesMoveResourcesOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ResourcesUpdateByIdOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ResourcesUpdateByIdResponse = GenericResource; + +// @public +export interface ResourcesUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ResourcesUpdateResponse = GenericResource; + +// @public +export interface ResourcesValidateMoveResourcesOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface RoleDefinition { + id?: string; + isServiceRole?: boolean; + name?: string; + permissions?: Permission[]; + scopes?: string[]; +} + +// @public +export interface ScopedDeployment { + location: string; + properties: DeploymentProperties; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface ScopedDeploymentWhatIf { + location: string; + properties: DeploymentWhatIfProperties; +} + +// @public +export interface Sku { + capacity?: number; + family?: string; + model?: string; + name?: string; + size?: string; + tier?: string; +} + +// @public +export interface StatusMessage { + error?: ErrorResponse; + status?: string; +} + +// @public +export interface SubResource { + id?: string; +} + +// @public +export interface TagCount { + type?: string; + value?: number; +} + +// @public +export interface TagDetails { + count?: TagCount; + readonly id?: string; + tagName?: string; + values?: TagValue[]; +} + +// @public +export interface Tags { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface TagsListResult { + readonly nextLink?: string; + value?: TagDetails[]; +} + +// @public +export interface TagsOperations { + createOrUpdate(tagName: string, options?: TagsOperationsCreateOrUpdateOptionalParams): Promise; + createOrUpdateAtScope(scope: string, parameters: TagsResource, options?: TagsOperationsCreateOrUpdateAtScopeOptionalParams): Promise; + createOrUpdateValue(tagName: string, tagValue: string, options?: TagsOperationsCreateOrUpdateValueOptionalParams): Promise; + delete(tagName: string, options?: TagsOperationsDeleteOptionalParams): Promise; + deleteAtScope(scope: string, options?: TagsOperationsDeleteAtScopeOptionalParams): Promise; + deleteValue(tagName: string, tagValue: string, options?: TagsOperationsDeleteValueOptionalParams): Promise; + getAtScope(scope: string, options?: TagsOperationsGetAtScopeOptionalParams): Promise; + list(options?: TagsOperationsListOptionalParams): PagedAsyncIterableIterator; + listNext(nextLink: string, options?: TagsOperationsListNextOptionalParams): PagedAsyncIterableIterator; + updateAtScope(scope: string, parameters: TagsPatchResource, options?: TagsOperationsUpdateAtScopeOptionalParams): Promise; +} + +// @public +export interface TagsOperationsCreateOrUpdateAtScopeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TagsOperationsCreateOrUpdateAtScopeResponse = TagsResource; + +// @public +export interface TagsOperationsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TagsOperationsCreateOrUpdateResponse = TagDetails; + +// @public +export interface TagsOperationsCreateOrUpdateValueOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TagsOperationsCreateOrUpdateValueResponse = TagValue; + +// @public +export interface TagsOperationsDeleteAtScopeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface TagsOperationsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface TagsOperationsDeleteValueOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface TagsOperationsGetAtScopeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TagsOperationsGetAtScopeResponse = TagsResource; + +// @public +export interface TagsOperationsListNextNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TagsOperationsListNextNextResponse = TagsListResult; + +// @public +export interface TagsOperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TagsOperationsListNextResponse = TagsListResult; + +// @public +export interface TagsOperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TagsOperationsListResponse = TagsListResult; + +// @public +export interface TagsOperationsUpdateAtScopeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TagsOperationsUpdateAtScopeResponse = TagsResource; + +// @public +export type TagsPatchOperation = string; + +// @public +export interface TagsPatchResource { + operation?: TagsPatchOperation; + properties?: Tags; +} + +// @public +export interface TagsResource { + readonly id?: string; + readonly name?: string; + properties: Tags; + readonly type?: string; +} + +// @public +export interface TagValue { + count?: TagCount; + readonly id?: string; + tagValue?: string; +} + +// @public +export interface TargetResource { + id?: string; + resourceName?: string; + resourceType?: string; +} + +// @public +export interface TemplateHashResult { + minifiedTemplate?: string; + templateHash?: string; +} + +// @public +export interface TemplateLink { + contentVersion?: string; + id?: string; + queryString?: string; + relativePath?: string; + uri?: string; +} + +// @public +export interface WhatIfChange { + after?: Record; + before?: Record; + changeType: ChangeType; + delta?: WhatIfPropertyChange[]; + resourceId: string; + unsupportedReason?: string; +} + +// @public +export interface WhatIfOperationResult { + changes?: WhatIfChange[]; + error?: ErrorResponse; + status?: string; +} + +// @public +export interface WhatIfPropertyChange { + after?: Record; + before?: Record; + children?: WhatIfPropertyChange[]; + path: string; + propertyChangeType: PropertyChangeType; +} + +// @public +export type WhatIfResultFormat = "ResourceIdOnly" | "FullResourcePayloads"; + + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/resources/arm-resources/rollup.config.js b/sdk/resources/arm-resources/rollup.config.js index cca39c93fd80..9be1955eb7f1 100644 --- a/sdk/resources/arm-resources/rollup.config.js +++ b/sdk/resources/arm-resources/rollup.config.js @@ -1,31 +1,188 @@ -import rollup from "rollup"; -import nodeResolve from "rollup-plugin-node-resolve"; -import sourcemaps from "rollup-plugin-sourcemaps"; - -/** - * @type {rollup.RollupFileOptions} - */ -const config = { - input: "./esm/resourceManagementClient.js", - external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"], - output: { - file: "./dist/arm-resources.js", - format: "umd", - name: "Azure.ArmResources", - sourcemap: true, - globals: { - "@azure/ms-rest-js": "msRest", - "@azure/ms-rest-azure-js": "msRestAzure" - }, - banner: `/* +/* * 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. - */` - }, - plugins: [nodeResolve({ mainFields: ["module", "main"] }), sourcemaps()] + */ + +import nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + +// #region Warning Handler + +/** + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +function ignoreNiseSinonEvalWarnings(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependencyWarnings(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] + }, + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false }; -export 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/resources/arm-resources/src/coreClientLro.ts b/sdk/resources/arm-resources/src/coreClientLro.ts new file mode 100644 index 000000000000..d793a24458bc --- /dev/null +++ b/sdk/resources/arm-resources/src/coreClientLro.ts @@ -0,0 +1,323 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + OperationArguments, + OperationSpec, + OperationResponseMap, + FullOperationResponse +} from "@azure/core-client"; +import { + LroResourceLocationConfig, + GetLroStatusFromResponse, + LongRunningOperation, + LroConfig, + LroMode, + LroResponse, + LroStatus, + createGetLroStatusFromResponse, + RawResponse +} from "./lro"; + +export const successStates = ["succeeded"]; +export const failureStates = ["failed", "canceled", "cancelled"]; +export const terminalStates = successStates.concat(failureStates); + +export type SendOperationFn = ( + args: OperationArguments, + spec: OperationSpec +) => Promise>; + +export function createPollingMethod( + sendOperationFn: SendOperationFn, + GetLroStatusFromResponse: GetLroStatusFromResponse, + args: OperationArguments, + spec: OperationSpec, + mode?: LroMode +): (path?: string) => Promise> { + /** + * Polling calls will always return a status object i.e. {"status": "success"} + * these intermediate responses are not described in the swagger so we need to + * pass custom mappers at runtime. + * This function replaces all the existing mappers to be able to deserialize a status object + * @param responses Original set of responses defined in the operation + */ + function getCompositeMappers(responses: { + [responseCode: string]: OperationResponseMap; + }): { + [responseCode: string]: OperationResponseMap; + } { + return Object.keys(responses).reduce((acc, statusCode) => { + return { + ...acc, + [statusCode]: { + ...responses[statusCode], + bodyMapper: { + type: { + name: "Composite", + modelProperties: { + status: { + serializedName: "status", + type: { + name: "String" + } + } + } + } + } + } + }; + }, {} as { [responseCode: string]: OperationResponseMap }); + } + let response: LroStatus | undefined = undefined; + const customerCallback = args?.options?.onResponse; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: ( + rawResponse: FullOperationResponse, + flatResponse: unknown + ): void => { + response = GetLroStatusFromResponse( + { + statusCode: rawResponse.status, + body: rawResponse.parsedBody, + headers: rawResponse.headers.toJSON() + }, + flatResponse as TResult + ); + if (response.done) { + customerCallback?.(rawResponse, flatResponse); + } + } + } + }; + // Make sure we don't send any body to the get request + const { requestBody, responses, ...restSpec } = spec; + if (mode === "AzureAsync") { + return async (path?: string) => { + await sendOperationFn(updatedArgs, { + ...restSpec, + responses: getCompositeMappers(responses), + httpMethod: "GET", + ...(path && { path }) + }); + return response!; + }; + } + return async (path?: string) => { + await sendOperationFn(updatedArgs, { + ...restSpec, + responses: responses, + httpMethod: "GET", + ...(path && { path }) + }); + return response!; + }; +} + +/** + * We need to selectively deserialize our responses, only deserializing if we + * are in a final Lro response, not deserializing any polling non-terminal responses + */ +export function shouldDeserializeLro(lroResourceLocationConfig?: string) { + let initialOperationInfo: LroResponseInfo | undefined; + let isInitialRequest = true; + + return (response: FullOperationResponse) => { + if (response.status < 200 || response.status >= 300) { + return true; + } + + if (!initialOperationInfo) { + initialOperationInfo = getLroData(response); + } else { + isInitialRequest = false; + } + + if ( + initialOperationInfo.azureAsyncOperation || + initialOperationInfo.operationLocation + ) { + return ( + !isInitialRequest && + isAsyncOperationFinalResponse( + response, + initialOperationInfo, + lroResourceLocationConfig + ) + ); + } + + if (initialOperationInfo.location) { + return isLocationFinalResponse(response); + } + + if (initialOperationInfo.requestMethod === "PUT") { + return isBodyPollingFinalResponse(response); + } + + return true; + }; +} + +function isAsyncOperationFinalResponse( + response: FullOperationResponse, + initialOperationInfo: LroResponseInfo, + lroResourceLocationConfig?: string +): boolean { + const status: string = response.parsedBody?.status || "Succeeded"; + if (!terminalStates.includes(status.toLowerCase())) { + return false; + } + + if (initialOperationInfo.requestMethod === "DELETE") { + return true; + } + + if ( + initialOperationInfo.requestMethod === "PUT" && + lroResourceLocationConfig && + lroResourceLocationConfig.toLowerCase() === "azure-asyncoperation" + ) { + return true; + } + + if ( + initialOperationInfo.requestMethod !== "PUT" && + !initialOperationInfo.location + ) { + return true; + } + + return false; +} + +function isLocationFinalResponse(response: FullOperationResponse): boolean { + return response.status !== 202; +} + +function isBodyPollingFinalResponse(response: FullOperationResponse): boolean { + const provisioningState: string = + response.parsedBody?.properties?.provisioningState || "Succeeded"; + + if (terminalStates.includes(provisioningState.toLowerCase())) { + return true; + } + + return false; +} + +interface LroResponseInfo { + requestMethod: string; + azureAsyncOperation?: string; + operationLocation?: string; + location?: string; +} + +function getLroData(result: FullOperationResponse): LroResponseInfo { + return { + azureAsyncOperation: result.headers.get("azure-asyncoperation"), + operationLocation: result.headers.get("operation-location"), + location: result.headers.get("location"), + requestMethod: result.request.method + }; +} + +export function getSpecPath(spec: OperationSpec): string { + if (spec.path) { + return spec.path; + } else { + throw Error("Bad spec: request path is not found!"); + } +} + +export class CoreClientLro implements LongRunningOperation { + constructor( + private sendOperationFn: SendOperationFn, + private args: OperationArguments, + private spec: OperationSpec, + private lroResourceLocationConfig?: LroResourceLocationConfig, + public requestPath: string = spec.path!, + public requestMethod: string = spec.httpMethod + ) {} + public async sendInitialRequest( + initializeState: ( + rawResponse: RawResponse, + flatResponse: unknown + ) => boolean + ): Promise> { + const { onResponse, ...restOptions } = this.args.options || {}; + return this.sendOperationFn( + { + ...this.args, + options: { + ...restOptions, + onResponse: ( + rawResponse: FullOperationResponse, + flatResponse: unknown + ) => { + const isCompleted = initializeState( + { + statusCode: rawResponse.status, + body: rawResponse.parsedBody, + headers: rawResponse.headers.toJSON() + }, + flatResponse + ); + if (isCompleted) { + onResponse?.(rawResponse, flatResponse); + } + } + } + }, + this.spec + ); + } + + public async sendPollRequest( + config: LroConfig, + path: string + ): Promise> { + const getLroStatusFromResponse = createGetLroStatusFromResponse( + this, + config, + this.lroResourceLocationConfig + ); + return createPollingMethod( + this.sendOperationFn, + getLroStatusFromResponse, + this.args, + this.spec, + config.mode + )(path); + } + + public async retrieveAzureAsyncResource( + path?: string + ): Promise> { + const updatedArgs = { ...this.args }; + if (updatedArgs.options) { + (updatedArgs.options as any).shouldDeserialize = true; + } + return createPollingMethod( + this.sendOperationFn, + (rawResponse, flatResponse) => ({ + rawResponse, + flatResponse, + done: true + }), + updatedArgs, + this.spec + )(path); + } +} diff --git a/sdk/resources/arm-resources/src/index.ts b/sdk/resources/arm-resources/src/index.ts new file mode 100644 index 000000000000..43ae2e201eb3 --- /dev/null +++ b/sdk/resources/arm-resources/src/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/// +export * from "./models"; +export { ResourceManagementClient } from "./resourceManagementClient"; +export { ResourceManagementClientContext } from "./resourceManagementClientContext"; +export * from "./operationsInterfaces"; diff --git a/sdk/resources/arm-resources/src/lro/azureAsyncPolling.ts b/sdk/resources/arm-resources/src/lro/azureAsyncPolling.ts new file mode 100644 index 000000000000..725578a69264 --- /dev/null +++ b/sdk/resources/arm-resources/src/lro/azureAsyncPolling.ts @@ -0,0 +1,96 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { + failureStates, + LroResourceLocationConfig, + LongRunningOperation, + LroBody, + LroResponse, + LroStatus, + RawResponse, + successStates +} from "./models"; +import { isUnexpectedPollingResponse } from "./requestUtils"; + +function getResponseStatus(rawResponse: RawResponse): string { + const { status } = (rawResponse.body as LroBody) ?? {}; + return status?.toLowerCase() ?? "succeeded"; +} + +function isAzureAsyncPollingDone(rawResponse: RawResponse): boolean { + const state = getResponseStatus(rawResponse); + if ( + isUnexpectedPollingResponse(rawResponse) || + failureStates.includes(state) + ) { + throw new Error(`Operation status: ${state}`); + } + return successStates.includes(state); +} + +async function sendFinalRequest( + lro: LongRunningOperation, + lroResourceLocationConfig?: LroResourceLocationConfig, + resourceLocation?: string +): Promise | undefined> { + switch (lroResourceLocationConfig) { + case "original-uri": + return lro.retrieveAzureAsyncResource(); + case "azure-async-operation": + return Promise.resolve(undefined); + case "location": + default: + return lro.retrieveAzureAsyncResource(resourceLocation); + } +} + +export function processAzureAsyncOperationResult( + lro: LongRunningOperation, + resourceLocation?: string, + lroResourceLocationConfig?: LroResourceLocationConfig +): (rawResponse: RawResponse, flatResponse: TResult) => LroStatus { + return ( + rawResponse: RawResponse, + flatResponse: TResult + ): LroStatus => { + if (isAzureAsyncPollingDone(rawResponse)) { + if (resourceLocation === undefined) { + return { rawResponse, flatResponse, done: true }; + } else { + return { + rawResponse, + flatResponse, + done: false, + next: async () => { + const finalResponse = await sendFinalRequest( + lro, + lroResourceLocationConfig, + resourceLocation + ); + return { + ...(finalResponse ?? { + rawResponse, + flatResponse + }), + done: true + }; + } + }; + } + } + return { + rawResponse, + flatResponse, + done: false + }; + }; +} diff --git a/sdk/resources/arm-resources/src/lro/bodyPolling.ts b/sdk/resources/arm-resources/src/lro/bodyPolling.ts new file mode 100644 index 000000000000..b1c87f8bc8d7 --- /dev/null +++ b/sdk/resources/arm-resources/src/lro/bodyPolling.ts @@ -0,0 +1,54 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { + failureStates, + LroBody, + LroStatus, + RawResponse, + successStates +} from "./models"; +import { isUnexpectedPollingResponse } from "./requestUtils"; + +function getProvisioningState(rawResponse: RawResponse): string { + const { properties, provisioningState } = (rawResponse.body as LroBody) ?? {}; + const state: string | undefined = + properties?.provisioningState ?? provisioningState; + return state?.toLowerCase() ?? "succeeded"; +} + +export function isBodyPollingDone(rawResponse: RawResponse): boolean { + const state = getProvisioningState(rawResponse); + if ( + isUnexpectedPollingResponse(rawResponse) || + failureStates.includes(state) + ) { + throw new Error( + `The long running operation has failed. The provisioning state: ${state}.` + ); + } + return successStates.includes(state); +} + +/** + * Creates a polling strategy based on BodyPolling which uses the provisioning state + * from the result to determine the current operation state + */ +export function processBodyPollingOperationResult( + rawResponse: RawResponse, + flatResponse: TResult +): LroStatus { + return { + rawResponse, + flatResponse, + done: isBodyPollingDone(rawResponse) + }; +} diff --git a/sdk/resources/arm-resources/src/lro/index.ts b/sdk/resources/arm-resources/src/lro/index.ts new file mode 100644 index 000000000000..20df608fc848 --- /dev/null +++ b/sdk/resources/arm-resources/src/lro/index.ts @@ -0,0 +1,26 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +export { LroEngine } from "./lroEngine"; +export { createGetLroStatusFromResponse } from "./stateMachine"; +export { + LroResourceLocationConfig, + GetLroStatusFromResponse, + RawResponse, + LongRunningOperation, + LroConfig, + LroMode, + LroResponse, + LroStatus, + LroTerminalState, + LroInProgressState, + LroEngineOptions +} from "./models"; diff --git a/sdk/resources/arm-resources/src/lro/locationPolling.ts b/sdk/resources/arm-resources/src/lro/locationPolling.ts new file mode 100644 index 000000000000..9d1aadfbdecc --- /dev/null +++ b/sdk/resources/arm-resources/src/lro/locationPolling.ts @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { LroStatus, RawResponse } from "./models"; +import { isUnexpectedPollingResponse } from "./requestUtils"; + +function isLocationPollingDone(rawResponse: RawResponse): boolean { + return ( + !isUnexpectedPollingResponse(rawResponse) && rawResponse.statusCode !== 202 + ); +} + +export function processLocationPollingOperationResult( + rawResponse: RawResponse, + flatResponse: TResult +): LroStatus { + return { + rawResponse, + flatResponse, + done: isLocationPollingDone(rawResponse) + }; +} diff --git a/sdk/resources/arm-resources/src/lro/lroEngine.ts b/sdk/resources/arm-resources/src/lro/lroEngine.ts new file mode 100644 index 000000000000..85cc15e60913 --- /dev/null +++ b/sdk/resources/arm-resources/src/lro/lroEngine.ts @@ -0,0 +1,61 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { Poller, PollOperationState } from "@azure/core-lro"; +import { + LongRunningOperation, + LroEngineOptions, + ResumablePollOperationState +} from "./models"; +import { GenericPollOperation } from "./operation"; + +/** + * The LRO Engine, a class that performs polling. + */ +export class LroEngine< + TResult, + TState extends PollOperationState +> extends Poller { + private intervalInMs: number; + + constructor(lro: LongRunningOperation, options?: LroEngineOptions) { + const { intervalInMs = 2000, resumeFrom } = options || {}; + function deserializeState( + resumeFrom: string + ): TState & ResumablePollOperationState { + try { + return JSON.parse(resumeFrom).state; + } catch (e) { + throw new Error( + `LroEngine: Unable to deserialize state: ${resumeFrom}` + ); + } + } + const state: TState & ResumablePollOperationState = resumeFrom + ? deserializeState(resumeFrom) + : ({} as any); + + const operation = new GenericPollOperation(state, lro); + super(operation); + + this.intervalInMs = intervalInMs; + operation.setPollerConfig(this as any); + } + + /** + * The method used by the poller to wait before attempting to update its operation. + */ + delay(): Promise { + return new Promise((resolve) => + setTimeout(() => resolve(), this.intervalInMs) + ); + } +} diff --git a/sdk/resources/arm-resources/src/lro/models.ts b/sdk/resources/arm-resources/src/lro/models.ts new file mode 100644 index 000000000000..93c3437c8e40 --- /dev/null +++ b/sdk/resources/arm-resources/src/lro/models.ts @@ -0,0 +1,173 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { PollOperationState } from "@azure/core-lro"; + +/** + * Options for the LRO poller. + */ +export interface LroEngineOptions { + /** + * Defines how much time the poller is going to wait before making a new request to the service. + */ + intervalInMs?: number; + /** + * A serialized poller which can be used to resume an existing paused Long-Running-Operation. + */ + resumeFrom?: string; +} + +export const successStates = ["succeeded"]; +export const failureStates = ["failed", "canceled", "cancelled"]; +/** + * The LRO states that signal that the LRO has completed. + */ +export const terminalStates = successStates.concat(failureStates); + +/** + * The potential location of the result of the LRO if specified by the LRO extension in the swagger. + */ +export type LroResourceLocationConfig = + | "azure-async-operation" + | "location" + | "original-uri"; + +/** + * The type of a LRO response body. This is just a convenience type for checking the status of the operation. + */ + +export interface LroBody extends Record { + /** The status of the operation. */ + status?: string; + /** The state of the provisioning process */ + provisioningState?: string; + /** The properties of the provisioning process */ + properties?: { provisioningState?: string } & Record; +} + +/** + * Simple type of the raw response. + */ +export interface RawResponse { + /** The HTTP status code */ + statusCode: number; + /** A HttpHeaders collection in the response represented as a simple JSON object where all header names have been normalized to be lower-case. */ + headers: { + [headerName: string]: string; + }; + /** The parsed response body */ + body?: unknown; +} + +/** + * The type of the response of a LRO. + */ +export interface LroResponse { + /** The flattened response */ + flatResponse: T; + /** The raw response */ + rawResponse: RawResponse; +} + +/** The type of which LRO implementation being followed by a specific API. */ +export type LroMode = "AzureAsync" | "Location" | "Body"; + +/** + * The configuration of a LRO to determine how to perform polling and checking whether the operation has completed. + */ +export interface LroConfig { + /** The LRO mode */ + mode?: LroMode; + /** The path of a provisioned resource */ + resourceLocation?: string; +} + +/** + * Type of a polling operation state that can actually be resumed. + */ +export type ResumablePollOperationState = PollOperationState & { + initialRawResponse?: RawResponse; + config?: LroConfig; + pollingURL?: string; +}; + +export interface PollerConfig { + intervalInMs: number; +} + +/** + * The type of a terminal state of an LRO. + */ +export interface LroTerminalState extends LroResponse { + /** + * Whether the operation has finished. + */ + done: true; +} + +/** + * The type of an in-progress state of an LRO. + */ +export interface LroInProgressState extends LroResponse { + /** + * Whether the operation has finished. + */ + done: false; + /** + * The request to be sent next if it is different from the standard polling one. + * Notice that it will disregard any polling URLs provided to it. + */ + next?: () => Promise>; +} + +/** + * The type of an LRO state which is a tagged union of terminal and in-progress states. + */ +export type LroStatus = LroTerminalState | LroInProgressState; + +/** + * The type of the getLROStatusFromResponse method. It takes the response as input and returns along the response whether the operation has finished. + */ +export type GetLroStatusFromResponse = ( + rawResponse: RawResponse, + flatResponse: T +) => LroStatus; + +/** + * Description of a long running operation. + */ +export interface LongRunningOperation { + /** + * The request path. + */ + requestPath: string; + /** + * The HTTP request method. + */ + requestMethod: string; + /** + * A function that can be used to send initial request to the service. + */ + sendInitialRequest: ( + initializeState: ( + rawResponse: RawResponse, + flatResponse: unknown + ) => boolean + ) => Promise>; + /** + * A function that can be used to poll for the current status of a long running operation. + */ + sendPollRequest: (config: LroConfig, path: string) => Promise>; + /** + * A function that can be used to retrieve the provisioned azure resource. + */ + retrieveAzureAsyncResource: (path?: string) => Promise>; +} diff --git a/sdk/resources/arm-resources/src/lro/operation.ts b/sdk/resources/arm-resources/src/lro/operation.ts new file mode 100644 index 000000000000..3ea7b76d89b3 --- /dev/null +++ b/sdk/resources/arm-resources/src/lro/operation.ts @@ -0,0 +1,120 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { AbortSignalLike } from "@azure/abort-controller"; +import { PollOperationState, PollOperation } from "@azure/core-lro"; +import { + PollerConfig, + ResumablePollOperationState, + LongRunningOperation, + LroStatus +} from "./models"; +import { getPollingUrl } from "./requestUtils"; +import { createInitializeState, createPollForLROStatus } from "./stateMachine"; + +export class GenericPollOperation< + TResult, + TState extends PollOperationState +> implements PollOperation { + private getLROStatusFromResponse?: ( + pollingURL: string, + pollerConfig: PollerConfig + ) => Promise>; + private pollerConfig?: PollerConfig; + constructor( + public state: TState & ResumablePollOperationState, + private lro: LongRunningOperation + ) {} + + public setPollerConfig(pollerConfig: PollerConfig): void { + this.pollerConfig = pollerConfig; + } + + /** + * General update function for LROPoller, the general process is as follows + * 1. Check initial operation result to determine the strategy to use + * - Strategies: Location, Azure-AsyncOperation, Original Uri + * 2. Check if the operation result has a terminal state + * - Terminal state will be determined by each strategy + * 2.1 If it is terminal state Check if a final GET request is required, if so + * send final GET request and return result from operation. If no final GET + * is required, just return the result from operation. + * - Determining what to call for final request is responsibility of each strategy + * 2.2 If it is not terminal state, call the polling operation and go to step 1 + * - Determining what to call for polling is responsibility of each strategy + * - Strategies will always use the latest URI for polling if provided otherwise + * the last known one + */ + async update(options?: { + abortSignal?: AbortSignalLike | undefined; + fireProgress?: ((state: TState) => void) | undefined; + }): Promise> { + const state = this.state; + if (!state.isStarted) { + const initializeState = createInitializeState( + state, + this.lro.requestPath, + this.lro.requestMethod + ); + await this.lro.sendInitialRequest(initializeState); + } + + if (!state.isCompleted) { + if (this.getLROStatusFromResponse === undefined) { + if (state.config === undefined) { + throw new Error( + "Bad state: LRO mode is undefined. Please check if the serialized state is well-formed." + ); + } + this.getLROStatusFromResponse = createPollForLROStatus( + this.lro, + state.config + ); + } + if (state.pollingURL === undefined) { + throw new Error( + "Bad state: polling URL is undefined. Please check if the serialized state is well-formed." + ); + } + const currentState = await this.getLROStatusFromResponse( + state.pollingURL, + this.pollerConfig! + ); + if (currentState.done) { + state.result = currentState.flatResponse; + state.isCompleted = true; + } else { + this.getLROStatusFromResponse = + currentState.next ?? this.getLROStatusFromResponse; + state.pollingURL = getPollingUrl( + currentState.rawResponse, + state.pollingURL + ); + } + } + options?.fireProgress?.(state); + return this; + } + + async cancel(): Promise> { + this.state.isCancelled = true; + return this; + } + + /** + * Serializes the Poller operation. + */ + public toString(): string { + return JSON.stringify({ + state: this.state + }); + } +} diff --git a/sdk/resources/arm-resources/src/lro/passthrough.ts b/sdk/resources/arm-resources/src/lro/passthrough.ts new file mode 100644 index 000000000000..ae7f87d38483 --- /dev/null +++ b/sdk/resources/arm-resources/src/lro/passthrough.ts @@ -0,0 +1,23 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { LroStatus, RawResponse } from "./models"; + +export function processPassthroughOperationResult( + rawResponse: RawResponse, + flatResponse: TResult +): LroStatus { + return { + rawResponse, + flatResponse, + done: true + }; +} diff --git a/sdk/resources/arm-resources/src/lro/requestUtils.ts b/sdk/resources/arm-resources/src/lro/requestUtils.ts new file mode 100644 index 000000000000..40d993686f0d --- /dev/null +++ b/sdk/resources/arm-resources/src/lro/requestUtils.ts @@ -0,0 +1,105 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { LroConfig, RawResponse } from "./models"; + +/** + * Detects where the continuation token is and returns it. Notice that azure-asyncoperation + * must be checked first before the other location headers because there are scenarios + * where both azure-asyncoperation and location could be present in the same response but + * azure-asyncoperation should be the one to use for polling. + */ +export function getPollingUrl( + rawResponse: RawResponse, + defaultPath: string +): string { + return ( + getAzureAsyncOperation(rawResponse) ?? + getLocation(rawResponse) ?? + getOperationLocation(rawResponse) ?? + defaultPath + ); +} + +function getLocation(rawResponse: RawResponse): string | undefined { + return rawResponse.headers["location"]; +} + +function getOperationLocation(rawResponse: RawResponse): string | undefined { + return rawResponse.headers["operation-location"]; +} + +function getAzureAsyncOperation(rawResponse: RawResponse): string | undefined { + return rawResponse.headers["azure-asyncoperation"]; +} + +export function inferLroMode( + requestPath: string, + requestMethod: string, + rawResponse: RawResponse +): LroConfig { + if (getAzureAsyncOperation(rawResponse) !== undefined) { + return { + mode: "AzureAsync", + resourceLocation: + requestMethod === "PUT" + ? requestPath + : requestMethod === "POST" + ? getLocation(rawResponse) + : undefined + }; + } else if ( + getLocation(rawResponse) !== undefined || + getOperationLocation(rawResponse) !== undefined + ) { + return { + mode: "Location" + }; + } else if (["PUT", "PATCH"].includes(requestMethod)) { + return { + mode: "Body" + }; + } + return {}; +} + +export class RestError extends Error { + public statusCode?: number; + constructor(message: string, statusCode: number) { + super(message); + this.name = "RestError"; + this.statusCode = statusCode; + + Object.setPrototypeOf(this, RestError.prototype); + } +} + +export function isUnexpectedInitialResponse(rawResponse: RawResponse): boolean { + const code = rawResponse.statusCode; + if (![203, 204, 202, 201, 200, 500].includes(code)) { + throw new RestError( + `Received unexpected HTTP status code ${code} in the initial response. This may indicate a server issue.`, + code + ); + } + return false; +} + +export function isUnexpectedPollingResponse(rawResponse: RawResponse): boolean { + const code = rawResponse.statusCode; + if (![202, 201, 200, 500].includes(code)) { + throw new RestError( + `Received unexpected HTTP status code ${code} while polling. This may indicate a server issue.`, + code + ); + } + return false; +} diff --git a/sdk/resources/arm-resources/src/lro/stateMachine.ts b/sdk/resources/arm-resources/src/lro/stateMachine.ts new file mode 100644 index 000000000000..19a8f6747032 --- /dev/null +++ b/sdk/resources/arm-resources/src/lro/stateMachine.ts @@ -0,0 +1,138 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { processAzureAsyncOperationResult } from "./azureAsyncPolling"; +import { + isBodyPollingDone, + processBodyPollingOperationResult +} from "./bodyPolling"; +import { processLocationPollingOperationResult } from "./locationPolling"; +import { + LroResourceLocationConfig, + GetLroStatusFromResponse, + LongRunningOperation, + LroConfig, + LroStatus, + PollerConfig, + RawResponse, + ResumablePollOperationState +} from "./models"; +import { processPassthroughOperationResult } from "./passthrough"; +import { + getPollingUrl, + inferLroMode, + isUnexpectedInitialResponse +} from "./requestUtils"; + +/** + * creates a stepping function that maps an LRO state to another. + */ +export function createGetLroStatusFromResponse( + lroPrimitives: LongRunningOperation, + config: LroConfig, + lroResourceLocationConfig?: LroResourceLocationConfig +): GetLroStatusFromResponse { + switch (config.mode) { + case "AzureAsync": { + return processAzureAsyncOperationResult( + lroPrimitives, + config.resourceLocation, + lroResourceLocationConfig + ); + } + case "Location": { + return processLocationPollingOperationResult; + } + case "Body": { + return processBodyPollingOperationResult; + } + default: { + return processPassthroughOperationResult; + } + } +} + +/** + * Creates a polling operation that returns a LRO state. + */ +export function createPollForLROStatus( + lroPrimitives: LongRunningOperation, + config: LroConfig +): ( + pollingURL: string, + pollerConfig: PollerConfig +) => Promise> { + return async ( + path: string, + pollerConfig: PollerConfig + ): Promise> => { + const response = await lroPrimitives.sendPollRequest(config, path); + const retryAfter: string | undefined = + response.rawResponse.headers["retry-after"]; + if (retryAfter !== undefined) { + const retryAfterInMs = parseInt(retryAfter); + pollerConfig.intervalInMs = isNaN(retryAfterInMs) + ? calculatePollingIntervalFromDate( + new Date(retryAfter), + pollerConfig.intervalInMs + ) + : retryAfterInMs; + } + return response; + }; +} + +function calculatePollingIntervalFromDate( + retryAfterDate: Date, + defaultIntervalInMs: number +): number { + const timeNow = Math.floor(new Date().getTime()); + const retryAfterTime = retryAfterDate.getTime(); + if (timeNow < retryAfterTime) { + return retryAfterTime - timeNow; + } + return defaultIntervalInMs; +} + +/** + * Creates a callback to be used to initialize the polling operation state. + * @param state - of the polling operation + * @param operationSpec - of the LRO + * @param callback - callback to be called when the operation is done + * @returns callback that initializes the state of the polling operation + */ +export function createInitializeState( + state: ResumablePollOperationState, + requestPath: string, + requestMethod: string +): (rawResponse: RawResponse, flatResponse: unknown) => boolean { + return (rawResponse: RawResponse, flatResponse: unknown) => { + if (isUnexpectedInitialResponse(rawResponse)) return true; + state.initialRawResponse = rawResponse; + state.isStarted = true; + state.pollingURL = getPollingUrl(state.initialRawResponse, requestPath); + state.config = inferLroMode( + requestPath, + requestMethod, + state.initialRawResponse + ); + /** short circuit polling if body polling is done in the initial request */ + if ( + state.config.mode === undefined || + (state.config.mode === "Body" && + isBodyPollingDone(state.initialRawResponse)) + ) { + state.result = flatResponse as TResult; + state.isCompleted = true; + } + return Boolean(state.isCompleted); + }; +} diff --git a/sdk/resources/arm-resources/src/models/deploymentOperationsMappers.ts b/sdk/resources/arm-resources/src/models/deploymentOperationsMappers.ts deleted file mode 100644 index 87a71c90a692..000000000000 --- a/sdk/resources/arm-resources/src/models/deploymentOperationsMappers.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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 { - CloudError, - DeploymentOperation, - DeploymentOperationProperties, - DeploymentOperationsListResult, - ErrorAdditionalInfo, - ErrorResponse, - HttpMessage, - StatusMessage, - TargetResource -} from "../models/mappers"; diff --git a/sdk/resources/arm-resources/src/models/deploymentsMappers.ts b/sdk/resources/arm-resources/src/models/deploymentsMappers.ts deleted file mode 100644 index 59299c8a9c84..000000000000 --- a/sdk/resources/arm-resources/src/models/deploymentsMappers.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 { - Alias, - AliasPath, - AliasPathMetadata, - AliasPattern, - ApiProfile, - BaseResource, - BasicDependency, - CloudError, - DebugSetting, - Dependency, - Deployment, - DeploymentExportResult, - DeploymentExtended, - DeploymentListResult, - DeploymentProperties, - DeploymentPropertiesExtended, - DeploymentsWhatIfAtManagementGroupScopeHeaders, - DeploymentsWhatIfAtSubscriptionScopeHeaders, - DeploymentsWhatIfAtTenantScopeHeaders, - DeploymentsWhatIfHeaders, - DeploymentValidateResult, - DeploymentWhatIf, - DeploymentWhatIfProperties, - DeploymentWhatIfSettings, - ErrorAdditionalInfo, - ErrorResponse, - ExpressionEvaluationOptions, - ExtendedLocation, - GenericResource, - GenericResourceExpanded, - Identity, - IdentityUserAssignedIdentitiesValue, - OnErrorDeployment, - OnErrorDeploymentExtended, - ParametersLink, - Plan, - Provider, - ProviderExtendedLocation, - ProviderResourceType, - Resource, - ResourceGroup, - ResourceGroupProperties, - ResourceReference, - ScopedDeployment, - ScopedDeploymentWhatIf, - Sku, - SubResource, - TagCount, - TagDetails, - Tags, - TagsResource, - TagValue, - TemplateHashResult, - TemplateLink, - WhatIfChange, - WhatIfOperationResult, - WhatIfPropertyChange -} from "../models/mappers"; diff --git a/sdk/resources/arm-resources/src/models/index.ts b/sdk/resources/arm-resources/src/models/index.ts index 4c1f784cbc3c..ce845f30714d 100644 --- a/sdk/resources/arm-resources/src/models/index.ts +++ b/sdk/resources/arm-resources/src/models/index.ts @@ -6,4510 +6,2578 @@ * 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 }; +/** Result of the request to list Microsoft.Resources operations. It contains a list of operations and a URL link to get the next set of results. */ +export interface OperationListResult { + /** List of Microsoft.Resources operations. */ + value?: Operation[]; + /** URL to get the next set of operation list results if there are any. */ + nextLink?: string; +} -/** - * Deployment filter. - */ -export interface DeploymentExtendedFilter { - /** - * The provisioning state. - */ - provisioningState?: string; +/** Microsoft.Resources operation */ +export interface Operation { + /** Operation name: {provider}/{resource}/{operation} */ + name?: string; + /** The object that represents the operation. */ + display?: OperationDisplay; } -/** - * Resource filter. - */ -export interface GenericResourceFilter { +/** The object that represents the operation. */ +export interface OperationDisplay { + /** Service provider: Microsoft.Resources */ + provider?: string; + /** Resource on which the operation is performed: Profile, endpoint, etc. */ + resource?: string; + /** Operation type: Read, write, delete, etc. */ + operation?: string; + /** Description of the operation. */ + description?: string; +} + +/** An error response for a resource management request. */ +export interface CloudError { + /** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.) */ + error?: ErrorResponse; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.) */ +export interface ErrorResponse { /** - * The resource type. + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - resourceType?: string; + readonly code?: string; /** - * The tag name. + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tagname?: string; + readonly message?: string; /** - * The tag value. + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tagvalue?: string; -} - -/** - * Resource group filter. - */ -export interface ResourceGroupFilter { + readonly target?: string; /** - * The tag name. + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tagName?: string; + readonly details?: ErrorResponse[]; /** - * The tag value. + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tagValue?: string; + readonly additionalInfo?: ErrorAdditionalInfo[]; } -/** - * Entity representing the reference to the template. - */ -export interface TemplateLink { +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { /** - * The URI of the template to deploy. Use either the uri or id property, but not both. + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - uri?: string; + readonly type?: string; /** - * The resource id of a Template Spec. Use either the id or uri property, but not both. + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly info?: Record; +} + +/** Deployment operation parameters. */ +export interface Deployment { + /** The location to store the deployment data. */ + location?: string; + /** The deployment properties. */ + properties: DeploymentProperties; + /** Deployment tags */ + tags?: { [propertyName: string]: string }; +} + +/** Deployment properties. */ +export interface DeploymentProperties { + /** The template content. You use this element when you want to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the template property, but not both. */ + template?: Record; + /** The URI of the template. Use either the templateLink property or the template property, but not both. */ + templateLink?: TemplateLink; + /** Name and value pairs that define the deployment parameters for the template. You use this element when you want to provide the parameter values directly in the request rather than link to an existing parameter file. Use either the parametersLink property or the parameters property, but not both. It can be a JObject or a well formed JSON string. */ + parameters?: Record; + /** The URI of parameters file. You use this element to link to an existing parameters file. Use either the parametersLink property or the parameters property, but not both. */ + parametersLink?: ParametersLink; + /** The mode that is used to deploy resources. This value can be either Incremental or Complete. In Incremental mode, resources are deployed without deleting existing resources that are not included in the template. In Complete mode, resources are deployed and existing resources in the resource group that are not included in the template are deleted. Be careful when using Complete mode as you may unintentionally delete resources. */ + mode: DeploymentMode; + /** The debug setting of the deployment. */ + debugSetting?: DebugSetting; + /** The deployment on error behavior. */ + onErrorDeployment?: OnErrorDeployment; + /** Specifies whether template expressions are evaluated within the scope of the parent template or nested template. Only applicable to nested templates. If not specified, default value is outer. */ + expressionEvaluationOptions?: ExpressionEvaluationOptions; +} + +/** Entity representing the reference to the template. */ +export interface TemplateLink { + /** The URI of the template to deploy. Use either the uri or id property, but not both. */ + uri?: string; + /** The resource id of a Template Spec. Use either the id or uri property, but not both. */ id?: string; - /** - * The relativePath property can be used to deploy a linked template at a location relative to - * the parent. If the parent template was linked with a TemplateSpec, this will reference an - * artifact in the TemplateSpec. If the parent was linked with a URI, the child deployment will - * be a combination of the parent and relativePath URIs - */ + /** The relativePath property can be used to deploy a linked template at a location relative to the parent. If the parent template was linked with a TemplateSpec, this will reference an artifact in the TemplateSpec. If the parent was linked with a URI, the child deployment will be a combination of the parent and relativePath URIs */ relativePath?: string; - /** - * If included, must match the ContentVersion in the template. - */ + /** If included, must match the ContentVersion in the template. */ contentVersion?: string; - /** - * The query string (for example, a SAS token) to be used with the templateLink URI. - */ + /** The query string (for example, a SAS token) to be used with the templateLink URI. */ queryString?: string; } -/** - * Entity representing the reference to the deployment parameters. - */ +/** Entity representing the reference to the deployment parameters. */ export interface ParametersLink { - /** - * The URI of the parameters file. - */ + /** The URI of the parameters file. */ uri: string; - /** - * If included, must match the ContentVersion in the template. - */ + /** If included, must match the ContentVersion in the template. */ contentVersion?: string; } -/** - * The debug setting. - */ +/** The debug setting. */ export interface DebugSetting { - /** - * Specifies the type of information to log for debugging. The permitted values are none, - * requestContent, responseContent, or both requestContent and responseContent separated by a - * comma. The default is none. When setting this value, carefully consider the type of - * information you are passing in during deployment. By logging information about the request or - * response, you could potentially expose sensitive data that is retrieved through the deployment - * operations. - */ + /** Specifies the type of information to log for debugging. The permitted values are none, requestContent, responseContent, or both requestContent and responseContent separated by a comma. The default is none. When setting this value, carefully consider the type of information you are passing in during deployment. By logging information about the request or response, you could potentially expose sensitive data that is retrieved through the deployment operations. */ detailLevel?: string; } -/** - * Deployment on error behavior. - */ +/** Deployment on error behavior. */ export interface OnErrorDeployment { - /** - * The deployment on error behavior type. Possible values are LastSuccessful and - * SpecificDeployment. Possible values include: 'LastSuccessful', 'SpecificDeployment' - */ + /** The deployment on error behavior type. Possible values are LastSuccessful and SpecificDeployment. */ type?: OnErrorDeploymentType; - /** - * The deployment to be used on error case. - */ + /** The deployment to be used on error case. */ deploymentName?: string; } -/** - * Specifies whether template expressions are evaluated within the scope of the parent template or - * nested template. - */ +/** Specifies whether template expressions are evaluated within the scope of the parent template or nested template. */ export interface ExpressionEvaluationOptions { - /** - * The scope to be used for evaluation of parameters, variables and functions in a nested - * template. Possible values include: 'NotSpecified', 'Outer', 'Inner' - */ + /** The scope to be used for evaluation of parameters, variables and functions in a nested template. */ scope?: ExpressionEvaluationOptionsScopeType; } -/** - * Deployment properties. - */ -export interface DeploymentProperties { - /** - * The template content. You use this element when you want to pass the template syntax directly - * in the request rather than link to an existing template. It can be a JObject or well-formed - * JSON string. Use either the templateLink property or the template property, but not both. - */ - template?: any; +/** Deployment information. */ +export interface DeploymentExtended { /** - * The URI of the template. Use either the templateLink property or the template property, but - * not both. - */ - templateLink?: TemplateLink; - /** - * Name and value pairs that define the deployment parameters for the template. You use this - * element when you want to provide the parameter values directly in the request rather than link - * to an existing parameter file. Use either the parametersLink property or the parameters - * property, but not both. It can be a JObject or a well formed JSON string. - */ - parameters?: any; - /** - * The URI of parameters file. You use this element to link to an existing parameters file. Use - * either the parametersLink property or the parameters property, but not both. + * The ID of the deployment. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - parametersLink?: ParametersLink; + readonly id?: string; /** - * The mode that is used to deploy resources. This value can be either Incremental or Complete. - * In Incremental mode, resources are deployed without deleting existing resources that are not - * included in the template. In Complete mode, resources are deployed and existing resources in - * the resource group that are not included in the template are deleted. Be careful when using - * Complete mode as you may unintentionally delete resources. Possible values include: - * 'Incremental', 'Complete' + * The name of the deployment. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - mode: DeploymentMode; + readonly name?: string; /** - * The debug setting of the deployment. + * The type of the deployment. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - debugSetting?: DebugSetting; + readonly type?: string; + /** the location of the deployment. */ + location?: string; + /** Deployment properties. */ + properties?: DeploymentPropertiesExtended; + /** Deployment tags */ + tags?: { [propertyName: string]: string }; +} + +/** Deployment properties with additional details. */ +export interface DeploymentPropertiesExtended { /** - * The deployment on error behavior. + * Denotes the state of provisioning. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - onErrorDeployment?: OnErrorDeployment; + readonly provisioningState?: ProvisioningState; /** - * Specifies whether template expressions are evaluated within the scope of the parent template - * or nested template. Only applicable to nested templates. If not specified, default value is - * outer. + * The correlation ID of the deployment. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - expressionEvaluationOptions?: ExpressionEvaluationOptions; -} - -/** - * Deployment operation parameters. - */ -export interface Deployment { + readonly correlationId?: string; /** - * The location to store the deployment data. + * The timestamp of the template deployment. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - location?: string; + readonly timestamp?: Date; /** - * The deployment properties. + * The duration of the template deployment. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - properties: DeploymentProperties; + readonly duration?: string; /** - * Deployment tags + * Key/value pairs that represent deployment output. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tags?: { [propertyName: string]: string }; -} - -/** - * Deployment operation parameters. - */ -export interface ScopedDeployment { + readonly outputs?: Record; /** - * The location to store the deployment data. + * The list of resource providers needed for the deployment. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - location: string; + readonly providers?: Provider[]; /** - * The deployment properties. + * The list of deployment dependencies. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - properties: DeploymentProperties; + readonly dependencies?: Dependency[]; /** - * Deployment tags + * The URI referencing the template. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tags?: { [propertyName: string]: string }; -} - -/** - * The deployment export result. - */ -export interface DeploymentExportResult { + readonly templateLink?: TemplateLink; /** - * The template content. + * Deployment parameters. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - template?: any; -} - -/** - * Deployment What-If operation settings. - */ -export interface DeploymentWhatIfSettings { + readonly parameters?: Record; /** - * The format of the What-If results. Possible values include: 'ResourceIdOnly', - * 'FullResourcePayloads' + * The URI referencing the parameters. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - resultFormat?: WhatIfResultFormat; -} - -/** - * Deployment What-if properties. - */ -export interface DeploymentWhatIfProperties extends DeploymentProperties { + readonly parametersLink?: ParametersLink; /** - * Optional What-If operation settings. + * The deployment mode. Possible values are Incremental and Complete. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - whatIfSettings?: DeploymentWhatIfSettings; -} - -/** - * Deployment What-if operation parameters. - */ -export interface DeploymentWhatIf { + readonly mode?: DeploymentMode; /** - * The location to store the deployment data. + * The debug setting of the deployment. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - location?: string; + readonly debugSetting?: DebugSetting; /** - * The deployment properties. + * The deployment on error behavior. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - properties: DeploymentWhatIfProperties; -} - -/** - * Deployment What-if operation parameters. - */ -export interface ScopedDeploymentWhatIf { + readonly onErrorDeployment?: OnErrorDeploymentExtended; /** - * The location to store the deployment data. + * The hash produced for the template. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - location: string; + readonly templateHash?: string; /** - * The deployment properties. + * Array of provisioned resources. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - properties: DeploymentWhatIfProperties; -} - -/** - * The resource management error additional info. - */ -export interface ErrorAdditionalInfo { + readonly outputResources?: ResourceReference[]; /** - * The additional info type. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Array of validated resources. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; + readonly validatedResources?: ResourceReference[]; /** - * The additional info. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The deployment error. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly info?: any; + readonly error?: ErrorResponse; } -/** - * Common error response for all Azure Resource Manager APIs to return error details for failed - * operations. (This also follows the OData error response format.) - * @summary Error Response - */ -export interface ErrorResponse { - /** - * The error code. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly code?: string; +/** Resource provider information. */ +export interface Provider { /** - * The error message. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The provider ID. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly message?: string; + readonly id?: string; + /** The namespace of the resource provider. */ + namespace?: string; /** - * The error target. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The registration state of the resource provider. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly target?: string; + readonly registrationState?: string; /** - * The error details. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The registration policy of the resource provider. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly details?: ErrorResponse[]; + readonly registrationPolicy?: string; /** - * The error additional info. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The collection of provider resource types. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly resourceTypes?: ProviderResourceType[]; + /** The provider authorization consent state. */ + providerAuthorizationConsentState?: ProviderAuthorizationConsentState; } -/** - * An interface representing ApiProfile. - */ -export interface ApiProfile { +/** Resource type managed by the resource provider. */ +export interface ProviderResourceType { + /** The resource type. */ + resourceType?: string; + /** The collection of locations where this resource type can be created. */ + locations?: string[]; + /** The location mappings that are supported by this resource type. */ + locationMappings?: ProviderExtendedLocation[]; + /** The aliases that are supported by this resource type. */ + aliases?: Alias[]; + /** The API version. */ + apiVersions?: string[]; /** - * The profile version. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The default API version. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly profileVersion?: string; + readonly defaultApiVersion?: string; /** - * The API version. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The API profiles for the resource provider. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly apiVersion?: string; + readonly apiProfiles?: ApiProfile[]; + /** The additional capabilities offered by this resource type. */ + capabilities?: string; + /** The properties. */ + properties?: { [propertyName: string]: string }; } -/** - * An interface representing AliasPathMetadata. - */ -export interface AliasPathMetadata { - /** - * The type of the token that the alias path is referring to. Possible values include: - * 'NotSpecified', 'Any', 'String', 'Object', 'Array', 'Integer', 'Number', 'Boolean' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly type?: AliasPathTokenType; - /** - * The attributes of the token that the alias path is referring to. Possible values include: - * 'None', 'Modifiable' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly attributes?: AliasPathAttributes; +/** The provider extended location. */ +export interface ProviderExtendedLocation { + /** The azure location. */ + location?: string; + /** The extended location type. */ + type?: string; + /** The extended locations for the azure location. */ + extendedLocations?: string[]; } -/** - * The type of the pattern for an alias path. - */ -export interface AliasPattern { - /** - * The alias pattern phrase. - */ - phrase?: string; - /** - * The alias pattern variable. - */ - variable?: string; +/** The alias type. */ +export interface Alias { + /** The alias name. */ + name?: string; + /** The paths for an alias. */ + paths?: AliasPath[]; + /** The type of the alias. */ + type?: AliasType; + /** The default path for an alias. */ + defaultPath?: string; + /** The default pattern for an alias. */ + defaultPattern?: AliasPattern; /** - * The type of alias pattern. Possible values include: 'NotSpecified', 'Extract' + * The default alias path metadata. Applies to the default path and to any alias path that doesn't have metadata + * NOTE: This property will not be serialized. It can only be populated by the server. */ - type?: AliasPatternType; + readonly defaultMetadata?: AliasPathMetadata; } -/** - * The type of the paths for alias. - */ +/** The type of the paths for alias. */ export interface AliasPath { - /** - * The path of an alias. - */ + /** The path of an alias. */ path?: string; - /** - * The API versions. - */ + /** The API versions. */ apiVersions?: string[]; - /** - * The pattern for an alias path. - */ + /** The pattern for an alias path. */ pattern?: AliasPattern; /** * The metadata of the alias path. If missing, fall back to the default metadata of the alias. - * **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 metadata?: AliasPathMetadata; } -/** - * The alias type. - */ -export interface Alias { - /** - * The alias name. - */ - name?: string; - /** - * The paths for an alias. - */ - paths?: AliasPath[]; - /** - * The type of the alias. Possible values include: 'NotSpecified', 'PlainText', 'Mask' - */ - type?: AliasType; - /** - * The default path for an alias. - */ - defaultPath?: string; - /** - * The default pattern for an alias. - */ - defaultPattern?: AliasPattern; - /** - * The default alias path metadata. Applies to the default path and to any alias path that - * doesn't have metadata - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly defaultMetadata?: AliasPathMetadata; +/** The type of the pattern for an alias path. */ +export interface AliasPattern { + /** The alias pattern phrase. */ + phrase?: string; + /** The alias pattern variable. */ + variable?: string; + /** The type of alias pattern */ + type?: AliasPatternType; } -/** - * The provider extended location. - */ -export interface ProviderExtendedLocation { - /** - * The azure location. - */ - location?: string; +export interface AliasPathMetadata { /** - * The extended location type. + * The type of the token that the alias path is referring to. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - type?: string; + readonly type?: AliasPathTokenType; /** - * The extended locations for the azure location. + * The attributes of the token that the alias path is referring to. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - extendedLocations?: string[]; + readonly attributes?: AliasPathAttributes; } -/** - * Resource type managed by the resource provider. - */ -export interface ProviderResourceType { - /** - * The resource type. - */ - resourceType?: string; - /** - * The collection of locations where this resource type can be created. - */ - locations?: string[]; - /** - * The location mappings that are supported by this resource type. - */ - locationMappings?: ProviderExtendedLocation[]; +export interface ApiProfile { /** - * The aliases that are supported by this resource type. + * The profile version. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - aliases?: Alias[]; + readonly profileVersion?: string; /** * The API version. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - apiVersions?: string[]; - /** - * The default API version. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly defaultApiVersion?: string; - /** - * The API profiles for the resource provider. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly apiProfiles?: ApiProfile[]; - /** - * The additional capabilities offered by this resource type. - */ - capabilities?: string; - /** - * The properties. - */ - properties?: { [propertyName: string]: string }; -} - -/** - * Resource provider information. - */ -export interface Provider { - /** - * The provider ID. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * The namespace of the resource provider. - */ - namespace?: string; - /** - * The registration state of the resource provider. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly registrationState?: string; - /** - * The registration policy of the resource provider. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly registrationPolicy?: string; - /** - * The collection of provider resource types. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly resourceTypes?: ProviderResourceType[]; + readonly apiVersion?: string; } -/** - * Deployment dependency information. - */ -export interface BasicDependency { - /** - * The ID of the dependency. - */ +/** Deployment dependency information. */ +export interface Dependency { + /** The list of dependencies. */ + dependsOn?: BasicDependency[]; + /** The ID of the dependency. */ id?: string; - /** - * The dependency resource type. - */ + /** The dependency resource type. */ resourceType?: string; - /** - * The dependency resource name. - */ + /** The dependency resource name. */ resourceName?: string; } -/** - * Deployment dependency information. - */ -export interface Dependency { - /** - * The list of dependencies. - */ - dependsOn?: BasicDependency[]; - /** - * The ID of the dependency. - */ +/** Deployment dependency information. */ +export interface BasicDependency { + /** The ID of the dependency. */ id?: string; - /** - * The dependency resource type. - */ + /** The dependency resource type. */ resourceType?: string; - /** - * The dependency resource name. - */ + /** The dependency resource name. */ resourceName?: string; } -/** - * Deployment on error behavior with additional details. - */ +/** Deployment on error behavior with additional details. */ export interface OnErrorDeploymentExtended { /** * The state of the provisioning for the on error deployment. - * **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 provisioningState?: string; - /** - * The deployment on error behavior type. Possible values are LastSuccessful and - * SpecificDeployment. Possible values include: 'LastSuccessful', 'SpecificDeployment' - */ + /** The deployment on error behavior type. Possible values are LastSuccessful and SpecificDeployment. */ type?: OnErrorDeploymentType; - /** - * The deployment to be used on error case. - */ + /** The deployment to be used on error case. */ deploymentName?: string; } -/** - * The resource Id model. - */ +/** The resource Id model. */ export interface ResourceReference { /** * The fully qualified 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; } -/** - * Deployment properties with additional details. - */ -export interface DeploymentPropertiesExtended { +/** Information from validate template deployment response. */ +export interface DeploymentValidateResult { /** - * Denotes the state of provisioning. Possible values include: 'NotSpecified', 'Accepted', - * 'Running', 'Ready', 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', - * 'Succeeded', 'Updating' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The deployment validation error. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provisioningState?: ProvisioningState; + readonly error?: ErrorResponse; + /** The template deployment properties. */ + properties?: DeploymentPropertiesExtended; +} + +/** The deployment export result. */ +export interface DeploymentExportResult { + /** The template content. */ + template?: Record; +} + +/** List of deployments. */ +export interface DeploymentListResult { + /** An array of deployments. */ + value?: DeploymentExtended[]; /** - * The correlation ID of the deployment. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The URL to use for getting the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly correlationId?: string; + readonly nextLink?: string; +} + +/** Deployment operation parameters. */ +export interface ScopedDeployment { + /** The location to store the deployment data. */ + location: string; + /** The deployment properties. */ + properties: DeploymentProperties; + /** Deployment tags */ + tags?: { [propertyName: string]: string }; +} + +/** Deployment What-if operation parameters. */ +export interface ScopedDeploymentWhatIf { + /** The location to store the deployment data. */ + location: string; + /** The deployment properties. */ + properties: DeploymentWhatIfProperties; +} + +/** Deployment What-If operation settings. */ +export interface DeploymentWhatIfSettings { + /** The format of the What-If results */ + resultFormat?: WhatIfResultFormat; +} + +/** Result of the What-If operation. Contains a list of predicted changes and a URL link to get to the next set of results. */ +export interface WhatIfOperationResult { + /** Status of the What-If operation. */ + status?: string; + /** Error when What-If operation fails. */ + error?: ErrorResponse; + /** List of resource changes predicted by What-If operation. */ + changes?: WhatIfChange[]; +} + +/** Information about a single resource change predicted by What-If operation. */ +export interface WhatIfChange { + /** Resource ID */ + resourceId: string; + /** Type of change that will be made to the resource when the deployment is executed. */ + changeType: ChangeType; + /** The explanation about why the resource is unsupported by What-If. */ + unsupportedReason?: string; + /** The snapshot of the resource before the deployment is executed. */ + before?: Record; + /** The predicted snapshot of the resource after the deployment is executed. */ + after?: Record; + /** The predicted changes to resource properties. */ + delta?: WhatIfPropertyChange[]; +} + +/** The predicted change to the resource property. */ +export interface WhatIfPropertyChange { + /** The path of the property. */ + path: string; + /** The type of property change. */ + propertyChangeType: PropertyChangeType; + /** The value of the property before the deployment is executed. */ + before?: Record; + /** The value of the property after the deployment is executed. */ + after?: Record; + /** Nested property changes. */ + children?: WhatIfPropertyChange[]; +} + +/** Deployment What-if operation parameters. */ +export interface DeploymentWhatIf { + /** The location to store the deployment data. */ + location?: string; + /** The deployment properties. */ + properties: DeploymentWhatIfProperties; +} + +/** List of provider permissions. */ +export interface ProviderPermissionListResult { + /** An array of provider permissions. */ + value?: ProviderPermission[]; /** - * The timestamp of the template deployment. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The URL to use for getting the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly timestamp?: Date; + readonly nextLink?: string; +} + +/** The provider permission */ +export interface ProviderPermission { + /** The application id. */ + applicationId?: string; + /** Role definition properties. */ + roleDefinition?: RoleDefinition; + /** Role definition properties. */ + managedByRoleDefinition?: RoleDefinition; + /** The provider authorization consent state. */ + providerAuthorizationConsentState?: ProviderAuthorizationConsentState; +} + +/** Role definition properties. */ +export interface RoleDefinition { + /** The role definition ID. */ + id?: string; + /** The role definition name. */ + name?: string; + /** If this is a service role. */ + isServiceRole?: boolean; + /** Role definition permissions. */ + permissions?: Permission[]; + /** Role definition assignable scopes. */ + scopes?: string[]; +} + +/** Role definition permissions. */ +export interface Permission { + /** Allowed actions. */ + actions?: string[]; + /** Denied actions. */ + notActions?: string[]; + /** Allowed Data actions. */ + dataActions?: string[]; + /** Denied Data actions. */ + notDataActions?: string[]; +} + +/** The provider registration definition. */ +export interface ProviderRegistrationRequest { + /** The provider consent. */ + thirdPartyProviderConsent?: ProviderConsentDefinition; +} + +/** The provider consent. */ +export interface ProviderConsentDefinition { + /** A value indicating whether authorization is consented or not. */ + consentToAuthorization?: boolean; +} + +/** List of resource providers. */ +export interface ProviderListResult { + /** An array of resource providers. */ + value?: Provider[]; /** - * The duration of the template deployment. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The URL to use for getting the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly duration?: string; + readonly nextLink?: string; +} + +/** List of resource types of a resource provider. */ +export interface ProviderResourceTypeListResult { + /** An array of resource types. */ + value?: ProviderResourceType[]; /** - * Key/value pairs that represent deployment output. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The URL to use for getting the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly outputs?: any; + readonly nextLink?: string; +} + +/** List of resource groups. */ +export interface ResourceListResult { + /** An array of resources. */ + value?: GenericResourceExpanded[]; /** - * The list of resource providers needed for the deployment. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The URL to use for getting the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly providers?: Provider[]; - /** - * The list of deployment dependencies. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly dependencies?: Dependency[]; - /** - * The URI referencing the template. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly templateLink?: TemplateLink; - /** - * Deployment parameters. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly parameters?: any; - /** - * The URI referencing the parameters. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly parametersLink?: ParametersLink; - /** - * The deployment mode. Possible values are Incremental and Complete. Possible values include: - * 'Incremental', 'Complete' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly mode?: DeploymentMode; - /** - * The debug setting of the deployment. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly debugSetting?: DebugSetting; - /** - * The deployment on error behavior. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly onErrorDeployment?: OnErrorDeploymentExtended; - /** - * The hash produced for the template. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly templateHash?: string; - /** - * Array of provisioned resources. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly outputResources?: ResourceReference[]; - /** - * Array of validated resources. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly validatedResources?: ResourceReference[]; - /** - * The deployment error. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly error?: ErrorResponse; -} - -/** - * Information from validate template deployment response. - */ -export interface DeploymentValidateResult { - /** - * The deployment validation error. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly error?: ErrorResponse; - /** - * The template deployment properties. - */ - properties?: DeploymentPropertiesExtended; + readonly nextLink?: string; } -/** - * Deployment information. - */ -export interface DeploymentExtended extends BaseResource { +/** Specified resource. */ +export interface Resource { /** - * The ID of the deployment. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Resource ID + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * The name of the deployment. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Resource name + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * The type of the deployment. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Resource type + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; - /** - * the location of the deployment. - */ + /** Resource location */ location?: string; - /** - * Deployment properties. - */ - properties?: DeploymentPropertiesExtended; - /** - * Deployment tags - */ + /** Resource extended location. */ + extendedLocation?: ExtendedLocation; + /** Resource tags */ tags?: { [propertyName: string]: string }; } -/** - * List of resource types of a resource provider. - */ -export interface ProviderResourceTypeListResult { - /** - * An array of resource types. - */ - value?: ProviderResourceType[]; - /** - * The URL to use for getting the next set of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; +/** Resource extended location. */ +export interface ExtendedLocation { + /** The extended location type. */ + type?: ExtendedLocationType; + /** The extended location name. */ + name?: string; } -/** - * Plan for the resource. - */ +/** Plan for the resource. */ export interface Plan { - /** - * The plan ID. - */ + /** The plan ID. */ name?: string; - /** - * The publisher ID. - */ + /** The publisher ID. */ publisher?: string; - /** - * The offer ID. - */ + /** The offer ID. */ product?: string; - /** - * The promotion code. - */ + /** The promotion code. */ promotionCode?: string; - /** - * The plan's version. - */ + /** The plan's version. */ version?: string; } -/** - * SKU for the resource. - */ +/** SKU for the resource. */ export interface Sku { - /** - * The SKU name. - */ + /** The SKU name. */ name?: string; - /** - * The SKU tier. - */ + /** The SKU tier. */ tier?: string; - /** - * The SKU size. - */ + /** The SKU size. */ size?: string; - /** - * The SKU family. - */ + /** The SKU family. */ family?: string; - /** - * The SKU model. - */ + /** The SKU model. */ model?: string; - /** - * The SKU capacity. - */ + /** The SKU capacity. */ capacity?: number; } -/** - * An interface representing IdentityUserAssignedIdentitiesValue. - */ -export interface IdentityUserAssignedIdentitiesValue { - /** - * The principal id of 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 user assigned identity. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly clientId?: string; -} - -/** - * Identity for the resource. - */ +/** Identity for the resource. */ export interface Identity { /** * The principal ID of resource identity. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly principalId?: string; /** * The tenant ID of resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly tenantId?: string; + /** The identity type. */ + type?: ResourceIdentityType; + /** The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ + userAssignedIdentities?: { + [propertyName: string]: IdentityUserAssignedIdentitiesValue; + }; +} + +export interface IdentityUserAssignedIdentitiesValue { /** - * The identity type. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, - * UserAssigned', 'None' + * The principal id of user assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - type?: ResourceIdentityType; + readonly principalId?: string; /** - * The list of user identities associated with the resource. The user identity dictionary key - * references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * The client id of user assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - userAssignedIdentities?: { [propertyName: string]: IdentityUserAssignedIdentitiesValue }; + readonly clientId?: string; } -/** - * Specified resource. - */ -export interface Resource extends BaseResource { +/** Resource group information. */ +export interface ResourceGroup { /** - * Resource ID - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The ID of the resource group. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * Resource name - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The name of the resource group. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * Resource type - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The type of the resource group. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; - /** - * Resource location - */ - location?: string; - /** - * Resource extended location. - */ - extendedLocation?: ExtendedLocation; - /** - * Resource tags - */ + /** The resource group properties. */ + properties?: ResourceGroupProperties; + /** The location of the resource group. It cannot be changed after the resource group has been created. It must be one of the supported Azure locations. */ + location: string; + /** The ID of the resource that manages this resource group. */ + managedBy?: string; + /** The tags attached to the resource group. */ tags?: { [propertyName: string]: string }; } -/** - * Resource information. - */ -export interface GenericResource extends Resource { - /** - * The plan of the resource. - */ - plan?: Plan; - /** - * The resource properties. - */ - properties?: any; - /** - * The kind of the resource. - */ - kind?: string; - /** - * ID of the resource that manages this resource. - */ - managedBy?: string; - /** - * The SKU of the resource. - */ - sku?: Sku; +/** The resource group properties. */ +export interface ResourceGroupProperties { /** - * The identity of the resource. + * The provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - identity?: Identity; + readonly provisioningState?: string; } -/** - * Resource extended location. - */ -export interface ExtendedLocation { - /** - * The extended location type. Possible values include: 'EdgeZone' - */ - type?: ExtendedLocationType; - /** - * The extended location name. - */ +/** Resource group information. */ +export interface ResourceGroupPatchable { + /** The name of the resource group. */ name?: string; + /** The resource group properties. */ + properties?: ResourceGroupProperties; + /** The ID of the resource that manages this resource group. */ + managedBy?: string; + /** The tags attached to the resource group. */ + tags?: { [propertyName: string]: string }; } -/** - * Resource information. - */ -export interface GenericResourceExpanded extends GenericResource { +/** Export resource group template request parameters. */ +export interface ExportTemplateRequest { + /** The IDs of the resources to filter the export by. To export all resources, supply an array with single entry '*'. */ + resources?: string[]; + /** The export template options. A CSV-formatted list containing zero or more of the following: 'IncludeParameterDefaultValue', 'IncludeComments', 'SkipResourceNameParameterization', 'SkipAllParameterization' */ + options?: string; +} + +/** Resource group export result. */ +export interface ResourceGroupExportResult { + /** The template content. */ + template?: Record; + /** The template export error. */ + error?: ErrorResponse; +} + +/** List of resource groups. */ +export interface ResourceGroupListResult { + /** An array of resource groups. */ + value?: ResourceGroup[]; /** - * The created time of the resource. This is only present if requested via the $expand query - * parameter. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The URL to use for getting the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly createdTime?: Date; + readonly nextLink?: string; +} + +/** Parameters of move resources. */ +export interface ResourcesMoveInfo { + /** The IDs of the resources. */ + resources?: string[]; + /** The target resource group. */ + targetResourceGroup?: string; +} + +/** Tag information. */ +export interface TagValue { /** - * The changed time of the resource. This is only present if requested via the $expand query - * parameter. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The tag value ID. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly changedTime?: Date; + readonly id?: string; + /** The tag value. */ + tagValue?: string; + /** The tag value count. */ + count?: TagCount; +} + +/** Tag count. */ +export interface TagCount { + /** Type of count. */ + type?: string; + /** Value of count. */ + value?: number; +} + +/** Tag details. */ +export interface TagDetails { /** - * The provisioning state of the resource. This is only present if requested via the $expand - * query parameter. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The tag name ID. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provisioningState?: string; + readonly id?: string; + /** The tag name. */ + tagName?: string; + /** The total number of resources that use the resource tag. When a tag is initially created and has no associated resources, the value is 0. */ + count?: TagCount; + /** The list of tag values. */ + values?: TagValue[]; } -/** - * The resource group properties. - */ -export interface ResourceGroupProperties { +/** List of subscription tags. */ +export interface TagsListResult { + /** An array of tags. */ + value?: TagDetails[]; /** - * The provisioning state. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The URL to use for getting the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provisioningState?: string; + readonly nextLink?: string; } -/** - * Resource group information. - */ -export interface ResourceGroup extends BaseResource { +/** Deployment operation information. */ +export interface DeploymentOperation { /** - * The ID of the resource group. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Full deployment operation ID. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * The name of the resource group. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Deployment operation ID. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly operationId?: string; + /** Deployment properties. */ + properties?: DeploymentOperationProperties; +} + +/** Deployment operation properties. */ +export interface DeploymentOperationProperties { /** - * The type of the resource group. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The name of the current provisioning operation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; + readonly provisioningOperation?: ProvisioningOperation; /** - * The resource group properties. + * The state of the provisioning. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - properties?: ResourceGroupProperties; + readonly provisioningState?: string; /** - * The location of the resource group. It cannot be changed after the resource group has been - * created. It must be one of the supported Azure locations. + * The date and time of the operation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - location: string; + readonly timestamp?: Date; /** - * The ID of the resource that manages this resource group. + * The duration of the operation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - managedBy?: string; + readonly duration?: string; /** - * The tags attached to the resource group. + * Deployment operation service request id. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tags?: { [propertyName: string]: string }; -} - -/** - * Resource group information. - */ -export interface ResourceGroupPatchable { - /** - * The name of the resource group. - */ - name?: string; + readonly serviceRequestId?: string; /** - * The resource group properties. + * Operation status code from the resource provider. This property may not be set if a response has not yet been received. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - properties?: ResourceGroupProperties; + readonly statusCode?: string; /** - * The ID of the resource that manages this resource group. + * Operation status message from the resource provider. This property is optional. It will only be provided if an error was received from the resource provider. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - managedBy?: string; + readonly statusMessage?: StatusMessage; /** - * The tags attached to the resource group. + * The target resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tags?: { [propertyName: string]: string }; -} - -/** - * Parameters of move resources. - */ -export interface ResourcesMoveInfo { + readonly targetResource?: TargetResource; /** - * The IDs of the resources. + * The HTTP request message. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - resources?: string[]; + readonly request?: HttpMessage; /** - * The target resource group. + * The HTTP response message. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - targetResourceGroup?: string; + readonly response?: HttpMessage; } -/** - * Export resource group template request parameters. - */ -export interface ExportTemplateRequest { - /** - * The IDs of the resources to filter the export by. To export all resources, supply an array - * with single entry '*'. - */ - resources?: string[]; - /** - * The export template options. A CSV-formatted list containing zero or more of the following: - * 'IncludeParameterDefaultValue', 'IncludeComments', 'SkipResourceNameParameterization', - * 'SkipAllParameterization' - */ - options?: string; +/** Operation status message object. */ +export interface StatusMessage { + /** Status of the deployment operation. */ + status?: string; + /** The error reported by the operation. */ + error?: ErrorResponse; } -/** - * Tag count. - */ -export interface TagCount { - /** - * Type of count. - */ - type?: string; - /** - * Value of count. - */ - value?: number; +/** Target resource. */ +export interface TargetResource { + /** The ID of the resource. */ + id?: string; + /** The name of the resource. */ + resourceName?: string; + /** The type of the resource. */ + resourceType?: string; } -/** - * Tag information. - */ -export interface TagValue extends BaseResource { - /** - * The tag value ID. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * The tag value. - */ - tagValue?: string; +/** HTTP message. */ +export interface HttpMessage { + /** HTTP message content. */ + content?: Record; +} + +/** List of deployment operations. */ +export interface DeploymentOperationsListResult { + /** An array of deployment operations. */ + value?: DeploymentOperation[]; /** - * The tag value count. + * The URL to use for getting the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - count?: TagCount; + readonly nextLink?: string; } -/** - * Tag details. - */ -export interface TagDetails extends BaseResource { +/** Result of the request to calculate template hash. It contains a string of minified template and its hash. */ +export interface TemplateHashResult { + /** The minified template string. */ + minifiedTemplate?: string; + /** The template hash. */ + templateHash?: string; +} + +/** Wrapper resource for tags API requests and responses. */ +export interface TagsResource { /** - * The tag name ID. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The ID of the tags wrapper resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * The tag name. - */ - tagName?: string; - /** - * The total number of resources that use the resource tag. When a tag is initially created and - * has no associated resources, the value is 0. + * The name of the tags wrapper resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - count?: TagCount; + readonly name?: string; /** - * The list of tag values. + * The type of the tags wrapper resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - values?: TagValue[]; + readonly type?: string; + /** The set of tags. */ + properties: Tags; } -/** - * Target resource. - */ -export interface TargetResource { - /** - * The ID of the resource. - */ - id?: string; - /** - * The name of the resource. - */ - resourceName?: string; - /** - * The type of the resource. - */ - resourceType?: string; +/** A dictionary of name and value pairs. */ +export interface Tags { + /** Dictionary of */ + tags?: { [propertyName: string]: string }; } -/** - * HTTP message. - */ -export interface HttpMessage { - /** - * HTTP message content. - */ - content?: any; +/** Wrapper resource for tags patch API request only. */ +export interface TagsPatchResource { + /** The operation type for the patch API. */ + operation?: TagsPatchOperation; + /** The set of tags. */ + properties?: Tags; } -/** - * Operation status message object. - */ -export interface StatusMessage { - /** - * Status of the deployment operation. - */ - status?: string; - /** - * The error reported by the operation. - */ - error?: ErrorResponse; +/** Deployment filter. */ +export interface DeploymentExtendedFilter { + /** The provisioning state. */ + provisioningState?: string; } -/** - * Deployment operation properties. - */ -export interface DeploymentOperationProperties { - /** - * The name of the current provisioning operation. Possible values include: 'NotSpecified', - * 'Create', 'Delete', 'Waiting', 'AzureAsyncOperationWaiting', 'ResourceCacheWaiting', 'Action', - * 'Read', 'EvaluateDeploymentOutput', 'DeploymentCleanup' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly provisioningOperation?: ProvisioningOperation; - /** - * The state of the provisioning. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly provisioningState?: string; - /** - * The date and time of the operation. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly timestamp?: Date; - /** - * The duration of the operation. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly duration?: string; - /** - * Deployment operation service request id. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly serviceRequestId?: string; - /** - * Operation status code from the resource provider. This property may not be set if a response - * has not yet been received. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly statusCode?: string; - /** - * Operation status message from the resource provider. This property is optional. It will only - * be provided if an error was received from the resource provider. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly statusMessage?: StatusMessage; - /** - * The target resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly targetResource?: TargetResource; - /** - * The HTTP request message. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly request?: HttpMessage; - /** - * The HTTP response message. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly response?: HttpMessage; +/** Resource filter. */ +export interface GenericResourceFilter { + /** The resource type. */ + resourceType?: string; + /** The tag name. */ + tagname?: string; + /** The tag value. */ + tagvalue?: string; } -/** - * Deployment operation information. - */ -export interface DeploymentOperation { - /** - * Full deployment operation ID. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * Deployment operation ID. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly operationId?: string; - /** - * Deployment properties. - */ - properties?: DeploymentOperationProperties; +/** Resource group filter. */ +export interface ResourceGroupFilter { + /** The tag name. */ + tagName?: string; + /** The tag value. */ + tagValue?: string; } -/** - * Resource provider operation's display properties. - */ +/** Resource provider operation's display properties. */ export interface ResourceProviderOperationDisplayProperties { - /** - * Operation description. - */ + /** Operation description. */ publisher?: string; - /** - * Operation provider. - */ + /** Operation provider. */ provider?: string; - /** - * Operation resource. - */ + /** Operation resource. */ resource?: string; - /** - * Resource provider operation. - */ + /** Resource provider operation. */ operation?: string; - /** - * Operation description. - */ + /** Operation description. */ description?: string; } -/** - * Sub-resource. - */ -export interface SubResource extends BaseResource { - /** - * Resource ID - */ +/** Sub-resource. */ +export interface SubResource { + /** Resource ID */ id?: string; } -/** - * Resource group export result. - */ -export interface ResourceGroupExportResult { - /** - * The template content. - */ - template?: any; - /** - * The template export error. - */ - error?: ErrorResponse; -} +/** Deployment What-if properties. */ +export type DeploymentWhatIfProperties = DeploymentProperties & { + /** Optional What-If operation settings. */ + whatIfSettings?: DeploymentWhatIfSettings; +}; -/** - * The object that represents the operation. - */ -export interface OperationDisplay { - /** - * Service provider: Microsoft.Resources - */ - provider?: string; +/** Resource information. */ +export type GenericResource = Resource & { + /** The plan of the resource. */ + plan?: Plan; + /** The resource properties. */ + properties?: Record; + /** The kind of the resource. */ + kind?: string; + /** ID of the resource that manages this resource. */ + managedBy?: string; + /** The SKU of the resource. */ + sku?: Sku; + /** The identity of the resource. */ + identity?: Identity; +}; + +/** Resource information. */ +export type GenericResourceExpanded = GenericResource & { /** - * Resource on which the operation is performed: Profile, endpoint, etc. + * The created time of the resource. This is only present if requested via the $expand query parameter. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - resource?: string; + readonly createdTime?: Date; /** - * Operation type: Read, write, delete, etc. + * The changed time of the resource. This is only present if requested via the $expand query parameter. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - operation?: string; + readonly changedTime?: Date; /** - * Description of the operation. + * The provisioning state of the resource. This is only present if requested via the $expand query parameter. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - description?: string; + readonly provisioningState?: string; +}; + +/** Defines headers for Deployments_whatIfAtTenantScope operation. */ +export interface DeploymentsWhatIfAtTenantScopeHeaders { + /** URL to get status of this long-running operation. */ + location?: string; + /** Number of seconds to wait before polling for status. */ + retryAfter?: string; } -/** - * Microsoft.Resources operation - */ -export interface Operation { - /** - * Operation name: {provider}/{resource}/{operation} - */ - name?: string; - /** - * The object that represents the operation. - */ - display?: OperationDisplay; +/** Defines headers for Deployments_whatIfAtManagementGroupScope operation. */ +export interface DeploymentsWhatIfAtManagementGroupScopeHeaders { + /** URL to get status of this long-running operation. */ + location?: string; + /** Number of seconds to wait before polling for status. */ + retryAfter?: string; } -/** - * Result of the request to calculate template hash. It contains a string of minified template and - * its hash. - */ -export interface TemplateHashResult { - /** - * The minified template string. - */ - minifiedTemplate?: string; - /** - * The template hash. - */ - templateHash?: string; +/** Defines headers for Deployments_whatIfAtSubscriptionScope operation. */ +export interface DeploymentsWhatIfAtSubscriptionScopeHeaders { + /** URL to get status of this long-running operation. */ + location?: string; + /** Number of seconds to wait before polling for status. */ + retryAfter?: string; } -/** - * The predicted change to the resource property. - */ -export interface WhatIfPropertyChange { - /** - * The path of the property. - */ - path: string; - /** - * The type of property change. Possible values include: 'Create', 'Delete', 'Modify', 'Array', - * 'NoEffect' - */ - propertyChangeType: PropertyChangeType; - /** - * The value of the property before the deployment is executed. - */ - before?: any; - /** - * The value of the property after the deployment is executed. - */ - after?: any; - /** - * Nested property changes. - */ - children?: WhatIfPropertyChange[]; -} +/** Defines headers for Deployments_whatIf operation. */ +export interface DeploymentsWhatIfHeaders { + /** URL to get status of this long-running operation. */ + location?: string; + /** Number of seconds to wait before polling for status. */ + retryAfter?: string; +} + +/** Known values of {@link ExpressionEvaluationOptionsScopeType} that the service accepts. */ +export enum KnownExpressionEvaluationOptionsScopeType { + NotSpecified = "NotSpecified", + Outer = "Outer", + Inner = "Inner" +} + +/** + * Defines values for ExpressionEvaluationOptionsScopeType. \ + * {@link KnownExpressionEvaluationOptionsScopeType} can be used interchangeably with ExpressionEvaluationOptionsScopeType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NotSpecified** \ + * **Outer** \ + * **Inner** + */ +export type ExpressionEvaluationOptionsScopeType = string; + +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + NotSpecified = "NotSpecified", + Accepted = "Accepted", + Running = "Running", + Ready = "Ready", + Creating = "Creating", + Created = "Created", + Deleting = "Deleting", + Deleted = "Deleted", + Canceled = "Canceled", + Failed = "Failed", + Succeeded = "Succeeded", + Updating = "Updating" +} + +/** + * 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 + * **NotSpecified** \ + * **Accepted** \ + * **Running** \ + * **Ready** \ + * **Creating** \ + * **Created** \ + * **Deleting** \ + * **Deleted** \ + * **Canceled** \ + * **Failed** \ + * **Succeeded** \ + * **Updating** + */ +export type ProvisioningState = string; + +/** Known values of {@link AliasPathTokenType} that the service accepts. */ +export enum KnownAliasPathTokenType { + /** The token type is not specified. */ + NotSpecified = "NotSpecified", + /** The token type can be anything. */ + Any = "Any", + /** The token type is string. */ + String = "String", + /** The token type is object. */ + Object = "Object", + /** The token type is array. */ + Array = "Array", + /** The token type is integer. */ + Integer = "Integer", + /** The token type is number. */ + Number = "Number", + /** The token type is boolean. */ + Boolean = "Boolean" +} + +/** + * Defines values for AliasPathTokenType. \ + * {@link KnownAliasPathTokenType} can be used interchangeably with AliasPathTokenType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NotSpecified**: The token type is not specified. \ + * **Any**: The token type can be anything. \ + * **String**: The token type is string. \ + * **Object**: The token type is object. \ + * **Array**: The token type is array. \ + * **Integer**: The token type is integer. \ + * **Number**: The token type is number. \ + * **Boolean**: The token type is boolean. + */ +export type AliasPathTokenType = string; + +/** Known values of {@link AliasPathAttributes} that the service accepts. */ +export enum KnownAliasPathAttributes { + /** The token that the alias path is referring to has no attributes. */ + None = "None", + /** The token that the alias path is referring to is modifiable by policies with 'modify' effect. */ + Modifiable = "Modifiable" +} + +/** + * Defines values for AliasPathAttributes. \ + * {@link KnownAliasPathAttributes} can be used interchangeably with AliasPathAttributes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None**: The token that the alias path is referring to has no attributes. \ + * **Modifiable**: The token that the alias path is referring to is modifiable by policies with 'modify' effect. + */ +export type AliasPathAttributes = string; + +/** Known values of {@link ProviderAuthorizationConsentState} that the service accepts. */ +export enum KnownProviderAuthorizationConsentState { + NotSpecified = "NotSpecified", + Required = "Required", + NotRequired = "NotRequired", + Consented = "Consented" +} + +/** + * Defines values for ProviderAuthorizationConsentState. \ + * {@link KnownProviderAuthorizationConsentState} can be used interchangeably with ProviderAuthorizationConsentState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NotSpecified** \ + * **Required** \ + * **NotRequired** \ + * **Consented** + */ +export type ProviderAuthorizationConsentState = string; + +/** Known values of {@link ExtendedLocationType} that the service accepts. */ +export enum KnownExtendedLocationType { + EdgeZone = "EdgeZone" +} + +/** + * Defines values for ExtendedLocationType. \ + * {@link KnownExtendedLocationType} can be used interchangeably with ExtendedLocationType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **EdgeZone** + */ +export type ExtendedLocationType = string; + +/** Known values of {@link TagsPatchOperation} that the service accepts. */ +export enum KnownTagsPatchOperation { + /** The 'replace' option replaces the entire set of existing tags with a new set. */ + Replace = "Replace", + /** The 'merge' option allows adding tags with new names and updating the values of tags with existing names. */ + Merge = "Merge", + /** The 'delete' option allows selectively deleting tags based on given names or name/value pairs. */ + Delete = "Delete" +} + +/** + * Defines values for TagsPatchOperation. \ + * {@link KnownTagsPatchOperation} can be used interchangeably with TagsPatchOperation, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Replace**: The 'replace' option replaces the entire set of existing tags with a new set. \ + * **Merge**: The 'merge' option allows adding tags with new names and updating the values of tags with existing names. \ + * **Delete**: The 'delete' option allows selectively deleting tags based on given names or name\/value pairs. + */ +export type TagsPatchOperation = string; +/** Defines values for DeploymentMode. */ +export type DeploymentMode = "Incremental" | "Complete"; +/** Defines values for OnErrorDeploymentType. */ +export type OnErrorDeploymentType = "LastSuccessful" | "SpecificDeployment"; +/** Defines values for AliasPatternType. */ +export type AliasPatternType = "NotSpecified" | "Extract"; +/** Defines values for AliasType. */ +export type AliasType = "NotSpecified" | "PlainText" | "Mask"; +/** Defines values for WhatIfResultFormat. */ +export type WhatIfResultFormat = "ResourceIdOnly" | "FullResourcePayloads"; +/** Defines values for ChangeType. */ +export type ChangeType = + | "Create" + | "Delete" + | "Ignore" + | "Deploy" + | "NoChange" + | "Modify" + | "Unsupported"; +/** Defines values for PropertyChangeType. */ +export type PropertyChangeType = + | "Create" + | "Delete" + | "Modify" + | "Array" + | "NoEffect"; +/** Defines values for ResourceIdentityType. */ +export type ResourceIdentityType = + | "SystemAssigned" + | "UserAssigned" + | "SystemAssigned, UserAssigned" + | "None"; +/** Defines values for ProvisioningOperation. */ +export type ProvisioningOperation = + | "NotSpecified" + | "Create" + | "Delete" + | "Waiting" + | "AzureAsyncOperationWaiting" + | "ResourceCacheWaiting" + | "Action" + | "Read" + | "EvaluateDeploymentOutput" + | "DeploymentCleanup"; -/** - * Information about a single resource change predicted by What-If operation. - */ -export interface WhatIfChange { - /** - * Resource ID - */ - resourceId: string; - /** - * Type of change that will be made to the resource when the deployment is executed. Possible - * values include: 'Create', 'Delete', 'Ignore', 'Deploy', 'NoChange', 'Modify', 'Unsupported' - */ - changeType: ChangeType; - /** - * The explanation about why the resource is unsupported by What-If. - */ - unsupportedReason?: string; - /** - * The snapshot of the resource before the deployment is executed. - */ - before?: any; - /** - * The predicted snapshot of the resource after the deployment is executed. - */ - after?: any; - /** - * The predicted changes to resource properties. - */ - delta?: WhatIfPropertyChange[]; -} +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} -/** - * Result of the What-If operation. Contains a list of predicted changes and a URL link to get to - * the next set of results. - */ -export interface WhatIfOperationResult { - /** - * Status of the What-If operation. - */ - status?: string; - /** - * List of resource changes predicted by What-If operation. - */ - changes?: WhatIfChange[]; - /** - * Error when What-If operation fails. - */ - error?: ErrorResponse; -} +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; -/** - * A dictionary of name and value pairs. - */ -export interface Tags { - tags?: { [propertyName: string]: string }; -} +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Wrapper resource for tags patch API request only. - */ -export interface TagsPatchResource { - /** - * The operation type for the patch API. Possible values include: 'Replace', 'Merge', 'Delete' - */ - operation?: TagsPatchOperation; - /** - * The set of tags. - */ - properties?: Tags; -} +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; -/** - * Wrapper resource for tags API requests and responses. - */ -export interface TagsResource extends BaseResource { - /** - * The ID of the tags wrapper resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * The name of the tags wrapper resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * The type of the tags wrapper resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly type?: string; - /** - * The set of tags. - */ - properties: Tags; -} +/** Optional parameters. */ +export interface OperationsListNextNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Optional Parameters. - */ -export interface DeploymentsListAtScopeOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - */ - filter?: string; - /** - * The number of results to get. If null is passed, returns all deployments. - */ - top?: number; -} +/** Contains response data for the listNextNext operation. */ +export type OperationsListNextNextResponse = OperationListResult; -/** - * Optional Parameters. - */ -export interface DeploymentsListAtTenantScopeOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - */ - filter?: string; - /** - * The number of results to get. If null is passed, returns all deployments. - */ - top?: number; +/** Optional parameters. */ +export interface DeploymentsDeleteAtScopeOptionalParams + 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 DeploymentsListAtManagementGroupScopeOptionalParams - extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - */ - filter?: string; - /** - * The number of results to get. If null is passed, returns all deployments. - */ - top?: number; +/** Optional parameters. */ +export interface DeploymentsCheckExistenceAtScopeOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the checkExistenceAtScope operation. */ +export type DeploymentsCheckExistenceAtScopeResponse = { + body: boolean; +}; + +/** Optional parameters. */ +export interface DeploymentsCreateOrUpdateAtScopeOptionalParams + 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 DeploymentsListAtSubscriptionScopeOptionalParams - extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - */ - filter?: string; - /** - * The number of results to get. If null is passed, returns all deployments. - */ - top?: number; +/** Contains response data for the createOrUpdateAtScope operation. */ +export type DeploymentsCreateOrUpdateAtScopeResponse = DeploymentExtended; + +/** Optional parameters. */ +export interface DeploymentsGetAtScopeOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getAtScope operation. */ +export type DeploymentsGetAtScopeResponse = DeploymentExtended; + +/** Optional parameters. */ +export interface DeploymentsCancelAtScopeOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface DeploymentsValidateAtScopeOptionalParams + 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 DeploymentsListByResourceGroupOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - */ +/** Contains response data for the validateAtScope operation. */ +export type DeploymentsValidateAtScopeResponse = DeploymentValidateResult; + +/** Optional parameters. */ +export interface DeploymentsExportTemplateAtScopeOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the exportTemplateAtScope operation. */ +export type DeploymentsExportTemplateAtScopeResponse = DeploymentExportResult; + +/** Optional parameters. */ +export interface DeploymentsListAtScopeOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'. */ filter?: string; - /** - * The number of results to get. If null is passed, returns all deployments. - */ + /** The number of results to get. If null is passed, returns all deployments. */ top?: number; } -/** - * Optional Parameters. - */ -export interface DeploymentsListAtScopeNextOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - */ - filter?: string; - /** - * The number of results to get. If null is passed, returns all deployments. - */ - top?: number; +/** Contains response data for the listAtScope operation. */ +export type DeploymentsListAtScopeResponse = DeploymentListResult; + +/** Optional parameters. */ +export interface DeploymentsDeleteAtTenantScopeOptionalParams + 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 DeploymentsListAtTenantScopeNextOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - */ - filter?: string; - /** - * The number of results to get. If null is passed, returns all deployments. - */ - top?: number; +/** Optional parameters. */ +export interface DeploymentsCheckExistenceAtTenantScopeOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the checkExistenceAtTenantScope operation. */ +export type DeploymentsCheckExistenceAtTenantScopeResponse = { + body: boolean; +}; + +/** Optional parameters. */ +export interface DeploymentsCreateOrUpdateAtTenantScopeOptionalParams + 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 DeploymentsListAtManagementGroupScopeNextOptionalParams - extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - */ - filter?: string; - /** - * The number of results to get. If null is passed, returns all deployments. - */ - top?: number; +/** Contains response data for the createOrUpdateAtTenantScope operation. */ +export type DeploymentsCreateOrUpdateAtTenantScopeResponse = DeploymentExtended; + +/** Optional parameters. */ +export interface DeploymentsGetAtTenantScopeOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getAtTenantScope operation. */ +export type DeploymentsGetAtTenantScopeResponse = DeploymentExtended; + +/** Optional parameters. */ +export interface DeploymentsCancelAtTenantScopeOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface DeploymentsValidateAtTenantScopeOptionalParams + 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 DeploymentsListAtSubscriptionScopeNextOptionalParams - extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - */ - filter?: string; - /** - * The number of results to get. If null is passed, returns all deployments. - */ - top?: number; +/** Contains response data for the validateAtTenantScope operation. */ +export type DeploymentsValidateAtTenantScopeResponse = DeploymentValidateResult; + +/** Optional parameters. */ +export interface DeploymentsWhatIfAtTenantScopeOptionalParams + 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 DeploymentsListByResourceGroupNextOptionalParams - extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - */ +/** Contains response data for the whatIfAtTenantScope operation. */ +export type DeploymentsWhatIfAtTenantScopeResponse = WhatIfOperationResult; + +/** Optional parameters. */ +export interface DeploymentsExportTemplateAtTenantScopeOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the exportTemplateAtTenantScope operation. */ +export type DeploymentsExportTemplateAtTenantScopeResponse = DeploymentExportResult; + +/** Optional parameters. */ +export interface DeploymentsListAtTenantScopeOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'. */ filter?: string; - /** - * The number of results to get. If null is passed, returns all deployments. - */ + /** The number of results to get. If null is passed, returns all deployments. */ top?: number; } -/** - * Optional Parameters. - */ -export interface ProvidersListOptionalParams extends msRest.RequestOptionsBase { - /** - * The number of results to return. If null is passed returns all deployments. - */ - top?: number; - /** - * The properties to include in the results. For example, use &$expand=metadata in the query - * string to retrieve resource provider metadata. To include property aliases in response, use - * $expand=resourceTypes/aliases. - */ - expand?: string; -} +/** Contains response data for the listAtTenantScope operation. */ +export type DeploymentsListAtTenantScopeResponse = DeploymentListResult; -/** - * Optional Parameters. - */ -export interface ProvidersListAtTenantScopeOptionalParams extends msRest.RequestOptionsBase { - /** - * The number of results to return. If null is passed returns all providers. - */ - top?: number; - /** - * The properties to include in the results. For example, use &$expand=metadata in the query - * string to retrieve resource provider metadata. To include property aliases in response, use - * $expand=resourceTypes/aliases. - */ - expand?: string; +/** Optional parameters. */ +export interface DeploymentsDeleteAtManagementGroupScopeOptionalParams + 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 ProvidersGetOptionalParams extends msRest.RequestOptionsBase { - /** - * The $expand query parameter. For example, to include property aliases in response, use - * $expand=resourceTypes/aliases. - */ - expand?: string; -} +/** Optional parameters. */ +export interface DeploymentsCheckExistenceAtManagementGroupScopeOptionalParams + extends coreClient.OperationOptions {} -/** - * Optional Parameters. - */ -export interface ProvidersGetAtTenantScopeOptionalParams extends msRest.RequestOptionsBase { - /** - * The $expand query parameter. For example, to include property aliases in response, use - * $expand=resourceTypes/aliases. - */ - expand?: string; -} +/** Contains response data for the checkExistenceAtManagementGroupScope operation. */ +export type DeploymentsCheckExistenceAtManagementGroupScopeResponse = { + body: boolean; +}; -/** - * Optional Parameters. - */ -export interface ProvidersListNextOptionalParams extends msRest.RequestOptionsBase { - /** - * The number of results to return. If null is passed returns all deployments. - */ - top?: number; - /** - * The properties to include in the results. For example, use &$expand=metadata in the query - * string to retrieve resource provider metadata. To include property aliases in response, use - * $expand=resourceTypes/aliases. - */ - expand?: string; +/** Optional parameters. */ +export interface DeploymentsCreateOrUpdateAtManagementGroupScopeOptionalParams + 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 ProvidersListAtTenantScopeNextOptionalParams extends msRest.RequestOptionsBase { - /** - * The number of results to return. If null is passed returns all providers. - */ - top?: number; - /** - * The properties to include in the results. For example, use &$expand=metadata in the query - * string to retrieve resource provider metadata. To include property aliases in response, use - * $expand=resourceTypes/aliases. - */ - expand?: string; -} +/** Contains response data for the createOrUpdateAtManagementGroupScope operation. */ +export type DeploymentsCreateOrUpdateAtManagementGroupScopeResponse = DeploymentExtended; -/** - * Optional Parameters. - */ -export interface ProviderResourceTypesListOptionalParams extends msRest.RequestOptionsBase { - /** - * The $expand query parameter. For example, to include property aliases in response, use - * $expand=resourceTypes/aliases. - */ - expand?: string; +/** Optional parameters. */ +export interface DeploymentsGetAtManagementGroupScopeOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getAtManagementGroupScope operation. */ +export type DeploymentsGetAtManagementGroupScopeResponse = DeploymentExtended; + +/** Optional parameters. */ +export interface DeploymentsCancelAtManagementGroupScopeOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface DeploymentsValidateAtManagementGroupScopeOptionalParams + 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 ResourcesListByResourceGroupOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation.

The properties you can use for eq (equals) or ne - * (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, - * plan, plan/publisher, plan/product, plan/name, plan/version, and - * plan/promotionCode.

For example, to filter by a resource type, use: - * $filter=resourceType eq 'Microsoft.Network/virtualNetworks'

You can use - * substringof(value, property) in the filter. The properties you can use for substring are: name - * and resourceGroup.

For example, to get all resources with 'demo' anywhere in the name, - * use: $filter=substringof('demo', name)

You can link more than one substringof together - * by adding and/or operators.

You can filter by tag names and values. For example, to - * filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When - * you filter by a tag name and value, the tags for each resource are not returned in the - * results.

You can use some properties together when filtering. The combinations you can - * use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and - * identity/principalId. - */ - filter?: string; - /** - * Comma-separated list of additional properties to be included in the response. Valid values - * include `createdTime`, `changedTime` and `provisioningState`. For example, - * `$expand=createdTime,changedTime`. - */ - expand?: string; - /** - * The number of results to return. If null is passed, returns all resources. - */ - top?: number; +/** Contains response data for the validateAtManagementGroupScope operation. */ +export type DeploymentsValidateAtManagementGroupScopeResponse = DeploymentValidateResult; + +/** Optional parameters. */ +export interface DeploymentsWhatIfAtManagementGroupScopeOptionalParams + 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 ResourcesListOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation.

The properties you can use for eq (equals) or ne - * (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, - * plan, plan/publisher, plan/product, plan/name, plan/version, and - * plan/promotionCode.

For example, to filter by a resource type, use: - * $filter=resourceType eq 'Microsoft.Network/virtualNetworks'

You can use - * substringof(value, property) in the filter. The properties you can use for substring are: name - * and resourceGroup.

For example, to get all resources with 'demo' anywhere in the name, - * use: $filter=substringof('demo', name)

You can link more than one substringof together - * by adding and/or operators.

You can filter by tag names and values. For example, to - * filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When - * you filter by a tag name and value, the tags for each resource are not returned in the - * results.

You can use some properties together when filtering. The combinations you can - * use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and - * identity/principalId. - */ +/** Contains response data for the whatIfAtManagementGroupScope operation. */ +export type DeploymentsWhatIfAtManagementGroupScopeResponse = WhatIfOperationResult; + +/** Optional parameters. */ +export interface DeploymentsExportTemplateAtManagementGroupScopeOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the exportTemplateAtManagementGroupScope operation. */ +export type DeploymentsExportTemplateAtManagementGroupScopeResponse = DeploymentExportResult; + +/** Optional parameters. */ +export interface DeploymentsListAtManagementGroupScopeOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'. */ filter?: string; - /** - * Comma-separated list of additional properties to be included in the response. Valid values - * include `createdTime`, `changedTime` and `provisioningState`. For example, - * `$expand=createdTime,changedTime`. - */ - expand?: string; - /** - * The number of results to return. If null is passed, returns all resource groups. - */ + /** The number of results to get. If null is passed, returns all deployments. */ top?: number; } -/** - * Optional Parameters. - */ -export interface ResourcesListByResourceGroupNextOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation.

The properties you can use for eq (equals) or ne - * (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, - * plan, plan/publisher, plan/product, plan/name, plan/version, and - * plan/promotionCode.

For example, to filter by a resource type, use: - * $filter=resourceType eq 'Microsoft.Network/virtualNetworks'

You can use - * substringof(value, property) in the filter. The properties you can use for substring are: name - * and resourceGroup.

For example, to get all resources with 'demo' anywhere in the name, - * use: $filter=substringof('demo', name)

You can link more than one substringof together - * by adding and/or operators.

You can filter by tag names and values. For example, to - * filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When - * you filter by a tag name and value, the tags for each resource are not returned in the - * results.

You can use some properties together when filtering. The combinations you can - * use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and - * identity/principalId. - */ - filter?: string; - /** - * Comma-separated list of additional properties to be included in the response. Valid values - * include `createdTime`, `changedTime` and `provisioningState`. For example, - * `$expand=createdTime,changedTime`. - */ - expand?: string; - /** - * The number of results to return. If null is passed, returns all resources. - */ - top?: number; +/** Contains response data for the listAtManagementGroupScope operation. */ +export type DeploymentsListAtManagementGroupScopeResponse = DeploymentListResult; + +/** Optional parameters. */ +export interface DeploymentsDeleteAtSubscriptionScopeOptionalParams + 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 ResourcesListNextOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation.

The properties you can use for eq (equals) or ne - * (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, - * plan, plan/publisher, plan/product, plan/name, plan/version, and - * plan/promotionCode.

For example, to filter by a resource type, use: - * $filter=resourceType eq 'Microsoft.Network/virtualNetworks'

You can use - * substringof(value, property) in the filter. The properties you can use for substring are: name - * and resourceGroup.

For example, to get all resources with 'demo' anywhere in the name, - * use: $filter=substringof('demo', name)

You can link more than one substringof together - * by adding and/or operators.

You can filter by tag names and values. For example, to - * filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When - * you filter by a tag name and value, the tags for each resource are not returned in the - * results.

You can use some properties together when filtering. The combinations you can - * use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and - * identity/principalId. - */ - filter?: string; - /** - * Comma-separated list of additional properties to be included in the response. Valid values - * include `createdTime`, `changedTime` and `provisioningState`. For example, - * `$expand=createdTime,changedTime`. - */ - expand?: string; - /** - * The number of results to return. If null is passed, returns all resource groups. - */ - top?: number; +/** Optional parameters. */ +export interface DeploymentsCheckExistenceAtSubscriptionScopeOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the checkExistenceAtSubscriptionScope operation. */ +export type DeploymentsCheckExistenceAtSubscriptionScopeResponse = { + body: boolean; +}; + +/** Optional parameters. */ +export interface DeploymentsCreateOrUpdateAtSubscriptionScopeOptionalParams + 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 ResourceGroupsListOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation.

You can filter by tag names and values. For - * example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq - * 'Value1' - */ - filter?: string; - /** - * The number of results to return. If null is passed, returns all resource groups. - */ - top?: number; +/** Contains response data for the createOrUpdateAtSubscriptionScope operation. */ +export type DeploymentsCreateOrUpdateAtSubscriptionScopeResponse = DeploymentExtended; + +/** Optional parameters. */ +export interface DeploymentsGetAtSubscriptionScopeOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getAtSubscriptionScope operation. */ +export type DeploymentsGetAtSubscriptionScopeResponse = DeploymentExtended; + +/** Optional parameters. */ +export interface DeploymentsCancelAtSubscriptionScopeOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface DeploymentsValidateAtSubscriptionScopeOptionalParams + 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 ResourceGroupsListNextOptionalParams extends msRest.RequestOptionsBase { - /** - * The filter to apply on the operation.

You can filter by tag names and values. For - * example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq - * 'Value1' - */ - filter?: string; - /** - * The number of results to return. If null is passed, returns all resource groups. - */ - top?: number; +/** Contains response data for the validateAtSubscriptionScope operation. */ +export type DeploymentsValidateAtSubscriptionScopeResponse = DeploymentValidateResult; + +/** Optional parameters. */ +export interface DeploymentsWhatIfAtSubscriptionScopeOptionalParams + 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 DeploymentOperationsListAtScopeOptionalParams extends msRest.RequestOptionsBase { - /** - * The number of results to return. - */ +/** Contains response data for the whatIfAtSubscriptionScope operation. */ +export type DeploymentsWhatIfAtSubscriptionScopeResponse = WhatIfOperationResult; + +/** Optional parameters. */ +export interface DeploymentsExportTemplateAtSubscriptionScopeOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the exportTemplateAtSubscriptionScope operation. */ +export type DeploymentsExportTemplateAtSubscriptionScopeResponse = DeploymentExportResult; + +/** Optional parameters. */ +export interface DeploymentsListAtSubscriptionScopeOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'. */ + filter?: string; + /** The number of results to get. If null is passed, returns all deployments. */ top?: number; } -/** - * Optional Parameters. - */ -export interface DeploymentOperationsListAtTenantScopeOptionalParams - extends msRest.RequestOptionsBase { - /** - * The number of results to return. - */ - top?: number; +/** Contains response data for the listAtSubscriptionScope operation. */ +export type DeploymentsListAtSubscriptionScopeResponse = DeploymentListResult; + +/** Optional parameters. */ +export interface DeploymentsDeleteOptionalParams + 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 DeploymentOperationsListAtManagementGroupScopeOptionalParams - extends msRest.RequestOptionsBase { - /** - * The number of results to return. - */ - top?: number; +/** Optional parameters. */ +export interface DeploymentsCheckExistenceOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the checkExistence operation. */ +export type DeploymentsCheckExistenceResponse = { + body: boolean; +}; + +/** Optional parameters. */ +export interface DeploymentsCreateOrUpdateOptionalParams + 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 DeploymentOperationsListAtSubscriptionScopeOptionalParams - extends msRest.RequestOptionsBase { - /** - * The number of results to return. - */ - top?: number; +/** Contains response data for the createOrUpdate operation. */ +export type DeploymentsCreateOrUpdateResponse = DeploymentExtended; + +/** Optional parameters. */ +export interface DeploymentsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type DeploymentsGetResponse = DeploymentExtended; + +/** Optional parameters. */ +export interface DeploymentsCancelOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface DeploymentsValidateOptionalParams + 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 DeploymentOperationsListOptionalParams extends msRest.RequestOptionsBase { - /** - * The number of results to return. - */ - top?: number; +/** Contains response data for the validate operation. */ +export type DeploymentsValidateResponse = DeploymentValidateResult; + +/** Optional parameters. */ +export interface DeploymentsWhatIfOptionalParams + 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 DeploymentOperationsListAtScopeNextOptionalParams - extends msRest.RequestOptionsBase { - /** - * The number of results to return. - */ +/** Contains response data for the whatIf operation. */ +export type DeploymentsWhatIfResponse = WhatIfOperationResult; + +/** Optional parameters. */ +export interface DeploymentsExportTemplateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the exportTemplate operation. */ +export type DeploymentsExportTemplateResponse = DeploymentExportResult; + +/** Optional parameters. */ +export interface DeploymentsListByResourceGroupOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'. */ + filter?: string; + /** The number of results to get. If null is passed, returns all deployments. */ top?: number; } -/** - * Optional Parameters. - */ -export interface DeploymentOperationsListAtTenantScopeNextOptionalParams - extends msRest.RequestOptionsBase { - /** - * The number of results to return. - */ +/** Contains response data for the listByResourceGroup operation. */ +export type DeploymentsListByResourceGroupResponse = DeploymentListResult; + +/** Optional parameters. */ +export interface DeploymentsCalculateTemplateHashOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the calculateTemplateHash operation. */ +export type DeploymentsCalculateTemplateHashResponse = TemplateHashResult; + +/** Optional parameters. */ +export interface DeploymentsListAtScopeNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'. */ + filter?: string; + /** The number of results to get. If null is passed, returns all deployments. */ top?: number; } -/** - * Optional Parameters. - */ -export interface DeploymentOperationsListAtManagementGroupScopeNextOptionalParams - extends msRest.RequestOptionsBase { - /** - * The number of results to return. - */ +/** Contains response data for the listAtScopeNext operation. */ +export type DeploymentsListAtScopeNextResponse = DeploymentListResult; + +/** Optional parameters. */ +export interface DeploymentsListAtTenantScopeNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'. */ + filter?: string; + /** The number of results to get. If null is passed, returns all deployments. */ top?: number; } -/** - * Optional Parameters. - */ -export interface DeploymentOperationsListAtSubscriptionScopeNextOptionalParams - extends msRest.RequestOptionsBase { - /** - * The number of results to return. - */ +/** Contains response data for the listAtTenantScopeNext operation. */ +export type DeploymentsListAtTenantScopeNextResponse = DeploymentListResult; + +/** Optional parameters. */ +export interface DeploymentsListAtManagementGroupScopeNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'. */ + filter?: string; + /** The number of results to get. If null is passed, returns all deployments. */ top?: number; } -/** - * Optional Parameters. - */ -export interface DeploymentOperationsListNextOptionalParams extends msRest.RequestOptionsBase { - /** - * The number of results to return. - */ +/** Contains response data for the listAtManagementGroupScopeNext operation. */ +export type DeploymentsListAtManagementGroupScopeNextResponse = DeploymentListResult; + +/** Optional parameters. */ +export interface DeploymentsListAtSubscriptionScopeNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'. */ + filter?: string; + /** The number of results to get. If null is passed, returns all deployments. */ top?: number; } -/** - * An interface representing ResourceManagementClientOptions. - */ -export interface ResourceManagementClientOptions extends AzureServiceClientOptions { - baseUri?: string; -} +/** Contains response data for the listAtSubscriptionScopeNext operation. */ +export type DeploymentsListAtSubscriptionScopeNextResponse = DeploymentListResult; -/** - * Defines headers for WhatIfAtTenantScope operation. - */ -export interface DeploymentsWhatIfAtTenantScopeHeaders { - /** - * URL to get status of this long-running operation. - */ - location: string; - /** - * Number of seconds to wait before polling for status. - */ - retryAfter: string; +/** Optional parameters. */ +export interface DeploymentsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'. */ + filter?: string; + /** The number of results to get. If null is passed, returns all deployments. */ + top?: number; } -/** - * Defines headers for WhatIfAtManagementGroupScope operation. - */ -export interface DeploymentsWhatIfAtManagementGroupScopeHeaders { - /** - * URL to get status of this long-running operation. - */ - location: string; - /** - * Number of seconds to wait before polling for status. - */ - retryAfter: string; -} +/** Contains response data for the listByResourceGroupNext operation. */ +export type DeploymentsListByResourceGroupNextResponse = DeploymentListResult; -/** - * Defines headers for WhatIfAtSubscriptionScope operation. - */ -export interface DeploymentsWhatIfAtSubscriptionScopeHeaders { - /** - * URL to get status of this long-running operation. - */ - location: string; - /** - * Number of seconds to wait before polling for status. - */ - retryAfter: string; +/** Optional parameters. */ +export interface DeploymentsListAtScopeNextNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'. */ + filter?: string; + /** The number of results to get. If null is passed, returns all deployments. */ + top?: number; } -/** - * Defines headers for WhatIf operation. - */ -export interface DeploymentsWhatIfHeaders { - /** - * URL to get status of this long-running operation. - */ - location: string; - /** - * Number of seconds to wait before polling for status. - */ - retryAfter: string; -} +/** Contains response data for the listAtScopeNextNext operation. */ +export type DeploymentsListAtScopeNextNextResponse = DeploymentListResult; -/** - * @interface - * Result of the request to list Microsoft.Resources operations. It contains a list of operations - * and a URL link to get the next set of results. - * @extends Array - */ -export interface OperationListResult extends Array { - /** - * URL to get the next set of operation list results if there are any. - */ - nextLink?: string; +/** Optional parameters. */ +export interface DeploymentsListAtTenantScopeNextNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'. */ + filter?: string; + /** The number of results to get. If null is passed, returns all deployments. */ + top?: number; } -/** - * @interface - * List of deployments. - * @extends Array - */ -export interface DeploymentListResult extends Array { - /** - * The URL to use for getting the next set of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; -} +/** Contains response data for the listAtTenantScopeNextNext operation. */ +export type DeploymentsListAtTenantScopeNextNextResponse = DeploymentListResult; -/** - * @interface - * List of resource providers. - * @extends Array - */ -export interface ProviderListResult extends Array { - /** - * The URL to use for getting the next set of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; +/** Optional parameters. */ +export interface DeploymentsListAtManagementGroupScopeNextNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'. */ + filter?: string; + /** The number of results to get. If null is passed, returns all deployments. */ + top?: number; } -/** - * @interface - * List of resource groups. - * @extends Array - */ -export interface ResourceListResult extends Array { - /** - * The URL to use for getting the next set of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; -} +/** Contains response data for the listAtManagementGroupScopeNextNext operation. */ +export type DeploymentsListAtManagementGroupScopeNextNextResponse = DeploymentListResult; -/** - * @interface - * List of resource groups. - * @extends Array - */ -export interface ResourceGroupListResult extends Array { - /** - * The URL to use for getting the next set of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; +/** Optional parameters. */ +export interface DeploymentsListAtSubscriptionScopeNextNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'. */ + filter?: string; + /** The number of results to get. If null is passed, returns all deployments. */ + top?: number; } -/** - * @interface - * List of subscription tags. - * @extends Array - */ -export interface TagsListResult extends Array { - /** - * The URL to use for getting the next set of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; -} +/** Contains response data for the listAtSubscriptionScopeNextNext operation. */ +export type DeploymentsListAtSubscriptionScopeNextNextResponse = DeploymentListResult; -/** - * @interface - * List of deployment operations. - * @extends Array - */ -export interface DeploymentOperationsListResult extends Array { - /** - * The URL to use for getting the next set of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; +/** Optional parameters. */ +export interface DeploymentsListByResourceGroupNextNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'. */ + filter?: string; + /** The number of results to get. If null is passed, returns all deployments. */ + top?: number; } -/** - * Defines values for DeploymentMode. - * Possible values include: 'Incremental', 'Complete' - * @readonly - * @enum {string} - */ -export type DeploymentMode = "Incremental" | "Complete"; +/** Contains response data for the listByResourceGroupNextNext operation. */ +export type DeploymentsListByResourceGroupNextNextResponse = DeploymentListResult; -/** - * Defines values for OnErrorDeploymentType. - * Possible values include: 'LastSuccessful', 'SpecificDeployment' - * @readonly - * @enum {string} - */ -export type OnErrorDeploymentType = "LastSuccessful" | "SpecificDeployment"; +/** Optional parameters. */ +export interface ProvidersUnregisterOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for ExpressionEvaluationOptionsScopeType. - * Possible values include: 'NotSpecified', 'Outer', 'Inner' - * @readonly - * @enum {string} - */ -export type ExpressionEvaluationOptionsScopeType = "NotSpecified" | "Outer" | "Inner"; +/** Contains response data for the unregister operation. */ +export type ProvidersUnregisterResponse = Provider; -/** - * Defines values for WhatIfResultFormat. - * Possible values include: 'ResourceIdOnly', 'FullResourcePayloads' - * @readonly - * @enum {string} - */ -export type WhatIfResultFormat = "ResourceIdOnly" | "FullResourcePayloads"; +/** Optional parameters. */ +export interface ProvidersRegisterAtManagementGroupScopeOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for AliasPathTokenType. - * Possible values include: 'NotSpecified', 'Any', 'String', 'Object', 'Array', 'Integer', - * 'Number', 'Boolean' - * @readonly - * @enum {string} - */ -export type AliasPathTokenType = - | "NotSpecified" - | "Any" - | "String" - | "Object" - | "Array" - | "Integer" - | "Number" - | "Boolean"; +/** Optional parameters. */ +export interface ProvidersProviderPermissionsOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for AliasPathAttributes. - * Possible values include: 'None', 'Modifiable' - * @readonly - * @enum {string} - */ -export type AliasPathAttributes = "None" | "Modifiable"; +/** Contains response data for the providerPermissions operation. */ +export type ProvidersProviderPermissionsResponse = ProviderPermissionListResult; -/** - * Defines values for AliasPatternType. - * Possible values include: 'NotSpecified', 'Extract' - * @readonly - * @enum {string} - */ -export type AliasPatternType = "NotSpecified" | "Extract"; +/** Optional parameters. */ +export interface ProvidersRegisterOptionalParams + extends coreClient.OperationOptions { + /** The third party consent for S2S. */ + properties?: ProviderRegistrationRequest; +} -/** - * Defines values for AliasType. - * Possible values include: 'NotSpecified', 'PlainText', 'Mask' - * @readonly - * @enum {string} - */ -export type AliasType = "NotSpecified" | "PlainText" | "Mask"; +/** Contains response data for the register operation. */ +export type ProvidersRegisterResponse = Provider; -/** - * Defines values for ProvisioningState. - * Possible values include: 'NotSpecified', 'Accepted', 'Running', 'Ready', 'Creating', 'Created', - * 'Deleting', 'Deleted', 'Canceled', 'Failed', 'Succeeded', 'Updating' - * @readonly - * @enum {string} - */ -export type ProvisioningState = - | "NotSpecified" - | "Accepted" - | "Running" - | "Ready" - | "Creating" - | "Created" - | "Deleting" - | "Deleted" - | "Canceled" - | "Failed" - | "Succeeded" - | "Updating"; +/** Optional parameters. */ +export interface ProvidersListOptionalParams + extends coreClient.OperationOptions { + /** The number of results to return. If null is passed returns all deployments. */ + top?: number; + /** The properties to include in the results. For example, use &$expand=metadata in the query string to retrieve resource provider metadata. To include property aliases in response, use $expand=resourceTypes/aliases. */ + expand?: string; +} -/** - * Defines values for ResourceIdentityType. - * Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', - * 'None' - * @readonly - * @enum {string} - */ -export type ResourceIdentityType = - | "SystemAssigned" - | "UserAssigned" - | "SystemAssigned, UserAssigned" - | "None"; +/** Contains response data for the list operation. */ +export type ProvidersListResponse = ProviderListResult; -/** - * Defines values for ExtendedLocationType. - * Possible values include: 'EdgeZone' - * @readonly - * @enum {string} - */ -export type ExtendedLocationType = "EdgeZone"; +/** Optional parameters. */ +export interface ProvidersListAtTenantScopeOptionalParams + extends coreClient.OperationOptions { + /** The number of results to return. If null is passed returns all providers. */ + top?: number; + /** The properties to include in the results. For example, use &$expand=metadata in the query string to retrieve resource provider metadata. To include property aliases in response, use $expand=resourceTypes/aliases. */ + expand?: string; +} -/** - * Defines values for ProvisioningOperation. - * Possible values include: 'NotSpecified', 'Create', 'Delete', 'Waiting', - * 'AzureAsyncOperationWaiting', 'ResourceCacheWaiting', 'Action', 'Read', - * 'EvaluateDeploymentOutput', 'DeploymentCleanup' - * @readonly - * @enum {string} - */ -export type ProvisioningOperation = - | "NotSpecified" - | "Create" - | "Delete" - | "Waiting" - | "AzureAsyncOperationWaiting" - | "ResourceCacheWaiting" - | "Action" - | "Read" - | "EvaluateDeploymentOutput" - | "DeploymentCleanup"; +/** Contains response data for the listAtTenantScope operation. */ +export type ProvidersListAtTenantScopeResponse = ProviderListResult; -/** - * Defines values for PropertyChangeType. - * Possible values include: 'Create', 'Delete', 'Modify', 'Array', 'NoEffect' - * @readonly - * @enum {string} - */ -export type PropertyChangeType = "Create" | "Delete" | "Modify" | "Array" | "NoEffect"; +/** Optional parameters. */ +export interface ProvidersGetOptionalParams + extends coreClient.OperationOptions { + /** The $expand query parameter. For example, to include property aliases in response, use $expand=resourceTypes/aliases. */ + expand?: string; +} -/** - * Defines values for ChangeType. - * Possible values include: 'Create', 'Delete', 'Ignore', 'Deploy', 'NoChange', 'Modify', - * 'Unsupported' - * @readonly - * @enum {string} - */ -export type ChangeType = - | "Create" - | "Delete" - | "Ignore" - | "Deploy" - | "NoChange" - | "Modify" - | "Unsupported"; +/** Contains response data for the get operation. */ +export type ProvidersGetResponse = Provider; + +/** Optional parameters. */ +export interface ProvidersGetAtTenantScopeOptionalParams + extends coreClient.OperationOptions { + /** The $expand query parameter. For example, to include property aliases in response, use $expand=resourceTypes/aliases. */ + expand?: string; +} -/** - * Defines values for TagsPatchOperation. - * Possible values include: 'Replace', 'Merge', 'Delete' - * @readonly - * @enum {string} - */ -export type TagsPatchOperation = "Replace" | "Merge" | "Delete"; +/** Contains response data for the getAtTenantScope operation. */ +export type ProvidersGetAtTenantScopeResponse = Provider; -/** - * Contains response data for the list operation. - */ -export type OperationsListResponse = OperationListResult & { - /** - * 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: OperationListResult; - }; -}; +/** Optional parameters. */ +export interface ProvidersListNextOptionalParams + extends coreClient.OperationOptions { + /** The number of results to return. If null is passed returns all deployments. */ + top?: number; + /** The properties to include in the results. For example, use &$expand=metadata in the query string to retrieve resource provider metadata. To include property aliases in response, use $expand=resourceTypes/aliases. */ + expand?: string; +} -/** - * Contains response data for the listNext operation. - */ -export type OperationsListNextResponse = OperationListResult & { - /** - * 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: OperationListResult; - }; -}; +/** Contains response data for the listNext operation. */ +export type ProvidersListNextResponse = ProviderListResult; -/** - * Contains response data for the checkExistenceAtScope operation. - */ -export type DeploymentsCheckExistenceAtScopeResponse = { - /** - * The parsed response body. - */ - body: boolean; +/** Optional parameters. */ +export interface ProvidersListAtTenantScopeNextOptionalParams + extends coreClient.OperationOptions { + /** The number of results to return. If null is passed returns all providers. */ + top?: number; + /** The properties to include in the results. For example, use &$expand=metadata in the query string to retrieve resource provider metadata. To include property aliases in response, use $expand=resourceTypes/aliases. */ + expand?: string; +} - /** - * 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: boolean; - }; -}; +/** Contains response data for the listAtTenantScopeNext operation. */ +export type ProvidersListAtTenantScopeNextResponse = ProviderListResult; -/** - * Contains response data for the createOrUpdateAtScope operation. - */ -export type DeploymentsCreateOrUpdateAtScopeResponse = DeploymentExtended & { - /** - * 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: DeploymentExtended; - }; -}; +/** Optional parameters. */ +export interface ProvidersListNextNextOptionalParams + extends coreClient.OperationOptions { + /** The number of results to return. If null is passed returns all deployments. */ + top?: number; + /** The properties to include in the results. For example, use &$expand=metadata in the query string to retrieve resource provider metadata. To include property aliases in response, use $expand=resourceTypes/aliases. */ + expand?: string; +} -/** - * Contains response data for the getAtScope operation. - */ -export type DeploymentsGetAtScopeResponse = DeploymentExtended & { - /** - * 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: DeploymentExtended; - }; -}; +/** Contains response data for the listNextNext operation. */ +export type ProvidersListNextNextResponse = ProviderListResult; -/** - * Contains response data for the validateAtScope operation. - */ -export type DeploymentsValidateAtScopeResponse = DeploymentValidateResult & { - /** - * 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: DeploymentValidateResult; - }; -}; +/** Optional parameters. */ +export interface ProvidersListAtTenantScopeNextNextOptionalParams + extends coreClient.OperationOptions { + /** The number of results to return. If null is passed returns all providers. */ + top?: number; + /** The properties to include in the results. For example, use &$expand=metadata in the query string to retrieve resource provider metadata. To include property aliases in response, use $expand=resourceTypes/aliases. */ + expand?: string; +} -/** - * Contains response data for the exportTemplateAtScope operation. - */ -export type DeploymentsExportTemplateAtScopeResponse = DeploymentExportResult & { - /** - * 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: DeploymentExportResult; - }; -}; +/** Contains response data for the listAtTenantScopeNextNext operation. */ +export type ProvidersListAtTenantScopeNextNextResponse = ProviderListResult; -/** - * Contains response data for the listAtScope operation. - */ -export type DeploymentsListAtScopeResponse = DeploymentListResult & { - /** - * 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: DeploymentListResult; - }; -}; +/** Optional parameters. */ +export interface ProviderResourceTypesListOptionalParams + extends coreClient.OperationOptions { + /** The $expand query parameter. For example, to include property aliases in response, use $expand=resourceTypes/aliases. */ + expand?: string; +} -/** - * Contains response data for the checkExistenceAtTenantScope operation. - */ -export type DeploymentsCheckExistenceAtTenantScopeResponse = { - /** - * The parsed response body. - */ - body: boolean; +/** Contains response data for the list operation. */ +export type ProviderResourceTypesListResponse = ProviderResourceTypeListResult; - /** - * 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: boolean; - }; -}; +/** Optional parameters. */ +export interface ResourcesListByResourceGroupOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation.

The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.

For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'

You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.

For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)

You can link more than one substringof together by adding and/or operators.

You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, the tags for each resource are not returned in the results.

You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. */ + filter?: string; + /** The number of results to return. If null is passed, returns all resources. */ + top?: number; + /** Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. */ + expand?: string; +} -/** - * Contains response data for the createOrUpdateAtTenantScope operation. - */ -export type DeploymentsCreateOrUpdateAtTenantScopeResponse = DeploymentExtended & { - /** - * 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: DeploymentExtended; - }; -}; +/** Contains response data for the listByResourceGroup operation. */ +export type ResourcesListByResourceGroupResponse = ResourceListResult; -/** - * Contains response data for the getAtTenantScope operation. - */ -export type DeploymentsGetAtTenantScopeResponse = DeploymentExtended & { - /** - * 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: DeploymentExtended; - }; -}; +/** Optional parameters. */ +export interface ResourcesMoveResourcesOptionalParams + 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 validateAtTenantScope operation. - */ -export type DeploymentsValidateAtTenantScopeResponse = DeploymentValidateResult & { - /** - * 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: DeploymentValidateResult; - }; -}; +/** Optional parameters. */ +export interface ResourcesValidateMoveResourcesOptionalParams + 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 whatIfAtTenantScope operation. - */ -export type DeploymentsWhatIfAtTenantScopeResponse = WhatIfOperationResult & - DeploymentsWhatIfAtTenantScopeHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: DeploymentsWhatIfAtTenantScopeHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: WhatIfOperationResult; - }; - }; +/** Optional parameters. */ +export interface ResourcesListOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation.

The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.

For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'

You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.

For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)

You can link more than one substringof together by adding and/or operators.

You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, the tags for each resource are not returned in the results.

You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. */ + filter?: string; + /** The number of results to return. If null is passed, returns all resource groups. */ + top?: number; + /** Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. */ + expand?: string; +} -/** - * Contains response data for the exportTemplateAtTenantScope operation. - */ -export type DeploymentsExportTemplateAtTenantScopeResponse = DeploymentExportResult & { - /** - * 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: DeploymentExportResult; - }; -}; +/** Contains response data for the list operation. */ +export type ResourcesListResponse = ResourceListResult; -/** - * Contains response data for the listAtTenantScope operation. - */ -export type DeploymentsListAtTenantScopeResponse = DeploymentListResult & { - /** - * 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: DeploymentListResult; - }; -}; +/** Optional parameters. */ +export interface ResourcesCheckExistenceOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the checkExistenceAtManagementGroupScope operation. - */ -export type DeploymentsCheckExistenceAtManagementGroupScopeResponse = { - /** - * The parsed response body. - */ +/** Contains response data for the checkExistence operation. */ +export type ResourcesCheckExistenceResponse = { body: boolean; - - /** - * 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: boolean; - }; }; -/** - * Contains response data for the createOrUpdateAtManagementGroupScope operation. - */ -export type DeploymentsCreateOrUpdateAtManagementGroupScopeResponse = DeploymentExtended & { - /** - * 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: DeploymentExtended; - }; -}; +/** Optional parameters. */ +export interface ResourcesDeleteOptionalParams + 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 getAtManagementGroupScope operation. - */ -export type DeploymentsGetAtManagementGroupScopeResponse = DeploymentExtended & { - /** - * 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: DeploymentExtended; - }; -}; +/** Optional parameters. */ +export interface ResourcesCreateOrUpdateOptionalParams + 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 validateAtManagementGroupScope operation. - */ -export type DeploymentsValidateAtManagementGroupScopeResponse = DeploymentValidateResult & { - /** - * 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: DeploymentValidateResult; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type ResourcesCreateOrUpdateResponse = GenericResource; -/** - * Contains response data for the whatIfAtManagementGroupScope operation. - */ -export type DeploymentsWhatIfAtManagementGroupScopeResponse = WhatIfOperationResult & - DeploymentsWhatIfAtManagementGroupScopeHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: DeploymentsWhatIfAtManagementGroupScopeHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: WhatIfOperationResult; - }; - }; +/** Optional parameters. */ +export interface ResourcesUpdateOptionalParams + 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 exportTemplateAtManagementGroupScope operation. - */ -export type DeploymentsExportTemplateAtManagementGroupScopeResponse = DeploymentExportResult & { - /** - * 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: DeploymentExportResult; - }; -}; +/** Contains response data for the update operation. */ +export type ResourcesUpdateResponse = GenericResource; -/** - * Contains response data for the listAtManagementGroupScope operation. - */ -export type DeploymentsListAtManagementGroupScopeResponse = DeploymentListResult & { - /** - * 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: DeploymentListResult; - }; -}; +/** Optional parameters. */ +export interface ResourcesGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the checkExistenceAtSubscriptionScope operation. - */ -export type DeploymentsCheckExistenceAtSubscriptionScopeResponse = { - /** - * The parsed response body. - */ - body: boolean; +/** Contains response data for the get operation. */ +export type ResourcesGetResponse = GenericResource; - /** - * 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: boolean; - }; -}; +/** Optional parameters. */ +export interface ResourcesCheckExistenceByIdOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdateAtSubscriptionScope operation. - */ -export type DeploymentsCreateOrUpdateAtSubscriptionScopeResponse = DeploymentExtended & { - /** - * 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: DeploymentExtended; - }; +/** Contains response data for the checkExistenceById operation. */ +export type ResourcesCheckExistenceByIdResponse = { + body: boolean; }; -/** - * Contains response data for the getAtSubscriptionScope operation. - */ -export type DeploymentsGetAtSubscriptionScopeResponse = DeploymentExtended & { - /** - * 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: DeploymentExtended; - }; -}; +/** Optional parameters. */ +export interface ResourcesDeleteByIdOptionalParams + 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 validateAtSubscriptionScope operation. - */ -export type DeploymentsValidateAtSubscriptionScopeResponse = DeploymentValidateResult & { - /** - * 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: DeploymentValidateResult; - }; -}; +/** Optional parameters. */ +export interface ResourcesCreateOrUpdateByIdOptionalParams + 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 whatIfAtSubscriptionScope operation. - */ -export type DeploymentsWhatIfAtSubscriptionScopeResponse = WhatIfOperationResult & - DeploymentsWhatIfAtSubscriptionScopeHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: DeploymentsWhatIfAtSubscriptionScopeHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: WhatIfOperationResult; - }; - }; +/** Contains response data for the createOrUpdateById operation. */ +export type ResourcesCreateOrUpdateByIdResponse = GenericResource; -/** - * Contains response data for the exportTemplateAtSubscriptionScope operation. - */ -export type DeploymentsExportTemplateAtSubscriptionScopeResponse = DeploymentExportResult & { - /** - * 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: DeploymentExportResult; - }; -}; +/** Optional parameters. */ +export interface ResourcesUpdateByIdOptionalParams + 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 listAtSubscriptionScope operation. - */ -export type DeploymentsListAtSubscriptionScopeResponse = DeploymentListResult & { - /** - * 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: DeploymentListResult; - }; -}; +/** Contains response data for the updateById operation. */ +export type ResourcesUpdateByIdResponse = GenericResource; -/** - * Contains response data for the checkExistence operation. - */ -export type DeploymentsCheckExistenceResponse = { - /** - * The parsed response body. - */ - body: boolean; +/** Optional parameters. */ +export interface ResourcesGetByIdOptionalParams + extends coreClient.OperationOptions {} - /** - * 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: boolean; - }; -}; +/** Contains response data for the getById operation. */ +export type ResourcesGetByIdResponse = GenericResource; -/** - * Contains response data for the createOrUpdate operation. - */ -export type DeploymentsCreateOrUpdateResponse = DeploymentExtended & { - /** - * 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: DeploymentExtended; - }; -}; +/** Optional parameters. */ +export interface ResourcesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation.

The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.

For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'

You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.

For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)

You can link more than one substringof together by adding and/or operators.

You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, the tags for each resource are not returned in the results.

You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. */ + filter?: string; + /** The number of results to return. If null is passed, returns all resources. */ + top?: number; + /** Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. */ + expand?: string; +} -/** - * Contains response data for the get operation. - */ -export type DeploymentsGetResponse = DeploymentExtended & { - /** - * 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: DeploymentExtended; - }; -}; +/** Contains response data for the listByResourceGroupNext operation. */ +export type ResourcesListByResourceGroupNextResponse = ResourceListResult; + +/** Optional parameters. */ +export interface ResourcesListNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation.

The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.

For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'

You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.

For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)

You can link more than one substringof together by adding and/or operators.

You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, the tags for each resource are not returned in the results.

You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. */ + filter?: string; + /** The number of results to return. If null is passed, returns all resource groups. */ + top?: number; + /** Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. */ + expand?: string; +} + +/** Contains response data for the listNext operation. */ +export type ResourcesListNextResponse = ResourceListResult; + +/** Optional parameters. */ +export interface ResourcesListByResourceGroupNextNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation.

The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.

For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'

You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.

For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)

You can link more than one substringof together by adding and/or operators.

You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, the tags for each resource are not returned in the results.

You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. */ + filter?: string; + /** The number of results to return. If null is passed, returns all resources. */ + top?: number; + /** Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. */ + expand?: string; +} + +/** Contains response data for the listByResourceGroupNextNext operation. */ +export type ResourcesListByResourceGroupNextNextResponse = ResourceListResult; + +/** Optional parameters. */ +export interface ResourcesListNextNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation.

The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.

For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'

You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.

For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)

You can link more than one substringof together by adding and/or operators.

You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, the tags for each resource are not returned in the results.

You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. */ + filter?: string; + /** The number of results to return. If null is passed, returns all resource groups. */ + top?: number; + /** Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. */ + expand?: string; +} -/** - * Contains response data for the validate operation. - */ -export type DeploymentsValidateResponse = DeploymentValidateResult & { - /** - * 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: DeploymentValidateResult; - }; -}; +/** Contains response data for the listNextNext operation. */ +export type ResourcesListNextNextResponse = ResourceListResult; -/** - * Contains response data for the whatIf operation. - */ -export type DeploymentsWhatIfResponse = WhatIfOperationResult & - DeploymentsWhatIfHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: DeploymentsWhatIfHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: WhatIfOperationResult; - }; - }; +/** Optional parameters. */ +export interface ResourceGroupsCheckExistenceOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the exportTemplate operation. - */ -export type DeploymentsExportTemplateResponse = DeploymentExportResult & { - /** - * 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: DeploymentExportResult; - }; +/** Contains response data for the checkExistence operation. */ +export type ResourceGroupsCheckExistenceResponse = { + body: boolean; }; -/** - * Contains response data for the listByResourceGroup operation. - */ -export type DeploymentsListByResourceGroupResponse = DeploymentListResult & { - /** - * 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: DeploymentListResult; - }; -}; +/** Optional parameters. */ +export interface ResourceGroupsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the calculateTemplateHash operation. - */ -export type DeploymentsCalculateTemplateHashResponse = TemplateHashResult & { - /** - * 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: TemplateHashResult; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type ResourceGroupsCreateOrUpdateResponse = ResourceGroup; -/** - * Contains response data for the beginCreateOrUpdateAtScope operation. - */ -export type DeploymentsBeginCreateOrUpdateAtScopeResponse = DeploymentExtended & { - /** - * 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: DeploymentExtended; - }; -}; +/** Optional parameters. */ +export interface ResourceGroupsDeleteOptionalParams + extends coreClient.OperationOptions { + /** The resource types you want to force delete. Currently, only the following is supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets */ + forceDeletionTypes?: string; + /** 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 beginValidateAtScope operation. - */ -export type DeploymentsBeginValidateAtScopeResponse = DeploymentValidateResult & { - /** - * 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: DeploymentValidateResult; - }; -}; +/** Optional parameters. */ +export interface ResourceGroupsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the beginCreateOrUpdateAtTenantScope operation. - */ -export type DeploymentsBeginCreateOrUpdateAtTenantScopeResponse = DeploymentExtended & { - /** - * 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: DeploymentExtended; - }; -}; +/** Contains response data for the get operation. */ +export type ResourceGroupsGetResponse = ResourceGroup; -/** - * Contains response data for the beginValidateAtTenantScope operation. - */ -export type DeploymentsBeginValidateAtTenantScopeResponse = DeploymentValidateResult & { - /** - * 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: DeploymentValidateResult; - }; -}; +/** Optional parameters. */ +export interface ResourceGroupsUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the beginCreateOrUpdateAtManagementGroupScope operation. - */ -export type DeploymentsBeginCreateOrUpdateAtManagementGroupScopeResponse = DeploymentExtended & { - /** - * 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: DeploymentExtended; - }; -}; +/** Contains response data for the update operation. */ +export type ResourceGroupsUpdateResponse = ResourceGroup; -/** - * Contains response data for the beginValidateAtManagementGroupScope operation. - */ -export type DeploymentsBeginValidateAtManagementGroupScopeResponse = DeploymentValidateResult & { - /** - * 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: DeploymentValidateResult; - }; -}; +/** Optional parameters. */ +export interface ResourceGroupsExportTemplateOptionalParams + 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 beginCreateOrUpdateAtSubscriptionScope operation. - */ -export type DeploymentsBeginCreateOrUpdateAtSubscriptionScopeResponse = DeploymentExtended & { - /** - * 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: DeploymentExtended; - }; -}; +/** Contains response data for the exportTemplate operation. */ +export type ResourceGroupsExportTemplateResponse = ResourceGroupExportResult; -/** - * Contains response data for the beginValidateAtSubscriptionScope operation. - */ -export type DeploymentsBeginValidateAtSubscriptionScopeResponse = DeploymentValidateResult & { - /** - * 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: DeploymentValidateResult; - }; -}; +/** Optional parameters. */ +export interface ResourceGroupsListOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation.

You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1' */ + filter?: string; + /** The number of results to return. If null is passed, returns all resource groups. */ + top?: number; +} -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type DeploymentsBeginCreateOrUpdateResponse = DeploymentExtended & { - /** - * 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: DeploymentExtended; - }; -}; +/** Contains response data for the list operation. */ +export type ResourceGroupsListResponse = ResourceGroupListResult; -/** - * Contains response data for the beginValidate operation. - */ -export type DeploymentsBeginValidateResponse = DeploymentValidateResult & { - /** - * 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: DeploymentValidateResult; - }; -}; +/** Optional parameters. */ +export interface ResourceGroupsListNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation.

You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1' */ + filter?: string; + /** The number of results to return. If null is passed, returns all resource groups. */ + top?: number; +} -/** - * Contains response data for the listAtScopeNext operation. - */ -export type DeploymentsListAtScopeNextResponse = DeploymentListResult & { - /** - * 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: DeploymentListResult; - }; -}; +/** Contains response data for the listNext operation. */ +export type ResourceGroupsListNextResponse = ResourceGroupListResult; -/** - * Contains response data for the listAtTenantScopeNext operation. - */ -export type DeploymentsListAtTenantScopeNextResponse = DeploymentListResult & { - /** - * 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: DeploymentListResult; - }; -}; +/** Optional parameters. */ +export interface ResourceGroupsListNextNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation.

You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1' */ + filter?: string; + /** The number of results to return. If null is passed, returns all resource groups. */ + top?: number; +} -/** - * Contains response data for the listAtManagementGroupScopeNext operation. - */ -export type DeploymentsListAtManagementGroupScopeNextResponse = DeploymentListResult & { - /** - * 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: DeploymentListResult; - }; -}; +/** Contains response data for the listNextNext operation. */ +export type ResourceGroupsListNextNextResponse = ResourceGroupListResult; -/** - * Contains response data for the listAtSubscriptionScopeNext operation. - */ -export type DeploymentsListAtSubscriptionScopeNextResponse = DeploymentListResult & { - /** - * 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: DeploymentListResult; - }; -}; +/** Optional parameters. */ +export interface TagsOperationsDeleteValueOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByResourceGroupNext operation. - */ -export type DeploymentsListByResourceGroupNextResponse = DeploymentListResult & { - /** - * 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: DeploymentListResult; - }; -}; +/** Optional parameters. */ +export interface TagsOperationsCreateOrUpdateValueOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the unregister operation. - */ -export type ProvidersUnregisterResponse = Provider & { - /** - * 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: Provider; - }; -}; +/** Contains response data for the createOrUpdateValue operation. */ +export type TagsOperationsCreateOrUpdateValueResponse = TagValue; -/** - * Contains response data for the register operation. - */ -export type ProvidersRegisterResponse = Provider & { - /** - * 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: Provider; - }; -}; +/** Optional parameters. */ +export interface TagsOperationsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type ProvidersListResponse = ProviderListResult & { - /** - * 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: ProviderListResult; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type TagsOperationsCreateOrUpdateResponse = TagDetails; -/** - * Contains response data for the listAtTenantScope operation. - */ -export type ProvidersListAtTenantScopeResponse = ProviderListResult & { - /** - * 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: ProviderListResult; - }; -}; +/** Optional parameters. */ +export interface TagsOperationsDeleteOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type ProvidersGetResponse = Provider & { - /** - * 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: Provider; - }; -}; +/** Optional parameters. */ +export interface TagsOperationsListOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the getAtTenantScope operation. - */ -export type ProvidersGetAtTenantScopeResponse = Provider & { - /** - * 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: Provider; - }; -}; +/** Contains response data for the list operation. */ +export type TagsOperationsListResponse = TagsListResult; -/** - * Contains response data for the listNext operation. - */ -export type ProvidersListNextResponse = ProviderListResult & { - /** - * 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: ProviderListResult; - }; -}; +/** Optional parameters. */ +export interface TagsOperationsCreateOrUpdateAtScopeOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listAtTenantScopeNext operation. - */ -export type ProvidersListAtTenantScopeNextResponse = ProviderListResult & { - /** - * 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: ProviderListResult; - }; -}; +/** Contains response data for the createOrUpdateAtScope operation. */ +export type TagsOperationsCreateOrUpdateAtScopeResponse = TagsResource; -/** - * Contains response data for the list operation. - */ -export type ProviderResourceTypesListResponse = ProviderResourceTypeListResult & { - /** - * 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: ProviderResourceTypeListResult; - }; -}; +/** Optional parameters. */ +export interface TagsOperationsUpdateAtScopeOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByResourceGroup operation. - */ -export type ResourcesListByResourceGroupResponse = ResourceListResult & { - /** - * 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: ResourceListResult; - }; -}; +/** Contains response data for the updateAtScope operation. */ +export type TagsOperationsUpdateAtScopeResponse = TagsResource; -/** - * Contains response data for the list operation. - */ -export type ResourcesListResponse = ResourceListResult & { - /** - * 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: ResourceListResult; - }; -}; +/** Optional parameters. */ +export interface TagsOperationsGetAtScopeOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the checkExistence operation. - */ -export type ResourcesCheckExistenceResponse = { - /** - * The parsed response body. - */ - body: boolean; +/** Contains response data for the getAtScope operation. */ +export type TagsOperationsGetAtScopeResponse = TagsResource; - /** - * 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: boolean; - }; -}; +/** Optional parameters. */ +export interface TagsOperationsDeleteAtScopeOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdate operation. - */ -export type ResourcesCreateOrUpdateResponse = GenericResource & { - /** - * 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: GenericResource; - }; -}; +/** Optional parameters. */ +export interface TagsOperationsListNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the update operation. - */ -export type ResourcesUpdateResponse = GenericResource & { - /** - * 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: GenericResource; - }; -}; +/** Contains response data for the listNext operation. */ +export type TagsOperationsListNextResponse = TagsListResult; -/** - * Contains response data for the get operation. - */ -export type ResourcesGetResponse = GenericResource & { - /** - * 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: GenericResource; - }; -}; +/** Optional parameters. */ +export interface TagsOperationsListNextNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the checkExistenceById operation. - */ -export type ResourcesCheckExistenceByIdResponse = { - /** - * The parsed response body. - */ - body: boolean; +/** Contains response data for the listNextNext operation. */ +export type TagsOperationsListNextNextResponse = TagsListResult; - /** - * 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: boolean; - }; -}; +/** Optional parameters. */ +export interface DeploymentOperationsGetAtScopeOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdateById operation. - */ -export type ResourcesCreateOrUpdateByIdResponse = GenericResource & { - /** - * 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: GenericResource; - }; -}; +/** Contains response data for the getAtScope operation. */ +export type DeploymentOperationsGetAtScopeResponse = DeploymentOperation; -/** - * Contains response data for the updateById operation. - */ -export type ResourcesUpdateByIdResponse = GenericResource & { - /** - * 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: GenericResource; - }; -}; +/** Optional parameters. */ +export interface DeploymentOperationsListAtScopeOptionalParams + extends coreClient.OperationOptions { + /** The number of results to return. */ + top?: number; +} -/** - * Contains response data for the getById operation. - */ -export type ResourcesGetByIdResponse = GenericResource & { - /** - * 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: GenericResource; - }; -}; +/** Contains response data for the listAtScope operation. */ +export type DeploymentOperationsListAtScopeResponse = DeploymentOperationsListResult; -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type ResourcesBeginCreateOrUpdateResponse = GenericResource & { - /** - * 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: GenericResource; - }; -}; +/** Optional parameters. */ +export interface DeploymentOperationsGetAtTenantScopeOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the beginUpdate operation. - */ -export type ResourcesBeginUpdateResponse = GenericResource & { - /** - * 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: GenericResource; - }; -}; +/** Contains response data for the getAtTenantScope operation. */ +export type DeploymentOperationsGetAtTenantScopeResponse = DeploymentOperation; -/** - * Contains response data for the beginCreateOrUpdateById operation. - */ -export type ResourcesBeginCreateOrUpdateByIdResponse = GenericResource & { - /** - * 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: GenericResource; - }; -}; +/** Optional parameters. */ +export interface DeploymentOperationsListAtTenantScopeOptionalParams + extends coreClient.OperationOptions { + /** The number of results to return. */ + top?: number; +} -/** - * Contains response data for the beginUpdateById operation. - */ -export type ResourcesBeginUpdateByIdResponse = GenericResource & { - /** - * 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: GenericResource; - }; -}; +/** Contains response data for the listAtTenantScope operation. */ +export type DeploymentOperationsListAtTenantScopeResponse = DeploymentOperationsListResult; -/** - * Contains response data for the listByResourceGroupNext operation. - */ -export type ResourcesListByResourceGroupNextResponse = ResourceListResult & { - /** - * 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: ResourceListResult; - }; -}; +/** Optional parameters. */ +export interface DeploymentOperationsGetAtManagementGroupScopeOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listNext operation. - */ -export type ResourcesListNextResponse = ResourceListResult & { - /** - * 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: ResourceListResult; - }; -}; +/** Contains response data for the getAtManagementGroupScope operation. */ +export type DeploymentOperationsGetAtManagementGroupScopeResponse = DeploymentOperation; -/** - * Contains response data for the checkExistence operation. - */ -export type ResourceGroupsCheckExistenceResponse = { - /** - * The parsed response body. - */ - body: boolean; +/** Optional parameters. */ +export interface DeploymentOperationsListAtManagementGroupScopeOptionalParams + extends coreClient.OperationOptions { + /** The number of results to return. */ + top?: number; +} - /** - * 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: boolean; - }; -}; +/** Contains response data for the listAtManagementGroupScope operation. */ +export type DeploymentOperationsListAtManagementGroupScopeResponse = DeploymentOperationsListResult; -/** - * Contains response data for the createOrUpdate operation. - */ -export type ResourceGroupsCreateOrUpdateResponse = ResourceGroup & { - /** - * 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: ResourceGroup; - }; -}; +/** Optional parameters. */ +export interface DeploymentOperationsGetAtSubscriptionScopeOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type ResourceGroupsGetResponse = ResourceGroup & { - /** - * 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: ResourceGroup; - }; -}; +/** Contains response data for the getAtSubscriptionScope operation. */ +export type DeploymentOperationsGetAtSubscriptionScopeResponse = DeploymentOperation; -/** - * Contains response data for the update operation. - */ -export type ResourceGroupsUpdateResponse = ResourceGroup & { - /** - * 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: ResourceGroup; - }; -}; +/** Optional parameters. */ +export interface DeploymentOperationsListAtSubscriptionScopeOptionalParams + extends coreClient.OperationOptions { + /** The number of results to return. */ + top?: number; +} -/** - * Contains response data for the exportTemplate operation. - */ -export type ResourceGroupsExportTemplateResponse = ResourceGroupExportResult & { - /** - * 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: ResourceGroupExportResult; - }; -}; +/** Contains response data for the listAtSubscriptionScope operation. */ +export type DeploymentOperationsListAtSubscriptionScopeResponse = DeploymentOperationsListResult; -/** - * Contains response data for the list operation. - */ -export type ResourceGroupsListResponse = ResourceGroupListResult & { - /** - * 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: ResourceGroupListResult; - }; -}; +/** Optional parameters. */ +export interface DeploymentOperationsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the beginExportTemplate operation. - */ -export type ResourceGroupsBeginExportTemplateResponse = ResourceGroupExportResult & { - /** - * 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: ResourceGroupExportResult; - }; -}; +/** Contains response data for the get operation. */ +export type DeploymentOperationsGetResponse = DeploymentOperation; -/** - * Contains response data for the listNext operation. - */ -export type ResourceGroupsListNextResponse = ResourceGroupListResult & { - /** - * 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: ResourceGroupListResult; - }; -}; +/** Optional parameters. */ +export interface DeploymentOperationsListOptionalParams + extends coreClient.OperationOptions { + /** The number of results to return. */ + top?: number; +} -/** - * Contains response data for the createOrUpdateValue operation. - */ -export type TagsCreateOrUpdateValueResponse = TagValue & { - /** - * 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: TagValue; - }; -}; +/** Contains response data for the list operation. */ +export type DeploymentOperationsListResponse = DeploymentOperationsListResult; -/** - * Contains response data for the createOrUpdate operation. - */ -export type TagsCreateOrUpdateResponse = TagDetails & { - /** - * 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: TagDetails; - }; -}; +/** Optional parameters. */ +export interface DeploymentOperationsListAtScopeNextOptionalParams + extends coreClient.OperationOptions { + /** The number of results to return. */ + top?: number; +} -/** - * Contains response data for the list operation. - */ -export type TagsListResponse = TagsListResult & { - /** - * 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: TagsListResult; - }; -}; +/** Contains response data for the listAtScopeNext operation. */ +export type DeploymentOperationsListAtScopeNextResponse = DeploymentOperationsListResult; -/** - * Contains response data for the createOrUpdateAtScope operation. - */ -export type TagsCreateOrUpdateAtScopeResponse = TagsResource & { - /** - * 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: TagsResource; - }; -}; +/** Optional parameters. */ +export interface DeploymentOperationsListAtTenantScopeNextOptionalParams + extends coreClient.OperationOptions { + /** The number of results to return. */ + top?: number; +} -/** - * Contains response data for the updateAtScope operation. - */ -export type TagsUpdateAtScopeResponse = TagsResource & { - /** - * 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: TagsResource; - }; -}; +/** Contains response data for the listAtTenantScopeNext operation. */ +export type DeploymentOperationsListAtTenantScopeNextResponse = DeploymentOperationsListResult; -/** - * Contains response data for the getAtScope operation. - */ -export type TagsGetAtScopeResponse = TagsResource & { - /** - * 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: TagsResource; - }; -}; +/** Optional parameters. */ +export interface DeploymentOperationsListAtManagementGroupScopeNextOptionalParams + extends coreClient.OperationOptions { + /** The number of results to return. */ + top?: number; +} -/** - * Contains response data for the listNext operation. - */ -export type TagsListNextResponse = TagsListResult & { - /** - * 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: TagsListResult; - }; -}; +/** Contains response data for the listAtManagementGroupScopeNext operation. */ +export type DeploymentOperationsListAtManagementGroupScopeNextResponse = DeploymentOperationsListResult; -/** - * Contains response data for the getAtScope operation. - */ -export type DeploymentOperationsGetAtScopeResponse = DeploymentOperation & { - /** - * 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: DeploymentOperation; - }; -}; +/** Optional parameters. */ +export interface DeploymentOperationsListAtSubscriptionScopeNextOptionalParams + extends coreClient.OperationOptions { + /** The number of results to return. */ + top?: number; +} -/** - * Contains response data for the listAtScope operation. - */ -export type DeploymentOperationsListAtScopeResponse = DeploymentOperationsListResult & { - /** - * 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: DeploymentOperationsListResult; - }; -}; +/** Contains response data for the listAtSubscriptionScopeNext operation. */ +export type DeploymentOperationsListAtSubscriptionScopeNextResponse = DeploymentOperationsListResult; -/** - * Contains response data for the getAtTenantScope operation. - */ -export type DeploymentOperationsGetAtTenantScopeResponse = DeploymentOperation & { - /** - * 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: DeploymentOperation; - }; -}; +/** Optional parameters. */ +export interface DeploymentOperationsListNextOptionalParams + extends coreClient.OperationOptions { + /** The number of results to return. */ + top?: number; +} -/** - * Contains response data for the listAtTenantScope operation. - */ -export type DeploymentOperationsListAtTenantScopeResponse = DeploymentOperationsListResult & { - /** - * 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: DeploymentOperationsListResult; - }; -}; +/** Contains response data for the listNext operation. */ +export type DeploymentOperationsListNextResponse = DeploymentOperationsListResult; -/** - * Contains response data for the getAtManagementGroupScope operation. - */ -export type DeploymentOperationsGetAtManagementGroupScopeResponse = DeploymentOperation & { - /** - * 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: DeploymentOperation; - }; -}; +/** Optional parameters. */ +export interface DeploymentOperationsListAtScopeNextNextOptionalParams + extends coreClient.OperationOptions { + /** The number of results to return. */ + top?: number; +} -/** - * Contains response data for the listAtManagementGroupScope operation. - */ -export type DeploymentOperationsListAtManagementGroupScopeResponse = DeploymentOperationsListResult & { - /** - * 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: DeploymentOperationsListResult; - }; -}; +/** Contains response data for the listAtScopeNextNext operation. */ +export type DeploymentOperationsListAtScopeNextNextResponse = DeploymentOperationsListResult; -/** - * Contains response data for the getAtSubscriptionScope operation. - */ -export type DeploymentOperationsGetAtSubscriptionScopeResponse = DeploymentOperation & { - /** - * 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: DeploymentOperation; - }; -}; +/** Optional parameters. */ +export interface DeploymentOperationsListAtTenantScopeNextNextOptionalParams + extends coreClient.OperationOptions { + /** The number of results to return. */ + top?: number; +} -/** - * Contains response data for the listAtSubscriptionScope operation. - */ -export type DeploymentOperationsListAtSubscriptionScopeResponse = DeploymentOperationsListResult & { - /** - * 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: DeploymentOperationsListResult; - }; -}; +/** Contains response data for the listAtTenantScopeNextNext operation. */ +export type DeploymentOperationsListAtTenantScopeNextNextResponse = DeploymentOperationsListResult; -/** - * Contains response data for the get operation. - */ -export type DeploymentOperationsGetResponse = DeploymentOperation & { - /** - * 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: DeploymentOperation; - }; -}; +/** Optional parameters. */ +export interface DeploymentOperationsListAtManagementGroupScopeNextNextOptionalParams + extends coreClient.OperationOptions { + /** The number of results to return. */ + top?: number; +} -/** - * Contains response data for the list operation. - */ -export type DeploymentOperationsListResponse = DeploymentOperationsListResult & { - /** - * 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: DeploymentOperationsListResult; - }; -}; +/** Contains response data for the listAtManagementGroupScopeNextNext operation. */ +export type DeploymentOperationsListAtManagementGroupScopeNextNextResponse = DeploymentOperationsListResult; -/** - * Contains response data for the listAtScopeNext operation. - */ -export type DeploymentOperationsListAtScopeNextResponse = DeploymentOperationsListResult & { - /** - * 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: DeploymentOperationsListResult; - }; -}; +/** Optional parameters. */ +export interface DeploymentOperationsListAtSubscriptionScopeNextNextOptionalParams + extends coreClient.OperationOptions { + /** The number of results to return. */ + top?: number; +} -/** - * Contains response data for the listAtTenantScopeNext operation. - */ -export type DeploymentOperationsListAtTenantScopeNextResponse = DeploymentOperationsListResult & { - /** - * 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: DeploymentOperationsListResult; - }; -}; +/** Contains response data for the listAtSubscriptionScopeNextNext operation. */ +export type DeploymentOperationsListAtSubscriptionScopeNextNextResponse = DeploymentOperationsListResult; -/** - * Contains response data for the listAtManagementGroupScopeNext operation. - */ -export type DeploymentOperationsListAtManagementGroupScopeNextResponse = DeploymentOperationsListResult & { - /** - * 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: DeploymentOperationsListResult; - }; -}; +/** Optional parameters. */ +export interface DeploymentOperationsListNextNextOptionalParams + extends coreClient.OperationOptions { + /** The number of results to return. */ + top?: number; +} -/** - * Contains response data for the listAtSubscriptionScopeNext operation. - */ -export type DeploymentOperationsListAtSubscriptionScopeNextResponse = DeploymentOperationsListResult & { - /** - * 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: DeploymentOperationsListResult; - }; -}; +/** Contains response data for the listNextNext operation. */ +export type DeploymentOperationsListNextNextResponse = DeploymentOperationsListResult; -/** - * Contains response data for the listNext operation. - */ -export type DeploymentOperationsListNextResponse = DeploymentOperationsListResult & { - /** - * 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: DeploymentOperationsListResult; - }; -}; +/** Optional parameters. */ +export interface ResourceManagementClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/resources/arm-resources/src/models/mappers.ts b/sdk/resources/arm-resources/src/models/mappers.ts index 18499387682a..2c7c561438fe 100644 --- a/sdk/resources/arm-resources/src/models/mappers.ts +++ b/sdk/resources/arm-resources/src/models/mappers.ts @@ -6,48 +6,27 @@ * 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 DeploymentExtendedFilter: msRest.CompositeMapper = { - serializedName: "DeploymentExtendedFilter", - type: { - name: "Composite", - className: "DeploymentExtendedFilter", - modelProperties: { - provisioningState: { - serializedName: "provisioningState", - type: { - name: "String" - } - } - } - } -}; - -export const GenericResourceFilter: msRest.CompositeMapper = { - serializedName: "GenericResourceFilter", +export const OperationListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "GenericResourceFilter", + className: "OperationListResult", modelProperties: { - resourceType: { - serializedName: "resourceType", - type: { - name: "String" - } - }, - tagname: { - serializedName: "tagname", + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } } }, - tagvalue: { - serializedName: "tagvalue", + nextLink: { + serializedName: "nextLink", type: { name: "String" } @@ -56,60 +35,53 @@ export const GenericResourceFilter: msRest.CompositeMapper = { } }; -export const ResourceGroupFilter: msRest.CompositeMapper = { - serializedName: "ResourceGroupFilter", +export const Operation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceGroupFilter", + className: "Operation", modelProperties: { - tagName: { - serializedName: "tagName", + name: { + serializedName: "name", type: { name: "String" } }, - tagValue: { - serializedName: "tagValue", + display: { + serializedName: "display", type: { - name: "String" + name: "Composite", + className: "OperationDisplay" } } } } }; -export const TemplateLink: msRest.CompositeMapper = { - serializedName: "TemplateLink", +export const OperationDisplay: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TemplateLink", + className: "OperationDisplay", modelProperties: { - uri: { - serializedName: "uri", - type: { - name: "String" - } - }, - id: { - serializedName: "id", + provider: { + serializedName: "provider", type: { name: "String" } }, - relativePath: { - serializedName: "relativePath", + resource: { + serializedName: "resource", type: { name: "String" } }, - contentVersion: { - serializedName: "contentVersion", + operation: { + serializedName: "operation", type: { name: "String" } }, - queryString: { - serializedName: "queryString", + description: { + serializedName: "description", type: { name: "String" } @@ -118,86 +90,132 @@ export const TemplateLink: msRest.CompositeMapper = { } }; -export const ParametersLink: msRest.CompositeMapper = { - serializedName: "ParametersLink", +export const CloudError: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ParametersLink", + className: "CloudError", modelProperties: { - uri: { - required: true, - serializedName: "uri", - type: { - name: "String" - } - }, - contentVersion: { - serializedName: "contentVersion", + error: { + serializedName: "error", type: { - name: "String" + name: "Composite", + className: "ErrorResponse" } } } } }; -export const DebugSetting: msRest.CompositeMapper = { - serializedName: "DebugSetting", +export const ErrorResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DebugSetting", + className: "ErrorResponse", modelProperties: { - detailLevel: { - serializedName: "detailLevel", + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + }, + target: { + serializedName: "target", + readOnly: true, type: { name: "String" } + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorResponse" + } + } + } + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } } } } }; -export const OnErrorDeployment: msRest.CompositeMapper = { - serializedName: "OnErrorDeployment", +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OnErrorDeployment", + className: "ErrorAdditionalInfo", modelProperties: { type: { serializedName: "type", + readOnly: true, type: { - name: "Enum", - allowedValues: ["LastSuccessful", "SpecificDeployment"] + name: "String" } }, - deploymentName: { - serializedName: "deploymentName", + info: { + serializedName: "info", + readOnly: true, type: { - name: "String" + name: "Dictionary", + value: { type: { name: "any" } } } } } } }; -export const ExpressionEvaluationOptions: msRest.CompositeMapper = { - serializedName: "ExpressionEvaluationOptions", +export const Deployment: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ExpressionEvaluationOptions", + className: "Deployment", modelProperties: { - scope: { - serializedName: "scope", + location: { + serializedName: "location", type: { name: "String" } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "DeploymentProperties" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } } } } }; -export const DeploymentProperties: msRest.CompositeMapper = { - serializedName: "DeploymentProperties", +export const DeploymentProperties: coreClient.CompositeMapper = { type: { name: "Composite", className: "DeploymentProperties", @@ -205,7 +223,8 @@ export const DeploymentProperties: msRest.CompositeMapper = { template: { serializedName: "template", type: { - name: "Object" + name: "Dictionary", + value: { type: { name: "any" } } } }, templateLink: { @@ -218,7 +237,8 @@ export const DeploymentProperties: msRest.CompositeMapper = { parameters: { serializedName: "parameters", type: { - name: "Object" + name: "Dictionary", + value: { type: { name: "any" } } } }, parametersLink: { @@ -229,8 +249,8 @@ export const DeploymentProperties: msRest.CompositeMapper = { } }, mode: { - required: true, serializedName: "mode", + required: true, type: { name: "Enum", allowedValues: ["Incremental", "Complete"] @@ -261,468 +281,380 @@ export const DeploymentProperties: msRest.CompositeMapper = { } }; -export const Deployment: msRest.CompositeMapper = { - serializedName: "Deployment", +export const TemplateLink: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Deployment", + className: "TemplateLink", modelProperties: { - location: { - serializedName: "location", + uri: { + serializedName: "uri", type: { name: "String" } }, - properties: { - required: true, - serializedName: "properties", + id: { + serializedName: "id", type: { - name: "Composite", - className: "DeploymentProperties" + name: "String" } }, - tags: { - serializedName: "tags", + relativePath: { + serializedName: "relativePath", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "String" + } + }, + contentVersion: { + serializedName: "contentVersion", + type: { + name: "String" + } + }, + queryString: { + serializedName: "queryString", + type: { + name: "String" } } } } }; -export const ScopedDeployment: msRest.CompositeMapper = { - serializedName: "ScopedDeployment", +export const ParametersLink: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ScopedDeployment", + className: "ParametersLink", modelProperties: { - location: { + uri: { + serializedName: "uri", required: true, - serializedName: "location", type: { name: "String" } }, - properties: { - required: true, - serializedName: "properties", - type: { - name: "Composite", - className: "DeploymentProperties" - } - }, - tags: { - serializedName: "tags", + contentVersion: { + serializedName: "contentVersion", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "String" } } } } }; -export const DeploymentExportResult: msRest.CompositeMapper = { - serializedName: "DeploymentExportResult", +export const DebugSetting: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DeploymentExportResult", + className: "DebugSetting", modelProperties: { - template: { - serializedName: "template", + detailLevel: { + serializedName: "detailLevel", type: { - name: "Object" + name: "String" } } } } }; -export const DeploymentWhatIfSettings: msRest.CompositeMapper = { - serializedName: "DeploymentWhatIfSettings", +export const OnErrorDeployment: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DeploymentWhatIfSettings", + className: "OnErrorDeployment", modelProperties: { - resultFormat: { - serializedName: "resultFormat", + type: { + serializedName: "type", type: { name: "Enum", - allowedValues: ["ResourceIdOnly", "FullResourcePayloads"] + allowedValues: ["LastSuccessful", "SpecificDeployment"] } - } - } - } -}; - -export const DeploymentWhatIfProperties: msRest.CompositeMapper = { - serializedName: "DeploymentWhatIfProperties", - type: { - name: "Composite", - className: "DeploymentWhatIfProperties", - modelProperties: { - ...DeploymentProperties.type.modelProperties, - whatIfSettings: { - serializedName: "whatIfSettings", + }, + deploymentName: { + serializedName: "deploymentName", type: { - name: "Composite", - className: "DeploymentWhatIfSettings" + name: "String" } } } } }; -export const DeploymentWhatIf: msRest.CompositeMapper = { - serializedName: "DeploymentWhatIf", +export const ExpressionEvaluationOptions: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DeploymentWhatIf", + className: "ExpressionEvaluationOptions", modelProperties: { - location: { - serializedName: "location", + scope: { + serializedName: "scope", type: { name: "String" } - }, - properties: { - required: true, - serializedName: "properties", - type: { - name: "Composite", - className: "DeploymentWhatIfProperties" - } } } } }; -export const ScopedDeploymentWhatIf: msRest.CompositeMapper = { - serializedName: "ScopedDeploymentWhatIf", +export const DeploymentExtended: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ScopedDeploymentWhatIf", + className: "DeploymentExtended", modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, location: { - required: true, serializedName: "location", type: { name: "String" } }, properties: { - required: true, serializedName: "properties", type: { name: "Composite", - className: "DeploymentWhatIfProperties" + className: "DeploymentPropertiesExtended" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const ErrorAdditionalInfo: msRest.CompositeMapper = { - serializedName: "ErrorAdditionalInfo", +export const DeploymentPropertiesExtended: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorAdditionalInfo", + className: "DeploymentPropertiesExtended", modelProperties: { - type: { + provisioningState: { + serializedName: "provisioningState", readOnly: true, - serializedName: "type", type: { name: "String" } }, - info: { + correlationId: { + serializedName: "correlationId", readOnly: true, - serializedName: "info", type: { - name: "Object" + name: "String" } - } - } - } -}; - -export const ErrorResponse: msRest.CompositeMapper = { - serializedName: "ErrorResponse", - type: { - name: "Composite", - className: "ErrorResponse", - modelProperties: { - code: { + }, + timestamp: { + serializedName: "timestamp", readOnly: true, - serializedName: "code", type: { - name: "String" + name: "DateTime" } }, - message: { + duration: { + serializedName: "duration", readOnly: true, - serializedName: "message", type: { name: "String" } }, - target: { + outputs: { + serializedName: "outputs", readOnly: true, - serializedName: "target", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "any" } } } }, - details: { + providers: { + serializedName: "providers", readOnly: true, - serializedName: "details", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ErrorResponse" + className: "Provider" } } } }, - additionalInfo: { + dependencies: { + serializedName: "dependencies", readOnly: true, - serializedName: "additionalInfo", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ErrorAdditionalInfo" + className: "Dependency" } } } - } - } - } -}; - -export const ApiProfile: msRest.CompositeMapper = { - serializedName: "ApiProfile", - type: { - name: "Composite", - className: "ApiProfile", - modelProperties: { - profileVersion: { - readOnly: true, - serializedName: "profileVersion", + }, + templateLink: { + serializedName: "templateLink", type: { - name: "String" + name: "Composite", + className: "TemplateLink" } }, - apiVersion: { + parameters: { + serializedName: "parameters", readOnly: true, - serializedName: "apiVersion", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "any" } } } - } - } - } -}; - -export const AliasPathMetadata: msRest.CompositeMapper = { - serializedName: "AliasPathMetadata", - type: { - name: "Composite", - className: "AliasPathMetadata", - modelProperties: { - type: { - readOnly: true, - serializedName: "type", + }, + parametersLink: { + serializedName: "parametersLink", type: { - name: "String" + name: "Composite", + className: "ParametersLink" } }, - attributes: { + mode: { + serializedName: "mode", readOnly: true, - serializedName: "attributes", - type: { - name: "String" - } - } - } - } -}; - -export const AliasPattern: msRest.CompositeMapper = { - serializedName: "AliasPattern", - type: { - name: "Composite", - className: "AliasPattern", - modelProperties: { - phrase: { - serializedName: "phrase", type: { - name: "String" + name: "Enum", + allowedValues: ["Incremental", "Complete"] } }, - variable: { - serializedName: "variable", + debugSetting: { + serializedName: "debugSetting", type: { - name: "String" + name: "Composite", + className: "DebugSetting" } }, - type: { - serializedName: "type", + onErrorDeployment: { + serializedName: "onErrorDeployment", type: { - name: "Enum", - allowedValues: ["NotSpecified", "Extract"] + name: "Composite", + className: "OnErrorDeploymentExtended" } - } - } - } -}; - -export const AliasPath: msRest.CompositeMapper = { - serializedName: "AliasPath", - type: { - name: "Composite", - className: "AliasPath", - modelProperties: { - path: { - serializedName: "path", + }, + templateHash: { + serializedName: "templateHash", + readOnly: true, type: { name: "String" } }, - apiVersions: { - serializedName: "apiVersions", + outputResources: { + serializedName: "outputResources", + readOnly: true, type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "ResourceReference" } } } }, - pattern: { - serializedName: "pattern", + validatedResources: { + serializedName: "validatedResources", + readOnly: true, type: { - name: "Composite", - className: "AliasPattern" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceReference" + } + } } }, - metadata: { - readOnly: true, - serializedName: "metadata", + error: { + serializedName: "error", type: { name: "Composite", - className: "AliasPathMetadata" + className: "ErrorResponse" } } } } }; -export const Alias: msRest.CompositeMapper = { - serializedName: "Alias", +export const Provider: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Alias", + className: "Provider", modelProperties: { - name: { - serializedName: "name", + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - paths: { - serializedName: "paths", + namespace: { + serializedName: "namespace", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AliasPath" - } - } + name: "String" } }, - type: { - serializedName: "type", - type: { - name: "Enum", - allowedValues: ["NotSpecified", "PlainText", "Mask"] - } - }, - defaultPath: { - serializedName: "defaultPath", + registrationState: { + serializedName: "registrationState", + readOnly: true, type: { name: "String" } }, - defaultPattern: { - serializedName: "defaultPattern", - type: { - name: "Composite", - className: "AliasPattern" - } - }, - defaultMetadata: { + registrationPolicy: { + serializedName: "registrationPolicy", readOnly: true, - serializedName: "defaultMetadata", - type: { - name: "Composite", - className: "AliasPathMetadata" - } - } - } - } -}; - -export const ProviderExtendedLocation: msRest.CompositeMapper = { - serializedName: "ProviderExtendedLocation", - type: { - name: "Composite", - className: "ProviderExtendedLocation", - modelProperties: { - location: { - serializedName: "location", type: { name: "String" } }, - type: { - serializedName: "type", - type: { - name: "String" - } - }, - extendedLocations: { - serializedName: "extendedLocations", + resourceTypes: { + serializedName: "resourceTypes", + readOnly: true, type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "ProviderResourceType" } } } + }, + providerAuthorizationConsentState: { + serializedName: "providerAuthorizationConsentState", + type: { + name: "String" + } } } } }; -export const ProviderResourceType: msRest.CompositeMapper = { - serializedName: "ProviderResourceType", +export const ProviderResourceType: coreClient.CompositeMapper = { type: { name: "Composite", className: "ProviderResourceType", @@ -780,15 +712,15 @@ export const ProviderResourceType: msRest.CompositeMapper = { } }, defaultApiVersion: { - readOnly: true, serializedName: "defaultApiVersion", + readOnly: true, type: { name: "String" } }, apiProfiles: { - readOnly: true, serializedName: "apiProfiles", + readOnly: true, type: { name: "Sequence", element: { @@ -809,7 +741,35 @@ export const ProviderResourceType: msRest.CompositeMapper = { serializedName: "properties", type: { name: "Dictionary", - value: { + value: { type: { name: "String" } } + } + } + } + } +}; + +export const ProviderExtendedLocation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProviderExtendedLocation", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "String" + } + }, + extendedLocations: { + serializedName: "extendedLocations", + type: { + name: "Sequence", + element: { type: { name: "String" } @@ -820,48 +780,561 @@ export const ProviderResourceType: msRest.CompositeMapper = { } }; -export const Provider: msRest.CompositeMapper = { - serializedName: "Provider", +export const Alias: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Provider", + className: "Alias", modelProperties: { - id: { - readOnly: true, - serializedName: "id", + name: { + serializedName: "name", type: { name: "String" } }, - namespace: { - serializedName: "namespace", + paths: { + serializedName: "paths", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AliasPath" + } + } + } + }, + type: { + serializedName: "type", + type: { + name: "Enum", + allowedValues: ["NotSpecified", "PlainText", "Mask"] + } + }, + defaultPath: { + serializedName: "defaultPath", type: { name: "String" } }, - registrationState: { + defaultPattern: { + serializedName: "defaultPattern", + type: { + name: "Composite", + className: "AliasPattern" + } + }, + defaultMetadata: { + serializedName: "defaultMetadata", + type: { + name: "Composite", + className: "AliasPathMetadata" + } + } + } + } +}; + +export const AliasPath: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AliasPath", + modelProperties: { + path: { + serializedName: "path", + type: { + name: "String" + } + }, + apiVersions: { + serializedName: "apiVersions", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + pattern: { + serializedName: "pattern", + type: { + name: "Composite", + className: "AliasPattern" + } + }, + metadata: { + serializedName: "metadata", + type: { + name: "Composite", + className: "AliasPathMetadata" + } + } + } + } +}; + +export const AliasPattern: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AliasPattern", + modelProperties: { + phrase: { + serializedName: "phrase", + type: { + name: "String" + } + }, + variable: { + serializedName: "variable", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "Enum", + allowedValues: ["NotSpecified", "Extract"] + } + } + } + } +}; + +export const AliasPathMetadata: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AliasPathMetadata", + modelProperties: { + type: { + serializedName: "type", readOnly: true, - serializedName: "registrationState", type: { name: "String" } }, - registrationPolicy: { + attributes: { + serializedName: "attributes", readOnly: true, - serializedName: "registrationPolicy", type: { name: "String" } + } + } + } +}; + +export const ApiProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApiProfile", + modelProperties: { + profileVersion: { + serializedName: "profileVersion", + readOnly: true, + type: { + name: "String" + } + }, + apiVersion: { + serializedName: "apiVersion", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Dependency: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Dependency", + modelProperties: { + dependsOn: { + serializedName: "dependsOn", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BasicDependency" + } + } + } + }, + id: { + serializedName: "id", + type: { + name: "String" + } + }, + resourceType: { + serializedName: "resourceType", + type: { + name: "String" + } + }, + resourceName: { + serializedName: "resourceName", + type: { + name: "String" + } + } + } + } +}; + +export const BasicDependency: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BasicDependency", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + resourceType: { + serializedName: "resourceType", + type: { + name: "String" + } + }, + resourceName: { + serializedName: "resourceName", + type: { + name: "String" + } + } + } + } +}; + +export const OnErrorDeploymentExtended: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OnErrorDeploymentExtended", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "Enum", + allowedValues: ["LastSuccessful", "SpecificDeployment"] + } + }, + deploymentName: { + serializedName: "deploymentName", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceReference: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceReference", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const DeploymentValidateResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DeploymentValidateResult", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorResponse" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "DeploymentPropertiesExtended" + } + } + } + } +}; + +export const DeploymentExportResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DeploymentExportResult", + modelProperties: { + template: { + serializedName: "template", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + +export const DeploymentListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DeploymentListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DeploymentExtended" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ScopedDeployment: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ScopedDeployment", + modelProperties: { + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "DeploymentProperties" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const ScopedDeploymentWhatIf: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ScopedDeploymentWhatIf", + modelProperties: { + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "DeploymentWhatIfProperties" + } + } + } + } +}; + +export const DeploymentWhatIfSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DeploymentWhatIfSettings", + modelProperties: { + resultFormat: { + serializedName: "resultFormat", + type: { + name: "Enum", + allowedValues: ["ResourceIdOnly", "FullResourcePayloads"] + } + } + } + } +}; + +export const WhatIfOperationResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WhatIfOperationResult", + modelProperties: { + status: { + serializedName: "status", + type: { + name: "String" + } + }, + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorResponse" + } + }, + changes: { + serializedName: "properties.changes", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "WhatIfChange" + } + } + } + } + } + } +}; + +export const WhatIfChange: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WhatIfChange", + modelProperties: { + resourceId: { + serializedName: "resourceId", + required: true, + type: { + name: "String" + } + }, + changeType: { + serializedName: "changeType", + required: true, + type: { + name: "Enum", + allowedValues: [ + "Create", + "Delete", + "Ignore", + "Deploy", + "NoChange", + "Modify", + "Unsupported" + ] + } + }, + unsupportedReason: { + serializedName: "unsupportedReason", + type: { + name: "String" + } + }, + before: { + serializedName: "before", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + }, + after: { + serializedName: "after", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + }, + delta: { + serializedName: "delta", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "WhatIfPropertyChange" + } + } + } + } + } + } +}; + +export const WhatIfPropertyChange: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WhatIfPropertyChange", + modelProperties: { + path: { + serializedName: "path", + required: true, + type: { + name: "String" + } + }, + propertyChangeType: { + serializedName: "propertyChangeType", + required: true, + type: { + name: "Enum", + allowedValues: ["Create", "Delete", "Modify", "Array", "NoEffect"] + } + }, + before: { + serializedName: "before", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + }, + after: { + serializedName: "after", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } }, - resourceTypes: { - readOnly: true, - serializedName: "resourceTypes", + children: { + serializedName: "children", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ProviderResourceType" + className: "WhatIfPropertyChange" } } } @@ -870,66 +1343,48 @@ export const Provider: msRest.CompositeMapper = { } }; -export const BasicDependency: msRest.CompositeMapper = { - serializedName: "BasicDependency", +export const DeploymentWhatIf: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BasicDependency", + className: "DeploymentWhatIf", modelProperties: { - id: { - serializedName: "id", - type: { - name: "String" - } - }, - resourceType: { - serializedName: "resourceType", + location: { + serializedName: "location", type: { name: "String" } }, - resourceName: { - serializedName: "resourceName", + properties: { + serializedName: "properties", type: { - name: "String" + name: "Composite", + className: "DeploymentWhatIfProperties" } } } } }; -export const Dependency: msRest.CompositeMapper = { - serializedName: "Dependency", +export const ProviderPermissionListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Dependency", + className: "ProviderPermissionListResult", modelProperties: { - dependsOn: { - serializedName: "dependsOn", + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "BasicDependency" + className: "ProviderPermission" } } } }, - id: { - serializedName: "id", - type: { - name: "String" - } - }, - resourceType: { - serializedName: "resourceType", - type: { - name: "String" - } - }, - resourceName: { - serializedName: "resourceName", + nextLink: { + serializedName: "nextLink", + readOnly: true, type: { name: "String" } @@ -938,45 +1393,33 @@ export const Dependency: msRest.CompositeMapper = { } }; -export const OnErrorDeploymentExtended: msRest.CompositeMapper = { - serializedName: "OnErrorDeploymentExtended", +export const ProviderPermission: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OnErrorDeploymentExtended", + className: "ProviderPermission", modelProperties: { - provisioningState: { - readOnly: true, - serializedName: "provisioningState", + applicationId: { + serializedName: "applicationId", type: { name: "String" } }, - type: { - serializedName: "type", + roleDefinition: { + serializedName: "roleDefinition", type: { - name: "Enum", - allowedValues: ["LastSuccessful", "SpecificDeployment"] + name: "Composite", + className: "RoleDefinition" } }, - deploymentName: { - serializedName: "deploymentName", + managedByRoleDefinition: { + serializedName: "managedByRoleDefinition", type: { - name: "String" + name: "Composite", + className: "RoleDefinition" } - } - } - } -}; - -export const ResourceReference: msRest.CompositeMapper = { - serializedName: "ResourceReference", - type: { - name: "Composite", - className: "ResourceReference", - modelProperties: { - id: { - readOnly: true, - serializedName: "id", + }, + providerAuthorizationConsentState: { + serializedName: "providerAuthorizationConsentState", type: { name: "String" } @@ -985,213 +1428,246 @@ export const ResourceReference: msRest.CompositeMapper = { } }; -export const DeploymentPropertiesExtended: msRest.CompositeMapper = { - serializedName: "DeploymentPropertiesExtended", +export const RoleDefinition: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DeploymentPropertiesExtended", + className: "RoleDefinition", modelProperties: { - provisioningState: { - readOnly: true, - serializedName: "provisioningState", - type: { - name: "String" - } - }, - correlationId: { - readOnly: true, - serializedName: "correlationId", + id: { + serializedName: "id", type: { name: "String" } }, - timestamp: { - readOnly: true, - serializedName: "timestamp", - type: { - name: "DateTime" - } - }, - duration: { - readOnly: true, - serializedName: "duration", + name: { + serializedName: "name", type: { name: "String" } }, - outputs: { - readOnly: true, - serializedName: "outputs", + isServiceRole: { + serializedName: "isServiceRole", type: { - name: "Object" + name: "Boolean" } }, - providers: { - readOnly: true, - serializedName: "providers", + permissions: { + serializedName: "permissions", type: { name: "Sequence", element: { type: { name: "Composite", - className: "Provider" + className: "Permission" } } } }, - dependencies: { - readOnly: true, - serializedName: "dependencies", + scopes: { + serializedName: "scopes", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "Dependency" + name: "String" } } } - }, - templateLink: { - readOnly: true, - serializedName: "templateLink", - type: { - name: "Composite", - className: "TemplateLink" - } - }, - parameters: { - readOnly: true, - serializedName: "parameters", + } + } + } +}; + +export const Permission: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Permission", + modelProperties: { + actions: { + serializedName: "actions", type: { - name: "Object" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - parametersLink: { - readOnly: true, - serializedName: "parametersLink", + notActions: { + serializedName: "notActions", type: { - name: "Composite", - className: "ParametersLink" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - mode: { - readOnly: true, - serializedName: "mode", + dataActions: { + serializedName: "dataActions", type: { - name: "Enum", - allowedValues: ["Incremental", "Complete"] + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - debugSetting: { - readOnly: true, - serializedName: "debugSetting", + notDataActions: { + serializedName: "notDataActions", type: { - name: "Composite", - className: "DebugSetting" + name: "Sequence", + element: { + type: { + name: "String" + } + } } - }, - onErrorDeployment: { - readOnly: true, - serializedName: "onErrorDeployment", + } + } + } +}; + +export const ProviderRegistrationRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProviderRegistrationRequest", + modelProperties: { + thirdPartyProviderConsent: { + serializedName: "thirdPartyProviderConsent", type: { name: "Composite", - className: "OnErrorDeploymentExtended" + className: "ProviderConsentDefinition" } - }, - templateHash: { - readOnly: true, - serializedName: "templateHash", + } + } + } +}; + +export const ProviderConsentDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProviderConsentDefinition", + modelProperties: { + consentToAuthorization: { + serializedName: "consentToAuthorization", type: { - name: "String" + name: "Boolean" } - }, - outputResources: { - readOnly: true, - serializedName: "outputResources", + } + } + } +}; + +export const ProviderListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProviderListResult", + modelProperties: { + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ResourceReference" + className: "Provider" } } } }, - validatedResources: { + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "validatedResources", + type: { + name: "String" + } + } + } + } +}; + +export const ProviderResourceTypeListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProviderResourceTypeListResult", + modelProperties: { + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ResourceReference" + className: "ProviderResourceType" } } } }, - error: { + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "error", type: { - name: "Composite", - className: "ErrorResponse" + name: "String" } } } } }; -export const DeploymentValidateResult: msRest.CompositeMapper = { - serializedName: "DeploymentValidateResult", +export const ResourceListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DeploymentValidateResult", + className: "ResourceListResult", modelProperties: { - error: { - readOnly: true, - serializedName: "error", + value: { + serializedName: "value", type: { - name: "Composite", - className: "ErrorResponse" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "GenericResourceExpanded" + } + } } }, - properties: { - serializedName: "properties", + nextLink: { + serializedName: "nextLink", + readOnly: true, type: { - name: "Composite", - className: "DeploymentPropertiesExtended" + name: "String" } } } } }; -export const DeploymentExtended: msRest.CompositeMapper = { - serializedName: "DeploymentExtended", +export const Resource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DeploymentExtended", + className: "Resource", 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" } @@ -1202,49 +1678,37 @@ export const DeploymentExtended: msRest.CompositeMapper = { name: "String" } }, - properties: { - serializedName: "properties", + extendedLocation: { + serializedName: "extendedLocation", type: { name: "Composite", - className: "DeploymentPropertiesExtended" + className: "ExtendedLocation" } }, tags: { serializedName: "tags", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } + value: { type: { name: "String" } } } } } } }; -export const ProviderResourceTypeListResult: msRest.CompositeMapper = { - serializedName: "ProviderResourceTypeListResult", +export const ExtendedLocation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ProviderResourceTypeListResult", + className: "ExtendedLocation", modelProperties: { - value: { - serializedName: "value", + type: { + serializedName: "type", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ProviderResourceType" - } - } + name: "String" } }, - nextLink: { - readOnly: true, - serializedName: "nextLink", + name: { + serializedName: "name", type: { name: "String" } @@ -1253,8 +1717,7 @@ export const ProviderResourceTypeListResult: msRest.CompositeMapper = { } }; -export const Plan: msRest.CompositeMapper = { - serializedName: "Plan", +export const Plan: coreClient.CompositeMapper = { type: { name: "Composite", className: "Plan", @@ -1293,8 +1756,7 @@ export const Plan: msRest.CompositeMapper = { } }; -export const Sku: msRest.CompositeMapper = { - serializedName: "Sku", +export const Sku: coreClient.CompositeMapper = { type: { name: "Composite", className: "Sku", @@ -1339,46 +1801,21 @@ export const Sku: msRest.CompositeMapper = { } }; -export const IdentityUserAssignedIdentitiesValue: msRest.CompositeMapper = { - serializedName: "Identity_userAssignedIdentitiesValue", - type: { - name: "Composite", - className: "IdentityUserAssignedIdentitiesValue", - modelProperties: { - principalId: { - readOnly: true, - serializedName: "principalId", - type: { - name: "String" - } - }, - clientId: { - readOnly: true, - serializedName: "clientId", - type: { - name: "String" - } - } - } - } -}; - -export const Identity: msRest.CompositeMapper = { - serializedName: "Identity", +export const Identity: coreClient.CompositeMapper = { type: { name: "Composite", className: "Identity", modelProperties: { principalId: { - readOnly: true, serializedName: "principalId", + readOnly: true, type: { name: "String" } }, tenantId: { - readOnly: true, serializedName: "tenantId", + readOnly: true, type: { name: "String" } @@ -1387,7 +1824,12 @@ export const Identity: msRest.CompositeMapper = { serializedName: "type", type: { name: "Enum", - allowedValues: ["SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", "None"] + allowedValues: [ + "SystemAssigned", + "UserAssigned", + "SystemAssigned, UserAssigned", + "None" + ] } }, userAssignedIdentities: { @@ -1406,249 +1848,103 @@ export const Identity: msRest.CompositeMapper = { } }; -export const Resource: msRest.CompositeMapper = { - serializedName: "Resource", +export const IdentityUserAssignedIdentitiesValue: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "IdentityUserAssignedIdentitiesValue", modelProperties: { - id: { - readOnly: true, - serializedName: "id", - type: { - name: "String" - } - }, - name: { + principalId: { + serializedName: "principalId", readOnly: true, - serializedName: "name", type: { name: "String" } }, - type: { + clientId: { + serializedName: "clientId", readOnly: true, - serializedName: "type", - type: { - name: "String" - } - }, - location: { - serializedName: "location", type: { name: "String" } - }, - extendedLocation: { - serializedName: "extendedLocation", - type: { - name: "Composite", - className: "ExtendedLocation" - } - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - } } } } }; -export const GenericResource: msRest.CompositeMapper = { - serializedName: "GenericResource", +export const ResourceGroup: coreClient.CompositeMapper = { type: { name: "Composite", - className: "GenericResource", + className: "ResourceGroup", modelProperties: { - ...Resource.type.modelProperties, - plan: { - serializedName: "plan", - type: { - name: "Composite", - className: "Plan" - } - }, - properties: { - serializedName: "properties", + id: { + serializedName: "id", + readOnly: true, type: { - name: "Object" + name: "String" } }, - kind: { - serializedName: "kind", - constraints: { - Pattern: /^[-\w\._,\(\)]+$/ - }, + name: { + serializedName: "name", + readOnly: true, type: { name: "String" } }, - managedBy: { - serializedName: "managedBy", + type: { + serializedName: "type", + readOnly: true, type: { name: "String" } }, - sku: { - serializedName: "sku", + properties: { + serializedName: "properties", type: { name: "Composite", - className: "Sku" + className: "ResourceGroupProperties" } }, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "Identity" - } - } - } - } -}; - -export const ExtendedLocation: msRest.CompositeMapper = { - serializedName: "ExtendedLocation", - type: { - name: "Composite", - className: "ExtendedLocation", - modelProperties: { - type: { - serializedName: "type", + location: { + serializedName: "location", + required: true, type: { name: "String" } }, - name: { - serializedName: "name", + managedBy: { + serializedName: "managedBy", type: { name: "String" } - } - } - } -}; - -export const GenericResourceExpanded: msRest.CompositeMapper = { - serializedName: "GenericResourceExpanded", - type: { - name: "Composite", - className: "GenericResourceExpanded", - modelProperties: { - ...GenericResource.type.modelProperties, - createdTime: { - readOnly: true, - serializedName: "createdTime", - type: { - name: "DateTime" - } - }, - changedTime: { - readOnly: true, - serializedName: "changedTime", - type: { - name: "DateTime" - } }, - provisioningState: { - readOnly: true, - serializedName: "provisioningState", + tags: { + serializedName: "tags", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const ResourceGroupProperties: msRest.CompositeMapper = { - serializedName: "ResourceGroupProperties", +export const ResourceGroupProperties: coreClient.CompositeMapper = { type: { name: "Composite", className: "ResourceGroupProperties", modelProperties: { provisioningState: { - readOnly: true, - serializedName: "provisioningState", - type: { - name: "String" - } - } - } - } -}; - -export const ResourceGroup: msRest.CompositeMapper = { - serializedName: "ResourceGroup", - type: { - name: "Composite", - className: "ResourceGroup", - modelProperties: { - id: { - readOnly: true, - serializedName: "id", - type: { - name: "String" - } - }, - name: { - readOnly: true, - serializedName: "name", - type: { - name: "String" - } - }, - type: { - readOnly: true, - serializedName: "type", - type: { - name: "String" - } - }, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "ResourceGroupProperties" - } - }, - location: { - required: true, - serializedName: "location", - type: { - name: "String" - } - }, - managedBy: { - serializedName: "managedBy", + serializedName: "provisioningState", + readOnly: true, type: { name: "String" } - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - } } } } }; -export const ResourceGroupPatchable: msRest.CompositeMapper = { - serializedName: "ResourceGroupPatchable", +export const ResourceGroupPatchable: coreClient.CompositeMapper = { type: { name: "Composite", className: "ResourceGroupPatchable", @@ -1676,22 +1972,17 @@ export const ResourceGroupPatchable: msRest.CompositeMapper = { serializedName: "tags", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } + value: { type: { name: "String" } } } } } } }; -export const ResourcesMoveInfo: msRest.CompositeMapper = { - serializedName: "ResourcesMoveInfo", +export const ExportTemplateRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourcesMoveInfo", + className: "ExportTemplateRequest", modelProperties: { resources: { serializedName: "resources", @@ -1704,8 +1995,8 @@ export const ResourcesMoveInfo: msRest.CompositeMapper = { } } }, - targetResourceGroup: { - serializedName: "targetResourceGroup", + options: { + serializedName: "options", type: { name: "String" } @@ -1714,25 +2005,49 @@ export const ResourcesMoveInfo: msRest.CompositeMapper = { } }; -export const ExportTemplateRequest: msRest.CompositeMapper = { - serializedName: "ExportTemplateRequest", +export const ResourceGroupExportResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ExportTemplateRequest", + className: "ResourceGroupExportResult", modelProperties: { - resources: { - serializedName: "resources", + template: { + serializedName: "template", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + }, + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorResponse" + } + } + } + } +}; + +export const ResourceGroupListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceGroupListResult", + modelProperties: { + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "ResourceGroup" } } } }, - options: { - serializedName: "options", + nextLink: { + serializedName: "nextLink", + readOnly: true, type: { name: "String" } @@ -1741,37 +2056,40 @@ export const ExportTemplateRequest: msRest.CompositeMapper = { } }; -export const TagCount: msRest.CompositeMapper = { - serializedName: "TagCount", +export const ResourcesMoveInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TagCount", + className: "ResourcesMoveInfo", modelProperties: { - type: { - serializedName: "type", + resources: { + serializedName: "resources", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - value: { - serializedName: "value", + targetResourceGroup: { + serializedName: "targetResourceGroup", type: { - name: "Number" + name: "String" } } } } }; -export const TagValue: msRest.CompositeMapper = { - serializedName: "TagValue", +export const TagValue: coreClient.CompositeMapper = { type: { name: "Composite", className: "TagValue", modelProperties: { id: { - readOnly: true, serializedName: "id", + readOnly: true, type: { name: "String" } @@ -1793,15 +2111,35 @@ export const TagValue: msRest.CompositeMapper = { } }; -export const TagDetails: msRest.CompositeMapper = { - serializedName: "TagDetails", +export const TagCount: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TagCount", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Number" + } + } + } + } +}; + +export const TagDetails: coreClient.CompositeMapper = { type: { name: "Composite", className: "TagDetails", modelProperties: { id: { - readOnly: true, serializedName: "id", + readOnly: true, type: { name: "String" } @@ -1835,26 +2173,26 @@ export const TagDetails: msRest.CompositeMapper = { } }; -export const TargetResource: msRest.CompositeMapper = { - serializedName: "TargetResource", +export const TagsListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TargetResource", + className: "TagsListResult", modelProperties: { - id: { - serializedName: "id", - type: { - name: "String" - } - }, - resourceName: { - serializedName: "resourceName", + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TagDetails" + } + } } }, - resourceType: { - serializedName: "resourceType", + nextLink: { + serializedName: "nextLink", + readOnly: true, type: { name: "String" } @@ -1863,54 +2201,44 @@ export const TargetResource: msRest.CompositeMapper = { } }; -export const HttpMessage: msRest.CompositeMapper = { - serializedName: "HttpMessage", +export const DeploymentOperation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "HttpMessage", + className: "DeploymentOperation", modelProperties: { - content: { - serializedName: "content", + id: { + serializedName: "id", + readOnly: true, type: { - name: "Object" + name: "String" } - } - } - } -}; - -export const StatusMessage: msRest.CompositeMapper = { - serializedName: "StatusMessage", - type: { - name: "Composite", - className: "StatusMessage", - modelProperties: { - status: { - serializedName: "status", + }, + operationId: { + serializedName: "operationId", + readOnly: true, type: { name: "String" } }, - error: { - serializedName: "error", + properties: { + serializedName: "properties", type: { name: "Composite", - className: "ErrorResponse" + className: "DeploymentOperationProperties" } } } } }; -export const DeploymentOperationProperties: msRest.CompositeMapper = { - serializedName: "DeploymentOperationProperties", +export const DeploymentOperationProperties: coreClient.CompositeMapper = { type: { name: "Composite", className: "DeploymentOperationProperties", modelProperties: { provisioningOperation: { - readOnly: true, serializedName: "provisioningOperation", + readOnly: true, type: { name: "Enum", allowedValues: [ @@ -1928,173 +2256,81 @@ export const DeploymentOperationProperties: msRest.CompositeMapper = { } }, provisioningState: { - readOnly: true, serializedName: "provisioningState", + readOnly: true, type: { name: "String" } }, timestamp: { - readOnly: true, serializedName: "timestamp", - type: { - name: "DateTime" - } - }, - duration: { - readOnly: true, - serializedName: "duration", - type: { - name: "String" - } - }, - serviceRequestId: { - readOnly: true, - serializedName: "serviceRequestId", - type: { - name: "String" - } - }, - statusCode: { - readOnly: true, - serializedName: "statusCode", - type: { - name: "String" - } - }, - statusMessage: { - readOnly: true, - serializedName: "statusMessage", - type: { - name: "Composite", - className: "StatusMessage" - } - }, - targetResource: { - readOnly: true, - serializedName: "targetResource", - type: { - name: "Composite", - className: "TargetResource" - } - }, - request: { - readOnly: true, - serializedName: "request", - type: { - name: "Composite", - className: "HttpMessage" - } - }, - response: { - readOnly: true, - serializedName: "response", - type: { - name: "Composite", - className: "HttpMessage" - } - } - } - } -}; - -export const DeploymentOperation: msRest.CompositeMapper = { - serializedName: "DeploymentOperation", - type: { - name: "Composite", - className: "DeploymentOperation", - modelProperties: { - id: { - readOnly: true, - serializedName: "id", - type: { - name: "String" - } - }, - operationId: { readOnly: true, - serializedName: "operationId", - type: { - name: "String" - } - }, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "DeploymentOperationProperties" - } - } - } - } -}; - -export const ResourceProviderOperationDisplayProperties: msRest.CompositeMapper = { - serializedName: "ResourceProviderOperationDisplayProperties", - type: { - name: "Composite", - className: "ResourceProviderOperationDisplayProperties", - modelProperties: { - publisher: { - serializedName: "publisher", type: { - name: "String" + name: "DateTime" } }, - provider: { - serializedName: "provider", + duration: { + serializedName: "duration", + readOnly: true, type: { name: "String" } }, - resource: { - serializedName: "resource", + serviceRequestId: { + serializedName: "serviceRequestId", + readOnly: true, type: { name: "String" } }, - operation: { - serializedName: "operation", + statusCode: { + serializedName: "statusCode", + readOnly: true, type: { name: "String" } }, - description: { - serializedName: "description", + statusMessage: { + serializedName: "statusMessage", type: { - name: "String" + name: "Composite", + className: "StatusMessage" } - } - } - } -}; - -export const SubResource: msRest.CompositeMapper = { - serializedName: "SubResource", - type: { - name: "Composite", - className: "SubResource", - modelProperties: { - id: { - serializedName: "id", + }, + targetResource: { + serializedName: "targetResource", type: { - name: "String" + name: "Composite", + className: "TargetResource" + } + }, + request: { + serializedName: "request", + type: { + name: "Composite", + className: "HttpMessage" + } + }, + response: { + serializedName: "response", + type: { + name: "Composite", + className: "HttpMessage" } } } } }; -export const ResourceGroupExportResult: msRest.CompositeMapper = { - serializedName: "ResourceGroupExportResult", +export const StatusMessage: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceGroupExportResult", + className: "StatusMessage", modelProperties: { - template: { - serializedName: "template", + status: { + serializedName: "status", type: { - name: "Object" + name: "String" } }, error: { @@ -2108,65 +2344,78 @@ export const ResourceGroupExportResult: msRest.CompositeMapper = { } }; -export const OperationDisplay: msRest.CompositeMapper = { - serializedName: "Operation_display", +export const TargetResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationDisplay", + className: "TargetResource", modelProperties: { - provider: { - serializedName: "provider", + id: { + serializedName: "id", type: { name: "String" } }, - resource: { - serializedName: "resource", + resourceName: { + serializedName: "resourceName", type: { name: "String" } }, - operation: { - serializedName: "operation", + resourceType: { + serializedName: "resourceType", type: { name: "String" } - }, - description: { - serializedName: "description", + } + } + } +}; + +export const HttpMessage: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HttpMessage", + modelProperties: { + content: { + serializedName: "content", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "any" } } } } } } }; -export const Operation: msRest.CompositeMapper = { - serializedName: "Operation", +export const DeploymentOperationsListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Operation", + className: "DeploymentOperationsListResult", modelProperties: { - name: { - serializedName: "name", + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DeploymentOperation" + } + } } }, - display: { - serializedName: "display", + nextLink: { + serializedName: "nextLink", + readOnly: true, type: { - name: "Composite", - className: "OperationDisplay" + name: "String" } } } } }; -export const TemplateHashResult: msRest.CompositeMapper = { - serializedName: "TemplateHashResult", +export const TemplateHashResult: coreClient.CompositeMapper = { type: { name: "Composite", className: "TemplateHashResult", @@ -2187,250 +2436,136 @@ export const TemplateHashResult: msRest.CompositeMapper = { } }; -export const WhatIfPropertyChange: msRest.CompositeMapper = { - serializedName: "WhatIfPropertyChange", +export const TagsResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "WhatIfPropertyChange", + className: "TagsResource", modelProperties: { - path: { - required: true, - serializedName: "path", + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - propertyChangeType: { - required: true, - serializedName: "propertyChangeType", - type: { - name: "Enum", - allowedValues: ["Create", "Delete", "Modify", "Array", "NoEffect"] - } - }, - before: { - serializedName: "before", + name: { + serializedName: "name", + readOnly: true, type: { - name: "Object" + name: "String" } }, - after: { - serializedName: "after", + type: { + serializedName: "type", + readOnly: true, type: { - name: "Object" + name: "String" } }, - children: { - serializedName: "children", + properties: { + serializedName: "properties", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "WhatIfPropertyChange" - } - } + name: "Composite", + className: "Tags" } } } } }; -export const WhatIfChange: msRest.CompositeMapper = { - serializedName: "WhatIfChange", +export const Tags: coreClient.CompositeMapper = { type: { name: "Composite", - className: "WhatIfChange", + className: "Tags", modelProperties: { - resourceId: { - required: true, - serializedName: "resourceId", - type: { - name: "String" - } - }, - changeType: { - required: true, - serializedName: "changeType", - type: { - name: "Enum", - allowedValues: [ - "Create", - "Delete", - "Ignore", - "Deploy", - "NoChange", - "Modify", - "Unsupported" - ] - } - }, - unsupportedReason: { - serializedName: "unsupportedReason", - type: { - name: "String" - } - }, - before: { - serializedName: "before", - type: { - name: "Object" - } - }, - after: { - serializedName: "after", - type: { - name: "Object" - } - }, - delta: { - serializedName: "delta", + tags: { + serializedName: "tags", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "WhatIfPropertyChange" - } - } + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const WhatIfOperationResult: msRest.CompositeMapper = { - serializedName: "WhatIfOperationResult", +export const TagsPatchResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "WhatIfOperationResult", + className: "TagsPatchResource", modelProperties: { - status: { - serializedName: "status", + operation: { + serializedName: "operation", type: { name: "String" } }, - changes: { - serializedName: "properties.changes", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "WhatIfChange" - } - } - } - }, - error: { - serializedName: "error", + properties: { + serializedName: "properties", type: { name: "Composite", - className: "ErrorResponse" - } - } - } - } -}; - -export const Tags: msRest.CompositeMapper = { - serializedName: "Tags", - type: { - name: "Composite", - className: "Tags", - modelProperties: { - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + className: "Tags" } } } } }; -export const TagsPatchResource: msRest.CompositeMapper = { - serializedName: "TagsPatchResource", +export const DeploymentExtendedFilter: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TagsPatchResource", + className: "DeploymentExtendedFilter", modelProperties: { - operation: { - serializedName: "operation", + provisioningState: { + serializedName: "provisioningState", type: { name: "String" } - }, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "Tags" - } } } } }; -export const TagsResource: msRest.CompositeMapper = { - serializedName: "TagsResource", +export const GenericResourceFilter: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TagsResource", + className: "GenericResourceFilter", modelProperties: { - id: { - readOnly: true, - serializedName: "id", + resourceType: { + serializedName: "resourceType", type: { name: "String" } }, - name: { - readOnly: true, - serializedName: "name", + tagname: { + serializedName: "tagname", type: { name: "String" } }, - type: { - readOnly: true, - serializedName: "type", + tagvalue: { + serializedName: "tagvalue", type: { name: "String" } - }, - properties: { - required: true, - serializedName: "properties", - type: { - name: "Composite", - className: "Tags" - } } } } }; -export const DeploymentsWhatIfAtTenantScopeHeaders: msRest.CompositeMapper = { - serializedName: "deployments-whatifattenantscope-headers", +export const ResourceGroupFilter: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DeploymentsWhatIfAtTenantScopeHeaders", + className: "ResourceGroupFilter", modelProperties: { - location: { - serializedName: "location", + tagName: { + serializedName: "tagName", type: { name: "String" } }, - retryAfter: { - serializedName: "retry-after", + tagValue: { + serializedName: "tagValue", type: { name: "String" } @@ -2439,42 +2574,37 @@ export const DeploymentsWhatIfAtTenantScopeHeaders: msRest.CompositeMapper = { } }; -export const DeploymentsWhatIfAtManagementGroupScopeHeaders: msRest.CompositeMapper = { - serializedName: "deployments-whatifatmanagementgroupscope-headers", +export const ResourceProviderOperationDisplayProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DeploymentsWhatIfAtManagementGroupScopeHeaders", + className: "ResourceProviderOperationDisplayProperties", modelProperties: { - location: { - serializedName: "location", + publisher: { + serializedName: "publisher", type: { name: "String" } }, - retryAfter: { - serializedName: "retry-after", + provider: { + serializedName: "provider", type: { name: "String" } - } - } - } -}; - -export const DeploymentsWhatIfAtSubscriptionScopeHeaders: msRest.CompositeMapper = { - serializedName: "deployments-whatifatsubscriptionscope-headers", - type: { - name: "Composite", - className: "DeploymentsWhatIfAtSubscriptionScopeHeaders", - modelProperties: { - location: { - serializedName: "location", + }, + resource: { + serializedName: "resource", type: { name: "String" } }, - retryAfter: { - serializedName: "retry-after", + operation: { + serializedName: "operation", + type: { + name: "String" + } + }, + description: { + serializedName: "description", type: { name: "String" } @@ -2483,20 +2613,13 @@ export const DeploymentsWhatIfAtSubscriptionScopeHeaders: msRest.CompositeMapper } }; -export const DeploymentsWhatIfHeaders: msRest.CompositeMapper = { - serializedName: "deployments-whatif-headers", +export const SubResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DeploymentsWhatIfHeaders", + className: "SubResource", modelProperties: { - location: { - serializedName: "location", - type: { - name: "String" - } - }, - retryAfter: { - serializedName: "retry-after", + id: { + serializedName: "id", type: { name: "String" } @@ -2505,84 +2628,99 @@ export const DeploymentsWhatIfHeaders: msRest.CompositeMapper = { } }; -export const OperationListResult: msRest.CompositeMapper = { - serializedName: "OperationListResult", +export const DeploymentWhatIfProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationListResult", + className: "DeploymentWhatIfProperties", modelProperties: { - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Operation" - } - } - } - }, - nextLink: { - serializedName: "nextLink", + ...DeploymentProperties.type.modelProperties, + whatIfSettings: { + serializedName: "whatIfSettings", type: { - name: "String" + name: "Composite", + className: "DeploymentWhatIfSettings" } } } } }; -export const DeploymentListResult: msRest.CompositeMapper = { - serializedName: "DeploymentListResult", +export const GenericResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DeploymentListResult", + className: "GenericResource", modelProperties: { - value: { - serializedName: "", + ...Resource.type.modelProperties, + plan: { + serializedName: "plan", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DeploymentExtended" - } - } + name: "Composite", + className: "Plan" } }, - nextLink: { - readOnly: true, - serializedName: "nextLink", + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + }, + kind: { + constraints: { + Pattern: new RegExp("^[-\\w\\._,\\(\\)]+$") + }, + serializedName: "kind", + type: { + name: "String" + } + }, + managedBy: { + serializedName: "managedBy", type: { name: "String" } + }, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku" + } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity" + } } } } }; -export const ProviderListResult: msRest.CompositeMapper = { - serializedName: "ProviderListResult", +export const GenericResourceExpanded: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ProviderListResult", + className: "GenericResourceExpanded", modelProperties: { - value: { - serializedName: "", + ...GenericResource.type.modelProperties, + createdTime: { + serializedName: "createdTime", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Provider" - } - } + name: "DateTime" } }, - nextLink: { + changedTime: { + serializedName: "changedTime", + readOnly: true, + type: { + name: "DateTime" + } + }, + provisioningState: { + serializedName: "provisioningState", readOnly: true, - serializedName: "nextLink", type: { name: "String" } @@ -2591,27 +2729,19 @@ export const ProviderListResult: msRest.CompositeMapper = { } }; -export const ResourceListResult: msRest.CompositeMapper = { - serializedName: "ResourceListResult", +export const DeploymentsWhatIfAtTenantScopeHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceListResult", + className: "DeploymentsWhatIfAtTenantScopeHeaders", modelProperties: { - value: { - serializedName: "", + location: { + serializedName: "location", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "GenericResourceExpanded" - } - } + name: "String" } }, - nextLink: { - readOnly: true, - serializedName: "nextLink", + retryAfter: { + serializedName: "retry-after", type: { name: "String" } @@ -2620,27 +2750,19 @@ export const ResourceListResult: msRest.CompositeMapper = { } }; -export const ResourceGroupListResult: msRest.CompositeMapper = { - serializedName: "ResourceGroupListResult", +export const DeploymentsWhatIfAtManagementGroupScopeHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceGroupListResult", + className: "DeploymentsWhatIfAtManagementGroupScopeHeaders", modelProperties: { - value: { - serializedName: "", + location: { + serializedName: "location", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceGroup" - } - } + name: "String" } }, - nextLink: { - readOnly: true, - serializedName: "nextLink", + retryAfter: { + serializedName: "retry-after", type: { name: "String" } @@ -2649,27 +2771,19 @@ export const ResourceGroupListResult: msRest.CompositeMapper = { } }; -export const TagsListResult: msRest.CompositeMapper = { - serializedName: "TagsListResult", +export const DeploymentsWhatIfAtSubscriptionScopeHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TagsListResult", + className: "DeploymentsWhatIfAtSubscriptionScopeHeaders", modelProperties: { - value: { - serializedName: "", + location: { + serializedName: "location", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "TagDetails" - } - } + name: "String" } }, - nextLink: { - readOnly: true, - serializedName: "nextLink", + retryAfter: { + serializedName: "retry-after", type: { name: "String" } @@ -2678,27 +2792,19 @@ export const TagsListResult: msRest.CompositeMapper = { } }; -export const DeploymentOperationsListResult: msRest.CompositeMapper = { - serializedName: "DeploymentOperationsListResult", +export const DeploymentsWhatIfHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DeploymentOperationsListResult", + className: "DeploymentsWhatIfHeaders", modelProperties: { - value: { - serializedName: "", + location: { + serializedName: "location", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DeploymentOperation" - } - } + name: "String" } }, - nextLink: { - readOnly: true, - serializedName: "nextLink", + retryAfter: { + serializedName: "retry-after", type: { name: "String" } diff --git a/sdk/resources/arm-resources/src/models/operationsMappers.ts b/sdk/resources/arm-resources/src/models/operationsMappers.ts deleted file mode 100644 index cdbd10423173..000000000000 --- a/sdk/resources/arm-resources/src/models/operationsMappers.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * 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 { - CloudError, - ErrorAdditionalInfo, - ErrorResponse, - Operation, - OperationDisplay, - OperationListResult -} from "../models/mappers"; diff --git a/sdk/resources/arm-resources/src/models/parameters.ts b/sdk/resources/arm-resources/src/models/parameters.ts index a2d25e2713d1..4e19dc1f6919 100644 --- a/sdk/resources/arm-resources/src/models/parameters.ts +++ b/sdk/resources/arm-resources/src/models/parameters.ts @@ -3,57 +3,123 @@ * 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 { + Deployment as DeploymentMapper, + ScopedDeployment as ScopedDeploymentMapper, + ScopedDeploymentWhatIf as ScopedDeploymentWhatIfMapper, + DeploymentWhatIf as DeploymentWhatIfMapper, + ProviderRegistrationRequest as ProviderRegistrationRequestMapper, + ResourcesMoveInfo as ResourcesMoveInfoMapper, + GenericResource as GenericResourceMapper, + ResourceGroup as ResourceGroupMapper, + ResourceGroupPatchable as ResourceGroupPatchableMapper, + ExportTemplateRequest as ExportTemplateRequestMapper, + TagsResource as TagsResourceMapper, + TagsPatchResource as TagsPatchResourceMapper +} 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 apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2021-04-01", + isConstant: true, serializedName: "api-version", type: { name: "String" } } }; -export const deploymentName: msRest.OperationURLParameter = { - parameterPath: "deploymentName", + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", mapper: { + serializedName: "nextLink", required: true, - serializedName: "deploymentName", + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const scope: OperationURLParameter = { + parameterPath: "scope", + mapper: { + serializedName: "scope", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const deploymentName: OperationURLParameter = { + parameterPath: "deploymentName", + mapper: { constraints: { + Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), MaxLength: 64, - MinLength: 1, - Pattern: /^[-\w\._\(\)]+$/ + MinLength: 1 }, + serializedName: "deploymentName", + required: true, type: { name: "String" } } }; -export const expand: msRest.OperationQueryParameter = { - parameterPath: ["options", "expand"], + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], mapper: { - serializedName: "$expand", + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", type: { name: "String" } } }; -export const filter: msRest.OperationQueryParameter = { + +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: DeploymentMapper +}; + +export const filter: OperationQueryParameter = { parameterPath: ["options", "filter"], mapper: { serializedName: "$filter", @@ -62,171 +128,275 @@ export const filter: msRest.OperationQueryParameter = { } } }; -export const groupId: msRest.OperationURLParameter = { + +export const top: OperationQueryParameter = { + parameterPath: ["options", "top"], + mapper: { + serializedName: "$top", + type: { + name: "Number" + } + } +}; + +export const parameters1: OperationParameter = { + parameterPath: "parameters", + mapper: ScopedDeploymentMapper +}; + +export const parameters2: OperationParameter = { + parameterPath: "parameters", + mapper: ScopedDeploymentWhatIfMapper +}; + +export const groupId: OperationURLParameter = { parameterPath: "groupId", mapper: { - required: true, - serializedName: "groupId", constraints: { MaxLength: 90, MinLength: 1 }, + serializedName: "groupId", + required: true, type: { name: "String" } } }; -export const nextPageLink: msRest.OperationURLParameter = { - parameterPath: "nextPageLink", + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { + serializedName: "subscriptionId", required: true, - serializedName: "nextLink", type: { name: "String" } - }, - skipEncoding: true + } }; -export const operationId: msRest.OperationURLParameter = { - parameterPath: "operationId", + +export const parameters3: OperationParameter = { + parameterPath: "parameters", + mapper: DeploymentWhatIfMapper +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", mapper: { + constraints: { + Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), + MaxLength: 90, + MinLength: 1 + }, + serializedName: "resourceGroupName", required: true, - serializedName: "operationId", type: { name: "String" } } }; -export const parentResourcePath: msRest.OperationURLParameter = { - parameterPath: "parentResourcePath", + +export const template: OperationParameter = { + parameterPath: "template", mapper: { + serializedName: "template", required: true, - serializedName: "parentResourcePath", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "any" } } } - }, - skipEncoding: true + } }; -export const resourceGroupName: msRest.OperationURLParameter = { - parameterPath: "resourceGroupName", + +export const resourceProviderNamespace: OperationURLParameter = { + parameterPath: "resourceProviderNamespace", mapper: { + serializedName: "resourceProviderNamespace", required: true, - serializedName: "resourceGroupName", + type: { + name: "String" + } + } +}; + +export const properties: OperationParameter = { + parameterPath: ["options", "properties"], + mapper: ProviderRegistrationRequestMapper +}; + +export const expand: OperationQueryParameter = { + parameterPath: ["options", "expand"], + mapper: { + serializedName: "$expand", + type: { + name: "String" + } + } +}; + +export const parameters4: OperationParameter = { + parameterPath: "parameters", + mapper: ResourcesMoveInfoMapper +}; + +export const sourceResourceGroupName: OperationURLParameter = { + parameterPath: "sourceResourceGroupName", + mapper: { constraints: { + Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), MaxLength: 90, - MinLength: 1, - Pattern: /^[-\w\._\(\)]+$/ + MinLength: 1 }, + serializedName: "sourceResourceGroupName", + required: true, type: { name: "String" } } }; -export const resourceId: msRest.OperationURLParameter = { - parameterPath: "resourceId", + +export const parentResourcePath: OperationURLParameter = { + parameterPath: "parentResourcePath", mapper: { + serializedName: "parentResourcePath", required: true, - serializedName: "resourceId", type: { name: "String" } }, skipEncoding: true }; -export const resourceName: msRest.OperationURLParameter = { - parameterPath: "resourceName", + +export const resourceType: OperationURLParameter = { + parameterPath: "resourceType", mapper: { + serializedName: "resourceType", required: true, - serializedName: "resourceName", type: { name: "String" } - } + }, + skipEncoding: true }; -export const resourceProviderNamespace: msRest.OperationURLParameter = { - parameterPath: "resourceProviderNamespace", + +export const resourceName: OperationURLParameter = { + parameterPath: "resourceName", mapper: { + serializedName: "resourceName", required: true, - serializedName: "resourceProviderNamespace", type: { name: "String" } } }; -export const resourceType: msRest.OperationURLParameter = { - parameterPath: "resourceType", + +export const apiVersion1: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { + serializedName: "api-version", required: true, - serializedName: "resourceType", type: { name: "String" } - }, - skipEncoding: true + } }; -export const scope: msRest.OperationURLParameter = { - parameterPath: "scope", + +export const parameters5: OperationParameter = { + parameterPath: "parameters", + mapper: GenericResourceMapper +}; + +export const resourceId: OperationURLParameter = { + parameterPath: "resourceId", mapper: { + serializedName: "resourceId", required: true, - serializedName: "scope", type: { name: "String" } }, skipEncoding: true }; -export const sourceResourceGroupName: msRest.OperationURLParameter = { - parameterPath: "sourceResourceGroupName", + +export const parameters6: OperationParameter = { + parameterPath: "parameters", + mapper: ResourceGroupMapper +}; + +export const forceDeletionTypes: OperationQueryParameter = { + parameterPath: ["options", "forceDeletionTypes"], mapper: { - required: true, - serializedName: "sourceResourceGroupName", - constraints: { - MaxLength: 90, - MinLength: 1, - Pattern: /^[-\w\._\(\)]+$/ - }, + serializedName: "forceDeletionTypes", type: { name: "String" } } }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +export const parameters7: OperationParameter = { + parameterPath: "parameters", + mapper: ResourceGroupPatchableMapper +}; + +export const parameters8: OperationParameter = { + parameterPath: "parameters", + mapper: ExportTemplateRequestMapper +}; + +export const resourceGroupName1: OperationURLParameter = { + parameterPath: "resourceGroupName", mapper: { + constraints: { + MaxLength: 90, + MinLength: 1 + }, + serializedName: "resourceGroupName", required: true, - serializedName: "subscriptionId", type: { name: "String" } } }; -export const tagName: msRest.OperationURLParameter = { + +export const tagName: OperationURLParameter = { parameterPath: "tagName", mapper: { - required: true, serializedName: "tagName", + required: true, type: { name: "String" } } }; -export const tagValue: msRest.OperationURLParameter = { + +export const tagValue: OperationURLParameter = { parameterPath: "tagValue", mapper: { - required: true, serializedName: "tagValue", + required: true, type: { name: "String" } } }; -export const top: msRest.OperationQueryParameter = { - parameterPath: ["options", "top"], + +export const parameters9: OperationParameter = { + parameterPath: "parameters", + mapper: TagsResourceMapper +}; + +export const parameters10: OperationParameter = { + parameterPath: "parameters", + mapper: TagsPatchResourceMapper +}; + +export const operationId: OperationURLParameter = { + parameterPath: "operationId", mapper: { - serializedName: "$top", + serializedName: "operationId", + required: true, type: { - name: "Number" + name: "String" } } }; diff --git a/sdk/resources/arm-resources/src/models/providerResourceTypesMappers.ts b/sdk/resources/arm-resources/src/models/providerResourceTypesMappers.ts deleted file mode 100644 index 79eed67fc80d..000000000000 --- a/sdk/resources/arm-resources/src/models/providerResourceTypesMappers.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * 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 { - Alias, - AliasPath, - AliasPathMetadata, - AliasPattern, - ApiProfile, - CloudError, - ErrorAdditionalInfo, - ErrorResponse, - ProviderExtendedLocation, - ProviderResourceType, - ProviderResourceTypeListResult -} from "../models/mappers"; diff --git a/sdk/resources/arm-resources/src/models/providersMappers.ts b/sdk/resources/arm-resources/src/models/providersMappers.ts deleted file mode 100644 index b5c3cf524591..000000000000 --- a/sdk/resources/arm-resources/src/models/providersMappers.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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 { - Alias, - AliasPath, - AliasPathMetadata, - AliasPattern, - ApiProfile, - CloudError, - ErrorAdditionalInfo, - ErrorResponse, - Provider, - ProviderExtendedLocation, - ProviderListResult, - ProviderResourceType -} from "../models/mappers"; diff --git a/sdk/resources/arm-resources/src/models/resourceGroupsMappers.ts b/sdk/resources/arm-resources/src/models/resourceGroupsMappers.ts deleted file mode 100644 index 624acd101591..000000000000 --- a/sdk/resources/arm-resources/src/models/resourceGroupsMappers.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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 { - Alias, - AliasPath, - AliasPathMetadata, - AliasPattern, - ApiProfile, - BaseResource, - BasicDependency, - CloudError, - DebugSetting, - Dependency, - DeploymentExtended, - DeploymentPropertiesExtended, - ErrorAdditionalInfo, - ErrorResponse, - ExportTemplateRequest, - ExtendedLocation, - GenericResource, - GenericResourceExpanded, - Identity, - IdentityUserAssignedIdentitiesValue, - OnErrorDeploymentExtended, - ParametersLink, - Plan, - Provider, - ProviderExtendedLocation, - ProviderResourceType, - Resource, - ResourceGroup, - ResourceGroupExportResult, - ResourceGroupListResult, - ResourceGroupPatchable, - ResourceGroupProperties, - ResourceReference, - Sku, - SubResource, - TagCount, - TagDetails, - Tags, - TagsResource, - TagValue, - TemplateLink -} from "../models/mappers"; diff --git a/sdk/resources/arm-resources/src/models/resourcesMappers.ts b/sdk/resources/arm-resources/src/models/resourcesMappers.ts deleted file mode 100644 index 5bbd6a2b1f8b..000000000000 --- a/sdk/resources/arm-resources/src/models/resourcesMappers.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 { - Alias, - AliasPath, - AliasPathMetadata, - AliasPattern, - ApiProfile, - BaseResource, - BasicDependency, - CloudError, - DebugSetting, - Dependency, - DeploymentExtended, - DeploymentPropertiesExtended, - ErrorAdditionalInfo, - ErrorResponse, - ExtendedLocation, - GenericResource, - GenericResourceExpanded, - Identity, - IdentityUserAssignedIdentitiesValue, - OnErrorDeploymentExtended, - ParametersLink, - Plan, - Provider, - ProviderExtendedLocation, - ProviderResourceType, - Resource, - ResourceGroup, - ResourceGroupProperties, - ResourceListResult, - ResourceReference, - ResourcesMoveInfo, - Sku, - SubResource, - TagCount, - TagDetails, - Tags, - TagsResource, - TagValue, - TemplateLink -} from "../models/mappers"; diff --git a/sdk/resources/arm-resources/src/models/tagsOperationsMappers.ts b/sdk/resources/arm-resources/src/models/tagsOperationsMappers.ts deleted file mode 100644 index 9f841fa18cd0..000000000000 --- a/sdk/resources/arm-resources/src/models/tagsOperationsMappers.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 { - Alias, - AliasPath, - AliasPathMetadata, - AliasPattern, - ApiProfile, - BaseResource, - BasicDependency, - CloudError, - DebugSetting, - Dependency, - DeploymentExtended, - DeploymentPropertiesExtended, - ErrorAdditionalInfo, - ErrorResponse, - ExtendedLocation, - GenericResource, - GenericResourceExpanded, - Identity, - IdentityUserAssignedIdentitiesValue, - OnErrorDeploymentExtended, - ParametersLink, - Plan, - Provider, - ProviderExtendedLocation, - ProviderResourceType, - Resource, - ResourceGroup, - ResourceGroupProperties, - ResourceReference, - Sku, - SubResource, - TagCount, - TagDetails, - Tags, - TagsListResult, - TagsPatchResource, - TagsResource, - TagValue, - TemplateLink -} from "../models/mappers"; diff --git a/sdk/resources/arm-resources/src/operations/deploymentOperations.ts b/sdk/resources/arm-resources/src/operations/deploymentOperations.ts index 1b9fd8d0aefb..d42d1093191f 100644 --- a/sdk/resources/arm-resources/src/operations/deploymentOperations.ts +++ b/sdk/resources/arm-resources/src/operations/deploymentOperations.ts @@ -3,791 +3,1112 @@ * 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/deploymentOperationsMappers"; +import "@azure/core-paging"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { DeploymentOperations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ResourceManagementClientContext } from "../resourceManagementClientContext"; +import { + DeploymentOperation, + DeploymentOperationsListAtScopeNextOptionalParams, + DeploymentOperationsListAtScopeOptionalParams, + DeploymentOperationsListAtTenantScopeNextOptionalParams, + DeploymentOperationsListAtTenantScopeOptionalParams, + DeploymentOperationsListAtManagementGroupScopeNextOptionalParams, + DeploymentOperationsListAtManagementGroupScopeOptionalParams, + DeploymentOperationsListAtSubscriptionScopeNextOptionalParams, + DeploymentOperationsListAtSubscriptionScopeOptionalParams, + DeploymentOperationsListNextOptionalParams, + DeploymentOperationsListOptionalParams, + DeploymentOperationsListAtScopeNextNextOptionalParams, + DeploymentOperationsListAtTenantScopeNextNextOptionalParams, + DeploymentOperationsListAtManagementGroupScopeNextNextOptionalParams, + DeploymentOperationsListAtSubscriptionScopeNextNextOptionalParams, + DeploymentOperationsListNextNextOptionalParams, + DeploymentOperationsGetAtScopeOptionalParams, + DeploymentOperationsGetAtScopeResponse, + DeploymentOperationsListAtScopeResponse, + DeploymentOperationsGetAtTenantScopeOptionalParams, + DeploymentOperationsGetAtTenantScopeResponse, + DeploymentOperationsListAtTenantScopeResponse, + DeploymentOperationsGetAtManagementGroupScopeOptionalParams, + DeploymentOperationsGetAtManagementGroupScopeResponse, + DeploymentOperationsListAtManagementGroupScopeResponse, + DeploymentOperationsGetAtSubscriptionScopeOptionalParams, + DeploymentOperationsGetAtSubscriptionScopeResponse, + DeploymentOperationsListAtSubscriptionScopeResponse, + DeploymentOperationsGetOptionalParams, + DeploymentOperationsGetResponse, + DeploymentOperationsListResponse, + DeploymentOperationsListAtScopeNextResponse, + DeploymentOperationsListAtTenantScopeNextResponse, + DeploymentOperationsListAtManagementGroupScopeNextResponse, + DeploymentOperationsListAtSubscriptionScopeNextResponse, + DeploymentOperationsListNextResponse, + DeploymentOperationsListAtScopeNextNextResponse, + DeploymentOperationsListAtTenantScopeNextNextResponse, + DeploymentOperationsListAtManagementGroupScopeNextNextResponse, + DeploymentOperationsListAtSubscriptionScopeNextNextResponse, + DeploymentOperationsListNextNextResponse +} from "../models"; +/// /** Class representing a DeploymentOperations. */ -export class DeploymentOperations { +export class DeploymentOperationsImpl implements DeploymentOperations { private readonly client: ResourceManagementClientContext; /** - * Create a DeploymentOperations. - * @param {ResourceManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class DeploymentOperations class. + * @param client Reference to the service client */ constructor(client: ResourceManagementClientContext) { this.client = client; } /** - * Gets a deployments operation. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param [options] The optional parameters - * @returns Promise - */ - getAtScope( - scope: string, - deploymentName: string, - operationId: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param callback The callback - */ - getAtScope( - scope: string, - deploymentName: string, - operationId: string, - callback: msRest.ServiceCallback - ): void; - /** + * Gets all deployments operations for a deployment. * @param scope The resource scope. * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - getAtScope( + public listAtScope( scope: string, deploymentName: string, - operationId: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getAtScope( + options?: DeploymentOperationsListAtScopeOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAtScopePagingAll(scope, deploymentName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listAtScopePagingPage(scope, deploymentName, options); + } + }; + } + + private async *listAtScopePagingPage( scope: string, deploymentName: string, - operationId: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { + options?: DeploymentOperationsListAtScopeOptionalParams + ): AsyncIterableIterator { + let result = await this._listAtScope(scope, deploymentName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listAtScopeNext( scope, deploymentName, - operationId, + continuationToken, options - }, - getAtScopeOperationSpec, - callback - ) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } } - /** - * Gets all deployments operations for a deployment. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise - */ - listAtScope( + private async *listAtScopePagingAll( scope: string, deploymentName: string, - options?: Models.DeploymentOperationsListAtScopeOptionalParams - ): Promise; - /** - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param callback The callback - */ - listAtScope( - scope: string, - deploymentName: string, - callback: msRest.ServiceCallback - ): void; + options?: DeploymentOperationsListAtScopeOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAtScopePagingPage( + scope, + deploymentName, + options + )) { + yield* page; + } + } + /** - * @param scope The resource scope. + * Gets all deployments operations for a deployment. * @param deploymentName The name of the deployment. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listAtScope( - scope: string, + public listAtTenantScope( deploymentName: string, - options: Models.DeploymentOperationsListAtScopeOptionalParams, - callback: msRest.ServiceCallback - ): void; - listAtScope( - scope: string, + options?: DeploymentOperationsListAtTenantScopeOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAtTenantScopePagingAll(deploymentName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listAtTenantScopePagingPage(deploymentName, options); + } + }; + } + + private async *listAtTenantScopePagingPage( deploymentName: string, - options?: - | Models.DeploymentOperationsListAtScopeOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - scope, + options?: DeploymentOperationsListAtTenantScopeOptionalParams + ): AsyncIterableIterator { + let result = await this._listAtTenantScope(deploymentName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listAtTenantScopeNext( deploymentName, + continuationToken, options - }, - listAtScopeOperationSpec, - callback - ) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } } - /** - * Gets a deployments operation. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param [options] The optional parameters - * @returns Promise - */ - getAtTenantScope( + private async *listAtTenantScopePagingAll( deploymentName: string, - operationId: string, - options?: msRest.RequestOptionsBase - ): Promise; + options?: DeploymentOperationsListAtTenantScopeOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAtTenantScopePagingPage( + deploymentName, + options + )) { + yield* page; + } + } + /** + * Gets all deployments operations for a deployment. + * @param groupId The management group ID. * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param callback The callback + * @param options The options parameters. */ - getAtTenantScope( + public listAtManagementGroupScope( + groupId: string, deploymentName: string, - operationId: string, - callback: msRest.ServiceCallback - ): void; + options?: DeploymentOperationsListAtManagementGroupScopeOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAtManagementGroupScopePagingAll( + groupId, + deploymentName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listAtManagementGroupScopePagingPage( + groupId, + deploymentName, + options + ); + } + }; + } + + private async *listAtManagementGroupScopePagingPage( + groupId: string, + deploymentName: string, + options?: DeploymentOperationsListAtManagementGroupScopeOptionalParams + ): AsyncIterableIterator { + let result = await this._listAtManagementGroupScope( + groupId, + deploymentName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listAtManagementGroupScopeNext( + groupId, + deploymentName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listAtManagementGroupScopePagingAll( + groupId: string, + deploymentName: string, + options?: DeploymentOperationsListAtManagementGroupScopeOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAtManagementGroupScopePagingPage( + groupId, + deploymentName, + options + )) { + yield* page; + } + } + /** + * Gets all deployments operations for a deployment. * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - getAtTenantScope( + public listAtSubscriptionScope( deploymentName: string, - operationId: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getAtTenantScope( + options?: DeploymentOperationsListAtSubscriptionScopeOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAtSubscriptionScopePagingAll(deploymentName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listAtSubscriptionScopePagingPage(deploymentName, options); + } + }; + } + + private async *listAtSubscriptionScopePagingPage( deploymentName: string, - operationId: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { + options?: DeploymentOperationsListAtSubscriptionScopeOptionalParams + ): AsyncIterableIterator { + let result = await this._listAtSubscriptionScope(deploymentName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listAtSubscriptionScopeNext( deploymentName, - operationId, + continuationToken, options - }, - getAtTenantScopeOperationSpec, - callback - ) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listAtSubscriptionScopePagingAll( + deploymentName: string, + options?: DeploymentOperationsListAtSubscriptionScopeOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAtSubscriptionScopePagingPage( + deploymentName, + options + )) { + yield* page; + } } /** * Gets all deployments operations for a deployment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listAtTenantScope( + public list( + resourceGroupName: string, deploymentName: string, - options?: Models.DeploymentOperationsListAtTenantScopeOptionalParams - ): Promise; - /** - * @param deploymentName The name of the deployment. - * @param callback The callback - */ - listAtTenantScope( + options?: DeploymentOperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, deploymentName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceGroupName, deploymentName, options); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + deploymentName: string, + options?: DeploymentOperationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceGroupName, deploymentName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + deploymentName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, deploymentName: string, - callback: msRest.ServiceCallback - ): void; + options?: DeploymentOperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + deploymentName, + options + )) { + yield* page; + } + } + /** + * ListAtScopeNext + * @param scope The resource scope. * @param deploymentName The name of the deployment. - * @param options The optional parameters - * @param callback The callback + * @param nextLink The nextLink from the previous successful call to the ListAtScope method. + * @param options The options parameters. */ - listAtTenantScope( + public listAtScopeNext( + scope: string, deploymentName: string, - options: Models.DeploymentOperationsListAtTenantScopeOptionalParams, - callback: msRest.ServiceCallback - ): void; - listAtTenantScope( + nextLink: string, + options?: DeploymentOperationsListAtScopeNextOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAtScopeNextPagingAll( + scope, + deploymentName, + nextLink, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listAtScopeNextPagingPage( + scope, + deploymentName, + nextLink, + options + ); + } + }; + } + + private async *listAtScopeNextPagingPage( + scope: string, deploymentName: string, - options?: - | Models.DeploymentOperationsListAtTenantScopeOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { + nextLink: string, + options?: DeploymentOperationsListAtScopeNextOptionalParams + ): AsyncIterableIterator { + let result = await this._listAtScopeNext( + scope, + deploymentName, + nextLink, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listAtScopeNextNext( + scope, deploymentName, + continuationToken, options - }, - listAtTenantScopeOperationSpec, - callback - ) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } } - /** - * Gets a deployments operation. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param [options] The optional parameters - * @returns Promise - */ - getAtManagementGroupScope( - groupId: string, + private async *listAtScopeNextPagingAll( + scope: string, deploymentName: string, - operationId: string, - options?: msRest.RequestOptionsBase - ): Promise; + nextLink: string, + options?: DeploymentOperationsListAtScopeNextOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAtScopeNextPagingPage( + scope, + deploymentName, + nextLink, + options + )) { + yield* page; + } + } + /** - * @param groupId The management group ID. + * ListAtTenantScopeNext * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param callback The callback + * @param nextLink The nextLink from the previous successful call to the ListAtTenantScope method. + * @param options The options parameters. */ - getAtManagementGroupScope( - groupId: string, + public listAtTenantScopeNext( deploymentName: string, - operationId: string, - callback: msRest.ServiceCallback - ): void; + nextLink: string, + options?: DeploymentOperationsListAtTenantScopeNextOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAtTenantScopeNextPagingAll( + deploymentName, + nextLink, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listAtTenantScopeNextPagingPage( + deploymentName, + nextLink, + options + ); + } + }; + } + + private async *listAtTenantScopeNextPagingPage( + deploymentName: string, + nextLink: string, + options?: DeploymentOperationsListAtTenantScopeNextOptionalParams + ): AsyncIterableIterator { + let result = await this._listAtTenantScopeNext( + deploymentName, + nextLink, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listAtTenantScopeNextNext( + deploymentName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listAtTenantScopeNextPagingAll( + deploymentName: string, + nextLink: string, + options?: DeploymentOperationsListAtTenantScopeNextOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAtTenantScopeNextPagingPage( + deploymentName, + nextLink, + options + )) { + yield* page; + } + } + /** + * ListAtManagementGroupScopeNext * @param groupId The management group ID. * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param options The optional parameters - * @param callback The callback + * @param nextLink The nextLink from the previous successful call to the ListAtManagementGroupScope + * method. + * @param options The options parameters. */ - getAtManagementGroupScope( + public listAtManagementGroupScopeNext( groupId: string, deploymentName: string, - operationId: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getAtManagementGroupScope( + nextLink: string, + options?: DeploymentOperationsListAtManagementGroupScopeNextOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAtManagementGroupScopeNextPagingAll( + groupId, + deploymentName, + nextLink, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listAtManagementGroupScopeNextPagingPage( + groupId, + deploymentName, + nextLink, + options + ); + } + }; + } + + private async *listAtManagementGroupScopeNextPagingPage( groupId: string, deploymentName: string, - operationId: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { + nextLink: string, + options?: DeploymentOperationsListAtManagementGroupScopeNextOptionalParams + ): AsyncIterableIterator { + let result = await this._listAtManagementGroupScopeNext( + groupId, + deploymentName, + nextLink, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listAtManagementGroupScopeNextNext( groupId, deploymentName, - operationId, + continuationToken, options - }, - getAtManagementGroupScopeOperationSpec, - callback - ) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } } - /** - * Gets all deployments operations for a deployment. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise - */ - listAtManagementGroupScope( + private async *listAtManagementGroupScopeNextPagingAll( groupId: string, deploymentName: string, - options?: Models.DeploymentOperationsListAtManagementGroupScopeOptionalParams - ): Promise; + nextLink: string, + options?: DeploymentOperationsListAtManagementGroupScopeNextOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAtManagementGroupScopeNextPagingPage( + groupId, + deploymentName, + nextLink, + options + )) { + yield* page; + } + } + /** - * @param groupId The management group ID. + * ListAtSubscriptionScopeNext * @param deploymentName The name of the deployment. - * @param callback The callback + * @param nextLink The nextLink from the previous successful call to the ListAtSubscriptionScope + * method. + * @param options The options parameters. */ - listAtManagementGroupScope( - groupId: string, + public listAtSubscriptionScopeNext( + deploymentName: string, + nextLink: string, + options?: DeploymentOperationsListAtSubscriptionScopeNextOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAtSubscriptionScopeNextPagingAll( + deploymentName, + nextLink, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listAtSubscriptionScopeNextPagingPage( + deploymentName, + nextLink, + options + ); + } + }; + } + + private async *listAtSubscriptionScopeNextPagingPage( deploymentName: string, - callback: msRest.ServiceCallback - ): void; + nextLink: string, + options?: DeploymentOperationsListAtSubscriptionScopeNextOptionalParams + ): AsyncIterableIterator { + let result = await this._listAtSubscriptionScopeNext( + deploymentName, + nextLink, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listAtSubscriptionScopeNextNext( + deploymentName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listAtSubscriptionScopeNextPagingAll( + deploymentName: string, + nextLink: string, + options?: DeploymentOperationsListAtSubscriptionScopeNextOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAtSubscriptionScopeNextPagingPage( + deploymentName, + nextLink, + options + )) { + yield* page; + } + } + /** - * @param groupId The management group ID. + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of the deployment. - * @param options The optional parameters - * @param callback The callback + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listAtManagementGroupScope( - groupId: string, + public listNext( + resourceGroupName: string, deploymentName: string, - options: Models.DeploymentOperationsListAtManagementGroupScopeOptionalParams, - callback: msRest.ServiceCallback - ): void; - listAtManagementGroupScope( - groupId: string, + nextLink: string, + options?: DeploymentOperationsListNextOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listNextPagingAll( + resourceGroupName, + deploymentName, + nextLink, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listNextPagingPage( + resourceGroupName, + deploymentName, + nextLink, + options + ); + } + }; + } + + private async *listNextPagingPage( + resourceGroupName: string, deploymentName: string, - options?: - | Models.DeploymentOperationsListAtManagementGroupScopeOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - groupId, + nextLink: string, + options?: DeploymentOperationsListNextOptionalParams + ): AsyncIterableIterator { + let result = await this._listNext( + resourceGroupName, + deploymentName, + nextLink, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNextNext( + resourceGroupName, deploymentName, + continuationToken, options - }, - listAtManagementGroupScopeOperationSpec, - callback - ) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listNextPagingAll( + resourceGroupName: string, + deploymentName: string, + nextLink: string, + options?: DeploymentOperationsListNextOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listNextPagingPage( + resourceGroupName, + deploymentName, + nextLink, + options + )) { + yield* page; + } } /** * Gets a deployments operation. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param operationId The ID of the operation to get. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - getAtSubscriptionScope( + getAtScope( + scope: string, deploymentName: string, operationId: string, - options?: msRest.RequestOptionsBase - ): Promise; + options?: DeploymentOperationsGetAtScopeOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, deploymentName, operationId, options }, + getAtScopeOperationSpec + ); + } + /** + * Gets all deployments operations for a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param callback The callback + * @param options The options parameters. */ - getAtSubscriptionScope( + private _listAtScope( + scope: string, deploymentName: string, - operationId: string, - callback: msRest.ServiceCallback - ): void; + options?: DeploymentOperationsListAtScopeOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, deploymentName, options }, + listAtScopeOperationSpec + ); + } + /** + * Gets a deployments operation. * @param deploymentName The name of the deployment. * @param operationId The ID of the operation to get. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - getAtSubscriptionScope( - deploymentName: string, - operationId: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getAtSubscriptionScope( + getAtTenantScope( deploymentName: string, operationId: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: DeploymentOperationsGetAtTenantScopeOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deploymentName, - operationId, - options - }, - getAtSubscriptionScopeOperationSpec, - callback - ) as Promise; + { deploymentName, operationId, options }, + getAtTenantScopeOperationSpec + ); } /** * Gets all deployments operations for a deployment. * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listAtSubscriptionScope( + private _listAtTenantScope( deploymentName: string, - options?: Models.DeploymentOperationsListAtSubscriptionScopeOptionalParams - ): Promise; + options?: DeploymentOperationsListAtTenantScopeOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deploymentName, options }, + listAtTenantScopeOperationSpec + ); + } + /** + * Gets a deployments operation. + * @param groupId The management group ID. * @param deploymentName The name of the deployment. - * @param callback The callback + * @param operationId The ID of the operation to get. + * @param options The options parameters. */ - listAtSubscriptionScope( + getAtManagementGroupScope( + groupId: string, deploymentName: string, - callback: msRest.ServiceCallback - ): void; + operationId: string, + options?: DeploymentOperationsGetAtManagementGroupScopeOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { groupId, deploymentName, operationId, options }, + getAtManagementGroupScopeOperationSpec + ); + } + /** + * Gets all deployments operations for a deployment. + * @param groupId The management group ID. * @param deploymentName The name of the deployment. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listAtSubscriptionScope( - deploymentName: string, - options: Models.DeploymentOperationsListAtSubscriptionScopeOptionalParams, - callback: msRest.ServiceCallback - ): void; - listAtSubscriptionScope( + private _listAtManagementGroupScope( + groupId: string, deploymentName: string, - options?: - | Models.DeploymentOperationsListAtSubscriptionScopeOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: DeploymentOperationsListAtManagementGroupScopeOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deploymentName, - options - }, - listAtSubscriptionScopeOperationSpec, - callback - ) as Promise; + { groupId, deploymentName, options }, + listAtManagementGroupScopeOperationSpec + ); } /** * Gets a deployments operation. - * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of the deployment. * @param operationId The ID of the operation to get. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get( - resourceGroupName: string, + getAtSubscriptionScope( deploymentName: string, operationId: string, - options?: msRest.RequestOptionsBase - ): Promise; + options?: DeploymentOperationsGetAtSubscriptionScopeOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deploymentName, operationId, options }, + getAtSubscriptionScopeOperationSpec + ); + } + /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * Gets all deployments operations for a deployment. * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param callback The callback + * @param options The options parameters. */ - get( - resourceGroupName: string, + private _listAtSubscriptionScope( deploymentName: string, - operationId: string, - callback: msRest.ServiceCallback - ): void; + options?: DeploymentOperationsListAtSubscriptionScopeOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deploymentName, options }, + listAtSubscriptionScopeOperationSpec + ); + } + /** + * Gets a deployments operation. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of the deployment. * @param operationId The ID of the operation to get. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ get( resourceGroupName: string, deploymentName: string, operationId: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - get( - resourceGroupName: string, - deploymentName: string, - operationId: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: DeploymentOperationsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - deploymentName, - operationId, - options - }, - getOperationSpec, - callback - ) as Promise; + { resourceGroupName, deploymentName, operationId, options }, + getOperationSpec + ); } /** * Gets all deployments operations for a deployment. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list( + private _list( resourceGroupName: string, deploymentName: string, - options?: Models.DeploymentOperationsListOptionalParams - ): Promise; + options?: DeploymentOperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, deploymentName, options }, + listOperationSpec + ); + } + /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * ListAtScopeNext + * @param scope The resource scope. * @param deploymentName The name of the deployment. - * @param callback The callback + * @param nextLink The nextLink from the previous successful call to the ListAtScope method. + * @param options The options parameters. */ - list( - resourceGroupName: string, + private _listAtScopeNext( + scope: string, deploymentName: string, - callback: msRest.ServiceCallback - ): void; + nextLink: string, + options?: DeploymentOperationsListAtScopeNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, deploymentName, nextLink, options }, + listAtScopeNextOperationSpec + ); + } + /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * ListAtTenantScopeNext * @param deploymentName The name of the deployment. - * @param options The optional parameters - * @param callback The callback + * @param nextLink The nextLink from the previous successful call to the ListAtTenantScope method. + * @param options The options parameters. */ - list( - resourceGroupName: string, - deploymentName: string, - options: Models.DeploymentOperationsListOptionalParams, - callback: msRest.ServiceCallback - ): void; - list( - resourceGroupName: string, + private _listAtTenantScopeNext( deploymentName: string, - options?: - | Models.DeploymentOperationsListOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + nextLink: string, + options?: DeploymentOperationsListAtTenantScopeNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - deploymentName, - options - }, - listOperationSpec, - callback - ) as Promise; + { deploymentName, nextLink, options }, + listAtTenantScopeNextOperationSpec + ); } /** - * Gets all deployments operations for a deployment. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listAtScopeNext( - nextPageLink: string, - options?: Models.DeploymentOperationsListAtScopeNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listAtScopeNext( - 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 + * ListAtManagementGroupScopeNext + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param nextLink The nextLink from the previous successful call to the ListAtManagementGroupScope + * method. + * @param options The options parameters. */ - listAtScopeNext( - nextPageLink: string, - options: Models.DeploymentOperationsListAtScopeNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listAtScopeNext( - nextPageLink: string, - options?: - | Models.DeploymentOperationsListAtScopeNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listAtManagementGroupScopeNext( + groupId: string, + deploymentName: string, + nextLink: string, + options?: DeploymentOperationsListAtManagementGroupScopeNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listAtScopeNextOperationSpec, - callback - ) as Promise; + { groupId, deploymentName, nextLink, options }, + listAtManagementGroupScopeNextOperationSpec + ); } /** - * Gets all deployments operations for a deployment. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listAtTenantScopeNext( - nextPageLink: string, - options?: Models.DeploymentOperationsListAtTenantScopeNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listAtTenantScopeNext( - 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 + * ListAtSubscriptionScopeNext + * @param deploymentName The name of the deployment. + * @param nextLink The nextLink from the previous successful call to the ListAtSubscriptionScope + * method. + * @param options The options parameters. */ - listAtTenantScopeNext( - nextPageLink: string, - options: Models.DeploymentOperationsListAtTenantScopeNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listAtTenantScopeNext( - nextPageLink: string, - options?: - | Models.DeploymentOperationsListAtTenantScopeNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listAtSubscriptionScopeNext( + deploymentName: string, + nextLink: string, + options?: DeploymentOperationsListAtSubscriptionScopeNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listAtTenantScopeNextOperationSpec, - callback - ) as Promise; + { deploymentName, nextLink, options }, + listAtSubscriptionScopeNextOperationSpec + ); } /** - * Gets all deployments operations for a deployment. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listAtManagementGroupScopeNext( - nextPageLink: string, - options?: Models.DeploymentOperationsListAtManagementGroupScopeNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listAtManagementGroupScopeNext( - 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 resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listAtManagementGroupScopeNext( - nextPageLink: string, - options: Models.DeploymentOperationsListAtManagementGroupScopeNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listAtManagementGroupScopeNext( - nextPageLink: string, - options?: - | Models.DeploymentOperationsListAtManagementGroupScopeNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listNext( + resourceGroupName: string, + deploymentName: string, + nextLink: string, + options?: DeploymentOperationsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listAtManagementGroupScopeNextOperationSpec, - callback - ) as Promise; + { resourceGroupName, deploymentName, nextLink, options }, + listNextOperationSpec + ); } /** - * Gets all deployments operations for a deployment. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listAtSubscriptionScopeNext( - nextPageLink: string, - options?: Models.DeploymentOperationsListAtSubscriptionScopeNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * ListAtScopeNextNext + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param nextLink The nextLink from the previous successful call to the ListAtScopeNext method. + * @param options The options parameters. */ - listAtSubscriptionScopeNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; + private _listAtScopeNextNext( + scope: string, + deploymentName: string, + nextLink: string, + options?: DeploymentOperationsListAtScopeNextNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, deploymentName, nextLink, options }, + listAtScopeNextNextOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListAtTenantScopeNextNext + * @param deploymentName The name of the deployment. + * @param nextLink The nextLink from the previous successful call to the ListAtTenantScopeNext method. + * @param options The options parameters. */ - listAtSubscriptionScopeNext( - nextPageLink: string, - options: Models.DeploymentOperationsListAtSubscriptionScopeNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listAtSubscriptionScopeNext( - nextPageLink: string, - options?: - | Models.DeploymentOperationsListAtSubscriptionScopeNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listAtTenantScopeNextNext( + deploymentName: string, + nextLink: string, + options?: DeploymentOperationsListAtTenantScopeNextNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listAtSubscriptionScopeNextOperationSpec, - callback - ) as Promise; + { deploymentName, nextLink, options }, + listAtTenantScopeNextNextOperationSpec + ); } /** - * Gets all deployments operations for a deployment. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise + * ListAtManagementGroupScopeNextNext + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param nextLink The nextLink from the previous successful call to the ListAtManagementGroupScopeNext + * method. + * @param options The options parameters. */ - listNext( - nextPageLink: string, - options?: Models.DeploymentOperationsListNextOptionalParams - ): Promise; + private _listAtManagementGroupScopeNextNext( + groupId: string, + deploymentName: string, + nextLink: string, + options?: DeploymentOperationsListAtManagementGroupScopeNextNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { groupId, deploymentName, nextLink, options }, + listAtManagementGroupScopeNextNextOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * ListAtSubscriptionScopeNextNext + * @param deploymentName The name of the deployment. + * @param nextLink The nextLink from the previous successful call to the ListAtSubscriptionScopeNext + * method. + * @param options The options parameters. */ - listNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; + private _listAtSubscriptionScopeNextNext( + deploymentName: string, + nextLink: string, + options?: DeploymentOperationsListAtSubscriptionScopeNextNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deploymentName, nextLink, options }, + listAtSubscriptionScopeNextNextOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNextNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param nextLink The nextLink from the previous successful call to the ListNext method. + * @param options The options parameters. */ - listNext( - nextPageLink: string, - options: Models.DeploymentOperationsListNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listNext( - nextPageLink: string, - options?: - | Models.DeploymentOperationsListNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listNextNext( + resourceGroupName: string, + deploymentName: string, + nextLink: string, + options?: DeploymentOperationsListNextNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback - ) as Promise; + { resourceGroupName, deploymentName, nextLink, options }, + listNextNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getAtScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getAtScopeOperationSpec: coreClient.OperationSpec = { path: - "{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}", - urlParameters: [Parameters.scope, Parameters.deploymentName, Parameters.operationId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DeploymentOperation @@ -796,15 +1117,20 @@ const getAtScopeOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.scope, + Parameters.deploymentName, + Parameters.operationId + ], + headerParameters: [Parameters.accept], serializer }; - -const listAtScopeOperationSpec: msRest.OperationSpec = { +const listAtScopeOperationSpec: coreClient.OperationSpec = { + path: + "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations", httpMethod: "GET", - path: "{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations", - urlParameters: [Parameters.scope, Parameters.deploymentName], - queryParameters: [Parameters.top, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.DeploymentOperationsListResult @@ -813,15 +1139,19 @@ const listAtScopeOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.scope, + Parameters.deploymentName + ], + headerParameters: [Parameters.accept], serializer }; - -const getAtTenantScopeOperationSpec: msRest.OperationSpec = { +const getAtTenantScopeOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}", httpMethod: "GET", - path: "providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}", - urlParameters: [Parameters.deploymentName, Parameters.operationId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.DeploymentOperation @@ -830,15 +1160,19 @@ const getAtTenantScopeOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.operationId + ], + headerParameters: [Parameters.accept], serializer }; - -const listAtTenantScopeOperationSpec: msRest.OperationSpec = { +const listAtTenantScopeOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Resources/deployments/{deploymentName}/operations", httpMethod: "GET", - path: "providers/Microsoft.Resources/deployments/{deploymentName}/operations", - urlParameters: [Parameters.deploymentName], - queryParameters: [Parameters.top, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.DeploymentOperationsListResult @@ -847,16 +1181,15 @@ const listAtTenantScopeOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [Parameters.$host, Parameters.deploymentName], + headerParameters: [Parameters.accept], serializer }; - -const getAtManagementGroupScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const getAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { path: - "providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}", - urlParameters: [Parameters.groupId, Parameters.deploymentName, Parameters.operationId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DeploymentOperation @@ -865,16 +1198,20 @@ const getAtManagementGroupScopeOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.groupId, + Parameters.operationId + ], + headerParameters: [Parameters.accept], serializer }; - -const listAtManagementGroupScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const listAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { path: - "providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations", - urlParameters: [Parameters.groupId, Parameters.deploymentName], - queryParameters: [Parameters.top, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DeploymentOperationsListResult @@ -883,16 +1220,19 @@ const listAtManagementGroupScopeOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.groupId + ], + headerParameters: [Parameters.accept], serializer }; - -const getAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const getAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}", - urlParameters: [Parameters.deploymentName, Parameters.operationId, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DeploymentOperation @@ -901,16 +1241,20 @@ const getAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.subscriptionId, + Parameters.operationId + ], + headerParameters: [Parameters.accept], serializer }; - -const listAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const listAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations", - urlParameters: [Parameters.deploymentName, Parameters.subscriptionId], - queryParameters: [Parameters.top, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DeploymentOperationsListResult @@ -919,21 +1263,19 @@ const listAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations/{operationId}", + queryParameters: [Parameters.apiVersion, Parameters.top], urlParameters: [ - Parameters.resourceGroupName, + Parameters.$host, Parameters.deploymentName, - Parameters.operationId, Parameters.subscriptionId ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations/{operationId}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DeploymentOperation @@ -942,20 +1284,42 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.operationId + ], + headerParameters: [Parameters.accept], serializer }; - -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const listOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations", + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DeploymentOperationsListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], urlParameters: [ - Parameters.resourceGroupName, + Parameters.$host, Parameters.deploymentName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.resourceGroupName ], - queryParameters: [Parameters.top, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + headerParameters: [Parameters.accept], + serializer +}; +const listAtScopeNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DeploymentOperationsListResult @@ -964,16 +1328,19 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.scope, + Parameters.deploymentName + ], + headerParameters: [Parameters.accept], serializer }; - -const listAtScopeNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listAtTenantScopeNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.top, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DeploymentOperationsListResult @@ -982,16 +1349,39 @@ const listAtScopeNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.deploymentName + ], + headerParameters: [Parameters.accept], serializer }; - -const listAtTenantScopeNextOperationSpec: msRest.OperationSpec = { +const listAtManagementGroupScopeNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", httpMethod: "GET", - baseUrl: "https://management.azure.com", + responses: { + 200: { + bodyMapper: Mappers.DeploymentOperationsListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.deploymentName, + Parameters.groupId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listAtSubscriptionScopeNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.top, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DeploymentOperationsListResult @@ -1000,16 +1390,41 @@ const listAtTenantScopeNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.deploymentName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], serializer }; - -const listAtManagementGroupScopeNextOperationSpec: msRest.OperationSpec = { +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", httpMethod: "GET", - baseUrl: "https://management.azure.com", + responses: { + 200: { + bodyMapper: Mappers.DeploymentOperationsListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.deploymentName, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listAtScopeNextNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.top, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DeploymentOperationsListResult @@ -1018,16 +1433,39 @@ const listAtManagementGroupScopeNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.scope, + Parameters.deploymentName + ], + headerParameters: [Parameters.accept], serializer }; - -const listAtSubscriptionScopeNextOperationSpec: msRest.OperationSpec = { +const listAtTenantScopeNextNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", httpMethod: "GET", - baseUrl: "https://management.azure.com", + responses: { + 200: { + bodyMapper: Mappers.DeploymentOperationsListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.deploymentName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listAtManagementGroupScopeNextNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.top, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DeploymentOperationsListResult @@ -1036,16 +1474,40 @@ const listAtSubscriptionScopeNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.deploymentName, + Parameters.groupId + ], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { +const listAtSubscriptionScopeNextNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", httpMethod: "GET", - baseUrl: "https://management.azure.com", + responses: { + 200: { + bodyMapper: Mappers.DeploymentOperationsListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.deploymentName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.top, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DeploymentOperationsListResult @@ -1054,5 +1516,14 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.deploymentName, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/resources/arm-resources/src/operations/deployments.ts b/sdk/resources/arm-resources/src/operations/deployments.ts index 10d9f37bfa15..3e56e35f379b 100644 --- a/sdk/resources/arm-resources/src/operations/deployments.ts +++ b/sdk/resources/arm-resources/src/operations/deployments.ts @@ -3,2435 +3,2951 @@ * 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/deploymentsMappers"; +import "@azure/core-paging"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Deployments } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ResourceManagementClientContext } from "../resourceManagementClientContext"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { LroEngine } from "../lro"; +import { CoreClientLro, shouldDeserializeLro } from "../coreClientLro"; +import { + DeploymentExtended, + DeploymentsListAtScopeNextOptionalParams, + DeploymentsListAtScopeOptionalParams, + DeploymentsListAtTenantScopeNextOptionalParams, + DeploymentsListAtTenantScopeOptionalParams, + DeploymentsListAtManagementGroupScopeNextOptionalParams, + DeploymentsListAtManagementGroupScopeOptionalParams, + DeploymentsListAtSubscriptionScopeNextOptionalParams, + DeploymentsListAtSubscriptionScopeOptionalParams, + DeploymentsListByResourceGroupNextOptionalParams, + DeploymentsListByResourceGroupOptionalParams, + DeploymentsListAtScopeNextNextOptionalParams, + DeploymentsListAtTenantScopeNextNextOptionalParams, + DeploymentsListAtManagementGroupScopeNextNextOptionalParams, + DeploymentsListAtSubscriptionScopeNextNextOptionalParams, + DeploymentsListByResourceGroupNextNextOptionalParams, + DeploymentsDeleteAtScopeOptionalParams, + DeploymentsCheckExistenceAtScopeOptionalParams, + DeploymentsCheckExistenceAtScopeResponse, + Deployment, + DeploymentsCreateOrUpdateAtScopeOptionalParams, + DeploymentsCreateOrUpdateAtScopeResponse, + DeploymentsGetAtScopeOptionalParams, + DeploymentsGetAtScopeResponse, + DeploymentsCancelAtScopeOptionalParams, + DeploymentsValidateAtScopeOptionalParams, + DeploymentsValidateAtScopeResponse, + DeploymentsExportTemplateAtScopeOptionalParams, + DeploymentsExportTemplateAtScopeResponse, + DeploymentsListAtScopeResponse, + DeploymentsDeleteAtTenantScopeOptionalParams, + DeploymentsCheckExistenceAtTenantScopeOptionalParams, + DeploymentsCheckExistenceAtTenantScopeResponse, + ScopedDeployment, + DeploymentsCreateOrUpdateAtTenantScopeOptionalParams, + DeploymentsCreateOrUpdateAtTenantScopeResponse, + DeploymentsGetAtTenantScopeOptionalParams, + DeploymentsGetAtTenantScopeResponse, + DeploymentsCancelAtTenantScopeOptionalParams, + DeploymentsValidateAtTenantScopeOptionalParams, + DeploymentsValidateAtTenantScopeResponse, + ScopedDeploymentWhatIf, + DeploymentsWhatIfAtTenantScopeOptionalParams, + DeploymentsWhatIfAtTenantScopeResponse, + DeploymentsExportTemplateAtTenantScopeOptionalParams, + DeploymentsExportTemplateAtTenantScopeResponse, + DeploymentsListAtTenantScopeResponse, + DeploymentsDeleteAtManagementGroupScopeOptionalParams, + DeploymentsCheckExistenceAtManagementGroupScopeOptionalParams, + DeploymentsCheckExistenceAtManagementGroupScopeResponse, + DeploymentsCreateOrUpdateAtManagementGroupScopeOptionalParams, + DeploymentsCreateOrUpdateAtManagementGroupScopeResponse, + DeploymentsGetAtManagementGroupScopeOptionalParams, + DeploymentsGetAtManagementGroupScopeResponse, + DeploymentsCancelAtManagementGroupScopeOptionalParams, + DeploymentsValidateAtManagementGroupScopeOptionalParams, + DeploymentsValidateAtManagementGroupScopeResponse, + DeploymentsWhatIfAtManagementGroupScopeOptionalParams, + DeploymentsWhatIfAtManagementGroupScopeResponse, + DeploymentsExportTemplateAtManagementGroupScopeOptionalParams, + DeploymentsExportTemplateAtManagementGroupScopeResponse, + DeploymentsListAtManagementGroupScopeResponse, + DeploymentsDeleteAtSubscriptionScopeOptionalParams, + DeploymentsCheckExistenceAtSubscriptionScopeOptionalParams, + DeploymentsCheckExistenceAtSubscriptionScopeResponse, + DeploymentsCreateOrUpdateAtSubscriptionScopeOptionalParams, + DeploymentsCreateOrUpdateAtSubscriptionScopeResponse, + DeploymentsGetAtSubscriptionScopeOptionalParams, + DeploymentsGetAtSubscriptionScopeResponse, + DeploymentsCancelAtSubscriptionScopeOptionalParams, + DeploymentsValidateAtSubscriptionScopeOptionalParams, + DeploymentsValidateAtSubscriptionScopeResponse, + DeploymentWhatIf, + DeploymentsWhatIfAtSubscriptionScopeOptionalParams, + DeploymentsWhatIfAtSubscriptionScopeResponse, + DeploymentsExportTemplateAtSubscriptionScopeOptionalParams, + DeploymentsExportTemplateAtSubscriptionScopeResponse, + DeploymentsListAtSubscriptionScopeResponse, + DeploymentsDeleteOptionalParams, + DeploymentsCheckExistenceOptionalParams, + DeploymentsCheckExistenceResponse, + DeploymentsCreateOrUpdateOptionalParams, + DeploymentsCreateOrUpdateResponse, + DeploymentsGetOptionalParams, + DeploymentsGetResponse, + DeploymentsCancelOptionalParams, + DeploymentsValidateOptionalParams, + DeploymentsValidateResponse, + DeploymentsWhatIfOptionalParams, + DeploymentsWhatIfResponse, + DeploymentsExportTemplateOptionalParams, + DeploymentsExportTemplateResponse, + DeploymentsListByResourceGroupResponse, + DeploymentsCalculateTemplateHashOptionalParams, + DeploymentsCalculateTemplateHashResponse, + DeploymentsListAtScopeNextResponse, + DeploymentsListAtTenantScopeNextResponse, + DeploymentsListAtManagementGroupScopeNextResponse, + DeploymentsListAtSubscriptionScopeNextResponse, + DeploymentsListByResourceGroupNextResponse, + DeploymentsListAtScopeNextNextResponse, + DeploymentsListAtTenantScopeNextNextResponse, + DeploymentsListAtManagementGroupScopeNextNextResponse, + DeploymentsListAtSubscriptionScopeNextNextResponse, + DeploymentsListByResourceGroupNextNextResponse +} from "../models"; +/// /** Class representing a Deployments. */ -export class Deployments { +export class DeploymentsImpl implements Deployments { private readonly client: ResourceManagementClientContext; /** - * Create a Deployments. - * @param {ResourceManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Deployments class. + * @param client Reference to the service client */ constructor(client: ResourceManagementClientContext) { this.client = client; } /** - * A template deployment that is currently running cannot be deleted. Deleting a template - * deployment removes the associated deployment operations. This is an asynchronous operation that - * returns a status of 202 until the template deployment is successfully deleted. The Location - * response header contains the URI that is used to obtain the status of the process. While the - * process is running, a call to the URI in the Location header returns a status of 202. When the - * process finishes, the URI in the Location header returns a status of 204 on success. If the - * asynchronous request failed, the URI in the Location header returns an error-level status code. - * @summary Deletes a deployment from the deployment history. + * Get all the deployments at the given scope. * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteAtScope( + public listAtScope( scope: string, - deploymentName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginDeleteAtScope(scope, deploymentName, options).then((lroPoller) => - lroPoller.pollUntilFinished() - ); + options?: DeploymentsListAtScopeOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAtScopePagingAll(scope, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listAtScopePagingPage(scope, options); + } + }; } - /** - * Checks whether the deployment exists. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise - */ - checkExistenceAtScope( + private async *listAtScopePagingPage( scope: string, - deploymentName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param callback The callback - */ - checkExistenceAtScope( + options?: DeploymentsListAtScopeOptionalParams + ): AsyncIterableIterator { + let result = await this._listAtScope(scope, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listAtScopeNext(scope, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listAtScopePagingAll( scope: string, - deploymentName: string, - callback: msRest.ServiceCallback - ): void; + options?: DeploymentsListAtScopeOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAtScopePagingPage(scope, options)) { + yield* page; + } + } + /** - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param options The optional parameters - * @param callback The callback - */ - checkExistenceAtScope( - scope: string, - deploymentName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - checkExistenceAtScope( - scope: string, - deploymentName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - scope, - deploymentName, - options + * Get all the deployments at the tenant scope. + * @param options The options parameters. + */ + public listAtTenantScope( + options?: DeploymentsListAtTenantScopeOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAtTenantScopePagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - checkExistenceAtScopeOperationSpec, - callback - ) as Promise; + byPage: () => { + return this.listAtTenantScopePagingPage(options); + } + }; + } + + private async *listAtTenantScopePagingPage( + options?: DeploymentsListAtTenantScopeOptionalParams + ): AsyncIterableIterator { + let result = await this._listAtTenantScope(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listAtTenantScopeNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listAtTenantScopePagingAll( + options?: DeploymentsListAtTenantScopeOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAtTenantScopePagingPage(options)) { + yield* page; + } } /** - * You can provide the template and parameters directly in the request or link to JSON files. - * @summary Deploys resources at a given scope. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param [options] The optional parameters - * @returns Promise + * Get all the deployments for a management group. + * @param groupId The management group ID. + * @param options The options parameters. */ - createOrUpdateAtScope( - scope: string, - deploymentName: string, - parameters: Models.Deployment, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginCreateOrUpdateAtScope( - scope, - deploymentName, - parameters, + public listAtManagementGroupScope( + groupId: string, + options?: DeploymentsListAtManagementGroupScopeOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAtManagementGroupScopePagingAll(groupId, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listAtManagementGroupScopePagingPage(groupId, options); + } + }; + } + + private async *listAtManagementGroupScopePagingPage( + groupId: string, + options?: DeploymentsListAtManagementGroupScopeOptionalParams + ): AsyncIterableIterator { + let result = await this._listAtManagementGroupScope(groupId, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listAtManagementGroupScopeNext( + groupId, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listAtManagementGroupScopePagingAll( + groupId: string, + options?: DeploymentsListAtManagementGroupScopeOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAtManagementGroupScopePagingPage( + groupId, options - ).then((lroPoller) => lroPoller.pollUntilFinished()) as Promise< - Models.DeploymentsCreateOrUpdateAtScopeResponse - >; + )) { + yield* page; + } } /** - * Gets a deployment. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise - */ - getAtScope( - scope: string, - deploymentName: string, - options?: msRest.RequestOptionsBase - ): Promise; + * Get all the deployments for a subscription. + * @param options The options parameters. + */ + public listAtSubscriptionScope( + options?: DeploymentsListAtSubscriptionScopeOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAtSubscriptionScopePagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listAtSubscriptionScopePagingPage(options); + } + }; + } + + private async *listAtSubscriptionScopePagingPage( + options?: DeploymentsListAtSubscriptionScopeOptionalParams + ): AsyncIterableIterator { + let result = await this._listAtSubscriptionScope(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listAtSubscriptionScopeNext( + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listAtSubscriptionScopePagingAll( + options?: DeploymentsListAtSubscriptionScopeOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAtSubscriptionScopePagingPage(options)) { + yield* page; + } + } + /** - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param callback The callback + * Get all the deployments for a resource group. + * @param resourceGroupName The name of the resource group with the deployments to get. The name is + * case insensitive. + * @param options The options parameters. */ - getAtScope( - scope: string, - deploymentName: string, - callback: msRest.ServiceCallback - ): void; + public listByResourceGroup( + resourceGroupName: string, + options?: DeploymentsListByResourceGroupOptionalParams + ): 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?: DeploymentsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: DeploymentsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + /** + * ListAtScopeNext * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param options The optional parameters - * @param callback The callback + * @param nextLink The nextLink from the previous successful call to the ListAtScope method. + * @param options The options parameters. */ - getAtScope( + public listAtScopeNext( scope: string, - deploymentName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getAtScope( + nextLink: string, + options?: DeploymentsListAtScopeNextOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAtScopeNextPagingAll(scope, nextLink, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listAtScopeNextPagingPage(scope, nextLink, options); + } + }; + } + + private async *listAtScopeNextPagingPage( scope: string, - deploymentName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { + nextLink: string, + options?: DeploymentsListAtScopeNextOptionalParams + ): AsyncIterableIterator { + let result = await this._listAtScopeNext(scope, nextLink, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listAtScopeNextNext( scope, - deploymentName, + continuationToken, options - }, - getAtScopeOperationSpec, - callback - ) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } } - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the - * deployment is canceled, the provisioningState is set to Canceled. Canceling a template - * deployment stops the currently running template deployment and leaves the resources partially - * deployed. - * @summary Cancels a currently running template deployment. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise - */ - cancelAtScope( + private async *listAtScopeNextPagingAll( scope: string, - deploymentName: string, - options?: msRest.RequestOptionsBase - ): Promise; + nextLink: string, + options?: DeploymentsListAtScopeNextOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAtScopeNextPagingPage( + scope, + nextLink, + options + )) { + yield* page; + } + } + /** - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param callback The callback - */ - cancelAtScope( - scope: string, - deploymentName: string, - callback: msRest.ServiceCallback - ): void; + * ListAtTenantScopeNext + * @param nextLink The nextLink from the previous successful call to the ListAtTenantScope method. + * @param options The options parameters. + */ + public listAtTenantScopeNext( + nextLink: string, + options?: DeploymentsListAtTenantScopeNextOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAtTenantScopeNextPagingAll(nextLink, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listAtTenantScopeNextPagingPage(nextLink, options); + } + }; + } + + private async *listAtTenantScopeNextPagingPage( + nextLink: string, + options?: DeploymentsListAtTenantScopeNextOptionalParams + ): AsyncIterableIterator { + let result = await this._listAtTenantScopeNext(nextLink, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listAtTenantScopeNextNext( + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listAtTenantScopeNextPagingAll( + nextLink: string, + options?: DeploymentsListAtTenantScopeNextOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAtTenantScopeNextPagingPage( + nextLink, + options + )) { + yield* page; + } + } + /** - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param options The optional parameters - * @param callback The callback + * ListAtManagementGroupScopeNext + * @param groupId The management group ID. + * @param nextLink The nextLink from the previous successful call to the ListAtManagementGroupScope + * method. + * @param options The options parameters. */ - cancelAtScope( - scope: string, - deploymentName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - cancelAtScope( - scope: string, - deploymentName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - scope, - deploymentName, - options + public listAtManagementGroupScopeNext( + groupId: string, + nextLink: string, + options?: DeploymentsListAtManagementGroupScopeNextOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAtManagementGroupScopeNextPagingAll( + groupId, + nextLink, + options + ); + return { + next() { + return iter.next(); }, - cancelAtScopeOperationSpec, - callback + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listAtManagementGroupScopeNextPagingPage( + groupId, + nextLink, + options + ); + } + }; + } + + private async *listAtManagementGroupScopeNextPagingPage( + groupId: string, + nextLink: string, + options?: DeploymentsListAtManagementGroupScopeNextOptionalParams + ): AsyncIterableIterator { + let result = await this._listAtManagementGroupScopeNext( + groupId, + nextLink, + options ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listAtManagementGroupScopeNextNext( + groupId, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listAtManagementGroupScopeNextPagingAll( + groupId: string, + nextLink: string, + options?: DeploymentsListAtManagementGroupScopeNextOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAtManagementGroupScopeNextPagingPage( + groupId, + nextLink, + options + )) { + yield* page; + } } /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure - * Resource Manager.. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param [options] The optional parameters - * @returns Promise - */ - validateAtScope( - scope: string, - deploymentName: string, - parameters: Models.Deployment, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginValidateAtScope(scope, deploymentName, parameters, options).then((lroPoller) => - lroPoller.pollUntilFinished() - ) as Promise; + * ListAtSubscriptionScopeNext + * @param nextLink The nextLink from the previous successful call to the ListAtSubscriptionScope + * method. + * @param options The options parameters. + */ + public listAtSubscriptionScopeNext( + nextLink: string, + options?: DeploymentsListAtSubscriptionScopeNextOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAtSubscriptionScopeNextPagingAll(nextLink, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listAtSubscriptionScopeNextPagingPage(nextLink, options); + } + }; + } + + private async *listAtSubscriptionScopeNextPagingPage( + nextLink: string, + options?: DeploymentsListAtSubscriptionScopeNextOptionalParams + ): AsyncIterableIterator { + let result = await this._listAtSubscriptionScopeNext(nextLink, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listAtSubscriptionScopeNextNext( + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listAtSubscriptionScopeNextPagingAll( + nextLink: string, + options?: DeploymentsListAtSubscriptionScopeNextOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAtSubscriptionScopeNextPagingPage( + nextLink, + options + )) { + yield* page; + } } /** - * Exports the template used for specified deployment. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group with the deployments to get. The name is + * case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. */ - exportTemplateAtScope( - scope: string, - deploymentName: string, - options?: msRest.RequestOptionsBase - ): Promise; + public listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: DeploymentsListByResourceGroupNextOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupNextPagingAll( + resourceGroupName, + nextLink, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupNextPagingPage( + resourceGroupName, + nextLink, + options + ); + } + }; + } + + private async *listByResourceGroupNextPagingPage( + resourceGroupName: string, + nextLink: string, + options?: DeploymentsListByResourceGroupNextOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroupNext( + resourceGroupName, + nextLink, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNextNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupNextPagingAll( + resourceGroupName: string, + nextLink: string, + options?: DeploymentsListByResourceGroupNextOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupNextPagingPage( + resourceGroupName, + nextLink, + options + )) { + yield* page; + } + } + /** + * A template deployment that is currently running cannot be deleted. Deleting a template deployment + * removes the associated deployment operations. This is an asynchronous operation that returns a + * status of 202 until the template deployment is successfully deleted. The Location response header + * contains the URI that is used to obtain the status of the process. While the process is running, a + * call to the URI in the Location header returns a status of 202. When the process finishes, the URI + * in the Location header returns a status of 204 on success. If the asynchronous request failed, the + * URI in the Location header returns an error-level status code. * @param scope The resource scope. * @param deploymentName The name of the deployment. - * @param callback The callback + * @param options The options parameters. */ - exportTemplateAtScope( + async beginDeleteAtScope( scope: string, deploymentName: string, - callback: msRest.ServiceCallback - ): void; + options?: DeploymentsDeleteAtScopeOptionalParams + ): 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 CoreClientLro( + sendOperation, + { scope, deploymentName, options }, + deleteAtScopeOperationSpec + ); + return new LroEngine(lro, { intervalInMs: options?.updateIntervalInMs }); + } + /** + * A template deployment that is currently running cannot be deleted. Deleting a template deployment + * removes the associated deployment operations. This is an asynchronous operation that returns a + * status of 202 until the template deployment is successfully deleted. The Location response header + * contains the URI that is used to obtain the status of the process. While the process is running, a + * call to the URI in the Location header returns a status of 202. When the process finishes, the URI + * in the Location header returns a status of 204 on success. If the asynchronous request failed, the + * URI in the Location header returns an error-level status code. * @param scope The resource scope. * @param deploymentName The name of the deployment. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - exportTemplateAtScope( - scope: string, - deploymentName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - exportTemplateAtScope( + async beginDeleteAtScopeAndWait( scope: string, deploymentName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - scope, - deploymentName, - options - }, - exportTemplateAtScopeOperationSpec, - callback - ) as Promise; + options?: DeploymentsDeleteAtScopeOptionalParams + ): Promise { + const poller = await this.beginDeleteAtScope( + scope, + deploymentName, + options + ); + return poller.pollUntilDone(); } /** - * Get all the deployments at the given scope. - * @param scope The resource scope. - * @param [options] The optional parameters - * @returns Promise - */ - listAtScope( - scope: string, - options?: Models.DeploymentsListAtScopeOptionalParams - ): Promise; - /** - * @param scope The resource scope. - * @param callback The callback - */ - listAtScope(scope: string, callback: msRest.ServiceCallback): void; - /** + * Checks whether the deployment exists. * @param scope The resource scope. - * @param options The optional parameters - * @param callback The callback - */ - listAtScope( - scope: string, - options: Models.DeploymentsListAtScopeOptionalParams, - callback: msRest.ServiceCallback - ): void; - listAtScope( - scope: string, - options?: - | Models.DeploymentsListAtScopeOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - scope, - options - }, - listAtScopeOperationSpec, - callback - ) as Promise; - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template - * deployment removes the associated deployment operations. This is an asynchronous operation that - * returns a status of 202 until the template deployment is successfully deleted. The Location - * response header contains the URI that is used to obtain the status of the process. While the - * process is running, a call to the URI in the Location header returns a status of 202. When the - * process finishes, the URI in the Location header returns a status of 204 on success. If the - * asynchronous request failed, the URI in the Location header returns an error-level status code. - * @summary Deletes a deployment from the deployment history. * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteAtTenantScope( + checkExistenceAtScope( + scope: string, deploymentName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginDeleteAtTenantScope(deploymentName, options).then((lroPoller) => - lroPoller.pollUntilFinished() + options?: DeploymentsCheckExistenceAtScopeOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, deploymentName, options }, + checkExistenceAtScopeOperationSpec ); } /** - * Checks whether the deployment exists. - * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise - */ - checkExistenceAtTenantScope( - deploymentName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param deploymentName The name of the deployment. - * @param callback The callback - */ - checkExistenceAtTenantScope( - deploymentName: string, - callback: msRest.ServiceCallback - ): void; - /** + * You can provide the template and parameters directly in the request or link to JSON files. + * @param scope The resource scope. * @param deploymentName The name of the deployment. - * @param options The optional parameters - * @param callback The callback + * @param parameters Additional parameters supplied to the operation. + * @param options The options parameters. */ - checkExistenceAtTenantScope( - deploymentName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - checkExistenceAtTenantScope( + async beginCreateOrUpdateAtScope( + scope: string, deploymentName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - deploymentName, - options - }, - checkExistenceAtTenantScopeOperationSpec, - callback - ) as Promise; + parameters: Deployment, + options?: DeploymentsCreateOrUpdateAtScopeOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeploymentsCreateOrUpdateAtScopeResponse + > + > { + 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 CoreClientLro( + sendOperation, + { scope, deploymentName, parameters, options }, + createOrUpdateAtScopeOperationSpec + ); + return new LroEngine(lro, { intervalInMs: options?.updateIntervalInMs }); } /** * You can provide the template and parameters directly in the request or link to JSON files. - * @summary Deploys resources at tenant scope. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdateAtTenantScope( + async beginCreateOrUpdateAtScopeAndWait( + scope: string, deploymentName: string, - parameters: Models.ScopedDeployment, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginCreateOrUpdateAtTenantScope( + parameters: Deployment, + options?: DeploymentsCreateOrUpdateAtScopeOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdateAtScope( + scope, deploymentName, parameters, options - ).then((lroPoller) => lroPoller.pollUntilFinished()) as Promise< - Models.DeploymentsCreateOrUpdateAtTenantScopeResponse - >; + ); + return poller.pollUntilDone(); } /** * Gets a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise - */ - getAtTenantScope( - deploymentName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param deploymentName The name of the deployment. - * @param callback The callback - */ - getAtTenantScope( - deploymentName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param deploymentName The name of the deployment. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - getAtTenantScope( - deploymentName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getAtTenantScope( + getAtScope( + scope: string, deploymentName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: DeploymentsGetAtScopeOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deploymentName, - options - }, - getAtTenantScopeOperationSpec, - callback - ) as Promise; + { scope, deploymentName, options }, + getAtScopeOperationSpec + ); } /** * You can cancel a deployment only if the provisioningState is Accepted or Running. After the - * deployment is canceled, the provisioningState is set to Canceled. Canceling a template - * deployment stops the currently running template deployment and leaves the resources partially - * deployed. - * @summary Cancels a currently running template deployment. - * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise - */ - cancelAtTenantScope( - deploymentName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param deploymentName The name of the deployment. - * @param callback The callback - */ - cancelAtTenantScope(deploymentName: string, callback: msRest.ServiceCallback): void; - /** + * deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment + * stops the currently running template deployment and leaves the resources partially deployed. + * @param scope The resource scope. * @param deploymentName The name of the deployment. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - cancelAtTenantScope( - deploymentName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - cancelAtTenantScope( + cancelAtScope( + scope: string, deploymentName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: DeploymentsCancelAtScopeOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deploymentName, - options - }, - cancelAtTenantScopeOperationSpec, - callback + { scope, deploymentName, options }, + cancelAtScopeOperationSpec ); } /** * Validates whether the specified template is syntactically correct and will be accepted by Azure * Resource Manager.. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - validateAtTenantScope( + async beginValidateAtScope( + scope: string, deploymentName: string, - parameters: Models.ScopedDeployment, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginValidateAtTenantScope(deploymentName, parameters, options).then((lroPoller) => - lroPoller.pollUntilFinished() - ) as Promise; + parameters: Deployment, + options?: DeploymentsValidateAtScopeOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeploymentsValidateAtScopeResponse + > + > { + 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 CoreClientLro( + sendOperation, + { scope, deploymentName, parameters, options }, + validateAtScopeOperationSpec + ); + return new LroEngine(lro, { intervalInMs: options?.updateIntervalInMs }); } /** - * Returns changes that will be made by the deployment if executed at the scope of the tenant - * group. + * Validates whether the specified template is syntactically correct and will be accepted by Azure + * Resource Manager.. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - whatIfAtTenantScope( + async beginValidateAtScopeAndWait( + scope: string, deploymentName: string, - parameters: Models.ScopedDeploymentWhatIf, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginWhatIfAtTenantScope(deploymentName, parameters, options).then((lroPoller) => - lroPoller.pollUntilFinished() - ) as Promise; + parameters: Deployment, + options?: DeploymentsValidateAtScopeOptionalParams + ): Promise { + const poller = await this.beginValidateAtScope( + scope, + deploymentName, + parameters, + options + ); + return poller.pollUntilDone(); } /** * Exports the template used for specified deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise - */ - exportTemplateAtTenantScope( - deploymentName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param deploymentName The name of the deployment. - * @param callback The callback - */ - exportTemplateAtTenantScope( - deploymentName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param deploymentName The name of the deployment. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - exportTemplateAtTenantScope( - deploymentName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - exportTemplateAtTenantScope( + exportTemplateAtScope( + scope: string, deploymentName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: DeploymentsExportTemplateAtScopeOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deploymentName, - options - }, - exportTemplateAtTenantScopeOperationSpec, - callback - ) as Promise; + { scope, deploymentName, options }, + exportTemplateAtScopeOperationSpec + ); } /** - * Get all the deployments at the tenant scope. - * @param [options] The optional parameters - * @returns Promise - */ - listAtTenantScope( - options?: Models.DeploymentsListAtTenantScopeOptionalParams - ): Promise; - /** - * @param callback The callback - */ - listAtTenantScope(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - listAtTenantScope( - options: Models.DeploymentsListAtTenantScopeOptionalParams, - callback: msRest.ServiceCallback - ): void; - listAtTenantScope( - options?: - | Models.DeploymentsListAtTenantScopeOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + * Get all the deployments at the given scope. + * @param scope The resource scope. + * @param options The options parameters. + */ + private _listAtScope( + scope: string, + options?: DeploymentsListAtScopeOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - options - }, - listAtTenantScopeOperationSpec, - callback - ) as Promise; + { scope, options }, + listAtScopeOperationSpec + ); } /** - * A template deployment that is currently running cannot be deleted. Deleting a template - * deployment removes the associated deployment operations. This is an asynchronous operation that - * returns a status of 202 until the template deployment is successfully deleted. The Location - * response header contains the URI that is used to obtain the status of the process. While the - * process is running, a call to the URI in the Location header returns a status of 202. When the - * process finishes, the URI in the Location header returns a status of 204 on success. If the - * asynchronous request failed, the URI in the Location header returns an error-level status code. - * @summary Deletes a deployment from the deployment history. - * @param groupId The management group ID. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment + * removes the associated deployment operations. This is an asynchronous operation that returns a + * status of 202 until the template deployment is successfully deleted. The Location response header + * contains the URI that is used to obtain the status of the process. While the process is running, a + * call to the URI in the Location header returns a status of 202. When the process finishes, the URI + * in the Location header returns a status of 204 on success. If the asynchronous request failed, the + * URI in the Location header returns an error-level status code. * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteAtManagementGroupScope( - groupId: string, + async beginDeleteAtTenantScope( deploymentName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginDeleteAtManagementGroupScope( - groupId, - deploymentName, - options - ).then((lroPoller) => lroPoller.pollUntilFinished()); + options?: DeploymentsDeleteAtTenantScopeOptionalParams + ): 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 CoreClientLro( + sendOperation, + { deploymentName, options }, + deleteAtTenantScopeOperationSpec + ); + return new LroEngine(lro, { intervalInMs: options?.updateIntervalInMs }); } /** - * Checks whether the deployment exists. - * @param groupId The management group ID. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment + * removes the associated deployment operations. This is an asynchronous operation that returns a + * status of 202 until the template deployment is successfully deleted. The Location response header + * contains the URI that is used to obtain the status of the process. While the process is running, a + * call to the URI in the Location header returns a status of 202. When the process finishes, the URI + * in the Location header returns a status of 204 on success. If the asynchronous request failed, the + * URI in the Location header returns an error-level status code. * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - checkExistenceAtManagementGroupScope( - groupId: string, + async beginDeleteAtTenantScopeAndWait( deploymentName: string, - options?: msRest.RequestOptionsBase - ): Promise; + options?: DeploymentsDeleteAtTenantScopeOptionalParams + ): Promise { + const poller = await this.beginDeleteAtTenantScope(deploymentName, options); + return poller.pollUntilDone(); + } + /** - * @param groupId The management group ID. + * Checks whether the deployment exists. * @param deploymentName The name of the deployment. - * @param callback The callback + * @param options The options parameters. */ - checkExistenceAtManagementGroupScope( - groupId: string, + checkExistenceAtTenantScope( deploymentName: string, - callback: msRest.ServiceCallback - ): void; + options?: DeploymentsCheckExistenceAtTenantScopeOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deploymentName, options }, + checkExistenceAtTenantScopeOperationSpec + ); + } + /** - * @param groupId The management group ID. + * You can provide the template and parameters directly in the request or link to JSON files. * @param deploymentName The name of the deployment. - * @param options The optional parameters - * @param callback The callback + * @param parameters Additional parameters supplied to the operation. + * @param options The options parameters. */ - checkExistenceAtManagementGroupScope( - groupId: string, + async beginCreateOrUpdateAtTenantScope( deploymentName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - checkExistenceAtManagementGroupScope( - groupId: string, - deploymentName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - groupId, - deploymentName, - options - }, - checkExistenceAtManagementGroupScopeOperationSpec, - callback - ) as Promise; + parameters: ScopedDeployment, + options?: DeploymentsCreateOrUpdateAtTenantScopeOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeploymentsCreateOrUpdateAtTenantScopeResponse + > + > { + 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 CoreClientLro( + sendOperation, + { deploymentName, parameters, options }, + createOrUpdateAtTenantScopeOperationSpec + ); + return new LroEngine(lro, { intervalInMs: options?.updateIntervalInMs }); } /** * You can provide the template and parameters directly in the request or link to JSON files. - * @summary Deploys resources at management group scope. - * @param groupId The management group ID. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdateAtManagementGroupScope( - groupId: string, + async beginCreateOrUpdateAtTenantScopeAndWait( deploymentName: string, - parameters: Models.ScopedDeployment, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginCreateOrUpdateAtManagementGroupScope( - groupId, + parameters: ScopedDeployment, + options?: DeploymentsCreateOrUpdateAtTenantScopeOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdateAtTenantScope( deploymentName, parameters, options - ).then((lroPoller) => lroPoller.pollUntilFinished()) as Promise< - Models.DeploymentsCreateOrUpdateAtManagementGroupScopeResponse - >; + ); + return poller.pollUntilDone(); } /** * Gets a deployment. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise - */ - getAtManagementGroupScope( - groupId: string, - deploymentName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param callback The callback - */ - getAtManagementGroupScope( - groupId: string, - deploymentName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param groupId The management group ID. * @param deploymentName The name of the deployment. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - getAtManagementGroupScope( - groupId: string, - deploymentName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getAtManagementGroupScope( - groupId: string, + getAtTenantScope( deploymentName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: DeploymentsGetAtTenantScopeOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - groupId, - deploymentName, - options - }, - getAtManagementGroupScopeOperationSpec, - callback - ) as Promise; - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the - * deployment is canceled, the provisioningState is set to Canceled. Canceling a template - * deployment stops the currently running template deployment and leaves the resources partially - * deployed. - * @summary Cancels a currently running template deployment. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise - */ - cancelAtManagementGroupScope( - groupId: string, - deploymentName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param callback The callback - */ - cancelAtManagementGroupScope( - groupId: string, - deploymentName: string, - callback: msRest.ServiceCallback - ): void; + { deploymentName, options }, + getAtTenantScopeOperationSpec + ); + } + /** - * @param groupId The management group ID. + * You can cancel a deployment only if the provisioningState is Accepted or Running. After the + * deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment + * stops the currently running template deployment and leaves the resources partially deployed. * @param deploymentName The name of the deployment. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - cancelAtManagementGroupScope( - groupId: string, - deploymentName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - cancelAtManagementGroupScope( - groupId: string, + cancelAtTenantScope( deploymentName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: DeploymentsCancelAtTenantScopeOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - groupId, - deploymentName, - options - }, - cancelAtManagementGroupScopeOperationSpec, - callback + { deploymentName, options }, + cancelAtTenantScopeOperationSpec ); } /** * Validates whether the specified template is syntactically correct and will be accepted by Azure * Resource Manager.. - * @param groupId The management group ID. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - validateAtManagementGroupScope( - groupId: string, + async beginValidateAtTenantScope( deploymentName: string, - parameters: Models.ScopedDeployment, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginValidateAtManagementGroupScope( - groupId, - deploymentName, - parameters, - options - ).then((lroPoller) => lroPoller.pollUntilFinished()) as Promise< - Models.DeploymentsValidateAtManagementGroupScopeResponse - >; + parameters: ScopedDeployment, + options?: DeploymentsValidateAtTenantScopeOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeploymentsValidateAtTenantScopeResponse + > + > { + 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 CoreClientLro( + sendOperation, + { deploymentName, parameters, options }, + validateAtTenantScopeOperationSpec + ); + return new LroEngine(lro, { intervalInMs: options?.updateIntervalInMs }); } /** - * Returns changes that will be made by the deployment if executed at the scope of the management - * group. - * @param groupId The management group ID. + * Validates whether the specified template is syntactically correct and will be accepted by Azure + * Resource Manager.. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - whatIfAtManagementGroupScope( - groupId: string, + async beginValidateAtTenantScopeAndWait( deploymentName: string, - parameters: Models.ScopedDeploymentWhatIf, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginWhatIfAtManagementGroupScope( - groupId, + parameters: ScopedDeployment, + options?: DeploymentsValidateAtTenantScopeOptionalParams + ): Promise { + const poller = await this.beginValidateAtTenantScope( deploymentName, parameters, options - ).then((lroPoller) => lroPoller.pollUntilFinished()) as Promise< - Models.DeploymentsWhatIfAtManagementGroupScopeResponse - >; + ); + return poller.pollUntilDone(); } /** - * Exports the template used for specified deployment. - * @param groupId The management group ID. + * Returns changes that will be made by the deployment if executed at the scope of the tenant group. * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise + * @param parameters Parameters to validate. + * @param options The options parameters. */ - exportTemplateAtManagementGroupScope( - groupId: string, + async beginWhatIfAtTenantScope( deploymentName: string, - options?: msRest.RequestOptionsBase - ): Promise; + parameters: ScopedDeploymentWhatIf, + options?: DeploymentsWhatIfAtTenantScopeOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeploymentsWhatIfAtTenantScopeResponse + > + > { + 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 CoreClientLro( + sendOperation, + { deploymentName, parameters, options }, + whatIfAtTenantScopeOperationSpec, + "location" + ); + return new LroEngine(lro, { intervalInMs: options?.updateIntervalInMs }); + } + /** - * @param groupId The management group ID. + * Returns changes that will be made by the deployment if executed at the scope of the tenant group. * @param deploymentName The name of the deployment. - * @param callback The callback + * @param parameters Parameters to validate. + * @param options The options parameters. */ - exportTemplateAtManagementGroupScope( - groupId: string, + async beginWhatIfAtTenantScopeAndWait( deploymentName: string, - callback: msRest.ServiceCallback - ): void; + parameters: ScopedDeploymentWhatIf, + options?: DeploymentsWhatIfAtTenantScopeOptionalParams + ): Promise { + const poller = await this.beginWhatIfAtTenantScope( + deploymentName, + parameters, + options + ); + return poller.pollUntilDone(); + } + /** - * @param groupId The management group ID. + * Exports the template used for specified deployment. * @param deploymentName The name of the deployment. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - exportTemplateAtManagementGroupScope( - groupId: string, - deploymentName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - exportTemplateAtManagementGroupScope( - groupId: string, + exportTemplateAtTenantScope( deploymentName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: DeploymentsExportTemplateAtTenantScopeOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - groupId, - deploymentName, - options - }, - exportTemplateAtManagementGroupScopeOperationSpec, - callback - ) as Promise; + { deploymentName, options }, + exportTemplateAtTenantScopeOperationSpec + ); } /** - * Get all the deployments for a management group. - * @param groupId The management group ID. - * @param [options] The optional parameters - * @returns Promise - */ - listAtManagementGroupScope( - groupId: string, - options?: Models.DeploymentsListAtManagementGroupScopeOptionalParams - ): Promise; - /** - * @param groupId The management group ID. - * @param callback The callback - */ - listAtManagementGroupScope( - groupId: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param groupId The management group ID. - * @param options The optional parameters - * @param callback The callback + * Get all the deployments at the tenant scope. + * @param options The options parameters. */ - listAtManagementGroupScope( - groupId: string, - options: Models.DeploymentsListAtManagementGroupScopeOptionalParams, - callback: msRest.ServiceCallback - ): void; - listAtManagementGroupScope( - groupId: string, - options?: - | Models.DeploymentsListAtManagementGroupScopeOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listAtTenantScope( + options?: DeploymentsListAtTenantScopeOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - groupId, - options - }, - listAtManagementGroupScopeOperationSpec, - callback - ) as Promise; + { options }, + listAtTenantScopeOperationSpec + ); } /** - * A template deployment that is currently running cannot be deleted. Deleting a template - * deployment removes the associated deployment operations. This is an asynchronous operation that - * returns a status of 202 until the template deployment is successfully deleted. The Location - * response header contains the URI that is used to obtain the status of the process. While the - * process is running, a call to the URI in the Location header returns a status of 202. When the - * process finishes, the URI in the Location header returns a status of 204 on success. If the - * asynchronous request failed, the URI in the Location header returns an error-level status code. - * @summary Deletes a deployment from the deployment history. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment + * removes the associated deployment operations. This is an asynchronous operation that returns a + * status of 202 until the template deployment is successfully deleted. The Location response header + * contains the URI that is used to obtain the status of the process. While the process is running, a + * call to the URI in the Location header returns a status of 202. When the process finishes, the URI + * in the Location header returns a status of 204 on success. If the asynchronous request failed, the + * URI in the Location header returns an error-level status code. + * @param groupId The management group ID. * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteAtSubscriptionScope( + async beginDeleteAtManagementGroupScope( + groupId: string, deploymentName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginDeleteAtSubscriptionScope(deploymentName, options).then((lroPoller) => - lroPoller.pollUntilFinished() + options?: DeploymentsDeleteAtManagementGroupScopeOptionalParams + ): 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 CoreClientLro( + sendOperation, + { groupId, deploymentName, options }, + deleteAtManagementGroupScopeOperationSpec ); + return new LroEngine(lro, { intervalInMs: options?.updateIntervalInMs }); } /** - * Checks whether the deployment exists. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment + * removes the associated deployment operations. This is an asynchronous operation that returns a + * status of 202 until the template deployment is successfully deleted. The Location response header + * contains the URI that is used to obtain the status of the process. While the process is running, a + * call to the URI in the Location header returns a status of 202. When the process finishes, the URI + * in the Location header returns a status of 204 on success. If the asynchronous request failed, the + * URI in the Location header returns an error-level status code. + * @param groupId The management group ID. * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - checkExistenceAtSubscriptionScope( + async beginDeleteAtManagementGroupScopeAndWait( + groupId: string, deploymentName: string, - options?: msRest.RequestOptionsBase - ): Promise; + options?: DeploymentsDeleteAtManagementGroupScopeOptionalParams + ): Promise { + const poller = await this.beginDeleteAtManagementGroupScope( + groupId, + deploymentName, + options + ); + return poller.pollUntilDone(); + } + /** + * Checks whether the deployment exists. + * @param groupId The management group ID. * @param deploymentName The name of the deployment. - * @param callback The callback + * @param options The options parameters. */ - checkExistenceAtSubscriptionScope( + checkExistenceAtManagementGroupScope( + groupId: string, deploymentName: string, - callback: msRest.ServiceCallback - ): void; + options?: DeploymentsCheckExistenceAtManagementGroupScopeOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { groupId, deploymentName, options }, + checkExistenceAtManagementGroupScopeOperationSpec + ); + } + /** + * You can provide the template and parameters directly in the request or link to JSON files. + * @param groupId The management group ID. * @param deploymentName The name of the deployment. - * @param options The optional parameters - * @param callback The callback + * @param parameters Additional parameters supplied to the operation. + * @param options The options parameters. */ - checkExistenceAtSubscriptionScope( - deploymentName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - checkExistenceAtSubscriptionScope( + async beginCreateOrUpdateAtManagementGroupScope( + groupId: string, deploymentName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - deploymentName, - options - }, - checkExistenceAtSubscriptionScopeOperationSpec, - callback - ) as Promise; + parameters: ScopedDeployment, + options?: DeploymentsCreateOrUpdateAtManagementGroupScopeOptionalParams + ): Promise< + PollerLike< + PollOperationState< + DeploymentsCreateOrUpdateAtManagementGroupScopeResponse + >, + DeploymentsCreateOrUpdateAtManagementGroupScopeResponse + > + > { + 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 CoreClientLro( + sendOperation, + { groupId, deploymentName, parameters, options }, + createOrUpdateAtManagementGroupScopeOperationSpec + ); + return new LroEngine(lro, { intervalInMs: options?.updateIntervalInMs }); } /** * You can provide the template and parameters directly in the request or link to JSON files. - * @summary Deploys resources at subscription scope. + * @param groupId The management group ID. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdateAtSubscriptionScope( + async beginCreateOrUpdateAtManagementGroupScopeAndWait( + groupId: string, deploymentName: string, - parameters: Models.Deployment, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginCreateOrUpdateAtSubscriptionScope( + parameters: ScopedDeployment, + options?: DeploymentsCreateOrUpdateAtManagementGroupScopeOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdateAtManagementGroupScope( + groupId, deploymentName, parameters, options - ).then((lroPoller) => lroPoller.pollUntilFinished()) as Promise< - Models.DeploymentsCreateOrUpdateAtSubscriptionScopeResponse - >; + ); + return poller.pollUntilDone(); } /** * Gets a deployment. + * @param groupId The management group ID. * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise - */ - getAtSubscriptionScope( - deploymentName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param deploymentName The name of the deployment. - * @param callback The callback - */ - getAtSubscriptionScope( - deploymentName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param deploymentName The name of the deployment. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - getAtSubscriptionScope( - deploymentName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getAtSubscriptionScope( + getAtManagementGroupScope( + groupId: string, deploymentName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: DeploymentsGetAtManagementGroupScopeOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deploymentName, - options - }, - getAtSubscriptionScopeOperationSpec, - callback - ) as Promise; + { groupId, deploymentName, options }, + getAtManagementGroupScopeOperationSpec + ); } /** * You can cancel a deployment only if the provisioningState is Accepted or Running. After the - * deployment is canceled, the provisioningState is set to Canceled. Canceling a template - * deployment stops the currently running template deployment and leaves the resources partially - * deployed. - * @summary Cancels a currently running template deployment. - * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise - */ - cancelAtSubscriptionScope( - deploymentName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param deploymentName The name of the deployment. - * @param callback The callback - */ - cancelAtSubscriptionScope(deploymentName: string, callback: msRest.ServiceCallback): void; - /** + * deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment + * stops the currently running template deployment and leaves the resources partially deployed. + * @param groupId The management group ID. * @param deploymentName The name of the deployment. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - cancelAtSubscriptionScope( - deploymentName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - cancelAtSubscriptionScope( + cancelAtManagementGroupScope( + groupId: string, deploymentName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: DeploymentsCancelAtManagementGroupScopeOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deploymentName, - options - }, - cancelAtSubscriptionScopeOperationSpec, - callback + { groupId, deploymentName, options }, + cancelAtManagementGroupScopeOperationSpec ); } /** * Validates whether the specified template is syntactically correct and will be accepted by Azure * Resource Manager.. + * @param groupId The management group ID. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - validateAtSubscriptionScope( + async beginValidateAtManagementGroupScope( + groupId: string, deploymentName: string, - parameters: Models.Deployment, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginValidateAtSubscriptionScope( - deploymentName, - parameters, - options - ).then((lroPoller) => lroPoller.pollUntilFinished()) as Promise< - Models.DeploymentsValidateAtSubscriptionScopeResponse - >; + parameters: ScopedDeployment, + options?: DeploymentsValidateAtManagementGroupScopeOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeploymentsValidateAtManagementGroupScopeResponse + > + > { + 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 CoreClientLro( + sendOperation, + { groupId, deploymentName, parameters, options }, + validateAtManagementGroupScopeOperationSpec + ); + return new LroEngine(lro, { intervalInMs: options?.updateIntervalInMs }); } /** - * Returns changes that will be made by the deployment if executed at the scope of the - * subscription. + * Validates whether the specified template is syntactically correct and will be accepted by Azure + * Resource Manager.. + * @param groupId The management group ID. * @param deploymentName The name of the deployment. - * @param parameters Parameters to What If. - * @param [options] The optional parameters - * @returns Promise + * @param parameters Parameters to validate. + * @param options The options parameters. */ - whatIfAtSubscriptionScope( + async beginValidateAtManagementGroupScopeAndWait( + groupId: string, deploymentName: string, - parameters: Models.DeploymentWhatIf, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginWhatIfAtSubscriptionScope( + parameters: ScopedDeployment, + options?: DeploymentsValidateAtManagementGroupScopeOptionalParams + ): Promise { + const poller = await this.beginValidateAtManagementGroupScope( + groupId, deploymentName, parameters, options - ).then((lroPoller) => lroPoller.pollUntilFinished()) as Promise< - Models.DeploymentsWhatIfAtSubscriptionScopeResponse - >; + ); + return poller.pollUntilDone(); } /** - * Exports the template used for specified deployment. + * Returns changes that will be made by the deployment if executed at the scope of the management + * group. + * @param groupId The management group ID. * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise + * @param parameters Parameters to validate. + * @param options The options parameters. */ - exportTemplateAtSubscriptionScope( + async beginWhatIfAtManagementGroupScope( + groupId: string, deploymentName: string, - options?: msRest.RequestOptionsBase - ): Promise; + parameters: ScopedDeploymentWhatIf, + options?: DeploymentsWhatIfAtManagementGroupScopeOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeploymentsWhatIfAtManagementGroupScopeResponse + > + > { + 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 CoreClientLro( + sendOperation, + { groupId, deploymentName, parameters, options }, + whatIfAtManagementGroupScopeOperationSpec, + "location" + ); + return new LroEngine(lro, { intervalInMs: options?.updateIntervalInMs }); + } + /** + * Returns changes that will be made by the deployment if executed at the scope of the management + * group. + * @param groupId The management group ID. * @param deploymentName The name of the deployment. - * @param callback The callback + * @param parameters Parameters to validate. + * @param options The options parameters. */ - exportTemplateAtSubscriptionScope( + async beginWhatIfAtManagementGroupScopeAndWait( + groupId: string, deploymentName: string, - callback: msRest.ServiceCallback - ): void; + parameters: ScopedDeploymentWhatIf, + options?: DeploymentsWhatIfAtManagementGroupScopeOptionalParams + ): Promise { + const poller = await this.beginWhatIfAtManagementGroupScope( + groupId, + deploymentName, + parameters, + options + ); + return poller.pollUntilDone(); + } + /** + * Exports the template used for specified deployment. + * @param groupId The management group ID. * @param deploymentName The name of the deployment. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - exportTemplateAtSubscriptionScope( - deploymentName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - exportTemplateAtSubscriptionScope( + exportTemplateAtManagementGroupScope( + groupId: string, deploymentName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: DeploymentsExportTemplateAtManagementGroupScopeOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deploymentName, - options - }, - exportTemplateAtSubscriptionScopeOperationSpec, - callback - ) as Promise; + { groupId, deploymentName, options }, + exportTemplateAtManagementGroupScopeOperationSpec + ); } /** - * Get all the deployments for a subscription. - * @param [options] The optional parameters - * @returns Promise - */ - listAtSubscriptionScope( - options?: Models.DeploymentsListAtSubscriptionScopeOptionalParams - ): Promise; - /** - * @param callback The callback - */ - listAtSubscriptionScope(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - listAtSubscriptionScope( - options: Models.DeploymentsListAtSubscriptionScopeOptionalParams, - callback: msRest.ServiceCallback - ): void; - listAtSubscriptionScope( - options?: - | Models.DeploymentsListAtSubscriptionScopeOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - options - }, - listAtSubscriptionScopeOperationSpec, - callback - ) as Promise; - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template - * deployment removes the associated deployment operations. Deleting a template deployment does not - * affect the state of the resource group. This is an asynchronous operation that returns a status - * of 202 until the template deployment is successfully deleted. The Location response header - * contains the URI that is used to obtain the status of the process. While the process is running, - * a call to the URI in the Location header returns a status of 202. When the process finishes, the - * URI in the Location header returns a status of 204 on success. If the asynchronous request - * failed, the URI in the Location header returns an error-level status code. - * @summary Deletes a deployment from the deployment history. - * @param resourceGroupName The name of the resource group with the deployment to delete. The name - * is case insensitive. - * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise + * Get all the deployments for a management group. + * @param groupId The management group ID. + * @param options The options parameters. */ - deleteMethod( - resourceGroupName: string, - deploymentName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginDeleteMethod(resourceGroupName, deploymentName, options).then((lroPoller) => - lroPoller.pollUntilFinished() + private _listAtManagementGroupScope( + groupId: string, + options?: DeploymentsListAtManagementGroupScopeOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { groupId, options }, + listAtManagementGroupScopeOperationSpec ); } /** - * Checks whether the deployment exists. - * @param resourceGroupName The name of the resource group with the deployment to check. The name - * is case insensitive. - * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise - */ - checkExistence( - resourceGroupName: string, - deploymentName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName The name of the resource group with the deployment to check. The name - * is case insensitive. - * @param deploymentName The name of the deployment. - * @param callback The callback - */ - checkExistence( - resourceGroupName: string, - deploymentName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceGroupName The name of the resource group with the deployment to check. The name - * is case insensitive. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment + * removes the associated deployment operations. This is an asynchronous operation that returns a + * status of 202 until the template deployment is successfully deleted. The Location response header + * contains the URI that is used to obtain the status of the process. While the process is running, a + * call to the URI in the Location header returns a status of 202. When the process finishes, the URI + * in the Location header returns a status of 204 on success. If the asynchronous request failed, the + * URI in the Location header returns an error-level status code. * @param deploymentName The name of the deployment. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - checkExistence( - resourceGroupName: string, - deploymentName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - checkExistence( - resourceGroupName: string, + async beginDeleteAtSubscriptionScope( deploymentName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - deploymentName, - options - }, - checkExistenceOperationSpec, - callback - ) as Promise; + options?: DeploymentsDeleteAtSubscriptionScopeOptionalParams + ): 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 CoreClientLro( + sendOperation, + { deploymentName, options }, + deleteAtSubscriptionScopeOperationSpec + ); + return new LroEngine(lro, { intervalInMs: options?.updateIntervalInMs }); } /** - * You can provide the template and parameters directly in the request or link to JSON files. - * @summary Deploys resources to a resource group. - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is - * case insensitive. The resource group must already exist. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment + * removes the associated deployment operations. This is an asynchronous operation that returns a + * status of 202 until the template deployment is successfully deleted. The Location response header + * contains the URI that is used to obtain the status of the process. While the process is running, a + * call to the URI in the Location header returns a status of 202. When the process finishes, the URI + * in the Location header returns a status of 204 on success. If the asynchronous request failed, the + * URI in the Location header returns an error-level status code. * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdate( - resourceGroupName: string, + async beginDeleteAtSubscriptionScopeAndWait( deploymentName: string, - parameters: Models.Deployment, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginCreateOrUpdate( - resourceGroupName, + options?: DeploymentsDeleteAtSubscriptionScopeOptionalParams + ): Promise { + const poller = await this.beginDeleteAtSubscriptionScope( deploymentName, - parameters, options - ).then((lroPoller) => lroPoller.pollUntilFinished()) as Promise< - Models.DeploymentsCreateOrUpdateResponse - >; + ); + return poller.pollUntilDone(); } /** - * Gets a deployment. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise - */ - get( - resourceGroupName: string, - deploymentName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * Checks whether the deployment exists. * @param deploymentName The name of the deployment. - * @param callback The callback + * @param options The options parameters. */ - get( - resourceGroupName: string, + checkExistenceAtSubscriptionScope( deploymentName: string, - callback: msRest.ServiceCallback - ): void; + options?: DeploymentsCheckExistenceAtSubscriptionScopeOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deploymentName, options }, + checkExistenceAtSubscriptionScopeOperationSpec + ); + } + /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * You can provide the template and parameters directly in the request or link to JSON files. * @param deploymentName The name of the deployment. - * @param options The optional parameters - * @param callback The callback + * @param parameters Additional parameters supplied to the operation. + * @param options The options parameters. */ - get( - resourceGroupName: string, - deploymentName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - get( - resourceGroupName: string, + async beginCreateOrUpdateAtSubscriptionScope( deploymentName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - deploymentName, - options - }, - getOperationSpec, - callback - ) as Promise; + parameters: Deployment, + options?: DeploymentsCreateOrUpdateAtSubscriptionScopeOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeploymentsCreateOrUpdateAtSubscriptionScopeResponse + > + > { + 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 CoreClientLro( + sendOperation, + { deploymentName, parameters, options }, + createOrUpdateAtSubscriptionScopeOperationSpec + ); + return new LroEngine(lro, { intervalInMs: options?.updateIntervalInMs }); } /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the - * deployment is canceled, the provisioningState is set to Canceled. Canceling a template - * deployment stops the currently running template deployment and leaves the resource group - * partially deployed. - * @summary Cancels a currently running template deployment. - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * You can provide the template and parameters directly in the request or link to JSON files. * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise + * @param parameters Additional parameters supplied to the operation. + * @param options The options parameters. */ - cancel( - resourceGroupName: string, + async beginCreateOrUpdateAtSubscriptionScopeAndWait( deploymentName: string, - options?: msRest.RequestOptionsBase - ): Promise; + parameters: Deployment, + options?: DeploymentsCreateOrUpdateAtSubscriptionScopeOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdateAtSubscriptionScope( + deploymentName, + parameters, + options + ); + return poller.pollUntilDone(); + } + /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * Gets a deployment. * @param deploymentName The name of the deployment. - * @param callback The callback + * @param options The options parameters. */ - cancel( - resourceGroupName: string, + getAtSubscriptionScope( deploymentName: string, - callback: msRest.ServiceCallback - ): void; + options?: DeploymentsGetAtSubscriptionScopeOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deploymentName, options }, + getAtSubscriptionScopeOperationSpec + ); + } + /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * You can cancel a deployment only if the provisioningState is Accepted or Running. After the + * deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment + * stops the currently running template deployment and leaves the resources partially deployed. * @param deploymentName The name of the deployment. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - cancel( - resourceGroupName: string, - deploymentName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - cancel( - resourceGroupName: string, + cancelAtSubscriptionScope( deploymentName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: DeploymentsCancelAtSubscriptionScopeOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - deploymentName, - options - }, - cancelOperationSpec, - callback + { deploymentName, options }, + cancelAtSubscriptionScopeOperationSpec ); } /** * Validates whether the specified template is syntactically correct and will be accepted by Azure * Resource Manager.. - * @param resourceGroupName The name of the resource group the template will be deployed to. The - * name is case insensitive. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - validate( - resourceGroupName: string, + async beginValidateAtSubscriptionScope( deploymentName: string, - parameters: Models.Deployment, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginValidate( - resourceGroupName, - deploymentName, - parameters, - options - ).then((lroPoller) => lroPoller.pollUntilFinished()) as Promise< - Models.DeploymentsValidateResponse - >; + parameters: Deployment, + options?: DeploymentsValidateAtSubscriptionScopeOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeploymentsValidateAtSubscriptionScopeResponse + > + > { + 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 CoreClientLro( + sendOperation, + { deploymentName, parameters, options }, + validateAtSubscriptionScopeOperationSpec + ); + return new LroEngine(lro, { intervalInMs: options?.updateIntervalInMs }); } /** - * Returns changes that will be made by the deployment if executed at the scope of the resource - * group. - * @param resourceGroupName The name of the resource group the template will be deployed to. The - * name is case insensitive. + * Validates whether the specified template is syntactically correct and will be accepted by Azure + * Resource Manager.. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - whatIf( - resourceGroupName: string, + async beginValidateAtSubscriptionScopeAndWait( deploymentName: string, - parameters: Models.DeploymentWhatIf, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginWhatIf( - resourceGroupName, + parameters: Deployment, + options?: DeploymentsValidateAtSubscriptionScopeOptionalParams + ): Promise { + const poller = await this.beginValidateAtSubscriptionScope( deploymentName, parameters, options - ).then((lroPoller) => lroPoller.pollUntilFinished()) as Promise< - Models.DeploymentsWhatIfResponse - >; + ); + return poller.pollUntilDone(); } /** - * Exports the template used for specified deployment. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise - */ - exportTemplate( - resourceGroupName: string, - deploymentName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * Returns changes that will be made by the deployment if executed at the scope of the subscription. * @param deploymentName The name of the deployment. - * @param callback The callback + * @param parameters Parameters to What If. + * @param options The options parameters. */ - exportTemplate( - resourceGroupName: string, + async beginWhatIfAtSubscriptionScope( deploymentName: string, - callback: msRest.ServiceCallback - ): void; + parameters: DeploymentWhatIf, + options?: DeploymentsWhatIfAtSubscriptionScopeOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeploymentsWhatIfAtSubscriptionScopeResponse + > + > { + 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 CoreClientLro( + sendOperation, + { deploymentName, parameters, options }, + whatIfAtSubscriptionScopeOperationSpec, + "location" + ); + return new LroEngine(lro, { intervalInMs: options?.updateIntervalInMs }); + } + /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * Returns changes that will be made by the deployment if executed at the scope of the subscription. * @param deploymentName The name of the deployment. - * @param options The optional parameters - * @param callback The callback + * @param parameters Parameters to What If. + * @param options The options parameters. */ - exportTemplate( - resourceGroupName: string, - deploymentName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - exportTemplate( - resourceGroupName: string, + async beginWhatIfAtSubscriptionScopeAndWait( deploymentName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - deploymentName, - options - }, - exportTemplateOperationSpec, - callback - ) as Promise; + parameters: DeploymentWhatIf, + options?: DeploymentsWhatIfAtSubscriptionScopeOptionalParams + ): Promise { + const poller = await this.beginWhatIfAtSubscriptionScope( + deploymentName, + parameters, + options + ); + return poller.pollUntilDone(); } /** - * Get all the deployments for a resource group. - * @param resourceGroupName The name of the resource group with the deployments to get. The name is - * case insensitive. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroup( - resourceGroupName: string, - options?: Models.DeploymentsListByResourceGroupOptionalParams - ): Promise; - /** - * @param resourceGroupName The name of the resource group with the deployments to get. The name is - * case insensitive. - * @param callback The callback - */ - listByResourceGroup( - resourceGroupName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceGroupName The name of the resource group with the deployments to get. The name is - * case insensitive. - * @param options The optional parameters - * @param callback The callback + * Exports the template used for specified deployment. + * @param deploymentName The name of the deployment. + * @param options The options parameters. */ - listByResourceGroup( - resourceGroupName: string, - options: Models.DeploymentsListByResourceGroupOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByResourceGroup( - resourceGroupName: string, - options?: - | Models.DeploymentsListByResourceGroupOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + exportTemplateAtSubscriptionScope( + deploymentName: string, + options?: DeploymentsExportTemplateAtSubscriptionScopeOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - options - }, - listByResourceGroupOperationSpec, - callback - ) as Promise; + { deploymentName, options }, + exportTemplateAtSubscriptionScopeOperationSpec + ); } /** - * Calculate the hash of the given template. - * @param template The template provided to calculate hash. - * @param [options] The optional parameters - * @returns Promise - */ - calculateTemplateHash( - template: any, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param template The template provided to calculate hash. - * @param callback The callback - */ - calculateTemplateHash( - template: any, - callback: msRest.ServiceCallback - ): void; - /** - * @param template The template provided to calculate hash. - * @param options The optional parameters - * @param callback The callback + * Get all the deployments for a subscription. + * @param options The options parameters. */ - calculateTemplateHash( - template: any, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - calculateTemplateHash( - template: any, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listAtSubscriptionScope( + options?: DeploymentsListAtSubscriptionScopeOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - template, - options - }, - calculateTemplateHashOperationSpec, - callback - ) as Promise; + { options }, + listAtSubscriptionScopeOperationSpec + ); } /** - * A template deployment that is currently running cannot be deleted. Deleting a template - * deployment removes the associated deployment operations. This is an asynchronous operation that - * returns a status of 202 until the template deployment is successfully deleted. The Location - * response header contains the URI that is used to obtain the status of the process. While the - * process is running, a call to the URI in the Location header returns a status of 202. When the - * process finishes, the URI in the Location header returns a status of 204 on success. If the - * asynchronous request failed, the URI in the Location header returns an error-level status code. - * @summary Deletes a deployment from the deployment history. - * @param scope The resource scope. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment + * removes the associated deployment operations. Deleting a template deployment does not affect the + * state of the resource group. This is an asynchronous operation that returns a status of 202 until + * the template deployment is successfully deleted. The Location response header contains the URI that + * is used to obtain the status of the process. While the process is running, a call to the URI in the + * Location header returns a status of 202. When the process finishes, the URI in the Location header + * returns a status of 204 on success. If the asynchronous request failed, the URI in the Location + * header returns an error-level status code. + * @param resourceGroupName The name of the resource group with the deployment to delete. The name is + * case insensitive. * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteAtScope( - scope: string, + async beginDelete( + resourceGroupName: string, deploymentName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - scope, - deploymentName, - options - }, - beginDeleteAtScopeOperationSpec, - options + options?: DeploymentsDeleteOptionalParams + ): 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 CoreClientLro( + sendOperation, + { resourceGroupName, deploymentName, options }, + deleteOperationSpec ); + return new LroEngine(lro, { intervalInMs: options?.updateIntervalInMs }); } /** - * You can provide the template and parameters directly in the request or link to JSON files. - * @summary Deploys resources at a given scope. - * @param scope The resource scope. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment + * removes the associated deployment operations. Deleting a template deployment does not affect the + * state of the resource group. This is an asynchronous operation that returns a status of 202 until + * the template deployment is successfully deleted. The Location response header contains the URI that + * is used to obtain the status of the process. While the process is running, a call to the URI in the + * Location header returns a status of 202. When the process finishes, the URI in the Location header + * returns a status of 204 on success. If the asynchronous request failed, the URI in the Location + * header returns an error-level status code. + * @param resourceGroupName The name of the resource group with the deployment to delete. The name is + * case insensitive. * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginCreateOrUpdateAtScope( - scope: string, + async beginDeleteAndWait( + resourceGroupName: string, deploymentName: string, - parameters: Models.Deployment, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - scope, - deploymentName, - parameters, - options - }, - beginCreateOrUpdateAtScopeOperationSpec, + options?: DeploymentsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + deploymentName, options ); + return poller.pollUntilDone(); } /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure - * Resource Manager.. - * @param scope The resource scope. + * Checks whether the deployment exists. + * @param resourceGroupName The name of the resource group with the deployment to check. The name is + * case insensitive. * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginValidateAtScope( - scope: string, + checkExistence( + resourceGroupName: string, deploymentName: string, - parameters: Models.Deployment, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - scope, - deploymentName, - parameters, - options - }, - beginValidateAtScopeOperationSpec, - options + options?: DeploymentsCheckExistenceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, deploymentName, options }, + checkExistenceOperationSpec ); } /** - * A template deployment that is currently running cannot be deleted. Deleting a template - * deployment removes the associated deployment operations. This is an asynchronous operation that - * returns a status of 202 until the template deployment is successfully deleted. The Location - * response header contains the URI that is used to obtain the status of the process. While the - * process is running, a call to the URI in the Location header returns a status of 202. When the - * process finishes, the URI in the Location header returns a status of 204 on success. If the - * asynchronous request failed, the URI in the Location header returns an error-level status code. - * @summary Deletes a deployment from the deployment history. + * You can provide the template and parameters directly in the request or link to JSON files. + * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case + * insensitive. The resource group must already exist. * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise + * @param parameters Additional parameters supplied to the operation. + * @param options The options parameters. */ - beginDeleteAtTenantScope( + async beginCreateOrUpdate( + resourceGroupName: string, deploymentName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - deploymentName, - options - }, - beginDeleteAtTenantScopeOperationSpec, - options + parameters: Deployment, + options?: DeploymentsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeploymentsCreateOrUpdateResponse + > + > { + 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 CoreClientLro( + sendOperation, + { resourceGroupName, deploymentName, parameters, options }, + createOrUpdateOperationSpec ); + return new LroEngine(lro, { intervalInMs: options?.updateIntervalInMs }); } /** * You can provide the template and parameters directly in the request or link to JSON files. - * @summary Deploys resources at tenant scope. + * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case + * insensitive. The resource group must already exist. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginCreateOrUpdateAtTenantScope( + async beginCreateOrUpdateAndWait( + resourceGroupName: string, deploymentName: string, - parameters: Models.ScopedDeployment, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - deploymentName, - parameters, - options - }, - beginCreateOrUpdateAtTenantScopeOperationSpec, + parameters: Deployment, + options?: DeploymentsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + deploymentName, + parameters, options ); + return poller.pollUntilDone(); } /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure - * Resource Manager.. + * Gets a deployment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginValidateAtTenantScope( + get( + resourceGroupName: string, deploymentName: string, - parameters: Models.ScopedDeployment, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - deploymentName, - parameters, - options - }, - beginValidateAtTenantScopeOperationSpec, - options + options?: DeploymentsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, deploymentName, options }, + getOperationSpec ); } /** - * Returns changes that will be made by the deployment if executed at the scope of the tenant - * group. + * You can cancel a deployment only if the provisioningState is Accepted or Running. After the + * deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment + * stops the currently running template deployment and leaves the resource group partially deployed. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginWhatIfAtTenantScope( + cancel( + resourceGroupName: string, deploymentName: string, - parameters: Models.ScopedDeploymentWhatIf, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - deploymentName, - parameters, - options - }, - beginWhatIfAtTenantScopeOperationSpec, - options + options?: DeploymentsCancelOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, deploymentName, options }, + cancelOperationSpec ); } /** - * A template deployment that is currently running cannot be deleted. Deleting a template - * deployment removes the associated deployment operations. This is an asynchronous operation that - * returns a status of 202 until the template deployment is successfully deleted. The Location - * response header contains the URI that is used to obtain the status of the process. While the - * process is running, a call to the URI in the Location header returns a status of 202. When the - * process finishes, the URI in the Location header returns a status of 204 on success. If the - * asynchronous request failed, the URI in the Location header returns an error-level status code. - * @summary Deletes a deployment from the deployment history. - * @param groupId The management group ID. + * Validates whether the specified template is syntactically correct and will be accepted by Azure + * Resource Manager.. + * @param resourceGroupName The name of the resource group the template will be deployed to. The name + * is case insensitive. * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise + * @param parameters Parameters to validate. + * @param options The options parameters. */ - beginDeleteAtManagementGroupScope( - groupId: string, + async beginValidate( + resourceGroupName: string, deploymentName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - groupId, - deploymentName, - options - }, - beginDeleteAtManagementGroupScopeOperationSpec, - options + parameters: Deployment, + options?: DeploymentsValidateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeploymentsValidateResponse + > + > { + 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 CoreClientLro( + sendOperation, + { resourceGroupName, deploymentName, parameters, options }, + validateOperationSpec ); + return new LroEngine(lro, { intervalInMs: options?.updateIntervalInMs }); } /** - * You can provide the template and parameters directly in the request or link to JSON files. - * @summary Deploys resources at management group scope. - * @param groupId The management group ID. + * Validates whether the specified template is syntactically correct and will be accepted by Azure + * Resource Manager.. + * @param resourceGroupName The name of the resource group the template will be deployed to. The name + * is case insensitive. * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param [options] The optional parameters - * @returns Promise + * @param parameters Parameters to validate. + * @param options The options parameters. */ - beginCreateOrUpdateAtManagementGroupScope( - groupId: string, + async beginValidateAndWait( + resourceGroupName: string, deploymentName: string, - parameters: Models.ScopedDeployment, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - groupId, - deploymentName, - parameters, - options - }, - beginCreateOrUpdateAtManagementGroupScopeOperationSpec, + parameters: Deployment, + options?: DeploymentsValidateOptionalParams + ): Promise { + const poller = await this.beginValidate( + resourceGroupName, + deploymentName, + parameters, options ); + return poller.pollUntilDone(); } /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure - * Resource Manager.. - * @param groupId The management group ID. + * Returns changes that will be made by the deployment if executed at the scope of the resource group. + * @param resourceGroupName The name of the resource group the template will be deployed to. The name + * is case insensitive. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginValidateAtManagementGroupScope( - groupId: string, + async beginWhatIf( + resourceGroupName: string, deploymentName: string, - parameters: Models.ScopedDeployment, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - groupId, - deploymentName, - parameters, - options - }, - beginValidateAtManagementGroupScopeOperationSpec, - options + parameters: DeploymentWhatIf, + options?: DeploymentsWhatIfOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeploymentsWhatIfResponse + > + > { + 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 CoreClientLro( + sendOperation, + { resourceGroupName, deploymentName, parameters, options }, + whatIfOperationSpec, + "location" ); + return new LroEngine(lro, { intervalInMs: options?.updateIntervalInMs }); } /** - * Returns changes that will be made by the deployment if executed at the scope of the management - * group. - * @param groupId The management group ID. + * Returns changes that will be made by the deployment if executed at the scope of the resource group. + * @param resourceGroupName The name of the resource group the template will be deployed to. The name + * is case insensitive. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginWhatIfAtManagementGroupScope( - groupId: string, + async beginWhatIfAndWait( + resourceGroupName: string, deploymentName: string, - parameters: Models.ScopedDeploymentWhatIf, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - groupId, - deploymentName, - parameters, - options - }, - beginWhatIfAtManagementGroupScopeOperationSpec, + parameters: DeploymentWhatIf, + options?: DeploymentsWhatIfOptionalParams + ): Promise { + const poller = await this.beginWhatIf( + resourceGroupName, + deploymentName, + parameters, options ); + return poller.pollUntilDone(); } /** - * A template deployment that is currently running cannot be deleted. Deleting a template - * deployment removes the associated deployment operations. This is an asynchronous operation that - * returns a status of 202 until the template deployment is successfully deleted. The Location - * response header contains the URI that is used to obtain the status of the process. While the - * process is running, a call to the URI in the Location header returns a status of 202. When the - * process finishes, the URI in the Location header returns a status of 204 on success. If the - * asynchronous request failed, the URI in the Location header returns an error-level status code. - * @summary Deletes a deployment from the deployment history. + * Exports the template used for specified deployment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteAtSubscriptionScope( + exportTemplate( + resourceGroupName: string, deploymentName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - deploymentName, - options - }, - beginDeleteAtSubscriptionScopeOperationSpec, - options + options?: DeploymentsExportTemplateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, deploymentName, options }, + exportTemplateOperationSpec ); } /** - * You can provide the template and parameters directly in the request or link to JSON files. - * @summary Deploys resources at subscription scope. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param [options] The optional parameters - * @returns Promise - */ - beginCreateOrUpdateAtSubscriptionScope( - deploymentName: string, - parameters: Models.Deployment, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - deploymentName, - parameters, - options - }, - beginCreateOrUpdateAtSubscriptionScopeOperationSpec, - options + * Get all the deployments for a resource group. + * @param resourceGroupName The name of the resource group with the deployments to get. The name is + * case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: DeploymentsListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec ); } /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure - * Resource Manager.. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param [options] The optional parameters - * @returns Promise + * Calculate the hash of the given template. + * @param template The template provided to calculate hash. + * @param options The options parameters. */ - beginValidateAtSubscriptionScope( - deploymentName: string, - parameters: Models.Deployment, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - deploymentName, - parameters, - options - }, - beginValidateAtSubscriptionScopeOperationSpec, - options + calculateTemplateHash( + template: Record, + options?: DeploymentsCalculateTemplateHashOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { template, options }, + calculateTemplateHashOperationSpec ); } /** - * Returns changes that will be made by the deployment if executed at the scope of the - * subscription. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to What If. - * @param [options] The optional parameters - * @returns Promise + * ListAtScopeNext + * @param scope The resource scope. + * @param nextLink The nextLink from the previous successful call to the ListAtScope method. + * @param options The options parameters. */ - beginWhatIfAtSubscriptionScope( - deploymentName: string, - parameters: Models.DeploymentWhatIf, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - deploymentName, - parameters, - options - }, - beginWhatIfAtSubscriptionScopeOperationSpec, - options + private _listAtScopeNext( + scope: string, + nextLink: string, + options?: DeploymentsListAtScopeNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, nextLink, options }, + listAtScopeNextOperationSpec ); } /** - * A template deployment that is currently running cannot be deleted. Deleting a template - * deployment removes the associated deployment operations. Deleting a template deployment does not - * affect the state of the resource group. This is an asynchronous operation that returns a status - * of 202 until the template deployment is successfully deleted. The Location response header - * contains the URI that is used to obtain the status of the process. While the process is running, - * a call to the URI in the Location header returns a status of 202. When the process finishes, the - * URI in the Location header returns a status of 204 on success. If the asynchronous request - * failed, the URI in the Location header returns an error-level status code. - * @summary Deletes a deployment from the deployment history. - * @param resourceGroupName The name of the resource group with the deployment to delete. The name - * is case insensitive. - * @param deploymentName The name of the deployment. - * @param [options] The optional parameters - * @returns Promise + * ListAtTenantScopeNext + * @param nextLink The nextLink from the previous successful call to the ListAtTenantScope method. + * @param options The options parameters. */ - beginDeleteMethod( - resourceGroupName: string, - deploymentName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - deploymentName, - options - }, - beginDeleteMethodOperationSpec, - options + private _listAtTenantScopeNext( + nextLink: string, + options?: DeploymentsListAtTenantScopeNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listAtTenantScopeNextOperationSpec ); } /** - * You can provide the template and parameters directly in the request or link to JSON files. - * @summary Deploys resources to a resource group. - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is - * case insensitive. The resource group must already exist. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param [options] The optional parameters - * @returns Promise + * ListAtManagementGroupScopeNext + * @param groupId The management group ID. + * @param nextLink The nextLink from the previous successful call to the ListAtManagementGroupScope + * method. + * @param options The options parameters. */ - beginCreateOrUpdate( - resourceGroupName: string, - deploymentName: string, - parameters: Models.Deployment, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - deploymentName, - parameters, - options - }, - beginCreateOrUpdateOperationSpec, - options + private _listAtManagementGroupScopeNext( + groupId: string, + nextLink: string, + options?: DeploymentsListAtManagementGroupScopeNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { groupId, nextLink, options }, + listAtManagementGroupScopeNextOperationSpec ); } /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure - * Resource Manager.. - * @param resourceGroupName The name of the resource group the template will be deployed to. The - * name is case insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param [options] The optional parameters - * @returns Promise + * ListAtSubscriptionScopeNext + * @param nextLink The nextLink from the previous successful call to the ListAtSubscriptionScope + * method. + * @param options The options parameters. */ - beginValidate( - resourceGroupName: string, - deploymentName: string, - parameters: Models.Deployment, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - deploymentName, - parameters, - options - }, - beginValidateOperationSpec, - options + private _listAtSubscriptionScopeNext( + nextLink: string, + options?: DeploymentsListAtSubscriptionScopeNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listAtSubscriptionScopeNextOperationSpec ); } /** - * Returns changes that will be made by the deployment if executed at the scope of the resource - * group. - * @param resourceGroupName The name of the resource group the template will be deployed to. The - * name is case insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param [options] The optional parameters - * @returns Promise + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group with the deployments to get. The name is + * case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. */ - beginWhatIf( + private _listByResourceGroupNext( resourceGroupName: string, - deploymentName: string, - parameters: Models.DeploymentWhatIf, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - deploymentName, - parameters, - options - }, - beginWhatIfOperationSpec, - options + nextLink: string, + options?: DeploymentsListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec ); } /** - * Get all the deployments at the given scope. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listAtScopeNext( - nextPageLink: string, - options?: Models.DeploymentsListAtScopeNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listAtScopeNext( - 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 - */ - listAtScopeNext( - nextPageLink: string, - options: Models.DeploymentsListAtScopeNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listAtScopeNext( - nextPageLink: string, - options?: - | Models.DeploymentsListAtScopeNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + * ListAtScopeNextNext + * @param scope The resource scope. + * @param nextLink The nextLink from the previous successful call to the ListAtScopeNext method. + * @param options The options parameters. + */ + private _listAtScopeNextNext( + scope: string, + nextLink: string, + options?: DeploymentsListAtScopeNextNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listAtScopeNextOperationSpec, - callback - ) as Promise; + { scope, nextLink, options }, + listAtScopeNextNextOperationSpec + ); } /** - * Get all the deployments at the tenant scope. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listAtTenantScopeNext( - nextPageLink: string, - options?: Models.DeploymentsListAtTenantScopeNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listAtTenantScopeNext( - 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 - */ - listAtTenantScopeNext( - nextPageLink: string, - options: Models.DeploymentsListAtTenantScopeNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listAtTenantScopeNext( - nextPageLink: string, - options?: - | Models.DeploymentsListAtTenantScopeNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + * ListAtTenantScopeNextNext + * @param nextLink The nextLink from the previous successful call to the ListAtTenantScopeNext method. + * @param options The options parameters. + */ + private _listAtTenantScopeNextNext( + nextLink: string, + options?: DeploymentsListAtTenantScopeNextNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listAtTenantScopeNextOperationSpec, - callback - ) as Promise; + { nextLink, options }, + listAtTenantScopeNextNextOperationSpec + ); } /** - * Get all the deployments for a management group. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listAtManagementGroupScopeNext( - nextPageLink: string, - options?: Models.DeploymentsListAtManagementGroupScopeNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listAtManagementGroupScopeNext( - 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 - */ - listAtManagementGroupScopeNext( - nextPageLink: string, - options: Models.DeploymentsListAtManagementGroupScopeNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listAtManagementGroupScopeNext( - nextPageLink: string, - options?: - | Models.DeploymentsListAtManagementGroupScopeNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + * ListAtManagementGroupScopeNextNext + * @param groupId The management group ID. + * @param nextLink The nextLink from the previous successful call to the ListAtManagementGroupScopeNext + * method. + * @param options The options parameters. + */ + private _listAtManagementGroupScopeNextNext( + groupId: string, + nextLink: string, + options?: DeploymentsListAtManagementGroupScopeNextNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listAtManagementGroupScopeNextOperationSpec, - callback - ) as Promise; + { groupId, nextLink, options }, + listAtManagementGroupScopeNextNextOperationSpec + ); } /** - * Get all the deployments for a subscription. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listAtSubscriptionScopeNext( - nextPageLink: string, - options?: Models.DeploymentsListAtSubscriptionScopeNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listAtSubscriptionScopeNext( - 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 - */ - listAtSubscriptionScopeNext( - nextPageLink: string, - options: Models.DeploymentsListAtSubscriptionScopeNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listAtSubscriptionScopeNext( - nextPageLink: string, - options?: - | Models.DeploymentsListAtSubscriptionScopeNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + * ListAtSubscriptionScopeNextNext + * @param nextLink The nextLink from the previous successful call to the ListAtSubscriptionScopeNext + * method. + * @param options The options parameters. + */ + private _listAtSubscriptionScopeNextNext( + nextLink: string, + options?: DeploymentsListAtSubscriptionScopeNextNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listAtSubscriptionScopeNextOperationSpec, - callback - ) as Promise; + { nextLink, options }, + listAtSubscriptionScopeNextNextOperationSpec + ); } /** - * Get all the deployments for a 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?: Models.DeploymentsListByResourceGroupNextOptionalParams - ): 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: Models.DeploymentsListByResourceGroupNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByResourceGroupNext( - nextPageLink: string, - options?: - | Models.DeploymentsListByResourceGroupNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + * ListByResourceGroupNextNext + * @param resourceGroupName The name of the resource group with the deployments to get. The name is + * case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroupNext + * method. + * @param options The options parameters. + */ + private _listByResourceGroupNextNext( + resourceGroupName: string, + nextLink: string, + options?: DeploymentsListByResourceGroupNextNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByResourceGroupNextOperationSpec, - callback - ) as Promise; + { resourceGroupName, nextLink, options }, + listByResourceGroupNextNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const checkExistenceAtScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "HEAD", - path: "{scope}/providers/Microsoft.Resources/deployments/{deploymentName}", - urlParameters: [Parameters.scope, Parameters.deploymentName], +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const deleteAtScopeOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.$host, + Parameters.scope, + Parameters.deploymentName + ], + headerParameters: [Parameters.accept], + serializer +}; +const checkExistenceAtScopeOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}", + httpMethod: "HEAD", responses: { 204: {}, 404: {}, @@ -2439,15 +2955,49 @@ const checkExistenceAtScopeOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.scope, + Parameters.deploymentName + ], + headerParameters: [Parameters.accept], serializer }; - -const getAtScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "{scope}/providers/Microsoft.Resources/deployments/{deploymentName}", - urlParameters: [Parameters.scope, Parameters.deploymentName], +const createOrUpdateAtScopeOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.DeploymentExtended + }, + 201: { + bodyMapper: Mappers.DeploymentExtended + }, + 202: { + bodyMapper: Mappers.DeploymentExtended + }, + 204: { + bodyMapper: Mappers.DeploymentExtended + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.$host, + Parameters.scope, + Parameters.deploymentName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getAtScopeOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DeploymentExtended @@ -2456,30 +3006,70 @@ const getAtScopeOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.scope, + Parameters.deploymentName + ], + headerParameters: [Parameters.accept], serializer }; - -const cancelAtScopeOperationSpec: msRest.OperationSpec = { +const cancelAtScopeOperationSpec: coreClient.OperationSpec = { + path: + "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", httpMethod: "POST", - path: "{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", - urlParameters: [Parameters.scope, Parameters.deploymentName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 204: {}, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.scope, + Parameters.deploymentName + ], + headerParameters: [Parameters.accept], serializer }; - -const exportTemplateAtScopeOperationSpec: msRest.OperationSpec = { +const validateAtScopeOperationSpec: coreClient.OperationSpec = { + path: + "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", httpMethod: "POST", - path: "{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", - urlParameters: [Parameters.scope, Parameters.deploymentName], + responses: { + 200: { + bodyMapper: Mappers.DeploymentValidateResult + }, + 201: { + bodyMapper: Mappers.DeploymentValidateResult + }, + 202: { + bodyMapper: Mappers.DeploymentValidateResult + }, + 204: { + bodyMapper: Mappers.DeploymentValidateResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.$host, + Parameters.scope, + Parameters.deploymentName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const exportTemplateAtScopeOperationSpec: coreClient.OperationSpec = { + path: + "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", + httpMethod: "POST", responses: { 200: { bodyMapper: Mappers.DeploymentExportResult @@ -2488,15 +3078,18 @@ const exportTemplateAtScopeOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.scope, + Parameters.deploymentName + ], + headerParameters: [Parameters.accept], serializer }; - -const listAtScopeOperationSpec: msRest.OperationSpec = { +const listAtScopeOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Resources/deployments/", httpMethod: "GET", - path: "{scope}/providers/Microsoft.Resources/deployments/", - urlParameters: [Parameters.scope], - queryParameters: [Parameters.filter, Parameters.top, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.DeploymentListResult @@ -2505,15 +3098,31 @@ const listAtScopeOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept], serializer }; - -const checkExistenceAtTenantScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "HEAD", - path: "providers/Microsoft.Resources/deployments/{deploymentName}", - urlParameters: [Parameters.deploymentName], +const deleteAtTenantScopeOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Resources/deployments/{deploymentName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [Parameters.$host, Parameters.deploymentName], + headerParameters: [Parameters.accept], + serializer +}; +const checkExistenceAtTenantScopeOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Resources/deployments/{deploymentName}", + httpMethod: "HEAD", responses: { 204: {}, 404: {}, @@ -2521,15 +3130,41 @@ const checkExistenceAtTenantScopeOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.deploymentName], + headerParameters: [Parameters.accept], serializer }; - -const getAtTenantScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "providers/Microsoft.Resources/deployments/{deploymentName}", - urlParameters: [Parameters.deploymentName], +const createOrUpdateAtTenantScopeOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Resources/deployments/{deploymentName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.DeploymentExtended + }, + 201: { + bodyMapper: Mappers.DeploymentExtended + }, + 202: { + bodyMapper: Mappers.DeploymentExtended + }, + 204: { + bodyMapper: Mappers.DeploymentExtended + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.parameters1, queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [Parameters.$host, Parameters.deploymentName], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getAtTenantScopeOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Resources/deployments/{deploymentName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DeploymentExtended @@ -2538,30 +3173,83 @@ const getAtTenantScopeOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.deploymentName], + headerParameters: [Parameters.accept], serializer }; - -const cancelAtTenantScopeOperationSpec: msRest.OperationSpec = { +const cancelAtTenantScopeOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", httpMethod: "POST", - path: "providers/Microsoft.Resources/deployments/{deploymentName}/cancel", - urlParameters: [Parameters.deploymentName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 204: {}, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.deploymentName], + headerParameters: [Parameters.accept], serializer }; - -const exportTemplateAtTenantScopeOperationSpec: msRest.OperationSpec = { +const validateAtTenantScopeOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Resources/deployments/{deploymentName}/validate", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.DeploymentValidateResult + }, + 201: { + bodyMapper: Mappers.DeploymentValidateResult + }, + 202: { + bodyMapper: Mappers.DeploymentValidateResult + }, + 204: { + bodyMapper: Mappers.DeploymentValidateResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.deploymentName], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const whatIfAtTenantScopeOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf", httpMethod: "POST", - path: "providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", - urlParameters: [Parameters.deploymentName], + responses: { + 200: { + bodyMapper: Mappers.WhatIfOperationResult + }, + 201: { + bodyMapper: Mappers.WhatIfOperationResult + }, + 202: { + bodyMapper: Mappers.WhatIfOperationResult + }, + 204: { + bodyMapper: Mappers.WhatIfOperationResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.parameters2, queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [Parameters.$host, Parameters.deploymentName], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const exportTemplateAtTenantScopeOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", + httpMethod: "POST", responses: { 200: { bodyMapper: Mappers.DeploymentExportResult @@ -2570,14 +3258,14 @@ const exportTemplateAtTenantScopeOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.deploymentName], + headerParameters: [Parameters.accept], serializer }; - -const listAtTenantScopeOperationSpec: msRest.OperationSpec = { +const listAtTenantScopeOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Resources/deployments/", httpMethod: "GET", - path: "providers/Microsoft.Resources/deployments/", - queryParameters: [Parameters.filter, Parameters.top, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.DeploymentListResult @@ -2586,152 +3274,193 @@ const listAtTenantScopeOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; - -const checkExistenceAtManagementGroupScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "HEAD", +const deleteAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { path: - "providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}", - urlParameters: [Parameters.groupId, Parameters.deploymentName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}", + httpMethod: "DELETE", responses: { + 200: {}, + 201: {}, + 202: {}, 204: {}, - 404: {}, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getAtManagementGroupScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}", - urlParameters: [Parameters.groupId, Parameters.deploymentName], queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.DeploymentExtended - }, - default: { - bodyMapper: Mappers.CloudError - } - }, + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.groupId + ], + headerParameters: [Parameters.accept], serializer }; - -const cancelAtManagementGroupScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", +const checkExistenceAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { path: - "providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", - urlParameters: [Parameters.groupId, Parameters.deploymentName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}", + httpMethod: "HEAD", responses: { 204: {}, + 404: {}, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.groupId + ], + headerParameters: [Parameters.accept], serializer }; - -const exportTemplateAtManagementGroupScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", +const createOrUpdateAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { path: - "providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", - urlParameters: [Parameters.groupId, Parameters.deploymentName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}", + httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.DeploymentExportResult + bodyMapper: Mappers.DeploymentExtended + }, + 201: { + bodyMapper: Mappers.DeploymentExtended + }, + 202: { + bodyMapper: Mappers.DeploymentExtended + }, + 204: { + bodyMapper: Mappers.DeploymentExtended }, default: { bodyMapper: Mappers.CloudError } }, + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.groupId + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listAtManagementGroupScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const getAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { path: - "providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/", - urlParameters: [Parameters.groupId], - queryParameters: [Parameters.filter, Parameters.top, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentListResult + bodyMapper: Mappers.DeploymentExtended }, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.groupId + ], + headerParameters: [Parameters.accept], serializer }; - -const checkExistenceAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "HEAD", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", - urlParameters: [Parameters.deploymentName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], +const cancelAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", + httpMethod: "POST", responses: { 204: {}, - 404: {}, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.groupId + ], + headerParameters: [Parameters.accept], serializer }; - -const getAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", - urlParameters: [Parameters.deploymentName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], +const validateAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.DeploymentExtended + bodyMapper: Mappers.DeploymentValidateResult + }, + 201: { + bodyMapper: Mappers.DeploymentValidateResult + }, + 202: { + bodyMapper: Mappers.DeploymentValidateResult + }, + 204: { + bodyMapper: Mappers.DeploymentValidateResult }, default: { bodyMapper: Mappers.CloudError } }, + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.groupId + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const cancelAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", +const whatIfAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", - urlParameters: [Parameters.deploymentName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf", + httpMethod: "POST", responses: { - 204: {}, + 200: { + bodyMapper: Mappers.WhatIfOperationResult + }, + 201: { + bodyMapper: Mappers.WhatIfOperationResult + }, + 202: { + bodyMapper: Mappers.WhatIfOperationResult + }, + 204: { + bodyMapper: Mappers.WhatIfOperationResult + }, default: { bodyMapper: Mappers.CloudError } }, + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.groupId + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const exportTemplateAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", +const exportTemplateAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", - urlParameters: [Parameters.deploymentName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", + httpMethod: "POST", responses: { 200: { bodyMapper: Mappers.DeploymentExportResult @@ -2740,15 +3469,19 @@ const exportTemplateAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.groupId + ], + headerParameters: [Parameters.accept], serializer }; - -const listAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { +const listAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/", - urlParameters: [Parameters.subscriptionId], - queryParameters: [Parameters.filter, Parameters.top, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.DeploymentListResult @@ -2757,20 +3490,37 @@ const listAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], + urlParameters: [Parameters.$host, Parameters.groupId], + headerParameters: [Parameters.accept], serializer }; - -const checkExistenceOperationSpec: msRest.OperationSpec = { - httpMethod: "HEAD", +const deleteAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", + "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.resourceGroupName, + Parameters.$host, Parameters.deploymentName, Parameters.subscriptionId ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + headerParameters: [Parameters.accept], + serializer +}; +const checkExistenceAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", + httpMethod: "HEAD", responses: { 204: {}, 404: {}, @@ -2778,621 +3528,527 @@ const checkExistenceOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.resourceGroupName, + Parameters.$host, Parameters.deploymentName, Parameters.subscriptionId ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.DeploymentExtended }, + 201: { + bodyMapper: Mappers.DeploymentExtended + }, + 202: { + bodyMapper: Mappers.DeploymentExtended + }, + 204: { + bodyMapper: Mappers.DeploymentExtended + }, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const cancelOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: - "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.resourceGroupName, + Parameters.$host, Parameters.deploymentName, Parameters.subscriptionId ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - responses: { - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const exportTemplateOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", +const getAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.deploymentName, - Parameters.subscriptionId - ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentExportResult + bodyMapper: Mappers.DeploymentExtended }, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const cancelAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/", - urlParameters: [Parameters.resourceGroupName, Parameters.subscriptionId], - queryParameters: [Parameters.filter, Parameters.top, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", + httpMethod: "POST", responses: { - 200: { - bodyMapper: Mappers.DeploymentListResult - }, + 204: {}, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], serializer }; - -const calculateTemplateHashOperationSpec: msRest.OperationSpec = { +const validateAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", httpMethod: "POST", - path: "providers/Microsoft.Resources/calculateTemplateHash", - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "template", - mapper: { - required: true, - serializedName: "template", - type: { - name: "Object" - } - } - }, responses: { 200: { - bodyMapper: Mappers.TemplateHashResult + bodyMapper: Mappers.DeploymentValidateResult + }, + 201: { + bodyMapper: Mappers.DeploymentValidateResult + }, + 202: { + bodyMapper: Mappers.DeploymentValidateResult + }, + 204: { + bodyMapper: Mappers.DeploymentValidateResult }, default: { bodyMapper: Mappers.CloudError } }, + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const beginDeleteAtScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "{scope}/providers/Microsoft.Resources/deployments/{deploymentName}", - urlParameters: [Parameters.scope, Parameters.deploymentName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], +const whatIfAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf", + httpMethod: "POST", responses: { - 202: {}, - 204: {}, + 200: { + bodyMapper: Mappers.WhatIfOperationResult + }, + 201: { + bodyMapper: Mappers.WhatIfOperationResult + }, + 202: { + bodyMapper: Mappers.WhatIfOperationResult + }, + 204: { + bodyMapper: Mappers.WhatIfOperationResult + }, default: { bodyMapper: Mappers.CloudError } }, + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const beginCreateOrUpdateAtScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "{scope}/providers/Microsoft.Resources/deployments/{deploymentName}", - urlParameters: [Parameters.scope, Parameters.deploymentName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.Deployment, - required: true - } - }, +const exportTemplateAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.DeploymentExtended - }, - 201: { - bodyMapper: Mappers.DeploymentExtended + bodyMapper: Mappers.DeploymentExportResult }, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], serializer }; - -const beginValidateAtScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", - urlParameters: [Parameters.scope, Parameters.deploymentName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.Deployment, - required: true - } - }, +const listAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentValidateResult - }, - 202: {}, - 400: { - bodyMapper: Mappers.DeploymentValidateResult + bodyMapper: Mappers.DeploymentListResult }, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const beginDeleteAtTenantScopeOperationSpec: msRest.OperationSpec = { +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", httpMethod: "DELETE", - path: "providers/Microsoft.Resources/deployments/{deploymentName}", - urlParameters: [Parameters.deploymentName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { + 200: {}, + 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], serializer }; - -const beginCreateOrUpdateAtTenantScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "providers/Microsoft.Resources/deployments/{deploymentName}", - urlParameters: [Parameters.deploymentName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.ScopedDeployment, - required: true - } - }, +const checkExistenceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", + httpMethod: "HEAD", responses: { - 200: { - bodyMapper: Mappers.DeploymentExtended - }, - 201: { - bodyMapper: Mappers.DeploymentExtended - }, + 204: {}, + 404: {}, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], serializer }; - -const beginValidateAtTenantScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "providers/Microsoft.Resources/deployments/{deploymentName}/validate", - urlParameters: [Parameters.deploymentName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.ScopedDeployment, - required: true - } - }, +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", + httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.DeploymentValidateResult + bodyMapper: Mappers.DeploymentExtended }, - 202: {}, - 400: { - bodyMapper: Mappers.DeploymentValidateResult + 201: { + bodyMapper: Mappers.DeploymentExtended + }, + 202: { + bodyMapper: Mappers.DeploymentExtended + }, + 204: { + bodyMapper: Mappers.DeploymentExtended }, default: { bodyMapper: Mappers.CloudError } }, + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const beginWhatIfAtTenantScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "providers/Microsoft.Resources/deployments/{deploymentName}/whatIf", - urlParameters: [Parameters.deploymentName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.ScopedDeploymentWhatIf, - required: true - } - }, +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.WhatIfOperationResult, - headersMapper: Mappers.DeploymentsWhatIfAtTenantScopeHeaders - }, - 202: { - headersMapper: Mappers.DeploymentsWhatIfAtTenantScopeHeaders + bodyMapper: Mappers.DeploymentExtended }, default: { - bodyMapper: Mappers.CloudError, - headersMapper: Mappers.DeploymentsWhatIfAtTenantScopeHeaders + bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], serializer }; - -const beginDeleteAtManagementGroupScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", +const cancelOperationSpec: coreClient.OperationSpec = { path: - "providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}", - urlParameters: [Parameters.groupId, Parameters.deploymentName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", + httpMethod: "POST", responses: { - 202: {}, 204: {}, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], serializer }; - -const beginCreateOrUpdateAtManagementGroupScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", +const validateOperationSpec: coreClient.OperationSpec = { path: - "providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}", - urlParameters: [Parameters.groupId, Parameters.deploymentName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.ScopedDeployment, - required: true - } - }, + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.DeploymentExtended + bodyMapper: Mappers.DeploymentValidateResult }, 201: { - bodyMapper: Mappers.DeploymentExtended + bodyMapper: Mappers.DeploymentValidateResult }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const beginValidateAtManagementGroupScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: - "providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", - urlParameters: [Parameters.groupId, Parameters.deploymentName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.ScopedDeployment, - required: true - } - }, - responses: { - 200: { + 202: { bodyMapper: Mappers.DeploymentValidateResult }, - 202: {}, - 400: { + 204: { bodyMapper: Mappers.DeploymentValidateResult }, default: { bodyMapper: Mappers.CloudError } }, + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const beginWhatIfAtManagementGroupScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", +const whatIfOperationSpec: coreClient.OperationSpec = { path: - "providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf", - urlParameters: [Parameters.groupId, Parameters.deploymentName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.ScopedDeploymentWhatIf, - required: true - } - }, + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.WhatIfOperationResult, - headersMapper: Mappers.DeploymentsWhatIfAtManagementGroupScopeHeaders + bodyMapper: Mappers.WhatIfOperationResult + }, + 201: { + bodyMapper: Mappers.WhatIfOperationResult }, 202: { - headersMapper: Mappers.DeploymentsWhatIfAtManagementGroupScopeHeaders + bodyMapper: Mappers.WhatIfOperationResult + }, + 204: { + bodyMapper: Mappers.WhatIfOperationResult }, default: { - bodyMapper: Mappers.CloudError, - headersMapper: Mappers.DeploymentsWhatIfAtManagementGroupScopeHeaders + bodyMapper: Mappers.CloudError } }, + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const beginDeleteAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", - urlParameters: [Parameters.deploymentName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], +const exportTemplateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", + httpMethod: "POST", responses: { - 202: {}, - 204: {}, + 200: { + bodyMapper: Mappers.DeploymentExportResult + }, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.deploymentName, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], serializer }; - -const beginCreateOrUpdateAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", - urlParameters: [Parameters.deploymentName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.Deployment, - required: true - } - }, +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentExtended - }, - 201: { - bodyMapper: Mappers.DeploymentExtended + bodyMapper: Mappers.DeploymentListResult }, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], serializer }; - -const beginValidateAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { +const calculateTemplateHashOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Resources/calculateTemplateHash", httpMethod: "POST", - path: - "subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", - urlParameters: [Parameters.deploymentName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.Deployment, - required: true - } - }, responses: { 200: { - bodyMapper: Mappers.DeploymentValidateResult - }, - 202: {}, - 400: { - bodyMapper: Mappers.DeploymentValidateResult + bodyMapper: Mappers.TemplateHashResult }, default: { bodyMapper: Mappers.CloudError } }, + requestBody: Parameters.template, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const beginWhatIfAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: - "subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf", - urlParameters: [Parameters.deploymentName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.DeploymentWhatIf, - required: true - } - }, +const listAtScopeNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.WhatIfOperationResult, - headersMapper: Mappers.DeploymentsWhatIfAtSubscriptionScopeHeaders - }, - 202: { - headersMapper: Mappers.DeploymentsWhatIfAtSubscriptionScopeHeaders + bodyMapper: Mappers.DeploymentListResult }, default: { - bodyMapper: Mappers.CloudError, - headersMapper: Mappers.DeploymentsWhatIfAtSubscriptionScopeHeaders + bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], + urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.scope], + headerParameters: [Parameters.accept], serializer }; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: - "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.deploymentName, - Parameters.subscriptionId - ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], +const listAtTenantScopeNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", responses: { - 202: {}, - 204: {}, + 200: { + bodyMapper: Mappers.DeploymentListResult + }, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: - "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.deploymentName, - Parameters.subscriptionId - ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.Deployment, - required: true - } - }, +const listAtManagementGroupScopeNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentExtended - }, - 201: { - bodyMapper: Mappers.DeploymentExtended + bodyMapper: Mappers.DeploymentListResult }, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], + urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.groupId], + headerParameters: [Parameters.accept], serializer }; - -const beginValidateOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: - "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.deploymentName, - Parameters.subscriptionId - ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.Deployment, - required: true - } - }, +const listAtSubscriptionScopeNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DeploymentValidateResult - }, - 202: {}, - 400: { - bodyMapper: Mappers.DeploymentValidateResult + bodyMapper: Mappers.DeploymentListResult }, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginWhatIfOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: - "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf", + queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], urlParameters: [ - Parameters.resourceGroupName, - Parameters.deploymentName, + Parameters.$host, + Parameters.nextLink, Parameters.subscriptionId ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.DeploymentWhatIf, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.WhatIfOperationResult, - headersMapper: Mappers.DeploymentsWhatIfHeaders - }, - 202: { - headersMapper: Mappers.DeploymentsWhatIfHeaders + bodyMapper: Mappers.DeploymentListResult }, default: { - bodyMapper: Mappers.CloudError, - headersMapper: Mappers.DeploymentsWhatIfHeaders + bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], serializer }; - -const listAtScopeNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listAtScopeNextNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.filter, Parameters.top, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DeploymentListResult @@ -3401,16 +4057,14 @@ const listAtScopeNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], + urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.scope], + headerParameters: [Parameters.accept], serializer }; - -const listAtTenantScopeNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listAtTenantScopeNextNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.filter, Parameters.top, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DeploymentListResult @@ -3419,16 +4073,14 @@ const listAtTenantScopeNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; - -const listAtManagementGroupScopeNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listAtManagementGroupScopeNextNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.filter, Parameters.top, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DeploymentListResult @@ -3437,16 +4089,14 @@ const listAtManagementGroupScopeNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], + urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.groupId], + headerParameters: [Parameters.accept], serializer }; - -const listAtSubscriptionScopeNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listAtSubscriptionScopeNextNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.filter, Parameters.top, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DeploymentListResult @@ -3455,16 +4105,18 @@ const listAtSubscriptionScopeNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByResourceGroupNextNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.filter, Parameters.top, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DeploymentListResult @@ -3473,5 +4125,13 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/resources/arm-resources/src/operations/index.ts b/sdk/resources/arm-resources/src/operations/index.ts index 4a1c899f6cb0..dea1301605d5 100644 --- a/sdk/resources/arm-resources/src/operations/index.ts +++ b/sdk/resources/arm-resources/src/operations/index.ts @@ -3,8 +3,7 @@ * 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 "./operations"; diff --git a/sdk/resources/arm-resources/src/operations/operations.ts b/sdk/resources/arm-resources/src/operations/operations.ts index d059d5ad2c40..6f3162419577 100644 --- a/sdk/resources/arm-resources/src/operations/operations.ts +++ b/sdk/resources/arm-resources/src/operations/operations.ts @@ -3,23 +3,34 @@ * 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 "@azure/core-paging"; +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 { ResourceManagementClientContext } from "../resourceManagementClientContext"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListNextNextOptionalParams, + OperationsListResponse, + OperationsListNextResponse, + OperationsListNextNextResponse +} from "../models"; +/// /** Class representing a Operations. */ -export class Operations { +export class OperationsImpl implements Operations { private readonly client: ResourceManagementClientContext; /** - * Create a Operations. - * @param {ResourceManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client */ constructor(client: ResourceManagementClientContext) { this.client = client; @@ -27,86 +38,138 @@ export class Operations { /** * Lists all of the available Microsoft.Resources REST API operations. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + /** - * @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. */ - list( - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - list( - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - options + public listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listNextPagingAll(nextLink, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listOperationSpec, - callback - ) as Promise; + byPage: () => { + return this.listNextPagingPage(nextLink, options); + } + }; + } + + private async *listNextPagingPage( + nextLink: string, + options?: OperationsListNextOptionalParams + ): AsyncIterableIterator { + let result = await this._listNext(nextLink, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNextNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listNextPagingAll( + nextLink: string, + options?: OperationsListNextOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listNextPagingPage(nextLink, options)) { + yield* page; + } } /** * Lists all of the available Microsoft.Resources REST API operations. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase - ): Promise; + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @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, - callback: msRest.ServiceCallback - ): void; + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNextNext + * @param nextLink The nextLink from the previous successful call to the ListNext 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 _listNextNext( + nextLink: string, + options?: OperationsListNextNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback - ) as Promise; + { nextLink, options }, + listNextNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Resources/operations", httpMethod: "GET", - path: "providers/Microsoft.Resources/operations", - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.OperationListResult @@ -115,16 +178,30 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + 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], + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; +const listNextNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.OperationListResult @@ -133,5 +210,8 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/resources/arm-resources/src/operations/providerResourceTypes.ts b/sdk/resources/arm-resources/src/operations/providerResourceTypes.ts index f1c3dede0f22..7bfeaf39d6dd 100644 --- a/sdk/resources/arm-resources/src/operations/providerResourceTypes.ts +++ b/sdk/resources/arm-resources/src/operations/providerResourceTypes.ts @@ -3,23 +3,26 @@ * 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/providerResourceTypesMappers"; +import { ProviderResourceTypes } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ResourceManagementClientContext } from "../resourceManagementClientContext"; +import { + ProviderResourceTypesListOptionalParams, + ProviderResourceTypesListResponse +} from "../models"; /** Class representing a ProviderResourceTypes. */ -export class ProviderResourceTypes { +export class ProviderResourceTypesImpl implements ProviderResourceTypes { private readonly client: ResourceManagementClientContext; /** - * Create a ProviderResourceTypes. - * @param {ResourceManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class ProviderResourceTypes class. + * @param client Reference to the service client */ constructor(client: ResourceManagementClientContext) { this.client = client; @@ -28,57 +31,25 @@ export class ProviderResourceTypes { /** * List the resource types for a specified resource provider. * @param resourceProviderNamespace The namespace of the resource provider. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ list( resourceProviderNamespace: string, - options?: Models.ProviderResourceTypesListOptionalParams - ): Promise; - /** - * @param resourceProviderNamespace The namespace of the resource provider. - * @param callback The callback - */ - list( - resourceProviderNamespace: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceProviderNamespace The namespace of the resource provider. - * @param options The optional parameters - * @param callback The callback - */ - list( - resourceProviderNamespace: string, - options: Models.ProviderResourceTypesListOptionalParams, - callback: msRest.ServiceCallback - ): void; - list( - resourceProviderNamespace: string, - options?: - | Models.ProviderResourceTypesListOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: ProviderResourceTypesListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceProviderNamespace, - options - }, - listOperationSpec, - callback - ) as Promise; + { resourceProviderNamespace, options }, + listOperationSpec + ); } } - // 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/{resourceProviderNamespace}/resourceTypes", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/resourceTypes", - urlParameters: [Parameters.resourceProviderNamespace, Parameters.subscriptionId], - queryParameters: [Parameters.expand, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.ProviderResourceTypeListResult @@ -87,5 +58,12 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.expand], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceProviderNamespace + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/resources/arm-resources/src/operations/providers.ts b/sdk/resources/arm-resources/src/operations/providers.ts index 757b841829b6..e80617c08591 100644 --- a/sdk/resources/arm-resources/src/operations/providers.ts +++ b/sdk/resources/arm-resources/src/operations/providers.ts @@ -3,414 +3,420 @@ * 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/providersMappers"; +import "@azure/core-paging"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Providers } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ResourceManagementClientContext } from "../resourceManagementClientContext"; +import { + Provider, + ProvidersListNextOptionalParams, + ProvidersListOptionalParams, + ProvidersListAtTenantScopeNextOptionalParams, + ProvidersListAtTenantScopeOptionalParams, + ProvidersListNextNextOptionalParams, + ProvidersListAtTenantScopeNextNextOptionalParams, + ProvidersUnregisterOptionalParams, + ProvidersUnregisterResponse, + ProvidersRegisterAtManagementGroupScopeOptionalParams, + ProvidersProviderPermissionsOptionalParams, + ProvidersProviderPermissionsResponse, + ProvidersRegisterOptionalParams, + ProvidersRegisterResponse, + ProvidersListResponse, + ProvidersListAtTenantScopeResponse, + ProvidersGetOptionalParams, + ProvidersGetResponse, + ProvidersGetAtTenantScopeOptionalParams, + ProvidersGetAtTenantScopeResponse, + ProvidersListNextResponse, + ProvidersListAtTenantScopeNextResponse, + ProvidersListNextNextResponse, + ProvidersListAtTenantScopeNextNextResponse +} from "../models"; +/// /** Class representing a Providers. */ -export class Providers { +export class ProvidersImpl implements Providers { private readonly client: ResourceManagementClientContext; /** - * Create a Providers. - * @param {ResourceManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Providers class. + * @param client Reference to the service client */ constructor(client: ResourceManagementClientContext) { this.client = client; } /** - * Unregisters a subscription from a resource provider. - * @param resourceProviderNamespace The namespace of the resource provider to unregister. - * @param [options] The optional parameters - * @returns Promise + * Gets all resource providers for a subscription. + * @param options The options parameters. */ - unregister( - resourceProviderNamespace: string, - options?: msRest.RequestOptionsBase - ): Promise; + public list( + options?: ProvidersListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: ProvidersListOptionalParams + ): 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?: ProvidersListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + /** - * @param resourceProviderNamespace The namespace of the resource provider to unregister. - * @param callback The callback + * Gets all resource providers for the tenant. + * @param options The options parameters. */ - unregister( - resourceProviderNamespace: string, - callback: msRest.ServiceCallback - ): void; + public listAtTenantScope( + options?: ProvidersListAtTenantScopeOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAtTenantScopePagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listAtTenantScopePagingPage(options); + } + }; + } + + private async *listAtTenantScopePagingPage( + options?: ProvidersListAtTenantScopeOptionalParams + ): AsyncIterableIterator { + let result = await this._listAtTenantScope(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listAtTenantScopeNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listAtTenantScopePagingAll( + options?: ProvidersListAtTenantScopeOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAtTenantScopePagingPage(options)) { + yield* page; + } + } + /** - * @param resourceProviderNamespace The namespace of the resource provider to unregister. - * @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. */ - unregister( - resourceProviderNamespace: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - unregister( - resourceProviderNamespace: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - resourceProviderNamespace, - options + public listNext( + nextLink: string, + options?: ProvidersListNextOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listNextPagingAll(nextLink, options); + return { + next() { + return iter.next(); }, - unregisterOperationSpec, - callback - ) as Promise; + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listNextPagingPage(nextLink, options); + } + }; + } + + private async *listNextPagingPage( + nextLink: string, + options?: ProvidersListNextOptionalParams + ): AsyncIterableIterator { + let result = await this._listNext(nextLink, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNextNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listNextPagingAll( + nextLink: string, + options?: ProvidersListNextOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listNextPagingPage(nextLink, options)) { + yield* page; + } } /** - * Registers a management group with a resource provider. - * @param resourceProviderNamespace The namespace of the resource provider to register. - * @param groupId The management group ID. - * @param [options] The optional parameters - * @returns Promise + * ListAtTenantScopeNext + * @param nextLink The nextLink from the previous successful call to the ListAtTenantScope method. + * @param options The options parameters. */ - registerAtManagementGroupScope( - resourceProviderNamespace: string, - groupId: string, - options?: msRest.RequestOptionsBase - ): Promise; + public listAtTenantScopeNext( + nextLink: string, + options?: ProvidersListAtTenantScopeNextOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAtTenantScopeNextPagingAll(nextLink, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listAtTenantScopeNextPagingPage(nextLink, options); + } + }; + } + + private async *listAtTenantScopeNextPagingPage( + nextLink: string, + options?: ProvidersListAtTenantScopeNextOptionalParams + ): AsyncIterableIterator { + let result = await this._listAtTenantScopeNext(nextLink, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listAtTenantScopeNextNext( + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listAtTenantScopeNextPagingAll( + nextLink: string, + options?: ProvidersListAtTenantScopeNextOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAtTenantScopeNextPagingPage( + nextLink, + options + )) { + yield* page; + } + } + /** - * @param resourceProviderNamespace The namespace of the resource provider to register. - * @param groupId The management group ID. - * @param callback The callback + * Unregisters a subscription from a resource provider. + * @param resourceProviderNamespace The namespace of the resource provider to unregister. + * @param options The options parameters. */ - registerAtManagementGroupScope( + unregister( resourceProviderNamespace: string, - groupId: string, - callback: msRest.ServiceCallback - ): void; + options?: ProvidersUnregisterOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceProviderNamespace, options }, + unregisterOperationSpec + ); + } + /** + * Registers a management group with a resource provider. * @param resourceProviderNamespace The namespace of the resource provider to register. * @param groupId The management group ID. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ registerAtManagementGroupScope( resourceProviderNamespace: string, groupId: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - registerAtManagementGroupScope( - resourceProviderNamespace: string, - groupId: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: ProvidersRegisterAtManagementGroupScopeOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceProviderNamespace, - groupId, - options - }, - registerAtManagementGroupScopeOperationSpec, - callback + { resourceProviderNamespace, groupId, options }, + registerAtManagementGroupScopeOperationSpec ); } /** - * Registers a subscription with a resource provider. - * @param resourceProviderNamespace The namespace of the resource provider to register. - * @param [options] The optional parameters - * @returns Promise - */ - register( - resourceProviderNamespace: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceProviderNamespace The namespace of the resource provider to register. - * @param callback The callback + * Get the provider permissions. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param options The options parameters. */ - register( + providerPermissions( resourceProviderNamespace: string, - callback: msRest.ServiceCallback - ): void; + options?: ProvidersProviderPermissionsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceProviderNamespace, options }, + providerPermissionsOperationSpec + ); + } + /** + * Registers a subscription with a resource provider. * @param resourceProviderNamespace The namespace of the resource provider to register. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ register( resourceProviderNamespace: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - register( - resourceProviderNamespace: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: ProvidersRegisterOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceProviderNamespace, - options - }, - registerOperationSpec, - callback - ) as Promise; + { resourceProviderNamespace, options }, + registerOperationSpec + ); } /** * Gets all resource providers for a subscription. - * @param [options] The optional parameters - * @returns Promise - */ - list(options?: Models.ProvidersListOptionalParams): Promise; - /** - * @param callback The callback + * @param options The options parameters. */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list( - options: Models.ProvidersListOptionalParams, - callback: msRest.ServiceCallback - ): void; - list( - options?: - | Models.ProvidersListOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback - ) as Promise; + private _list( + options?: ProvidersListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); } /** * Gets all resource providers for the tenant. - * @param [options] The optional parameters - * @returns Promise - */ - listAtTenantScope( - options?: Models.ProvidersListAtTenantScopeOptionalParams - ): Promise; - /** - * @param callback The callback - */ - listAtTenantScope(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listAtTenantScope( - options: Models.ProvidersListAtTenantScopeOptionalParams, - callback: msRest.ServiceCallback - ): void; - listAtTenantScope( - options?: - | Models.ProvidersListAtTenantScopeOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listAtTenantScope( + options?: ProvidersListAtTenantScopeOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - options - }, - listAtTenantScopeOperationSpec, - callback - ) as Promise; + { options }, + listAtTenantScopeOperationSpec + ); } /** * Gets the specified resource provider. * @param resourceProviderNamespace The namespace of the resource provider. - * @param [options] The optional parameters - * @returns Promise - */ - get( - resourceProviderNamespace: string, - options?: Models.ProvidersGetOptionalParams - ): Promise; - /** - * @param resourceProviderNamespace The namespace of the resource provider. - * @param callback The callback - */ - get(resourceProviderNamespace: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceProviderNamespace The namespace of the resource provider. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ get( resourceProviderNamespace: string, - options: Models.ProvidersGetOptionalParams, - callback: msRest.ServiceCallback - ): void; - get( - resourceProviderNamespace: string, - options?: Models.ProvidersGetOptionalParams | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: ProvidersGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceProviderNamespace, - options - }, - getOperationSpec, - callback - ) as Promise; + { resourceProviderNamespace, options }, + getOperationSpec + ); } /** * Gets the specified resource provider at the tenant level. * @param resourceProviderNamespace The namespace of the resource provider. - * @param [options] The optional parameters - * @returns Promise - */ - getAtTenantScope( - resourceProviderNamespace: string, - options?: Models.ProvidersGetAtTenantScopeOptionalParams - ): Promise; - /** - * @param resourceProviderNamespace The namespace of the resource provider. - * @param callback The callback + * @param options The options parameters. */ getAtTenantScope( resourceProviderNamespace: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceProviderNamespace The namespace of the resource provider. - * @param options The optional parameters - * @param callback The callback - */ - getAtTenantScope( - resourceProviderNamespace: string, - options: Models.ProvidersGetAtTenantScopeOptionalParams, - callback: msRest.ServiceCallback - ): void; - getAtTenantScope( - resourceProviderNamespace: string, - options?: - | Models.ProvidersGetAtTenantScopeOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: ProvidersGetAtTenantScopeOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceProviderNamespace, - options - }, - getAtTenantScopeOperationSpec, - callback - ) as Promise; + { resourceProviderNamespace, options }, + getAtTenantScopeOperationSpec + ); } /** - * Gets all resource providers for a subscription. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext( - nextPageLink: string, - options?: Models.ProvidersListNextOptionalParams - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @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, 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( - nextPageLink: string, - options: Models.ProvidersListNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listNext( - nextPageLink: string, - options?: - | Models.ProvidersListNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listNext( + nextLink: string, + options?: ProvidersListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback - ) as Promise; + { nextLink, options }, + listNextOperationSpec + ); } /** - * Gets all resource providers for the tenant. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise + * ListAtTenantScopeNext + * @param nextLink The nextLink from the previous successful call to the ListAtTenantScope method. + * @param options The options parameters. */ - listAtTenantScopeNext( - nextPageLink: string, - options?: Models.ProvidersListAtTenantScopeNextOptionalParams - ): Promise; + private _listAtTenantScopeNext( + nextLink: string, + options?: ProvidersListAtTenantScopeNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listAtTenantScopeNextOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * ListNextNext + * @param nextLink The nextLink from the previous successful call to the ListNext method. + * @param options The options parameters. */ - listAtTenantScopeNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; + private _listNextNext( + nextLink: string, + options?: ProvidersListNextNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextNextOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListAtTenantScopeNextNext + * @param nextLink The nextLink from the previous successful call to the ListAtTenantScopeNext method. + * @param options The options parameters. */ - listAtTenantScopeNext( - nextPageLink: string, - options: Models.ProvidersListAtTenantScopeNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listAtTenantScopeNext( - nextPageLink: string, - options?: - | Models.ProvidersListAtTenantScopeNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listAtTenantScopeNextNext( + nextLink: string, + options?: ProvidersListAtTenantScopeNextNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listAtTenantScopeNextOperationSpec, - callback - ) as Promise; + { nextLink, options }, + listAtTenantScopeNextNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const unregisterOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const unregisterOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/unregister", httpMethod: "POST", - path: "subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/unregister", - urlParameters: [Parameters.resourceProviderNamespace, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.Provider @@ -419,31 +425,59 @@ const unregisterOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceProviderNamespace + ], + headerParameters: [Parameters.accept], serializer }; - -const registerAtManagementGroupScopeOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", +const registerAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { path: - "providers/Microsoft.Management/managementGroups/{groupId}/providers/{resourceProviderNamespace}/register", - urlParameters: [Parameters.resourceProviderNamespace, Parameters.groupId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/providers/Microsoft.Management/managementGroups/{groupId}/providers/{resourceProviderNamespace}/register", + httpMethod: "POST", responses: { 200: {}, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.groupId, + Parameters.resourceProviderNamespace + ], + headerParameters: [Parameters.accept], serializer }; - -const registerOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register", - urlParameters: [Parameters.resourceProviderNamespace, Parameters.subscriptionId], +const providerPermissionsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/providerPermissions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ProviderPermissionListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceProviderNamespace + ], + headerParameters: [Parameters.accept], + serializer +}; +const registerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register", + httpMethod: "POST", responses: { 200: { bodyMapper: Mappers.Provider @@ -452,15 +486,20 @@ const registerOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + requestBody: Parameters.properties, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceProviderNamespace + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listOperationSpec: msRest.OperationSpec = { +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers", - urlParameters: [Parameters.subscriptionId], - queryParameters: [Parameters.top, Parameters.expand, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.ProviderListResult @@ -469,14 +508,14 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.top, Parameters.expand], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const listAtTenantScopeOperationSpec: msRest.OperationSpec = { +const listAtTenantScopeOperationSpec: coreClient.OperationSpec = { + path: "/providers", httpMethod: "GET", - path: "providers", - queryParameters: [Parameters.top, Parameters.expand, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.ProviderListResult @@ -485,15 +524,14 @@ const listAtTenantScopeOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.top, Parameters.expand], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; - -const getOperationSpec: msRest.OperationSpec = { +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}", - urlParameters: [Parameters.resourceProviderNamespace, Parameters.subscriptionId], - queryParameters: [Parameters.expand, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.Provider @@ -502,15 +540,18 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.expand], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceProviderNamespace + ], + headerParameters: [Parameters.accept], serializer }; - -const getAtTenantScopeOperationSpec: msRest.OperationSpec = { +const getAtTenantScopeOperationSpec: coreClient.OperationSpec = { + path: "/providers/{resourceProviderNamespace}", httpMethod: "GET", - path: "providers/{resourceProviderNamespace}", - urlParameters: [Parameters.resourceProviderNamespace], - queryParameters: [Parameters.expand, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.Provider @@ -519,16 +560,34 @@ const getAtTenantScopeOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.expand], + urlParameters: [Parameters.$host, Parameters.resourceProviderNamespace], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", httpMethod: "GET", - baseUrl: "https://management.azure.com", + responses: { + 200: { + bodyMapper: Mappers.ProviderListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top, Parameters.expand], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listAtTenantScopeNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.top, Parameters.expand, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ProviderListResult @@ -537,16 +596,34 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.top, Parameters.expand], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; - -const listAtTenantScopeNextOperationSpec: msRest.OperationSpec = { +const listNextNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", httpMethod: "GET", - baseUrl: "https://management.azure.com", + responses: { + 200: { + bodyMapper: Mappers.ProviderListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top, Parameters.expand], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listAtTenantScopeNextNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.top, Parameters.expand, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ProviderListResult @@ -555,5 +632,8 @@ const listAtTenantScopeNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.top, Parameters.expand], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/resources/arm-resources/src/operations/resourceGroups.ts b/sdk/resources/arm-resources/src/operations/resourceGroups.ts index 3f85612e27e3..4868f6273bde 100644 --- a/sdk/resources/arm-resources/src/operations/resourceGroups.ts +++ b/sdk/resources/arm-resources/src/operations/resourceGroups.ts @@ -3,388 +3,411 @@ * 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/resourceGroupsMappers"; +import "@azure/core-paging"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { ResourceGroups } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ResourceManagementClientContext } from "../resourceManagementClientContext"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { LroEngine } from "../lro"; +import { CoreClientLro, shouldDeserializeLro } from "../coreClientLro"; +import { + ResourceGroup, + ResourceGroupsListNextOptionalParams, + ResourceGroupsListOptionalParams, + ResourceGroupsListNextNextOptionalParams, + ResourceGroupsCheckExistenceOptionalParams, + ResourceGroupsCheckExistenceResponse, + ResourceGroupsCreateOrUpdateOptionalParams, + ResourceGroupsCreateOrUpdateResponse, + ResourceGroupsDeleteOptionalParams, + ResourceGroupsGetOptionalParams, + ResourceGroupsGetResponse, + ResourceGroupPatchable, + ResourceGroupsUpdateOptionalParams, + ResourceGroupsUpdateResponse, + ExportTemplateRequest, + ResourceGroupsExportTemplateOptionalParams, + ResourceGroupsExportTemplateResponse, + ResourceGroupsListResponse, + ResourceGroupsListNextResponse, + ResourceGroupsListNextNextResponse +} from "../models"; +/// /** Class representing a ResourceGroups. */ -export class ResourceGroups { +export class ResourceGroupsImpl implements ResourceGroups { private readonly client: ResourceManagementClientContext; /** - * Create a ResourceGroups. - * @param {ResourceManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class ResourceGroups class. + * @param client Reference to the service client */ constructor(client: ResourceManagementClientContext) { this.client = client; } /** - * Checks whether a resource group exists. - * @param resourceGroupName The name of the resource group to check. The name is case insensitive. - * @param [options] The optional parameters - * @returns Promise + * Gets all the resource groups for a subscription. + * @param options The options parameters. */ - checkExistence( - resourceGroupName: string, - options?: msRest.RequestOptionsBase - ): Promise; + public list( + options?: ResourceGroupsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: ResourceGroupsListOptionalParams + ): 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?: ResourceGroupsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + /** - * @param resourceGroupName The name of the resource group to check. The name is case insensitive. - * @param callback The callback + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - checkExistence(resourceGroupName: string, callback: msRest.ServiceCallback): void; + public listNext( + nextLink: string, + options?: ResourceGroupsListNextOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listNextPagingAll(nextLink, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listNextPagingPage(nextLink, options); + } + }; + } + + private async *listNextPagingPage( + nextLink: string, + options?: ResourceGroupsListNextOptionalParams + ): AsyncIterableIterator { + let result = await this._listNext(nextLink, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNextNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listNextPagingAll( + nextLink: string, + options?: ResourceGroupsListNextOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listNextPagingPage(nextLink, options)) { + yield* page; + } + } + /** + * Checks whether a resource group exists. * @param resourceGroupName The name of the resource group to check. The name is case insensitive. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ checkExistence( resourceGroupName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - checkExistence( - resourceGroupName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: ResourceGroupsCheckExistenceOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - options - }, - checkExistenceOperationSpec, - callback - ) as Promise; + { resourceGroupName, options }, + checkExistenceOperationSpec + ); } /** * Creates or updates a resource group. * @param resourceGroupName The name of the resource group to create or update. Can include - * alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters - * that match the allowed characters. - * @param parameters Parameters supplied to the create or update a resource group. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdate( - resourceGroupName: string, - parameters: Models.ResourceGroup, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName The name of the resource group to create or update. Can include - * alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters - * that match the allowed characters. - * @param parameters Parameters supplied to the create or update a resource group. - * @param callback The callback - */ - createOrUpdate( - resourceGroupName: string, - parameters: Models.ResourceGroup, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceGroupName The name of the resource group to create or update. Can include - * alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters - * that match the allowed characters. + * alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters that + * match the allowed characters. * @param parameters Parameters supplied to the create or update a resource group. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ createOrUpdate( resourceGroupName: string, - parameters: Models.ResourceGroup, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - createOrUpdate( - resourceGroupName: string, - parameters: Models.ResourceGroup, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + parameters: ResourceGroup, + options?: ResourceGroupsCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - parameters, - options - }, - createOrUpdateOperationSpec, - callback - ) as Promise; + { resourceGroupName, parameters, options }, + createOrUpdateOperationSpec + ); } /** - * When you delete a resource group, all of its resources are also deleted. Deleting a resource - * group deletes all of its template deployments and currently stored operations. - * @summary Deletes a resource group. + * When you delete a resource group, all of its resources are also deleted. Deleting a resource group + * deletes all of its template deployments and currently stored operations. * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod( + async beginDelete( resourceGroupName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginDeleteMethod(resourceGroupName, options).then((lroPoller) => - lroPoller.pollUntilFinished() + options?: ResourceGroupsDeleteOptionalParams + ): 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 CoreClientLro( + sendOperation, + { resourceGroupName, options }, + deleteOperationSpec ); + return new LroEngine(lro, { intervalInMs: options?.updateIntervalInMs }); } /** - * Gets a resource group. - * @param resourceGroupName The name of the resource group to get. The name is case insensitive. - * @param [options] The optional parameters - * @returns Promise + * When you delete a resource group, all of its resources are also deleted. Deleting a resource group + * deletes all of its template deployments and currently stored operations. + * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param options The options parameters. */ - get( + async beginDeleteAndWait( resourceGroupName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName The name of the resource group to get. The name is case insensitive. - * @param callback The callback - */ - get(resourceGroupName: string, callback: msRest.ServiceCallback): void; + options?: ResourceGroupsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete(resourceGroupName, options); + return poller.pollUntilDone(); + } + /** + * Gets a resource group. * @param resourceGroupName The name of the resource group to get. The name is case insensitive. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ get( resourceGroupName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - get( - resourceGroupName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: ResourceGroupsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - options - }, - getOperationSpec, - callback - ) as Promise; + { resourceGroupName, options }, + getOperationSpec + ); } /** - * Resource groups can be updated through a simple PATCH operation to a group address. The format - * of the request is the same as that for creating a resource group. If a field is unspecified, the + * Resource groups can be updated through a simple PATCH operation to a group address. The format of + * the request is the same as that for creating a resource group. If a field is unspecified, the * current value is retained. - * @summary Updates a resource group. - * @param resourceGroupName The name of the resource group to update. The name is case insensitive. - * @param parameters Parameters supplied to update a resource group. - * @param [options] The optional parameters - * @returns Promise - */ - update( - resourceGroupName: string, - parameters: Models.ResourceGroupPatchable, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName The name of the resource group to update. The name is case insensitive. - * @param parameters Parameters supplied to update a resource group. - * @param callback The callback - */ - update( - resourceGroupName: string, - parameters: Models.ResourceGroupPatchable, - callback: msRest.ServiceCallback - ): void; - /** * @param resourceGroupName The name of the resource group to update. The name is case insensitive. * @param parameters Parameters supplied to update a resource group. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ update( resourceGroupName: string, - parameters: Models.ResourceGroupPatchable, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - update( - resourceGroupName: string, - parameters: Models.ResourceGroupPatchable, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + parameters: ResourceGroupPatchable, + options?: ResourceGroupsUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - parameters, - options - }, - updateOperationSpec, - callback - ) as Promise; + { resourceGroupName, parameters, options }, + updateOperationSpec + ); } /** * Captures the specified resource group as a template. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param parameters Parameters for exporting the template. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - exportTemplate( + async beginExportTemplate( resourceGroupName: string, - parameters: Models.ExportTemplateRequest, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginExportTemplate(resourceGroupName, parameters, options).then((lroPoller) => - lroPoller.pollUntilFinished() - ) as Promise; - } - - /** - * Gets all the resource groups for a subscription. - * @param [options] The optional parameters - * @returns Promise - */ - list( - options?: Models.ResourceGroupsListOptionalParams - ): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list( - options: Models.ResourceGroupsListOptionalParams, - callback: msRest.ServiceCallback - ): void; - list( - options?: - | Models.ResourceGroupsListOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback - ) as Promise; - } + parameters: ExportTemplateRequest, + options?: ResourceGroupsExportTemplateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ResourceGroupsExportTemplateResponse + > + > { + 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() + } + }; + }; - /** - * When you delete a resource group, all of its resources are also deleted. Deleting a resource - * group deletes all of its template deployments and currently stored operations. - * @summary Deletes a resource group. - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. - * @param [options] The optional parameters - * @returns Promise - */ - beginDeleteMethod( - resourceGroupName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - options - }, - beginDeleteMethodOperationSpec, - options + const lro = new CoreClientLro( + sendOperation, + { resourceGroupName, parameters, options }, + exportTemplateOperationSpec, + "location" ); + return new LroEngine(lro, { intervalInMs: options?.updateIntervalInMs }); } /** * Captures the specified resource group as a template. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param parameters Parameters for exporting the template. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginExportTemplate( + async beginExportTemplateAndWait( resourceGroupName: string, - parameters: Models.ExportTemplateRequest, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - parameters, - options - }, - beginExportTemplateOperationSpec, + parameters: ExportTemplateRequest, + options?: ResourceGroupsExportTemplateOptionalParams + ): Promise { + const poller = await this.beginExportTemplate( + resourceGroupName, + parameters, options ); + return poller.pollUntilDone(); } /** * Gets all the resource groups for a subscription. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listNext( - nextPageLink: string, - options?: Models.ResourceGroupsListNextOptionalParams - ): Promise; + private _list( + options?: ResourceGroupsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @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, - callback: msRest.ServiceCallback - ): void; + private _listNext( + nextLink: string, + options?: ResourceGroupsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNextNext + * @param nextLink The nextLink from the previous successful call to the ListNext method. + * @param options The options parameters. */ - listNext( - nextPageLink: string, - options: Models.ResourceGroupsListNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listNext( - nextPageLink: string, - options?: - | Models.ResourceGroupsListNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listNextNext( + nextLink: string, + options?: ResourceGroupsListNextNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback - ) as Promise; + { nextLink, options }, + listNextNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const checkExistenceOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const checkExistenceOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", httpMethod: "HEAD", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", - urlParameters: [Parameters.resourceGroupName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 204: {}, 404: {}, @@ -392,22 +415,18 @@ const checkExistenceOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], serializer }; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", - urlParameters: [Parameters.resourceGroupName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.ResourceGroup, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.ResourceGroup @@ -419,15 +438,41 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + requestBody: Parameters.parameters6, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const getOperationSpec: msRest.OperationSpec = { +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.forceDeletionTypes], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", - urlParameters: [Parameters.resourceGroupName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.ResourceGroup @@ -436,22 +481,18 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], serializer }; - -const updateOperationSpec: msRest.OperationSpec = { +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", - urlParameters: [Parameters.resourceGroupName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.ResourceGroupPatchable, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.ResourceGroup @@ -460,74 +501,88 @@ const updateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + requestBody: Parameters.parameters7, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourcegroups", - urlParameters: [Parameters.subscriptionId], - queryParameters: [Parameters.filter, Parameters.top, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], +const exportTemplateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/exportTemplate", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.ResourceGroupListResult + bodyMapper: Mappers.ResourceGroupExportResult + }, + 201: { + bodyMapper: Mappers.ResourceGroupExportResult + }, + 202: { + bodyMapper: Mappers.ResourceGroupExportResult + }, + 204: { + bodyMapper: Mappers.ResourceGroupExportResult }, default: { bodyMapper: Mappers.CloudError } }, + requestBody: Parameters.parameters8, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName1 + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", - urlParameters: [Parameters.resourceGroupName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourcegroups", + httpMethod: "GET", responses: { - 200: {}, - 202: {}, + 200: { + bodyMapper: Mappers.ResourceGroupListResult + }, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const beginExportTemplateOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/exportTemplate", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.ExportTemplateRequest, - required: true - } - }, +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ResourceGroupExportResult + bodyMapper: Mappers.ResourceGroupListResult }, - 202: {}, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.filter, Parameters.top, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ResourceGroupListResult @@ -536,5 +591,12 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/resources/arm-resources/src/operations/resources.ts b/sdk/resources/arm-resources/src/operations/resources.ts index 5433d06caac8..ebfe59e53210 100644 --- a/sdk/resources/arm-resources/src/operations/resources.ts +++ b/sdk/resources/arm-resources/src/operations/resources.ts @@ -3,24 +3,65 @@ * 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/resourcesMappers"; +import "@azure/core-paging"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Resources } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ResourceManagementClientContext } from "../resourceManagementClientContext"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { LroEngine } from "../lro"; +import { CoreClientLro, shouldDeserializeLro } from "../coreClientLro"; +import { + GenericResourceExpanded, + ResourcesListByResourceGroupNextOptionalParams, + ResourcesListByResourceGroupOptionalParams, + ResourcesListNextOptionalParams, + ResourcesListOptionalParams, + ResourcesListByResourceGroupNextNextOptionalParams, + ResourcesListNextNextOptionalParams, + ResourcesListByResourceGroupResponse, + ResourcesMoveInfo, + ResourcesMoveResourcesOptionalParams, + ResourcesValidateMoveResourcesOptionalParams, + ResourcesListResponse, + ResourcesCheckExistenceOptionalParams, + ResourcesCheckExistenceResponse, + ResourcesDeleteOptionalParams, + GenericResource, + ResourcesCreateOrUpdateOptionalParams, + ResourcesCreateOrUpdateResponse, + ResourcesUpdateOptionalParams, + ResourcesUpdateResponse, + ResourcesGetOptionalParams, + ResourcesGetResponse, + ResourcesCheckExistenceByIdOptionalParams, + ResourcesCheckExistenceByIdResponse, + ResourcesDeleteByIdOptionalParams, + ResourcesCreateOrUpdateByIdOptionalParams, + ResourcesCreateOrUpdateByIdResponse, + ResourcesUpdateByIdOptionalParams, + ResourcesUpdateByIdResponse, + ResourcesGetByIdOptionalParams, + ResourcesGetByIdResponse, + ResourcesListByResourceGroupNextResponse, + ResourcesListNextResponse, + ResourcesListByResourceGroupNextNextResponse, + ResourcesListNextNextResponse +} from "../models"; +/// /** Class representing a Resources. */ -export class Resources { +export class ResourcesImpl implements Resources { private readonly client: ResourceManagementClientContext; /** - * Create a Resources. - * @param {ResourceManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Resources class. + * @param client Reference to the service client */ constructor(client: ResourceManagementClientContext) { this.client = client; @@ -29,158 +70,423 @@ export class Resources { /** * Get all the resources for a resource group. * @param resourceGroupName The resource group with the resources to get. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByResourceGroup( + public listByResourceGroup( resourceGroupName: string, - options?: Models.ResourcesListByResourceGroupOptionalParams - ): Promise; + options?: ResourcesListByResourceGroupOptionalParams + ): 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?: ResourcesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: ResourcesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + /** - * @param resourceGroupName The resource group with the resources to get. - * @param callback The callback + * Get all the resources in a subscription. + * @param options The options parameters. */ - listByResourceGroup( - resourceGroupName: string, - callback: msRest.ServiceCallback - ): void; + public list( + options?: ResourcesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: ResourcesListOptionalParams + ): 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?: ResourcesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + /** + * ListByResourceGroupNext * @param resourceGroupName The resource group with the resources to get. - * @param options The optional parameters - * @param callback The callback + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. */ - listByResourceGroup( + public listByResourceGroupNext( resourceGroupName: string, - options: Models.ResourcesListByResourceGroupOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByResourceGroup( + nextLink: string, + options?: ResourcesListByResourceGroupNextOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupNextPagingAll( + resourceGroupName, + nextLink, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupNextPagingPage( + resourceGroupName, + nextLink, + options + ); + } + }; + } + + private async *listByResourceGroupNextPagingPage( resourceGroupName: string, - options?: - | Models.ResourcesListByResourceGroupOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { + nextLink: string, + options?: ResourcesListByResourceGroupNextOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroupNext( + resourceGroupName, + nextLink, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNextNext( resourceGroupName, + continuationToken, options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupNextPagingAll( + resourceGroupName: string, + nextLink: string, + options?: ResourcesListByResourceGroupNextOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupNextPagingPage( + resourceGroupName, + nextLink, + options + )) { + yield* page; + } + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + public listNext( + nextLink: string, + options?: ResourcesListNextOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listNextPagingAll(nextLink, options); + return { + next() { + return iter.next(); }, - listByResourceGroupOperationSpec, - callback - ) as Promise; + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listNextPagingPage(nextLink, options); + } + }; + } + + private async *listNextPagingPage( + nextLink: string, + options?: ResourcesListNextOptionalParams + ): AsyncIterableIterator { + let result = await this._listNext(nextLink, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNextNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listNextPagingAll( + nextLink: string, + options?: ResourcesListNextOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listNextPagingPage(nextLink, options)) { + yield* page; + } + } + + /** + * Get all the resources for a resource group. + * @param resourceGroupName The resource group with the resources to get. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: ResourcesListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); } /** - * The resources to move must be in the same source resource group. The target resource group may - * be in a different subscription. When moving resources, both the source group and the target - * group are locked for the duration of the operation. Write and delete operations are blocked on - * the groups until the move completes. - * @summary Moves resources from one resource group to another resource group. - * @param sourceResourceGroupName The name of the resource group containing the resources to move. + * The resources to be moved must be in the same source resource group in the source subscription being + * used. The target resource group may be in a different subscription. When moving resources, both the + * source group and the target group are locked for the duration of the operation. Write and delete + * operations are blocked on the groups until the move completes. + * @param sourceResourceGroupName The name of the resource group from the source subscription + * containing the resources to be moved. * @param parameters Parameters for moving resources. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - moveResources( + async beginMoveResources( sourceResourceGroupName: string, - parameters: Models.ResourcesMoveInfo, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginMoveResources(sourceResourceGroupName, parameters, options).then((lroPoller) => - lroPoller.pollUntilFinished() + parameters: ResourcesMoveInfo, + options?: ResourcesMoveResourcesOptionalParams + ): 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 CoreClientLro( + sendOperation, + { sourceResourceGroupName, parameters, options }, + moveResourcesOperationSpec ); + return new LroEngine(lro, { intervalInMs: options?.updateIntervalInMs }); } /** - * This operation checks whether the specified resources can be moved to the target. The resources - * to move must be in the same source resource group. The target resource group may be in a - * different subscription. If validation succeeds, it returns HTTP response code 204 (no content). - * If validation fails, it returns HTTP response code 409 (Conflict) with an error message. - * Retrieve the URL in the Location header value to check the result of the long-running operation. - * @summary Validates whether resources can be moved from one resource group to another resource - * group. - * @param sourceResourceGroupName The name of the resource group containing the resources to - * validate for move. + * The resources to be moved must be in the same source resource group in the source subscription being + * used. The target resource group may be in a different subscription. When moving resources, both the + * source group and the target group are locked for the duration of the operation. Write and delete + * operations are blocked on the groups until the move completes. + * @param sourceResourceGroupName The name of the resource group from the source subscription + * containing the resources to be moved. * @param parameters Parameters for moving resources. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - validateMoveResources( + async beginMoveResourcesAndWait( sourceResourceGroupName: string, - parameters: Models.ResourcesMoveInfo, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginValidateMoveResources( + parameters: ResourcesMoveInfo, + options?: ResourcesMoveResourcesOptionalParams + ): Promise { + const poller = await this.beginMoveResources( sourceResourceGroupName, parameters, options - ).then((lroPoller) => lroPoller.pollUntilFinished()); + ); + return poller.pollUntilDone(); } /** - * Get all the resources in a subscription. - * @param [options] The optional parameters - * @returns Promise + * This operation checks whether the specified resources can be moved to the target. The resources to + * be moved must be in the same source resource group in the source subscription being used. The target + * resource group may be in a different subscription. If validation succeeds, it returns HTTP response + * code 204 (no content). If validation fails, it returns HTTP response code 409 (Conflict) with an + * error message. Retrieve the URL in the Location header value to check the result of the long-running + * operation. + * @param sourceResourceGroupName The name of the resource group from the source subscription + * containing the resources to be validated for move. + * @param parameters Parameters for moving resources. + * @param options The options parameters. */ - list(options?: Models.ResourcesListOptionalParams): Promise; + async beginValidateMoveResources( + sourceResourceGroupName: string, + parameters: ResourcesMoveInfo, + options?: ResourcesValidateMoveResourcesOptionalParams + ): 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 CoreClientLro( + sendOperation, + { sourceResourceGroupName, parameters, options }, + validateMoveResourcesOperationSpec + ); + return new LroEngine(lro, { intervalInMs: options?.updateIntervalInMs }); + } + /** - * @param callback The callback + * This operation checks whether the specified resources can be moved to the target. The resources to + * be moved must be in the same source resource group in the source subscription being used. The target + * resource group may be in a different subscription. If validation succeeds, it returns HTTP response + * code 204 (no content). If validation fails, it returns HTTP response code 409 (Conflict) with an + * error message. Retrieve the URL in the Location header value to check the result of the long-running + * operation. + * @param sourceResourceGroupName The name of the resource group from the source subscription + * containing the resources to be validated for move. + * @param parameters Parameters for moving resources. + * @param options The options parameters. */ - list(callback: msRest.ServiceCallback): void; + async beginValidateMoveResourcesAndWait( + sourceResourceGroupName: string, + parameters: ResourcesMoveInfo, + options?: ResourcesValidateMoveResourcesOptionalParams + ): Promise { + const poller = await this.beginValidateMoveResources( + sourceResourceGroupName, + parameters, + options + ); + return poller.pollUntilDone(); + } + /** - * @param options The optional parameters - * @param callback The callback + * Get all the resources in a subscription. + * @param options The options parameters. */ - list( - options: Models.ResourcesListOptionalParams, - callback: msRest.ServiceCallback - ): void; - list( - options?: - | Models.ResourcesListOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback - ) as Promise; + private _list( + options?: ResourcesListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); } /** * Checks whether a resource exists. - * @param resourceGroupName The name of the resource group containing the resource to check. The - * name is case insensitive. - * @param resourceProviderNamespace The resource provider of the resource to check. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to check whether it exists. - * @param apiVersion The API version to use for the operation. - * @param [options] The optional parameters - * @returns Promise - */ - checkExistence( - resourceGroupName: string, - resourceProviderNamespace: string, - parentResourcePath: string, - resourceType: string, - resourceName: string, - apiVersion: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName The name of the resource group containing the resource to check. The - * name is case insensitive. + * @param resourceGroupName The name of the resource group containing the resource to check. The name + * is case insensitive. * @param resourceProviderNamespace The resource provider of the resource to check. * @param parentResourcePath The parent resource identity. * @param resourceType The resource type. * @param resourceName The name of the resource to check whether it exists. * @param apiVersion The API version to use for the operation. - * @param callback The callback + * @param options The options parameters. */ checkExistence( resourceGroupName: string, @@ -189,40 +495,83 @@ export class Resources { resourceType: string, resourceName: string, apiVersion: string, - callback: msRest.ServiceCallback - ): void; + options?: ResourcesCheckExistenceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + options + }, + checkExistenceOperationSpec + ); + } + /** - * @param resourceGroupName The name of the resource group containing the resource to check. The - * name is case insensitive. - * @param resourceProviderNamespace The resource provider of the resource to check. + * Deletes a resource. + * @param resourceGroupName The name of the resource group that contains the resource to delete. The + * name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. * @param parentResourcePath The parent resource identity. * @param resourceType The resource type. - * @param resourceName The name of the resource to check whether it exists. + * @param resourceName The name of the resource to delete. * @param apiVersion The API version to use for the operation. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - checkExistence( - resourceGroupName: string, - resourceProviderNamespace: string, - parentResourcePath: string, - resourceType: string, - resourceName: string, - apiVersion: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - checkExistence( + async beginDelete( resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( + options?: ResourcesDeleteOptionalParams + ): 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 CoreClientLro( + sendOperation, { resourceGroupName, resourceProviderNamespace, @@ -232,33 +581,32 @@ export class Resources { apiVersion, options }, - checkExistenceOperationSpec, - callback - ) as Promise; + deleteOperationSpec + ); + return new LroEngine(lro, { intervalInMs: options?.updateIntervalInMs }); } /** * Deletes a resource. - * @param resourceGroupName The name of the resource group that contains the resource to delete. - * The name is case insensitive. + * @param resourceGroupName The name of the resource group that contains the resource to delete. The + * name is case insensitive. * @param resourceProviderNamespace The namespace of the resource provider. * @param parentResourcePath The parent resource identity. * @param resourceType The resource type. * @param resourceName The name of the resource to delete. * @param apiVersion The API version to use for the operation. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod( + async beginDeleteAndWait( resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginDeleteMethod( + options?: ResourcesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( resourceGroupName, resourceProviderNamespace, parentResourcePath, @@ -266,70 +614,116 @@ export class Resources { resourceName, apiVersion, options - ).then((lroPoller) => lroPoller.pollUntilFinished()); + ); + return poller.pollUntilDone(); } /** * Creates a resource. * @param resourceGroupName The name of the resource group for the resource. The name is case - * insensitive. + * insensitive. * @param resourceProviderNamespace The namespace of the resource provider. * @param parentResourcePath The parent resource identity. * @param resourceType The resource type of the resource to create. * @param resourceName The name of the resource to create. * @param apiVersion The API version to use for the operation. * @param parameters Parameters for creating or updating the resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdate( + async beginCreateOrUpdate( resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, - parameters: Models.GenericResource, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginCreateOrUpdate( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - parameters, - options - ).then((lroPoller) => lroPoller.pollUntilFinished()) as Promise< - Models.ResourcesCreateOrUpdateResponse - >; + parameters: GenericResource, + options?: ResourcesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ResourcesCreateOrUpdateResponse + > + > { + 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 CoreClientLro( + sendOperation, + { + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + parameters, + options + }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { intervalInMs: options?.updateIntervalInMs }); } /** - * Updates a resource. + * Creates a resource. * @param resourceGroupName The name of the resource group for the resource. The name is case - * insensitive. + * insensitive. * @param resourceProviderNamespace The namespace of the resource provider. * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. + * @param resourceType The resource type of the resource to create. + * @param resourceName The name of the resource to create. * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. - * @param [options] The optional parameters - * @returns Promise + * @param parameters Parameters for creating or updating the resource. + * @param options The options parameters. */ - update( + async beginCreateOrUpdateAndWait( resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, - parameters: Models.GenericResource, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginUpdate( + parameters: GenericResource, + options?: ResourcesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( resourceGroupName, resourceProviderNamespace, parentResourcePath, @@ -338,59 +732,138 @@ export class Resources { apiVersion, parameters, options - ).then((lroPoller) => lroPoller.pollUntilFinished()) as Promise; + ); + return poller.pollUntilDone(); } /** - * Gets a resource. - * @param resourceGroupName The name of the resource group containing the resource to get. The name - * is case insensitive. + * Updates a resource. + * @param resourceGroupName The name of the resource group for the resource. The name is case + * insensitive. * @param resourceProviderNamespace The namespace of the resource provider. * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get. + * @param resourceType The resource type of the resource to update. + * @param resourceName The name of the resource to update. * @param apiVersion The API version to use for the operation. - * @param [options] The optional parameters - * @returns Promise + * @param parameters Parameters for updating the resource. + * @param options The options parameters. */ - get( + async beginUpdate( resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, - options?: msRest.RequestOptionsBase - ): Promise; + parameters: GenericResource, + options?: ResourcesUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ResourcesUpdateResponse + > + > { + 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 CoreClientLro( + sendOperation, + { + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + parameters, + options + }, + updateOperationSpec + ); + return new LroEngine(lro, { intervalInMs: options?.updateIntervalInMs }); + } + /** - * @param resourceGroupName The name of the resource group containing the resource to get. The name - * is case insensitive. + * Updates a resource. + * @param resourceGroupName The name of the resource group for the resource. The name is case + * insensitive. * @param resourceProviderNamespace The namespace of the resource provider. * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get. + * @param resourceType The resource type of the resource to update. + * @param resourceName The name of the resource to update. * @param apiVersion The API version to use for the operation. - * @param callback The callback + * @param parameters Parameters for updating the resource. + * @param options The options parameters. */ - get( + async beginUpdateAndWait( resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, - callback: msRest.ServiceCallback - ): void; + parameters: GenericResource, + options?: ResourcesUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + parameters, + options + ); + return poller.pollUntilDone(); + } + /** - * @param resourceGroupName The name of the resource group containing the resource to get. The name - * is case insensitive. + * Gets a resource. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is + * case insensitive. * @param resourceProviderNamespace The namespace of the resource provider. * @param parentResourcePath The parent resource identity. * @param resourceType The resource type of the resource. * @param resourceName The name of the resource to get. * @param apiVersion The API version to use for the operation. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ get( resourceGroupName: string, @@ -399,19 +872,8 @@ export class Resources { resourceType: string, resourceName: string, apiVersion: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - get( - resourceGroupName: string, - resourceProviderNamespace: string, - parentResourcePath: string, - resourceType: string, - resourceName: string, - apiVersion: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: ResourcesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -422,556 +884,379 @@ export class Resources { apiVersion, options }, - getOperationSpec, - callback - ) as Promise; + getOperationSpec + ); } /** * Checks by ID whether a resource exists. - * @param resourceId The fully qualified ID of the resource, including the resource name and - * resource type. Use the format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + * @param resourceId The fully qualified ID of the resource, including the resource name and resource + * type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} * @param apiVersion The API version to use for the operation. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ checkExistenceById( resourceId: string, apiVersion: string, - options?: msRest.RequestOptionsBase - ): Promise; + options?: ResourcesCheckExistenceByIdOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceId, apiVersion, options }, + checkExistenceByIdOperationSpec + ); + } + /** - * @param resourceId The fully qualified ID of the resource, including the resource name and - * resource type. Use the format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + * Deletes a resource by ID. + * @param resourceId The fully qualified ID of the resource, including the resource name and resource + * type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} * @param apiVersion The API version to use for the operation. - * @param callback The callback + * @param options The options parameters. */ - checkExistenceById( + async beginDeleteById( resourceId: string, apiVersion: string, - callback: msRest.ServiceCallback - ): void; + options?: ResourcesDeleteByIdOptionalParams + ): 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 CoreClientLro( + sendOperation, + { resourceId, apiVersion, options }, + deleteByIdOperationSpec + ); + return new LroEngine(lro, { intervalInMs: options?.updateIntervalInMs }); + } + /** - * @param resourceId The fully qualified ID of the resource, including the resource name and - * resource type. Use the format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + * Deletes a resource by ID. + * @param resourceId The fully qualified ID of the resource, including the resource name and resource + * type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} * @param apiVersion The API version to use for the operation. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - checkExistenceById( - resourceId: string, - apiVersion: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - checkExistenceById( + async beginDeleteByIdAndWait( resourceId: string, apiVersion: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - resourceId, - apiVersion, - options - }, - checkExistenceByIdOperationSpec, - callback - ) as Promise; + options?: ResourcesDeleteByIdOptionalParams + ): Promise { + const poller = await this.beginDeleteById(resourceId, apiVersion, options); + return poller.pollUntilDone(); } /** - * Deletes a resource by ID. - * @param resourceId The fully qualified ID of the resource, including the resource name and - * resource type. Use the format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + * Create a resource by ID. + * @param resourceId The fully qualified ID of the resource, including the resource name and resource + * type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} * @param apiVersion The API version to use for the operation. - * @param [options] The optional parameters - * @returns Promise + * @param parameters Create or update resource parameters. + * @param options The options parameters. */ - deleteById( + async beginCreateOrUpdateById( resourceId: string, apiVersion: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginDeleteById(resourceId, apiVersion, options).then((lroPoller) => - lroPoller.pollUntilFinished() + parameters: GenericResource, + options?: ResourcesCreateOrUpdateByIdOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ResourcesCreateOrUpdateByIdResponse + > + > { + 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 CoreClientLro( + sendOperation, + { resourceId, apiVersion, parameters, options }, + createOrUpdateByIdOperationSpec ); + return new LroEngine(lro, { intervalInMs: options?.updateIntervalInMs }); } /** * Create a resource by ID. - * @param resourceId The fully qualified ID of the resource, including the resource name and - * resource type. Use the format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + * @param resourceId The fully qualified ID of the resource, including the resource name and resource + * type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} * @param apiVersion The API version to use for the operation. * @param parameters Create or update resource parameters. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdateById( + async beginCreateOrUpdateByIdAndWait( resourceId: string, apiVersion: string, - parameters: Models.GenericResource, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginCreateOrUpdateById( + parameters: GenericResource, + options?: ResourcesCreateOrUpdateByIdOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdateById( resourceId, apiVersion, parameters, options - ).then((lroPoller) => lroPoller.pollUntilFinished()) as Promise< - Models.ResourcesCreateOrUpdateByIdResponse - >; + ); + return poller.pollUntilDone(); } /** * Updates a resource by ID. - * @param resourceId The fully qualified ID of the resource, including the resource name and - * resource type. Use the format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + * @param resourceId The fully qualified ID of the resource, including the resource name and resource + * type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} * @param apiVersion The API version to use for the operation. * @param parameters Update resource parameters. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - updateById( + async beginUpdateById( resourceId: string, apiVersion: string, - parameters: Models.GenericResource, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginUpdateById(resourceId, apiVersion, parameters, options).then((lroPoller) => - lroPoller.pollUntilFinished() - ) as Promise; + parameters: GenericResource, + options?: ResourcesUpdateByIdOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ResourcesUpdateByIdResponse + > + > { + 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 CoreClientLro( + sendOperation, + { resourceId, apiVersion, parameters, options }, + updateByIdOperationSpec + ); + return new LroEngine(lro, { intervalInMs: options?.updateIntervalInMs }); } /** - * Gets a resource by ID. - * @param resourceId The fully qualified ID of the resource, including the resource name and - * resource type. Use the format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + * Updates a resource by ID. + * @param resourceId The fully qualified ID of the resource, including the resource name and resource + * type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} * @param apiVersion The API version to use for the operation. - * @param [options] The optional parameters - * @returns Promise + * @param parameters Update resource parameters. + * @param options The options parameters. */ - getById( + async beginUpdateByIdAndWait( resourceId: string, apiVersion: string, - options?: msRest.RequestOptionsBase - ): Promise; + parameters: GenericResource, + options?: ResourcesUpdateByIdOptionalParams + ): Promise { + const poller = await this.beginUpdateById( + resourceId, + apiVersion, + parameters, + options + ); + return poller.pollUntilDone(); + } + /** - * @param resourceId The fully qualified ID of the resource, including the resource name and - * resource type. Use the format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + * Gets a resource by ID. + * @param resourceId The fully qualified ID of the resource, including the resource name and resource + * type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} * @param apiVersion The API version to use for the operation. - * @param callback The callback + * @param options The options parameters. */ getById( resourceId: string, apiVersion: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceId The fully qualified ID of the resource, including the resource name and - * resource type. Use the format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - * @param apiVersion The API version to use for the operation. - * @param options The optional parameters - * @param callback The callback - */ - getById( - resourceId: string, - apiVersion: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getById( - resourceId: string, - apiVersion: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: ResourcesGetByIdOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceId, - apiVersion, - options - }, - getByIdOperationSpec, - callback - ) as Promise; - } - - /** - * The resources to move must be in the same source resource group. The target resource group may - * be in a different subscription. When moving resources, both the source group and the target - * group are locked for the duration of the operation. Write and delete operations are blocked on - * the groups until the move completes. - * @summary Moves resources from one resource group to another resource group. - * @param sourceResourceGroupName The name of the resource group containing the resources to move. - * @param parameters Parameters for moving resources. - * @param [options] The optional parameters - * @returns Promise - */ - beginMoveResources( - sourceResourceGroupName: string, - parameters: Models.ResourcesMoveInfo, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - sourceResourceGroupName, - parameters, - options - }, - beginMoveResourcesOperationSpec, - options + { resourceId, apiVersion, options }, + getByIdOperationSpec ); } /** - * This operation checks whether the specified resources can be moved to the target. The resources - * to move must be in the same source resource group. The target resource group may be in a - * different subscription. If validation succeeds, it returns HTTP response code 204 (no content). - * If validation fails, it returns HTTP response code 409 (Conflict) with an error message. - * Retrieve the URL in the Location header value to check the result of the long-running operation. - * @summary Validates whether resources can be moved from one resource group to another resource - * group. - * @param sourceResourceGroupName The name of the resource group containing the resources to - * validate for move. - * @param parameters Parameters for moving resources. - * @param [options] The optional parameters - * @returns Promise - */ - beginValidateMoveResources( - sourceResourceGroupName: string, - parameters: Models.ResourcesMoveInfo, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - sourceResourceGroupName, - parameters, - options - }, - beginValidateMoveResourcesOperationSpec, - options - ); - } - - /** - * Deletes a resource. - * @param resourceGroupName The name of the resource group that contains the resource to delete. - * The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. - * @param [options] The optional parameters - * @returns Promise + * ListByResourceGroupNext + * @param resourceGroupName The resource group with the resources to get. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. */ - beginDeleteMethod( + private _listByResourceGroupNext( resourceGroupName: string, - resourceProviderNamespace: string, - parentResourcePath: string, - resourceType: string, - resourceName: string, - apiVersion: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - options - }, - beginDeleteMethodOperationSpec, - options + nextLink: string, + options?: ResourcesListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec ); } /** - * Creates a resource. - * @param resourceGroupName The name of the resource group for the resource. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. - * @param [options] The optional parameters - * @returns Promise + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - beginCreateOrUpdate( - resourceGroupName: string, - resourceProviderNamespace: string, - parentResourcePath: string, - resourceType: string, - resourceName: string, - apiVersion: string, - parameters: Models.GenericResource, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - parameters, - options - }, - beginCreateOrUpdateOperationSpec, - options + private _listNext( + nextLink: string, + options?: ResourcesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec ); } /** - * Updates a resource. - * @param resourceGroupName The name of the resource group for the resource. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. - * @param [options] The optional parameters - * @returns Promise + * ListByResourceGroupNextNext + * @param resourceGroupName The resource group with the resources to get. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroupNext + * method. + * @param options The options parameters. */ - beginUpdate( + private _listByResourceGroupNextNext( resourceGroupName: string, - resourceProviderNamespace: string, - parentResourcePath: string, - resourceType: string, - resourceName: string, - apiVersion: string, - parameters: Models.GenericResource, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - apiVersion, - parameters, - options - }, - beginUpdateOperationSpec, - options - ); - } - - /** - * Deletes a resource by ID. - * @param resourceId The fully qualified ID of the resource, including the resource name and - * resource type. Use the format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - * @param apiVersion The API version to use for the operation. - * @param [options] The optional parameters - * @returns Promise - */ - beginDeleteById( - resourceId: string, - apiVersion: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - resourceId, - apiVersion, - options - }, - beginDeleteByIdOperationSpec, - options - ); - } - - /** - * Create a resource by ID. - * @param resourceId The fully qualified ID of the resource, including the resource name and - * resource type. Use the format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. - * @param [options] The optional parameters - * @returns Promise - */ - beginCreateOrUpdateById( - resourceId: string, - apiVersion: string, - parameters: Models.GenericResource, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - resourceId, - apiVersion, - parameters, - options - }, - beginCreateOrUpdateByIdOperationSpec, - options - ); - } - - /** - * Updates a resource by ID. - * @param resourceId The fully qualified ID of the resource, including the resource name and - * resource type. Use the format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. - * @param [options] The optional parameters - * @returns Promise - */ - beginUpdateById( - resourceId: string, - apiVersion: string, - parameters: Models.GenericResource, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - resourceId, - apiVersion, - parameters, - options - }, - beginUpdateByIdOperationSpec, - options - ); - } - - /** - * Get all the resources for a 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?: Models.ResourcesListByResourceGroupNextOptionalParams - ): 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: Models.ResourcesListByResourceGroupNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByResourceGroupNext( - nextPageLink: string, - options?: - | Models.ResourcesListByResourceGroupNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + nextLink: string, + options?: ResourcesListByResourceGroupNextNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByResourceGroupNextOperationSpec, - callback - ) as Promise; + { resourceGroupName, nextLink, options }, + listByResourceGroupNextNextOperationSpec + ); } /** - * Get all the resources in a subscription. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext( - nextPageLink: string, - options?: Models.ResourcesListNextOptionalParams - ): 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 + * ListNextNext + * @param nextLink The nextLink from the previous successful call to the ListNext method. + * @param options The options parameters. */ - listNext( - nextPageLink: string, - options: Models.ResourcesListNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listNext( - nextPageLink: string, - options?: - | Models.ResourcesListNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listNextNext( + nextLink: string, + options?: ResourcesListNextNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback - ) as Promise; + { nextLink, options }, + listNextNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByResourceGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources", - urlParameters: [Parameters.resourceGroupName, Parameters.subscriptionId], - queryParameters: [Parameters.filter, Parameters.expand, Parameters.top, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.ResourceListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const listOperationSpec: msRest.OperationSpec = { +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resources", - urlParameters: [Parameters.subscriptionId], - queryParameters: [Parameters.filter, Parameters.expand, Parameters.top, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.ResourceListResult @@ -980,184 +1265,179 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top, + Parameters.expand + ], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], serializer }; - -const checkExistenceOperationSpec: msRest.OperationSpec = { - httpMethod: "HEAD", +const moveResourcesOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.resourceProviderNamespace, - Parameters.parentResourcePath, - Parameters.resourceType, - Parameters.resourceName, - Parameters.subscriptionId - ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources", + httpMethod: "POST", responses: { + 200: {}, + 201: {}, + 202: {}, 204: {}, - 404: {}, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", + requestBody: Parameters.parameters4, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.resourceGroupName, - Parameters.resourceProviderNamespace, - Parameters.parentResourcePath, - Parameters.resourceType, - Parameters.resourceName, - Parameters.subscriptionId + Parameters.$host, + Parameters.subscriptionId, + Parameters.sourceResourceGroupName ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.GenericResource - }, - default: { - bodyMapper: Mappers.CloudError - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const checkExistenceByIdOperationSpec: msRest.OperationSpec = { - httpMethod: "HEAD", - path: "{resourceId}", - urlParameters: [Parameters.resourceId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], +const validateMoveResourcesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/validateMoveResources", + httpMethod: "POST", responses: { + 200: {}, + 201: {}, + 202: {}, 204: {}, - 404: {}, default: { bodyMapper: Mappers.CloudError } }, + requestBody: Parameters.parameters4, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.sourceResourceGroupName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const getByIdOperationSpec: msRest.OperationSpec = { +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resources", httpMethod: "GET", - path: "{resourceId}", - urlParameters: [Parameters.resourceId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { - bodyMapper: Mappers.GenericResource + bodyMapper: Mappers.ResourceListResult }, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top, + Parameters.expand + ], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const beginMoveResourcesOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources", - urlParameters: [Parameters.sourceResourceGroupName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.ResourcesMoveInfo, - required: true - } - }, +const checkExistenceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", + httpMethod: "HEAD", responses: { - 202: {}, 204: {}, + 404: {}, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion1], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceProviderNamespace, + Parameters.parentResourcePath, + Parameters.resourceType, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], serializer }; - -const beginValidateMoveResourcesOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", +const deleteOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/validateMoveResources", - urlParameters: [Parameters.sourceResourceGroupName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.ResourcesMoveInfo, - required: true - } - }, + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", + httpMethod: "DELETE", responses: { + 200: {}, + 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: - "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", + queryParameters: [Parameters.apiVersion1], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, - Parameters.resourceName, - Parameters.subscriptionId + Parameters.resourceName ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", + httpMethod: "PUT", responses: { - 200: {}, - 202: {}, - 204: {}, + 200: { + bodyMapper: Mappers.GenericResource + }, + 201: { + bodyMapper: Mappers.GenericResource + }, + 202: { + bodyMapper: Mappers.GenericResource + }, + 204: { + bodyMapper: Mappers.GenericResource + }, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: - "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", + requestBody: Parameters.parameters5, + queryParameters: [Parameters.apiVersion1], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, - Parameters.resourceName, - Parameters.subscriptionId + Parameters.resourceName ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.GenericResource, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.GenericResource @@ -1165,77 +1445,91 @@ const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { 201: { bodyMapper: Mappers.GenericResource }, - 202: {}, + 202: { + bodyMapper: Mappers.GenericResource + }, + 204: { + bodyMapper: Mappers.GenericResource + }, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: - "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", + requestBody: Parameters.parameters5, + queryParameters: [Parameters.apiVersion1], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, - Parameters.resourceName, - Parameters.subscriptionId + Parameters.resourceName ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.GenericResource, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.GenericResource }, - 202: {}, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion1], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceProviderNamespace, + Parameters.parentResourcePath, + Parameters.resourceType, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], serializer }; - -const beginDeleteByIdOperationSpec: msRest.OperationSpec = { +const checkExistenceByIdOperationSpec: coreClient.OperationSpec = { + path: "/{resourceId}", + httpMethod: "HEAD", + responses: { + 204: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion1], + urlParameters: [Parameters.$host, Parameters.resourceId], + headerParameters: [Parameters.accept], + serializer +}; +const deleteByIdOperationSpec: coreClient.OperationSpec = { + path: "/{resourceId}", httpMethod: "DELETE", - path: "{resourceId}", - urlParameters: [Parameters.resourceId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: {}, + 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion1], + urlParameters: [Parameters.$host, Parameters.resourceId], + headerParameters: [Parameters.accept], serializer }; - -const beginCreateOrUpdateByIdOperationSpec: msRest.OperationSpec = { +const createOrUpdateByIdOperationSpec: coreClient.OperationSpec = { + path: "/{resourceId}", httpMethod: "PUT", - path: "{resourceId}", - urlParameters: [Parameters.resourceId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.GenericResource, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.GenericResource @@ -1243,46 +1537,95 @@ const beginCreateOrUpdateByIdOperationSpec: msRest.OperationSpec = { 201: { bodyMapper: Mappers.GenericResource }, - 202: {}, + 202: { + bodyMapper: Mappers.GenericResource + }, + 204: { + bodyMapper: Mappers.GenericResource + }, default: { bodyMapper: Mappers.CloudError } }, + requestBody: Parameters.parameters5, + queryParameters: [Parameters.apiVersion1], + urlParameters: [Parameters.$host, Parameters.resourceId], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const beginUpdateByIdOperationSpec: msRest.OperationSpec = { +const updateByIdOperationSpec: coreClient.OperationSpec = { + path: "/{resourceId}", httpMethod: "PATCH", - path: "{resourceId}", - urlParameters: [Parameters.resourceId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.GenericResource, - required: true + responses: { + 200: { + bodyMapper: Mappers.GenericResource + }, + 201: { + bodyMapper: Mappers.GenericResource + }, + 202: { + bodyMapper: Mappers.GenericResource + }, + 204: { + bodyMapper: Mappers.GenericResource + }, + default: { + bodyMapper: Mappers.CloudError } }, + requestBody: Parameters.parameters5, + queryParameters: [Parameters.apiVersion1], + urlParameters: [Parameters.$host, Parameters.resourceId], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getByIdOperationSpec: coreClient.OperationSpec = { + path: "/{resourceId}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.GenericResource }, - 202: {}, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion1], + urlParameters: [Parameters.$host, Parameters.resourceId], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", httpMethod: "GET", - baseUrl: "https://management.azure.com", + responses: { + 200: { + bodyMapper: Mappers.ResourceListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top, + Parameters.expand + ], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.filter, Parameters.expand, Parameters.top, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ResourceListResult @@ -1291,16 +1634,49 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top, + Parameters.expand + ], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { +const listByResourceGroupNextNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", httpMethod: "GET", - baseUrl: "https://management.azure.com", + responses: { + 200: { + bodyMapper: Mappers.ResourceListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top, + Parameters.expand + ], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.filter, Parameters.expand, Parameters.top, Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ResourceListResult @@ -1309,5 +1685,17 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top, + Parameters.expand + ], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/resources/arm-resources/src/operations/tagsOperations.ts b/sdk/resources/arm-resources/src/operations/tagsOperations.ts index de5d8e5d3bc2..979890248dfa 100644 --- a/sdk/resources/arm-resources/src/operations/tagsOperations.ts +++ b/sdk/resources/arm-resources/src/operations/tagsOperations.ts @@ -3,212 +3,213 @@ * 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/tagsOperationsMappers"; +import "@azure/core-paging"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { TagsOperations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ResourceManagementClientContext } from "../resourceManagementClientContext"; +import { + TagDetails, + TagsOperationsListNextOptionalParams, + TagsOperationsListOptionalParams, + TagsOperationsListNextNextOptionalParams, + TagsOperationsDeleteValueOptionalParams, + TagsOperationsCreateOrUpdateValueOptionalParams, + TagsOperationsCreateOrUpdateValueResponse, + TagsOperationsCreateOrUpdateOptionalParams, + TagsOperationsCreateOrUpdateResponse, + TagsOperationsDeleteOptionalParams, + TagsOperationsListResponse, + TagsResource, + TagsOperationsCreateOrUpdateAtScopeOptionalParams, + TagsOperationsCreateOrUpdateAtScopeResponse, + TagsPatchResource, + TagsOperationsUpdateAtScopeOptionalParams, + TagsOperationsUpdateAtScopeResponse, + TagsOperationsGetAtScopeOptionalParams, + TagsOperationsGetAtScopeResponse, + TagsOperationsDeleteAtScopeOptionalParams, + TagsOperationsListNextResponse, + TagsOperationsListNextNextResponse +} from "../models"; +/// /** Class representing a TagsOperations. */ -export class TagsOperations { +export class TagsOperationsImpl implements TagsOperations { private readonly client: ResourceManagementClientContext; /** - * Create a TagsOperations. - * @param {ResourceManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class TagsOperations class. + * @param client Reference to the service client */ constructor(client: ResourceManagementClientContext) { this.client = client; } /** - * This operation allows deleting a value from the list of predefined values for an existing - * predefined tag name. The value being deleted must not be in use as a tag value for the given tag - * name for any resource. - * @summary Deletes a predefined tag value for a predefined tag name. - * @param tagName The name of the tag. - * @param tagValue The value of the tag to delete. - * @param [options] The optional parameters - * @returns Promise + * This operation performs a union of predefined tags, resource tags, resource group tags and + * subscription tags, and returns a summary of usage for each tag name and value under the given + * subscription. In case of a large number of tags, this operation may return a previously cached + * result. + * @param options The options parameters. */ - deleteValue( - tagName: string, - tagValue: string, - options?: msRest.RequestOptionsBase - ): Promise; + public list( + options?: TagsOperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: TagsOperationsListOptionalParams + ): 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?: TagsOperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + /** - * @param tagName The name of the tag. - * @param tagValue The value of the tag to delete. - * @param callback The callback + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - deleteValue(tagName: string, tagValue: string, callback: msRest.ServiceCallback): void; + public listNext( + nextLink: string, + options?: TagsOperationsListNextOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listNextPagingAll(nextLink, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listNextPagingPage(nextLink, options); + } + }; + } + + private async *listNextPagingPage( + nextLink: string, + options?: TagsOperationsListNextOptionalParams + ): AsyncIterableIterator { + let result = await this._listNext(nextLink, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNextNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listNextPagingAll( + nextLink: string, + options?: TagsOperationsListNextOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listNextPagingPage(nextLink, options)) { + yield* page; + } + } + /** + * This operation allows deleting a value from the list of predefined values for an existing predefined + * tag name. The value being deleted must not be in use as a tag value for the given tag name for any + * resource. * @param tagName The name of the tag. * @param tagValue The value of the tag to delete. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ deleteValue( tagName: string, tagValue: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - deleteValue( - tagName: string, - tagValue: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: TagsOperationsDeleteValueOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - tagName, - tagValue, - options - }, - deleteValueOperationSpec, - callback + { tagName, tagValue, options }, + deleteValueOperationSpec ); } /** - * This operation allows adding a value to the list of predefined values for an existing predefined - * tag name. A tag value can have a maximum of 256 characters. - * @summary Creates a predefined value for a predefined tag name. - * @param tagName The name of the tag. - * @param tagValue The value of the tag to create. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdateValue( - tagName: string, - tagValue: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** + * This operation allows adding a value to the list of predefined values for an existing predefined tag + * name. A tag value can have a maximum of 256 characters. * @param tagName The name of the tag. * @param tagValue The value of the tag to create. - * @param callback The callback + * @param options The options parameters. */ createOrUpdateValue( tagName: string, tagValue: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param tagName The name of the tag. - * @param tagValue The value of the tag to create. - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdateValue( - tagName: string, - tagValue: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - createOrUpdateValue( - tagName: string, - tagValue: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: TagsOperationsCreateOrUpdateValueOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - tagName, - tagValue, - options - }, - createOrUpdateValueOperationSpec, - callback - ) as Promise; + { tagName, tagValue, options }, + createOrUpdateValueOperationSpec + ); } /** - * This operation allows adding a name to the list of predefined tag names for the given - * subscription. A tag name can have a maximum of 512 characters and is case-insensitive. Tag names - * cannot have the following prefixes which are reserved for Azure use: 'microsoft', 'azure', - * 'windows'. - * @summary Creates a predefined tag name. - * @param tagName The name of the tag to create. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdate( - tagName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param tagName The name of the tag to create. - * @param callback The callback - */ - createOrUpdate(tagName: string, callback: msRest.ServiceCallback): void; - /** + * This operation allows adding a name to the list of predefined tag names for the given subscription. + * A tag name can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the + * following prefixes which are reserved for Azure use: 'microsoft', 'azure', 'windows'. * @param tagName The name of the tag to create. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ createOrUpdate( tagName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - createOrUpdate( - tagName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: TagsOperationsCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - tagName, - options - }, - createOrUpdateOperationSpec, - callback - ) as Promise; + { tagName, options }, + createOrUpdateOperationSpec + ); } /** * This operation allows deleting a name from the list of predefined tag names for the given * subscription. The name being deleted must not be in use as a tag name for any resource. All * predefined values for the given name must have already been deleted. - * @summary Deletes a predefined tag name. - * @param tagName The name of the tag. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(tagName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param tagName The name of the tag. - * @param callback The callback - */ - deleteMethod(tagName: string, callback: msRest.ServiceCallback): void; - /** * @param tagName The name of the tag. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - deleteMethod( + delete( tagName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - deleteMethod( - tagName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: TagsOperationsDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - tagName, - options - }, - deleteMethodOperationSpec, - callback + { tagName, options }, + deleteOperationSpec ); } @@ -217,275 +218,120 @@ export class TagsOperations { * subscription tags, and returns a summary of usage for each tag name and value under the given * subscription. In case of a large number of tags, this operation may return a previously cached * result. - * @summary Gets a summary of tag usage under the subscription. - * @param [options] The optional parameters - * @returns Promise - */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - list( - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - list( - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback - ) as Promise; + private _list( + options?: TagsOperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); } /** * This operation allows adding or replacing the entire set of tags on the specified resource or * subscription. The specified entity can have a maximum of 50 tags. - * @summary Creates or updates the entire set of tags on a resource or subscription. * @param scope The resource scope. - * @param parameters - * @param [options] The optional parameters - * @returns Promise + * @param parameters Wrapper resource for tags API requests and responses. + * @param options The options parameters. */ createOrUpdateAtScope( scope: string, - parameters: Models.TagsResource, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param scope The resource scope. - * @param parameters - * @param callback The callback - */ - createOrUpdateAtScope( - scope: string, - parameters: Models.TagsResource, - callback: msRest.ServiceCallback - ): void; - /** - * @param scope The resource scope. - * @param parameters - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdateAtScope( - scope: string, - parameters: Models.TagsResource, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - createOrUpdateAtScope( - scope: string, - parameters: Models.TagsResource, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + parameters: TagsResource, + options?: TagsOperationsCreateOrUpdateAtScopeOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - scope, - parameters, - options - }, - createOrUpdateAtScopeOperationSpec, - callback - ) as Promise; + { scope, parameters, options }, + createOrUpdateAtScopeOperationSpec + ); } /** - * This operation allows replacing, merging or selectively deleting tags on the specified resource - * or subscription. The specified entity can have a maximum of 50 tags at the end of the operation. - * The 'replace' option replaces the entire set of existing tags with a new set. The 'merge' option - * allows adding tags with new names and updating the values of tags with existing names. The - * 'delete' option allows selectively deleting tags based on given names or name/value pairs. - * @summary Selectively updates the set of tags on a resource or subscription. + * This operation allows replacing, merging or selectively deleting tags on the specified resource or + * subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The + * 'replace' option replaces the entire set of existing tags with a new set. The 'merge' option allows + * adding tags with new names and updating the values of tags with existing names. The 'delete' option + * allows selectively deleting tags based on given names or name/value pairs. * @param scope The resource scope. - * @param parameters - * @param [options] The optional parameters - * @returns Promise + * @param parameters Wrapper resource for tags patch API request only. + * @param options The options parameters. */ updateAtScope( scope: string, - parameters: Models.TagsPatchResource, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param scope The resource scope. - * @param parameters - * @param callback The callback - */ - updateAtScope( - scope: string, - parameters: Models.TagsPatchResource, - callback: msRest.ServiceCallback - ): void; - /** - * @param scope The resource scope. - * @param parameters - * @param options The optional parameters - * @param callback The callback - */ - updateAtScope( - scope: string, - parameters: Models.TagsPatchResource, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - updateAtScope( - scope: string, - parameters: Models.TagsPatchResource, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + parameters: TagsPatchResource, + options?: TagsOperationsUpdateAtScopeOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - scope, - parameters, - options - }, - updateAtScopeOperationSpec, - callback - ) as Promise; + { scope, parameters, options }, + updateAtScopeOperationSpec + ); } /** - * @summary Gets the entire set of tags on a resource or subscription. - * @param scope The resource scope. - * @param [options] The optional parameters - * @returns Promise - */ - getAtScope( - scope: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** + * Gets the entire set of tags on a resource or subscription. * @param scope The resource scope. - * @param callback The callback - */ - getAtScope(scope: string, callback: msRest.ServiceCallback): void; - /** - * @param scope The resource scope. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ getAtScope( scope: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getAtScope( - scope: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: TagsOperationsGetAtScopeOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - scope, - options - }, - getAtScopeOperationSpec, - callback - ) as Promise; + { scope, options }, + getAtScopeOperationSpec + ); } /** - * @summary Deletes the entire set of tags on a resource or subscription. - * @param scope The resource scope. - * @param [options] The optional parameters - * @returns Promise - */ - deleteAtScope(scope: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param scope The resource scope. - * @param callback The callback - */ - deleteAtScope(scope: string, callback: msRest.ServiceCallback): void; - /** + * Deletes the entire set of tags on a resource or subscription. * @param scope The resource scope. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ deleteAtScope( scope: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - deleteAtScope( - scope: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: TagsOperationsDeleteAtScopeOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - scope, - options - }, - deleteAtScopeOperationSpec, - callback + { scope, options }, + deleteAtScopeOperationSpec ); } /** - * This operation performs a union of predefined tags, resource tags, resource group tags and - * subscription tags, and returns a summary of usage for each tag name and value under the given - * subscription. In case of a large number of tags, this operation may return a previously cached - * result. - * @summary Gets a summary of tag usage under the 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 + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + private _listNext( + nextLink: string, + options?: TagsOperationsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNextNext + * @param nextLink The nextLink from the previous successful call to the ListNext 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 _listNextNext( + nextLink: string, + options?: TagsOperationsListNextNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback - ) as Promise; + { nextLink, options }, + listNextNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const deleteValueOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const deleteValueOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}", httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}", - urlParameters: [Parameters.tagName, Parameters.tagValue, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: {}, 204: {}, @@ -493,15 +339,20 @@ const deleteValueOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.tagName, + Parameters.tagValue + ], + headerParameters: [Parameters.accept], serializer }; - -const createOrUpdateValueOperationSpec: msRest.OperationSpec = { +const createOrUpdateValueOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}", httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}", - urlParameters: [Parameters.tagName, Parameters.tagValue, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.TagValue @@ -513,15 +364,19 @@ const createOrUpdateValueOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.tagName, + Parameters.tagValue + ], + headerParameters: [Parameters.accept], serializer }; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/tagNames/{tagName}", httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/tagNames/{tagName}", - urlParameters: [Parameters.tagName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.TagDetails @@ -533,15 +388,18 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.tagName + ], + headerParameters: [Parameters.accept], serializer }; - -const deleteMethodOperationSpec: msRest.OperationSpec = { +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/tagNames/{tagName}", httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/tagNames/{tagName}", - urlParameters: [Parameters.tagName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: {}, 204: {}, @@ -549,15 +407,18 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.tagName + ], + headerParameters: [Parameters.accept], serializer }; - -const listOperationSpec: msRest.OperationSpec = { +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/tagNames", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/tagNames", - urlParameters: [Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.TagsListResult @@ -566,22 +427,14 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const createOrUpdateAtScopeOperationSpec: msRest.OperationSpec = { +const createOrUpdateAtScopeOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Resources/tags/default", httpMethod: "PUT", - path: "{scope}/providers/Microsoft.Resources/tags/default", - urlParameters: [Parameters.scope], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.TagsResource, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.TagsResource @@ -590,22 +443,16 @@ const createOrUpdateAtScopeOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + requestBody: Parameters.parameters9, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const updateAtScopeOperationSpec: msRest.OperationSpec = { +const updateAtScopeOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Resources/tags/default", httpMethod: "PATCH", - path: "{scope}/providers/Microsoft.Resources/tags/default", - urlParameters: [Parameters.scope], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.TagsPatchResource, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.TagsResource @@ -614,15 +461,16 @@ const updateAtScopeOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + requestBody: Parameters.parameters10, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const getAtScopeOperationSpec: msRest.OperationSpec = { +const getAtScopeOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Resources/tags/default", httpMethod: "GET", - path: "{scope}/providers/Microsoft.Resources/tags/default", - urlParameters: [Parameters.scope], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.TagsResource @@ -631,31 +479,48 @@ const getAtScopeOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept], serializer }; - -const deleteAtScopeOperationSpec: msRest.OperationSpec = { +const deleteAtScopeOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Resources/tags/default", httpMethod: "DELETE", - path: "{scope}/providers/Microsoft.Resources/tags/default", - urlParameters: [Parameters.scope], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: {}, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TagsListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.TagsListResult @@ -664,5 +529,12 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/deploymentOperations.ts b/sdk/resources/arm-resources/src/operationsInterfaces/deploymentOperations.ts new file mode 100644 index 000000000000..bc8747fa6bc5 --- /dev/null +++ b/sdk/resources/arm-resources/src/operationsInterfaces/deploymentOperations.ts @@ -0,0 +1,213 @@ +/* + * 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 "@azure/core-paging"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + DeploymentOperation, + DeploymentOperationsListAtScopeNextOptionalParams, + DeploymentOperationsListAtScopeOptionalParams, + DeploymentOperationsListAtTenantScopeNextOptionalParams, + DeploymentOperationsListAtTenantScopeOptionalParams, + DeploymentOperationsListAtManagementGroupScopeNextOptionalParams, + DeploymentOperationsListAtManagementGroupScopeOptionalParams, + DeploymentOperationsListAtSubscriptionScopeNextOptionalParams, + DeploymentOperationsListAtSubscriptionScopeOptionalParams, + DeploymentOperationsListNextOptionalParams, + DeploymentOperationsListOptionalParams, + DeploymentOperationsGetAtScopeOptionalParams, + DeploymentOperationsGetAtScopeResponse, + DeploymentOperationsGetAtTenantScopeOptionalParams, + DeploymentOperationsGetAtTenantScopeResponse, + DeploymentOperationsGetAtManagementGroupScopeOptionalParams, + DeploymentOperationsGetAtManagementGroupScopeResponse, + DeploymentOperationsGetAtSubscriptionScopeOptionalParams, + DeploymentOperationsGetAtSubscriptionScopeResponse, + DeploymentOperationsGetOptionalParams, + DeploymentOperationsGetResponse +} from "../models"; + +/// +/** Interface representing a DeploymentOperations. */ +export interface DeploymentOperations { + /** + * Gets all deployments operations for a deployment. + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + listAtScope( + scope: string, + deploymentName: string, + options?: DeploymentOperationsListAtScopeOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets all deployments operations for a deployment. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + listAtTenantScope( + deploymentName: string, + options?: DeploymentOperationsListAtTenantScopeOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets all deployments operations for a deployment. + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + listAtManagementGroupScope( + groupId: string, + deploymentName: string, + options?: DeploymentOperationsListAtManagementGroupScopeOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets all deployments operations for a deployment. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + listAtSubscriptionScope( + deploymentName: string, + options?: DeploymentOperationsListAtSubscriptionScopeOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets all deployments operations for a deployment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + deploymentName: string, + options?: DeploymentOperationsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * ListAtScopeNext + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param nextLink The nextLink from the previous successful call to the ListAtScope method. + * @param options The options parameters. + */ + listAtScopeNext( + scope: string, + deploymentName: string, + nextLink: string, + options?: DeploymentOperationsListAtScopeNextOptionalParams + ): PagedAsyncIterableIterator; + /** + * ListAtTenantScopeNext + * @param deploymentName The name of the deployment. + * @param nextLink The nextLink from the previous successful call to the ListAtTenantScope method. + * @param options The options parameters. + */ + listAtTenantScopeNext( + deploymentName: string, + nextLink: string, + options?: DeploymentOperationsListAtTenantScopeNextOptionalParams + ): PagedAsyncIterableIterator; + /** + * ListAtManagementGroupScopeNext + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param nextLink The nextLink from the previous successful call to the ListAtManagementGroupScope + * method. + * @param options The options parameters. + */ + listAtManagementGroupScopeNext( + groupId: string, + deploymentName: string, + nextLink: string, + options?: DeploymentOperationsListAtManagementGroupScopeNextOptionalParams + ): PagedAsyncIterableIterator; + /** + * ListAtSubscriptionScopeNext + * @param deploymentName The name of the deployment. + * @param nextLink The nextLink from the previous successful call to the ListAtSubscriptionScope + * method. + * @param options The options parameters. + */ + listAtSubscriptionScopeNext( + deploymentName: string, + nextLink: string, + options?: DeploymentOperationsListAtSubscriptionScopeNextOptionalParams + ): PagedAsyncIterableIterator; + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + listNext( + resourceGroupName: string, + deploymentName: string, + nextLink: string, + options?: DeploymentOperationsListNextOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a deployments operation. + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param options The options parameters. + */ + getAtScope( + scope: string, + deploymentName: string, + operationId: string, + options?: DeploymentOperationsGetAtScopeOptionalParams + ): Promise; + /** + * Gets a deployments operation. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param options The options parameters. + */ + getAtTenantScope( + deploymentName: string, + operationId: string, + options?: DeploymentOperationsGetAtTenantScopeOptionalParams + ): Promise; + /** + * Gets a deployments operation. + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param options The options parameters. + */ + getAtManagementGroupScope( + groupId: string, + deploymentName: string, + operationId: string, + options?: DeploymentOperationsGetAtManagementGroupScopeOptionalParams + ): Promise; + /** + * Gets a deployments operation. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param options The options parameters. + */ + getAtSubscriptionScope( + deploymentName: string, + operationId: string, + options?: DeploymentOperationsGetAtSubscriptionScopeOptionalParams + ): Promise; + /** + * Gets a deployments operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + deploymentName: string, + operationId: string, + options?: DeploymentOperationsGetOptionalParams + ): Promise; +} diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/deployments.ts b/sdk/resources/arm-resources/src/operationsInterfaces/deployments.ts new file mode 100644 index 000000000000..f75a97d6ccee --- /dev/null +++ b/sdk/resources/arm-resources/src/operationsInterfaces/deployments.ts @@ -0,0 +1,1019 @@ +/* + * 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 "@azure/core-paging"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + DeploymentExtended, + DeploymentsListAtScopeNextOptionalParams, + DeploymentsListAtScopeOptionalParams, + DeploymentsListAtTenantScopeNextOptionalParams, + DeploymentsListAtTenantScopeOptionalParams, + DeploymentsListAtManagementGroupScopeNextOptionalParams, + DeploymentsListAtManagementGroupScopeOptionalParams, + DeploymentsListAtSubscriptionScopeNextOptionalParams, + DeploymentsListAtSubscriptionScopeOptionalParams, + DeploymentsListByResourceGroupNextOptionalParams, + DeploymentsListByResourceGroupOptionalParams, + DeploymentsDeleteAtScopeOptionalParams, + DeploymentsCheckExistenceAtScopeOptionalParams, + DeploymentsCheckExistenceAtScopeResponse, + Deployment, + DeploymentsCreateOrUpdateAtScopeOptionalParams, + DeploymentsCreateOrUpdateAtScopeResponse, + DeploymentsGetAtScopeOptionalParams, + DeploymentsGetAtScopeResponse, + DeploymentsCancelAtScopeOptionalParams, + DeploymentsValidateAtScopeOptionalParams, + DeploymentsValidateAtScopeResponse, + DeploymentsExportTemplateAtScopeOptionalParams, + DeploymentsExportTemplateAtScopeResponse, + DeploymentsDeleteAtTenantScopeOptionalParams, + DeploymentsCheckExistenceAtTenantScopeOptionalParams, + DeploymentsCheckExistenceAtTenantScopeResponse, + ScopedDeployment, + DeploymentsCreateOrUpdateAtTenantScopeOptionalParams, + DeploymentsCreateOrUpdateAtTenantScopeResponse, + DeploymentsGetAtTenantScopeOptionalParams, + DeploymentsGetAtTenantScopeResponse, + DeploymentsCancelAtTenantScopeOptionalParams, + DeploymentsValidateAtTenantScopeOptionalParams, + DeploymentsValidateAtTenantScopeResponse, + ScopedDeploymentWhatIf, + DeploymentsWhatIfAtTenantScopeOptionalParams, + DeploymentsWhatIfAtTenantScopeResponse, + DeploymentsExportTemplateAtTenantScopeOptionalParams, + DeploymentsExportTemplateAtTenantScopeResponse, + DeploymentsDeleteAtManagementGroupScopeOptionalParams, + DeploymentsCheckExistenceAtManagementGroupScopeOptionalParams, + DeploymentsCheckExistenceAtManagementGroupScopeResponse, + DeploymentsCreateOrUpdateAtManagementGroupScopeOptionalParams, + DeploymentsCreateOrUpdateAtManagementGroupScopeResponse, + DeploymentsGetAtManagementGroupScopeOptionalParams, + DeploymentsGetAtManagementGroupScopeResponse, + DeploymentsCancelAtManagementGroupScopeOptionalParams, + DeploymentsValidateAtManagementGroupScopeOptionalParams, + DeploymentsValidateAtManagementGroupScopeResponse, + DeploymentsWhatIfAtManagementGroupScopeOptionalParams, + DeploymentsWhatIfAtManagementGroupScopeResponse, + DeploymentsExportTemplateAtManagementGroupScopeOptionalParams, + DeploymentsExportTemplateAtManagementGroupScopeResponse, + DeploymentsDeleteAtSubscriptionScopeOptionalParams, + DeploymentsCheckExistenceAtSubscriptionScopeOptionalParams, + DeploymentsCheckExistenceAtSubscriptionScopeResponse, + DeploymentsCreateOrUpdateAtSubscriptionScopeOptionalParams, + DeploymentsCreateOrUpdateAtSubscriptionScopeResponse, + DeploymentsGetAtSubscriptionScopeOptionalParams, + DeploymentsGetAtSubscriptionScopeResponse, + DeploymentsCancelAtSubscriptionScopeOptionalParams, + DeploymentsValidateAtSubscriptionScopeOptionalParams, + DeploymentsValidateAtSubscriptionScopeResponse, + DeploymentWhatIf, + DeploymentsWhatIfAtSubscriptionScopeOptionalParams, + DeploymentsWhatIfAtSubscriptionScopeResponse, + DeploymentsExportTemplateAtSubscriptionScopeOptionalParams, + DeploymentsExportTemplateAtSubscriptionScopeResponse, + DeploymentsDeleteOptionalParams, + DeploymentsCheckExistenceOptionalParams, + DeploymentsCheckExistenceResponse, + DeploymentsCreateOrUpdateOptionalParams, + DeploymentsCreateOrUpdateResponse, + DeploymentsGetOptionalParams, + DeploymentsGetResponse, + DeploymentsCancelOptionalParams, + DeploymentsValidateOptionalParams, + DeploymentsValidateResponse, + DeploymentsWhatIfOptionalParams, + DeploymentsWhatIfResponse, + DeploymentsExportTemplateOptionalParams, + DeploymentsExportTemplateResponse, + DeploymentsCalculateTemplateHashOptionalParams, + DeploymentsCalculateTemplateHashResponse +} from "../models"; + +/// +/** Interface representing a Deployments. */ +export interface Deployments { + /** + * Get all the deployments at the given scope. + * @param scope The resource scope. + * @param options The options parameters. + */ + listAtScope( + scope: string, + options?: DeploymentsListAtScopeOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get all the deployments at the tenant scope. + * @param options The options parameters. + */ + listAtTenantScope( + options?: DeploymentsListAtTenantScopeOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get all the deployments for a management group. + * @param groupId The management group ID. + * @param options The options parameters. + */ + listAtManagementGroupScope( + groupId: string, + options?: DeploymentsListAtManagementGroupScopeOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get all the deployments for a subscription. + * @param options The options parameters. + */ + listAtSubscriptionScope( + options?: DeploymentsListAtSubscriptionScopeOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get all the deployments for a resource group. + * @param resourceGroupName The name of the resource group with the deployments to get. The name is + * case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: DeploymentsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * ListAtScopeNext + * @param scope The resource scope. + * @param nextLink The nextLink from the previous successful call to the ListAtScope method. + * @param options The options parameters. + */ + listAtScopeNext( + scope: string, + nextLink: string, + options?: DeploymentsListAtScopeNextOptionalParams + ): PagedAsyncIterableIterator; + /** + * ListAtTenantScopeNext + * @param nextLink The nextLink from the previous successful call to the ListAtTenantScope method. + * @param options The options parameters. + */ + listAtTenantScopeNext( + nextLink: string, + options?: DeploymentsListAtTenantScopeNextOptionalParams + ): PagedAsyncIterableIterator; + /** + * ListAtManagementGroupScopeNext + * @param groupId The management group ID. + * @param nextLink The nextLink from the previous successful call to the ListAtManagementGroupScope + * method. + * @param options The options parameters. + */ + listAtManagementGroupScopeNext( + groupId: string, + nextLink: string, + options?: DeploymentsListAtManagementGroupScopeNextOptionalParams + ): PagedAsyncIterableIterator; + /** + * ListAtSubscriptionScopeNext + * @param nextLink The nextLink from the previous successful call to the ListAtSubscriptionScope + * method. + * @param options The options parameters. + */ + listAtSubscriptionScopeNext( + nextLink: string, + options?: DeploymentsListAtSubscriptionScopeNextOptionalParams + ): PagedAsyncIterableIterator; + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group with the deployments to get. The name is + * case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: DeploymentsListByResourceGroupNextOptionalParams + ): PagedAsyncIterableIterator; + /** + * A template deployment that is currently running cannot be deleted. Deleting a template deployment + * removes the associated deployment operations. This is an asynchronous operation that returns a + * status of 202 until the template deployment is successfully deleted. The Location response header + * contains the URI that is used to obtain the status of the process. While the process is running, a + * call to the URI in the Location header returns a status of 202. When the process finishes, the URI + * in the Location header returns a status of 204 on success. If the asynchronous request failed, the + * URI in the Location header returns an error-level status code. + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + beginDeleteAtScope( + scope: string, + deploymentName: string, + options?: DeploymentsDeleteAtScopeOptionalParams + ): Promise, void>>; + /** + * A template deployment that is currently running cannot be deleted. Deleting a template deployment + * removes the associated deployment operations. This is an asynchronous operation that returns a + * status of 202 until the template deployment is successfully deleted. The Location response header + * contains the URI that is used to obtain the status of the process. While the process is running, a + * call to the URI in the Location header returns a status of 202. When the process finishes, the URI + * in the Location header returns a status of 204 on success. If the asynchronous request failed, the + * URI in the Location header returns an error-level status code. + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + beginDeleteAtScopeAndWait( + scope: string, + deploymentName: string, + options?: DeploymentsDeleteAtScopeOptionalParams + ): Promise; + /** + * Checks whether the deployment exists. + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + checkExistenceAtScope( + scope: string, + deploymentName: string, + options?: DeploymentsCheckExistenceAtScopeOptionalParams + ): Promise; + /** + * You can provide the template and parameters directly in the request or link to JSON files. + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param options The options parameters. + */ + beginCreateOrUpdateAtScope( + scope: string, + deploymentName: string, + parameters: Deployment, + options?: DeploymentsCreateOrUpdateAtScopeOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeploymentsCreateOrUpdateAtScopeResponse + > + >; + /** + * You can provide the template and parameters directly in the request or link to JSON files. + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param options The options parameters. + */ + beginCreateOrUpdateAtScopeAndWait( + scope: string, + deploymentName: string, + parameters: Deployment, + options?: DeploymentsCreateOrUpdateAtScopeOptionalParams + ): Promise; + /** + * Gets a deployment. + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + getAtScope( + scope: string, + deploymentName: string, + options?: DeploymentsGetAtScopeOptionalParams + ): Promise; + /** + * You can cancel a deployment only if the provisioningState is Accepted or Running. After the + * deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment + * stops the currently running template deployment and leaves the resources partially deployed. + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + cancelAtScope( + scope: string, + deploymentName: string, + options?: DeploymentsCancelAtScopeOptionalParams + ): Promise; + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure + * Resource Manager.. + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param options The options parameters. + */ + beginValidateAtScope( + scope: string, + deploymentName: string, + parameters: Deployment, + options?: DeploymentsValidateAtScopeOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeploymentsValidateAtScopeResponse + > + >; + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure + * Resource Manager.. + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param options The options parameters. + */ + beginValidateAtScopeAndWait( + scope: string, + deploymentName: string, + parameters: Deployment, + options?: DeploymentsValidateAtScopeOptionalParams + ): Promise; + /** + * Exports the template used for specified deployment. + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + exportTemplateAtScope( + scope: string, + deploymentName: string, + options?: DeploymentsExportTemplateAtScopeOptionalParams + ): Promise; + /** + * A template deployment that is currently running cannot be deleted. Deleting a template deployment + * removes the associated deployment operations. This is an asynchronous operation that returns a + * status of 202 until the template deployment is successfully deleted. The Location response header + * contains the URI that is used to obtain the status of the process. While the process is running, a + * call to the URI in the Location header returns a status of 202. When the process finishes, the URI + * in the Location header returns a status of 204 on success. If the asynchronous request failed, the + * URI in the Location header returns an error-level status code. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + beginDeleteAtTenantScope( + deploymentName: string, + options?: DeploymentsDeleteAtTenantScopeOptionalParams + ): Promise, void>>; + /** + * A template deployment that is currently running cannot be deleted. Deleting a template deployment + * removes the associated deployment operations. This is an asynchronous operation that returns a + * status of 202 until the template deployment is successfully deleted. The Location response header + * contains the URI that is used to obtain the status of the process. While the process is running, a + * call to the URI in the Location header returns a status of 202. When the process finishes, the URI + * in the Location header returns a status of 204 on success. If the asynchronous request failed, the + * URI in the Location header returns an error-level status code. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + beginDeleteAtTenantScopeAndWait( + deploymentName: string, + options?: DeploymentsDeleteAtTenantScopeOptionalParams + ): Promise; + /** + * Checks whether the deployment exists. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + checkExistenceAtTenantScope( + deploymentName: string, + options?: DeploymentsCheckExistenceAtTenantScopeOptionalParams + ): Promise; + /** + * You can provide the template and parameters directly in the request or link to JSON files. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param options The options parameters. + */ + beginCreateOrUpdateAtTenantScope( + deploymentName: string, + parameters: ScopedDeployment, + options?: DeploymentsCreateOrUpdateAtTenantScopeOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeploymentsCreateOrUpdateAtTenantScopeResponse + > + >; + /** + * You can provide the template and parameters directly in the request or link to JSON files. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param options The options parameters. + */ + beginCreateOrUpdateAtTenantScopeAndWait( + deploymentName: string, + parameters: ScopedDeployment, + options?: DeploymentsCreateOrUpdateAtTenantScopeOptionalParams + ): Promise; + /** + * Gets a deployment. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + getAtTenantScope( + deploymentName: string, + options?: DeploymentsGetAtTenantScopeOptionalParams + ): Promise; + /** + * You can cancel a deployment only if the provisioningState is Accepted or Running. After the + * deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment + * stops the currently running template deployment and leaves the resources partially deployed. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + cancelAtTenantScope( + deploymentName: string, + options?: DeploymentsCancelAtTenantScopeOptionalParams + ): Promise; + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure + * Resource Manager.. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param options The options parameters. + */ + beginValidateAtTenantScope( + deploymentName: string, + parameters: ScopedDeployment, + options?: DeploymentsValidateAtTenantScopeOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeploymentsValidateAtTenantScopeResponse + > + >; + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure + * Resource Manager.. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param options The options parameters. + */ + beginValidateAtTenantScopeAndWait( + deploymentName: string, + parameters: ScopedDeployment, + options?: DeploymentsValidateAtTenantScopeOptionalParams + ): Promise; + /** + * Returns changes that will be made by the deployment if executed at the scope of the tenant group. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param options The options parameters. + */ + beginWhatIfAtTenantScope( + deploymentName: string, + parameters: ScopedDeploymentWhatIf, + options?: DeploymentsWhatIfAtTenantScopeOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeploymentsWhatIfAtTenantScopeResponse + > + >; + /** + * Returns changes that will be made by the deployment if executed at the scope of the tenant group. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param options The options parameters. + */ + beginWhatIfAtTenantScopeAndWait( + deploymentName: string, + parameters: ScopedDeploymentWhatIf, + options?: DeploymentsWhatIfAtTenantScopeOptionalParams + ): Promise; + /** + * Exports the template used for specified deployment. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + exportTemplateAtTenantScope( + deploymentName: string, + options?: DeploymentsExportTemplateAtTenantScopeOptionalParams + ): Promise; + /** + * A template deployment that is currently running cannot be deleted. Deleting a template deployment + * removes the associated deployment operations. This is an asynchronous operation that returns a + * status of 202 until the template deployment is successfully deleted. The Location response header + * contains the URI that is used to obtain the status of the process. While the process is running, a + * call to the URI in the Location header returns a status of 202. When the process finishes, the URI + * in the Location header returns a status of 204 on success. If the asynchronous request failed, the + * URI in the Location header returns an error-level status code. + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + beginDeleteAtManagementGroupScope( + groupId: string, + deploymentName: string, + options?: DeploymentsDeleteAtManagementGroupScopeOptionalParams + ): Promise, void>>; + /** + * A template deployment that is currently running cannot be deleted. Deleting a template deployment + * removes the associated deployment operations. This is an asynchronous operation that returns a + * status of 202 until the template deployment is successfully deleted. The Location response header + * contains the URI that is used to obtain the status of the process. While the process is running, a + * call to the URI in the Location header returns a status of 202. When the process finishes, the URI + * in the Location header returns a status of 204 on success. If the asynchronous request failed, the + * URI in the Location header returns an error-level status code. + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + beginDeleteAtManagementGroupScopeAndWait( + groupId: string, + deploymentName: string, + options?: DeploymentsDeleteAtManagementGroupScopeOptionalParams + ): Promise; + /** + * Checks whether the deployment exists. + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + checkExistenceAtManagementGroupScope( + groupId: string, + deploymentName: string, + options?: DeploymentsCheckExistenceAtManagementGroupScopeOptionalParams + ): Promise; + /** + * You can provide the template and parameters directly in the request or link to JSON files. + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param options The options parameters. + */ + beginCreateOrUpdateAtManagementGroupScope( + groupId: string, + deploymentName: string, + parameters: ScopedDeployment, + options?: DeploymentsCreateOrUpdateAtManagementGroupScopeOptionalParams + ): Promise< + PollerLike< + PollOperationState< + DeploymentsCreateOrUpdateAtManagementGroupScopeResponse + >, + DeploymentsCreateOrUpdateAtManagementGroupScopeResponse + > + >; + /** + * You can provide the template and parameters directly in the request or link to JSON files. + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param options The options parameters. + */ + beginCreateOrUpdateAtManagementGroupScopeAndWait( + groupId: string, + deploymentName: string, + parameters: ScopedDeployment, + options?: DeploymentsCreateOrUpdateAtManagementGroupScopeOptionalParams + ): Promise; + /** + * Gets a deployment. + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + getAtManagementGroupScope( + groupId: string, + deploymentName: string, + options?: DeploymentsGetAtManagementGroupScopeOptionalParams + ): Promise; + /** + * You can cancel a deployment only if the provisioningState is Accepted or Running. After the + * deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment + * stops the currently running template deployment and leaves the resources partially deployed. + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + cancelAtManagementGroupScope( + groupId: string, + deploymentName: string, + options?: DeploymentsCancelAtManagementGroupScopeOptionalParams + ): Promise; + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure + * Resource Manager.. + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param options The options parameters. + */ + beginValidateAtManagementGroupScope( + groupId: string, + deploymentName: string, + parameters: ScopedDeployment, + options?: DeploymentsValidateAtManagementGroupScopeOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeploymentsValidateAtManagementGroupScopeResponse + > + >; + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure + * Resource Manager.. + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param options The options parameters. + */ + beginValidateAtManagementGroupScopeAndWait( + groupId: string, + deploymentName: string, + parameters: ScopedDeployment, + options?: DeploymentsValidateAtManagementGroupScopeOptionalParams + ): Promise; + /** + * Returns changes that will be made by the deployment if executed at the scope of the management + * group. + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param options The options parameters. + */ + beginWhatIfAtManagementGroupScope( + groupId: string, + deploymentName: string, + parameters: ScopedDeploymentWhatIf, + options?: DeploymentsWhatIfAtManagementGroupScopeOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeploymentsWhatIfAtManagementGroupScopeResponse + > + >; + /** + * Returns changes that will be made by the deployment if executed at the scope of the management + * group. + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param options The options parameters. + */ + beginWhatIfAtManagementGroupScopeAndWait( + groupId: string, + deploymentName: string, + parameters: ScopedDeploymentWhatIf, + options?: DeploymentsWhatIfAtManagementGroupScopeOptionalParams + ): Promise; + /** + * Exports the template used for specified deployment. + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + exportTemplateAtManagementGroupScope( + groupId: string, + deploymentName: string, + options?: DeploymentsExportTemplateAtManagementGroupScopeOptionalParams + ): Promise; + /** + * A template deployment that is currently running cannot be deleted. Deleting a template deployment + * removes the associated deployment operations. This is an asynchronous operation that returns a + * status of 202 until the template deployment is successfully deleted. The Location response header + * contains the URI that is used to obtain the status of the process. While the process is running, a + * call to the URI in the Location header returns a status of 202. When the process finishes, the URI + * in the Location header returns a status of 204 on success. If the asynchronous request failed, the + * URI in the Location header returns an error-level status code. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + beginDeleteAtSubscriptionScope( + deploymentName: string, + options?: DeploymentsDeleteAtSubscriptionScopeOptionalParams + ): Promise, void>>; + /** + * A template deployment that is currently running cannot be deleted. Deleting a template deployment + * removes the associated deployment operations. This is an asynchronous operation that returns a + * status of 202 until the template deployment is successfully deleted. The Location response header + * contains the URI that is used to obtain the status of the process. While the process is running, a + * call to the URI in the Location header returns a status of 202. When the process finishes, the URI + * in the Location header returns a status of 204 on success. If the asynchronous request failed, the + * URI in the Location header returns an error-level status code. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + beginDeleteAtSubscriptionScopeAndWait( + deploymentName: string, + options?: DeploymentsDeleteAtSubscriptionScopeOptionalParams + ): Promise; + /** + * Checks whether the deployment exists. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + checkExistenceAtSubscriptionScope( + deploymentName: string, + options?: DeploymentsCheckExistenceAtSubscriptionScopeOptionalParams + ): Promise; + /** + * You can provide the template and parameters directly in the request or link to JSON files. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param options The options parameters. + */ + beginCreateOrUpdateAtSubscriptionScope( + deploymentName: string, + parameters: Deployment, + options?: DeploymentsCreateOrUpdateAtSubscriptionScopeOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeploymentsCreateOrUpdateAtSubscriptionScopeResponse + > + >; + /** + * You can provide the template and parameters directly in the request or link to JSON files. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param options The options parameters. + */ + beginCreateOrUpdateAtSubscriptionScopeAndWait( + deploymentName: string, + parameters: Deployment, + options?: DeploymentsCreateOrUpdateAtSubscriptionScopeOptionalParams + ): Promise; + /** + * Gets a deployment. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + getAtSubscriptionScope( + deploymentName: string, + options?: DeploymentsGetAtSubscriptionScopeOptionalParams + ): Promise; + /** + * You can cancel a deployment only if the provisioningState is Accepted or Running. After the + * deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment + * stops the currently running template deployment and leaves the resources partially deployed. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + cancelAtSubscriptionScope( + deploymentName: string, + options?: DeploymentsCancelAtSubscriptionScopeOptionalParams + ): Promise; + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure + * Resource Manager.. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param options The options parameters. + */ + beginValidateAtSubscriptionScope( + deploymentName: string, + parameters: Deployment, + options?: DeploymentsValidateAtSubscriptionScopeOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeploymentsValidateAtSubscriptionScopeResponse + > + >; + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure + * Resource Manager.. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param options The options parameters. + */ + beginValidateAtSubscriptionScopeAndWait( + deploymentName: string, + parameters: Deployment, + options?: DeploymentsValidateAtSubscriptionScopeOptionalParams + ): Promise; + /** + * Returns changes that will be made by the deployment if executed at the scope of the subscription. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to What If. + * @param options The options parameters. + */ + beginWhatIfAtSubscriptionScope( + deploymentName: string, + parameters: DeploymentWhatIf, + options?: DeploymentsWhatIfAtSubscriptionScopeOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeploymentsWhatIfAtSubscriptionScopeResponse + > + >; + /** + * Returns changes that will be made by the deployment if executed at the scope of the subscription. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to What If. + * @param options The options parameters. + */ + beginWhatIfAtSubscriptionScopeAndWait( + deploymentName: string, + parameters: DeploymentWhatIf, + options?: DeploymentsWhatIfAtSubscriptionScopeOptionalParams + ): Promise; + /** + * Exports the template used for specified deployment. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + exportTemplateAtSubscriptionScope( + deploymentName: string, + options?: DeploymentsExportTemplateAtSubscriptionScopeOptionalParams + ): Promise; + /** + * A template deployment that is currently running cannot be deleted. Deleting a template deployment + * removes the associated deployment operations. Deleting a template deployment does not affect the + * state of the resource group. This is an asynchronous operation that returns a status of 202 until + * the template deployment is successfully deleted. The Location response header contains the URI that + * is used to obtain the status of the process. While the process is running, a call to the URI in the + * Location header returns a status of 202. When the process finishes, the URI in the Location header + * returns a status of 204 on success. If the asynchronous request failed, the URI in the Location + * header returns an error-level status code. + * @param resourceGroupName The name of the resource group with the deployment to delete. The name is + * case insensitive. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + deploymentName: string, + options?: DeploymentsDeleteOptionalParams + ): Promise, void>>; + /** + * A template deployment that is currently running cannot be deleted. Deleting a template deployment + * removes the associated deployment operations. Deleting a template deployment does not affect the + * state of the resource group. This is an asynchronous operation that returns a status of 202 until + * the template deployment is successfully deleted. The Location response header contains the URI that + * is used to obtain the status of the process. While the process is running, a call to the URI in the + * Location header returns a status of 202. When the process finishes, the URI in the Location header + * returns a status of 204 on success. If the asynchronous request failed, the URI in the Location + * header returns an error-level status code. + * @param resourceGroupName The name of the resource group with the deployment to delete. The name is + * case insensitive. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + deploymentName: string, + options?: DeploymentsDeleteOptionalParams + ): Promise; + /** + * Checks whether the deployment exists. + * @param resourceGroupName The name of the resource group with the deployment to check. The name is + * case insensitive. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + checkExistence( + resourceGroupName: string, + deploymentName: string, + options?: DeploymentsCheckExistenceOptionalParams + ): Promise; + /** + * You can provide the template and parameters directly in the request or link to JSON files. + * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case + * insensitive. The resource group must already exist. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + deploymentName: string, + parameters: Deployment, + options?: DeploymentsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeploymentsCreateOrUpdateResponse + > + >; + /** + * You can provide the template and parameters directly in the request or link to JSON files. + * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case + * insensitive. The resource group must already exist. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + deploymentName: string, + parameters: Deployment, + options?: DeploymentsCreateOrUpdateOptionalParams + ): Promise; + /** + * Gets a deployment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + deploymentName: string, + options?: DeploymentsGetOptionalParams + ): Promise; + /** + * You can cancel a deployment only if the provisioningState is Accepted or Running. After the + * deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment + * stops the currently running template deployment and leaves the resource group partially deployed. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + cancel( + resourceGroupName: string, + deploymentName: string, + options?: DeploymentsCancelOptionalParams + ): Promise; + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure + * Resource Manager.. + * @param resourceGroupName The name of the resource group the template will be deployed to. The name + * is case insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param options The options parameters. + */ + beginValidate( + resourceGroupName: string, + deploymentName: string, + parameters: Deployment, + options?: DeploymentsValidateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeploymentsValidateResponse + > + >; + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure + * Resource Manager.. + * @param resourceGroupName The name of the resource group the template will be deployed to. The name + * is case insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param options The options parameters. + */ + beginValidateAndWait( + resourceGroupName: string, + deploymentName: string, + parameters: Deployment, + options?: DeploymentsValidateOptionalParams + ): Promise; + /** + * Returns changes that will be made by the deployment if executed at the scope of the resource group. + * @param resourceGroupName The name of the resource group the template will be deployed to. The name + * is case insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param options The options parameters. + */ + beginWhatIf( + resourceGroupName: string, + deploymentName: string, + parameters: DeploymentWhatIf, + options?: DeploymentsWhatIfOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DeploymentsWhatIfResponse + > + >; + /** + * Returns changes that will be made by the deployment if executed at the scope of the resource group. + * @param resourceGroupName The name of the resource group the template will be deployed to. The name + * is case insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param options The options parameters. + */ + beginWhatIfAndWait( + resourceGroupName: string, + deploymentName: string, + parameters: DeploymentWhatIf, + options?: DeploymentsWhatIfOptionalParams + ): Promise; + /** + * Exports the template used for specified deployment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param options The options parameters. + */ + exportTemplate( + resourceGroupName: string, + deploymentName: string, + options?: DeploymentsExportTemplateOptionalParams + ): Promise; + /** + * Calculate the hash of the given template. + * @param template The template provided to calculate hash. + * @param options The options parameters. + */ + calculateTemplateHash( + template: Record, + options?: DeploymentsCalculateTemplateHashOptionalParams + ): Promise; +} diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/index.ts b/sdk/resources/arm-resources/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..dea1301605d5 --- /dev/null +++ b/sdk/resources/arm-resources/src/operationsInterfaces/index.ts @@ -0,0 +1,16 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./operations"; +export * from "./deployments"; +export * from "./providers"; +export * from "./providerResourceTypes"; +export * from "./resources"; +export * from "./resourceGroups"; +export * from "./tagsOperations"; +export * from "./deploymentOperations"; diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/operations.ts b/sdk/resources/arm-resources/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..22818c150d21 --- /dev/null +++ b/sdk/resources/arm-resources/src/operationsInterfaces/operations.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import "@azure/core-paging"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams +} from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * Lists all of the available Microsoft.Resources REST API operations. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/providerResourceTypes.ts b/sdk/resources/arm-resources/src/operationsInterfaces/providerResourceTypes.ts new file mode 100644 index 000000000000..f7010e50bd64 --- /dev/null +++ b/sdk/resources/arm-resources/src/operationsInterfaces/providerResourceTypes.ts @@ -0,0 +1,25 @@ +/* + * 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 { + ProviderResourceTypesListOptionalParams, + ProviderResourceTypesListResponse +} from "../models"; + +/** Interface representing a ProviderResourceTypes. */ +export interface ProviderResourceTypes { + /** + * List the resource types for a specified resource provider. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param options The options parameters. + */ + list( + resourceProviderNamespace: string, + options?: ProviderResourceTypesListOptionalParams + ): Promise; +} diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/providers.ts b/sdk/resources/arm-resources/src/operationsInterfaces/providers.ts new file mode 100644 index 000000000000..2dc0e0383501 --- /dev/null +++ b/sdk/resources/arm-resources/src/operationsInterfaces/providers.ts @@ -0,0 +1,121 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import "@azure/core-paging"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + Provider, + ProvidersListNextOptionalParams, + ProvidersListOptionalParams, + ProvidersListAtTenantScopeNextOptionalParams, + ProvidersListAtTenantScopeOptionalParams, + ProvidersUnregisterOptionalParams, + ProvidersUnregisterResponse, + ProvidersRegisterAtManagementGroupScopeOptionalParams, + ProvidersProviderPermissionsOptionalParams, + ProvidersProviderPermissionsResponse, + ProvidersRegisterOptionalParams, + ProvidersRegisterResponse, + ProvidersGetOptionalParams, + ProvidersGetResponse, + ProvidersGetAtTenantScopeOptionalParams, + ProvidersGetAtTenantScopeResponse +} from "../models"; + +/// +/** Interface representing a Providers. */ +export interface Providers { + /** + * Gets all resource providers for a subscription. + * @param options The options parameters. + */ + list( + options?: ProvidersListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets all resource providers for the tenant. + * @param options The options parameters. + */ + listAtTenantScope( + options?: ProvidersListAtTenantScopeOptionalParams + ): PagedAsyncIterableIterator; + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + listNext( + nextLink: string, + options?: ProvidersListNextOptionalParams + ): PagedAsyncIterableIterator; + /** + * ListAtTenantScopeNext + * @param nextLink The nextLink from the previous successful call to the ListAtTenantScope method. + * @param options The options parameters. + */ + listAtTenantScopeNext( + nextLink: string, + options?: ProvidersListAtTenantScopeNextOptionalParams + ): PagedAsyncIterableIterator; + /** + * Unregisters a subscription from a resource provider. + * @param resourceProviderNamespace The namespace of the resource provider to unregister. + * @param options The options parameters. + */ + unregister( + resourceProviderNamespace: string, + options?: ProvidersUnregisterOptionalParams + ): Promise; + /** + * Registers a management group with a resource provider. + * @param resourceProviderNamespace The namespace of the resource provider to register. + * @param groupId The management group ID. + * @param options The options parameters. + */ + registerAtManagementGroupScope( + resourceProviderNamespace: string, + groupId: string, + options?: ProvidersRegisterAtManagementGroupScopeOptionalParams + ): Promise; + /** + * Get the provider permissions. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param options The options parameters. + */ + providerPermissions( + resourceProviderNamespace: string, + options?: ProvidersProviderPermissionsOptionalParams + ): Promise; + /** + * Registers a subscription with a resource provider. + * @param resourceProviderNamespace The namespace of the resource provider to register. + * @param options The options parameters. + */ + register( + resourceProviderNamespace: string, + options?: ProvidersRegisterOptionalParams + ): Promise; + /** + * Gets the specified resource provider. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param options The options parameters. + */ + get( + resourceProviderNamespace: string, + options?: ProvidersGetOptionalParams + ): Promise; + /** + * Gets the specified resource provider at the tenant level. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param options The options parameters. + */ + getAtTenantScope( + resourceProviderNamespace: string, + options?: ProvidersGetAtTenantScopeOptionalParams + ): Promise; +} diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/resourceGroups.ts b/sdk/resources/arm-resources/src/operationsInterfaces/resourceGroups.ts new file mode 100644 index 000000000000..4a191ac60db0 --- /dev/null +++ b/sdk/resources/arm-resources/src/operationsInterfaces/resourceGroups.ts @@ -0,0 +1,141 @@ +/* + * 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 "@azure/core-paging"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + ResourceGroup, + ResourceGroupsListNextOptionalParams, + ResourceGroupsListOptionalParams, + ResourceGroupsCheckExistenceOptionalParams, + ResourceGroupsCheckExistenceResponse, + ResourceGroupsCreateOrUpdateOptionalParams, + ResourceGroupsCreateOrUpdateResponse, + ResourceGroupsDeleteOptionalParams, + ResourceGroupsGetOptionalParams, + ResourceGroupsGetResponse, + ResourceGroupPatchable, + ResourceGroupsUpdateOptionalParams, + ResourceGroupsUpdateResponse, + ExportTemplateRequest, + ResourceGroupsExportTemplateOptionalParams, + ResourceGroupsExportTemplateResponse +} from "../models"; + +/// +/** Interface representing a ResourceGroups. */ +export interface ResourceGroups { + /** + * Gets all the resource groups for a subscription. + * @param options The options parameters. + */ + list( + options?: ResourceGroupsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + listNext( + nextLink: string, + options?: ResourceGroupsListNextOptionalParams + ): PagedAsyncIterableIterator; + /** + * Checks whether a resource group exists. + * @param resourceGroupName The name of the resource group to check. The name is case insensitive. + * @param options The options parameters. + */ + checkExistence( + resourceGroupName: string, + options?: ResourceGroupsCheckExistenceOptionalParams + ): Promise; + /** + * Creates or updates a resource group. + * @param resourceGroupName The name of the resource group to create or update. Can include + * alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters that + * match the allowed characters. + * @param parameters Parameters supplied to the create or update a resource group. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + parameters: ResourceGroup, + options?: ResourceGroupsCreateOrUpdateOptionalParams + ): Promise; + /** + * When you delete a resource group, all of its resources are also deleted. Deleting a resource group + * deletes all of its template deployments and currently stored operations. + * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + options?: ResourceGroupsDeleteOptionalParams + ): Promise, void>>; + /** + * When you delete a resource group, all of its resources are also deleted. Deleting a resource group + * deletes all of its template deployments and currently stored operations. + * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + options?: ResourceGroupsDeleteOptionalParams + ): Promise; + /** + * Gets a resource group. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + options?: ResourceGroupsGetOptionalParams + ): Promise; + /** + * Resource groups can be updated through a simple PATCH operation to a group address. The format of + * the request is the same as that for creating a resource group. If a field is unspecified, the + * current value is retained. + * @param resourceGroupName The name of the resource group to update. The name is case insensitive. + * @param parameters Parameters supplied to update a resource group. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + parameters: ResourceGroupPatchable, + options?: ResourceGroupsUpdateOptionalParams + ): Promise; + /** + * Captures the specified resource group as a template. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters for exporting the template. + * @param options The options parameters. + */ + beginExportTemplate( + resourceGroupName: string, + parameters: ExportTemplateRequest, + options?: ResourceGroupsExportTemplateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ResourceGroupsExportTemplateResponse + > + >; + /** + * Captures the specified resource group as a template. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters for exporting the template. + * @param options The options parameters. + */ + beginExportTemplateAndWait( + resourceGroupName: string, + parameters: ExportTemplateRequest, + options?: ResourceGroupsExportTemplateOptionalParams + ): Promise; +} diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/resources.ts b/sdk/resources/arm-resources/src/operationsInterfaces/resources.ts new file mode 100644 index 000000000000..56c0a031bd33 --- /dev/null +++ b/sdk/resources/arm-resources/src/operationsInterfaces/resources.ts @@ -0,0 +1,445 @@ +/* + * 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 "@azure/core-paging"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + GenericResourceExpanded, + ResourcesListByResourceGroupNextOptionalParams, + ResourcesListByResourceGroupOptionalParams, + ResourcesListNextOptionalParams, + ResourcesListOptionalParams, + ResourcesMoveInfo, + ResourcesMoveResourcesOptionalParams, + ResourcesValidateMoveResourcesOptionalParams, + ResourcesCheckExistenceOptionalParams, + ResourcesCheckExistenceResponse, + ResourcesDeleteOptionalParams, + GenericResource, + ResourcesCreateOrUpdateOptionalParams, + ResourcesCreateOrUpdateResponse, + ResourcesUpdateOptionalParams, + ResourcesUpdateResponse, + ResourcesGetOptionalParams, + ResourcesGetResponse, + ResourcesCheckExistenceByIdOptionalParams, + ResourcesCheckExistenceByIdResponse, + ResourcesDeleteByIdOptionalParams, + ResourcesCreateOrUpdateByIdOptionalParams, + ResourcesCreateOrUpdateByIdResponse, + ResourcesUpdateByIdOptionalParams, + ResourcesUpdateByIdResponse, + ResourcesGetByIdOptionalParams, + ResourcesGetByIdResponse +} from "../models"; + +/// +/** Interface representing a Resources. */ +export interface Resources { + /** + * Get all the resources for a resource group. + * @param resourceGroupName The resource group with the resources to get. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: ResourcesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get all the resources in a subscription. + * @param options The options parameters. + */ + list( + options?: ResourcesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * ListByResourceGroupNext + * @param resourceGroupName The resource group with the resources to get. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: ResourcesListByResourceGroupNextOptionalParams + ): PagedAsyncIterableIterator; + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + listNext( + nextLink: string, + options?: ResourcesListNextOptionalParams + ): PagedAsyncIterableIterator; + /** + * The resources to be moved must be in the same source resource group in the source subscription being + * used. The target resource group may be in a different subscription. When moving resources, both the + * source group and the target group are locked for the duration of the operation. Write and delete + * operations are blocked on the groups until the move completes. + * @param sourceResourceGroupName The name of the resource group from the source subscription + * containing the resources to be moved. + * @param parameters Parameters for moving resources. + * @param options The options parameters. + */ + beginMoveResources( + sourceResourceGroupName: string, + parameters: ResourcesMoveInfo, + options?: ResourcesMoveResourcesOptionalParams + ): Promise, void>>; + /** + * The resources to be moved must be in the same source resource group in the source subscription being + * used. The target resource group may be in a different subscription. When moving resources, both the + * source group and the target group are locked for the duration of the operation. Write and delete + * operations are blocked on the groups until the move completes. + * @param sourceResourceGroupName The name of the resource group from the source subscription + * containing the resources to be moved. + * @param parameters Parameters for moving resources. + * @param options The options parameters. + */ + beginMoveResourcesAndWait( + sourceResourceGroupName: string, + parameters: ResourcesMoveInfo, + options?: ResourcesMoveResourcesOptionalParams + ): Promise; + /** + * This operation checks whether the specified resources can be moved to the target. The resources to + * be moved must be in the same source resource group in the source subscription being used. The target + * resource group may be in a different subscription. If validation succeeds, it returns HTTP response + * code 204 (no content). If validation fails, it returns HTTP response code 409 (Conflict) with an + * error message. Retrieve the URL in the Location header value to check the result of the long-running + * operation. + * @param sourceResourceGroupName The name of the resource group from the source subscription + * containing the resources to be validated for move. + * @param parameters Parameters for moving resources. + * @param options The options parameters. + */ + beginValidateMoveResources( + sourceResourceGroupName: string, + parameters: ResourcesMoveInfo, + options?: ResourcesValidateMoveResourcesOptionalParams + ): Promise, void>>; + /** + * This operation checks whether the specified resources can be moved to the target. The resources to + * be moved must be in the same source resource group in the source subscription being used. The target + * resource group may be in a different subscription. If validation succeeds, it returns HTTP response + * code 204 (no content). If validation fails, it returns HTTP response code 409 (Conflict) with an + * error message. Retrieve the URL in the Location header value to check the result of the long-running + * operation. + * @param sourceResourceGroupName The name of the resource group from the source subscription + * containing the resources to be validated for move. + * @param parameters Parameters for moving resources. + * @param options The options parameters. + */ + beginValidateMoveResourcesAndWait( + sourceResourceGroupName: string, + parameters: ResourcesMoveInfo, + options?: ResourcesValidateMoveResourcesOptionalParams + ): Promise; + /** + * Checks whether a resource exists. + * @param resourceGroupName The name of the resource group containing the resource to check. The name + * is case insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for the operation. + * @param options The options parameters. + */ + checkExistence( + resourceGroupName: string, + resourceProviderNamespace: string, + parentResourcePath: string, + resourceType: string, + resourceName: string, + apiVersion: string, + options?: ResourcesCheckExistenceOptionalParams + ): Promise; + /** + * Deletes a resource. + * @param resourceGroupName The name of the resource group that contains the resource to delete. The + * name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to delete. + * @param apiVersion The API version to use for the operation. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + resourceProviderNamespace: string, + parentResourcePath: string, + resourceType: string, + resourceName: string, + apiVersion: string, + options?: ResourcesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a resource. + * @param resourceGroupName The name of the resource group that contains the resource to delete. The + * name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to delete. + * @param apiVersion The API version to use for the operation. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + resourceProviderNamespace: string, + parentResourcePath: string, + resourceType: string, + resourceName: string, + apiVersion: string, + options?: ResourcesDeleteOptionalParams + ): Promise; + /** + * Creates a resource. + * @param resourceGroupName The name of the resource group for the resource. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to create. + * @param resourceName The name of the resource to create. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for creating or updating the resource. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + resourceProviderNamespace: string, + parentResourcePath: string, + resourceType: string, + resourceName: string, + apiVersion: string, + parameters: GenericResource, + options?: ResourcesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ResourcesCreateOrUpdateResponse + > + >; + /** + * Creates a resource. + * @param resourceGroupName The name of the resource group for the resource. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to create. + * @param resourceName The name of the resource to create. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for creating or updating the resource. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + resourceProviderNamespace: string, + parentResourcePath: string, + resourceType: string, + resourceName: string, + apiVersion: string, + parameters: GenericResource, + options?: ResourcesCreateOrUpdateOptionalParams + ): Promise; + /** + * Updates a resource. + * @param resourceGroupName The name of the resource group for the resource. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to update. + * @param resourceName The name of the resource to update. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for updating the resource. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + resourceProviderNamespace: string, + parentResourcePath: string, + resourceType: string, + resourceName: string, + apiVersion: string, + parameters: GenericResource, + options?: ResourcesUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ResourcesUpdateResponse + > + >; + /** + * Updates a resource. + * @param resourceGroupName The name of the resource group for the resource. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to update. + * @param resourceName The name of the resource to update. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for updating the resource. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + resourceProviderNamespace: string, + parentResourcePath: string, + resourceType: string, + resourceName: string, + apiVersion: string, + parameters: GenericResource, + options?: ResourcesUpdateOptionalParams + ): Promise; + /** + * Gets a resource. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is + * case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get. + * @param apiVersion The API version to use for the operation. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceProviderNamespace: string, + parentResourcePath: string, + resourceType: string, + resourceName: string, + apiVersion: string, + options?: ResourcesGetOptionalParams + ): Promise; + /** + * Checks by ID whether a resource exists. + * @param resourceId The fully qualified ID of the resource, including the resource name and resource + * type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + * @param apiVersion The API version to use for the operation. + * @param options The options parameters. + */ + checkExistenceById( + resourceId: string, + apiVersion: string, + options?: ResourcesCheckExistenceByIdOptionalParams + ): Promise; + /** + * Deletes a resource by ID. + * @param resourceId The fully qualified ID of the resource, including the resource name and resource + * type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + * @param apiVersion The API version to use for the operation. + * @param options The options parameters. + */ + beginDeleteById( + resourceId: string, + apiVersion: string, + options?: ResourcesDeleteByIdOptionalParams + ): Promise, void>>; + /** + * Deletes a resource by ID. + * @param resourceId The fully qualified ID of the resource, including the resource name and resource + * type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + * @param apiVersion The API version to use for the operation. + * @param options The options parameters. + */ + beginDeleteByIdAndWait( + resourceId: string, + apiVersion: string, + options?: ResourcesDeleteByIdOptionalParams + ): Promise; + /** + * Create a resource by ID. + * @param resourceId The fully qualified ID of the resource, including the resource name and resource + * type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + * @param apiVersion The API version to use for the operation. + * @param parameters Create or update resource parameters. + * @param options The options parameters. + */ + beginCreateOrUpdateById( + resourceId: string, + apiVersion: string, + parameters: GenericResource, + options?: ResourcesCreateOrUpdateByIdOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ResourcesCreateOrUpdateByIdResponse + > + >; + /** + * Create a resource by ID. + * @param resourceId The fully qualified ID of the resource, including the resource name and resource + * type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + * @param apiVersion The API version to use for the operation. + * @param parameters Create or update resource parameters. + * @param options The options parameters. + */ + beginCreateOrUpdateByIdAndWait( + resourceId: string, + apiVersion: string, + parameters: GenericResource, + options?: ResourcesCreateOrUpdateByIdOptionalParams + ): Promise; + /** + * Updates a resource by ID. + * @param resourceId The fully qualified ID of the resource, including the resource name and resource + * type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + * @param apiVersion The API version to use for the operation. + * @param parameters Update resource parameters. + * @param options The options parameters. + */ + beginUpdateById( + resourceId: string, + apiVersion: string, + parameters: GenericResource, + options?: ResourcesUpdateByIdOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ResourcesUpdateByIdResponse + > + >; + /** + * Updates a resource by ID. + * @param resourceId The fully qualified ID of the resource, including the resource name and resource + * type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + * @param apiVersion The API version to use for the operation. + * @param parameters Update resource parameters. + * @param options The options parameters. + */ + beginUpdateByIdAndWait( + resourceId: string, + apiVersion: string, + parameters: GenericResource, + options?: ResourcesUpdateByIdOptionalParams + ): Promise; + /** + * Gets a resource by ID. + * @param resourceId The fully qualified ID of the resource, including the resource name and resource + * type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + * @param apiVersion The API version to use for the operation. + * @param options The options parameters. + */ + getById( + resourceId: string, + apiVersion: string, + options?: ResourcesGetByIdOptionalParams + ): Promise; +} diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/tagsOperations.ts b/sdk/resources/arm-resources/src/operationsInterfaces/tagsOperations.ts new file mode 100644 index 000000000000..dbcbe222b2d8 --- /dev/null +++ b/sdk/resources/arm-resources/src/operationsInterfaces/tagsOperations.ts @@ -0,0 +1,146 @@ +/* + * 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 "@azure/core-paging"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + TagDetails, + TagsOperationsListNextOptionalParams, + TagsOperationsListOptionalParams, + TagsOperationsDeleteValueOptionalParams, + TagsOperationsCreateOrUpdateValueOptionalParams, + TagsOperationsCreateOrUpdateValueResponse, + TagsOperationsCreateOrUpdateOptionalParams, + TagsOperationsCreateOrUpdateResponse, + TagsOperationsDeleteOptionalParams, + TagsResource, + TagsOperationsCreateOrUpdateAtScopeOptionalParams, + TagsOperationsCreateOrUpdateAtScopeResponse, + TagsPatchResource, + TagsOperationsUpdateAtScopeOptionalParams, + TagsOperationsUpdateAtScopeResponse, + TagsOperationsGetAtScopeOptionalParams, + TagsOperationsGetAtScopeResponse, + TagsOperationsDeleteAtScopeOptionalParams +} from "../models"; + +/// +/** Interface representing a TagsOperations. */ +export interface TagsOperations { + /** + * This operation performs a union of predefined tags, resource tags, resource group tags and + * subscription tags, and returns a summary of usage for each tag name and value under the given + * subscription. In case of a large number of tags, this operation may return a previously cached + * result. + * @param options The options parameters. + */ + list( + options?: TagsOperationsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + listNext( + nextLink: string, + options?: TagsOperationsListNextOptionalParams + ): PagedAsyncIterableIterator; + /** + * This operation allows deleting a value from the list of predefined values for an existing predefined + * tag name. The value being deleted must not be in use as a tag value for the given tag name for any + * resource. + * @param tagName The name of the tag. + * @param tagValue The value of the tag to delete. + * @param options The options parameters. + */ + deleteValue( + tagName: string, + tagValue: string, + options?: TagsOperationsDeleteValueOptionalParams + ): Promise; + /** + * This operation allows adding a value to the list of predefined values for an existing predefined tag + * name. A tag value can have a maximum of 256 characters. + * @param tagName The name of the tag. + * @param tagValue The value of the tag to create. + * @param options The options parameters. + */ + createOrUpdateValue( + tagName: string, + tagValue: string, + options?: TagsOperationsCreateOrUpdateValueOptionalParams + ): Promise; + /** + * This operation allows adding a name to the list of predefined tag names for the given subscription. + * A tag name can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the + * following prefixes which are reserved for Azure use: 'microsoft', 'azure', 'windows'. + * @param tagName The name of the tag to create. + * @param options The options parameters. + */ + createOrUpdate( + tagName: string, + options?: TagsOperationsCreateOrUpdateOptionalParams + ): Promise; + /** + * This operation allows deleting a name from the list of predefined tag names for the given + * subscription. The name being deleted must not be in use as a tag name for any resource. All + * predefined values for the given name must have already been deleted. + * @param tagName The name of the tag. + * @param options The options parameters. + */ + delete( + tagName: string, + options?: TagsOperationsDeleteOptionalParams + ): Promise; + /** + * This operation allows adding or replacing the entire set of tags on the specified resource or + * subscription. The specified entity can have a maximum of 50 tags. + * @param scope The resource scope. + * @param parameters Wrapper resource for tags API requests and responses. + * @param options The options parameters. + */ + createOrUpdateAtScope( + scope: string, + parameters: TagsResource, + options?: TagsOperationsCreateOrUpdateAtScopeOptionalParams + ): Promise; + /** + * This operation allows replacing, merging or selectively deleting tags on the specified resource or + * subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The + * 'replace' option replaces the entire set of existing tags with a new set. The 'merge' option allows + * adding tags with new names and updating the values of tags with existing names. The 'delete' option + * allows selectively deleting tags based on given names or name/value pairs. + * @param scope The resource scope. + * @param parameters Wrapper resource for tags patch API request only. + * @param options The options parameters. + */ + updateAtScope( + scope: string, + parameters: TagsPatchResource, + options?: TagsOperationsUpdateAtScopeOptionalParams + ): Promise; + /** + * Gets the entire set of tags on a resource or subscription. + * @param scope The resource scope. + * @param options The options parameters. + */ + getAtScope( + scope: string, + options?: TagsOperationsGetAtScopeOptionalParams + ): Promise; + /** + * Deletes the entire set of tags on a resource or subscription. + * @param scope The resource scope. + * @param options The options parameters. + */ + deleteAtScope( + scope: string, + options?: TagsOperationsDeleteAtScopeOptionalParams + ): Promise; +} diff --git a/sdk/resources/arm-resources/src/resourceManagementClient.ts b/sdk/resources/arm-resources/src/resourceManagementClient.ts index b6c4cccb8ac4..dbcc24bec9ed 100644 --- a/sdk/resources/arm-resources/src/resourceManagementClient.ts +++ b/sdk/resources/arm-resources/src/resourceManagementClient.ts @@ -3,62 +3,62 @@ * 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 * as coreAuth from "@azure/core-auth"; +import { + OperationsImpl, + DeploymentsImpl, + ProvidersImpl, + ProviderResourceTypesImpl, + ResourcesImpl, + ResourceGroupsImpl, + TagsOperationsImpl, + DeploymentOperationsImpl +} from "./operations"; +import { + Operations, + Deployments, + Providers, + ProviderResourceTypes, + Resources, + ResourceGroups, + TagsOperations, + DeploymentOperations +} from "./operationsInterfaces"; import { ResourceManagementClientContext } from "./resourceManagementClientContext"; +import { ResourceManagementClientOptionalParams } from "./models"; -class ResourceManagementClient extends ResourceManagementClientContext { - // Operation groups - operations: operations.Operations; - deployments: operations.Deployments; - providers: operations.Providers; - providerResourceTypes: operations.ProviderResourceTypes; - resources: operations.Resources; - resourceGroups: operations.ResourceGroups; - tags: operations.TagsOperations; - deploymentOperations: operations.DeploymentOperations; - +export class ResourceManagementClient extends ResourceManagementClientContext { /** * Initializes a new instance of the ResourceManagementClient 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 ID of the target subscription. - * @param [options] The parameter options + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The Microsoft Azure subscription ID. + * @param options The parameter options */ constructor( - credentials: msRest.ServiceClientCredentials | TokenCredential, + credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: Models.ResourceManagementClientOptions + options?: ResourceManagementClientOptionalParams ) { super(credentials, subscriptionId, options); - this.operations = new operations.Operations(this); - this.deployments = new operations.Deployments(this); - this.providers = new operations.Providers(this); - this.providerResourceTypes = new operations.ProviderResourceTypes(this); - this.resources = new operations.Resources(this); - this.resourceGroups = new operations.ResourceGroups(this); - this.tags = new operations.TagsOperations(this); - this.deploymentOperations = new operations.DeploymentOperations(this); + this.operations = new OperationsImpl(this); + this.deployments = new DeploymentsImpl(this); + this.providers = new ProvidersImpl(this); + this.providerResourceTypes = new ProviderResourceTypesImpl(this); + this.resources = new ResourcesImpl(this); + this.resourceGroups = new ResourceGroupsImpl(this); + this.tagsOperations = new TagsOperationsImpl(this); + this.deploymentOperations = new DeploymentOperationsImpl(this); } -} -// Operation Specifications - -export { - ResourceManagementClient, - ResourceManagementClientContext, - Models as ResourceManagementModels, - Mappers as ResourceManagementMappers -}; -export * from "./operations"; + operations: Operations; + deployments: Deployments; + providers: Providers; + providerResourceTypes: ProviderResourceTypes; + resources: Resources; + resourceGroups: ResourceGroups; + tagsOperations: TagsOperations; + deploymentOperations: DeploymentOperations; +} diff --git a/sdk/resources/arm-resources/src/resourceManagementClientContext.ts b/sdk/resources/arm-resources/src/resourceManagementClientContext.ts index fcb83eee4cb9..8e455ef91205 100644 --- a/sdk/resources/arm-resources/src/resourceManagementClientContext.ts +++ b/sdk/resources/arm-resources/src/resourceManagementClientContext.ts @@ -3,72 +3,68 @@ * 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 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"; +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { ResourceManagementClientOptionalParams } from "./models"; -const packageName = "@azure/arm-resources"; -const packageVersion = "4.2.0"; - -export class ResourceManagementClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials | TokenCredential; +export class ResourceManagementClientContext extends coreClient.ServiceClient { + $host: string; + apiVersion: string; subscriptionId: string; - apiVersion?: string; /** - * Initializes a new instance of the ResourceManagementClient 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 ID of the target subscription. - * @param [options] The parameter options + * Initializes a new instance of the ResourceManagementClientContext class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The Microsoft Azure subscription ID. + * @param options The parameter options */ constructor( - credentials: msRest.ServiceClientCredentials | TokenCredential, + credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: Models.ResourceManagementClientOptions + options?: ResourceManagementClientOptionalParams ) { - if (credentials == undefined) { - throw new Error("'credentials' cannot be null."); + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); } - if (subscriptionId == undefined) { - throw new Error("'subscriptionId' cannot be null."); + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); } + // Initializing default values for options if (!options) { options = {}; } - if (!options.userAgent) { - const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); - options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; - } + const defaults: ResourceManagementClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; - super(credentials, options); + const packageDetails = `azsdk-js-arm-resources/30.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; - this.apiVersion = "2021-01-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; + 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; - if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) { - this.acceptLanguage = options.acceptLanguage; - } - if ( - options.longRunningOperationRetryTimeout !== null && - options.longRunningOperationRetryTimeout !== undefined - ) { - this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; - } + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2021-04-01"; } } diff --git a/sdk/resources/arm-resources/tsconfig.json b/sdk/resources/arm-resources/tsconfig.json index 422b584abd5e..0ec8659c8e83 100644 --- a/sdk/resources/arm-resources/tsconfig.json +++ b/sdk/resources/arm-resources/tsconfig.json @@ -3,12 +3,13 @@ "module": "es6", "moduleResolution": "node", "strict": true, - "target": "es5", + "target": "es6", "sourceMap": true, "declarationMap": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, + "preserveConstEnums": true, "lib": ["es6", "dom"], "declaration": true, "outDir": "./esm", diff --git a/sdk/resources/ci.yml b/sdk/resources/ci.yml new file mode 100644 index 000000000000..0e55b36175dc --- /dev/null +++ b/sdk/resources/ci.yml @@ -0,0 +1,28 @@ +trigger: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/resources/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/resources/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: resources + Artifacts: + - name: azure-arm-resources + safeName: azurearmresources + \ No newline at end of file