diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 14b11bfe557d..a22ca88702eb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -26250,24 +26250,27 @@ importers: sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks: dependencies: + '@azure-rest/core-client': + specifier: ^2.3.1 + version: link:../../core/core-client-rest '@azure/abort-controller': specifier: ^2.1.2 version: link:../../core/abort-controller '@azure/core-auth': specifier: ^1.9.0 version: link:../../core/core-auth - '@azure/core-client': - specifier: ^1.9.2 - version: link:../../core/core-client '@azure/core-lro': - specifier: ^2.5.4 - version: 2.7.2 - '@azure/core-paging': - specifier: ^1.6.2 - version: link:../../core/core-paging + specifier: ^3.1.0 + version: link:../../core/core-lro '@azure/core-rest-pipeline': - specifier: ^1.19.0 + specifier: ^1.20.0 version: link:../../core/core-rest-pipeline + '@azure/core-util': + specifier: ^1.12.0 + version: link:../../core/core-util + '@azure/logger': + specifier: ^1.2.0 + version: link:../../core/logger tslib: specifier: ^2.8.1 version: 2.8.1 @@ -26284,12 +26287,12 @@ importers: '@azure/dev-tool': specifier: workspace:^ version: link:../../../common/tools/dev-tool + '@azure/eslint-plugin-azure-sdk': + specifier: workspace:^ + version: link:../../../common/tools/eslint-plugin-azure-sdk '@azure/identity': specifier: catalog:internal version: 4.13.0 - '@azure/logger': - specifier: ^1.1.4 - version: link:../../core/logger '@types/node': specifier: 'catalog:' version: 20.19.30 @@ -26305,9 +26308,15 @@ importers: dotenv: specifier: catalog:testing version: 16.6.1 + eslint: + specifier: 'catalog:' + version: 9.39.2 playwright: specifier: catalog:testing version: 1.58.0 + prettier: + specifier: 'catalog:' + version: 3.8.1 rimraf: specifier: 'catalog:' version: 6.1.2 diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/CHANGELOG.md b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/CHANGELOG.md index c5badc022e70..09d7272bcce1 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/CHANGELOG.md +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/CHANGELOG.md @@ -1,21 +1,154 @@ # Release History -## 1.0.2 (Unreleased) +## 2.0.0 (2026-01-27) ### Features Added + - Added operation group DeploymentStacksWhatIfResultsAtManagementGroupOperations + - Added operation group DeploymentStacksWhatIfResultsAtResourceGroupOperations + - Added operation group DeploymentStacksWhatIfResultsAtSubscriptionOperations + - Added operation DeploymentStacksOperations.createOrUpdateAtManagementGroup + - Added operation DeploymentStacksOperations.createOrUpdateAtResourceGroup + - Added operation DeploymentStacksOperations.createOrUpdateAtSubscription + - Added operation DeploymentStacksOperations.deleteAtManagementGroup + - Added operation DeploymentStacksOperations.deleteAtResourceGroup + - Added operation DeploymentStacksOperations.deleteAtSubscription + - Added operation DeploymentStacksOperations.validateStackAtManagementGroup + - Added operation DeploymentStacksOperations.validateStackAtResourceGroup + - Added operation DeploymentStacksOperations.validateStackAtSubscription + - Added Interface DeploymentExtension + - Added Interface DeploymentExtensionConfig + - Added Interface DeploymentExtensionConfigItem + - Added Interface DeploymentExternalInput + - Added Interface DeploymentExternalInputDefinition + - Added Interface DeploymentStacksChangeBase + - Added Interface DeploymentStacksChangeBaseDenyStatusMode + - Added Interface DeploymentStacksChangeBaseDeploymentStacksManagementStatus + - Added Interface DeploymentStacksChangeDeltaDenySettings + - Added Interface DeploymentStacksChangeDeltaRecord + - Added Interface DeploymentStacksDiagnostic + - Added Interface DeploymentStacksWhatIfChange + - Added Interface DeploymentStacksWhatIfPropertyChange + - Added Interface DeploymentStacksWhatIfResourceChange + - Added Interface DeploymentStacksWhatIfResult + - Added Interface DeploymentStacksWhatIfResultProperties + - Added Interface DeploymentStacksWhatIfResultsAtManagementGroupCreateOrUpdateOptionalParams + - Added Interface DeploymentStacksWhatIfResultsAtManagementGroupDeleteOptionalParams + - Added Interface DeploymentStacksWhatIfResultsAtManagementGroupGetOptionalParams + - Added Interface DeploymentStacksWhatIfResultsAtManagementGroupListOptionalParams + - Added Interface DeploymentStacksWhatIfResultsAtManagementGroupWhatIfOptionalParams + - Added Interface DeploymentStacksWhatIfResultsAtResourceGroupCreateOrUpdateOptionalParams + - Added Interface DeploymentStacksWhatIfResultsAtResourceGroupDeleteOptionalParams + - Added Interface DeploymentStacksWhatIfResultsAtResourceGroupGetOptionalParams + - Added Interface DeploymentStacksWhatIfResultsAtResourceGroupListOptionalParams + - Added Interface DeploymentStacksWhatIfResultsAtResourceGroupWhatIfOptionalParams + - Added Interface DeploymentStacksWhatIfResultsAtSubscriptionCreateOrUpdateOptionalParams + - Added Interface DeploymentStacksWhatIfResultsAtSubscriptionDeleteOptionalParams + - Added Interface DeploymentStacksWhatIfResultsAtSubscriptionGetOptionalParams + - Added Interface DeploymentStacksWhatIfResultsAtSubscriptionListOptionalParams + - Added Interface DeploymentStacksWhatIfResultsAtSubscriptionWhatIfOptionalParams + - Added Interface ErrorResponse + - Added Interface PagedAsyncIterableIterator + - Added Interface PageSettings + - Added Interface ProxyResource + - Added Interface Resource + - Added Interface RestorePollerOptions + - Interface ActionOnUnmanage has a new optional parameter resourcesWithoutDeleteSupport + - Interface DeploymentParameter has a new optional parameter expression + - Interface DeploymentStack has a new optional parameter actionOnUnmanage + - Interface DeploymentStack has a new optional parameter bypassStackOutOfSyncError + - Interface DeploymentStack has a new optional parameter correlationId + - Interface DeploymentStack has a new optional parameter debugSetting + - Interface DeploymentStack has a new optional parameter deletedResources + - Interface DeploymentStack has a new optional parameter denySettings + - Interface DeploymentStack has a new optional parameter deploymentExtensions + - Interface DeploymentStack has a new optional parameter deploymentId + - Interface DeploymentStack has a new optional parameter deploymentScope + - Interface DeploymentStack has a new optional parameter description + - Interface DeploymentStack has a new optional parameter detachedResources + - Interface DeploymentStack has a new optional parameter duration + - Interface DeploymentStack has a new optional parameter error + - Interface DeploymentStack has a new optional parameter extensionConfigs + - Interface DeploymentStack has a new optional parameter externalInputDefinitions + - Interface DeploymentStack has a new optional parameter externalInputs + - Interface DeploymentStack has a new optional parameter failedResources + - Interface DeploymentStack has a new optional parameter outputs + - Interface DeploymentStack has a new optional parameter parameters + - Interface DeploymentStack has a new optional parameter parametersLink + - Interface DeploymentStack has a new optional parameter provisioningState + - Interface DeploymentStack has a new optional parameter resources + - Interface DeploymentStack has a new optional parameter template + - Interface DeploymentStack has a new optional parameter templateLink + - Interface DeploymentStack has a new optional parameter validationLevel + - Interface DeploymentStackProperties has a new optional parameter deploymentExtensions + - Interface DeploymentStackProperties has a new optional parameter extensionConfigs + - Interface DeploymentStackProperties has a new optional parameter externalInputDefinitions + - Interface DeploymentStackProperties has a new optional parameter externalInputs + - Interface DeploymentStackProperties has a new optional parameter validationLevel + - Interface DeploymentStackValidateProperties has a new optional parameter deploymentExtensions + - Interface DeploymentStackValidateProperties has a new optional parameter validationLevel + - Interface ManagedResourceReference has a new optional parameter apiVersion + - Interface ManagedResourceReference has a new optional parameter extension + - Interface ManagedResourceReference has a new optional parameter identifiers + - Interface ManagedResourceReference has a new optional parameter type + - Interface ResourceReference has a new optional parameter apiVersion + - Interface ResourceReference has a new optional parameter extension + - Interface ResourceReference has a new optional parameter identifiers + - Interface ResourceReference has a new optional parameter type + - Interface ResourceReferenceExtended has a new optional parameter apiVersion + - Interface ResourceReferenceExtended has a new optional parameter extension + - Interface ResourceReferenceExtended has a new optional parameter identifiers + - Interface ResourceReferenceExtended has a new optional parameter type + - Added Type Alias AzureSupportedClouds + - Added Type Alias DeploymentStacksDiagnosticLevel + - Added Type Alias DeploymentStacksManagementStatus + - Added Type Alias DeploymentStacksResourcesWithoutDeleteSupportEnum + - Added Type Alias DeploymentStacksWhatIfChangeCertainty + - Added Type Alias DeploymentStacksWhatIfChangeType + - Added Type Alias DeploymentStacksWhatIfPropertyChangeType + - Added Type Alias ValidationLevel + - Added Enum AzureClouds + - Added Enum KnownDeploymentStacksDiagnosticLevel + - Added Enum KnownDeploymentStacksManagementStatus + - Added Enum KnownDeploymentStacksResourcesWithoutDeleteSupportEnum + - Added Enum KnownDeploymentStacksWhatIfChangeCertainty + - Added Enum KnownDeploymentStacksWhatIfChangeType + - Added Enum KnownDeploymentStacksWhatIfPropertyChangeType + - Added Enum KnownValidationLevel + - Added Enum KnownVersions + - Enum KnownDenyStatusMode has a new value Unknown + - Enum KnownDeploymentStackProvisioningState has a new value Initializing + - Enum KnownDeploymentStackProvisioningState has a new value Running ### Breaking Changes + - Removed operation DeploymentStacks.beginCreateOrUpdateAtManagementGroup + - Removed operation DeploymentStacks.beginCreateOrUpdateAtManagementGroupAndWait + - Removed operation DeploymentStacks.beginCreateOrUpdateAtResourceGroup + - Removed operation DeploymentStacks.beginCreateOrUpdateAtResourceGroupAndWait + - Removed operation DeploymentStacks.beginCreateOrUpdateAtSubscription + - Removed operation DeploymentStacks.beginCreateOrUpdateAtSubscriptionAndWait + - Removed operation DeploymentStacks.beginDeleteAtManagementGroup + - Removed operation DeploymentStacks.beginDeleteAtManagementGroupAndWait + - Removed operation DeploymentStacks.beginDeleteAtResourceGroup + - Removed operation DeploymentStacks.beginDeleteAtResourceGroupAndWait + - Removed operation DeploymentStacks.beginDeleteAtSubscription + - Removed operation DeploymentStacks.beginDeleteAtSubscriptionAndWait + - Removed operation DeploymentStacks.beginValidateStackAtManagementGroup + - Removed operation DeploymentStacks.beginValidateStackAtManagementGroupAndWait + - Removed operation DeploymentStacks.beginValidateStackAtResourceGroup + - Removed operation DeploymentStacks.beginValidateStackAtResourceGroupAndWait + - Removed operation DeploymentStacks.beginValidateStackAtSubscription + - Removed operation DeploymentStacks.beginValidateStackAtSubscriptionAndWait + - Removed Interface AzureResourceBase + - Removed Interface DeploymentStacksError + - Interface DeploymentStack no longer has parameter properties + - Removed Type Alias UnmanageActionManagementGroupMode + - Removed Type Alias UnmanageActionResourceGroupMode + - Removed Type Alias UnmanageActionResourceMode + - Removed Enum KnownUnmanageActionManagementGroupMode + - Removed Enum KnownUnmanageActionResourceGroupMode + - Removed Enum KnownUnmanageActionResourceMode -### Bugs Fixed - -### Other Changes - -## 1.0.1 (2025-08-22) - -### Other Changes - - - Other fixes - + ## 1.0.0 (2024-06-24) ### Features Added diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/LICENSE b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/LICENSE index b2f52a2bad4e..63447fd8bbbf 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/LICENSE +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/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/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/README.md b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/README.md index 2c0a3d8be8c6..43c5321c360a 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/README.md +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/README.md @@ -4,10 +4,12 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) f The APIs listed in this specification can be used to manage Deployment stack resources through the Azure Resource Manager. -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-resourcesdeploymentstacks) | -[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-resourcesdeploymentstacks) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) +Key links: + +- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks) +- [Package (NPM)](https://www.npmjs.com/package/@azure/arm-resourcesdeploymentstacks) +- [API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-resourcesdeploymentstacks) +- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples) ## Getting started @@ -35,7 +37,7 @@ npm install @azure/arm-resourcesdeploymentstacks To create a client object to access the Azure DeploymentStacks API, you will need the `endpoint` of your Azure DeploymentStacks resource and a `credential`. The Azure DeploymentStacks client can use Azure Active Directory credentials to authenticate. You can find the endpoint for your Azure DeploymentStacks resource in the [Azure Portal][azure_portal]. -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: @@ -44,7 +46,6 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure DeploymentStacks** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. For more information about how to create an Azure AD Application check out [this guide](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). @@ -64,16 +65,16 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur import { InteractiveBrowserCredential } from "@azure/identity"; import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; -const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", clientId: "", }); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new DeploymentStacksClient(credential, subscriptionId); ``` -### JavaScript Bundle +### JavaScript Bundle To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). ## Key concepts @@ -98,7 +99,7 @@ For more detailed instructions on how to enable logs, you can look at the [@azur ## 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. +Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples) directory for detailed examples on how to use this library. ## Contributing @@ -108,10 +109,6 @@ If you'd like to contribute to this library, please read the [contributing guide - [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - - -[azure_cli]: https://learn.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ [azure_sub]: https://azure.microsoft.com/free/ [azure_portal]: https://portal.azure.com [azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/_meta.json b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/_meta.json deleted file mode 100644 index 711ebacb70e8..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/_meta.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "commit": "3a9110b06d1053fb4ef5f5c56002506dcc283c95", - "readme": "specification/resources/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\resources\\resource-manager\\readme.md --use=@autorest/typescript@6.0.23 --generate-sample=true", - "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.9", - "use": "@autorest/typescript@6.0.23" -} \ No newline at end of file diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/api-extractor.json b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/api-extractor.json index 16d81e2eb512..870d6d399477 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/api-extractor.json +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/api-extractor.json @@ -1,3 +1 @@ -{ - "extends": "../../../api-extractor-base.json" -} +{ "extends": "../../../api-extractor-base.json" } diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/assets.json b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/assets.json deleted file mode 100644 index d8e8b131af83..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "js", - "TagPrefix": "js/resourcesdeploymentstacks/arm-resourcesdeploymentstacks", - "Tag": "js/resourcesdeploymentstacks/arm-resourcesdeploymentstacks_185283849e" -} diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/eslint.config.mjs b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/eslint.config.mjs new file mode 100644 index 000000000000..6d2f8a5914c3 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/eslint.config.mjs @@ -0,0 +1,14 @@ +import azsdkEslint from "@azure/eslint-plugin-azure-sdk"; + +export default azsdkEslint.config([ + { + rules: { + "@azure/azure-sdk/ts-modules-only-named": "warn", + "@azure/azure-sdk/ts-package-json-types": "warn", + "@azure/azure-sdk/ts-package-json-engine-is-present": "warn", + "@azure/azure-sdk/ts-package-json-files-required": "off", + "@azure/azure-sdk/ts-package-json-main-is-cjs": "off", + "tsdoc/syntax": "warn", + }, + }, +]); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/metadata.json b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/metadata.json new file mode 100644 index 000000000000..56dbd661e0ab --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/metadata.json @@ -0,0 +1,98 @@ +{ + "apiVersion": "2025-07-01", + "emitterVersion": "0.48.1", + "crossLanguageDefinitions": { + "CrossLanguagePackageId": "Microsoft.Resources.DeploymentStacks", + "CrossLanguageDefinitionId": { + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksWhatIfResult:interface": "Microsoft.Resources.DeploymentStacks.DeploymentStacksWhatIfResult", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksWhatIfResultProperties:interface": "Microsoft.Resources.DeploymentStacks.DeploymentStacksWhatIfResultProperties", + "@azure/arm-resourcesdeploymentstacks!ErrorDetail:interface": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "@azure/arm-resourcesdeploymentstacks!ErrorAdditionalInfo:interface": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksTemplateLink:interface": "Microsoft.Resources.DeploymentStacks.DeploymentStacksTemplateLink", + "@azure/arm-resourcesdeploymentstacks!DeploymentParameter:interface": "Microsoft.Resources.DeploymentStacks.DeploymentParameter", + "@azure/arm-resourcesdeploymentstacks!KeyVaultParameterReference:interface": "Microsoft.Resources.DeploymentStacks.KeyVaultParameterReference", + "@azure/arm-resourcesdeploymentstacks!KeyVaultReference:interface": "Microsoft.Resources.DeploymentStacks.KeyVaultReference", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksParametersLink:interface": "Microsoft.Resources.DeploymentStacks.DeploymentStacksParametersLink", + "@azure/arm-resourcesdeploymentstacks!DeploymentExtensionConfig:interface": "Microsoft.Resources.DeploymentStacks.DeploymentExtensionConfig", + "@azure/arm-resourcesdeploymentstacks!DeploymentExtensionConfigItem:interface": "Microsoft.Resources.DeploymentStacks.DeploymentExtensionConfigItem", + "@azure/arm-resourcesdeploymentstacks!DeploymentExternalInput:interface": "Microsoft.Resources.DeploymentStacks.DeploymentExternalInput", + "@azure/arm-resourcesdeploymentstacks!DeploymentExternalInputDefinition:interface": "Microsoft.Resources.DeploymentStacks.DeploymentExternalInputDefinition", + "@azure/arm-resourcesdeploymentstacks!ActionOnUnmanage:interface": "Microsoft.Resources.DeploymentStacks.ActionOnUnmanage", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksDebugSetting:interface": "Microsoft.Resources.DeploymentStacks.DeploymentStacksDebugSetting", + "@azure/arm-resourcesdeploymentstacks!DenySettings:interface": "Microsoft.Resources.DeploymentStacks.DenySettings", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksWhatIfChange:interface": "Microsoft.Resources.DeploymentStacks.DeploymentStacksWhatIfChange", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksWhatIfResourceChange:interface": "Microsoft.Resources.DeploymentStacks.DeploymentStacksWhatIfResourceChange", + "@azure/arm-resourcesdeploymentstacks!DeploymentExtension:interface": "Microsoft.Resources.DeploymentStacks.DeploymentExtension", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksChangeBaseDeploymentStacksManagementStatus:interface": "Microsoft.Resources.DeploymentStacks.DeploymentStacksChangeBase", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksChangeBaseDenyStatusMode:interface": "Microsoft.Resources.DeploymentStacks.DeploymentStacksChangeBase", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksChangeDeltaRecord:interface": "Microsoft.Resources.DeploymentStacks.DeploymentStacksChangeDelta", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksWhatIfPropertyChange:interface": "Microsoft.Resources.DeploymentStacks.DeploymentStacksWhatIfPropertyChange", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksChangeDeltaDenySettings:interface": "Microsoft.Resources.DeploymentStacks.DeploymentStacksChangeDelta", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksChangeBase:interface": "Microsoft.Resources.DeploymentStacks.DeploymentStacksChangeBase", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksDiagnostic:interface": "Microsoft.Resources.DeploymentStacks.DeploymentStacksDiagnostic", + "@azure/arm-resourcesdeploymentstacks!ProxyResource:interface": "Azure.ResourceManager.CommonTypes.ProxyResource", + "@azure/arm-resourcesdeploymentstacks!Resource:interface": "Azure.ResourceManager.CommonTypes.Resource", + "@azure/arm-resourcesdeploymentstacks!SystemData:interface": "Azure.ResourceManager.CommonTypes.SystemData", + "@azure/arm-resourcesdeploymentstacks!ErrorResponse:interface": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksWhatIfResultListResult:interface": "Azure.ResourceManager.ResourceListResult", + "@azure/arm-resourcesdeploymentstacks!ArmOperationStatusResourceProvisioningState:interface": "Azure.ResourceManager.ArmOperationStatus", + "@azure/arm-resourcesdeploymentstacks!DeploymentStack:interface": "Microsoft.Resources.DeploymentStacks.DeploymentStack", + "@azure/arm-resourcesdeploymentstacks!DeploymentStackProperties:interface": "Microsoft.Resources.DeploymentStacks.DeploymentStackProperties", + "@azure/arm-resourcesdeploymentstacks!ResourceReference:interface": "Microsoft.Resources.DeploymentStacks.ResourceReference", + "@azure/arm-resourcesdeploymentstacks!ResourceReferenceExtended:interface": "Microsoft.Resources.DeploymentStacks.ResourceReferenceExtended", + "@azure/arm-resourcesdeploymentstacks!ManagedResourceReference:interface": "Microsoft.Resources.DeploymentStacks.ManagedResourceReference", + "@azure/arm-resourcesdeploymentstacks!DeploymentStackListResult:interface": "Azure.ResourceManager.ResourceListResult", + "@azure/arm-resourcesdeploymentstacks!DeploymentStackValidateResult:interface": "Microsoft.Resources.DeploymentStacks.DeploymentStackValidateResult", + "@azure/arm-resourcesdeploymentstacks!DeploymentStackValidateProperties:interface": "Microsoft.Resources.DeploymentStacks.DeploymentStackValidateProperties", + "@azure/arm-resourcesdeploymentstacks!DeploymentStackTemplateDefinition:interface": "Microsoft.Resources.DeploymentStacks.DeploymentStackTemplateDefinition", + "@azure/arm-resourcesdeploymentstacks!KnownDeploymentStacksDeleteDetachEnum:enum": "Microsoft.Resources.DeploymentStacks.DeploymentStacksDeleteDetachEnum", + "@azure/arm-resourcesdeploymentstacks!KnownDeploymentStacksResourcesWithoutDeleteSupportEnum:enum": "Microsoft.Resources.DeploymentStacks.DeploymentStacksResourcesWithoutDeleteSupportEnum", + "@azure/arm-resourcesdeploymentstacks!KnownDenySettingsMode:enum": "Microsoft.Resources.DeploymentStacks.DenySettingsMode", + "@azure/arm-resourcesdeploymentstacks!KnownDeploymentStackProvisioningState:enum": "Microsoft.Resources.DeploymentStacks.DeploymentStackProvisioningState", + "@azure/arm-resourcesdeploymentstacks!KnownValidationLevel:enum": "Microsoft.Resources.DeploymentStacks.ValidationLevel", + "@azure/arm-resourcesdeploymentstacks!KnownDeploymentStacksWhatIfChangeType:enum": "Microsoft.Resources.DeploymentStacks.DeploymentStacksWhatIfChangeType", + "@azure/arm-resourcesdeploymentstacks!KnownDeploymentStacksWhatIfChangeCertainty:enum": "Microsoft.Resources.DeploymentStacks.DeploymentStacksWhatIfChangeCertainty", + "@azure/arm-resourcesdeploymentstacks!KnownDeploymentStacksManagementStatus:enum": "Microsoft.Resources.DeploymentStacks.DeploymentStacksManagementStatus", + "@azure/arm-resourcesdeploymentstacks!KnownDenyStatusMode:enum": "Microsoft.Resources.DeploymentStacks.DenyStatusMode", + "@azure/arm-resourcesdeploymentstacks!KnownDeploymentStacksWhatIfPropertyChangeType:enum": "Microsoft.Resources.DeploymentStacks.DeploymentStacksWhatIfPropertyChangeType", + "@azure/arm-resourcesdeploymentstacks!KnownDeploymentStacksDiagnosticLevel:enum": "Microsoft.Resources.DeploymentStacks.DeploymentStacksDiagnosticLevel", + "@azure/arm-resourcesdeploymentstacks!KnowncreatedByType:enum": "Azure.ResourceManager.CommonTypes.createdByType", + "@azure/arm-resourcesdeploymentstacks!KnownResourceProvisioningState:enum": "Azure.ResourceManager.ResourceProvisioningState", + "@azure/arm-resourcesdeploymentstacks!KnownResourceStatusMode:enum": "Microsoft.Resources.DeploymentStacks.ResourceStatusMode", + "@azure/arm-resourcesdeploymentstacks!KnownVersions:enum": "Microsoft.Resources.DeploymentStacks.Versions", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksOperations#exportTemplateAtManagementGroup:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksAtManagementGroup.exportTemplate", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksOperations#deleteAtManagementGroup:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksAtManagementGroup.delete", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksOperations#createOrUpdateAtManagementGroup:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksAtManagementGroup.createOrUpdate", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksOperations#validateStackAtManagementGroup:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksAtManagementGroup.validateStack", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksOperations#listAtManagementGroup:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksAtManagementGroup.list", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksOperations#getAtManagementGroup:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksAtManagementGroup.get", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksOperations#exportTemplateAtSubscription:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksAtSubscription.exportTemplate", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksOperations#deleteAtSubscription:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksAtSubscription.delete", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksOperations#createOrUpdateAtSubscription:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksAtSubscription.createOrUpdate", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksOperations#validateStackAtSubscription:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksAtSubscription.validateStack", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksOperations#listAtSubscription:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksAtSubscription.list", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksOperations#getAtSubscription:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksAtSubscription.get", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksOperations#exportTemplateAtResourceGroup:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksAtResourceGroup.exportTemplate", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksOperations#deleteAtResourceGroup:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksAtResourceGroup.delete", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksOperations#createOrUpdateAtResourceGroup:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksAtResourceGroup.createOrUpdate", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksOperations#validateStackAtResourceGroup:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksAtResourceGroup.validateStack", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksOperations#listAtResourceGroup:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksAtResourceGroup.list", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksOperations#getAtResourceGroup:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksAtResourceGroup.get", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksWhatIfResultsAtManagementGroupOperations#whatIf:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksWhatIfResultsAtManagementGroup.whatIf", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksWhatIfResultsAtManagementGroupOperations#delete:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksWhatIfResultsAtManagementGroup.delete", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksWhatIfResultsAtManagementGroupOperations#createOrUpdate:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksWhatIfResultsAtManagementGroup.createOrUpdate", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksWhatIfResultsAtManagementGroupOperations#list:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksWhatIfResultsAtManagementGroup.list", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksWhatIfResultsAtManagementGroupOperations#get:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksWhatIfResultsAtManagementGroup.get", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksWhatIfResultsAtSubscriptionOperations#whatIf:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksWhatIfResultsAtSubscription.whatIf", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksWhatIfResultsAtSubscriptionOperations#delete:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksWhatIfResultsAtSubscription.delete", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksWhatIfResultsAtSubscriptionOperations#createOrUpdate:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksWhatIfResultsAtSubscription.createOrUpdate", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksWhatIfResultsAtSubscriptionOperations#list:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksWhatIfResultsAtSubscription.list", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksWhatIfResultsAtSubscriptionOperations#get:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksWhatIfResultsAtSubscription.get", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksWhatIfResultsAtResourceGroupOperations#whatIf:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksWhatIfResultsAtResourceGroup.whatIf", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksWhatIfResultsAtResourceGroupOperations#delete:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksWhatIfResultsAtResourceGroup.delete", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksWhatIfResultsAtResourceGroupOperations#createOrUpdate:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksWhatIfResultsAtResourceGroup.createOrUpdate", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksWhatIfResultsAtResourceGroupOperations#list:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksWhatIfResultsAtResourceGroup.list", + "@azure/arm-resourcesdeploymentstacks!DeploymentStacksWhatIfResultsAtResourceGroupOperations#get:member": "Microsoft.Resources.DeploymentStacks.DeploymentStacksWhatIfResultsAtResourceGroup.get" + } + } +} diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/package.json b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/package.json index 1b3595ae873c..c3042058d3aa 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/package.json +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/package.json @@ -1,117 +1,124 @@ { "name": "@azure/arm-resourcesdeploymentstacks", - "sdk-type": "mgmt", - "author": "Microsoft Corporation", + "version": "2.0.0", "description": "A generated SDK for DeploymentStacksClient.", - "version": "1.0.2", "engines": { "node": ">=20.0.0" }, - "dependencies": { - "@azure/abort-controller": "^2.1.2", - "@azure/core-auth": "^1.9.0", - "@azure/core-client": "^1.9.2", - "@azure/core-lro": "^2.5.4", - "@azure/core-paging": "^1.6.2", - "@azure/core-rest-pipeline": "^1.19.0", - "tslib": "^2.8.1" + "sideEffects": false, + "autoPublish": false, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts", + "./api": "./src/api/index.ts", + "./api/deploymentStacks": "./src/api/deploymentStacks/index.ts", + "./api/deploymentStacksWhatIfResultsAtManagementGroup": "./src/api/deploymentStacksWhatIfResultsAtManagementGroup/index.ts", + "./api/deploymentStacksWhatIfResultsAtSubscription": "./src/api/deploymentStacksWhatIfResultsAtSubscription/index.ts", + "./api/deploymentStacksWhatIfResultsAtResourceGroup": "./src/api/deploymentStacksWhatIfResultsAtResourceGroup/index.ts", + "./models": "./src/models/index.ts" + }, + "dialects": [ + "esm", + "commonjs" + ], + "esmDialects": [ + "browser", + "react-native" + ], + "selfLink": false, + "project": "../../../tsconfig.src.build.json" }, + "type": "module", + "browser": "./dist/browser/index.js", + "react-native": "./dist/react-native/index.js", "keywords": [ "node", "azure", + "cloud", "typescript", "browser", "isomorphic" ], + "author": "Microsoft Corporation", "license": "MIT", - "main": "./dist/commonjs/index.js", - "module": "./dist/esm/index.js", - "types": "./dist/commonjs/index.d.ts", + "files": [ + "dist/", + "!dist/**/*.d.*ts.map", + "README.md", + "LICENSE" + ], + "sdk-type": "mgmt", + "repository": "github:Azure/azure-sdk-for-js", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/README.md", + "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", + "//metadata": { + "constantPaths": [ + { + "path": "src/api/deploymentStacksContext.ts", + "prefix": "userAgentInfo" + } + ] + }, + "dependencies": { + "@azure/core-util": "^1.12.0", + "@azure-rest/core-client": "^2.3.1", + "@azure/abort-controller": "^2.1.2", + "@azure/core-auth": "^1.9.0", + "@azure/core-lro": "^3.1.0", + "@azure/core-rest-pipeline": "^1.20.0", + "@azure/logger": "^1.2.0", + "tslib": "^2.8.1" + }, "devDependencies": { "@azure-tools/test-credential": "workspace:^", "@azure-tools/test-recorder": "workspace:^", "@azure-tools/test-utils-vitest": "workspace:^", "@azure/dev-tool": "workspace:^", + "tshy": "catalog:", + "@azure/eslint-plugin-azure-sdk": "workspace:^", "@azure/identity": "catalog:internal", - "@azure/logger": "^1.1.4", "@types/node": "catalog:", + "cross-env": "catalog:", + "eslint": "catalog:", + "prettier": "catalog:", + "rimraf": "catalog:", "@vitest/browser-playwright": "catalog:testing", "@vitest/coverage-istanbul": "catalog:testing", - "cross-env": "catalog:", "dotenv": "catalog:testing", "playwright": "catalog:testing", - "rimraf": "catalog:", - "tshy": "catalog:", "typescript": "catalog:", "vitest": "catalog:testing" }, - "repository": { - "type": "git", - "url": "https://github.com/Azure/azure-sdk-for-js.git" - }, - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "files": [ - "dist/", - "README.md", - "LICENSE", - "review/", - "CHANGELOG.md" - ], "scripts": { - "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api", - "build:samples": "tsc -p tsconfig.samples.json && dev-tool samples publish -f", - "check-format": "echo skipped", "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", - "execute:samples": "echo skipped", - "extract-api": "dev-tool run extract-api", - "format": "echo skipped", - "lint": "echo skipped", + "extract-api": "rimraf review && dev-tool run extract-api", "pack": "pnpm pack 2>&1", + "lint": "echo skipped", + "lint:fix": "echo skipped", + "build:samples": "tsc -p tsconfig.samples.json && dev-tool samples publish -f", + "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" \"samples-dev/*.ts\"", + "execute:samples": "dev-tool samples run samples-dev", + "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" \"samples-dev/*.ts\"", + "generate:client": "echo skipped", + "test:browser": "dev-tool run build-test && dev-tool run test:vitest --browser", + "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api", + "test:node": "dev-tool run test:vitest", + "test:node:esm": "dev-tool run test:vitest --esm", "test": "npm run test:node && npm run test:browser", - "test:browser": "echo skipped", - "test:node": "dev-tool run build-test --no-browser-test && dev-tool run test:vitest", "update-snippets": "dev-tool run update-snippets" }, - "sideEffects": false, - "//metadata": { - "constantPaths": [ - { - "path": "src/deploymentStacksClient.ts", - "prefix": "packageDetails" - } - ] - }, - "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks", "//sampleConfiguration": { - "productName": "", + "productName": "@azure/arm-resourcesdeploymentstacks", "productSlugs": [ "azure" ], "disableDocsMs": true, "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-resourcesdeploymentstacks?view=azure-node-preview" }, - "type": "module", - "tshy": { - "project": "../../../tsconfig.src.build.json", - "exports": { - "./package.json": "./package.json", - ".": "./src/index.ts" - }, - "dialects": [ - "esm", - "commonjs" - ], - "esmDialects": [ - "browser", - "react-native" - ], - "selfLink": false - }, - "browser": "./dist/browser/index.js", - "react-native": "./dist/react-native/index.js", "exports": { "./package.json": "./package.json", ".": { @@ -131,6 +138,117 @@ "types": "./dist/commonjs/index.d.ts", "default": "./dist/commonjs/index.js" } + }, + "./api": { + "browser": { + "types": "./dist/browser/api/index.d.ts", + "default": "./dist/browser/api/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/index.d.ts", + "default": "./dist/react-native/api/index.js" + }, + "import": { + "types": "./dist/esm/api/index.d.ts", + "default": "./dist/esm/api/index.js" + }, + "require": { + "types": "./dist/commonjs/api/index.d.ts", + "default": "./dist/commonjs/api/index.js" + } + }, + "./api/deploymentStacks": { + "browser": { + "types": "./dist/browser/api/deploymentStacks/index.d.ts", + "default": "./dist/browser/api/deploymentStacks/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/deploymentStacks/index.d.ts", + "default": "./dist/react-native/api/deploymentStacks/index.js" + }, + "import": { + "types": "./dist/esm/api/deploymentStacks/index.d.ts", + "default": "./dist/esm/api/deploymentStacks/index.js" + }, + "require": { + "types": "./dist/commonjs/api/deploymentStacks/index.d.ts", + "default": "./dist/commonjs/api/deploymentStacks/index.js" + } + }, + "./api/deploymentStacksWhatIfResultsAtManagementGroup": { + "browser": { + "types": "./dist/browser/api/deploymentStacksWhatIfResultsAtManagementGroup/index.d.ts", + "default": "./dist/browser/api/deploymentStacksWhatIfResultsAtManagementGroup/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/deploymentStacksWhatIfResultsAtManagementGroup/index.d.ts", + "default": "./dist/react-native/api/deploymentStacksWhatIfResultsAtManagementGroup/index.js" + }, + "import": { + "types": "./dist/esm/api/deploymentStacksWhatIfResultsAtManagementGroup/index.d.ts", + "default": "./dist/esm/api/deploymentStacksWhatIfResultsAtManagementGroup/index.js" + }, + "require": { + "types": "./dist/commonjs/api/deploymentStacksWhatIfResultsAtManagementGroup/index.d.ts", + "default": "./dist/commonjs/api/deploymentStacksWhatIfResultsAtManagementGroup/index.js" + } + }, + "./api/deploymentStacksWhatIfResultsAtSubscription": { + "browser": { + "types": "./dist/browser/api/deploymentStacksWhatIfResultsAtSubscription/index.d.ts", + "default": "./dist/browser/api/deploymentStacksWhatIfResultsAtSubscription/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/deploymentStacksWhatIfResultsAtSubscription/index.d.ts", + "default": "./dist/react-native/api/deploymentStacksWhatIfResultsAtSubscription/index.js" + }, + "import": { + "types": "./dist/esm/api/deploymentStacksWhatIfResultsAtSubscription/index.d.ts", + "default": "./dist/esm/api/deploymentStacksWhatIfResultsAtSubscription/index.js" + }, + "require": { + "types": "./dist/commonjs/api/deploymentStacksWhatIfResultsAtSubscription/index.d.ts", + "default": "./dist/commonjs/api/deploymentStacksWhatIfResultsAtSubscription/index.js" + } + }, + "./api/deploymentStacksWhatIfResultsAtResourceGroup": { + "browser": { + "types": "./dist/browser/api/deploymentStacksWhatIfResultsAtResourceGroup/index.d.ts", + "default": "./dist/browser/api/deploymentStacksWhatIfResultsAtResourceGroup/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/deploymentStacksWhatIfResultsAtResourceGroup/index.d.ts", + "default": "./dist/react-native/api/deploymentStacksWhatIfResultsAtResourceGroup/index.js" + }, + "import": { + "types": "./dist/esm/api/deploymentStacksWhatIfResultsAtResourceGroup/index.d.ts", + "default": "./dist/esm/api/deploymentStacksWhatIfResultsAtResourceGroup/index.js" + }, + "require": { + "types": "./dist/commonjs/api/deploymentStacksWhatIfResultsAtResourceGroup/index.d.ts", + "default": "./dist/commonjs/api/deploymentStacksWhatIfResultsAtResourceGroup/index.js" + } + }, + "./models": { + "browser": { + "types": "./dist/browser/models/index.d.ts", + "default": "./dist/browser/models/index.js" + }, + "react-native": { + "types": "./dist/react-native/models/index.d.ts", + "default": "./dist/react-native/models/index.js" + }, + "import": { + "types": "./dist/esm/models/index.d.ts", + "default": "./dist/esm/models/index.js" + }, + "require": { + "types": "./dist/commonjs/models/index.d.ts", + "default": "./dist/commonjs/models/index.js" + } } - } + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "module": "./dist/esm/index.js" } diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/review/arm-resourcesdeploymentstacks-api-deploymentStacks-node.api.md b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/review/arm-resourcesdeploymentstacks-api-deploymentStacks-node.api.md new file mode 100644 index 000000000000..6ef58ad5c3e9 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/review/arm-resourcesdeploymentstacks-api-deploymentStacks-node.api.md @@ -0,0 +1,164 @@ +## API Report File for "@azure/arm-resourcesdeploymentstacks" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; +import type { OperationState } from '@azure/core-lro'; +import type { PollerLike } from '@azure/core-lro'; + +// @public +export function createOrUpdateAtManagementGroup(context: DeploymentStacksContext, managementGroupId: string, deploymentStackName: string, deploymentStack: DeploymentStack, options?: DeploymentStacksCreateOrUpdateAtManagementGroupOptionalParams): PollerLike, DeploymentStack>; + +// @public +export function createOrUpdateAtResourceGroup(context: DeploymentStacksContext, resourceGroupName: string, deploymentStackName: string, deploymentStack: DeploymentStack, options?: DeploymentStacksCreateOrUpdateAtResourceGroupOptionalParams): PollerLike, DeploymentStack>; + +// @public +export function createOrUpdateAtSubscription(context: DeploymentStacksContext, deploymentStackName: string, deploymentStack: DeploymentStack, options?: DeploymentStacksCreateOrUpdateAtSubscriptionOptionalParams): PollerLike, DeploymentStack>; + +// @public +export function deleteAtManagementGroup(context: DeploymentStacksContext, managementGroupId: string, deploymentStackName: string, options?: DeploymentStacksDeleteAtManagementGroupOptionalParams): PollerLike, void>; + +// @public +export function deleteAtResourceGroup(context: DeploymentStacksContext, resourceGroupName: string, deploymentStackName: string, options?: DeploymentStacksDeleteAtResourceGroupOptionalParams): PollerLike, void>; + +// @public +export function deleteAtSubscription(context: DeploymentStacksContext, deploymentStackName: string, options?: DeploymentStacksDeleteAtSubscriptionOptionalParams): PollerLike, void>; + +// @public +export interface DeploymentStacksCreateOrUpdateAtManagementGroupOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface DeploymentStacksCreateOrUpdateAtResourceGroupOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface DeploymentStacksCreateOrUpdateAtSubscriptionOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface DeploymentStacksDeleteAtManagementGroupOptionalParams extends OperationOptions { + bypassStackOutOfSyncError?: boolean; + unmanageActionManagementGroups?: DeploymentStacksDeleteDetachEnum; + unmanageActionResourceGroups?: DeploymentStacksDeleteDetachEnum; + unmanageActionResources?: DeploymentStacksDeleteDetachEnum; + unmanageActionResourcesWithoutDeleteSupport?: DeploymentStacksResourcesWithoutDeleteSupportEnum; + updateIntervalInMs?: number; +} + +// @public +export interface DeploymentStacksDeleteAtResourceGroupOptionalParams extends OperationOptions { + bypassStackOutOfSyncError?: boolean; + unmanageActionManagementGroups?: DeploymentStacksDeleteDetachEnum; + unmanageActionResourceGroups?: DeploymentStacksDeleteDetachEnum; + unmanageActionResources?: DeploymentStacksDeleteDetachEnum; + unmanageActionResourcesWithoutDeleteSupport?: DeploymentStacksResourcesWithoutDeleteSupportEnum; + updateIntervalInMs?: number; +} + +// @public +export interface DeploymentStacksDeleteAtSubscriptionOptionalParams extends OperationOptions { + bypassStackOutOfSyncError?: boolean; + unmanageActionManagementGroups?: DeploymentStacksDeleteDetachEnum; + unmanageActionResourceGroups?: DeploymentStacksDeleteDetachEnum; + unmanageActionResources?: DeploymentStacksDeleteDetachEnum; + unmanageActionResourcesWithoutDeleteSupport?: DeploymentStacksResourcesWithoutDeleteSupportEnum; + updateIntervalInMs?: number; +} + +// @public +export interface DeploymentStacksExportTemplateAtManagementGroupOptionalParams extends OperationOptions { +} + +// @public +export interface DeploymentStacksExportTemplateAtResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface DeploymentStacksExportTemplateAtSubscriptionOptionalParams extends OperationOptions { +} + +// @public +export interface DeploymentStacksGetAtManagementGroupOptionalParams extends OperationOptions { +} + +// @public +export interface DeploymentStacksGetAtResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface DeploymentStacksGetAtSubscriptionOptionalParams extends OperationOptions { +} + +// @public +export interface DeploymentStacksListAtManagementGroupOptionalParams extends OperationOptions { +} + +// @public +export interface DeploymentStacksListAtResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface DeploymentStacksListAtSubscriptionOptionalParams extends OperationOptions { +} + +// @public +export interface DeploymentStacksValidateStackAtManagementGroupOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface DeploymentStacksValidateStackAtResourceGroupOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface DeploymentStacksValidateStackAtSubscriptionOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export function exportTemplateAtManagementGroup(context: DeploymentStacksContext, managementGroupId: string, deploymentStackName: string, options?: DeploymentStacksExportTemplateAtManagementGroupOptionalParams): Promise; + +// @public +export function exportTemplateAtResourceGroup(context: DeploymentStacksContext, resourceGroupName: string, deploymentStackName: string, options?: DeploymentStacksExportTemplateAtResourceGroupOptionalParams): Promise; + +// @public +export function exportTemplateAtSubscription(context: DeploymentStacksContext, deploymentStackName: string, options?: DeploymentStacksExportTemplateAtSubscriptionOptionalParams): Promise; + +// @public +export function getAtManagementGroup(context: DeploymentStacksContext, managementGroupId: string, deploymentStackName: string, options?: DeploymentStacksGetAtManagementGroupOptionalParams): Promise; + +// @public +export function getAtResourceGroup(context: DeploymentStacksContext, resourceGroupName: string, deploymentStackName: string, options?: DeploymentStacksGetAtResourceGroupOptionalParams): Promise; + +// @public +export function getAtSubscription(context: DeploymentStacksContext, deploymentStackName: string, options?: DeploymentStacksGetAtSubscriptionOptionalParams): Promise; + +// @public +export function listAtManagementGroup(context: DeploymentStacksContext, managementGroupId: string, options?: DeploymentStacksListAtManagementGroupOptionalParams): PagedAsyncIterableIterator; + +// @public +export function listAtResourceGroup(context: DeploymentStacksContext, resourceGroupName: string, options?: DeploymentStacksListAtResourceGroupOptionalParams): PagedAsyncIterableIterator; + +// @public +export function listAtSubscription(context: DeploymentStacksContext, options?: DeploymentStacksListAtSubscriptionOptionalParams): PagedAsyncIterableIterator; + +// @public +export function validateStackAtManagementGroup(context: DeploymentStacksContext, managementGroupId: string, deploymentStackName: string, deploymentStack: DeploymentStack, options?: DeploymentStacksValidateStackAtManagementGroupOptionalParams): PollerLike, DeploymentStackValidateResult>; + +// @public +export function validateStackAtResourceGroup(context: DeploymentStacksContext, resourceGroupName: string, deploymentStackName: string, deploymentStack: DeploymentStack, options?: DeploymentStacksValidateStackAtResourceGroupOptionalParams): PollerLike, DeploymentStackValidateResult>; + +// @public +export function validateStackAtSubscription(context: DeploymentStacksContext, deploymentStackName: string, deploymentStack: DeploymentStack, options?: DeploymentStacksValidateStackAtSubscriptionOptionalParams): PollerLike, DeploymentStackValidateResult>; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/review/arm-resourcesdeploymentstacks-api-deploymentStacksWhatIfResultsAtManagementGroup-node.api.md b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/review/arm-resourcesdeploymentstacks-api-deploymentStacksWhatIfResultsAtManagementGroup-node.api.md new file mode 100644 index 000000000000..7edcf8b96bc4 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/review/arm-resourcesdeploymentstacks-api-deploymentStacksWhatIfResultsAtManagementGroup-node.api.md @@ -0,0 +1,56 @@ +## API Report File for "@azure/arm-resourcesdeploymentstacks" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; +import type { OperationState } from '@azure/core-lro'; +import type { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: DeploymentStacksContext, managementGroupId: string, deploymentStacksWhatIfResultName: string, options?: DeploymentStacksWhatIfResultsAtManagementGroupDeleteOptionalParams): Promise; + +// @public +export function createOrUpdate(context: DeploymentStacksContext, managementGroupId: string, deploymentStacksWhatIfResultName: string, resource: DeploymentStacksWhatIfResult, options?: DeploymentStacksWhatIfResultsAtManagementGroupCreateOrUpdateOptionalParams): PollerLike, DeploymentStacksWhatIfResult>; + +// @public +export interface DeploymentStacksWhatIfResultsAtManagementGroupCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface DeploymentStacksWhatIfResultsAtManagementGroupDeleteOptionalParams extends OperationOptions { + bypassStackOutOfSyncError?: boolean; + unmanageActionManagementGroups?: DeploymentStacksDeleteDetachEnum; + unmanageActionResourceGroups?: DeploymentStacksDeleteDetachEnum; + unmanageActionResources?: DeploymentStacksDeleteDetachEnum; + unmanageActionResourcesWithoutDeleteSupport?: DeploymentStacksResourcesWithoutDeleteSupportEnum; +} + +// @public +export interface DeploymentStacksWhatIfResultsAtManagementGroupGetOptionalParams extends OperationOptions { +} + +// @public +export interface DeploymentStacksWhatIfResultsAtManagementGroupListOptionalParams extends OperationOptions { +} + +// @public +export interface DeploymentStacksWhatIfResultsAtManagementGroupWhatIfOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export function get(context: DeploymentStacksContext, managementGroupId: string, deploymentStacksWhatIfResultName: string, options?: DeploymentStacksWhatIfResultsAtManagementGroupGetOptionalParams): Promise; + +// @public +export function list(context: DeploymentStacksContext, managementGroupId: string, options?: DeploymentStacksWhatIfResultsAtManagementGroupListOptionalParams): PagedAsyncIterableIterator; + +// @public +export function whatIf(context: DeploymentStacksContext, managementGroupId: string, deploymentStacksWhatIfResultName: string, options?: DeploymentStacksWhatIfResultsAtManagementGroupWhatIfOptionalParams): PollerLike, DeploymentStacksWhatIfResult>; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/review/arm-resourcesdeploymentstacks-api-deploymentStacksWhatIfResultsAtResourceGroup-node.api.md b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/review/arm-resourcesdeploymentstacks-api-deploymentStacksWhatIfResultsAtResourceGroup-node.api.md new file mode 100644 index 000000000000..80612852ad68 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/review/arm-resourcesdeploymentstacks-api-deploymentStacksWhatIfResultsAtResourceGroup-node.api.md @@ -0,0 +1,56 @@ +## API Report File for "@azure/arm-resourcesdeploymentstacks" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; +import type { OperationState } from '@azure/core-lro'; +import type { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: DeploymentStacksContext, resourceGroupName: string, deploymentStacksWhatIfResultName: string, options?: DeploymentStacksWhatIfResultsAtResourceGroupDeleteOptionalParams): Promise; + +// @public +export function createOrUpdate(context: DeploymentStacksContext, resourceGroupName: string, deploymentStacksWhatIfResultName: string, resource: DeploymentStacksWhatIfResult, options?: DeploymentStacksWhatIfResultsAtResourceGroupCreateOrUpdateOptionalParams): PollerLike, DeploymentStacksWhatIfResult>; + +// @public +export interface DeploymentStacksWhatIfResultsAtResourceGroupCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface DeploymentStacksWhatIfResultsAtResourceGroupDeleteOptionalParams extends OperationOptions { + bypassStackOutOfSyncError?: boolean; + unmanageActionManagementGroups?: DeploymentStacksDeleteDetachEnum; + unmanageActionResourceGroups?: DeploymentStacksDeleteDetachEnum; + unmanageActionResources?: DeploymentStacksDeleteDetachEnum; + unmanageActionResourcesWithoutDeleteSupport?: DeploymentStacksResourcesWithoutDeleteSupportEnum; +} + +// @public +export interface DeploymentStacksWhatIfResultsAtResourceGroupGetOptionalParams extends OperationOptions { +} + +// @public +export interface DeploymentStacksWhatIfResultsAtResourceGroupListOptionalParams extends OperationOptions { +} + +// @public +export interface DeploymentStacksWhatIfResultsAtResourceGroupWhatIfOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export function get(context: DeploymentStacksContext, resourceGroupName: string, deploymentStacksWhatIfResultName: string, options?: DeploymentStacksWhatIfResultsAtResourceGroupGetOptionalParams): Promise; + +// @public +export function list(context: DeploymentStacksContext, resourceGroupName: string, options?: DeploymentStacksWhatIfResultsAtResourceGroupListOptionalParams): PagedAsyncIterableIterator; + +// @public +export function whatIf(context: DeploymentStacksContext, resourceGroupName: string, deploymentStacksWhatIfResultName: string, options?: DeploymentStacksWhatIfResultsAtResourceGroupWhatIfOptionalParams): PollerLike, DeploymentStacksWhatIfResult>; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/review/arm-resourcesdeploymentstacks-api-deploymentStacksWhatIfResultsAtSubscription-node.api.md b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/review/arm-resourcesdeploymentstacks-api-deploymentStacksWhatIfResultsAtSubscription-node.api.md new file mode 100644 index 000000000000..46787f823fc8 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/review/arm-resourcesdeploymentstacks-api-deploymentStacksWhatIfResultsAtSubscription-node.api.md @@ -0,0 +1,56 @@ +## API Report File for "@azure/arm-resourcesdeploymentstacks" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; +import type { OperationState } from '@azure/core-lro'; +import type { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: DeploymentStacksContext, deploymentStacksWhatIfResultName: string, options?: DeploymentStacksWhatIfResultsAtSubscriptionDeleteOptionalParams): Promise; + +// @public +export function createOrUpdate(context: DeploymentStacksContext, deploymentStacksWhatIfResultName: string, resource: DeploymentStacksWhatIfResult, options?: DeploymentStacksWhatIfResultsAtSubscriptionCreateOrUpdateOptionalParams): PollerLike, DeploymentStacksWhatIfResult>; + +// @public +export interface DeploymentStacksWhatIfResultsAtSubscriptionCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface DeploymentStacksWhatIfResultsAtSubscriptionDeleteOptionalParams extends OperationOptions { + bypassStackOutOfSyncError?: boolean; + unmanageActionManagementGroups?: DeploymentStacksDeleteDetachEnum; + unmanageActionResourceGroups?: DeploymentStacksDeleteDetachEnum; + unmanageActionResources?: DeploymentStacksDeleteDetachEnum; + unmanageActionResourcesWithoutDeleteSupport?: DeploymentStacksResourcesWithoutDeleteSupportEnum; +} + +// @public +export interface DeploymentStacksWhatIfResultsAtSubscriptionGetOptionalParams extends OperationOptions { +} + +// @public +export interface DeploymentStacksWhatIfResultsAtSubscriptionListOptionalParams extends OperationOptions { +} + +// @public +export interface DeploymentStacksWhatIfResultsAtSubscriptionWhatIfOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export function get(context: DeploymentStacksContext, deploymentStacksWhatIfResultName: string, options?: DeploymentStacksWhatIfResultsAtSubscriptionGetOptionalParams): Promise; + +// @public +export function list(context: DeploymentStacksContext, options?: DeploymentStacksWhatIfResultsAtSubscriptionListOptionalParams): PagedAsyncIterableIterator; + +// @public +export function whatIf(context: DeploymentStacksContext, deploymentStacksWhatIfResultName: string, options?: DeploymentStacksWhatIfResultsAtSubscriptionWhatIfOptionalParams): PollerLike, DeploymentStacksWhatIfResult>; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/review/arm-resourcesdeploymentstacks-api-node.api.md b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/review/arm-resourcesdeploymentstacks-api-node.api.md new file mode 100644 index 000000000000..35bb6d215c97 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/review/arm-resourcesdeploymentstacks-api-node.api.md @@ -0,0 +1,28 @@ +## API Report File for "@azure/arm-resourcesdeploymentstacks" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { ClientOptions } from '@azure-rest/core-client'; +import type { TokenCredential } from '@azure/core-auth'; + +// @public +export function createDeploymentStacks(credential: TokenCredential, subscriptionId: string, options?: DeploymentStacksClientOptionalParams): DeploymentStacksContext; + +// @public +export interface DeploymentStacksClientOptionalParams extends ClientOptions { + apiVersion?: string; + cloudSetting?: AzureSupportedClouds; +} + +// @public +export interface DeploymentStacksContext extends Client { + apiVersion: string; + subscriptionId: string; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/review/arm-resourcesdeploymentstacks-models-node.api.md b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/review/arm-resourcesdeploymentstacks-models-node.api.md new file mode 100644 index 000000000000..d67f9612a7ed --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/review/arm-resourcesdeploymentstacks-models-node.api.md @@ -0,0 +1,512 @@ +## API Report File for "@azure/arm-resourcesdeploymentstacks" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +// @public +export interface ActionOnUnmanage { + managementGroups?: DeploymentStacksDeleteDetachEnum; + resourceGroups?: DeploymentStacksDeleteDetachEnum; + resources: DeploymentStacksDeleteDetachEnum; + resourcesWithoutDeleteSupport?: DeploymentStacksResourcesWithoutDeleteSupportEnum; +} + +// @public +export type CreatedByType = string; + +// @public +export interface DenySettings { + applyToChildScopes?: boolean; + excludedActions?: string[]; + excludedPrincipals?: string[]; + mode: DenySettingsMode; +} + +// @public +export type DenySettingsMode = string; + +// @public +export type DenyStatusMode = string; + +// @public +export interface DeploymentExtension { + config?: DeploymentExtensionConfig; + configId?: string; + name: string; + version: string; +} + +// @public +export interface DeploymentExtensionConfig { + additionalProperties?: Record; +} + +// @public +export interface DeploymentExtensionConfigItem { + keyVaultReference?: KeyVaultParameterReference; + readonly type?: string; + value?: any; +} + +// @public +export interface DeploymentExternalInput { + value: any; +} + +// @public +export interface DeploymentExternalInputDefinition { + config?: any; + kind: string; +} + +// @public +export interface DeploymentParameter { + expression?: string; + reference?: KeyVaultParameterReference; + type?: string; + value?: any; +} + +// @public +export interface DeploymentStack extends ProxyResource { + actionOnUnmanage?: ActionOnUnmanage; + bypassStackOutOfSyncError?: boolean; + readonly correlationId?: string; + debugSetting?: DeploymentStacksDebugSetting; + readonly deletedResources?: ResourceReference[]; + denySettings?: DenySettings; + readonly deploymentExtensions?: DeploymentExtension[]; + readonly deploymentId?: string; + deploymentScope?: string; + description?: string; + readonly detachedResources?: ResourceReference[]; + readonly duration?: string; + error?: ErrorDetail; + extensionConfigs?: Record; + externalInputDefinitions?: Record; + externalInputs?: Record; + readonly failedResources?: ResourceReferenceExtended[]; + location?: string; + readonly outputs?: Record; + parameters?: Record; + parametersLink?: DeploymentStacksParametersLink; + readonly provisioningState?: DeploymentStackProvisioningState; + readonly resources?: ManagedResourceReference[]; + tags?: Record; + template?: Record; + templateLink?: DeploymentStacksTemplateLink; + validationLevel?: ValidationLevel; +} + +// @public +export interface DeploymentStackProperties { + actionOnUnmanage: ActionOnUnmanage; + bypassStackOutOfSyncError?: boolean; + readonly correlationId?: string; + debugSetting?: DeploymentStacksDebugSetting; + readonly deletedResources?: ResourceReference[]; + denySettings: DenySettings; + readonly deploymentExtensions?: DeploymentExtension[]; + readonly deploymentId?: string; + deploymentScope?: string; + description?: string; + readonly detachedResources?: ResourceReference[]; + readonly duration?: string; + error?: ErrorDetail; + extensionConfigs?: Record; + externalInputDefinitions?: Record; + externalInputs?: Record; + readonly failedResources?: ResourceReferenceExtended[]; + readonly outputs?: Record; + parameters?: Record; + parametersLink?: DeploymentStacksParametersLink; + readonly provisioningState?: DeploymentStackProvisioningState; + readonly resources?: ManagedResourceReference[]; + template?: Record; + templateLink?: DeploymentStacksTemplateLink; + validationLevel?: ValidationLevel; +} + +// @public +export type DeploymentStackProvisioningState = string; + +// @public +export interface DeploymentStacksChangeBase { + after?: string; + before?: string; +} + +// @public +export interface DeploymentStacksChangeBaseDenyStatusMode { + after?: DenyStatusMode; + before?: DenyStatusMode; +} + +// @public +export interface DeploymentStacksChangeBaseDeploymentStacksManagementStatus { + after?: DeploymentStacksManagementStatus; + before?: DeploymentStacksManagementStatus; +} + +// @public +export interface DeploymentStacksChangeDeltaDenySettings { + after?: DenySettings; + before?: DenySettings; + delta?: DeploymentStacksWhatIfPropertyChange[]; +} + +// @public +export interface DeploymentStacksChangeDeltaRecord { + after?: Record; + before?: Record; + delta?: DeploymentStacksWhatIfPropertyChange[]; +} + +// @public +export interface DeploymentStacksDebugSetting { + detailLevel?: string; +} + +// @public +export type DeploymentStacksDeleteDetachEnum = string; + +// @public +export interface DeploymentStacksDiagnostic { + additionalInfo?: ErrorAdditionalInfo[]; + code: string; + level: DeploymentStacksDiagnosticLevel; + message: string; + target?: string; +} + +// @public +export type DeploymentStacksDiagnosticLevel = string; + +// @public +export type DeploymentStacksManagementStatus = string; + +// @public +export interface DeploymentStacksParametersLink { + contentVersion?: string; + uri: string; +} + +// @public +export type DeploymentStacksResourcesWithoutDeleteSupportEnum = string; + +// @public +export interface DeploymentStacksTemplateLink { + contentVersion?: string; + id?: string; + queryString?: string; + relativePath?: string; + uri?: string; +} + +// @public +export interface DeploymentStacksWhatIfChange { + denySettingsChange: DeploymentStacksChangeDeltaDenySettings; + deploymentScopeChange?: DeploymentStacksChangeBase; + resourceChanges: DeploymentStacksWhatIfResourceChange[]; +} + +// @public +export type DeploymentStacksWhatIfChangeCertainty = string; + +// @public +export type DeploymentStacksWhatIfChangeType = string; + +// @public +export interface DeploymentStacksWhatIfPropertyChange { + after?: any; + before?: any; + changeType: DeploymentStacksWhatIfPropertyChangeType; + children?: DeploymentStacksWhatIfPropertyChange[]; + path: string; +} + +// @public +export type DeploymentStacksWhatIfPropertyChangeType = string; + +// @public +export interface DeploymentStacksWhatIfResourceChange { + readonly apiVersion?: string; + changeCertainty: DeploymentStacksWhatIfChangeCertainty; + changeType: DeploymentStacksWhatIfChangeType; + denyStatusChange?: DeploymentStacksChangeBaseDenyStatusMode; + deploymentId?: string; + readonly extension?: DeploymentExtension; + readonly id?: string; + readonly identifiers?: Record; + managementStatusChange?: DeploymentStacksChangeBaseDeploymentStacksManagementStatus; + resourceConfigurationChanges?: DeploymentStacksChangeDeltaRecord; + symbolicName?: string; + readonly type?: string; + unsupportedReason?: string; +} + +// @public +export interface DeploymentStacksWhatIfResult extends ProxyResource { + location?: string; + properties?: DeploymentStacksWhatIfResultProperties; + tags?: Record; +} + +// @public +export interface DeploymentStacksWhatIfResultProperties { + actionOnUnmanage: ActionOnUnmanage; + readonly changes?: DeploymentStacksWhatIfChange; + readonly correlationId?: string; + debugSetting?: DeploymentStacksDebugSetting; + denySettings: DenySettings; + deploymentScope?: string; + readonly deploymentStackLastModified?: Date; + deploymentStackResourceId: string; + description?: string; + readonly diagnostics?: DeploymentStacksDiagnostic[]; + error?: ErrorDetail; + extensionConfigs?: Record; + externalInputDefinitions?: Record; + externalInputs?: Record; + parameters?: Record; + parametersLink?: DeploymentStacksParametersLink; + readonly provisioningState?: DeploymentStackProvisioningState; + retentionInterval: string; + template?: Record; + templateLink?: DeploymentStacksTemplateLink; + validationLevel?: ValidationLevel; +} + +// @public +export interface DeploymentStackTemplateDefinition { + template?: Record; + templateLink?: DeploymentStacksTemplateLink; +} + +// @public +export interface DeploymentStackValidateProperties { + actionOnUnmanage?: ActionOnUnmanage; + correlationId?: string; + denySettings?: DenySettings; + deploymentExtensions?: DeploymentExtension[]; + deploymentScope?: string; + description?: string; + parameters?: Record; + templateLink?: DeploymentStacksTemplateLink; + validatedResources?: ResourceReference[]; + validationLevel?: ValidationLevel; +} + +// @public +export interface DeploymentStackValidateResult { + error?: ErrorDetail; + readonly id?: string; + readonly name?: string; + properties?: DeploymentStackValidateProperties; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export interface ErrorAdditionalInfo { + readonly info?: any; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +export interface KeyVaultParameterReference { + keyVault: KeyVaultReference; + secretName: string; + secretVersion?: string; +} + +// @public +export interface KeyVaultReference { + id: string; +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownDenySettingsMode { + DenyDelete = "denyDelete", + DenyWriteAndDelete = "denyWriteAndDelete", + None = "none" +} + +// @public +export enum KnownDenyStatusMode { + DenyDelete = "denyDelete", + DenyWriteAndDelete = "denyWriteAndDelete", + Inapplicable = "inapplicable", + None = "none", + NotSupported = "notSupported", + RemovedBySystem = "removedBySystem", + Unknown = "unknown" +} + +// @public +export enum KnownDeploymentStackProvisioningState { + Canceled = "canceled", + Canceling = "canceling", + Creating = "creating", + Deleting = "deleting", + DeletingResources = "deletingResources", + Deploying = "deploying", + Failed = "failed", + Initializing = "initializing", + Running = "running", + Succeeded = "succeeded", + UpdatingDenyAssignments = "updatingDenyAssignments", + Validating = "validating", + Waiting = "waiting" +} + +// @public +export enum KnownDeploymentStacksDeleteDetachEnum { + Delete = "delete", + Detach = "detach" +} + +// @public +export enum KnownDeploymentStacksDiagnosticLevel { + Error = "error", + Info = "info", + Warning = "warning" +} + +// @public +export enum KnownDeploymentStacksManagementStatus { + Managed = "managed", + Unknown = "unknown", + Unmanaged = "unmanaged" +} + +// @public +export enum KnownDeploymentStacksResourcesWithoutDeleteSupportEnum { + Detach = "detach", + Fail = "fail" +} + +// @public +export enum KnownDeploymentStacksWhatIfChangeCertainty { + Definite = "definite", + Potential = "potential" +} + +// @public +export enum KnownDeploymentStacksWhatIfChangeType { + Create = "create", + Delete = "delete", + Detach = "detach", + Modify = "modify", + NoChange = "noChange", + Unsupported = "unsupported" +} + +// @public +export enum KnownDeploymentStacksWhatIfPropertyChangeType { + Array = "array", + Create = "create", + Delete = "delete", + Modify = "modify", + NoEffect = "noEffect" +} + +// @public +export enum KnownResourceStatusMode { + DeleteFailed = "deleteFailed", + Managed = "managed", + RemoveDenyFailed = "removeDenyFailed" +} + +// @public +export enum KnownValidationLevel { + Provider = "Provider", + ProviderNoRbac = "ProviderNoRbac", + Template = "Template" +} + +// @public +export enum KnownVersions { + V20240301 = "2024-03-01", + V20250701 = "2025-07-01" +} + +// @public +export interface ManagedResourceReference extends ResourceReference { + denyStatus?: DenyStatusMode; + status?: ResourceStatusMode; +} + +// @public +export interface ProxyResource extends Resource { +} + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export interface ResourceReference { + readonly apiVersion?: string; + readonly extension?: DeploymentExtension; + readonly id?: string; + readonly identifiers?: Record; + readonly type?: string; +} + +// @public +export interface ResourceReferenceExtended { + readonly apiVersion?: string; + error?: ErrorDetail; + readonly extension?: DeploymentExtension; + readonly id?: string; + readonly identifiers?: Record; + readonly type?: string; +} + +// @public +export type ResourceStatusMode = string; + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export type ValidationLevel = string; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/review/arm-resourcesdeploymentstacks-node.api.md b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/review/arm-resourcesdeploymentstacks-node.api.md index 4516b33b7307..dd1842535230 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/review/arm-resourcesdeploymentstacks-node.api.md +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/review/arm-resourcesdeploymentstacks-node.api.md @@ -4,27 +4,38 @@ ```ts -import * as coreAuth from '@azure/core-auth'; -import * as coreClient from '@azure/core-client'; -import { OperationState } from '@azure/core-lro'; -import { PagedAsyncIterableIterator } from '@azure/core-paging'; -import { SimplePollerLike } from '@azure/core-lro'; +import type { AbortSignalLike } from '@azure/abort-controller'; +import type { ClientOptions } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; +import type { OperationState } from '@azure/core-lro'; +import type { PathUncheckedResponse } from '@azure-rest/core-client'; +import type { Pipeline } from '@azure/core-rest-pipeline'; +import type { PollerLike } from '@azure/core-lro'; +import type { TokenCredential } from '@azure/core-auth'; // @public export interface ActionOnUnmanage { managementGroups?: DeploymentStacksDeleteDetachEnum; resourceGroups?: DeploymentStacksDeleteDetachEnum; resources: DeploymentStacksDeleteDetachEnum; + resourcesWithoutDeleteSupport?: DeploymentStacksResourcesWithoutDeleteSupportEnum; } // @public -export interface AzureResourceBase { - readonly id?: string; - readonly name?: string; - readonly systemData?: SystemData; - readonly type?: string; +export enum AzureClouds { + AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD", + AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD", + AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT" } +// @public +export type AzureSupportedClouds = `${AzureClouds}`; + +// @public +export type ContinuablePage = TPage & { + continuationToken?: string; +}; + // @public export type CreatedByType = string; @@ -42,346 +53,501 @@ export type DenySettingsMode = string; // @public export type DenyStatusMode = string; +// @public +export interface DeploymentExtension { + config?: DeploymentExtensionConfig; + configId?: string; + name: string; + version: string; +} + +// @public +export interface DeploymentExtensionConfig { + additionalProperties?: Record; +} + +// @public +export interface DeploymentExtensionConfigItem { + keyVaultReference?: KeyVaultParameterReference; + readonly type?: string; + value?: any; +} + +// @public +export interface DeploymentExternalInput { + value: any; +} + +// @public +export interface DeploymentExternalInputDefinition { + config?: any; + kind: string; +} + // @public export interface DeploymentParameter { + expression?: string; reference?: KeyVaultParameterReference; type?: string; value?: any; } // @public -export interface DeploymentStack extends AzureResourceBase { +export interface DeploymentStack extends ProxyResource { + actionOnUnmanage?: ActionOnUnmanage; + bypassStackOutOfSyncError?: boolean; + readonly correlationId?: string; + debugSetting?: DeploymentStacksDebugSetting; + readonly deletedResources?: ResourceReference[]; + denySettings?: DenySettings; + readonly deploymentExtensions?: DeploymentExtension[]; + readonly deploymentId?: string; + deploymentScope?: string; + description?: string; + readonly detachedResources?: ResourceReference[]; + readonly duration?: string; + error?: ErrorDetail; + extensionConfigs?: Record; + externalInputDefinitions?: Record; + externalInputs?: Record; + readonly failedResources?: ResourceReferenceExtended[]; location?: string; - properties?: DeploymentStackProperties; - tags?: { - [propertyName: string]: string; - }; -} - -// @public -export interface DeploymentStackListResult { - readonly nextLink?: string; - value?: DeploymentStack[]; + readonly outputs?: Record; + parameters?: Record; + parametersLink?: DeploymentStacksParametersLink; + readonly provisioningState?: DeploymentStackProvisioningState; + readonly resources?: ManagedResourceReference[]; + tags?: Record; + template?: Record; + templateLink?: DeploymentStacksTemplateLink; + validationLevel?: ValidationLevel; } // @public -export interface DeploymentStackProperties extends DeploymentStacksError { +export interface DeploymentStackProperties { actionOnUnmanage: ActionOnUnmanage; bypassStackOutOfSyncError?: boolean; readonly correlationId?: string; debugSetting?: DeploymentStacksDebugSetting; readonly deletedResources?: ResourceReference[]; denySettings: DenySettings; + readonly deploymentExtensions?: DeploymentExtension[]; readonly deploymentId?: string; deploymentScope?: string; description?: string; readonly detachedResources?: ResourceReference[]; readonly duration?: string; + error?: ErrorDetail; + extensionConfigs?: Record; + externalInputDefinitions?: Record; + externalInputs?: Record; readonly failedResources?: ResourceReferenceExtended[]; - readonly outputs?: Record; - parameters?: { - [propertyName: string]: DeploymentParameter; - }; + readonly outputs?: Record; + parameters?: Record; parametersLink?: DeploymentStacksParametersLink; readonly provisioningState?: DeploymentStackProvisioningState; readonly resources?: ManagedResourceReference[]; - template?: Record; + template?: Record; templateLink?: DeploymentStacksTemplateLink; + validationLevel?: ValidationLevel; } // @public export type DeploymentStackProvisioningState = string; // @public -export interface DeploymentStacks { - beginCreateOrUpdateAtManagementGroup(managementGroupId: string, deploymentStackName: string, deploymentStack: DeploymentStack, options?: DeploymentStacksCreateOrUpdateAtManagementGroupOptionalParams): Promise, DeploymentStacksCreateOrUpdateAtManagementGroupResponse>>; - beginCreateOrUpdateAtManagementGroupAndWait(managementGroupId: string, deploymentStackName: string, deploymentStack: DeploymentStack, options?: DeploymentStacksCreateOrUpdateAtManagementGroupOptionalParams): Promise; - beginCreateOrUpdateAtResourceGroup(resourceGroupName: string, deploymentStackName: string, deploymentStack: DeploymentStack, options?: DeploymentStacksCreateOrUpdateAtResourceGroupOptionalParams): Promise, DeploymentStacksCreateOrUpdateAtResourceGroupResponse>>; - beginCreateOrUpdateAtResourceGroupAndWait(resourceGroupName: string, deploymentStackName: string, deploymentStack: DeploymentStack, options?: DeploymentStacksCreateOrUpdateAtResourceGroupOptionalParams): Promise; - beginCreateOrUpdateAtSubscription(deploymentStackName: string, deploymentStack: DeploymentStack, options?: DeploymentStacksCreateOrUpdateAtSubscriptionOptionalParams): Promise, DeploymentStacksCreateOrUpdateAtSubscriptionResponse>>; - beginCreateOrUpdateAtSubscriptionAndWait(deploymentStackName: string, deploymentStack: DeploymentStack, options?: DeploymentStacksCreateOrUpdateAtSubscriptionOptionalParams): Promise; - beginDeleteAtManagementGroup(managementGroupId: string, deploymentStackName: string, options?: DeploymentStacksDeleteAtManagementGroupOptionalParams): Promise, void>>; - beginDeleteAtManagementGroupAndWait(managementGroupId: string, deploymentStackName: string, options?: DeploymentStacksDeleteAtManagementGroupOptionalParams): Promise; - beginDeleteAtResourceGroup(resourceGroupName: string, deploymentStackName: string, options?: DeploymentStacksDeleteAtResourceGroupOptionalParams): Promise, void>>; - beginDeleteAtResourceGroupAndWait(resourceGroupName: string, deploymentStackName: string, options?: DeploymentStacksDeleteAtResourceGroupOptionalParams): Promise; - beginDeleteAtSubscription(deploymentStackName: string, options?: DeploymentStacksDeleteAtSubscriptionOptionalParams): Promise, void>>; - beginDeleteAtSubscriptionAndWait(deploymentStackName: string, options?: DeploymentStacksDeleteAtSubscriptionOptionalParams): Promise; - beginValidateStackAtManagementGroup(managementGroupId: string, deploymentStackName: string, deploymentStack: DeploymentStack, options?: DeploymentStacksValidateStackAtManagementGroupOptionalParams): Promise, DeploymentStacksValidateStackAtManagementGroupResponse>>; - beginValidateStackAtManagementGroupAndWait(managementGroupId: string, deploymentStackName: string, deploymentStack: DeploymentStack, options?: DeploymentStacksValidateStackAtManagementGroupOptionalParams): Promise; - beginValidateStackAtResourceGroup(resourceGroupName: string, deploymentStackName: string, deploymentStack: DeploymentStack, options?: DeploymentStacksValidateStackAtResourceGroupOptionalParams): Promise, DeploymentStacksValidateStackAtResourceGroupResponse>>; - beginValidateStackAtResourceGroupAndWait(resourceGroupName: string, deploymentStackName: string, deploymentStack: DeploymentStack, options?: DeploymentStacksValidateStackAtResourceGroupOptionalParams): Promise; - beginValidateStackAtSubscription(deploymentStackName: string, deploymentStack: DeploymentStack, options?: DeploymentStacksValidateStackAtSubscriptionOptionalParams): Promise, DeploymentStacksValidateStackAtSubscriptionResponse>>; - beginValidateStackAtSubscriptionAndWait(deploymentStackName: string, deploymentStack: DeploymentStack, options?: DeploymentStacksValidateStackAtSubscriptionOptionalParams): Promise; - exportTemplateAtManagementGroup(managementGroupId: string, deploymentStackName: string, options?: DeploymentStacksExportTemplateAtManagementGroupOptionalParams): Promise; - exportTemplateAtResourceGroup(resourceGroupName: string, deploymentStackName: string, options?: DeploymentStacksExportTemplateAtResourceGroupOptionalParams): Promise; - exportTemplateAtSubscription(deploymentStackName: string, options?: DeploymentStacksExportTemplateAtSubscriptionOptionalParams): Promise; - getAtManagementGroup(managementGroupId: string, deploymentStackName: string, options?: DeploymentStacksGetAtManagementGroupOptionalParams): Promise; - getAtResourceGroup(resourceGroupName: string, deploymentStackName: string, options?: DeploymentStacksGetAtResourceGroupOptionalParams): Promise; - getAtSubscription(deploymentStackName: string, options?: DeploymentStacksGetAtSubscriptionOptionalParams): Promise; - listAtManagementGroup(managementGroupId: string, options?: DeploymentStacksListAtManagementGroupOptionalParams): PagedAsyncIterableIterator; - listAtResourceGroup(resourceGroupName: string, options?: DeploymentStacksListAtResourceGroupOptionalParams): PagedAsyncIterableIterator; - listAtSubscription(options?: DeploymentStacksListAtSubscriptionOptionalParams): PagedAsyncIterableIterator; +export interface DeploymentStacksChangeBase { + after?: string; + before?: string; } -// @public (undocumented) -export class DeploymentStacksClient extends coreClient.ServiceClient { - // (undocumented) - $host: string; - constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: DeploymentStacksClientOptionalParams); - constructor(credentials: coreAuth.TokenCredential, options?: DeploymentStacksClientOptionalParams); - // (undocumented) - apiVersion: string; - // (undocumented) - deploymentStacks: DeploymentStacks; - // (undocumented) - subscriptionId?: string; -} - -// @public -export interface DeploymentStacksClientOptionalParams extends coreClient.ServiceClientOptions { - $host?: string; - apiVersion?: string; - endpoint?: string; +// @public +export interface DeploymentStacksChangeBaseDenyStatusMode { + after?: DenyStatusMode; + before?: DenyStatusMode; } // @public -export interface DeploymentStacksCreateOrUpdateAtManagementGroupOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; +export interface DeploymentStacksChangeBaseDeploymentStacksManagementStatus { + after?: DeploymentStacksManagementStatus; + before?: DeploymentStacksManagementStatus; } // @public -export type DeploymentStacksCreateOrUpdateAtManagementGroupResponse = DeploymentStack; +export interface DeploymentStacksChangeDeltaDenySettings { + after?: DenySettings; + before?: DenySettings; + delta?: DeploymentStacksWhatIfPropertyChange[]; +} // @public -export interface DeploymentStacksCreateOrUpdateAtResourceGroupOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; +export interface DeploymentStacksChangeDeltaRecord { + after?: Record; + before?: Record; + delta?: DeploymentStacksWhatIfPropertyChange[]; +} + +// @public (undocumented) +export class DeploymentStacksClient { + constructor(credential: TokenCredential, options?: DeploymentStacksClientOptionalParams); + constructor(credential: TokenCredential, subscriptionId: string, options?: DeploymentStacksClientOptionalParams); + readonly deploymentStacks: DeploymentStacksOperations; + readonly deploymentStacksWhatIfResultsAtManagementGroup: DeploymentStacksWhatIfResultsAtManagementGroupOperations; + readonly deploymentStacksWhatIfResultsAtResourceGroup: DeploymentStacksWhatIfResultsAtResourceGroupOperations; + readonly deploymentStacksWhatIfResultsAtSubscription: DeploymentStacksWhatIfResultsAtSubscriptionOperations; + readonly pipeline: Pipeline; } // @public -export type DeploymentStacksCreateOrUpdateAtResourceGroupResponse = DeploymentStack; +export interface DeploymentStacksClientOptionalParams extends ClientOptions { + apiVersion?: string; + cloudSetting?: AzureSupportedClouds; +} // @public -export interface DeploymentStacksCreateOrUpdateAtSubscriptionOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface DeploymentStacksCreateOrUpdateAtManagementGroupOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type DeploymentStacksCreateOrUpdateAtSubscriptionResponse = DeploymentStack; +export interface DeploymentStacksCreateOrUpdateAtResourceGroupOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} // @public -export interface DeploymentStacksDebugSetting { - detailLevel?: string; +export interface DeploymentStacksCreateOrUpdateAtSubscriptionOptionalParams extends OperationOptions { + updateIntervalInMs?: number; } // @public -export interface DeploymentStacksDeleteAtManagementGroupHeaders { - // (undocumented) - location?: string; +export interface DeploymentStacksDebugSetting { + detailLevel?: string; } // @public -export interface DeploymentStacksDeleteAtManagementGroupOptionalParams extends coreClient.OperationOptions { +export interface DeploymentStacksDeleteAtManagementGroupOptionalParams extends OperationOptions { bypassStackOutOfSyncError?: boolean; - resumeFrom?: string; - unmanageActionManagementGroups?: UnmanageActionManagementGroupMode; - unmanageActionResourceGroups?: UnmanageActionResourceGroupMode; - unmanageActionResources?: UnmanageActionResourceMode; + unmanageActionManagementGroups?: DeploymentStacksDeleteDetachEnum; + unmanageActionResourceGroups?: DeploymentStacksDeleteDetachEnum; + unmanageActionResources?: DeploymentStacksDeleteDetachEnum; + unmanageActionResourcesWithoutDeleteSupport?: DeploymentStacksResourcesWithoutDeleteSupportEnum; updateIntervalInMs?: number; } // @public -export interface DeploymentStacksDeleteAtResourceGroupHeaders { - // (undocumented) - location?: string; +export interface DeploymentStacksDeleteAtResourceGroupOptionalParams extends OperationOptions { + bypassStackOutOfSyncError?: boolean; + unmanageActionManagementGroups?: DeploymentStacksDeleteDetachEnum; + unmanageActionResourceGroups?: DeploymentStacksDeleteDetachEnum; + unmanageActionResources?: DeploymentStacksDeleteDetachEnum; + unmanageActionResourcesWithoutDeleteSupport?: DeploymentStacksResourcesWithoutDeleteSupportEnum; + updateIntervalInMs?: number; } // @public -export interface DeploymentStacksDeleteAtResourceGroupOptionalParams extends coreClient.OperationOptions { +export interface DeploymentStacksDeleteAtSubscriptionOptionalParams extends OperationOptions { bypassStackOutOfSyncError?: boolean; - resumeFrom?: string; - unmanageActionManagementGroups?: UnmanageActionManagementGroupMode; - unmanageActionResourceGroups?: UnmanageActionResourceGroupMode; - unmanageActionResources?: UnmanageActionResourceMode; + unmanageActionManagementGroups?: DeploymentStacksDeleteDetachEnum; + unmanageActionResourceGroups?: DeploymentStacksDeleteDetachEnum; + unmanageActionResources?: DeploymentStacksDeleteDetachEnum; + unmanageActionResourcesWithoutDeleteSupport?: DeploymentStacksResourcesWithoutDeleteSupportEnum; updateIntervalInMs?: number; } // @public -export interface DeploymentStacksDeleteAtSubscriptionHeaders { - // (undocumented) - location?: string; -} +export type DeploymentStacksDeleteDetachEnum = string; // @public -export interface DeploymentStacksDeleteAtSubscriptionOptionalParams extends coreClient.OperationOptions { - bypassStackOutOfSyncError?: boolean; - resumeFrom?: string; - unmanageActionManagementGroups?: UnmanageActionManagementGroupMode; - unmanageActionResourceGroups?: UnmanageActionResourceGroupMode; - unmanageActionResources?: UnmanageActionResourceMode; - updateIntervalInMs?: number; +export interface DeploymentStacksDiagnostic { + additionalInfo?: ErrorAdditionalInfo[]; + code: string; + level: DeploymentStacksDiagnosticLevel; + message: string; + target?: string; } // @public -export type DeploymentStacksDeleteDetachEnum = string; +export type DeploymentStacksDiagnosticLevel = string; // @public -export interface DeploymentStacksError { - error?: ErrorDetail; +export interface DeploymentStacksExportTemplateAtManagementGroupOptionalParams extends OperationOptions { } // @public -export interface DeploymentStacksExportTemplateAtManagementGroupOptionalParams extends coreClient.OperationOptions { +export interface DeploymentStacksExportTemplateAtResourceGroupOptionalParams extends OperationOptions { } // @public -export type DeploymentStacksExportTemplateAtManagementGroupResponse = DeploymentStackTemplateDefinition; +export interface DeploymentStacksExportTemplateAtSubscriptionOptionalParams extends OperationOptions { +} + +// @public +export interface DeploymentStacksGetAtManagementGroupOptionalParams extends OperationOptions { +} // @public -export interface DeploymentStacksExportTemplateAtResourceGroupOptionalParams extends coreClient.OperationOptions { +export interface DeploymentStacksGetAtResourceGroupOptionalParams extends OperationOptions { } // @public -export type DeploymentStacksExportTemplateAtResourceGroupResponse = DeploymentStackTemplateDefinition; +export interface DeploymentStacksGetAtSubscriptionOptionalParams extends OperationOptions { +} // @public -export interface DeploymentStacksExportTemplateAtSubscriptionOptionalParams extends coreClient.OperationOptions { +export interface DeploymentStacksListAtManagementGroupOptionalParams extends OperationOptions { } // @public -export type DeploymentStacksExportTemplateAtSubscriptionResponse = DeploymentStackTemplateDefinition; +export interface DeploymentStacksListAtResourceGroupOptionalParams extends OperationOptions { +} // @public -export interface DeploymentStacksGetAtManagementGroupOptionalParams extends coreClient.OperationOptions { +export interface DeploymentStacksListAtSubscriptionOptionalParams extends OperationOptions { } // @public -export type DeploymentStacksGetAtManagementGroupResponse = DeploymentStack; +export type DeploymentStacksManagementStatus = string; // @public -export interface DeploymentStacksGetAtResourceGroupOptionalParams extends coreClient.OperationOptions { +export interface DeploymentStacksOperations { + createOrUpdateAtManagementGroup: (managementGroupId: string, deploymentStackName: string, deploymentStack: DeploymentStack, options?: DeploymentStacksCreateOrUpdateAtManagementGroupOptionalParams) => PollerLike, DeploymentStack>; + createOrUpdateAtResourceGroup: (resourceGroupName: string, deploymentStackName: string, deploymentStack: DeploymentStack, options?: DeploymentStacksCreateOrUpdateAtResourceGroupOptionalParams) => PollerLike, DeploymentStack>; + createOrUpdateAtSubscription: (deploymentStackName: string, deploymentStack: DeploymentStack, options?: DeploymentStacksCreateOrUpdateAtSubscriptionOptionalParams) => PollerLike, DeploymentStack>; + deleteAtManagementGroup: (managementGroupId: string, deploymentStackName: string, options?: DeploymentStacksDeleteAtManagementGroupOptionalParams) => PollerLike, void>; + deleteAtResourceGroup: (resourceGroupName: string, deploymentStackName: string, options?: DeploymentStacksDeleteAtResourceGroupOptionalParams) => PollerLike, void>; + deleteAtSubscription: (deploymentStackName: string, options?: DeploymentStacksDeleteAtSubscriptionOptionalParams) => PollerLike, void>; + exportTemplateAtManagementGroup: (managementGroupId: string, deploymentStackName: string, options?: DeploymentStacksExportTemplateAtManagementGroupOptionalParams) => Promise; + exportTemplateAtResourceGroup: (resourceGroupName: string, deploymentStackName: string, options?: DeploymentStacksExportTemplateAtResourceGroupOptionalParams) => Promise; + exportTemplateAtSubscription: (deploymentStackName: string, options?: DeploymentStacksExportTemplateAtSubscriptionOptionalParams) => Promise; + getAtManagementGroup: (managementGroupId: string, deploymentStackName: string, options?: DeploymentStacksGetAtManagementGroupOptionalParams) => Promise; + getAtResourceGroup: (resourceGroupName: string, deploymentStackName: string, options?: DeploymentStacksGetAtResourceGroupOptionalParams) => Promise; + getAtSubscription: (deploymentStackName: string, options?: DeploymentStacksGetAtSubscriptionOptionalParams) => Promise; + listAtManagementGroup: (managementGroupId: string, options?: DeploymentStacksListAtManagementGroupOptionalParams) => PagedAsyncIterableIterator; + listAtResourceGroup: (resourceGroupName: string, options?: DeploymentStacksListAtResourceGroupOptionalParams) => PagedAsyncIterableIterator; + listAtSubscription: (options?: DeploymentStacksListAtSubscriptionOptionalParams) => PagedAsyncIterableIterator; + validateStackAtManagementGroup: (managementGroupId: string, deploymentStackName: string, deploymentStack: DeploymentStack, options?: DeploymentStacksValidateStackAtManagementGroupOptionalParams) => PollerLike, DeploymentStackValidateResult>; + validateStackAtResourceGroup: (resourceGroupName: string, deploymentStackName: string, deploymentStack: DeploymentStack, options?: DeploymentStacksValidateStackAtResourceGroupOptionalParams) => PollerLike, DeploymentStackValidateResult>; + validateStackAtSubscription: (deploymentStackName: string, deploymentStack: DeploymentStack, options?: DeploymentStacksValidateStackAtSubscriptionOptionalParams) => PollerLike, DeploymentStackValidateResult>; } // @public -export type DeploymentStacksGetAtResourceGroupResponse = DeploymentStack; +export interface DeploymentStacksParametersLink { + contentVersion?: string; + uri: string; +} // @public -export interface DeploymentStacksGetAtSubscriptionOptionalParams extends coreClient.OperationOptions { +export type DeploymentStacksResourcesWithoutDeleteSupportEnum = string; + +// @public +export interface DeploymentStacksTemplateLink { + contentVersion?: string; + id?: string; + queryString?: string; + relativePath?: string; + uri?: string; } // @public -export type DeploymentStacksGetAtSubscriptionResponse = DeploymentStack; +export interface DeploymentStacksValidateStackAtManagementGroupOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} // @public -export interface DeploymentStacksListAtManagementGroupNextOptionalParams extends coreClient.OperationOptions { +export interface DeploymentStacksValidateStackAtResourceGroupOptionalParams extends OperationOptions { + updateIntervalInMs?: number; } // @public -export type DeploymentStacksListAtManagementGroupNextResponse = DeploymentStackListResult; +export interface DeploymentStacksValidateStackAtSubscriptionOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} // @public -export interface DeploymentStacksListAtManagementGroupOptionalParams extends coreClient.OperationOptions { +export interface DeploymentStacksWhatIfChange { + denySettingsChange: DeploymentStacksChangeDeltaDenySettings; + deploymentScopeChange?: DeploymentStacksChangeBase; + resourceChanges: DeploymentStacksWhatIfResourceChange[]; } // @public -export type DeploymentStacksListAtManagementGroupResponse = DeploymentStackListResult; +export type DeploymentStacksWhatIfChangeCertainty = string; // @public -export interface DeploymentStacksListAtResourceGroupNextOptionalParams extends coreClient.OperationOptions { +export type DeploymentStacksWhatIfChangeType = string; + +// @public +export interface DeploymentStacksWhatIfPropertyChange { + after?: any; + before?: any; + changeType: DeploymentStacksWhatIfPropertyChangeType; + children?: DeploymentStacksWhatIfPropertyChange[]; + path: string; } // @public -export type DeploymentStacksListAtResourceGroupNextResponse = DeploymentStackListResult; +export type DeploymentStacksWhatIfPropertyChangeType = string; // @public -export interface DeploymentStacksListAtResourceGroupOptionalParams extends coreClient.OperationOptions { +export interface DeploymentStacksWhatIfResourceChange { + readonly apiVersion?: string; + changeCertainty: DeploymentStacksWhatIfChangeCertainty; + changeType: DeploymentStacksWhatIfChangeType; + denyStatusChange?: DeploymentStacksChangeBaseDenyStatusMode; + deploymentId?: string; + readonly extension?: DeploymentExtension; + readonly id?: string; + readonly identifiers?: Record; + managementStatusChange?: DeploymentStacksChangeBaseDeploymentStacksManagementStatus; + resourceConfigurationChanges?: DeploymentStacksChangeDeltaRecord; + symbolicName?: string; + readonly type?: string; + unsupportedReason?: string; } // @public -export type DeploymentStacksListAtResourceGroupResponse = DeploymentStackListResult; +export interface DeploymentStacksWhatIfResult extends ProxyResource { + location?: string; + properties?: DeploymentStacksWhatIfResultProperties; + tags?: Record; +} // @public -export interface DeploymentStacksListAtSubscriptionNextOptionalParams extends coreClient.OperationOptions { +export interface DeploymentStacksWhatIfResultProperties { + actionOnUnmanage: ActionOnUnmanage; + readonly changes?: DeploymentStacksWhatIfChange; + readonly correlationId?: string; + debugSetting?: DeploymentStacksDebugSetting; + denySettings: DenySettings; + deploymentScope?: string; + readonly deploymentStackLastModified?: Date; + deploymentStackResourceId: string; + description?: string; + readonly diagnostics?: DeploymentStacksDiagnostic[]; + error?: ErrorDetail; + extensionConfigs?: Record; + externalInputDefinitions?: Record; + externalInputs?: Record; + parameters?: Record; + parametersLink?: DeploymentStacksParametersLink; + readonly provisioningState?: DeploymentStackProvisioningState; + retentionInterval: string; + template?: Record; + templateLink?: DeploymentStacksTemplateLink; + validationLevel?: ValidationLevel; } // @public -export type DeploymentStacksListAtSubscriptionNextResponse = DeploymentStackListResult; +export interface DeploymentStacksWhatIfResultsAtManagementGroupCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} // @public -export interface DeploymentStacksListAtSubscriptionOptionalParams extends coreClient.OperationOptions { +export interface DeploymentStacksWhatIfResultsAtManagementGroupDeleteOptionalParams extends OperationOptions { + bypassStackOutOfSyncError?: boolean; + unmanageActionManagementGroups?: DeploymentStacksDeleteDetachEnum; + unmanageActionResourceGroups?: DeploymentStacksDeleteDetachEnum; + unmanageActionResources?: DeploymentStacksDeleteDetachEnum; + unmanageActionResourcesWithoutDeleteSupport?: DeploymentStacksResourcesWithoutDeleteSupportEnum; } // @public -export type DeploymentStacksListAtSubscriptionResponse = DeploymentStackListResult; +export interface DeploymentStacksWhatIfResultsAtManagementGroupGetOptionalParams extends OperationOptions { +} // @public -export interface DeploymentStacksParametersLink { - contentVersion?: string; - uri: string; +export interface DeploymentStacksWhatIfResultsAtManagementGroupListOptionalParams extends OperationOptions { } // @public -export interface DeploymentStacksTemplateLink { - contentVersion?: string; - id?: string; - queryString?: string; - relativePath?: string; - uri?: string; +export interface DeploymentStacksWhatIfResultsAtManagementGroupOperations { + createOrUpdate: (managementGroupId: string, deploymentStacksWhatIfResultName: string, resource: DeploymentStacksWhatIfResult, options?: DeploymentStacksWhatIfResultsAtManagementGroupCreateOrUpdateOptionalParams) => PollerLike, DeploymentStacksWhatIfResult>; + delete: (managementGroupId: string, deploymentStacksWhatIfResultName: string, options?: DeploymentStacksWhatIfResultsAtManagementGroupDeleteOptionalParams) => Promise; + get: (managementGroupId: string, deploymentStacksWhatIfResultName: string, options?: DeploymentStacksWhatIfResultsAtManagementGroupGetOptionalParams) => Promise; + list: (managementGroupId: string, options?: DeploymentStacksWhatIfResultsAtManagementGroupListOptionalParams) => PagedAsyncIterableIterator; + whatIf: (managementGroupId: string, deploymentStacksWhatIfResultName: string, options?: DeploymentStacksWhatIfResultsAtManagementGroupWhatIfOptionalParams) => PollerLike, DeploymentStacksWhatIfResult>; } // @public -export interface DeploymentStacksValidateStackAtManagementGroupHeaders { - // (undocumented) - location?: string; - retryAfter?: string; +export interface DeploymentStacksWhatIfResultsAtManagementGroupWhatIfOptionalParams extends OperationOptions { + updateIntervalInMs?: number; } // @public -export interface DeploymentStacksValidateStackAtManagementGroupOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface DeploymentStacksWhatIfResultsAtResourceGroupCreateOrUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type DeploymentStacksValidateStackAtManagementGroupResponse = DeploymentStackValidateResult; +export interface DeploymentStacksWhatIfResultsAtResourceGroupDeleteOptionalParams extends OperationOptions { + bypassStackOutOfSyncError?: boolean; + unmanageActionManagementGroups?: DeploymentStacksDeleteDetachEnum; + unmanageActionResourceGroups?: DeploymentStacksDeleteDetachEnum; + unmanageActionResources?: DeploymentStacksDeleteDetachEnum; + unmanageActionResourcesWithoutDeleteSupport?: DeploymentStacksResourcesWithoutDeleteSupportEnum; +} // @public -export interface DeploymentStacksValidateStackAtResourceGroupHeaders { - // (undocumented) - location?: string; - retryAfter?: string; +export interface DeploymentStacksWhatIfResultsAtResourceGroupGetOptionalParams extends OperationOptions { } // @public -export interface DeploymentStacksValidateStackAtResourceGroupOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; +export interface DeploymentStacksWhatIfResultsAtResourceGroupListOptionalParams extends OperationOptions { } // @public -export type DeploymentStacksValidateStackAtResourceGroupResponse = DeploymentStackValidateResult; +export interface DeploymentStacksWhatIfResultsAtResourceGroupOperations { + createOrUpdate: (resourceGroupName: string, deploymentStacksWhatIfResultName: string, resource: DeploymentStacksWhatIfResult, options?: DeploymentStacksWhatIfResultsAtResourceGroupCreateOrUpdateOptionalParams) => PollerLike, DeploymentStacksWhatIfResult>; + delete: (resourceGroupName: string, deploymentStacksWhatIfResultName: string, options?: DeploymentStacksWhatIfResultsAtResourceGroupDeleteOptionalParams) => Promise; + get: (resourceGroupName: string, deploymentStacksWhatIfResultName: string, options?: DeploymentStacksWhatIfResultsAtResourceGroupGetOptionalParams) => Promise; + list: (resourceGroupName: string, options?: DeploymentStacksWhatIfResultsAtResourceGroupListOptionalParams) => PagedAsyncIterableIterator; + whatIf: (resourceGroupName: string, deploymentStacksWhatIfResultName: string, options?: DeploymentStacksWhatIfResultsAtResourceGroupWhatIfOptionalParams) => PollerLike, DeploymentStacksWhatIfResult>; +} // @public -export interface DeploymentStacksValidateStackAtSubscriptionHeaders { - // (undocumented) - location?: string; - retryAfter?: string; +export interface DeploymentStacksWhatIfResultsAtResourceGroupWhatIfOptionalParams extends OperationOptions { + updateIntervalInMs?: number; } // @public -export interface DeploymentStacksValidateStackAtSubscriptionOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface DeploymentStacksWhatIfResultsAtSubscriptionCreateOrUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type DeploymentStacksValidateStackAtSubscriptionResponse = DeploymentStackValidateResult; +export interface DeploymentStacksWhatIfResultsAtSubscriptionDeleteOptionalParams extends OperationOptions { + bypassStackOutOfSyncError?: boolean; + unmanageActionManagementGroups?: DeploymentStacksDeleteDetachEnum; + unmanageActionResourceGroups?: DeploymentStacksDeleteDetachEnum; + unmanageActionResources?: DeploymentStacksDeleteDetachEnum; + unmanageActionResourcesWithoutDeleteSupport?: DeploymentStacksResourcesWithoutDeleteSupportEnum; +} + +// @public +export interface DeploymentStacksWhatIfResultsAtSubscriptionGetOptionalParams extends OperationOptions { +} + +// @public +export interface DeploymentStacksWhatIfResultsAtSubscriptionListOptionalParams extends OperationOptions { +} + +// @public +export interface DeploymentStacksWhatIfResultsAtSubscriptionOperations { + createOrUpdate: (deploymentStacksWhatIfResultName: string, resource: DeploymentStacksWhatIfResult, options?: DeploymentStacksWhatIfResultsAtSubscriptionCreateOrUpdateOptionalParams) => PollerLike, DeploymentStacksWhatIfResult>; + delete: (deploymentStacksWhatIfResultName: string, options?: DeploymentStacksWhatIfResultsAtSubscriptionDeleteOptionalParams) => Promise; + get: (deploymentStacksWhatIfResultName: string, options?: DeploymentStacksWhatIfResultsAtSubscriptionGetOptionalParams) => Promise; + list: (options?: DeploymentStacksWhatIfResultsAtSubscriptionListOptionalParams) => PagedAsyncIterableIterator; + whatIf: (deploymentStacksWhatIfResultName: string, options?: DeploymentStacksWhatIfResultsAtSubscriptionWhatIfOptionalParams) => PollerLike, DeploymentStacksWhatIfResult>; +} + +// @public +export interface DeploymentStacksWhatIfResultsAtSubscriptionWhatIfOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} // @public export interface DeploymentStackTemplateDefinition { - template?: Record; + template?: Record; templateLink?: DeploymentStacksTemplateLink; } @@ -390,23 +556,28 @@ export interface DeploymentStackValidateProperties { actionOnUnmanage?: ActionOnUnmanage; correlationId?: string; denySettings?: DenySettings; + deploymentExtensions?: DeploymentExtension[]; deploymentScope?: string; description?: string; - parameters?: { - [propertyName: string]: DeploymentParameter; - }; + parameters?: Record; templateLink?: DeploymentStacksTemplateLink; validatedResources?: ResourceReference[]; + validationLevel?: ValidationLevel; } // @public -export interface DeploymentStackValidateResult extends AzureResourceBase, DeploymentStacksError { +export interface DeploymentStackValidateResult { + error?: ErrorDetail; + readonly id?: string; + readonly name?: string; properties?: DeploymentStackValidateProperties; + readonly systemData?: SystemData; + readonly type?: string; } // @public export interface ErrorAdditionalInfo { - readonly info?: Record; + readonly info?: any; readonly type?: string; } @@ -420,7 +591,9 @@ export interface ErrorDetail { } // @public -export function getContinuationToken(page: unknown): string | undefined; +export interface ErrorResponse { + error?: ErrorDetail; +} // @public export interface KeyVaultParameterReference { @@ -456,7 +629,8 @@ export enum KnownDenyStatusMode { Inapplicable = "inapplicable", None = "none", NotSupported = "notSupported", - RemovedBySystem = "removedBySystem" + RemovedBySystem = "removedBySystem", + Unknown = "unknown" } // @public @@ -468,6 +642,8 @@ export enum KnownDeploymentStackProvisioningState { DeletingResources = "deletingResources", Deploying = "deploying", Failed = "failed", + Initializing = "initializing", + Running = "running", Succeeded = "succeeded", UpdatingDenyAssignments = "updatingDenyAssignments", Validating = "validating", @@ -481,28 +657,68 @@ export enum KnownDeploymentStacksDeleteDetachEnum { } // @public -export enum KnownResourceStatusMode { - DeleteFailed = "deleteFailed", +export enum KnownDeploymentStacksDiagnosticLevel { + Error = "error", + Info = "info", + Warning = "warning" +} + +// @public +export enum KnownDeploymentStacksManagementStatus { Managed = "managed", - RemoveDenyFailed = "removeDenyFailed" + Unknown = "unknown", + Unmanaged = "unmanaged" } // @public -export enum KnownUnmanageActionManagementGroupMode { - Delete = "delete", - Detach = "detach" +export enum KnownDeploymentStacksResourcesWithoutDeleteSupportEnum { + Detach = "detach", + Fail = "fail" +} + +// @public +export enum KnownDeploymentStacksWhatIfChangeCertainty { + Definite = "definite", + Potential = "potential" } // @public -export enum KnownUnmanageActionResourceGroupMode { +export enum KnownDeploymentStacksWhatIfChangeType { + Create = "create", Delete = "delete", - Detach = "detach" + Detach = "detach", + Modify = "modify", + NoChange = "noChange", + Unsupported = "unsupported" } // @public -export enum KnownUnmanageActionResourceMode { +export enum KnownDeploymentStacksWhatIfPropertyChangeType { + Array = "array", + Create = "create", Delete = "delete", - Detach = "detach" + Modify = "modify", + NoEffect = "noEffect" +} + +// @public +export enum KnownResourceStatusMode { + DeleteFailed = "deleteFailed", + Managed = "managed", + RemoveDenyFailed = "removeDenyFailed" +} + +// @public +export enum KnownValidationLevel { + Provider = "Provider", + ProviderNoRbac = "ProviderNoRbac", + Template = "Template" +} + +// @public +export enum KnownVersions { + V20240301 = "2024-03-01", + V20250701 = "2025-07-01" } // @public @@ -511,18 +727,62 @@ export interface ManagedResourceReference extends ResourceReference { status?: ResourceStatusMode; } +// @public +export interface PagedAsyncIterableIterator { + [Symbol.asyncIterator](): PagedAsyncIterableIterator; + byPage: (settings?: TPageSettings) => AsyncIterableIterator>; + next(): Promise>; +} + +// @public +export interface PageSettings { + continuationToken?: string; +} + +// @public +export interface ProxyResource extends Resource { +} + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + // @public export interface ResourceReference { + readonly apiVersion?: string; + readonly extension?: DeploymentExtension; readonly id?: string; + readonly identifiers?: Record; + readonly type?: string; } // @public -export interface ResourceReferenceExtended extends ResourceReference, DeploymentStacksError { +export interface ResourceReferenceExtended { + readonly apiVersion?: string; + error?: ErrorDetail; + readonly extension?: DeploymentExtension; + readonly id?: string; + readonly identifiers?: Record; + readonly type?: string; } // @public export type ResourceStatusMode = string; +// @public +export function restorePoller(client: DeploymentStacksClient, serializedState: string, sourceOperation: (...args: any[]) => PollerLike, TResult>, options?: RestorePollerOptions): PollerLike, TResult>; + +// @public (undocumented) +export interface RestorePollerOptions extends OperationOptions { + abortSignal?: AbortSignalLike; + processResponseBody?: (result: TResponse) => Promise; + updateIntervalInMs?: number; +} + // @public export interface SystemData { createdAt?: Date; @@ -534,13 +794,7 @@ export interface SystemData { } // @public -export type UnmanageActionManagementGroupMode = string; - -// @public -export type UnmanageActionResourceGroupMode = string; - -// @public -export type UnmanageActionResourceMode = string; +export type ValidationLevel = string; // (No @packageDocumentation comment for this package) diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/sample.env b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/sample.env +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksCreateOrUpdateAtManagementGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksCreateOrUpdateAtManagementGroupSample.ts index 6e2811db1da5..1b58c9f344f7 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksCreateOrUpdateAtManagementGroupSample.ts +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksCreateOrUpdateAtManagementGroupSample.ts @@ -1,51 +1,51 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Creates or updates a Deployment stack at Management Group scope. - * - * @summary Creates or updates a Deployment stack at Management Group scope. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackManagementGroupCreate.json - */ - -import type { DeploymentStack } from "@azure/arm-resourcesdeploymentstacks"; import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; -async function deploymentStacksManagementGroupCreateOrUpdate(): Promise { - const managementGroupId = "myMg"; - const deploymentStackName = "simpleDeploymentStack"; - const deploymentStack: DeploymentStack = { - location: "eastus", - properties: { +/** + * This sample demonstrates how to creates or updates a Deployment stack at the specified scope. + * + * @summary creates or updates a Deployment stack at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackManagementGroupCreate.json + */ +async function createOrUpdateAManagementGroupDeploymentStack(): Promise { + const credential = new DefaultAzureCredential(); + const client = new DeploymentStacksClient(credential); + const result = await client.deploymentStacks.createOrUpdateAtManagementGroup( + "myMg", + "simpleDeploymentStack", + { + location: "eastus", + tags: { tagkey: "tagVal" }, actionOnUnmanage: { - managementGroups: "detach", - resourceGroups: "delete", resources: "delete", + resourceGroups: "delete", + managementGroups: "detach", }, denySettings: { - applyToChildScopes: false, - excludedActions: ["action"], - excludedPrincipals: ["principal"], mode: "denyDelete", + excludedPrincipals: ["principal"], + excludedActions: ["action"], + applyToChildScopes: false, }, parameters: { parameter1: { value: "a string" } }, + extensionConfigs: { + contoso: { + additionalProperties: { + configOne: { value: "config1Value" }, + configTwo: { value: true }, + }, + }, + }, }, - tags: { tagkey: "tagVal" }, - }; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential); - const result = await client.deploymentStacks.beginCreateOrUpdateAtManagementGroupAndWait( - managementGroupId, - deploymentStackName, - deploymentStack, ); console.log(result); } async function main(): Promise { - await deploymentStacksManagementGroupCreateOrUpdate(); + await createOrUpdateAManagementGroupDeploymentStack(); } main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksCreateOrUpdateAtResourceGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksCreateOrUpdateAtResourceGroupSample.ts index d9cddcae0f28..f9afe7631eee 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksCreateOrUpdateAtResourceGroupSample.ts +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksCreateOrUpdateAtResourceGroupSample.ts @@ -1,55 +1,52 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Creates or updates a Deployment stack at Resource Group scope. - * - * @summary Creates or updates a Deployment stack at Resource Group scope. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackResourceGroupCreate.json - */ - -import type { DeploymentStack } from "@azure/arm-resourcesdeploymentstacks"; import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; -async function deploymentStacksResourceGroupCreateOrUpdate(): Promise { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] || "deploymentStacksRG"; - const deploymentStackName = "simpleDeploymentStack"; - const deploymentStack: DeploymentStack = { - location: "eastus", - properties: { +/** + * This sample demonstrates how to creates or updates a Deployment stack at the specified scope. + * + * @summary creates or updates a Deployment stack at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackResourceGroupCreate.json + */ +async function createOrUpdateAResourceGroupDeploymentStack(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacks.createOrUpdateAtResourceGroup( + "deploymentStacksRG", + "simpleDeploymentStack", + { + location: "eastus", + tags: { tagkey: "tagVal" }, actionOnUnmanage: { - managementGroups: "detach", - resourceGroups: "delete", resources: "delete", + resourceGroups: "delete", + managementGroups: "detach", }, denySettings: { - applyToChildScopes: false, - excludedActions: ["action"], - excludedPrincipals: ["principal"], mode: "denyDelete", + excludedPrincipals: ["principal"], + excludedActions: ["action"], + applyToChildScopes: false, }, parameters: { parameter1: { value: "a string" } }, + extensionConfigs: { + contoso: { + additionalProperties: { + configOne: { value: "config1Value" }, + configTwo: { value: true }, + }, + }, + }, }, - tags: { tagkey: "tagVal" }, - }; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential, subscriptionId); - const result = await client.deploymentStacks.beginCreateOrUpdateAtResourceGroupAndWait( - resourceGroupName, - deploymentStackName, - deploymentStack, ); console.log(result); } async function main(): Promise { - await deploymentStacksResourceGroupCreateOrUpdate(); + await createOrUpdateAResourceGroupDeploymentStack(); } main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksCreateOrUpdateAtSubscriptionSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksCreateOrUpdateAtSubscriptionSample.ts index e1ef42773dde..5cb702a2d153 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksCreateOrUpdateAtSubscriptionSample.ts +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksCreateOrUpdateAtSubscriptionSample.ts @@ -1,52 +1,51 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Creates or updates a Deployment stack at Subscription scope. - * - * @summary Creates or updates a Deployment stack at Subscription scope. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackSubscriptionCreate.json - */ - -import type { DeploymentStack } from "@azure/arm-resourcesdeploymentstacks"; import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; -async function deploymentStacksSubscriptionCreateOrUpdate(): Promise { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const deploymentStackName = "simpleDeploymentStack"; - const deploymentStack: DeploymentStack = { - location: "eastus", - properties: { +/** + * This sample demonstrates how to creates or updates a Deployment stack at the specified scope. + * + * @summary creates or updates a Deployment stack at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackSubscriptionCreate.json + */ +async function createOrUpdateASubscriptionDeploymentStack(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacks.createOrUpdateAtSubscription( + "simpleDeploymentStack", + { + location: "eastus", + tags: { tagkey: "tagVal" }, actionOnUnmanage: { - managementGroups: "detach", - resourceGroups: "delete", resources: "delete", + resourceGroups: "delete", + managementGroups: "detach", }, denySettings: { - applyToChildScopes: false, - excludedActions: ["action"], - excludedPrincipals: ["principal"], mode: "denyDelete", + excludedPrincipals: ["principal"], + excludedActions: ["action"], + applyToChildScopes: false, }, parameters: { parameter1: { value: "a string" } }, + extensionConfigs: { + contoso: { + additionalProperties: { + configOne: { value: "config1Value" }, + configTwo: { value: true }, + }, + }, + }, }, - tags: { tagkey: "tagVal" }, - }; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential, subscriptionId); - const result = await client.deploymentStacks.beginCreateOrUpdateAtSubscriptionAndWait( - deploymentStackName, - deploymentStack, ); console.log(result); } async function main(): Promise { - await deploymentStacksSubscriptionCreateOrUpdate(); + await createOrUpdateASubscriptionDeploymentStack(); } main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksDeleteAtManagementGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksDeleteAtManagementGroupSample.ts index c7575a48d198..d9e4f724dc1c 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksDeleteAtManagementGroupSample.ts +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksDeleteAtManagementGroupSample.ts @@ -1,31 +1,23 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Deletes a Deployment stack by name at Management Group scope. When operation completes, status code 200 returned without content. - * - * @summary Deletes a Deployment stack by name at Management Group scope. When operation completes, status code 200 returned without content. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackManagementGroupDelete.json - */ - import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; -async function deploymentStacksManagementGroupDelete(): Promise { - const managementGroupId = "myMg"; - const deploymentStackName = "simpleDeploymentStack"; +/** + * This sample demonstrates how to deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * + * @summary deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * x-ms-original-file: 2025-07-01/DeploymentStackManagementGroupDelete.json + */ +async function deleteAManagementGroupDeploymentStack(): Promise { const credential = new DefaultAzureCredential(); const client = new DeploymentStacksClient(credential); - const result = await client.deploymentStacks.beginDeleteAtManagementGroupAndWait( - managementGroupId, - deploymentStackName, - ); - console.log(result); + await client.deploymentStacks.deleteAtManagementGroup("myMg", "simpleDeploymentStack"); } async function main(): Promise { - await deploymentStacksManagementGroupDelete(); + await deleteAManagementGroupDeploymentStack(); } main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksDeleteAtResourceGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksDeleteAtResourceGroupSample.ts index 6da704d5005e..8d6cc5fd0375 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksDeleteAtResourceGroupSample.ts +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksDeleteAtResourceGroupSample.ts @@ -1,35 +1,27 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code 200 returned without content. - * - * @summary Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code 200 returned without content. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackResourceGroupDelete.json - */ - import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; -async function deploymentStacksResourceGroupDelete(): Promise { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] || "deploymentStacksRG"; - const deploymentStackName = "simpleDeploymentStack"; +/** + * This sample demonstrates how to deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * + * @summary deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * x-ms-original-file: 2025-07-01/DeploymentStackResourceGroupDelete.json + */ +async function deleteAResourceGroupDeploymentStack(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new DeploymentStacksClient(credential, subscriptionId); - const result = await client.deploymentStacks.beginDeleteAtResourceGroupAndWait( - resourceGroupName, - deploymentStackName, + await client.deploymentStacks.deleteAtResourceGroup( + "deploymentStacksRG", + "simpleDeploymentStack", ); - console.log(result); } async function main(): Promise { - await deploymentStacksResourceGroupDelete(); + await deleteAResourceGroupDeploymentStack(); } main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksDeleteAtSubscriptionSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksDeleteAtSubscriptionSample.ts index 11c02bc91d62..fdd363932362 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksDeleteAtSubscriptionSample.ts +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksDeleteAtSubscriptionSample.ts @@ -1,31 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 returned without content. - * - * @summary Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 returned without content. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackSubscriptionDelete.json - */ - import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; -async function deploymentStacksSubscriptionDelete(): Promise { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const deploymentStackName = "simpleDeploymentStack"; +/** + * This sample demonstrates how to deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * + * @summary deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * x-ms-original-file: 2025-07-01/DeploymentStackSubscriptionDelete.json + */ +async function deleteASubscriptionDeploymentStack(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new DeploymentStacksClient(credential, subscriptionId); - const result = - await client.deploymentStacks.beginDeleteAtSubscriptionAndWait(deploymentStackName); - console.log(result); + await client.deploymentStacks.deleteAtSubscription("simpleDeploymentStack"); } async function main(): Promise { - await deploymentStacksSubscriptionDelete(); + await deleteASubscriptionDeploymentStack(); } main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksExportTemplateAtManagementGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksExportTemplateAtManagementGroupSample.ts index 6cff057d9fc5..9edf771b893d 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksExportTemplateAtManagementGroupSample.ts +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksExportTemplateAtManagementGroupSample.ts @@ -1,31 +1,27 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Exports the template used to create the Deployment stack at Management Group scope. - * - * @summary Exports the template used to create the Deployment stack at Management Group scope. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackManagementGroupExportTemplate.json - */ - import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; -async function deploymentStacksManagementGroupExportTemplate(): Promise { - const managementGroupId = "myMg"; - const deploymentStackName = "simpleDeploymentStack"; +/** + * This sample demonstrates how to exports the template used to create the Deployment stack at the specified scope. + * + * @summary exports the template used to create the Deployment stack at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackManagementGroupExportTemplate.json + */ +async function exportTheDeploymentTemplateForAManagementGroupDeploymentStack(): Promise { const credential = new DefaultAzureCredential(); const client = new DeploymentStacksClient(credential); const result = await client.deploymentStacks.exportTemplateAtManagementGroup( - managementGroupId, - deploymentStackName, + "myMg", + "simpleDeploymentStack", ); console.log(result); } async function main(): Promise { - await deploymentStacksManagementGroupExportTemplate(); + await exportTheDeploymentTemplateForAManagementGroupDeploymentStack(); } main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksExportTemplateAtResourceGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksExportTemplateAtResourceGroupSample.ts index 002bf284033f..30bf7a603336 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksExportTemplateAtResourceGroupSample.ts +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksExportTemplateAtResourceGroupSample.ts @@ -1,35 +1,28 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Exports the template used to create the Deployment stack at Resource Group scope. - * - * @summary Exports the template used to create the Deployment stack at Resource Group scope. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackExportTemplate.json - */ - import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; -async function deploymentStacksResourceGroupExportTemplate(): Promise { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] || "deploymentStacksRG"; - const deploymentStackName = "simpleDeploymentStack"; +/** + * This sample demonstrates how to exports the template used to create the Deployment stack at the specified scope. + * + * @summary exports the template used to create the Deployment stack at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackExportTemplate.json + */ +async function exportTheDeploymentTemplateForAResourceGroupDeploymentStack(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new DeploymentStacksClient(credential, subscriptionId); const result = await client.deploymentStacks.exportTemplateAtResourceGroup( - resourceGroupName, - deploymentStackName, + "deploymentStacksRG", + "simpleDeploymentStack", ); console.log(result); } async function main(): Promise { - await deploymentStacksResourceGroupExportTemplate(); + await exportTheDeploymentTemplateForAResourceGroupDeploymentStack(); } main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksExportTemplateAtSubscriptionSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksExportTemplateAtSubscriptionSample.ts index 69129e2d3f93..ef5d0b91342c 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksExportTemplateAtSubscriptionSample.ts +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksExportTemplateAtSubscriptionSample.ts @@ -1,30 +1,26 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Exports the template used to create the Deployment stack at Subscription scope. - * - * @summary Exports the template used to create the Deployment stack at Subscription scope. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackSubscriptionExportTemplate.json - */ - import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; -async function deploymentStacksSubscriptionExportTemplate(): Promise { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const deploymentStackName = "simpleDeploymentStack"; +/** + * This sample demonstrates how to exports the template used to create the Deployment stack at the specified scope. + * + * @summary exports the template used to create the Deployment stack at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackSubscriptionExportTemplate.json + */ +async function exportTheDeploymentTemplateForASubscriptionDeploymentStack(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new DeploymentStacksClient(credential, subscriptionId); - const result = await client.deploymentStacks.exportTemplateAtSubscription(deploymentStackName); + const result = + await client.deploymentStacks.exportTemplateAtSubscription("simpleDeploymentStack"); console.log(result); } async function main(): Promise { - await deploymentStacksSubscriptionExportTemplate(); + await exportTheDeploymentTemplateForASubscriptionDeploymentStack(); } main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksGetAtManagementGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksGetAtManagementGroupSample.ts index 1adf806c62db..fcf9397afdbf 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksGetAtManagementGroupSample.ts +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksGetAtManagementGroupSample.ts @@ -1,31 +1,27 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Gets a Deployment stack with a given name at Management Group scope. - * - * @summary Gets a Deployment stack with a given name at Management Group scope. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackManagementGroupGet.json - */ - import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; -async function deploymentStacksManagementGroupGet(): Promise { - const managementGroupId = "myMg"; - const deploymentStackName = "simpleDeploymentStack"; +/** + * This sample demonstrates how to gets the Deployment stack with the given name. + * + * @summary gets the Deployment stack with the given name. + * x-ms-original-file: 2025-07-01/DeploymentStackManagementGroupGet.json + */ +async function getAManagementGroupDeploymentStack(): Promise { const credential = new DefaultAzureCredential(); const client = new DeploymentStacksClient(credential); const result = await client.deploymentStacks.getAtManagementGroup( - managementGroupId, - deploymentStackName, + "myMg", + "simpleDeploymentStack", ); console.log(result); } async function main(): Promise { - await deploymentStacksManagementGroupGet(); + await getAManagementGroupDeploymentStack(); } main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksGetAtResourceGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksGetAtResourceGroupSample.ts index ef73d39cdcb7..6de3aca56c6b 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksGetAtResourceGroupSample.ts +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksGetAtResourceGroupSample.ts @@ -1,35 +1,28 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Gets a Deployment stack with a given name at Resource Group scope. - * - * @summary Gets a Deployment stack with a given name at Resource Group scope. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackResourceGroupGet.json - */ - import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; -async function deploymentStacksResourceGroupGet(): Promise { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] || "deploymentStacksRG"; - const deploymentStackName = "simpleDeploymentStack"; +/** + * This sample demonstrates how to gets the Deployment stack with the given name. + * + * @summary gets the Deployment stack with the given name. + * x-ms-original-file: 2025-07-01/DeploymentStackResourceGroupGet.json + */ +async function getAResourceGroupDeploymentStack(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new DeploymentStacksClient(credential, subscriptionId); const result = await client.deploymentStacks.getAtResourceGroup( - resourceGroupName, - deploymentStackName, + "deploymentStacksRG", + "simpleDeploymentStack", ); console.log(result); } async function main(): Promise { - await deploymentStacksResourceGroupGet(); + await getAResourceGroupDeploymentStack(); } main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksGetAtSubscriptionSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksGetAtSubscriptionSample.ts index ad56f9de1b92..986c41e03e2b 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksGetAtSubscriptionSample.ts +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksGetAtSubscriptionSample.ts @@ -1,30 +1,25 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Gets a Deployment stack with a given name at Subscription scope. - * - * @summary Gets a Deployment stack with a given name at Subscription scope. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackSubscriptionGet.json - */ - import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; -async function deploymentStacksSubscriptionGet(): Promise { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const deploymentStackName = "simpleDeploymentStack"; +/** + * This sample demonstrates how to gets the Deployment stack with the given name. + * + * @summary gets the Deployment stack with the given name. + * x-ms-original-file: 2025-07-01/DeploymentStackSubscriptionGet.json + */ +async function getASubscriptionDeploymentStack(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new DeploymentStacksClient(credential, subscriptionId); - const result = await client.deploymentStacks.getAtSubscription(deploymentStackName); + const result = await client.deploymentStacks.getAtSubscription("simpleDeploymentStack"); console.log(result); } async function main(): Promise { - await deploymentStacksSubscriptionGet(); + await getASubscriptionDeploymentStack(); } main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksListAtManagementGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksListAtManagementGroupSample.ts index d4321c125bb1..fc2340a4c3e0 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksListAtManagementGroupSample.ts +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksListAtManagementGroupSample.ts @@ -1,30 +1,28 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Lists all the Deployment stacks within the specified Management Group. - * - * @summary Lists all the Deployment stacks within the specified Management Group. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackManagementGroupList.json - */ - import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; -async function deploymentStacksManagementGroupList(): Promise { - const managementGroupId = "myMg"; +/** + * This sample demonstrates how to lists Deployment stacks at the specified scope. + * + * @summary lists Deployment stacks at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackManagementGroupList.json + */ +async function listManagementGroupDeploymentStacks(): Promise { const credential = new DefaultAzureCredential(); const client = new DeploymentStacksClient(credential); const resArray = new Array(); - for await (const item of client.deploymentStacks.listAtManagementGroup(managementGroupId)) { + for await (const item of client.deploymentStacks.listAtManagementGroup("myMg")) { resArray.push(item); } + console.log(resArray); } async function main(): Promise { - await deploymentStacksManagementGroupList(); + await listManagementGroupDeploymentStacks(); } main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksListAtResourceGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksListAtResourceGroupSample.ts index d85dd103a158..86b248c3674f 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksListAtResourceGroupSample.ts +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksListAtResourceGroupSample.ts @@ -1,34 +1,29 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Lists all the Deployment stacks within the specified Resource Group. - * - * @summary Lists all the Deployment stacks within the specified Resource Group. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackResourceGroupList.json - */ - import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; -async function deploymentStacksResourceGroupList(): Promise { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] || "deploymentStacksRG"; +/** + * This sample demonstrates how to lists Deployment stacks at the specified scope. + * + * @summary lists Deployment stacks at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackResourceGroupList.json + */ +async function listResourceGroupDeploymentStacks(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new DeploymentStacksClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.deploymentStacks.listAtResourceGroup(resourceGroupName)) { + for await (const item of client.deploymentStacks.listAtResourceGroup("deploymentStacksRG")) { resArray.push(item); } + console.log(resArray); } async function main(): Promise { - await deploymentStacksResourceGroupList(); + await listResourceGroupDeploymentStacks(); } main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksListAtSubscriptionSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksListAtSubscriptionSample.ts index f70d7295f8ef..49ed9047a09d 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksListAtSubscriptionSample.ts +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksListAtSubscriptionSample.ts @@ -1,32 +1,29 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Lists all the Deployment stacks within the specified Subscription. - * - * @summary Lists all the Deployment stacks within the specified Subscription. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackSubscriptionList.json - */ - import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; -async function deploymentStacksSubscriptionList(): Promise { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; +/** + * This sample demonstrates how to lists Deployment stacks at the specified scope. + * + * @summary lists Deployment stacks at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackSubscriptionList.json + */ +async function listSubscriptionDeploymentStacks(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new DeploymentStacksClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.deploymentStacks.listAtSubscription()) { resArray.push(item); } + console.log(resArray); } async function main(): Promise { - await deploymentStacksSubscriptionList(); + await listSubscriptionDeploymentStacks(); } main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksValidateStackAtManagementGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksValidateStackAtManagementGroupSample.ts index ffe70520f7f8..3c4aa0ba3aa5 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksValidateStackAtManagementGroupSample.ts +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksValidateStackAtManagementGroupSample.ts @@ -1,52 +1,44 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Runs preflight validation on the Management Group scoped Deployment stack template to verify its acceptance to Azure Resource Manager. - * - * @summary Runs preflight validation on the Management Group scoped Deployment stack template to verify its acceptance to Azure Resource Manager. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackManagementGroupValidate.json - */ - -import type { DeploymentStack } from "@azure/arm-resourcesdeploymentstacks"; import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; -async function deploymentStacksManagementGroupValidate(): Promise { - const managementGroupId = "myMg"; - const deploymentStackName = "simpleDeploymentStack"; - const deploymentStack: DeploymentStack = { - location: "eastus", - properties: { +/** + * This sample demonstrates how to runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager. + * + * @summary runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager. + * x-ms-original-file: 2025-07-01/DeploymentStackManagementGroupValidate.json + */ +async function validateAManagementGroupDeploymentStack(): Promise { + const credential = new DefaultAzureCredential(); + const client = new DeploymentStacksClient(credential); + const result = await client.deploymentStacks.validateStackAtManagementGroup( + "myMg", + "simpleDeploymentStack", + { + location: "eastus", + tags: { tagkey: "tagVal" }, actionOnUnmanage: { - managementGroups: "detach", - resourceGroups: "detach", resources: "detach", + resourceGroups: "detach", + managementGroups: "detach", }, denySettings: { - applyToChildScopes: false, - excludedActions: ["action"], - excludedPrincipals: ["principal"], mode: "denyDelete", + excludedPrincipals: ["principal"], + excludedActions: ["action"], + applyToChildScopes: false, }, - parameters: { parameter1: { value: "a string" } }, templateLink: { uri: "https://example.com/exampleTemplate.json" }, + parameters: { parameter1: { value: "a string" } }, }, - tags: { tagkey: "tagVal" }, - }; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential); - const result = await client.deploymentStacks.beginValidateStackAtManagementGroupAndWait( - managementGroupId, - deploymentStackName, - deploymentStack, ); console.log(result); } async function main(): Promise { - await deploymentStacksManagementGroupValidate(); + await validateAManagementGroupDeploymentStack(); } main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksValidateStackAtResourceGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksValidateStackAtResourceGroupSample.ts index 88ce5b514d12..745586e69389 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksValidateStackAtResourceGroupSample.ts +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksValidateStackAtResourceGroupSample.ts @@ -1,55 +1,44 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Runs preflight validation on the Resource Group scoped Deployment stack template to verify its acceptance to Azure Resource Manager. - * - * @summary Runs preflight validation on the Resource Group scoped Deployment stack template to verify its acceptance to Azure Resource Manager. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackResourceGroupValidate.json - */ - -import type { DeploymentStack } from "@azure/arm-resourcesdeploymentstacks"; import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; -async function deploymentStacksResourceGroupValidate(): Promise { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] || "deploymentStacksRG"; - const deploymentStackName = "simpleDeploymentStack"; - const deploymentStack: DeploymentStack = { - properties: { +/** + * This sample demonstrates how to runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager. + * + * @summary runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager. + * x-ms-original-file: 2025-07-01/DeploymentStackResourceGroupValidate.json + */ +async function validateAResourceGroupDeploymentStack(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacks.validateStackAtResourceGroup( + "deploymentStacksRG", + "simpleDeploymentStack", + { + tags: { tagkey: "tagVal" }, actionOnUnmanage: { - managementGroups: "delete", - resourceGroups: "delete", resources: "delete", + resourceGroups: "delete", + managementGroups: "delete", }, denySettings: { - applyToChildScopes: false, - excludedActions: ["action"], - excludedPrincipals: ["principal"], mode: "denyDelete", + excludedPrincipals: ["principal"], + excludedActions: ["action"], + applyToChildScopes: false, }, - parameters: { parameter1: { value: "a string" } }, templateLink: { uri: "https://example.com/exampleTemplate.json" }, + parameters: { parameter1: { value: "a string" } }, }, - tags: { tagkey: "tagVal" }, - }; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential, subscriptionId); - const result = await client.deploymentStacks.beginValidateStackAtResourceGroupAndWait( - resourceGroupName, - deploymentStackName, - deploymentStack, ); console.log(result); } async function main(): Promise { - await deploymentStacksResourceGroupValidate(); + await validateAResourceGroupDeploymentStack(); } main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksValidateStackAtSubscriptionSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksValidateStackAtSubscriptionSample.ts index e9ac7884ab79..3808f779d721 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksValidateStackAtSubscriptionSample.ts +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksValidateStackAtSubscriptionSample.ts @@ -1,53 +1,44 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Runs preflight validation on the Subscription scoped Deployment stack template to verify its acceptance to Azure Resource Manager. - * - * @summary Runs preflight validation on the Subscription scoped Deployment stack template to verify its acceptance to Azure Resource Manager. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackSubscriptionValidate.json - */ - -import type { DeploymentStack } from "@azure/arm-resourcesdeploymentstacks"; import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; -async function deploymentStacksSubscriptionValidate(): Promise { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const deploymentStackName = "simpleDeploymentStack"; - const deploymentStack: DeploymentStack = { - location: "eastus", - properties: { +/** + * This sample demonstrates how to runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager. + * + * @summary runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager. + * x-ms-original-file: 2025-07-01/DeploymentStackSubscriptionValidate.json + */ +async function validateASubscriptionDeploymentStack(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacks.validateStackAtSubscription( + "simpleDeploymentStack", + { + location: "eastus", + tags: { tagkey: "tagVal" }, actionOnUnmanage: { - managementGroups: "delete", - resourceGroups: "delete", resources: "delete", + resourceGroups: "delete", + managementGroups: "delete", }, denySettings: { - applyToChildScopes: false, - excludedActions: ["action"], - excludedPrincipals: ["principal"], mode: "denyDelete", + excludedPrincipals: ["principal"], + excludedActions: ["action"], + applyToChildScopes: false, }, - parameters: { parameter1: { value: "a string" } }, templateLink: { uri: "https://example.com/exampleTemplate.json" }, + parameters: { parameter1: { value: "a string" } }, }, - tags: { tagkey: "tagVal" }, - }; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential, subscriptionId); - const result = await client.deploymentStacks.beginValidateStackAtSubscriptionAndWait( - deploymentStackName, - deploymentStack, ); console.log(result); } async function main(): Promise { - await deploymentStacksSubscriptionValidate(); + await validateASubscriptionDeploymentStack(); } main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtManagementGroupCreateOrUpdateSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtManagementGroupCreateOrUpdateSample.ts new file mode 100644 index 000000000000..6bd071852907 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtManagementGroupCreateOrUpdateSample.ts @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates or updates a Deployment stack at the specified scope. + * + * @summary creates or updates a Deployment stack at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsManagementGroupCreate.json + */ +async function createOrUpdateAManagementGroupDeploymentStackWhatIfResult(): Promise { + const credential = new DefaultAzureCredential(); + const client = new DeploymentStacksClient(credential); + const result = await client.deploymentStacksWhatIfResultsAtManagementGroup.createOrUpdate( + "myMg", + "simpleDeploymentStackWhatIfResult", + { + location: "eastus", + properties: { + deploymentStackResourceId: + "/providers/Microsoft.Management/managementGroups/myMg/providers/Microsoft.Resources/deploymentStacks/simpleDeploymentStack", + retentionInterval: "P7D", + templateLink: { uri: "https://example.com/exampleTemplate.json" }, + parameters: {}, + actionOnUnmanage: { + resources: "delete", + resourceGroups: "delete", + managementGroups: "detach", + }, + denySettings: { mode: "none", applyToChildScopes: false }, + extensionConfigs: { + contoso: { + additionalProperties: { + configOne: { value: "config1Value" }, + configTwo: { value: true }, + }, + }, + }, + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateAManagementGroupDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtManagementGroupDeleteSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtManagementGroupDeleteSample.ts new file mode 100644 index 000000000000..fde69d685e74 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtManagementGroupDeleteSample.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * + * @summary deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsManagementGroupDelete.json + */ +async function deleteAManagementGroupDeploymentStackWhatIfResult(): Promise { + const credential = new DefaultAzureCredential(); + const client = new DeploymentStacksClient(credential); + await client.deploymentStacksWhatIfResultsAtManagementGroup.delete( + "myMg", + "simpleDeploymentStack", + ); +} + +async function main(): Promise { + await deleteAManagementGroupDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtManagementGroupGetSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtManagementGroupGetSample.ts new file mode 100644 index 000000000000..5242d79318e5 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtManagementGroupGetSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the Deployment stack with the given name. + * + * @summary gets the Deployment stack with the given name. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsManagementGroupGet.json + */ +async function getAManagementGroupDeploymentStackWhatIfResult(): Promise { + const credential = new DefaultAzureCredential(); + const client = new DeploymentStacksClient(credential); + const result = await client.deploymentStacksWhatIfResultsAtManagementGroup.get( + "myMg", + "simpleDeploymentStackWhatIfResult", + ); + console.log(result); +} + +async function main(): Promise { + await getAManagementGroupDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtManagementGroupListSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtManagementGroupListSample.ts new file mode 100644 index 000000000000..5f744bca9c96 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtManagementGroupListSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists Deployment stacks at the specified scope. + * + * @summary lists Deployment stacks at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsManagementGroupList.json + */ +async function listTheAvailableDeploymentStackWhatIfResultsAtManagementGroupScope(): Promise { + const credential = new DefaultAzureCredential(); + const client = new DeploymentStacksClient(credential); + const resArray = new Array(); + for await (const item of client.deploymentStacksWhatIfResultsAtManagementGroup.list("myMg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listTheAvailableDeploymentStackWhatIfResultsAtManagementGroupScope(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtManagementGroupWhatIfSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtManagementGroupWhatIfSample.ts new file mode 100644 index 000000000000..142dae4b414a --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtManagementGroupWhatIfSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to returns property-level changes that will be made by the deployment if executed. + * + * @summary returns property-level changes that will be made by the deployment if executed. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsManagementGroupWhatIf.json + */ +async function getADetailedManagementGroupDeploymentStackWhatIfResult(): Promise { + const credential = new DefaultAzureCredential(); + const client = new DeploymentStacksClient(credential); + const result = await client.deploymentStacksWhatIfResultsAtManagementGroup.whatIf( + "myMg", + "changedDeploymentStackWhatIfResult", + ); + console.log(result); +} + +async function main(): Promise { + await getADetailedManagementGroupDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtResourceGroupCreateOrUpdateSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtResourceGroupCreateOrUpdateSample.ts new file mode 100644 index 000000000000..884bf3014dd5 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtResourceGroupCreateOrUpdateSample.ts @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates or updates a Deployment stack at the specified scope. + * + * @summary creates or updates a Deployment stack at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsResourceGroupCreate.json + */ +async function createOrUpdateAResourceGroupScopedDeploymentStackWhatIfResult(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacksWhatIfResultsAtResourceGroup.createOrUpdate( + "myResourceGroup", + "simpleDeploymentStackWhatIfResult", + { + location: "eastus", + properties: { + deploymentStackResourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Resources/deploymentStacks/simpleDeploymentStack", + retentionInterval: "P7D", + templateLink: { uri: "https://example.com/exampleTemplate.json" }, + parameters: {}, + actionOnUnmanage: { + resources: "delete", + resourceGroups: "delete", + managementGroups: "detach", + }, + denySettings: { mode: "none", applyToChildScopes: false }, + extensionConfigs: { + contoso: { + additionalProperties: { + configOne: { value: "config1Value" }, + configTwo: { value: true }, + }, + }, + }, + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateAResourceGroupScopedDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtResourceGroupDeleteSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtResourceGroupDeleteSample.ts new file mode 100644 index 000000000000..8363d8c52a74 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtResourceGroupDeleteSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * + * @summary deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsResourceGroupDelete.json + */ +async function deleteAResourceGroupDeploymentStackWhatIfResult(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + await client.deploymentStacksWhatIfResultsAtResourceGroup.delete( + "myResourceGroup", + "simpleDeploymentStack", + ); +} + +async function main(): Promise { + await deleteAResourceGroupDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtResourceGroupGetSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtResourceGroupGetSample.ts new file mode 100644 index 000000000000..a0682b9230ba --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtResourceGroupGetSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the Deployment stack with the given name. + * + * @summary gets the Deployment stack with the given name. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsResourceGroupGet.json + */ +async function getAResourceGroupDeploymentStackWhatIfResult(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacksWhatIfResultsAtResourceGroup.get( + "myResourceGroup", + "simpleDeploymentStackWhatIfResult", + ); + console.log(result); +} + +async function main(): Promise { + await getAResourceGroupDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtResourceGroupListSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtResourceGroupListSample.ts new file mode 100644 index 000000000000..733e468df9d5 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtResourceGroupListSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists Deployment stacks at the specified scope. + * + * @summary lists Deployment stacks at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsResourceGroupList.json + */ +async function listTheAvailableDeploymentStackWhatIfResultsAtResourceGroupScope(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.deploymentStacksWhatIfResultsAtResourceGroup.list( + "myResourceGroup", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listTheAvailableDeploymentStackWhatIfResultsAtResourceGroupScope(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtResourceGroupWhatIfSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtResourceGroupWhatIfSample.ts new file mode 100644 index 000000000000..c171e8d7fa3e --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtResourceGroupWhatIfSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to returns property-level changes that will be made by the deployment if executed. + * + * @summary returns property-level changes that will be made by the deployment if executed. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsResourceGroupWhatIf.json + */ +async function getADetailedResourceGroupDeploymentStackWhatIfResult(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacksWhatIfResultsAtResourceGroup.whatIf( + "myResourceGroup", + "changedDeploymentStackWhatIfResult", + ); + console.log(result); +} + +async function main(): Promise { + await getADetailedResourceGroupDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtSubscriptionCreateOrUpdateSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtSubscriptionCreateOrUpdateSample.ts new file mode 100644 index 000000000000..61a746d51556 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtSubscriptionCreateOrUpdateSample.ts @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates or updates a Deployment stack at the specified scope. + * + * @summary creates or updates a Deployment stack at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsSubscriptionCreate.json + */ +async function createOrUpdateASubscriptionScopedDeploymentStackWhatIfResult(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacksWhatIfResultsAtSubscription.createOrUpdate( + "simpleDeploymentStackWhatIfResult", + { + location: "eastus", + properties: { + deploymentStackResourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deploymentStacks/simpleDeploymentStack", + retentionInterval: "P7D", + templateLink: { uri: "https://example.com/exampleTemplate.json" }, + parameters: {}, + actionOnUnmanage: { + resources: "delete", + resourceGroups: "delete", + managementGroups: "detach", + }, + denySettings: { mode: "none", applyToChildScopes: false }, + extensionConfigs: { + contoso: { + additionalProperties: { + configOne: { value: "config1Value" }, + configTwo: { value: true }, + }, + }, + }, + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateASubscriptionScopedDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtSubscriptionDeleteSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtSubscriptionDeleteSample.ts new file mode 100644 index 000000000000..f8be7e30cf7e --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtSubscriptionDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * + * @summary deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsSubscriptionDelete.json + */ +async function deleteASubscriptionDeploymentStackWhatIfResult(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + await client.deploymentStacksWhatIfResultsAtSubscription.delete("simpleDeploymentStack"); +} + +async function main(): Promise { + await deleteASubscriptionDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtSubscriptionGetSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtSubscriptionGetSample.ts new file mode 100644 index 000000000000..6c9c7870edb3 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtSubscriptionGetSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the Deployment stack with the given name. + * + * @summary gets the Deployment stack with the given name. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsSubscriptionGet.json + */ +async function getASubscriptionDeploymentStackWhatIfResult(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacksWhatIfResultsAtSubscription.get( + "simpleDeploymentStackWhatIfResult", + ); + console.log(result); +} + +async function main(): Promise { + await getASubscriptionDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtSubscriptionListSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtSubscriptionListSample.ts new file mode 100644 index 000000000000..285e6d942c9a --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtSubscriptionListSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists Deployment stacks at the specified scope. + * + * @summary lists Deployment stacks at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsSubscriptionList.json + */ +async function listTheAvailableDeploymentStackWhatIfResultsAtSubscriptionScope(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.deploymentStacksWhatIfResultsAtSubscription.list()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listTheAvailableDeploymentStackWhatIfResultsAtSubscriptionScope(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtSubscriptionWhatIfSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtSubscriptionWhatIfSample.ts new file mode 100644 index 000000000000..5aa3ee4db50c --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples-dev/deploymentStacksWhatIfResultsAtSubscriptionWhatIfSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to returns property-level changes that will be made by the deployment if executed. + * + * @summary returns property-level changes that will be made by the deployment if executed. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsSubscriptionWhatIf.json + */ +async function getADetailedSubscriptionDeploymentStackWhatIfResult(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacksWhatIfResultsAtSubscription.whatIf( + "changedDeploymentStackWhatIfResult", + ); + console.log(result); +} + +async function main(): Promise { + await getADetailedSubscriptionDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/README.md b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/README.md deleted file mode 100644 index 9c30b3b51855..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/README.md +++ /dev/null @@ -1,84 +0,0 @@ -# client library samples for JavaScript - -These sample programs show how to use the JavaScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ----------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [deploymentStacksCreateOrUpdateAtManagementGroupSample.js][deploymentstackscreateorupdateatmanagementgroupsample] | Creates or updates a Deployment stack at Management Group scope. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackManagementGroupCreate.json | -| [deploymentStacksCreateOrUpdateAtResourceGroupSample.js][deploymentstackscreateorupdateatresourcegroupsample] | Creates or updates a Deployment stack at Resource Group scope. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackResourceGroupCreate.json | -| [deploymentStacksCreateOrUpdateAtSubscriptionSample.js][deploymentstackscreateorupdateatsubscriptionsample] | Creates or updates a Deployment stack at Subscription scope. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackSubscriptionCreate.json | -| [deploymentStacksDeleteAtManagementGroupSample.js][deploymentstacksdeleteatmanagementgroupsample] | Deletes a Deployment stack by name at Management Group scope. When operation completes, status code 200 returned without content. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackManagementGroupDelete.json | -| [deploymentStacksDeleteAtResourceGroupSample.js][deploymentstacksdeleteatresourcegroupsample] | Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code 200 returned without content. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackResourceGroupDelete.json | -| [deploymentStacksDeleteAtSubscriptionSample.js][deploymentstacksdeleteatsubscriptionsample] | Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 returned without content. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackSubscriptionDelete.json | -| [deploymentStacksExportTemplateAtManagementGroupSample.js][deploymentstacksexporttemplateatmanagementgroupsample] | Exports the template used to create the Deployment stack at Management Group scope. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackManagementGroupExportTemplate.json | -| [deploymentStacksExportTemplateAtResourceGroupSample.js][deploymentstacksexporttemplateatresourcegroupsample] | Exports the template used to create the Deployment stack at Resource Group scope. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackExportTemplate.json | -| [deploymentStacksExportTemplateAtSubscriptionSample.js][deploymentstacksexporttemplateatsubscriptionsample] | Exports the template used to create the Deployment stack at Subscription scope. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackSubscriptionExportTemplate.json | -| [deploymentStacksGetAtManagementGroupSample.js][deploymentstacksgetatmanagementgroupsample] | Gets a Deployment stack with a given name at Management Group scope. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackManagementGroupGet.json | -| [deploymentStacksGetAtResourceGroupSample.js][deploymentstacksgetatresourcegroupsample] | Gets a Deployment stack with a given name at Resource Group scope. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackResourceGroupGet.json | -| [deploymentStacksGetAtSubscriptionSample.js][deploymentstacksgetatsubscriptionsample] | Gets a Deployment stack with a given name at Subscription scope. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackSubscriptionGet.json | -| [deploymentStacksListAtManagementGroupSample.js][deploymentstackslistatmanagementgroupsample] | Lists all the Deployment stacks within the specified Management Group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackManagementGroupList.json | -| [deploymentStacksListAtResourceGroupSample.js][deploymentstackslistatresourcegroupsample] | Lists all the Deployment stacks within the specified Resource Group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackResourceGroupList.json | -| [deploymentStacksListAtSubscriptionSample.js][deploymentstackslistatsubscriptionsample] | Lists all the Deployment stacks within the specified Subscription. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackSubscriptionList.json | -| [deploymentStacksValidateStackAtManagementGroupSample.js][deploymentstacksvalidatestackatmanagementgroupsample] | Runs preflight validation on the Management Group scoped Deployment stack template to verify its acceptance to Azure Resource Manager. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackManagementGroupValidate.json | -| [deploymentStacksValidateStackAtResourceGroupSample.js][deploymentstacksvalidatestackatresourcegroupsample] | Runs preflight validation on the Resource Group scoped Deployment stack template to verify its acceptance to Azure Resource Manager. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackResourceGroupValidate.json | -| [deploymentStacksValidateStackAtSubscriptionSample.js][deploymentstacksvalidatestackatsubscriptionsample] | Runs preflight validation on the Subscription scoped Deployment stack template to verify its acceptance to Azure Resource Manager. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackSubscriptionValidate.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node deploymentStacksCreateOrUpdateAtManagementGroupSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -cross-env node deploymentStacksCreateOrUpdateAtManagementGroupSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[deploymentstackscreateorupdateatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksCreateOrUpdateAtManagementGroupSample.js -[deploymentstackscreateorupdateatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksCreateOrUpdateAtResourceGroupSample.js -[deploymentstackscreateorupdateatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksCreateOrUpdateAtSubscriptionSample.js -[deploymentstacksdeleteatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksDeleteAtManagementGroupSample.js -[deploymentstacksdeleteatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksDeleteAtResourceGroupSample.js -[deploymentstacksdeleteatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksDeleteAtSubscriptionSample.js -[deploymentstacksexporttemplateatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksExportTemplateAtManagementGroupSample.js -[deploymentstacksexporttemplateatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksExportTemplateAtResourceGroupSample.js -[deploymentstacksexporttemplateatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksExportTemplateAtSubscriptionSample.js -[deploymentstacksgetatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksGetAtManagementGroupSample.js -[deploymentstacksgetatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksGetAtResourceGroupSample.js -[deploymentstacksgetatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksGetAtSubscriptionSample.js -[deploymentstackslistatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksListAtManagementGroupSample.js -[deploymentstackslistatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksListAtResourceGroupSample.js -[deploymentstackslistatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksListAtSubscriptionSample.js -[deploymentstacksvalidatestackatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksValidateStackAtManagementGroupSample.js -[deploymentstacksvalidatestackatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksValidateStackAtResourceGroupSample.js -[deploymentstacksvalidatestackatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksValidateStackAtSubscriptionSample.js -[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-resourcesdeploymentstacks?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/README.md diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksCreateOrUpdateAtManagementGroupSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksCreateOrUpdateAtManagementGroupSample.js deleted file mode 100644 index d2ec0716c5dd..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksCreateOrUpdateAtManagementGroupSample.js +++ /dev/null @@ -1,56 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates or updates a Deployment stack at Management Group scope. - * - * @summary Creates or updates a Deployment stack at Management Group scope. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackManagementGroupCreate.json - */ -async function deploymentStacksManagementGroupCreateOrUpdate() { - const managementGroupId = "myMg"; - const deploymentStackName = "simpleDeploymentStack"; - const deploymentStack = { - location: "eastus", - properties: { - actionOnUnmanage: { - managementGroups: "detach", - resourceGroups: "delete", - resources: "delete", - }, - denySettings: { - applyToChildScopes: false, - excludedActions: ["action"], - excludedPrincipals: ["principal"], - mode: "denyDelete", - }, - parameters: { parameter1: { value: "a string" } }, - }, - tags: { tagkey: "tagVal" }, - }; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential); - const result = await client.deploymentStacks.beginCreateOrUpdateAtManagementGroupAndWait( - managementGroupId, - deploymentStackName, - deploymentStack, - ); - console.log(result); -} - -async function main() { - deploymentStacksManagementGroupCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksCreateOrUpdateAtResourceGroupSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksCreateOrUpdateAtResourceGroupSample.js deleted file mode 100644 index 1db6924e96c1..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksCreateOrUpdateAtResourceGroupSample.js +++ /dev/null @@ -1,60 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates or updates a Deployment stack at Resource Group scope. - * - * @summary Creates or updates a Deployment stack at Resource Group scope. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackResourceGroupCreate.json - */ -async function deploymentStacksResourceGroupCreateOrUpdate() { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] || "deploymentStacksRG"; - const deploymentStackName = "simpleDeploymentStack"; - const deploymentStack = { - location: "eastus", - properties: { - actionOnUnmanage: { - managementGroups: "detach", - resourceGroups: "delete", - resources: "delete", - }, - denySettings: { - applyToChildScopes: false, - excludedActions: ["action"], - excludedPrincipals: ["principal"], - mode: "denyDelete", - }, - parameters: { parameter1: { value: "a string" } }, - }, - tags: { tagkey: "tagVal" }, - }; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential, subscriptionId); - const result = await client.deploymentStacks.beginCreateOrUpdateAtResourceGroupAndWait( - resourceGroupName, - deploymentStackName, - deploymentStack, - ); - console.log(result); -} - -async function main() { - deploymentStacksResourceGroupCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksCreateOrUpdateAtSubscriptionSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksCreateOrUpdateAtSubscriptionSample.js deleted file mode 100644 index 8959a09856d0..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksCreateOrUpdateAtSubscriptionSample.js +++ /dev/null @@ -1,57 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates or updates a Deployment stack at Subscription scope. - * - * @summary Creates or updates a Deployment stack at Subscription scope. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackSubscriptionCreate.json - */ -async function deploymentStacksSubscriptionCreateOrUpdate() { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const deploymentStackName = "simpleDeploymentStack"; - const deploymentStack = { - location: "eastus", - properties: { - actionOnUnmanage: { - managementGroups: "detach", - resourceGroups: "delete", - resources: "delete", - }, - denySettings: { - applyToChildScopes: false, - excludedActions: ["action"], - excludedPrincipals: ["principal"], - mode: "denyDelete", - }, - parameters: { parameter1: { value: "a string" } }, - }, - tags: { tagkey: "tagVal" }, - }; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential, subscriptionId); - const result = await client.deploymentStacks.beginCreateOrUpdateAtSubscriptionAndWait( - deploymentStackName, - deploymentStack, - ); - console.log(result); -} - -async function main() { - deploymentStacksSubscriptionCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksDeleteAtManagementGroupSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksDeleteAtManagementGroupSample.js deleted file mode 100644 index d8f99d9433df..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksDeleteAtManagementGroupSample.js +++ /dev/null @@ -1,37 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes a Deployment stack by name at Management Group scope. When operation completes, status code 200 returned without content. - * - * @summary Deletes a Deployment stack by name at Management Group scope. When operation completes, status code 200 returned without content. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackManagementGroupDelete.json - */ -async function deploymentStacksManagementGroupDelete() { - const managementGroupId = "myMg"; - const deploymentStackName = "simpleDeploymentStack"; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential); - const result = await client.deploymentStacks.beginDeleteAtManagementGroupAndWait( - managementGroupId, - deploymentStackName, - ); - console.log(result); -} - -async function main() { - deploymentStacksManagementGroupDelete(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksDeleteAtResourceGroupSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksDeleteAtResourceGroupSample.js deleted file mode 100644 index d8ece04071a3..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksDeleteAtResourceGroupSample.js +++ /dev/null @@ -1,41 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code 200 returned without content. - * - * @summary Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code 200 returned without content. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackResourceGroupDelete.json - */ -async function deploymentStacksResourceGroupDelete() { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] || "deploymentStacksRG"; - const deploymentStackName = "simpleDeploymentStack"; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential, subscriptionId); - const result = await client.deploymentStacks.beginDeleteAtResourceGroupAndWait( - resourceGroupName, - deploymentStackName, - ); - console.log(result); -} - -async function main() { - deploymentStacksResourceGroupDelete(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksDeleteAtSubscriptionSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksDeleteAtSubscriptionSample.js deleted file mode 100644 index 68e370baf28c..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksDeleteAtSubscriptionSample.js +++ /dev/null @@ -1,37 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 returned without content. - * - * @summary Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 returned without content. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackSubscriptionDelete.json - */ -async function deploymentStacksSubscriptionDelete() { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const deploymentStackName = "simpleDeploymentStack"; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential, subscriptionId); - const result = - await client.deploymentStacks.beginDeleteAtSubscriptionAndWait(deploymentStackName); - console.log(result); -} - -async function main() { - deploymentStacksSubscriptionDelete(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksExportTemplateAtManagementGroupSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksExportTemplateAtManagementGroupSample.js deleted file mode 100644 index 2a2a9febd1cd..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksExportTemplateAtManagementGroupSample.js +++ /dev/null @@ -1,37 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Exports the template used to create the Deployment stack at Management Group scope. - * - * @summary Exports the template used to create the Deployment stack at Management Group scope. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackManagementGroupExportTemplate.json - */ -async function deploymentStacksManagementGroupExportTemplate() { - const managementGroupId = "myMg"; - const deploymentStackName = "simpleDeploymentStack"; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential); - const result = await client.deploymentStacks.exportTemplateAtManagementGroup( - managementGroupId, - deploymentStackName, - ); - console.log(result); -} - -async function main() { - deploymentStacksManagementGroupExportTemplate(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksExportTemplateAtResourceGroupSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksExportTemplateAtResourceGroupSample.js deleted file mode 100644 index 429d9a86d29b..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksExportTemplateAtResourceGroupSample.js +++ /dev/null @@ -1,41 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Exports the template used to create the Deployment stack at Resource Group scope. - * - * @summary Exports the template used to create the Deployment stack at Resource Group scope. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackExportTemplate.json - */ -async function deploymentStacksResourceGroupExportTemplate() { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] || "deploymentStacksRG"; - const deploymentStackName = "simpleDeploymentStack"; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential, subscriptionId); - const result = await client.deploymentStacks.exportTemplateAtResourceGroup( - resourceGroupName, - deploymentStackName, - ); - console.log(result); -} - -async function main() { - deploymentStacksResourceGroupExportTemplate(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksExportTemplateAtSubscriptionSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksExportTemplateAtSubscriptionSample.js deleted file mode 100644 index d959574e2f12..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksExportTemplateAtSubscriptionSample.js +++ /dev/null @@ -1,36 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Exports the template used to create the Deployment stack at Subscription scope. - * - * @summary Exports the template used to create the Deployment stack at Subscription scope. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackSubscriptionExportTemplate.json - */ -async function deploymentStacksSubscriptionExportTemplate() { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const deploymentStackName = "simpleDeploymentStack"; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential, subscriptionId); - const result = await client.deploymentStacks.exportTemplateAtSubscription(deploymentStackName); - console.log(result); -} - -async function main() { - deploymentStacksSubscriptionExportTemplate(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksGetAtManagementGroupSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksGetAtManagementGroupSample.js deleted file mode 100644 index 7fea59a7ff23..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksGetAtManagementGroupSample.js +++ /dev/null @@ -1,37 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets a Deployment stack with a given name at Management Group scope. - * - * @summary Gets a Deployment stack with a given name at Management Group scope. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackManagementGroupGet.json - */ -async function deploymentStacksManagementGroupGet() { - const managementGroupId = "myMg"; - const deploymentStackName = "simpleDeploymentStack"; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential); - const result = await client.deploymentStacks.getAtManagementGroup( - managementGroupId, - deploymentStackName, - ); - console.log(result); -} - -async function main() { - deploymentStacksManagementGroupGet(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksGetAtResourceGroupSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksGetAtResourceGroupSample.js deleted file mode 100644 index da4bbde34241..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksGetAtResourceGroupSample.js +++ /dev/null @@ -1,41 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets a Deployment stack with a given name at Resource Group scope. - * - * @summary Gets a Deployment stack with a given name at Resource Group scope. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackResourceGroupGet.json - */ -async function deploymentStacksResourceGroupGet() { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] || "deploymentStacksRG"; - const deploymentStackName = "simpleDeploymentStack"; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential, subscriptionId); - const result = await client.deploymentStacks.getAtResourceGroup( - resourceGroupName, - deploymentStackName, - ); - console.log(result); -} - -async function main() { - deploymentStacksResourceGroupGet(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksGetAtSubscriptionSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksGetAtSubscriptionSample.js deleted file mode 100644 index aa2b72859913..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksGetAtSubscriptionSample.js +++ /dev/null @@ -1,36 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets a Deployment stack with a given name at Subscription scope. - * - * @summary Gets a Deployment stack with a given name at Subscription scope. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackSubscriptionGet.json - */ -async function deploymentStacksSubscriptionGet() { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const deploymentStackName = "simpleDeploymentStack"; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential, subscriptionId); - const result = await client.deploymentStacks.getAtSubscription(deploymentStackName); - console.log(result); -} - -async function main() { - deploymentStacksSubscriptionGet(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksListAtManagementGroupSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksListAtManagementGroupSample.js deleted file mode 100644 index 939341d7451e..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksListAtManagementGroupSample.js +++ /dev/null @@ -1,36 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists all the Deployment stacks within the specified Management Group. - * - * @summary Lists all the Deployment stacks within the specified Management Group. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackManagementGroupList.json - */ -async function deploymentStacksManagementGroupList() { - const managementGroupId = "myMg"; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential); - const resArray = new Array(); - for await (let item of client.deploymentStacks.listAtManagementGroup(managementGroupId)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - deploymentStacksManagementGroupList(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksListAtResourceGroupSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksListAtResourceGroupSample.js deleted file mode 100644 index 837a3fcfd670..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksListAtResourceGroupSample.js +++ /dev/null @@ -1,40 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists all the Deployment stacks within the specified Resource Group. - * - * @summary Lists all the Deployment stacks within the specified Resource Group. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackResourceGroupList.json - */ -async function deploymentStacksResourceGroupList() { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] || "deploymentStacksRG"; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.deploymentStacks.listAtResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - deploymentStacksResourceGroupList(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksListAtSubscriptionSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksListAtSubscriptionSample.js deleted file mode 100644 index e6424e4f32c4..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksListAtSubscriptionSample.js +++ /dev/null @@ -1,38 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists all the Deployment stacks within the specified Subscription. - * - * @summary Lists all the Deployment stacks within the specified Subscription. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackSubscriptionList.json - */ -async function deploymentStacksSubscriptionList() { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.deploymentStacks.listAtSubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - deploymentStacksSubscriptionList(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksValidateStackAtManagementGroupSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksValidateStackAtManagementGroupSample.js deleted file mode 100644 index 7fb29a21c80c..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksValidateStackAtManagementGroupSample.js +++ /dev/null @@ -1,57 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Runs preflight validation on the Management Group scoped Deployment stack template to verify its acceptance to Azure Resource Manager. - * - * @summary Runs preflight validation on the Management Group scoped Deployment stack template to verify its acceptance to Azure Resource Manager. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackManagementGroupValidate.json - */ -async function deploymentStacksManagementGroupValidate() { - const managementGroupId = "myMg"; - const deploymentStackName = "simpleDeploymentStack"; - const deploymentStack = { - location: "eastus", - properties: { - actionOnUnmanage: { - managementGroups: "detach", - resourceGroups: "detach", - resources: "detach", - }, - denySettings: { - applyToChildScopes: false, - excludedActions: ["action"], - excludedPrincipals: ["principal"], - mode: "denyDelete", - }, - parameters: { parameter1: { value: "a string" } }, - templateLink: { uri: "https://example.com/exampleTemplate.json" }, - }, - tags: { tagkey: "tagVal" }, - }; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential); - const result = await client.deploymentStacks.beginValidateStackAtManagementGroupAndWait( - managementGroupId, - deploymentStackName, - deploymentStack, - ); - console.log(result); -} - -async function main() { - deploymentStacksManagementGroupValidate(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksValidateStackAtResourceGroupSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksValidateStackAtResourceGroupSample.js deleted file mode 100644 index 34a54894b7f5..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksValidateStackAtResourceGroupSample.js +++ /dev/null @@ -1,60 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Runs preflight validation on the Resource Group scoped Deployment stack template to verify its acceptance to Azure Resource Manager. - * - * @summary Runs preflight validation on the Resource Group scoped Deployment stack template to verify its acceptance to Azure Resource Manager. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackResourceGroupValidate.json - */ -async function deploymentStacksResourceGroupValidate() { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] || "deploymentStacksRG"; - const deploymentStackName = "simpleDeploymentStack"; - const deploymentStack = { - properties: { - actionOnUnmanage: { - managementGroups: "delete", - resourceGroups: "delete", - resources: "delete", - }, - denySettings: { - applyToChildScopes: false, - excludedActions: ["action"], - excludedPrincipals: ["principal"], - mode: "denyDelete", - }, - parameters: { parameter1: { value: "a string" } }, - templateLink: { uri: "https://example.com/exampleTemplate.json" }, - }, - tags: { tagkey: "tagVal" }, - }; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential, subscriptionId); - const result = await client.deploymentStacks.beginValidateStackAtResourceGroupAndWait( - resourceGroupName, - deploymentStackName, - deploymentStack, - ); - console.log(result); -} - -async function main() { - deploymentStacksResourceGroupValidate(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksValidateStackAtSubscriptionSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksValidateStackAtSubscriptionSample.js deleted file mode 100644 index cb7008df8177..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/deploymentStacksValidateStackAtSubscriptionSample.js +++ /dev/null @@ -1,58 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Runs preflight validation on the Subscription scoped Deployment stack template to verify its acceptance to Azure Resource Manager. - * - * @summary Runs preflight validation on the Subscription scoped Deployment stack template to verify its acceptance to Azure Resource Manager. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackSubscriptionValidate.json - */ -async function deploymentStacksSubscriptionValidate() { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const deploymentStackName = "simpleDeploymentStack"; - const deploymentStack = { - location: "eastus", - properties: { - actionOnUnmanage: { - managementGroups: "delete", - resourceGroups: "delete", - resources: "delete", - }, - denySettings: { - applyToChildScopes: false, - excludedActions: ["action"], - excludedPrincipals: ["principal"], - mode: "denyDelete", - }, - parameters: { parameter1: { value: "a string" } }, - templateLink: { uri: "https://example.com/exampleTemplate.json" }, - }, - tags: { tagkey: "tagVal" }, - }; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential, subscriptionId); - const result = await client.deploymentStacks.beginValidateStackAtSubscriptionAndWait( - deploymentStackName, - deploymentStack, - ); - console.log(result); -} - -async function main() { - deploymentStacksSubscriptionValidate(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/sample.env b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/README.md b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/README.md deleted file mode 100644 index fe6482363998..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/README.md +++ /dev/null @@ -1,97 +0,0 @@ -# client library samples for TypeScript - -These sample programs show how to use the TypeScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ----------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [deploymentStacksCreateOrUpdateAtManagementGroupSample.ts][deploymentstackscreateorupdateatmanagementgroupsample] | Creates or updates a Deployment stack at Management Group scope. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackManagementGroupCreate.json | -| [deploymentStacksCreateOrUpdateAtResourceGroupSample.ts][deploymentstackscreateorupdateatresourcegroupsample] | Creates or updates a Deployment stack at Resource Group scope. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackResourceGroupCreate.json | -| [deploymentStacksCreateOrUpdateAtSubscriptionSample.ts][deploymentstackscreateorupdateatsubscriptionsample] | Creates or updates a Deployment stack at Subscription scope. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackSubscriptionCreate.json | -| [deploymentStacksDeleteAtManagementGroupSample.ts][deploymentstacksdeleteatmanagementgroupsample] | Deletes a Deployment stack by name at Management Group scope. When operation completes, status code 200 returned without content. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackManagementGroupDelete.json | -| [deploymentStacksDeleteAtResourceGroupSample.ts][deploymentstacksdeleteatresourcegroupsample] | Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code 200 returned without content. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackResourceGroupDelete.json | -| [deploymentStacksDeleteAtSubscriptionSample.ts][deploymentstacksdeleteatsubscriptionsample] | Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 returned without content. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackSubscriptionDelete.json | -| [deploymentStacksExportTemplateAtManagementGroupSample.ts][deploymentstacksexporttemplateatmanagementgroupsample] | Exports the template used to create the Deployment stack at Management Group scope. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackManagementGroupExportTemplate.json | -| [deploymentStacksExportTemplateAtResourceGroupSample.ts][deploymentstacksexporttemplateatresourcegroupsample] | Exports the template used to create the Deployment stack at Resource Group scope. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackExportTemplate.json | -| [deploymentStacksExportTemplateAtSubscriptionSample.ts][deploymentstacksexporttemplateatsubscriptionsample] | Exports the template used to create the Deployment stack at Subscription scope. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackSubscriptionExportTemplate.json | -| [deploymentStacksGetAtManagementGroupSample.ts][deploymentstacksgetatmanagementgroupsample] | Gets a Deployment stack with a given name at Management Group scope. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackManagementGroupGet.json | -| [deploymentStacksGetAtResourceGroupSample.ts][deploymentstacksgetatresourcegroupsample] | Gets a Deployment stack with a given name at Resource Group scope. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackResourceGroupGet.json | -| [deploymentStacksGetAtSubscriptionSample.ts][deploymentstacksgetatsubscriptionsample] | Gets a Deployment stack with a given name at Subscription scope. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackSubscriptionGet.json | -| [deploymentStacksListAtManagementGroupSample.ts][deploymentstackslistatmanagementgroupsample] | Lists all the Deployment stacks within the specified Management Group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackManagementGroupList.json | -| [deploymentStacksListAtResourceGroupSample.ts][deploymentstackslistatresourcegroupsample] | Lists all the Deployment stacks within the specified Resource Group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackResourceGroupList.json | -| [deploymentStacksListAtSubscriptionSample.ts][deploymentstackslistatsubscriptionsample] | Lists all the Deployment stacks within the specified Subscription. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackSubscriptionList.json | -| [deploymentStacksValidateStackAtManagementGroupSample.ts][deploymentstacksvalidatestackatmanagementgroupsample] | Runs preflight validation on the Management Group scoped Deployment stack template to verify its acceptance to Azure Resource Manager. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackManagementGroupValidate.json | -| [deploymentStacksValidateStackAtResourceGroupSample.ts][deploymentstacksvalidatestackatresourcegroupsample] | Runs preflight validation on the Resource Group scoped Deployment stack template to verify its acceptance to Azure Resource Manager. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackResourceGroupValidate.json | -| [deploymentStacksValidateStackAtSubscriptionSample.ts][deploymentstacksvalidatestackatsubscriptionsample] | Runs preflight validation on the Subscription scoped Deployment stack template to verify its acceptance to Azure Resource Manager. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackSubscriptionValidate.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/deploymentStacksCreateOrUpdateAtManagementGroupSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -cross-env node dist/deploymentStacksCreateOrUpdateAtManagementGroupSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[deploymentstackscreateorupdateatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksCreateOrUpdateAtManagementGroupSample.ts -[deploymentstackscreateorupdateatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksCreateOrUpdateAtResourceGroupSample.ts -[deploymentstackscreateorupdateatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksCreateOrUpdateAtSubscriptionSample.ts -[deploymentstacksdeleteatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksDeleteAtManagementGroupSample.ts -[deploymentstacksdeleteatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksDeleteAtResourceGroupSample.ts -[deploymentstacksdeleteatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksDeleteAtSubscriptionSample.ts -[deploymentstacksexporttemplateatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksExportTemplateAtManagementGroupSample.ts -[deploymentstacksexporttemplateatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksExportTemplateAtResourceGroupSample.ts -[deploymentstacksexporttemplateatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksExportTemplateAtSubscriptionSample.ts -[deploymentstacksgetatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksGetAtManagementGroupSample.ts -[deploymentstacksgetatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksGetAtResourceGroupSample.ts -[deploymentstacksgetatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksGetAtSubscriptionSample.ts -[deploymentstackslistatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksListAtManagementGroupSample.ts -[deploymentstackslistatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksListAtResourceGroupSample.ts -[deploymentstackslistatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksListAtSubscriptionSample.ts -[deploymentstacksvalidatestackatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksValidateStackAtManagementGroupSample.ts -[deploymentstacksvalidatestackatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksValidateStackAtResourceGroupSample.ts -[deploymentstacksvalidatestackatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksValidateStackAtSubscriptionSample.ts -[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-resourcesdeploymentstacks?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/sample.env b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksCreateOrUpdateAtManagementGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksCreateOrUpdateAtManagementGroupSample.ts deleted file mode 100644 index 97b52c3a5d87..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksCreateOrUpdateAtManagementGroupSample.ts +++ /dev/null @@ -1,60 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DeploymentStack, - DeploymentStacksClient, -} from "@azure/arm-resourcesdeploymentstacks"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Creates or updates a Deployment stack at Management Group scope. - * - * @summary Creates or updates a Deployment stack at Management Group scope. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackManagementGroupCreate.json - */ -async function deploymentStacksManagementGroupCreateOrUpdate(): Promise { - const managementGroupId = "myMg"; - const deploymentStackName = "simpleDeploymentStack"; - const deploymentStack: DeploymentStack = { - location: "eastus", - properties: { - actionOnUnmanage: { - managementGroups: "detach", - resourceGroups: "delete", - resources: "delete", - }, - denySettings: { - applyToChildScopes: false, - excludedActions: ["action"], - excludedPrincipals: ["principal"], - mode: "denyDelete", - }, - parameters: { parameter1: { value: "a string" } }, - }, - tags: { tagkey: "tagVal" }, - }; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential); - const result = - await client.deploymentStacks.beginCreateOrUpdateAtManagementGroupAndWait( - managementGroupId, - deploymentStackName, - deploymentStack, - ); - console.log(result); -} - -async function main(): Promise { - deploymentStacksManagementGroupCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksCreateOrUpdateAtResourceGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksCreateOrUpdateAtResourceGroupSample.ts deleted file mode 100644 index f25fe4978884..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksCreateOrUpdateAtResourceGroupSample.ts +++ /dev/null @@ -1,65 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DeploymentStack, - DeploymentStacksClient, -} from "@azure/arm-resourcesdeploymentstacks"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Creates or updates a Deployment stack at Resource Group scope. - * - * @summary Creates or updates a Deployment stack at Resource Group scope. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackResourceGroupCreate.json - */ -async function deploymentStacksResourceGroupCreateOrUpdate(): Promise { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] || - "deploymentStacksRG"; - const deploymentStackName = "simpleDeploymentStack"; - const deploymentStack: DeploymentStack = { - location: "eastus", - properties: { - actionOnUnmanage: { - managementGroups: "detach", - resourceGroups: "delete", - resources: "delete", - }, - denySettings: { - applyToChildScopes: false, - excludedActions: ["action"], - excludedPrincipals: ["principal"], - mode: "denyDelete", - }, - parameters: { parameter1: { value: "a string" } }, - }, - tags: { tagkey: "tagVal" }, - }; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential, subscriptionId); - const result = - await client.deploymentStacks.beginCreateOrUpdateAtResourceGroupAndWait( - resourceGroupName, - deploymentStackName, - deploymentStack, - ); - console.log(result); -} - -async function main(): Promise { - deploymentStacksResourceGroupCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksCreateOrUpdateAtSubscriptionSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksCreateOrUpdateAtSubscriptionSample.ts deleted file mode 100644 index 68992e695f34..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksCreateOrUpdateAtSubscriptionSample.ts +++ /dev/null @@ -1,61 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DeploymentStack, - DeploymentStacksClient, -} from "@azure/arm-resourcesdeploymentstacks"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Creates or updates a Deployment stack at Subscription scope. - * - * @summary Creates or updates a Deployment stack at Subscription scope. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackSubscriptionCreate.json - */ -async function deploymentStacksSubscriptionCreateOrUpdate(): Promise { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const deploymentStackName = "simpleDeploymentStack"; - const deploymentStack: DeploymentStack = { - location: "eastus", - properties: { - actionOnUnmanage: { - managementGroups: "detach", - resourceGroups: "delete", - resources: "delete", - }, - denySettings: { - applyToChildScopes: false, - excludedActions: ["action"], - excludedPrincipals: ["principal"], - mode: "denyDelete", - }, - parameters: { parameter1: { value: "a string" } }, - }, - tags: { tagkey: "tagVal" }, - }; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential, subscriptionId); - const result = - await client.deploymentStacks.beginCreateOrUpdateAtSubscriptionAndWait( - deploymentStackName, - deploymentStack, - ); - console.log(result); -} - -async function main(): Promise { - deploymentStacksSubscriptionCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksDeleteAtManagementGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksDeleteAtManagementGroupSample.ts deleted file mode 100644 index 1e41c95a2aac..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksDeleteAtManagementGroupSample.ts +++ /dev/null @@ -1,38 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes a Deployment stack by name at Management Group scope. When operation completes, status code 200 returned without content. - * - * @summary Deletes a Deployment stack by name at Management Group scope. When operation completes, status code 200 returned without content. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackManagementGroupDelete.json - */ -async function deploymentStacksManagementGroupDelete(): Promise { - const managementGroupId = "myMg"; - const deploymentStackName = "simpleDeploymentStack"; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential); - const result = - await client.deploymentStacks.beginDeleteAtManagementGroupAndWait( - managementGroupId, - deploymentStackName, - ); - console.log(result); -} - -async function main(): Promise { - deploymentStacksManagementGroupDelete(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksDeleteAtResourceGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksDeleteAtResourceGroupSample.ts deleted file mode 100644 index fa474bf7497c..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksDeleteAtResourceGroupSample.ts +++ /dev/null @@ -1,43 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code 200 returned without content. - * - * @summary Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code 200 returned without content. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackResourceGroupDelete.json - */ -async function deploymentStacksResourceGroupDelete(): Promise { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] || - "deploymentStacksRG"; - const deploymentStackName = "simpleDeploymentStack"; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential, subscriptionId); - const result = - await client.deploymentStacks.beginDeleteAtResourceGroupAndWait( - resourceGroupName, - deploymentStackName, - ); - console.log(result); -} - -async function main(): Promise { - deploymentStacksResourceGroupDelete(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksDeleteAtSubscriptionSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksDeleteAtSubscriptionSample.ts deleted file mode 100644 index ac69fff6fce6..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksDeleteAtSubscriptionSample.ts +++ /dev/null @@ -1,39 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 returned without content. - * - * @summary Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 returned without content. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackSubscriptionDelete.json - */ -async function deploymentStacksSubscriptionDelete(): Promise { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const deploymentStackName = "simpleDeploymentStack"; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential, subscriptionId); - const result = - await client.deploymentStacks.beginDeleteAtSubscriptionAndWait( - deploymentStackName, - ); - console.log(result); -} - -async function main(): Promise { - deploymentStacksSubscriptionDelete(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksExportTemplateAtManagementGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksExportTemplateAtManagementGroupSample.ts deleted file mode 100644 index 92d15f19e02a..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksExportTemplateAtManagementGroupSample.ts +++ /dev/null @@ -1,37 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Exports the template used to create the Deployment stack at Management Group scope. - * - * @summary Exports the template used to create the Deployment stack at Management Group scope. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackManagementGroupExportTemplate.json - */ -async function deploymentStacksManagementGroupExportTemplate(): Promise { - const managementGroupId = "myMg"; - const deploymentStackName = "simpleDeploymentStack"; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential); - const result = await client.deploymentStacks.exportTemplateAtManagementGroup( - managementGroupId, - deploymentStackName, - ); - console.log(result); -} - -async function main(): Promise { - deploymentStacksManagementGroupExportTemplate(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksExportTemplateAtResourceGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksExportTemplateAtResourceGroupSample.ts deleted file mode 100644 index e119d599bfdd..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksExportTemplateAtResourceGroupSample.ts +++ /dev/null @@ -1,42 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Exports the template used to create the Deployment stack at Resource Group scope. - * - * @summary Exports the template used to create the Deployment stack at Resource Group scope. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackExportTemplate.json - */ -async function deploymentStacksResourceGroupExportTemplate(): Promise { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] || - "deploymentStacksRG"; - const deploymentStackName = "simpleDeploymentStack"; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential, subscriptionId); - const result = await client.deploymentStacks.exportTemplateAtResourceGroup( - resourceGroupName, - deploymentStackName, - ); - console.log(result); -} - -async function main(): Promise { - deploymentStacksResourceGroupExportTemplate(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksExportTemplateAtSubscriptionSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksExportTemplateAtSubscriptionSample.ts deleted file mode 100644 index f5d546786664..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksExportTemplateAtSubscriptionSample.ts +++ /dev/null @@ -1,39 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Exports the template used to create the Deployment stack at Subscription scope. - * - * @summary Exports the template used to create the Deployment stack at Subscription scope. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackSubscriptionExportTemplate.json - */ -async function deploymentStacksSubscriptionExportTemplate(): Promise { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const deploymentStackName = "simpleDeploymentStack"; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential, subscriptionId); - const result = - await client.deploymentStacks.exportTemplateAtSubscription( - deploymentStackName, - ); - console.log(result); -} - -async function main(): Promise { - deploymentStacksSubscriptionExportTemplate(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksGetAtManagementGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksGetAtManagementGroupSample.ts deleted file mode 100644 index 50fac4cf5398..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksGetAtManagementGroupSample.ts +++ /dev/null @@ -1,37 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a Deployment stack with a given name at Management Group scope. - * - * @summary Gets a Deployment stack with a given name at Management Group scope. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackManagementGroupGet.json - */ -async function deploymentStacksManagementGroupGet(): Promise { - const managementGroupId = "myMg"; - const deploymentStackName = "simpleDeploymentStack"; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential); - const result = await client.deploymentStacks.getAtManagementGroup( - managementGroupId, - deploymentStackName, - ); - console.log(result); -} - -async function main(): Promise { - deploymentStacksManagementGroupGet(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksGetAtResourceGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksGetAtResourceGroupSample.ts deleted file mode 100644 index af2da0a1cf53..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksGetAtResourceGroupSample.ts +++ /dev/null @@ -1,42 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a Deployment stack with a given name at Resource Group scope. - * - * @summary Gets a Deployment stack with a given name at Resource Group scope. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackResourceGroupGet.json - */ -async function deploymentStacksResourceGroupGet(): Promise { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] || - "deploymentStacksRG"; - const deploymentStackName = "simpleDeploymentStack"; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential, subscriptionId); - const result = await client.deploymentStacks.getAtResourceGroup( - resourceGroupName, - deploymentStackName, - ); - console.log(result); -} - -async function main(): Promise { - deploymentStacksResourceGroupGet(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksGetAtSubscriptionSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksGetAtSubscriptionSample.ts deleted file mode 100644 index ab9f27f6e57c..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksGetAtSubscriptionSample.ts +++ /dev/null @@ -1,37 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a Deployment stack with a given name at Subscription scope. - * - * @summary Gets a Deployment stack with a given name at Subscription scope. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackSubscriptionGet.json - */ -async function deploymentStacksSubscriptionGet(): Promise { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const deploymentStackName = "simpleDeploymentStack"; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential, subscriptionId); - const result = - await client.deploymentStacks.getAtSubscription(deploymentStackName); - console.log(result); -} - -async function main(): Promise { - deploymentStacksSubscriptionGet(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksListAtManagementGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksListAtManagementGroupSample.ts deleted file mode 100644 index a6d634285dfc..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksListAtManagementGroupSample.ts +++ /dev/null @@ -1,38 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Lists all the Deployment stacks within the specified Management Group. - * - * @summary Lists all the Deployment stacks within the specified Management Group. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackManagementGroupList.json - */ -async function deploymentStacksManagementGroupList(): Promise { - const managementGroupId = "myMg"; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential); - const resArray = new Array(); - for await (let item of client.deploymentStacks.listAtManagementGroup( - managementGroupId, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - deploymentStacksManagementGroupList(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksListAtResourceGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksListAtResourceGroupSample.ts deleted file mode 100644 index 182f95a8d578..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksListAtResourceGroupSample.ts +++ /dev/null @@ -1,43 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Lists all the Deployment stacks within the specified Resource Group. - * - * @summary Lists all the Deployment stacks within the specified Resource Group. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackResourceGroupList.json - */ -async function deploymentStacksResourceGroupList(): Promise { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] || - "deploymentStacksRG"; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.deploymentStacks.listAtResourceGroup( - resourceGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - deploymentStacksResourceGroupList(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksListAtSubscriptionSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksListAtSubscriptionSample.ts deleted file mode 100644 index 9dcbd253b715..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksListAtSubscriptionSample.ts +++ /dev/null @@ -1,38 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Lists all the Deployment stacks within the specified Subscription. - * - * @summary Lists all the Deployment stacks within the specified Subscription. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackSubscriptionList.json - */ -async function deploymentStacksSubscriptionList(): Promise { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.deploymentStacks.listAtSubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - deploymentStacksSubscriptionList(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksValidateStackAtManagementGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksValidateStackAtManagementGroupSample.ts deleted file mode 100644 index e6707a8a43bf..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksValidateStackAtManagementGroupSample.ts +++ /dev/null @@ -1,61 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DeploymentStack, - DeploymentStacksClient, -} from "@azure/arm-resourcesdeploymentstacks"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Runs preflight validation on the Management Group scoped Deployment stack template to verify its acceptance to Azure Resource Manager. - * - * @summary Runs preflight validation on the Management Group scoped Deployment stack template to verify its acceptance to Azure Resource Manager. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackManagementGroupValidate.json - */ -async function deploymentStacksManagementGroupValidate(): Promise { - const managementGroupId = "myMg"; - const deploymentStackName = "simpleDeploymentStack"; - const deploymentStack: DeploymentStack = { - location: "eastus", - properties: { - actionOnUnmanage: { - managementGroups: "detach", - resourceGroups: "detach", - resources: "detach", - }, - denySettings: { - applyToChildScopes: false, - excludedActions: ["action"], - excludedPrincipals: ["principal"], - mode: "denyDelete", - }, - parameters: { parameter1: { value: "a string" } }, - templateLink: { uri: "https://example.com/exampleTemplate.json" }, - }, - tags: { tagkey: "tagVal" }, - }; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential); - const result = - await client.deploymentStacks.beginValidateStackAtManagementGroupAndWait( - managementGroupId, - deploymentStackName, - deploymentStack, - ); - console.log(result); -} - -async function main(): Promise { - deploymentStacksManagementGroupValidate(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksValidateStackAtResourceGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksValidateStackAtResourceGroupSample.ts deleted file mode 100644 index 5be58e24da08..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksValidateStackAtResourceGroupSample.ts +++ /dev/null @@ -1,65 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DeploymentStack, - DeploymentStacksClient, -} from "@azure/arm-resourcesdeploymentstacks"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Runs preflight validation on the Resource Group scoped Deployment stack template to verify its acceptance to Azure Resource Manager. - * - * @summary Runs preflight validation on the Resource Group scoped Deployment stack template to verify its acceptance to Azure Resource Manager. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackResourceGroupValidate.json - */ -async function deploymentStacksResourceGroupValidate(): Promise { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] || - "deploymentStacksRG"; - const deploymentStackName = "simpleDeploymentStack"; - const deploymentStack: DeploymentStack = { - properties: { - actionOnUnmanage: { - managementGroups: "delete", - resourceGroups: "delete", - resources: "delete", - }, - denySettings: { - applyToChildScopes: false, - excludedActions: ["action"], - excludedPrincipals: ["principal"], - mode: "denyDelete", - }, - parameters: { parameter1: { value: "a string" } }, - templateLink: { uri: "https://example.com/exampleTemplate.json" }, - }, - tags: { tagkey: "tagVal" }, - }; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential, subscriptionId); - const result = - await client.deploymentStacks.beginValidateStackAtResourceGroupAndWait( - resourceGroupName, - deploymentStackName, - deploymentStack, - ); - console.log(result); -} - -async function main(): Promise { - deploymentStacksResourceGroupValidate(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksValidateStackAtSubscriptionSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksValidateStackAtSubscriptionSample.ts deleted file mode 100644 index 86970d07a07b..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/src/deploymentStacksValidateStackAtSubscriptionSample.ts +++ /dev/null @@ -1,62 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DeploymentStack, - DeploymentStacksClient, -} from "@azure/arm-resourcesdeploymentstacks"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Runs preflight validation on the Subscription scoped Deployment stack template to verify its acceptance to Azure Resource Manager. - * - * @summary Runs preflight validation on the Subscription scoped Deployment stack template to verify its acceptance to Azure Resource Manager. - * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/DeploymentStackSubscriptionValidate.json - */ -async function deploymentStacksSubscriptionValidate(): Promise { - const subscriptionId = - process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const deploymentStackName = "simpleDeploymentStack"; - const deploymentStack: DeploymentStack = { - location: "eastus", - properties: { - actionOnUnmanage: { - managementGroups: "delete", - resourceGroups: "delete", - resources: "delete", - }, - denySettings: { - applyToChildScopes: false, - excludedActions: ["action"], - excludedPrincipals: ["principal"], - mode: "denyDelete", - }, - parameters: { parameter1: { value: "a string" } }, - templateLink: { uri: "https://example.com/exampleTemplate.json" }, - }, - tags: { tagkey: "tagVal" }, - }; - const credential = new DefaultAzureCredential(); - const client = new DeploymentStacksClient(credential, subscriptionId); - const result = - await client.deploymentStacks.beginValidateStackAtSubscriptionAndWait( - deploymentStackName, - deploymentStack, - ); - console.log(result); -} - -async function main(): Promise { - deploymentStacksSubscriptionValidate(); -} - -main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/tsconfig.json b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/tsconfig.json deleted file mode 100644 index 984eed535aa8..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2020", - "module": "commonjs", - "moduleResolution": "node", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "alwaysStrict": true, - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**/*.ts" - ] -} diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/README.md b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/README.md new file mode 100644 index 000000000000..14717c2c5acd --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/README.md @@ -0,0 +1,114 @@ +# @azure/arm-resourcesdeploymentstacks client library samples for JavaScript + +These sample programs show how to use the JavaScript client libraries for @azure/arm-resourcesdeploymentstacks in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [deploymentStacksCreateOrUpdateAtManagementGroupSample.js][deploymentstackscreateorupdateatmanagementgroupsample] | creates or updates a Deployment stack at the specified scope. x-ms-original-file: 2025-07-01/DeploymentStackManagementGroupCreate.json | +| [deploymentStacksCreateOrUpdateAtResourceGroupSample.js][deploymentstackscreateorupdateatresourcegroupsample] | creates or updates a Deployment stack at the specified scope. x-ms-original-file: 2025-07-01/DeploymentStackResourceGroupCreate.json | +| [deploymentStacksCreateOrUpdateAtSubscriptionSample.js][deploymentstackscreateorupdateatsubscriptionsample] | creates or updates a Deployment stack at the specified scope. x-ms-original-file: 2025-07-01/DeploymentStackSubscriptionCreate.json | +| [deploymentStacksDeleteAtManagementGroupSample.js][deploymentstacksdeleteatmanagementgroupsample] | deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. x-ms-original-file: 2025-07-01/DeploymentStackManagementGroupDelete.json | +| [deploymentStacksDeleteAtResourceGroupSample.js][deploymentstacksdeleteatresourcegroupsample] | deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. x-ms-original-file: 2025-07-01/DeploymentStackResourceGroupDelete.json | +| [deploymentStacksDeleteAtSubscriptionSample.js][deploymentstacksdeleteatsubscriptionsample] | deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. x-ms-original-file: 2025-07-01/DeploymentStackSubscriptionDelete.json | +| [deploymentStacksExportTemplateAtManagementGroupSample.js][deploymentstacksexporttemplateatmanagementgroupsample] | exports the template used to create the Deployment stack at the specified scope. x-ms-original-file: 2025-07-01/DeploymentStackManagementGroupExportTemplate.json | +| [deploymentStacksExportTemplateAtResourceGroupSample.js][deploymentstacksexporttemplateatresourcegroupsample] | exports the template used to create the Deployment stack at the specified scope. x-ms-original-file: 2025-07-01/DeploymentStackExportTemplate.json | +| [deploymentStacksExportTemplateAtSubscriptionSample.js][deploymentstacksexporttemplateatsubscriptionsample] | exports the template used to create the Deployment stack at the specified scope. x-ms-original-file: 2025-07-01/DeploymentStackSubscriptionExportTemplate.json | +| [deploymentStacksGetAtManagementGroupSample.js][deploymentstacksgetatmanagementgroupsample] | gets the Deployment stack with the given name. x-ms-original-file: 2025-07-01/DeploymentStackManagementGroupGet.json | +| [deploymentStacksGetAtResourceGroupSample.js][deploymentstacksgetatresourcegroupsample] | gets the Deployment stack with the given name. x-ms-original-file: 2025-07-01/DeploymentStackResourceGroupGet.json | +| [deploymentStacksGetAtSubscriptionSample.js][deploymentstacksgetatsubscriptionsample] | gets the Deployment stack with the given name. x-ms-original-file: 2025-07-01/DeploymentStackSubscriptionGet.json | +| [deploymentStacksListAtManagementGroupSample.js][deploymentstackslistatmanagementgroupsample] | lists Deployment stacks at the specified scope. x-ms-original-file: 2025-07-01/DeploymentStackManagementGroupList.json | +| [deploymentStacksListAtResourceGroupSample.js][deploymentstackslistatresourcegroupsample] | lists Deployment stacks at the specified scope. x-ms-original-file: 2025-07-01/DeploymentStackResourceGroupList.json | +| [deploymentStacksListAtSubscriptionSample.js][deploymentstackslistatsubscriptionsample] | lists Deployment stacks at the specified scope. x-ms-original-file: 2025-07-01/DeploymentStackSubscriptionList.json | +| [deploymentStacksValidateStackAtManagementGroupSample.js][deploymentstacksvalidatestackatmanagementgroupsample] | runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager. x-ms-original-file: 2025-07-01/DeploymentStackManagementGroupValidate.json | +| [deploymentStacksValidateStackAtResourceGroupSample.js][deploymentstacksvalidatestackatresourcegroupsample] | runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager. x-ms-original-file: 2025-07-01/DeploymentStackResourceGroupValidate.json | +| [deploymentStacksValidateStackAtSubscriptionSample.js][deploymentstacksvalidatestackatsubscriptionsample] | runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager. x-ms-original-file: 2025-07-01/DeploymentStackSubscriptionValidate.json | +| [deploymentStacksWhatIfResultsAtManagementGroupCreateOrUpdateSample.js][deploymentstackswhatifresultsatmanagementgroupcreateorupdatesample] | creates or updates a Deployment stack at the specified scope. x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsManagementGroupCreate.json | +| [deploymentStacksWhatIfResultsAtManagementGroupDeleteSample.js][deploymentstackswhatifresultsatmanagementgroupdeletesample] | deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsManagementGroupDelete.json | +| [deploymentStacksWhatIfResultsAtManagementGroupGetSample.js][deploymentstackswhatifresultsatmanagementgroupgetsample] | gets the Deployment stack with the given name. x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsManagementGroupGet.json | +| [deploymentStacksWhatIfResultsAtManagementGroupListSample.js][deploymentstackswhatifresultsatmanagementgrouplistsample] | lists Deployment stacks at the specified scope. x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsManagementGroupList.json | +| [deploymentStacksWhatIfResultsAtManagementGroupWhatIfSample.js][deploymentstackswhatifresultsatmanagementgroupwhatifsample] | returns property-level changes that will be made by the deployment if executed. x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsManagementGroupWhatIf.json | +| [deploymentStacksWhatIfResultsAtResourceGroupCreateOrUpdateSample.js][deploymentstackswhatifresultsatresourcegroupcreateorupdatesample] | creates or updates a Deployment stack at the specified scope. x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsResourceGroupCreate.json | +| [deploymentStacksWhatIfResultsAtResourceGroupDeleteSample.js][deploymentstackswhatifresultsatresourcegroupdeletesample] | deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsResourceGroupDelete.json | +| [deploymentStacksWhatIfResultsAtResourceGroupGetSample.js][deploymentstackswhatifresultsatresourcegroupgetsample] | gets the Deployment stack with the given name. x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsResourceGroupGet.json | +| [deploymentStacksWhatIfResultsAtResourceGroupListSample.js][deploymentstackswhatifresultsatresourcegrouplistsample] | lists Deployment stacks at the specified scope. x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsResourceGroupList.json | +| [deploymentStacksWhatIfResultsAtResourceGroupWhatIfSample.js][deploymentstackswhatifresultsatresourcegroupwhatifsample] | returns property-level changes that will be made by the deployment if executed. x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsResourceGroupWhatIf.json | +| [deploymentStacksWhatIfResultsAtSubscriptionCreateOrUpdateSample.js][deploymentstackswhatifresultsatsubscriptioncreateorupdatesample] | creates or updates a Deployment stack at the specified scope. x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsSubscriptionCreate.json | +| [deploymentStacksWhatIfResultsAtSubscriptionDeleteSample.js][deploymentstackswhatifresultsatsubscriptiondeletesample] | deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsSubscriptionDelete.json | +| [deploymentStacksWhatIfResultsAtSubscriptionGetSample.js][deploymentstackswhatifresultsatsubscriptiongetsample] | gets the Deployment stack with the given name. x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsSubscriptionGet.json | +| [deploymentStacksWhatIfResultsAtSubscriptionListSample.js][deploymentstackswhatifresultsatsubscriptionlistsample] | lists Deployment stacks at the specified scope. x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsSubscriptionList.json | +| [deploymentStacksWhatIfResultsAtSubscriptionWhatIfSample.js][deploymentstackswhatifresultsatsubscriptionwhatifsample] | returns property-level changes that will be made by the deployment if executed. x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsSubscriptionWhatIf.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +3. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node deploymentStacksCreateOrUpdateAtManagementGroupSample.js +``` + +Alternatively, run a single sample with the required environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +node deploymentStacksCreateOrUpdateAtManagementGroupSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[deploymentstackscreateorupdateatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksCreateOrUpdateAtManagementGroupSample.js +[deploymentstackscreateorupdateatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksCreateOrUpdateAtResourceGroupSample.js +[deploymentstackscreateorupdateatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksCreateOrUpdateAtSubscriptionSample.js +[deploymentstacksdeleteatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksDeleteAtManagementGroupSample.js +[deploymentstacksdeleteatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksDeleteAtResourceGroupSample.js +[deploymentstacksdeleteatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksDeleteAtSubscriptionSample.js +[deploymentstacksexporttemplateatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksExportTemplateAtManagementGroupSample.js +[deploymentstacksexporttemplateatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksExportTemplateAtResourceGroupSample.js +[deploymentstacksexporttemplateatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksExportTemplateAtSubscriptionSample.js +[deploymentstacksgetatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksGetAtManagementGroupSample.js +[deploymentstacksgetatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksGetAtResourceGroupSample.js +[deploymentstacksgetatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksGetAtSubscriptionSample.js +[deploymentstackslistatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksListAtManagementGroupSample.js +[deploymentstackslistatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksListAtResourceGroupSample.js +[deploymentstackslistatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksListAtSubscriptionSample.js +[deploymentstacksvalidatestackatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksValidateStackAtManagementGroupSample.js +[deploymentstacksvalidatestackatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksValidateStackAtResourceGroupSample.js +[deploymentstacksvalidatestackatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksValidateStackAtSubscriptionSample.js +[deploymentstackswhatifresultsatmanagementgroupcreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtManagementGroupCreateOrUpdateSample.js +[deploymentstackswhatifresultsatmanagementgroupdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtManagementGroupDeleteSample.js +[deploymentstackswhatifresultsatmanagementgroupgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtManagementGroupGetSample.js +[deploymentstackswhatifresultsatmanagementgrouplistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtManagementGroupListSample.js +[deploymentstackswhatifresultsatmanagementgroupwhatifsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtManagementGroupWhatIfSample.js +[deploymentstackswhatifresultsatresourcegroupcreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtResourceGroupCreateOrUpdateSample.js +[deploymentstackswhatifresultsatresourcegroupdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtResourceGroupDeleteSample.js +[deploymentstackswhatifresultsatresourcegroupgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtResourceGroupGetSample.js +[deploymentstackswhatifresultsatresourcegrouplistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtResourceGroupListSample.js +[deploymentstackswhatifresultsatresourcegroupwhatifsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtResourceGroupWhatIfSample.js +[deploymentstackswhatifresultsatsubscriptioncreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtSubscriptionCreateOrUpdateSample.js +[deploymentstackswhatifresultsatsubscriptiondeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtSubscriptionDeleteSample.js +[deploymentstackswhatifresultsatsubscriptiongetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtSubscriptionGetSample.js +[deploymentstackswhatifresultsatsubscriptionlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtSubscriptionListSample.js +[deploymentstackswhatifresultsatsubscriptionwhatifsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtSubscriptionWhatIfSample.js +[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-resourcesdeploymentstacks?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/README.md diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksCreateOrUpdateAtManagementGroupSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksCreateOrUpdateAtManagementGroupSample.js new file mode 100644 index 000000000000..99703de60604 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksCreateOrUpdateAtManagementGroupSample.js @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to creates or updates a Deployment stack at the specified scope. + * + * @summary creates or updates a Deployment stack at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackManagementGroupCreate.json + */ +async function createOrUpdateAManagementGroupDeploymentStack() { + const credential = new DefaultAzureCredential(); + const client = new DeploymentStacksClient(credential); + const result = await client.deploymentStacks.createOrUpdateAtManagementGroup( + "myMg", + "simpleDeploymentStack", + { + location: "eastus", + tags: { tagkey: "tagVal" }, + actionOnUnmanage: { + resources: "delete", + resourceGroups: "delete", + managementGroups: "detach", + }, + denySettings: { + mode: "denyDelete", + excludedPrincipals: ["principal"], + excludedActions: ["action"], + applyToChildScopes: false, + }, + parameters: { parameter1: { value: "a string" } }, + extensionConfigs: { + contoso: { + additionalProperties: { + configOne: { value: "config1Value" }, + configTwo: { value: true }, + }, + }, + }, + }, + ); + console.log(result); +} + +async function main() { + await createOrUpdateAManagementGroupDeploymentStack(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksCreateOrUpdateAtResourceGroupSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksCreateOrUpdateAtResourceGroupSample.js new file mode 100644 index 000000000000..8fa97d3644a6 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksCreateOrUpdateAtResourceGroupSample.js @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to creates or updates a Deployment stack at the specified scope. + * + * @summary creates or updates a Deployment stack at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackResourceGroupCreate.json + */ +async function createOrUpdateAResourceGroupDeploymentStack() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacks.createOrUpdateAtResourceGroup( + "deploymentStacksRG", + "simpleDeploymentStack", + { + location: "eastus", + tags: { tagkey: "tagVal" }, + actionOnUnmanage: { + resources: "delete", + resourceGroups: "delete", + managementGroups: "detach", + }, + denySettings: { + mode: "denyDelete", + excludedPrincipals: ["principal"], + excludedActions: ["action"], + applyToChildScopes: false, + }, + parameters: { parameter1: { value: "a string" } }, + extensionConfigs: { + contoso: { + additionalProperties: { + configOne: { value: "config1Value" }, + configTwo: { value: true }, + }, + }, + }, + }, + ); + console.log(result); +} + +async function main() { + await createOrUpdateAResourceGroupDeploymentStack(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksCreateOrUpdateAtSubscriptionSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksCreateOrUpdateAtSubscriptionSample.js new file mode 100644 index 000000000000..e2bc87515ae3 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksCreateOrUpdateAtSubscriptionSample.js @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to creates or updates a Deployment stack at the specified scope. + * + * @summary creates or updates a Deployment stack at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackSubscriptionCreate.json + */ +async function createOrUpdateASubscriptionDeploymentStack() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacks.createOrUpdateAtSubscription( + "simpleDeploymentStack", + { + location: "eastus", + tags: { tagkey: "tagVal" }, + actionOnUnmanage: { + resources: "delete", + resourceGroups: "delete", + managementGroups: "detach", + }, + denySettings: { + mode: "denyDelete", + excludedPrincipals: ["principal"], + excludedActions: ["action"], + applyToChildScopes: false, + }, + parameters: { parameter1: { value: "a string" } }, + extensionConfigs: { + contoso: { + additionalProperties: { + configOne: { value: "config1Value" }, + configTwo: { value: true }, + }, + }, + }, + }, + ); + console.log(result); +} + +async function main() { + await createOrUpdateASubscriptionDeploymentStack(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksDeleteAtManagementGroupSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksDeleteAtManagementGroupSample.js new file mode 100644 index 000000000000..20dc1852e104 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksDeleteAtManagementGroupSample.js @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * + * @summary deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * x-ms-original-file: 2025-07-01/DeploymentStackManagementGroupDelete.json + */ +async function deleteAManagementGroupDeploymentStack() { + const credential = new DefaultAzureCredential(); + const client = new DeploymentStacksClient(credential); + await client.deploymentStacks.deleteAtManagementGroup("myMg", "simpleDeploymentStack"); +} + +async function main() { + await deleteAManagementGroupDeploymentStack(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksDeleteAtResourceGroupSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksDeleteAtResourceGroupSample.js new file mode 100644 index 000000000000..ca4b8c824ecc --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksDeleteAtResourceGroupSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * + * @summary deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * x-ms-original-file: 2025-07-01/DeploymentStackResourceGroupDelete.json + */ +async function deleteAResourceGroupDeploymentStack() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + await client.deploymentStacks.deleteAtResourceGroup( + "deploymentStacksRG", + "simpleDeploymentStack", + ); +} + +async function main() { + await deleteAResourceGroupDeploymentStack(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksDeleteAtSubscriptionSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksDeleteAtSubscriptionSample.js new file mode 100644 index 000000000000..7ba4b2071d4b --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksDeleteAtSubscriptionSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * + * @summary deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * x-ms-original-file: 2025-07-01/DeploymentStackSubscriptionDelete.json + */ +async function deleteASubscriptionDeploymentStack() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + await client.deploymentStacks.deleteAtSubscription("simpleDeploymentStack"); +} + +async function main() { + await deleteASubscriptionDeploymentStack(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksExportTemplateAtManagementGroupSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksExportTemplateAtManagementGroupSample.js new file mode 100644 index 000000000000..f9752b23d131 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksExportTemplateAtManagementGroupSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to exports the template used to create the Deployment stack at the specified scope. + * + * @summary exports the template used to create the Deployment stack at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackManagementGroupExportTemplate.json + */ +async function exportTheDeploymentTemplateForAManagementGroupDeploymentStack() { + const credential = new DefaultAzureCredential(); + const client = new DeploymentStacksClient(credential); + const result = await client.deploymentStacks.exportTemplateAtManagementGroup( + "myMg", + "simpleDeploymentStack", + ); + console.log(result); +} + +async function main() { + await exportTheDeploymentTemplateForAManagementGroupDeploymentStack(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksExportTemplateAtResourceGroupSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksExportTemplateAtResourceGroupSample.js new file mode 100644 index 000000000000..2835d4850a90 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksExportTemplateAtResourceGroupSample.js @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to exports the template used to create the Deployment stack at the specified scope. + * + * @summary exports the template used to create the Deployment stack at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackExportTemplate.json + */ +async function exportTheDeploymentTemplateForAResourceGroupDeploymentStack() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacks.exportTemplateAtResourceGroup( + "deploymentStacksRG", + "simpleDeploymentStack", + ); + console.log(result); +} + +async function main() { + await exportTheDeploymentTemplateForAResourceGroupDeploymentStack(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksExportTemplateAtSubscriptionSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksExportTemplateAtSubscriptionSample.js new file mode 100644 index 000000000000..388739284f7b --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksExportTemplateAtSubscriptionSample.js @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to exports the template used to create the Deployment stack at the specified scope. + * + * @summary exports the template used to create the Deployment stack at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackSubscriptionExportTemplate.json + */ +async function exportTheDeploymentTemplateForASubscriptionDeploymentStack() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = + await client.deploymentStacks.exportTemplateAtSubscription("simpleDeploymentStack"); + console.log(result); +} + +async function main() { + await exportTheDeploymentTemplateForASubscriptionDeploymentStack(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksGetAtManagementGroupSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksGetAtManagementGroupSample.js new file mode 100644 index 000000000000..721d048617f0 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksGetAtManagementGroupSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets the Deployment stack with the given name. + * + * @summary gets the Deployment stack with the given name. + * x-ms-original-file: 2025-07-01/DeploymentStackManagementGroupGet.json + */ +async function getAManagementGroupDeploymentStack() { + const credential = new DefaultAzureCredential(); + const client = new DeploymentStacksClient(credential); + const result = await client.deploymentStacks.getAtManagementGroup( + "myMg", + "simpleDeploymentStack", + ); + console.log(result); +} + +async function main() { + await getAManagementGroupDeploymentStack(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksGetAtResourceGroupSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksGetAtResourceGroupSample.js new file mode 100644 index 000000000000..3c0ca5dbda22 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksGetAtResourceGroupSample.js @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets the Deployment stack with the given name. + * + * @summary gets the Deployment stack with the given name. + * x-ms-original-file: 2025-07-01/DeploymentStackResourceGroupGet.json + */ +async function getAResourceGroupDeploymentStack() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacks.getAtResourceGroup( + "deploymentStacksRG", + "simpleDeploymentStack", + ); + console.log(result); +} + +async function main() { + await getAResourceGroupDeploymentStack(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksGetAtSubscriptionSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksGetAtSubscriptionSample.js new file mode 100644 index 000000000000..b69291a515bb --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksGetAtSubscriptionSample.js @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets the Deployment stack with the given name. + * + * @summary gets the Deployment stack with the given name. + * x-ms-original-file: 2025-07-01/DeploymentStackSubscriptionGet.json + */ +async function getASubscriptionDeploymentStack() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacks.getAtSubscription("simpleDeploymentStack"); + console.log(result); +} + +async function main() { + await getASubscriptionDeploymentStack(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksListAtManagementGroupSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksListAtManagementGroupSample.js new file mode 100644 index 000000000000..a481be3f0581 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksListAtManagementGroupSample.js @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to lists Deployment stacks at the specified scope. + * + * @summary lists Deployment stacks at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackManagementGroupList.json + */ +async function listManagementGroupDeploymentStacks() { + const credential = new DefaultAzureCredential(); + const client = new DeploymentStacksClient(credential); + const resArray = new Array(); + for await (const item of client.deploymentStacks.listAtManagementGroup("myMg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await listManagementGroupDeploymentStacks(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksListAtResourceGroupSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksListAtResourceGroupSample.js new file mode 100644 index 000000000000..a8adffb9a196 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksListAtResourceGroupSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to lists Deployment stacks at the specified scope. + * + * @summary lists Deployment stacks at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackResourceGroupList.json + */ +async function listResourceGroupDeploymentStacks() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.deploymentStacks.listAtResourceGroup("deploymentStacksRG")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await listResourceGroupDeploymentStacks(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksListAtSubscriptionSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksListAtSubscriptionSample.js new file mode 100644 index 000000000000..993688cf1b7f --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksListAtSubscriptionSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to lists Deployment stacks at the specified scope. + * + * @summary lists Deployment stacks at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackSubscriptionList.json + */ +async function listSubscriptionDeploymentStacks() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.deploymentStacks.listAtSubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await listSubscriptionDeploymentStacks(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksValidateStackAtManagementGroupSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksValidateStackAtManagementGroupSample.js new file mode 100644 index 000000000000..c39e0ec55cc7 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksValidateStackAtManagementGroupSample.js @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager. + * + * @summary runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager. + * x-ms-original-file: 2025-07-01/DeploymentStackManagementGroupValidate.json + */ +async function validateAManagementGroupDeploymentStack() { + const credential = new DefaultAzureCredential(); + const client = new DeploymentStacksClient(credential); + const result = await client.deploymentStacks.validateStackAtManagementGroup( + "myMg", + "simpleDeploymentStack", + { + location: "eastus", + tags: { tagkey: "tagVal" }, + actionOnUnmanage: { + resources: "detach", + resourceGroups: "detach", + managementGroups: "detach", + }, + denySettings: { + mode: "denyDelete", + excludedPrincipals: ["principal"], + excludedActions: ["action"], + applyToChildScopes: false, + }, + templateLink: { uri: "https://example.com/exampleTemplate.json" }, + parameters: { parameter1: { value: "a string" } }, + }, + ); + console.log(result); +} + +async function main() { + await validateAManagementGroupDeploymentStack(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksValidateStackAtResourceGroupSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksValidateStackAtResourceGroupSample.js new file mode 100644 index 000000000000..38288f147e5e --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksValidateStackAtResourceGroupSample.js @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager. + * + * @summary runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager. + * x-ms-original-file: 2025-07-01/DeploymentStackResourceGroupValidate.json + */ +async function validateAResourceGroupDeploymentStack() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacks.validateStackAtResourceGroup( + "deploymentStacksRG", + "simpleDeploymentStack", + { + tags: { tagkey: "tagVal" }, + actionOnUnmanage: { + resources: "delete", + resourceGroups: "delete", + managementGroups: "delete", + }, + denySettings: { + mode: "denyDelete", + excludedPrincipals: ["principal"], + excludedActions: ["action"], + applyToChildScopes: false, + }, + templateLink: { uri: "https://example.com/exampleTemplate.json" }, + parameters: { parameter1: { value: "a string" } }, + }, + ); + console.log(result); +} + +async function main() { + await validateAResourceGroupDeploymentStack(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksValidateStackAtSubscriptionSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksValidateStackAtSubscriptionSample.js new file mode 100644 index 000000000000..c04ec319b935 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksValidateStackAtSubscriptionSample.js @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager. + * + * @summary runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager. + * x-ms-original-file: 2025-07-01/DeploymentStackSubscriptionValidate.json + */ +async function validateASubscriptionDeploymentStack() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacks.validateStackAtSubscription( + "simpleDeploymentStack", + { + location: "eastus", + tags: { tagkey: "tagVal" }, + actionOnUnmanage: { + resources: "delete", + resourceGroups: "delete", + managementGroups: "delete", + }, + denySettings: { + mode: "denyDelete", + excludedPrincipals: ["principal"], + excludedActions: ["action"], + applyToChildScopes: false, + }, + templateLink: { uri: "https://example.com/exampleTemplate.json" }, + parameters: { parameter1: { value: "a string" } }, + }, + ); + console.log(result); +} + +async function main() { + await validateASubscriptionDeploymentStack(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtManagementGroupCreateOrUpdateSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtManagementGroupCreateOrUpdateSample.js new file mode 100644 index 000000000000..f4553d0ae09b --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtManagementGroupCreateOrUpdateSample.js @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to creates or updates a Deployment stack at the specified scope. + * + * @summary creates or updates a Deployment stack at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsManagementGroupCreate.json + */ +async function createOrUpdateAManagementGroupDeploymentStackWhatIfResult() { + const credential = new DefaultAzureCredential(); + const client = new DeploymentStacksClient(credential); + const result = await client.deploymentStacksWhatIfResultsAtManagementGroup.createOrUpdate( + "myMg", + "simpleDeploymentStackWhatIfResult", + { + location: "eastus", + properties: { + deploymentStackResourceId: + "/providers/Microsoft.Management/managementGroups/myMg/providers/Microsoft.Resources/deploymentStacks/simpleDeploymentStack", + retentionInterval: "P7D", + templateLink: { uri: "https://example.com/exampleTemplate.json" }, + parameters: {}, + actionOnUnmanage: { + resources: "delete", + resourceGroups: "delete", + managementGroups: "detach", + }, + denySettings: { mode: "none", applyToChildScopes: false }, + extensionConfigs: { + contoso: { + additionalProperties: { + configOne: { value: "config1Value" }, + configTwo: { value: true }, + }, + }, + }, + }, + }, + ); + console.log(result); +} + +async function main() { + await createOrUpdateAManagementGroupDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtManagementGroupDeleteSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtManagementGroupDeleteSample.js new file mode 100644 index 000000000000..43bb0885d3b7 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtManagementGroupDeleteSample.js @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * + * @summary deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsManagementGroupDelete.json + */ +async function deleteAManagementGroupDeploymentStackWhatIfResult() { + const credential = new DefaultAzureCredential(); + const client = new DeploymentStacksClient(credential); + await client.deploymentStacksWhatIfResultsAtManagementGroup.delete( + "myMg", + "simpleDeploymentStack", + ); +} + +async function main() { + await deleteAManagementGroupDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtManagementGroupGetSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtManagementGroupGetSample.js new file mode 100644 index 000000000000..85101c6b880f --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtManagementGroupGetSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets the Deployment stack with the given name. + * + * @summary gets the Deployment stack with the given name. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsManagementGroupGet.json + */ +async function getAManagementGroupDeploymentStackWhatIfResult() { + const credential = new DefaultAzureCredential(); + const client = new DeploymentStacksClient(credential); + const result = await client.deploymentStacksWhatIfResultsAtManagementGroup.get( + "myMg", + "simpleDeploymentStackWhatIfResult", + ); + console.log(result); +} + +async function main() { + await getAManagementGroupDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtManagementGroupListSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtManagementGroupListSample.js new file mode 100644 index 000000000000..67aa35727d58 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtManagementGroupListSample.js @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to lists Deployment stacks at the specified scope. + * + * @summary lists Deployment stacks at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsManagementGroupList.json + */ +async function listTheAvailableDeploymentStackWhatIfResultsAtManagementGroupScope() { + const credential = new DefaultAzureCredential(); + const client = new DeploymentStacksClient(credential); + const resArray = new Array(); + for await (const item of client.deploymentStacksWhatIfResultsAtManagementGroup.list("myMg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await listTheAvailableDeploymentStackWhatIfResultsAtManagementGroupScope(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtManagementGroupWhatIfSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtManagementGroupWhatIfSample.js new file mode 100644 index 000000000000..c06ea1a1fe92 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtManagementGroupWhatIfSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to returns property-level changes that will be made by the deployment if executed. + * + * @summary returns property-level changes that will be made by the deployment if executed. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsManagementGroupWhatIf.json + */ +async function getADetailedManagementGroupDeploymentStackWhatIfResult() { + const credential = new DefaultAzureCredential(); + const client = new DeploymentStacksClient(credential); + const result = await client.deploymentStacksWhatIfResultsAtManagementGroup.whatIf( + "myMg", + "changedDeploymentStackWhatIfResult", + ); + console.log(result); +} + +async function main() { + await getADetailedManagementGroupDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtResourceGroupCreateOrUpdateSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtResourceGroupCreateOrUpdateSample.js new file mode 100644 index 000000000000..e1f3fc5d9aa4 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtResourceGroupCreateOrUpdateSample.js @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to creates or updates a Deployment stack at the specified scope. + * + * @summary creates or updates a Deployment stack at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsResourceGroupCreate.json + */ +async function createOrUpdateAResourceGroupScopedDeploymentStackWhatIfResult() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacksWhatIfResultsAtResourceGroup.createOrUpdate( + "myResourceGroup", + "simpleDeploymentStackWhatIfResult", + { + location: "eastus", + properties: { + deploymentStackResourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Resources/deploymentStacks/simpleDeploymentStack", + retentionInterval: "P7D", + templateLink: { uri: "https://example.com/exampleTemplate.json" }, + parameters: {}, + actionOnUnmanage: { + resources: "delete", + resourceGroups: "delete", + managementGroups: "detach", + }, + denySettings: { mode: "none", applyToChildScopes: false }, + extensionConfigs: { + contoso: { + additionalProperties: { + configOne: { value: "config1Value" }, + configTwo: { value: true }, + }, + }, + }, + }, + }, + ); + console.log(result); +} + +async function main() { + await createOrUpdateAResourceGroupScopedDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtResourceGroupDeleteSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtResourceGroupDeleteSample.js new file mode 100644 index 000000000000..794bf81b1f0b --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtResourceGroupDeleteSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * + * @summary deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsResourceGroupDelete.json + */ +async function deleteAResourceGroupDeploymentStackWhatIfResult() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + await client.deploymentStacksWhatIfResultsAtResourceGroup.delete( + "myResourceGroup", + "simpleDeploymentStack", + ); +} + +async function main() { + await deleteAResourceGroupDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtResourceGroupGetSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtResourceGroupGetSample.js new file mode 100644 index 000000000000..a043c41cde26 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtResourceGroupGetSample.js @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets the Deployment stack with the given name. + * + * @summary gets the Deployment stack with the given name. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsResourceGroupGet.json + */ +async function getAResourceGroupDeploymentStackWhatIfResult() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacksWhatIfResultsAtResourceGroup.get( + "myResourceGroup", + "simpleDeploymentStackWhatIfResult", + ); + console.log(result); +} + +async function main() { + await getAResourceGroupDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtResourceGroupListSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtResourceGroupListSample.js new file mode 100644 index 000000000000..58f82e0e06f1 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtResourceGroupListSample.js @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to lists Deployment stacks at the specified scope. + * + * @summary lists Deployment stacks at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsResourceGroupList.json + */ +async function listTheAvailableDeploymentStackWhatIfResultsAtResourceGroupScope() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.deploymentStacksWhatIfResultsAtResourceGroup.list( + "myResourceGroup", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await listTheAvailableDeploymentStackWhatIfResultsAtResourceGroupScope(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtResourceGroupWhatIfSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtResourceGroupWhatIfSample.js new file mode 100644 index 000000000000..fa77de0b37d0 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtResourceGroupWhatIfSample.js @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to returns property-level changes that will be made by the deployment if executed. + * + * @summary returns property-level changes that will be made by the deployment if executed. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsResourceGroupWhatIf.json + */ +async function getADetailedResourceGroupDeploymentStackWhatIfResult() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacksWhatIfResultsAtResourceGroup.whatIf( + "myResourceGroup", + "changedDeploymentStackWhatIfResult", + ); + console.log(result); +} + +async function main() { + await getADetailedResourceGroupDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtSubscriptionCreateOrUpdateSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtSubscriptionCreateOrUpdateSample.js new file mode 100644 index 000000000000..20d637d75f34 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtSubscriptionCreateOrUpdateSample.js @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to creates or updates a Deployment stack at the specified scope. + * + * @summary creates or updates a Deployment stack at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsSubscriptionCreate.json + */ +async function createOrUpdateASubscriptionScopedDeploymentStackWhatIfResult() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacksWhatIfResultsAtSubscription.createOrUpdate( + "simpleDeploymentStackWhatIfResult", + { + location: "eastus", + properties: { + deploymentStackResourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deploymentStacks/simpleDeploymentStack", + retentionInterval: "P7D", + templateLink: { uri: "https://example.com/exampleTemplate.json" }, + parameters: {}, + actionOnUnmanage: { + resources: "delete", + resourceGroups: "delete", + managementGroups: "detach", + }, + denySettings: { mode: "none", applyToChildScopes: false }, + extensionConfigs: { + contoso: { + additionalProperties: { + configOne: { value: "config1Value" }, + configTwo: { value: true }, + }, + }, + }, + }, + }, + ); + console.log(result); +} + +async function main() { + await createOrUpdateASubscriptionScopedDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtSubscriptionDeleteSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtSubscriptionDeleteSample.js new file mode 100644 index 000000000000..e81c40da2223 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtSubscriptionDeleteSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * + * @summary deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsSubscriptionDelete.json + */ +async function deleteASubscriptionDeploymentStackWhatIfResult() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + await client.deploymentStacksWhatIfResultsAtSubscription.delete("simpleDeploymentStack"); +} + +async function main() { + await deleteASubscriptionDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtSubscriptionGetSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtSubscriptionGetSample.js new file mode 100644 index 000000000000..2a47281fa861 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtSubscriptionGetSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets the Deployment stack with the given name. + * + * @summary gets the Deployment stack with the given name. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsSubscriptionGet.json + */ +async function getASubscriptionDeploymentStackWhatIfResult() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacksWhatIfResultsAtSubscription.get( + "simpleDeploymentStackWhatIfResult", + ); + console.log(result); +} + +async function main() { + await getASubscriptionDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtSubscriptionListSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtSubscriptionListSample.js new file mode 100644 index 000000000000..630e9ea7c3f6 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtSubscriptionListSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to lists Deployment stacks at the specified scope. + * + * @summary lists Deployment stacks at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsSubscriptionList.json + */ +async function listTheAvailableDeploymentStackWhatIfResultsAtSubscriptionScope() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.deploymentStacksWhatIfResultsAtSubscription.list()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await listTheAvailableDeploymentStackWhatIfResultsAtSubscriptionScope(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtSubscriptionWhatIfSample.js b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtSubscriptionWhatIfSample.js new file mode 100644 index 000000000000..c71a6da4f3ff --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/deploymentStacksWhatIfResultsAtSubscriptionWhatIfSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to returns property-level changes that will be made by the deployment if executed. + * + * @summary returns property-level changes that will be made by the deployment if executed. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsSubscriptionWhatIf.json + */ +async function getADetailedSubscriptionDeploymentStackWhatIfResult() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacksWhatIfResultsAtSubscription.whatIf( + "changedDeploymentStackWhatIfResult", + ); + console.log(result); +} + +async function main() { + await getADetailedSubscriptionDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/package.json b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/package.json similarity index 80% rename from sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/package.json rename to sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/package.json index 778a1322c760..4f7a0fc6b063 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/javascript/package.json +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/package.json @@ -2,7 +2,7 @@ "name": "@azure-samples/arm-resourcesdeploymentstacks-js", "private": true, "version": "1.0.0", - "description": " client library samples for JavaScript", + "description": "@azure/arm-resourcesdeploymentstacks client library samples for JavaScript", "engines": { "node": ">=20.0.0" }, @@ -14,6 +14,7 @@ "keywords": [ "node", "azure", + "cloud", "typescript", "browser", "isomorphic" @@ -27,6 +28,9 @@ "dependencies": { "@azure/arm-resourcesdeploymentstacks": "latest", "dotenv": "latest", - "@azure/identity": "^4.2.1" + "@azure/identity": "^4.13.0" + }, + "devDependencies": { + "cross-env": "latest" } } diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/sample.env b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/sample.env new file mode 100644 index 000000000000..508439fc7d62 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/javascript/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/README.md b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/README.md new file mode 100644 index 000000000000..6fbe385dbf0f --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/README.md @@ -0,0 +1,127 @@ +# @azure/arm-resourcesdeploymentstacks client library samples for TypeScript + +These sample programs show how to use the TypeScript client libraries for @azure/arm-resourcesdeploymentstacks in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [deploymentStacksCreateOrUpdateAtManagementGroupSample.ts][deploymentstackscreateorupdateatmanagementgroupsample] | creates or updates a Deployment stack at the specified scope. x-ms-original-file: 2025-07-01/DeploymentStackManagementGroupCreate.json | +| [deploymentStacksCreateOrUpdateAtResourceGroupSample.ts][deploymentstackscreateorupdateatresourcegroupsample] | creates or updates a Deployment stack at the specified scope. x-ms-original-file: 2025-07-01/DeploymentStackResourceGroupCreate.json | +| [deploymentStacksCreateOrUpdateAtSubscriptionSample.ts][deploymentstackscreateorupdateatsubscriptionsample] | creates or updates a Deployment stack at the specified scope. x-ms-original-file: 2025-07-01/DeploymentStackSubscriptionCreate.json | +| [deploymentStacksDeleteAtManagementGroupSample.ts][deploymentstacksdeleteatmanagementgroupsample] | deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. x-ms-original-file: 2025-07-01/DeploymentStackManagementGroupDelete.json | +| [deploymentStacksDeleteAtResourceGroupSample.ts][deploymentstacksdeleteatresourcegroupsample] | deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. x-ms-original-file: 2025-07-01/DeploymentStackResourceGroupDelete.json | +| [deploymentStacksDeleteAtSubscriptionSample.ts][deploymentstacksdeleteatsubscriptionsample] | deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. x-ms-original-file: 2025-07-01/DeploymentStackSubscriptionDelete.json | +| [deploymentStacksExportTemplateAtManagementGroupSample.ts][deploymentstacksexporttemplateatmanagementgroupsample] | exports the template used to create the Deployment stack at the specified scope. x-ms-original-file: 2025-07-01/DeploymentStackManagementGroupExportTemplate.json | +| [deploymentStacksExportTemplateAtResourceGroupSample.ts][deploymentstacksexporttemplateatresourcegroupsample] | exports the template used to create the Deployment stack at the specified scope. x-ms-original-file: 2025-07-01/DeploymentStackExportTemplate.json | +| [deploymentStacksExportTemplateAtSubscriptionSample.ts][deploymentstacksexporttemplateatsubscriptionsample] | exports the template used to create the Deployment stack at the specified scope. x-ms-original-file: 2025-07-01/DeploymentStackSubscriptionExportTemplate.json | +| [deploymentStacksGetAtManagementGroupSample.ts][deploymentstacksgetatmanagementgroupsample] | gets the Deployment stack with the given name. x-ms-original-file: 2025-07-01/DeploymentStackManagementGroupGet.json | +| [deploymentStacksGetAtResourceGroupSample.ts][deploymentstacksgetatresourcegroupsample] | gets the Deployment stack with the given name. x-ms-original-file: 2025-07-01/DeploymentStackResourceGroupGet.json | +| [deploymentStacksGetAtSubscriptionSample.ts][deploymentstacksgetatsubscriptionsample] | gets the Deployment stack with the given name. x-ms-original-file: 2025-07-01/DeploymentStackSubscriptionGet.json | +| [deploymentStacksListAtManagementGroupSample.ts][deploymentstackslistatmanagementgroupsample] | lists Deployment stacks at the specified scope. x-ms-original-file: 2025-07-01/DeploymentStackManagementGroupList.json | +| [deploymentStacksListAtResourceGroupSample.ts][deploymentstackslistatresourcegroupsample] | lists Deployment stacks at the specified scope. x-ms-original-file: 2025-07-01/DeploymentStackResourceGroupList.json | +| [deploymentStacksListAtSubscriptionSample.ts][deploymentstackslistatsubscriptionsample] | lists Deployment stacks at the specified scope. x-ms-original-file: 2025-07-01/DeploymentStackSubscriptionList.json | +| [deploymentStacksValidateStackAtManagementGroupSample.ts][deploymentstacksvalidatestackatmanagementgroupsample] | runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager. x-ms-original-file: 2025-07-01/DeploymentStackManagementGroupValidate.json | +| [deploymentStacksValidateStackAtResourceGroupSample.ts][deploymentstacksvalidatestackatresourcegroupsample] | runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager. x-ms-original-file: 2025-07-01/DeploymentStackResourceGroupValidate.json | +| [deploymentStacksValidateStackAtSubscriptionSample.ts][deploymentstacksvalidatestackatsubscriptionsample] | runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager. x-ms-original-file: 2025-07-01/DeploymentStackSubscriptionValidate.json | +| [deploymentStacksWhatIfResultsAtManagementGroupCreateOrUpdateSample.ts][deploymentstackswhatifresultsatmanagementgroupcreateorupdatesample] | creates or updates a Deployment stack at the specified scope. x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsManagementGroupCreate.json | +| [deploymentStacksWhatIfResultsAtManagementGroupDeleteSample.ts][deploymentstackswhatifresultsatmanagementgroupdeletesample] | deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsManagementGroupDelete.json | +| [deploymentStacksWhatIfResultsAtManagementGroupGetSample.ts][deploymentstackswhatifresultsatmanagementgroupgetsample] | gets the Deployment stack with the given name. x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsManagementGroupGet.json | +| [deploymentStacksWhatIfResultsAtManagementGroupListSample.ts][deploymentstackswhatifresultsatmanagementgrouplistsample] | lists Deployment stacks at the specified scope. x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsManagementGroupList.json | +| [deploymentStacksWhatIfResultsAtManagementGroupWhatIfSample.ts][deploymentstackswhatifresultsatmanagementgroupwhatifsample] | returns property-level changes that will be made by the deployment if executed. x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsManagementGroupWhatIf.json | +| [deploymentStacksWhatIfResultsAtResourceGroupCreateOrUpdateSample.ts][deploymentstackswhatifresultsatresourcegroupcreateorupdatesample] | creates or updates a Deployment stack at the specified scope. x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsResourceGroupCreate.json | +| [deploymentStacksWhatIfResultsAtResourceGroupDeleteSample.ts][deploymentstackswhatifresultsatresourcegroupdeletesample] | deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsResourceGroupDelete.json | +| [deploymentStacksWhatIfResultsAtResourceGroupGetSample.ts][deploymentstackswhatifresultsatresourcegroupgetsample] | gets the Deployment stack with the given name. x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsResourceGroupGet.json | +| [deploymentStacksWhatIfResultsAtResourceGroupListSample.ts][deploymentstackswhatifresultsatresourcegrouplistsample] | lists Deployment stacks at the specified scope. x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsResourceGroupList.json | +| [deploymentStacksWhatIfResultsAtResourceGroupWhatIfSample.ts][deploymentstackswhatifresultsatresourcegroupwhatifsample] | returns property-level changes that will be made by the deployment if executed. x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsResourceGroupWhatIf.json | +| [deploymentStacksWhatIfResultsAtSubscriptionCreateOrUpdateSample.ts][deploymentstackswhatifresultsatsubscriptioncreateorupdatesample] | creates or updates a Deployment stack at the specified scope. x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsSubscriptionCreate.json | +| [deploymentStacksWhatIfResultsAtSubscriptionDeleteSample.ts][deploymentstackswhatifresultsatsubscriptiondeletesample] | deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsSubscriptionDelete.json | +| [deploymentStacksWhatIfResultsAtSubscriptionGetSample.ts][deploymentstackswhatifresultsatsubscriptiongetsample] | gets the Deployment stack with the given name. x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsSubscriptionGet.json | +| [deploymentStacksWhatIfResultsAtSubscriptionListSample.ts][deploymentstackswhatifresultsatsubscriptionlistsample] | lists Deployment stacks at the specified scope. x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsSubscriptionList.json | +| [deploymentStacksWhatIfResultsAtSubscriptionWhatIfSample.ts][deploymentstackswhatifresultsatsubscriptionwhatifsample] | returns property-level changes that will be made by the deployment if executed. x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsSubscriptionWhatIf.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). + +Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: + +```bash +npm install -g typescript +``` + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Compile the samples: + +```bash +npm run build +``` + +3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +4. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node dist/deploymentStacksCreateOrUpdateAtManagementGroupSample.js +``` + +Alternatively, run a single sample with the required environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +node dist/deploymentStacksCreateOrUpdateAtManagementGroupSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[deploymentstackscreateorupdateatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksCreateOrUpdateAtManagementGroupSample.ts +[deploymentstackscreateorupdateatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksCreateOrUpdateAtResourceGroupSample.ts +[deploymentstackscreateorupdateatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksCreateOrUpdateAtSubscriptionSample.ts +[deploymentstacksdeleteatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksDeleteAtManagementGroupSample.ts +[deploymentstacksdeleteatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksDeleteAtResourceGroupSample.ts +[deploymentstacksdeleteatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksDeleteAtSubscriptionSample.ts +[deploymentstacksexporttemplateatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksExportTemplateAtManagementGroupSample.ts +[deploymentstacksexporttemplateatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksExportTemplateAtResourceGroupSample.ts +[deploymentstacksexporttemplateatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksExportTemplateAtSubscriptionSample.ts +[deploymentstacksgetatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksGetAtManagementGroupSample.ts +[deploymentstacksgetatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksGetAtResourceGroupSample.ts +[deploymentstacksgetatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksGetAtSubscriptionSample.ts +[deploymentstackslistatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksListAtManagementGroupSample.ts +[deploymentstackslistatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksListAtResourceGroupSample.ts +[deploymentstackslistatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksListAtSubscriptionSample.ts +[deploymentstacksvalidatestackatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksValidateStackAtManagementGroupSample.ts +[deploymentstacksvalidatestackatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksValidateStackAtResourceGroupSample.ts +[deploymentstacksvalidatestackatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksValidateStackAtSubscriptionSample.ts +[deploymentstackswhatifresultsatmanagementgroupcreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtManagementGroupCreateOrUpdateSample.ts +[deploymentstackswhatifresultsatmanagementgroupdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtManagementGroupDeleteSample.ts +[deploymentstackswhatifresultsatmanagementgroupgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtManagementGroupGetSample.ts +[deploymentstackswhatifresultsatmanagementgrouplistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtManagementGroupListSample.ts +[deploymentstackswhatifresultsatmanagementgroupwhatifsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtManagementGroupWhatIfSample.ts +[deploymentstackswhatifresultsatresourcegroupcreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtResourceGroupCreateOrUpdateSample.ts +[deploymentstackswhatifresultsatresourcegroupdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtResourceGroupDeleteSample.ts +[deploymentstackswhatifresultsatresourcegroupgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtResourceGroupGetSample.ts +[deploymentstackswhatifresultsatresourcegrouplistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtResourceGroupListSample.ts +[deploymentstackswhatifresultsatresourcegroupwhatifsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtResourceGroupWhatIfSample.ts +[deploymentstackswhatifresultsatsubscriptioncreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtSubscriptionCreateOrUpdateSample.ts +[deploymentstackswhatifresultsatsubscriptiondeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtSubscriptionDeleteSample.ts +[deploymentstackswhatifresultsatsubscriptiongetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtSubscriptionGetSample.ts +[deploymentstackswhatifresultsatsubscriptionlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtSubscriptionListSample.ts +[deploymentstackswhatifresultsatsubscriptionwhatifsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtSubscriptionWhatIfSample.ts +[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-resourcesdeploymentstacks?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/README.md +[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/package.json b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/package.json similarity index 80% rename from sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/package.json rename to sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/package.json index 743bc60dd8a0..e04e50e1d38d 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1/typescript/package.json +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/package.json @@ -2,7 +2,7 @@ "name": "@azure-samples/arm-resourcesdeploymentstacks-ts", "private": true, "version": "1.0.0", - "description": " client library samples for TypeScript", + "description": "@azure/arm-resourcesdeploymentstacks client library samples for TypeScript", "engines": { "node": ">=20.0.0" }, @@ -18,6 +18,7 @@ "keywords": [ "node", "azure", + "cloud", "typescript", "browser", "isomorphic" @@ -31,11 +32,12 @@ "dependencies": { "@azure/arm-resourcesdeploymentstacks": "latest", "dotenv": "latest", - "@azure/identity": "^4.2.1" + "@azure/identity": "^4.13.0" }, "devDependencies": { "@types/node": "^20.0.0", - "typescript": "~5.8.2", - "rimraf": "latest" + "cross-env": "latest", + "rimraf": "latest", + "typescript": "~5.9.3" } } diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/sample.env b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/sample.env new file mode 100644 index 000000000000..508439fc7d62 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksCreateOrUpdateAtManagementGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksCreateOrUpdateAtManagementGroupSample.ts new file mode 100644 index 000000000000..1b58c9f344f7 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksCreateOrUpdateAtManagementGroupSample.ts @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates or updates a Deployment stack at the specified scope. + * + * @summary creates or updates a Deployment stack at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackManagementGroupCreate.json + */ +async function createOrUpdateAManagementGroupDeploymentStack(): Promise { + const credential = new DefaultAzureCredential(); + const client = new DeploymentStacksClient(credential); + const result = await client.deploymentStacks.createOrUpdateAtManagementGroup( + "myMg", + "simpleDeploymentStack", + { + location: "eastus", + tags: { tagkey: "tagVal" }, + actionOnUnmanage: { + resources: "delete", + resourceGroups: "delete", + managementGroups: "detach", + }, + denySettings: { + mode: "denyDelete", + excludedPrincipals: ["principal"], + excludedActions: ["action"], + applyToChildScopes: false, + }, + parameters: { parameter1: { value: "a string" } }, + extensionConfigs: { + contoso: { + additionalProperties: { + configOne: { value: "config1Value" }, + configTwo: { value: true }, + }, + }, + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateAManagementGroupDeploymentStack(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksCreateOrUpdateAtResourceGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksCreateOrUpdateAtResourceGroupSample.ts new file mode 100644 index 000000000000..f9afe7631eee --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksCreateOrUpdateAtResourceGroupSample.ts @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates or updates a Deployment stack at the specified scope. + * + * @summary creates or updates a Deployment stack at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackResourceGroupCreate.json + */ +async function createOrUpdateAResourceGroupDeploymentStack(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacks.createOrUpdateAtResourceGroup( + "deploymentStacksRG", + "simpleDeploymentStack", + { + location: "eastus", + tags: { tagkey: "tagVal" }, + actionOnUnmanage: { + resources: "delete", + resourceGroups: "delete", + managementGroups: "detach", + }, + denySettings: { + mode: "denyDelete", + excludedPrincipals: ["principal"], + excludedActions: ["action"], + applyToChildScopes: false, + }, + parameters: { parameter1: { value: "a string" } }, + extensionConfigs: { + contoso: { + additionalProperties: { + configOne: { value: "config1Value" }, + configTwo: { value: true }, + }, + }, + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateAResourceGroupDeploymentStack(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksCreateOrUpdateAtSubscriptionSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksCreateOrUpdateAtSubscriptionSample.ts new file mode 100644 index 000000000000..5cb702a2d153 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksCreateOrUpdateAtSubscriptionSample.ts @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates or updates a Deployment stack at the specified scope. + * + * @summary creates or updates a Deployment stack at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackSubscriptionCreate.json + */ +async function createOrUpdateASubscriptionDeploymentStack(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacks.createOrUpdateAtSubscription( + "simpleDeploymentStack", + { + location: "eastus", + tags: { tagkey: "tagVal" }, + actionOnUnmanage: { + resources: "delete", + resourceGroups: "delete", + managementGroups: "detach", + }, + denySettings: { + mode: "denyDelete", + excludedPrincipals: ["principal"], + excludedActions: ["action"], + applyToChildScopes: false, + }, + parameters: { parameter1: { value: "a string" } }, + extensionConfigs: { + contoso: { + additionalProperties: { + configOne: { value: "config1Value" }, + configTwo: { value: true }, + }, + }, + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateASubscriptionDeploymentStack(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksDeleteAtManagementGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksDeleteAtManagementGroupSample.ts new file mode 100644 index 000000000000..d9e4f724dc1c --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksDeleteAtManagementGroupSample.ts @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * + * @summary deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * x-ms-original-file: 2025-07-01/DeploymentStackManagementGroupDelete.json + */ +async function deleteAManagementGroupDeploymentStack(): Promise { + const credential = new DefaultAzureCredential(); + const client = new DeploymentStacksClient(credential); + await client.deploymentStacks.deleteAtManagementGroup("myMg", "simpleDeploymentStack"); +} + +async function main(): Promise { + await deleteAManagementGroupDeploymentStack(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksDeleteAtResourceGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksDeleteAtResourceGroupSample.ts new file mode 100644 index 000000000000..8d6cc5fd0375 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksDeleteAtResourceGroupSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * + * @summary deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * x-ms-original-file: 2025-07-01/DeploymentStackResourceGroupDelete.json + */ +async function deleteAResourceGroupDeploymentStack(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + await client.deploymentStacks.deleteAtResourceGroup( + "deploymentStacksRG", + "simpleDeploymentStack", + ); +} + +async function main(): Promise { + await deleteAResourceGroupDeploymentStack(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksDeleteAtSubscriptionSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksDeleteAtSubscriptionSample.ts new file mode 100644 index 000000000000..fdd363932362 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksDeleteAtSubscriptionSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * + * @summary deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * x-ms-original-file: 2025-07-01/DeploymentStackSubscriptionDelete.json + */ +async function deleteASubscriptionDeploymentStack(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + await client.deploymentStacks.deleteAtSubscription("simpleDeploymentStack"); +} + +async function main(): Promise { + await deleteASubscriptionDeploymentStack(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksExportTemplateAtManagementGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksExportTemplateAtManagementGroupSample.ts new file mode 100644 index 000000000000..9edf771b893d --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksExportTemplateAtManagementGroupSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to exports the template used to create the Deployment stack at the specified scope. + * + * @summary exports the template used to create the Deployment stack at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackManagementGroupExportTemplate.json + */ +async function exportTheDeploymentTemplateForAManagementGroupDeploymentStack(): Promise { + const credential = new DefaultAzureCredential(); + const client = new DeploymentStacksClient(credential); + const result = await client.deploymentStacks.exportTemplateAtManagementGroup( + "myMg", + "simpleDeploymentStack", + ); + console.log(result); +} + +async function main(): Promise { + await exportTheDeploymentTemplateForAManagementGroupDeploymentStack(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksExportTemplateAtResourceGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksExportTemplateAtResourceGroupSample.ts new file mode 100644 index 000000000000..30bf7a603336 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksExportTemplateAtResourceGroupSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to exports the template used to create the Deployment stack at the specified scope. + * + * @summary exports the template used to create the Deployment stack at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackExportTemplate.json + */ +async function exportTheDeploymentTemplateForAResourceGroupDeploymentStack(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacks.exportTemplateAtResourceGroup( + "deploymentStacksRG", + "simpleDeploymentStack", + ); + console.log(result); +} + +async function main(): Promise { + await exportTheDeploymentTemplateForAResourceGroupDeploymentStack(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksExportTemplateAtSubscriptionSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksExportTemplateAtSubscriptionSample.ts new file mode 100644 index 000000000000..ef5d0b91342c --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksExportTemplateAtSubscriptionSample.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to exports the template used to create the Deployment stack at the specified scope. + * + * @summary exports the template used to create the Deployment stack at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackSubscriptionExportTemplate.json + */ +async function exportTheDeploymentTemplateForASubscriptionDeploymentStack(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = + await client.deploymentStacks.exportTemplateAtSubscription("simpleDeploymentStack"); + console.log(result); +} + +async function main(): Promise { + await exportTheDeploymentTemplateForASubscriptionDeploymentStack(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksGetAtManagementGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksGetAtManagementGroupSample.ts new file mode 100644 index 000000000000..fcf9397afdbf --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksGetAtManagementGroupSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the Deployment stack with the given name. + * + * @summary gets the Deployment stack with the given name. + * x-ms-original-file: 2025-07-01/DeploymentStackManagementGroupGet.json + */ +async function getAManagementGroupDeploymentStack(): Promise { + const credential = new DefaultAzureCredential(); + const client = new DeploymentStacksClient(credential); + const result = await client.deploymentStacks.getAtManagementGroup( + "myMg", + "simpleDeploymentStack", + ); + console.log(result); +} + +async function main(): Promise { + await getAManagementGroupDeploymentStack(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksGetAtResourceGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksGetAtResourceGroupSample.ts new file mode 100644 index 000000000000..6de3aca56c6b --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksGetAtResourceGroupSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the Deployment stack with the given name. + * + * @summary gets the Deployment stack with the given name. + * x-ms-original-file: 2025-07-01/DeploymentStackResourceGroupGet.json + */ +async function getAResourceGroupDeploymentStack(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacks.getAtResourceGroup( + "deploymentStacksRG", + "simpleDeploymentStack", + ); + console.log(result); +} + +async function main(): Promise { + await getAResourceGroupDeploymentStack(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksGetAtSubscriptionSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksGetAtSubscriptionSample.ts new file mode 100644 index 000000000000..986c41e03e2b --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksGetAtSubscriptionSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the Deployment stack with the given name. + * + * @summary gets the Deployment stack with the given name. + * x-ms-original-file: 2025-07-01/DeploymentStackSubscriptionGet.json + */ +async function getASubscriptionDeploymentStack(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacks.getAtSubscription("simpleDeploymentStack"); + console.log(result); +} + +async function main(): Promise { + await getASubscriptionDeploymentStack(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksListAtManagementGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksListAtManagementGroupSample.ts new file mode 100644 index 000000000000..fc2340a4c3e0 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksListAtManagementGroupSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists Deployment stacks at the specified scope. + * + * @summary lists Deployment stacks at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackManagementGroupList.json + */ +async function listManagementGroupDeploymentStacks(): Promise { + const credential = new DefaultAzureCredential(); + const client = new DeploymentStacksClient(credential); + const resArray = new Array(); + for await (const item of client.deploymentStacks.listAtManagementGroup("myMg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listManagementGroupDeploymentStacks(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksListAtResourceGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksListAtResourceGroupSample.ts new file mode 100644 index 000000000000..86b248c3674f --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksListAtResourceGroupSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists Deployment stacks at the specified scope. + * + * @summary lists Deployment stacks at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackResourceGroupList.json + */ +async function listResourceGroupDeploymentStacks(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.deploymentStacks.listAtResourceGroup("deploymentStacksRG")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listResourceGroupDeploymentStacks(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksListAtSubscriptionSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksListAtSubscriptionSample.ts new file mode 100644 index 000000000000..49ed9047a09d --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksListAtSubscriptionSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists Deployment stacks at the specified scope. + * + * @summary lists Deployment stacks at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackSubscriptionList.json + */ +async function listSubscriptionDeploymentStacks(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.deploymentStacks.listAtSubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listSubscriptionDeploymentStacks(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksValidateStackAtManagementGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksValidateStackAtManagementGroupSample.ts new file mode 100644 index 000000000000..3c4aa0ba3aa5 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksValidateStackAtManagementGroupSample.ts @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager. + * + * @summary runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager. + * x-ms-original-file: 2025-07-01/DeploymentStackManagementGroupValidate.json + */ +async function validateAManagementGroupDeploymentStack(): Promise { + const credential = new DefaultAzureCredential(); + const client = new DeploymentStacksClient(credential); + const result = await client.deploymentStacks.validateStackAtManagementGroup( + "myMg", + "simpleDeploymentStack", + { + location: "eastus", + tags: { tagkey: "tagVal" }, + actionOnUnmanage: { + resources: "detach", + resourceGroups: "detach", + managementGroups: "detach", + }, + denySettings: { + mode: "denyDelete", + excludedPrincipals: ["principal"], + excludedActions: ["action"], + applyToChildScopes: false, + }, + templateLink: { uri: "https://example.com/exampleTemplate.json" }, + parameters: { parameter1: { value: "a string" } }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await validateAManagementGroupDeploymentStack(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksValidateStackAtResourceGroupSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksValidateStackAtResourceGroupSample.ts new file mode 100644 index 000000000000..745586e69389 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksValidateStackAtResourceGroupSample.ts @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager. + * + * @summary runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager. + * x-ms-original-file: 2025-07-01/DeploymentStackResourceGroupValidate.json + */ +async function validateAResourceGroupDeploymentStack(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacks.validateStackAtResourceGroup( + "deploymentStacksRG", + "simpleDeploymentStack", + { + tags: { tagkey: "tagVal" }, + actionOnUnmanage: { + resources: "delete", + resourceGroups: "delete", + managementGroups: "delete", + }, + denySettings: { + mode: "denyDelete", + excludedPrincipals: ["principal"], + excludedActions: ["action"], + applyToChildScopes: false, + }, + templateLink: { uri: "https://example.com/exampleTemplate.json" }, + parameters: { parameter1: { value: "a string" } }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await validateAResourceGroupDeploymentStack(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksValidateStackAtSubscriptionSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksValidateStackAtSubscriptionSample.ts new file mode 100644 index 000000000000..3808f779d721 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksValidateStackAtSubscriptionSample.ts @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager. + * + * @summary runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager. + * x-ms-original-file: 2025-07-01/DeploymentStackSubscriptionValidate.json + */ +async function validateASubscriptionDeploymentStack(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacks.validateStackAtSubscription( + "simpleDeploymentStack", + { + location: "eastus", + tags: { tagkey: "tagVal" }, + actionOnUnmanage: { + resources: "delete", + resourceGroups: "delete", + managementGroups: "delete", + }, + denySettings: { + mode: "denyDelete", + excludedPrincipals: ["principal"], + excludedActions: ["action"], + applyToChildScopes: false, + }, + templateLink: { uri: "https://example.com/exampleTemplate.json" }, + parameters: { parameter1: { value: "a string" } }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await validateASubscriptionDeploymentStack(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtManagementGroupCreateOrUpdateSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtManagementGroupCreateOrUpdateSample.ts new file mode 100644 index 000000000000..6bd071852907 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtManagementGroupCreateOrUpdateSample.ts @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates or updates a Deployment stack at the specified scope. + * + * @summary creates or updates a Deployment stack at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsManagementGroupCreate.json + */ +async function createOrUpdateAManagementGroupDeploymentStackWhatIfResult(): Promise { + const credential = new DefaultAzureCredential(); + const client = new DeploymentStacksClient(credential); + const result = await client.deploymentStacksWhatIfResultsAtManagementGroup.createOrUpdate( + "myMg", + "simpleDeploymentStackWhatIfResult", + { + location: "eastus", + properties: { + deploymentStackResourceId: + "/providers/Microsoft.Management/managementGroups/myMg/providers/Microsoft.Resources/deploymentStacks/simpleDeploymentStack", + retentionInterval: "P7D", + templateLink: { uri: "https://example.com/exampleTemplate.json" }, + parameters: {}, + actionOnUnmanage: { + resources: "delete", + resourceGroups: "delete", + managementGroups: "detach", + }, + denySettings: { mode: "none", applyToChildScopes: false }, + extensionConfigs: { + contoso: { + additionalProperties: { + configOne: { value: "config1Value" }, + configTwo: { value: true }, + }, + }, + }, + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateAManagementGroupDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtManagementGroupDeleteSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtManagementGroupDeleteSample.ts new file mode 100644 index 000000000000..fde69d685e74 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtManagementGroupDeleteSample.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * + * @summary deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsManagementGroupDelete.json + */ +async function deleteAManagementGroupDeploymentStackWhatIfResult(): Promise { + const credential = new DefaultAzureCredential(); + const client = new DeploymentStacksClient(credential); + await client.deploymentStacksWhatIfResultsAtManagementGroup.delete( + "myMg", + "simpleDeploymentStack", + ); +} + +async function main(): Promise { + await deleteAManagementGroupDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtManagementGroupGetSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtManagementGroupGetSample.ts new file mode 100644 index 000000000000..5242d79318e5 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtManagementGroupGetSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the Deployment stack with the given name. + * + * @summary gets the Deployment stack with the given name. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsManagementGroupGet.json + */ +async function getAManagementGroupDeploymentStackWhatIfResult(): Promise { + const credential = new DefaultAzureCredential(); + const client = new DeploymentStacksClient(credential); + const result = await client.deploymentStacksWhatIfResultsAtManagementGroup.get( + "myMg", + "simpleDeploymentStackWhatIfResult", + ); + console.log(result); +} + +async function main(): Promise { + await getAManagementGroupDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtManagementGroupListSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtManagementGroupListSample.ts new file mode 100644 index 000000000000..5f744bca9c96 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtManagementGroupListSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists Deployment stacks at the specified scope. + * + * @summary lists Deployment stacks at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsManagementGroupList.json + */ +async function listTheAvailableDeploymentStackWhatIfResultsAtManagementGroupScope(): Promise { + const credential = new DefaultAzureCredential(); + const client = new DeploymentStacksClient(credential); + const resArray = new Array(); + for await (const item of client.deploymentStacksWhatIfResultsAtManagementGroup.list("myMg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listTheAvailableDeploymentStackWhatIfResultsAtManagementGroupScope(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtManagementGroupWhatIfSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtManagementGroupWhatIfSample.ts new file mode 100644 index 000000000000..142dae4b414a --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtManagementGroupWhatIfSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to returns property-level changes that will be made by the deployment if executed. + * + * @summary returns property-level changes that will be made by the deployment if executed. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsManagementGroupWhatIf.json + */ +async function getADetailedManagementGroupDeploymentStackWhatIfResult(): Promise { + const credential = new DefaultAzureCredential(); + const client = new DeploymentStacksClient(credential); + const result = await client.deploymentStacksWhatIfResultsAtManagementGroup.whatIf( + "myMg", + "changedDeploymentStackWhatIfResult", + ); + console.log(result); +} + +async function main(): Promise { + await getADetailedManagementGroupDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtResourceGroupCreateOrUpdateSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtResourceGroupCreateOrUpdateSample.ts new file mode 100644 index 000000000000..884bf3014dd5 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtResourceGroupCreateOrUpdateSample.ts @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates or updates a Deployment stack at the specified scope. + * + * @summary creates or updates a Deployment stack at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsResourceGroupCreate.json + */ +async function createOrUpdateAResourceGroupScopedDeploymentStackWhatIfResult(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacksWhatIfResultsAtResourceGroup.createOrUpdate( + "myResourceGroup", + "simpleDeploymentStackWhatIfResult", + { + location: "eastus", + properties: { + deploymentStackResourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Resources/deploymentStacks/simpleDeploymentStack", + retentionInterval: "P7D", + templateLink: { uri: "https://example.com/exampleTemplate.json" }, + parameters: {}, + actionOnUnmanage: { + resources: "delete", + resourceGroups: "delete", + managementGroups: "detach", + }, + denySettings: { mode: "none", applyToChildScopes: false }, + extensionConfigs: { + contoso: { + additionalProperties: { + configOne: { value: "config1Value" }, + configTwo: { value: true }, + }, + }, + }, + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateAResourceGroupScopedDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtResourceGroupDeleteSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtResourceGroupDeleteSample.ts new file mode 100644 index 000000000000..8363d8c52a74 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtResourceGroupDeleteSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * + * @summary deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsResourceGroupDelete.json + */ +async function deleteAResourceGroupDeploymentStackWhatIfResult(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + await client.deploymentStacksWhatIfResultsAtResourceGroup.delete( + "myResourceGroup", + "simpleDeploymentStack", + ); +} + +async function main(): Promise { + await deleteAResourceGroupDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtResourceGroupGetSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtResourceGroupGetSample.ts new file mode 100644 index 000000000000..a0682b9230ba --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtResourceGroupGetSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the Deployment stack with the given name. + * + * @summary gets the Deployment stack with the given name. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsResourceGroupGet.json + */ +async function getAResourceGroupDeploymentStackWhatIfResult(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacksWhatIfResultsAtResourceGroup.get( + "myResourceGroup", + "simpleDeploymentStackWhatIfResult", + ); + console.log(result); +} + +async function main(): Promise { + await getAResourceGroupDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtResourceGroupListSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtResourceGroupListSample.ts new file mode 100644 index 000000000000..733e468df9d5 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtResourceGroupListSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists Deployment stacks at the specified scope. + * + * @summary lists Deployment stacks at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsResourceGroupList.json + */ +async function listTheAvailableDeploymentStackWhatIfResultsAtResourceGroupScope(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.deploymentStacksWhatIfResultsAtResourceGroup.list( + "myResourceGroup", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listTheAvailableDeploymentStackWhatIfResultsAtResourceGroupScope(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtResourceGroupWhatIfSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtResourceGroupWhatIfSample.ts new file mode 100644 index 000000000000..c171e8d7fa3e --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtResourceGroupWhatIfSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to returns property-level changes that will be made by the deployment if executed. + * + * @summary returns property-level changes that will be made by the deployment if executed. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsResourceGroupWhatIf.json + */ +async function getADetailedResourceGroupDeploymentStackWhatIfResult(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacksWhatIfResultsAtResourceGroup.whatIf( + "myResourceGroup", + "changedDeploymentStackWhatIfResult", + ); + console.log(result); +} + +async function main(): Promise { + await getADetailedResourceGroupDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtSubscriptionCreateOrUpdateSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtSubscriptionCreateOrUpdateSample.ts new file mode 100644 index 000000000000..61a746d51556 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtSubscriptionCreateOrUpdateSample.ts @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates or updates a Deployment stack at the specified scope. + * + * @summary creates or updates a Deployment stack at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsSubscriptionCreate.json + */ +async function createOrUpdateASubscriptionScopedDeploymentStackWhatIfResult(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacksWhatIfResultsAtSubscription.createOrUpdate( + "simpleDeploymentStackWhatIfResult", + { + location: "eastus", + properties: { + deploymentStackResourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deploymentStacks/simpleDeploymentStack", + retentionInterval: "P7D", + templateLink: { uri: "https://example.com/exampleTemplate.json" }, + parameters: {}, + actionOnUnmanage: { + resources: "delete", + resourceGroups: "delete", + managementGroups: "detach", + }, + denySettings: { mode: "none", applyToChildScopes: false }, + extensionConfigs: { + contoso: { + additionalProperties: { + configOne: { value: "config1Value" }, + configTwo: { value: true }, + }, + }, + }, + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateASubscriptionScopedDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtSubscriptionDeleteSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtSubscriptionDeleteSample.ts new file mode 100644 index 000000000000..f8be7e30cf7e --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtSubscriptionDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * + * @summary deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsSubscriptionDelete.json + */ +async function deleteASubscriptionDeploymentStackWhatIfResult(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + await client.deploymentStacksWhatIfResultsAtSubscription.delete("simpleDeploymentStack"); +} + +async function main(): Promise { + await deleteASubscriptionDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtSubscriptionGetSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtSubscriptionGetSample.ts new file mode 100644 index 000000000000..6c9c7870edb3 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtSubscriptionGetSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the Deployment stack with the given name. + * + * @summary gets the Deployment stack with the given name. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsSubscriptionGet.json + */ +async function getASubscriptionDeploymentStackWhatIfResult(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacksWhatIfResultsAtSubscription.get( + "simpleDeploymentStackWhatIfResult", + ); + console.log(result); +} + +async function main(): Promise { + await getASubscriptionDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtSubscriptionListSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtSubscriptionListSample.ts new file mode 100644 index 000000000000..285e6d942c9a --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtSubscriptionListSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists Deployment stacks at the specified scope. + * + * @summary lists Deployment stacks at the specified scope. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsSubscriptionList.json + */ +async function listTheAvailableDeploymentStackWhatIfResultsAtSubscriptionScope(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.deploymentStacksWhatIfResultsAtSubscription.list()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listTheAvailableDeploymentStackWhatIfResultsAtSubscriptionScope(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtSubscriptionWhatIfSample.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtSubscriptionWhatIfSample.ts new file mode 100644 index 000000000000..5aa3ee4db50c --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/src/deploymentStacksWhatIfResultsAtSubscriptionWhatIfSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to returns property-level changes that will be made by the deployment if executed. + * + * @summary returns property-level changes that will be made by the deployment if executed. + * x-ms-original-file: 2025-07-01/DeploymentStackWhatIfResultsSubscriptionWhatIf.json + */ +async function getADetailedSubscriptionDeploymentStackWhatIfResult(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DeploymentStacksClient(credential, subscriptionId); + const result = await client.deploymentStacksWhatIfResultsAtSubscription.whatIf( + "changedDeploymentStackWhatIfResult", + ); + console.log(result); +} + +async function main(): Promise { + await getADetailedSubscriptionDeploymentStackWhatIfResult(); +} + +main().catch(console.error); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/tsconfig.json b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/tsconfig.json new file mode 100644 index 000000000000..400db87cf648 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v2/typescript/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "target": "ES2023", + "module": "commonjs", + "lib": [], + "importHelpers": true, + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "moduleResolution": "node10", + "esModuleInterop": true, + "outDir": "./dist", + "resolveJsonModule": true + }, + "include": [ + "./src" + ] +} diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacks/index.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacks/index.ts new file mode 100644 index 000000000000..7058f55316c7 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacks/index.ts @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + exportTemplateAtManagementGroup, + deleteAtManagementGroup, + createOrUpdateAtManagementGroup, + validateStackAtManagementGroup, + listAtManagementGroup, + getAtManagementGroup, + exportTemplateAtSubscription, + deleteAtSubscription, + createOrUpdateAtSubscription, + validateStackAtSubscription, + listAtSubscription, + getAtSubscription, + exportTemplateAtResourceGroup, + deleteAtResourceGroup, + createOrUpdateAtResourceGroup, + validateStackAtResourceGroup, + listAtResourceGroup, + getAtResourceGroup, +} from "./operations.js"; +export { + DeploymentStacksExportTemplateAtManagementGroupOptionalParams, + DeploymentStacksDeleteAtManagementGroupOptionalParams, + DeploymentStacksCreateOrUpdateAtManagementGroupOptionalParams, + DeploymentStacksValidateStackAtManagementGroupOptionalParams, + DeploymentStacksListAtManagementGroupOptionalParams, + DeploymentStacksGetAtManagementGroupOptionalParams, + DeploymentStacksExportTemplateAtSubscriptionOptionalParams, + DeploymentStacksDeleteAtSubscriptionOptionalParams, + DeploymentStacksCreateOrUpdateAtSubscriptionOptionalParams, + DeploymentStacksValidateStackAtSubscriptionOptionalParams, + DeploymentStacksListAtSubscriptionOptionalParams, + DeploymentStacksGetAtSubscriptionOptionalParams, + DeploymentStacksExportTemplateAtResourceGroupOptionalParams, + DeploymentStacksDeleteAtResourceGroupOptionalParams, + DeploymentStacksCreateOrUpdateAtResourceGroupOptionalParams, + DeploymentStacksValidateStackAtResourceGroupOptionalParams, + DeploymentStacksListAtResourceGroupOptionalParams, + DeploymentStacksGetAtResourceGroupOptionalParams, +} from "./options.js"; diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacks/operations.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacks/operations.ts new file mode 100644 index 000000000000..48556a3ba55a --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacks/operations.ts @@ -0,0 +1,1042 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { DeploymentStacksContext as Client } from "../index.js"; +import type { + DeploymentStack, + _DeploymentStackListResult, + DeploymentStackValidateResult, + DeploymentStackTemplateDefinition, +} from "../../models/models.js"; +import { + errorResponseDeserializer, + deploymentStackSerializer, + deploymentStackDeserializer, + _deploymentStackListResultDeserializer, + deploymentStackValidateResultDeserializer, + deploymentStackTemplateDefinitionDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + DeploymentStacksExportTemplateAtManagementGroupOptionalParams, + DeploymentStacksDeleteAtManagementGroupOptionalParams, + DeploymentStacksCreateOrUpdateAtManagementGroupOptionalParams, + DeploymentStacksValidateStackAtManagementGroupOptionalParams, + DeploymentStacksListAtManagementGroupOptionalParams, + DeploymentStacksGetAtManagementGroupOptionalParams, + DeploymentStacksExportTemplateAtSubscriptionOptionalParams, + DeploymentStacksDeleteAtSubscriptionOptionalParams, + DeploymentStacksCreateOrUpdateAtSubscriptionOptionalParams, + DeploymentStacksValidateStackAtSubscriptionOptionalParams, + DeploymentStacksListAtSubscriptionOptionalParams, + DeploymentStacksGetAtSubscriptionOptionalParams, + DeploymentStacksExportTemplateAtResourceGroupOptionalParams, + DeploymentStacksDeleteAtResourceGroupOptionalParams, + DeploymentStacksCreateOrUpdateAtResourceGroupOptionalParams, + DeploymentStacksValidateStackAtResourceGroupOptionalParams, + DeploymentStacksListAtResourceGroupOptionalParams, + DeploymentStacksGetAtResourceGroupOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +export function _exportTemplateAtManagementGroupSend( + context: Client, + managementGroupId: string, + deploymentStackName: string, + options: DeploymentStacksExportTemplateAtManagementGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/exportTemplate{?api%2Dversion}", + { + managementGroupId: managementGroupId, + deploymentStackName: deploymentStackName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _exportTemplateAtManagementGroupDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return deploymentStackTemplateDefinitionDeserializer(result.body); +} + +/** Exports the template used to create the Deployment stack at the specified scope. */ +export async function exportTemplateAtManagementGroup( + context: Client, + managementGroupId: string, + deploymentStackName: string, + options: DeploymentStacksExportTemplateAtManagementGroupOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _exportTemplateAtManagementGroupSend( + context, + managementGroupId, + deploymentStackName, + options, + ); + return _exportTemplateAtManagementGroupDeserialize(result); +} + +export function _deleteAtManagementGroupSend( + context: Client, + managementGroupId: string, + deploymentStackName: string, + options: DeploymentStacksDeleteAtManagementGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}{?api%2Dversion,unmanageAction.Resources,unmanageAction.ResourceGroups,unmanageAction.ManagementGroups,unmanageAction.ResourcesWithoutDeleteSupport,bypassStackOutOfSyncError}", + { + managementGroupId: managementGroupId, + deploymentStackName: deploymentStackName, + "api%2Dversion": context.apiVersion, + "unmanageAction.Resources": options?.unmanageActionResources, + "unmanageAction.ResourceGroups": options?.unmanageActionResourceGroups, + "unmanageAction.ManagementGroups": options?.unmanageActionManagementGroups, + "unmanageAction.ResourcesWithoutDeleteSupport": + options?.unmanageActionResourcesWithoutDeleteSupport, + bypassStackOutOfSyncError: options?.bypassStackOutOfSyncError, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _deleteAtManagementGroupDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. */ +export function deleteAtManagementGroup( + context: Client, + managementGroupId: string, + deploymentStackName: string, + options: DeploymentStacksDeleteAtManagementGroupOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _deleteAtManagementGroupDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _deleteAtManagementGroupSend(context, managementGroupId, deploymentStackName, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _createOrUpdateAtManagementGroupSend( + context: Client, + managementGroupId: string, + deploymentStackName: string, + deploymentStack: DeploymentStack, + options: DeploymentStacksCreateOrUpdateAtManagementGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}{?api%2Dversion}", + { + managementGroupId: managementGroupId, + deploymentStackName: deploymentStackName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: deploymentStackSerializer(deploymentStack), + }); +} + +export async function _createOrUpdateAtManagementGroupDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return deploymentStackDeserializer(result.body); +} + +/** Creates or updates a Deployment stack at the specified scope. */ +export function createOrUpdateAtManagementGroup( + context: Client, + managementGroupId: string, + deploymentStackName: string, + deploymentStack: DeploymentStack, + options: DeploymentStacksCreateOrUpdateAtManagementGroupOptionalParams = { requestOptions: {} }, +): PollerLike, DeploymentStack> { + return getLongRunningPoller( + context, + _createOrUpdateAtManagementGroupDeserialize, + ["200", "201", "202"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateAtManagementGroupSend( + context, + managementGroupId, + deploymentStackName, + deploymentStack, + options, + ), + resourceLocationConfig: "azure-async-operation", + }, + ) as PollerLike, DeploymentStack>; +} + +export function _validateStackAtManagementGroupSend( + context: Client, + managementGroupId: string, + deploymentStackName: string, + deploymentStack: DeploymentStack, + options: DeploymentStacksValidateStackAtManagementGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/validate{?api%2Dversion}", + { + managementGroupId: managementGroupId, + deploymentStackName: deploymentStackName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: deploymentStackSerializer(deploymentStack), + }); +} + +export async function _validateStackAtManagementGroupDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200", "400", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return deploymentStackValidateResultDeserializer(result.body); +} + +/** Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager. */ +export function validateStackAtManagementGroup( + context: Client, + managementGroupId: string, + deploymentStackName: string, + deploymentStack: DeploymentStack, + options: DeploymentStacksValidateStackAtManagementGroupOptionalParams = { requestOptions: {} }, +): PollerLike, DeploymentStackValidateResult> { + return getLongRunningPoller( + context, + _validateStackAtManagementGroupDeserialize, + ["202", "200", "400", "201"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _validateStackAtManagementGroupSend( + context, + managementGroupId, + deploymentStackName, + deploymentStack, + options, + ), + resourceLocationConfig: "location", + }, + ) as PollerLike, DeploymentStackValidateResult>; +} + +export function _listAtManagementGroupSend( + context: Client, + managementGroupId: string, + options: DeploymentStacksListAtManagementGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks{?api%2Dversion}", + { + managementGroupId: managementGroupId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listAtManagementGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_DeploymentStackListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _deploymentStackListResultDeserializer(result.body); +} + +/** Lists Deployment stacks at the specified scope. */ +export function listAtManagementGroup( + context: Client, + managementGroupId: string, + options: DeploymentStacksListAtManagementGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listAtManagementGroupSend(context, managementGroupId, options), + _listAtManagementGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _getAtManagementGroupSend( + context: Client, + managementGroupId: string, + deploymentStackName: string, + options: DeploymentStacksGetAtManagementGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}{?api%2Dversion}", + { + managementGroupId: managementGroupId, + deploymentStackName: deploymentStackName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getAtManagementGroupDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return deploymentStackDeserializer(result.body); +} + +/** Gets the Deployment stack with the given name. */ +export async function getAtManagementGroup( + context: Client, + managementGroupId: string, + deploymentStackName: string, + options: DeploymentStacksGetAtManagementGroupOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getAtManagementGroupSend( + context, + managementGroupId, + deploymentStackName, + options, + ); + return _getAtManagementGroupDeserialize(result); +} + +export function _exportTemplateAtSubscriptionSend( + context: Client, + deploymentStackName: string, + options: DeploymentStacksExportTemplateAtSubscriptionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/exportTemplate{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + deploymentStackName: deploymentStackName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _exportTemplateAtSubscriptionDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return deploymentStackTemplateDefinitionDeserializer(result.body); +} + +/** Exports the template used to create the Deployment stack at the specified scope. */ +export async function exportTemplateAtSubscription( + context: Client, + deploymentStackName: string, + options: DeploymentStacksExportTemplateAtSubscriptionOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _exportTemplateAtSubscriptionSend(context, deploymentStackName, options); + return _exportTemplateAtSubscriptionDeserialize(result); +} + +export function _deleteAtSubscriptionSend( + context: Client, + deploymentStackName: string, + options: DeploymentStacksDeleteAtSubscriptionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}{?api%2Dversion,unmanageAction.Resources,unmanageAction.ResourceGroups,unmanageAction.ManagementGroups,unmanageAction.ResourcesWithoutDeleteSupport,bypassStackOutOfSyncError}", + { + subscriptionId: context.subscriptionId, + deploymentStackName: deploymentStackName, + "api%2Dversion": context.apiVersion, + "unmanageAction.Resources": options?.unmanageActionResources, + "unmanageAction.ResourceGroups": options?.unmanageActionResourceGroups, + "unmanageAction.ManagementGroups": options?.unmanageActionManagementGroups, + "unmanageAction.ResourcesWithoutDeleteSupport": + options?.unmanageActionResourcesWithoutDeleteSupport, + bypassStackOutOfSyncError: options?.bypassStackOutOfSyncError, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _deleteAtSubscriptionDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. */ +export function deleteAtSubscription( + context: Client, + deploymentStackName: string, + options: DeploymentStacksDeleteAtSubscriptionOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _deleteAtSubscriptionDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _deleteAtSubscriptionSend(context, deploymentStackName, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _createOrUpdateAtSubscriptionSend( + context: Client, + deploymentStackName: string, + deploymentStack: DeploymentStack, + options: DeploymentStacksCreateOrUpdateAtSubscriptionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + deploymentStackName: deploymentStackName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: deploymentStackSerializer(deploymentStack), + }); +} + +export async function _createOrUpdateAtSubscriptionDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return deploymentStackDeserializer(result.body); +} + +/** Creates or updates a Deployment stack at the specified scope. */ +export function createOrUpdateAtSubscription( + context: Client, + deploymentStackName: string, + deploymentStack: DeploymentStack, + options: DeploymentStacksCreateOrUpdateAtSubscriptionOptionalParams = { requestOptions: {} }, +): PollerLike, DeploymentStack> { + return getLongRunningPoller( + context, + _createOrUpdateAtSubscriptionDeserialize, + ["200", "201", "202"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateAtSubscriptionSend(context, deploymentStackName, deploymentStack, options), + resourceLocationConfig: "azure-async-operation", + }, + ) as PollerLike, DeploymentStack>; +} + +export function _validateStackAtSubscriptionSend( + context: Client, + deploymentStackName: string, + deploymentStack: DeploymentStack, + options: DeploymentStacksValidateStackAtSubscriptionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/validate{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + deploymentStackName: deploymentStackName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: deploymentStackSerializer(deploymentStack), + }); +} + +export async function _validateStackAtSubscriptionDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200", "400", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return deploymentStackValidateResultDeserializer(result.body); +} + +/** Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager. */ +export function validateStackAtSubscription( + context: Client, + deploymentStackName: string, + deploymentStack: DeploymentStack, + options: DeploymentStacksValidateStackAtSubscriptionOptionalParams = { requestOptions: {} }, +): PollerLike, DeploymentStackValidateResult> { + return getLongRunningPoller( + context, + _validateStackAtSubscriptionDeserialize, + ["202", "200", "400", "201"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _validateStackAtSubscriptionSend(context, deploymentStackName, deploymentStack, options), + resourceLocationConfig: "location", + }, + ) as PollerLike, DeploymentStackValidateResult>; +} + +export function _listAtSubscriptionSend( + context: Client, + options: DeploymentStacksListAtSubscriptionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listAtSubscriptionDeserialize( + result: PathUncheckedResponse, +): Promise<_DeploymentStackListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _deploymentStackListResultDeserializer(result.body); +} + +/** Lists Deployment stacks at the specified scope. */ +export function listAtSubscription( + context: Client, + options: DeploymentStacksListAtSubscriptionOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listAtSubscriptionSend(context, options), + _listAtSubscriptionDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _getAtSubscriptionSend( + context: Client, + deploymentStackName: string, + options: DeploymentStacksGetAtSubscriptionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + deploymentStackName: deploymentStackName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getAtSubscriptionDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return deploymentStackDeserializer(result.body); +} + +/** Gets the Deployment stack with the given name. */ +export async function getAtSubscription( + context: Client, + deploymentStackName: string, + options: DeploymentStacksGetAtSubscriptionOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getAtSubscriptionSend(context, deploymentStackName, options); + return _getAtSubscriptionDeserialize(result); +} + +export function _exportTemplateAtResourceGroupSend( + context: Client, + resourceGroupName: string, + deploymentStackName: string, + options: DeploymentStacksExportTemplateAtResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/exportTemplate{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + deploymentStackName: deploymentStackName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _exportTemplateAtResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return deploymentStackTemplateDefinitionDeserializer(result.body); +} + +/** Exports the template used to create the Deployment stack at the specified scope. */ +export async function exportTemplateAtResourceGroup( + context: Client, + resourceGroupName: string, + deploymentStackName: string, + options: DeploymentStacksExportTemplateAtResourceGroupOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _exportTemplateAtResourceGroupSend( + context, + resourceGroupName, + deploymentStackName, + options, + ); + return _exportTemplateAtResourceGroupDeserialize(result); +} + +export function _deleteAtResourceGroupSend( + context: Client, + resourceGroupName: string, + deploymentStackName: string, + options: DeploymentStacksDeleteAtResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}{?api%2Dversion,unmanageAction.Resources,unmanageAction.ResourceGroups,unmanageAction.ManagementGroups,unmanageAction.ResourcesWithoutDeleteSupport,bypassStackOutOfSyncError}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + deploymentStackName: deploymentStackName, + "api%2Dversion": context.apiVersion, + "unmanageAction.Resources": options?.unmanageActionResources, + "unmanageAction.ResourceGroups": options?.unmanageActionResourceGroups, + "unmanageAction.ManagementGroups": options?.unmanageActionManagementGroups, + "unmanageAction.ResourcesWithoutDeleteSupport": + options?.unmanageActionResourcesWithoutDeleteSupport, + bypassStackOutOfSyncError: options?.bypassStackOutOfSyncError, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _deleteAtResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. */ +export function deleteAtResourceGroup( + context: Client, + resourceGroupName: string, + deploymentStackName: string, + options: DeploymentStacksDeleteAtResourceGroupOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _deleteAtResourceGroupDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _deleteAtResourceGroupSend(context, resourceGroupName, deploymentStackName, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _createOrUpdateAtResourceGroupSend( + context: Client, + resourceGroupName: string, + deploymentStackName: string, + deploymentStack: DeploymentStack, + options: DeploymentStacksCreateOrUpdateAtResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + deploymentStackName: deploymentStackName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: deploymentStackSerializer(deploymentStack), + }); +} + +export async function _createOrUpdateAtResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return deploymentStackDeserializer(result.body); +} + +/** Creates or updates a Deployment stack at the specified scope. */ +export function createOrUpdateAtResourceGroup( + context: Client, + resourceGroupName: string, + deploymentStackName: string, + deploymentStack: DeploymentStack, + options: DeploymentStacksCreateOrUpdateAtResourceGroupOptionalParams = { requestOptions: {} }, +): PollerLike, DeploymentStack> { + return getLongRunningPoller( + context, + _createOrUpdateAtResourceGroupDeserialize, + ["200", "201", "202"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateAtResourceGroupSend( + context, + resourceGroupName, + deploymentStackName, + deploymentStack, + options, + ), + resourceLocationConfig: "azure-async-operation", + }, + ) as PollerLike, DeploymentStack>; +} + +export function _validateStackAtResourceGroupSend( + context: Client, + resourceGroupName: string, + deploymentStackName: string, + deploymentStack: DeploymentStack, + options: DeploymentStacksValidateStackAtResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/validate{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + deploymentStackName: deploymentStackName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: deploymentStackSerializer(deploymentStack), + }); +} + +export async function _validateStackAtResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200", "400", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return deploymentStackValidateResultDeserializer(result.body); +} + +/** Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager. */ +export function validateStackAtResourceGroup( + context: Client, + resourceGroupName: string, + deploymentStackName: string, + deploymentStack: DeploymentStack, + options: DeploymentStacksValidateStackAtResourceGroupOptionalParams = { requestOptions: {} }, +): PollerLike, DeploymentStackValidateResult> { + return getLongRunningPoller( + context, + _validateStackAtResourceGroupDeserialize, + ["202", "200", "400", "201"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _validateStackAtResourceGroupSend( + context, + resourceGroupName, + deploymentStackName, + deploymentStack, + options, + ), + resourceLocationConfig: "location", + }, + ) as PollerLike, DeploymentStackValidateResult>; +} + +export function _listAtResourceGroupSend( + context: Client, + resourceGroupName: string, + options: DeploymentStacksListAtResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacks{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listAtResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_DeploymentStackListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _deploymentStackListResultDeserializer(result.body); +} + +/** Lists Deployment stacks at the specified scope. */ +export function listAtResourceGroup( + context: Client, + resourceGroupName: string, + options: DeploymentStacksListAtResourceGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listAtResourceGroupSend(context, resourceGroupName, options), + _listAtResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _getAtResourceGroupSend( + context: Client, + resourceGroupName: string, + deploymentStackName: string, + options: DeploymentStacksGetAtResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + deploymentStackName: deploymentStackName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getAtResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return deploymentStackDeserializer(result.body); +} + +/** Gets the Deployment stack with the given name. */ +export async function getAtResourceGroup( + context: Client, + resourceGroupName: string, + deploymentStackName: string, + options: DeploymentStacksGetAtResourceGroupOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getAtResourceGroupSend( + context, + resourceGroupName, + deploymentStackName, + options, + ); + return _getAtResourceGroupDeserialize(result); +} diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacks/options.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacks/options.ts new file mode 100644 index 000000000000..edfa36fc8c65 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacks/options.ts @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { + DeploymentStacksDeleteDetachEnum, + DeploymentStacksResourcesWithoutDeleteSupportEnum, +} from "../../models/models.js"; +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface DeploymentStacksExportTemplateAtManagementGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface DeploymentStacksDeleteAtManagementGroupOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** Flag to indicate delete rather than detach for unmanaged resources. */ + unmanageActionResources?: DeploymentStacksDeleteDetachEnum; + /** Flag to indicate delete rather than detach for unmanaged resource groups. */ + unmanageActionResourceGroups?: DeploymentStacksDeleteDetachEnum; + /** Flag to indicate delete rather than detach for unmanaged management groups. */ + unmanageActionManagementGroups?: DeploymentStacksDeleteDetachEnum; + /** Some resources do not support deletion. This flag will denote how the stack should handle those resources. */ + unmanageActionResourcesWithoutDeleteSupport?: DeploymentStacksResourcesWithoutDeleteSupportEnum; + /** Flag to bypass service errors that indicate the stack resource list is not correctly synchronized. */ + bypassStackOutOfSyncError?: boolean; +} + +/** Optional parameters. */ +export interface DeploymentStacksCreateOrUpdateAtManagementGroupOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DeploymentStacksValidateStackAtManagementGroupOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DeploymentStacksListAtManagementGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface DeploymentStacksGetAtManagementGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface DeploymentStacksExportTemplateAtSubscriptionOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface DeploymentStacksDeleteAtSubscriptionOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** Flag to indicate delete rather than detach for unmanaged resources. */ + unmanageActionResources?: DeploymentStacksDeleteDetachEnum; + /** Flag to indicate delete rather than detach for unmanaged resource groups. */ + unmanageActionResourceGroups?: DeploymentStacksDeleteDetachEnum; + /** Flag to indicate delete rather than detach for unmanaged management groups. */ + unmanageActionManagementGroups?: DeploymentStacksDeleteDetachEnum; + /** Some resources do not support deletion. This flag will denote how the stack should handle those resources. */ + unmanageActionResourcesWithoutDeleteSupport?: DeploymentStacksResourcesWithoutDeleteSupportEnum; + /** Flag to bypass service errors that indicate the stack resource list is not correctly synchronized. */ + bypassStackOutOfSyncError?: boolean; +} + +/** Optional parameters. */ +export interface DeploymentStacksCreateOrUpdateAtSubscriptionOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DeploymentStacksValidateStackAtSubscriptionOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DeploymentStacksListAtSubscriptionOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface DeploymentStacksGetAtSubscriptionOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface DeploymentStacksExportTemplateAtResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface DeploymentStacksDeleteAtResourceGroupOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** Flag to indicate delete rather than detach for unmanaged resources. */ + unmanageActionResources?: DeploymentStacksDeleteDetachEnum; + /** Flag to indicate delete rather than detach for unmanaged resource groups. */ + unmanageActionResourceGroups?: DeploymentStacksDeleteDetachEnum; + /** Flag to indicate delete rather than detach for unmanaged management groups. */ + unmanageActionManagementGroups?: DeploymentStacksDeleteDetachEnum; + /** Some resources do not support deletion. This flag will denote how the stack should handle those resources. */ + unmanageActionResourcesWithoutDeleteSupport?: DeploymentStacksResourcesWithoutDeleteSupportEnum; + /** Flag to bypass service errors that indicate the stack resource list is not correctly synchronized. */ + bypassStackOutOfSyncError?: boolean; +} + +/** Optional parameters. */ +export interface DeploymentStacksCreateOrUpdateAtResourceGroupOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DeploymentStacksValidateStackAtResourceGroupOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DeploymentStacksListAtResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface DeploymentStacksGetAtResourceGroupOptionalParams extends OperationOptions {} diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacksContext.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacksContext.ts new file mode 100644 index 000000000000..687605c5e861 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacksContext.ts @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { logger } from "../logger.js"; +import { KnownVersions } from "../models/models.js"; +import type { AzureSupportedClouds } from "../static-helpers/cloudSettingHelpers.js"; +import { getArmEndpoint } from "../static-helpers/cloudSettingHelpers.js"; +import type { Client, ClientOptions } from "@azure-rest/core-client"; +import { getClient } from "@azure-rest/core-client"; +import type { TokenCredential } from "@azure/core-auth"; + +/** The APIs listed in this specification can be used to manage Deployment stack resources through the Azure Resource Manager. */ +export interface DeploymentStacksContext extends Client { + /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ + apiVersion: string; + /** The ID of the target subscription. The value must be an UUID. */ + subscriptionId: string; +} + +/** Optional parameters for the client. */ +export interface DeploymentStacksClientOptionalParams extends ClientOptions { + /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ + apiVersion?: string; + /** Specifies the Azure cloud environment for the client. */ + cloudSetting?: AzureSupportedClouds; +} + +/** The APIs listed in this specification can be used to manage Deployment stack resources through the Azure Resource Manager. */ +export function createDeploymentStacks( + credential: TokenCredential, + subscriptionId: string, + options: DeploymentStacksClientOptionalParams = {}, +): DeploymentStacksContext { + const endpointUrl = + options.endpoint ?? getArmEndpoint(options.cloudSetting) ?? "https://management.azure.com"; + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentInfo = `azsdk-js-arm-resourcesdeploymentstacks/2.0.0`; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}` + : `azsdk-js-api ${userAgentInfo}`; + const { apiVersion: _, ...updatedOptions } = { + ...options, + userAgentOptions: { userAgentPrefix }, + loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info }, + credentials: { scopes: options.credentials?.scopes ?? [`${endpointUrl}/.default`] }, + }; + const clientContext = getClient(endpointUrl, credential, updatedOptions); + clientContext.pipeline.removePolicy({ name: "ApiVersionPolicy" }); + const apiVersion = options.apiVersion ?? "2025-07-01"; + clientContext.pipeline.addPolicy({ + name: "ClientApiVersionPolicy", + sendRequest: (req, next) => { + // Use the apiVersion defined in request url directly + // Append one if there is no apiVersion and we have one at client options + const url = new URL(req.url); + if (!url.searchParams.get("api-version")) { + req.url = `${req.url}${ + Array.from(url.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } + + return next(req); + }, + }); + return { ...clientContext, apiVersion, subscriptionId } as DeploymentStacksContext; +} diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacksWhatIfResultsAtManagementGroup/index.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacksWhatIfResultsAtManagementGroup/index.ts new file mode 100644 index 000000000000..953d3c763cb0 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacksWhatIfResultsAtManagementGroup/index.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { whatIf, $delete, createOrUpdate, list, get } from "./operations.js"; +export { + DeploymentStacksWhatIfResultsAtManagementGroupWhatIfOptionalParams, + DeploymentStacksWhatIfResultsAtManagementGroupDeleteOptionalParams, + DeploymentStacksWhatIfResultsAtManagementGroupCreateOrUpdateOptionalParams, + DeploymentStacksWhatIfResultsAtManagementGroupListOptionalParams, + DeploymentStacksWhatIfResultsAtManagementGroupGetOptionalParams, +} from "./options.js"; diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacksWhatIfResultsAtManagementGroup/operations.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacksWhatIfResultsAtManagementGroup/operations.ts new file mode 100644 index 000000000000..570455f7568b --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacksWhatIfResultsAtManagementGroup/operations.ts @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { DeploymentStacksContext as Client } from "../index.js"; +import type { + DeploymentStacksWhatIfResult, + _DeploymentStacksWhatIfResultListResult, +} from "../../models/models.js"; +import { + deploymentStacksWhatIfResultSerializer, + deploymentStacksWhatIfResultDeserializer, + errorResponseDeserializer, + _deploymentStacksWhatIfResultListResultDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + DeploymentStacksWhatIfResultsAtManagementGroupWhatIfOptionalParams, + DeploymentStacksWhatIfResultsAtManagementGroupDeleteOptionalParams, + DeploymentStacksWhatIfResultsAtManagementGroupCreateOrUpdateOptionalParams, + DeploymentStacksWhatIfResultsAtManagementGroupListOptionalParams, + DeploymentStacksWhatIfResultsAtManagementGroupGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +export function _whatIfSend( + context: Client, + managementGroupId: string, + deploymentStacksWhatIfResultName: string, + options: DeploymentStacksWhatIfResultsAtManagementGroupWhatIfOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacksWhatIfResults/{deploymentStacksWhatIfResultName}/whatIf{?api%2Dversion}", + { + managementGroupId: managementGroupId, + deploymentStacksWhatIfResultName: deploymentStacksWhatIfResultName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _whatIfDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return deploymentStacksWhatIfResultDeserializer(result.body); +} + +/** Returns property-level changes that will be made by the deployment if executed. */ +export function whatIf( + context: Client, + managementGroupId: string, + deploymentStacksWhatIfResultName: string, + options: DeploymentStacksWhatIfResultsAtManagementGroupWhatIfOptionalParams = { + requestOptions: {}, + }, +): PollerLike, DeploymentStacksWhatIfResult> { + return getLongRunningPoller(context, _whatIfDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _whatIfSend(context, managementGroupId, deploymentStacksWhatIfResultName, options), + resourceLocationConfig: "location", + }) as PollerLike, DeploymentStacksWhatIfResult>; +} + +export function _$deleteSend( + context: Client, + managementGroupId: string, + deploymentStacksWhatIfResultName: string, + options: DeploymentStacksWhatIfResultsAtManagementGroupDeleteOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacksWhatIfResults/{deploymentStacksWhatIfResultName}{?api%2Dversion,unmanageAction.Resources,unmanageAction.ResourceGroups,unmanageAction.ManagementGroups,unmanageAction.ResourcesWithoutDeleteSupport,bypassStackOutOfSyncError}", + { + managementGroupId: managementGroupId, + deploymentStacksWhatIfResultName: deploymentStacksWhatIfResultName, + "api%2Dversion": context.apiVersion, + "unmanageAction.Resources": options?.unmanageActionResources, + "unmanageAction.ResourceGroups": options?.unmanageActionResourceGroups, + "unmanageAction.ManagementGroups": options?.unmanageActionManagementGroups, + "unmanageAction.ResourcesWithoutDeleteSupport": + options?.unmanageActionResourcesWithoutDeleteSupport, + bypassStackOutOfSyncError: options?.bypassStackOutOfSyncError, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export async function $delete( + context: Client, + managementGroupId: string, + deploymentStacksWhatIfResultName: string, + options: DeploymentStacksWhatIfResultsAtManagementGroupDeleteOptionalParams = { + requestOptions: {}, + }, +): Promise { + const result = await _$deleteSend( + context, + managementGroupId, + deploymentStacksWhatIfResultName, + options, + ); + return _$deleteDeserialize(result); +} + +export function _createOrUpdateSend( + context: Client, + managementGroupId: string, + deploymentStacksWhatIfResultName: string, + resource: DeploymentStacksWhatIfResult, + options: DeploymentStacksWhatIfResultsAtManagementGroupCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacksWhatIfResults/{deploymentStacksWhatIfResultName}{?api%2Dversion}", + { + managementGroupId: managementGroupId, + deploymentStacksWhatIfResultName: deploymentStacksWhatIfResultName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: deploymentStacksWhatIfResultSerializer(resource), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return deploymentStacksWhatIfResultDeserializer(result.body); +} + +/** Creates or updates a Deployment stack at the specified scope. */ +export function createOrUpdate( + context: Client, + managementGroupId: string, + deploymentStacksWhatIfResultName: string, + resource: DeploymentStacksWhatIfResult, + options: DeploymentStacksWhatIfResultsAtManagementGroupCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): PollerLike, DeploymentStacksWhatIfResult> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend( + context, + managementGroupId, + deploymentStacksWhatIfResultName, + resource, + options, + ), + resourceLocationConfig: "azure-async-operation", + }) as PollerLike, DeploymentStacksWhatIfResult>; +} + +export function _listSend( + context: Client, + managementGroupId: string, + options: DeploymentStacksWhatIfResultsAtManagementGroupListOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacksWhatIfResults{?api%2Dversion}", + { + managementGroupId: managementGroupId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_DeploymentStacksWhatIfResultListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _deploymentStacksWhatIfResultListResultDeserializer(result.body); +} + +/** Lists Deployment stacks at the specified scope. */ +export function list( + context: Client, + managementGroupId: string, + options: DeploymentStacksWhatIfResultsAtManagementGroupListOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, managementGroupId, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _getSend( + context: Client, + managementGroupId: string, + deploymentStacksWhatIfResultName: string, + options: DeploymentStacksWhatIfResultsAtManagementGroupGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacksWhatIfResults/{deploymentStacksWhatIfResultName}{?api%2Dversion}", + { + managementGroupId: managementGroupId, + deploymentStacksWhatIfResultName: deploymentStacksWhatIfResultName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return deploymentStacksWhatIfResultDeserializer(result.body); +} + +/** Gets the Deployment stack with the given name. */ +export async function get( + context: Client, + managementGroupId: string, + deploymentStacksWhatIfResultName: string, + options: DeploymentStacksWhatIfResultsAtManagementGroupGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + managementGroupId, + deploymentStacksWhatIfResultName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacksWhatIfResultsAtManagementGroup/options.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacksWhatIfResultsAtManagementGroup/options.ts new file mode 100644 index 000000000000..7e2a909555f9 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacksWhatIfResultsAtManagementGroup/options.ts @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { + DeploymentStacksDeleteDetachEnum, + DeploymentStacksResourcesWithoutDeleteSupportEnum, +} from "../../models/models.js"; +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface DeploymentStacksWhatIfResultsAtManagementGroupWhatIfOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DeploymentStacksWhatIfResultsAtManagementGroupDeleteOptionalParams extends OperationOptions { + /** Flag to indicate delete rather than detach for unmanaged resources. */ + unmanageActionResources?: DeploymentStacksDeleteDetachEnum; + /** Flag to indicate delete rather than detach for unmanaged resource groups. */ + unmanageActionResourceGroups?: DeploymentStacksDeleteDetachEnum; + /** Flag to indicate delete rather than detach for unmanaged management groups. */ + unmanageActionManagementGroups?: DeploymentStacksDeleteDetachEnum; + /** Some resources do not support deletion. This flag will denote how the stack should handle those resources. */ + unmanageActionResourcesWithoutDeleteSupport?: DeploymentStacksResourcesWithoutDeleteSupportEnum; + /** Flag to bypass service errors that indicate the stack resource list is not correctly synchronized. */ + bypassStackOutOfSyncError?: boolean; +} + +/** Optional parameters. */ +export interface DeploymentStacksWhatIfResultsAtManagementGroupCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DeploymentStacksWhatIfResultsAtManagementGroupListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface DeploymentStacksWhatIfResultsAtManagementGroupGetOptionalParams extends OperationOptions {} diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacksWhatIfResultsAtResourceGroup/index.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacksWhatIfResultsAtResourceGroup/index.ts new file mode 100644 index 000000000000..5bf2dda7edaf --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacksWhatIfResultsAtResourceGroup/index.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { whatIf, $delete, createOrUpdate, list, get } from "./operations.js"; +export { + DeploymentStacksWhatIfResultsAtResourceGroupWhatIfOptionalParams, + DeploymentStacksWhatIfResultsAtResourceGroupDeleteOptionalParams, + DeploymentStacksWhatIfResultsAtResourceGroupCreateOrUpdateOptionalParams, + DeploymentStacksWhatIfResultsAtResourceGroupListOptionalParams, + DeploymentStacksWhatIfResultsAtResourceGroupGetOptionalParams, +} from "./options.js"; diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacksWhatIfResultsAtResourceGroup/operations.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacksWhatIfResultsAtResourceGroup/operations.ts new file mode 100644 index 000000000000..d89415b5ebf4 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacksWhatIfResultsAtResourceGroup/operations.ts @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { DeploymentStacksContext as Client } from "../index.js"; +import type { + DeploymentStacksWhatIfResult, + _DeploymentStacksWhatIfResultListResult, +} from "../../models/models.js"; +import { + deploymentStacksWhatIfResultSerializer, + deploymentStacksWhatIfResultDeserializer, + errorResponseDeserializer, + _deploymentStacksWhatIfResultListResultDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + DeploymentStacksWhatIfResultsAtResourceGroupWhatIfOptionalParams, + DeploymentStacksWhatIfResultsAtResourceGroupDeleteOptionalParams, + DeploymentStacksWhatIfResultsAtResourceGroupCreateOrUpdateOptionalParams, + DeploymentStacksWhatIfResultsAtResourceGroupListOptionalParams, + DeploymentStacksWhatIfResultsAtResourceGroupGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +export function _whatIfSend( + context: Client, + resourceGroupName: string, + deploymentStacksWhatIfResultName: string, + options: DeploymentStacksWhatIfResultsAtResourceGroupWhatIfOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacksWhatIfResults/{deploymentStacksWhatIfResultName}/whatIf{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + deploymentStacksWhatIfResultName: deploymentStacksWhatIfResultName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _whatIfDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return deploymentStacksWhatIfResultDeserializer(result.body); +} + +/** Returns property-level changes that will be made by the deployment if executed. */ +export function whatIf( + context: Client, + resourceGroupName: string, + deploymentStacksWhatIfResultName: string, + options: DeploymentStacksWhatIfResultsAtResourceGroupWhatIfOptionalParams = { + requestOptions: {}, + }, +): PollerLike, DeploymentStacksWhatIfResult> { + return getLongRunningPoller(context, _whatIfDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _whatIfSend(context, resourceGroupName, deploymentStacksWhatIfResultName, options), + resourceLocationConfig: "location", + }) as PollerLike, DeploymentStacksWhatIfResult>; +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + deploymentStacksWhatIfResultName: string, + options: DeploymentStacksWhatIfResultsAtResourceGroupDeleteOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacksWhatIfResults/{deploymentStacksWhatIfResultName}{?api%2Dversion,unmanageAction.Resources,unmanageAction.ResourceGroups,unmanageAction.ManagementGroups,unmanageAction.ResourcesWithoutDeleteSupport,bypassStackOutOfSyncError}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + deploymentStacksWhatIfResultName: deploymentStacksWhatIfResultName, + "api%2Dversion": context.apiVersion, + "unmanageAction.Resources": options?.unmanageActionResources, + "unmanageAction.ResourceGroups": options?.unmanageActionResourceGroups, + "unmanageAction.ManagementGroups": options?.unmanageActionManagementGroups, + "unmanageAction.ResourcesWithoutDeleteSupport": + options?.unmanageActionResourcesWithoutDeleteSupport, + bypassStackOutOfSyncError: options?.bypassStackOutOfSyncError, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export async function $delete( + context: Client, + resourceGroupName: string, + deploymentStacksWhatIfResultName: string, + options: DeploymentStacksWhatIfResultsAtResourceGroupDeleteOptionalParams = { + requestOptions: {}, + }, +): Promise { + const result = await _$deleteSend( + context, + resourceGroupName, + deploymentStacksWhatIfResultName, + options, + ); + return _$deleteDeserialize(result); +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + deploymentStacksWhatIfResultName: string, + resource: DeploymentStacksWhatIfResult, + options: DeploymentStacksWhatIfResultsAtResourceGroupCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacksWhatIfResults/{deploymentStacksWhatIfResultName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + deploymentStacksWhatIfResultName: deploymentStacksWhatIfResultName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: deploymentStacksWhatIfResultSerializer(resource), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return deploymentStacksWhatIfResultDeserializer(result.body); +} + +/** Creates or updates a Deployment stack at the specified scope. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + deploymentStacksWhatIfResultName: string, + resource: DeploymentStacksWhatIfResult, + options: DeploymentStacksWhatIfResultsAtResourceGroupCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): PollerLike, DeploymentStacksWhatIfResult> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend( + context, + resourceGroupName, + deploymentStacksWhatIfResultName, + resource, + options, + ), + resourceLocationConfig: "azure-async-operation", + }) as PollerLike, DeploymentStacksWhatIfResult>; +} + +export function _listSend( + context: Client, + resourceGroupName: string, + options: DeploymentStacksWhatIfResultsAtResourceGroupListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacksWhatIfResults{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_DeploymentStacksWhatIfResultListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _deploymentStacksWhatIfResultListResultDeserializer(result.body); +} + +/** Lists Deployment stacks at the specified scope. */ +export function list( + context: Client, + resourceGroupName: string, + options: DeploymentStacksWhatIfResultsAtResourceGroupListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, resourceGroupName, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _getSend( + context: Client, + resourceGroupName: string, + deploymentStacksWhatIfResultName: string, + options: DeploymentStacksWhatIfResultsAtResourceGroupGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacksWhatIfResults/{deploymentStacksWhatIfResultName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + deploymentStacksWhatIfResultName: deploymentStacksWhatIfResultName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return deploymentStacksWhatIfResultDeserializer(result.body); +} + +/** Gets the Deployment stack with the given name. */ +export async function get( + context: Client, + resourceGroupName: string, + deploymentStacksWhatIfResultName: string, + options: DeploymentStacksWhatIfResultsAtResourceGroupGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + deploymentStacksWhatIfResultName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacksWhatIfResultsAtResourceGroup/options.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacksWhatIfResultsAtResourceGroup/options.ts new file mode 100644 index 000000000000..4e26d6b9c7fe --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacksWhatIfResultsAtResourceGroup/options.ts @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { + DeploymentStacksDeleteDetachEnum, + DeploymentStacksResourcesWithoutDeleteSupportEnum, +} from "../../models/models.js"; +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface DeploymentStacksWhatIfResultsAtResourceGroupWhatIfOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DeploymentStacksWhatIfResultsAtResourceGroupDeleteOptionalParams extends OperationOptions { + /** Flag to indicate delete rather than detach for unmanaged resources. */ + unmanageActionResources?: DeploymentStacksDeleteDetachEnum; + /** Flag to indicate delete rather than detach for unmanaged resource groups. */ + unmanageActionResourceGroups?: DeploymentStacksDeleteDetachEnum; + /** Flag to indicate delete rather than detach for unmanaged management groups. */ + unmanageActionManagementGroups?: DeploymentStacksDeleteDetachEnum; + /** Some resources do not support deletion. This flag will denote how the stack should handle those resources. */ + unmanageActionResourcesWithoutDeleteSupport?: DeploymentStacksResourcesWithoutDeleteSupportEnum; + /** Flag to bypass service errors that indicate the stack resource list is not correctly synchronized. */ + bypassStackOutOfSyncError?: boolean; +} + +/** Optional parameters. */ +export interface DeploymentStacksWhatIfResultsAtResourceGroupCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DeploymentStacksWhatIfResultsAtResourceGroupListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface DeploymentStacksWhatIfResultsAtResourceGroupGetOptionalParams extends OperationOptions {} diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacksWhatIfResultsAtSubscription/index.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacksWhatIfResultsAtSubscription/index.ts new file mode 100644 index 000000000000..f7a1e224c22b --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacksWhatIfResultsAtSubscription/index.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { whatIf, $delete, createOrUpdate, list, get } from "./operations.js"; +export { + DeploymentStacksWhatIfResultsAtSubscriptionWhatIfOptionalParams, + DeploymentStacksWhatIfResultsAtSubscriptionDeleteOptionalParams, + DeploymentStacksWhatIfResultsAtSubscriptionCreateOrUpdateOptionalParams, + DeploymentStacksWhatIfResultsAtSubscriptionListOptionalParams, + DeploymentStacksWhatIfResultsAtSubscriptionGetOptionalParams, +} from "./options.js"; diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacksWhatIfResultsAtSubscription/operations.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacksWhatIfResultsAtSubscription/operations.ts new file mode 100644 index 000000000000..198b9a9003bb --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacksWhatIfResultsAtSubscription/operations.ts @@ -0,0 +1,278 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { DeploymentStacksContext as Client } from "../index.js"; +import type { + DeploymentStacksWhatIfResult, + _DeploymentStacksWhatIfResultListResult, +} from "../../models/models.js"; +import { + deploymentStacksWhatIfResultSerializer, + deploymentStacksWhatIfResultDeserializer, + errorResponseDeserializer, + _deploymentStacksWhatIfResultListResultDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + DeploymentStacksWhatIfResultsAtSubscriptionWhatIfOptionalParams, + DeploymentStacksWhatIfResultsAtSubscriptionDeleteOptionalParams, + DeploymentStacksWhatIfResultsAtSubscriptionCreateOrUpdateOptionalParams, + DeploymentStacksWhatIfResultsAtSubscriptionListOptionalParams, + DeploymentStacksWhatIfResultsAtSubscriptionGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +export function _whatIfSend( + context: Client, + deploymentStacksWhatIfResultName: string, + options: DeploymentStacksWhatIfResultsAtSubscriptionWhatIfOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacksWhatIfResults/{deploymentStacksWhatIfResultName}/whatIf{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + deploymentStacksWhatIfResultName: deploymentStacksWhatIfResultName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _whatIfDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return deploymentStacksWhatIfResultDeserializer(result.body); +} + +/** Returns property-level changes that will be made by the deployment if executed. */ +export function whatIf( + context: Client, + deploymentStacksWhatIfResultName: string, + options: DeploymentStacksWhatIfResultsAtSubscriptionWhatIfOptionalParams = { requestOptions: {} }, +): PollerLike, DeploymentStacksWhatIfResult> { + return getLongRunningPoller(context, _whatIfDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _whatIfSend(context, deploymentStacksWhatIfResultName, options), + resourceLocationConfig: "location", + }) as PollerLike, DeploymentStacksWhatIfResult>; +} + +export function _$deleteSend( + context: Client, + deploymentStacksWhatIfResultName: string, + options: DeploymentStacksWhatIfResultsAtSubscriptionDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacksWhatIfResults/{deploymentStacksWhatIfResultName}{?api%2Dversion,unmanageAction.Resources,unmanageAction.ResourceGroups,unmanageAction.ManagementGroups,unmanageAction.ResourcesWithoutDeleteSupport,bypassStackOutOfSyncError}", + { + subscriptionId: context.subscriptionId, + deploymentStacksWhatIfResultName: deploymentStacksWhatIfResultName, + "api%2Dversion": context.apiVersion, + "unmanageAction.Resources": options?.unmanageActionResources, + "unmanageAction.ResourceGroups": options?.unmanageActionResourceGroups, + "unmanageAction.ManagementGroups": options?.unmanageActionManagementGroups, + "unmanageAction.ResourcesWithoutDeleteSupport": + options?.unmanageActionResourcesWithoutDeleteSupport, + bypassStackOutOfSyncError: options?.bypassStackOutOfSyncError, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export async function $delete( + context: Client, + deploymentStacksWhatIfResultName: string, + options: DeploymentStacksWhatIfResultsAtSubscriptionDeleteOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _$deleteSend(context, deploymentStacksWhatIfResultName, options); + return _$deleteDeserialize(result); +} + +export function _createOrUpdateSend( + context: Client, + deploymentStacksWhatIfResultName: string, + resource: DeploymentStacksWhatIfResult, + options: DeploymentStacksWhatIfResultsAtSubscriptionCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacksWhatIfResults/{deploymentStacksWhatIfResultName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + deploymentStacksWhatIfResultName: deploymentStacksWhatIfResultName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: deploymentStacksWhatIfResultSerializer(resource), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return deploymentStacksWhatIfResultDeserializer(result.body); +} + +/** Creates or updates a Deployment stack at the specified scope. */ +export function createOrUpdate( + context: Client, + deploymentStacksWhatIfResultName: string, + resource: DeploymentStacksWhatIfResult, + options: DeploymentStacksWhatIfResultsAtSubscriptionCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): PollerLike, DeploymentStacksWhatIfResult> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend(context, deploymentStacksWhatIfResultName, resource, options), + resourceLocationConfig: "azure-async-operation", + }) as PollerLike, DeploymentStacksWhatIfResult>; +} + +export function _listSend( + context: Client, + options: DeploymentStacksWhatIfResultsAtSubscriptionListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacksWhatIfResults{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_DeploymentStacksWhatIfResultListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _deploymentStacksWhatIfResultListResultDeserializer(result.body); +} + +/** Lists Deployment stacks at the specified scope. */ +export function list( + context: Client, + options: DeploymentStacksWhatIfResultsAtSubscriptionListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _getSend( + context: Client, + deploymentStacksWhatIfResultName: string, + options: DeploymentStacksWhatIfResultsAtSubscriptionGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacksWhatIfResults/{deploymentStacksWhatIfResultName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + deploymentStacksWhatIfResultName: deploymentStacksWhatIfResultName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return deploymentStacksWhatIfResultDeserializer(result.body); +} + +/** Gets the Deployment stack with the given name. */ +export async function get( + context: Client, + deploymentStacksWhatIfResultName: string, + options: DeploymentStacksWhatIfResultsAtSubscriptionGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, deploymentStacksWhatIfResultName, options); + return _getDeserialize(result); +} diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacksWhatIfResultsAtSubscription/options.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacksWhatIfResultsAtSubscription/options.ts new file mode 100644 index 000000000000..3a048baec6ae --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/deploymentStacksWhatIfResultsAtSubscription/options.ts @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { + DeploymentStacksDeleteDetachEnum, + DeploymentStacksResourcesWithoutDeleteSupportEnum, +} from "../../models/models.js"; +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface DeploymentStacksWhatIfResultsAtSubscriptionWhatIfOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DeploymentStacksWhatIfResultsAtSubscriptionDeleteOptionalParams extends OperationOptions { + /** Flag to indicate delete rather than detach for unmanaged resources. */ + unmanageActionResources?: DeploymentStacksDeleteDetachEnum; + /** Flag to indicate delete rather than detach for unmanaged resource groups. */ + unmanageActionResourceGroups?: DeploymentStacksDeleteDetachEnum; + /** Flag to indicate delete rather than detach for unmanaged management groups. */ + unmanageActionManagementGroups?: DeploymentStacksDeleteDetachEnum; + /** Some resources do not support deletion. This flag will denote how the stack should handle those resources. */ + unmanageActionResourcesWithoutDeleteSupport?: DeploymentStacksResourcesWithoutDeleteSupportEnum; + /** Flag to bypass service errors that indicate the stack resource list is not correctly synchronized. */ + bypassStackOutOfSyncError?: boolean; +} + +/** Optional parameters. */ +export interface DeploymentStacksWhatIfResultsAtSubscriptionCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DeploymentStacksWhatIfResultsAtSubscriptionListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface DeploymentStacksWhatIfResultsAtSubscriptionGetOptionalParams extends OperationOptions {} diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/index.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/index.ts new file mode 100644 index 000000000000..cc628974136f --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/api/index.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + createDeploymentStacks, + DeploymentStacksContext, + DeploymentStacksClientOptionalParams, +} from "./deploymentStacksContext.js"; diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/classic/deploymentStacks/index.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/classic/deploymentStacks/index.ts new file mode 100644 index 000000000000..10c3d3f91437 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/classic/deploymentStacks/index.ts @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { DeploymentStacksContext } from "../../api/deploymentStacksContext.js"; +import { + exportTemplateAtManagementGroup, + deleteAtManagementGroup, + createOrUpdateAtManagementGroup, + validateStackAtManagementGroup, + listAtManagementGroup, + getAtManagementGroup, + exportTemplateAtSubscription, + deleteAtSubscription, + createOrUpdateAtSubscription, + validateStackAtSubscription, + listAtSubscription, + getAtSubscription, + exportTemplateAtResourceGroup, + deleteAtResourceGroup, + createOrUpdateAtResourceGroup, + validateStackAtResourceGroup, + listAtResourceGroup, + getAtResourceGroup, +} from "../../api/deploymentStacks/operations.js"; +import type { + DeploymentStacksExportTemplateAtManagementGroupOptionalParams, + DeploymentStacksDeleteAtManagementGroupOptionalParams, + DeploymentStacksCreateOrUpdateAtManagementGroupOptionalParams, + DeploymentStacksValidateStackAtManagementGroupOptionalParams, + DeploymentStacksListAtManagementGroupOptionalParams, + DeploymentStacksGetAtManagementGroupOptionalParams, + DeploymentStacksExportTemplateAtSubscriptionOptionalParams, + DeploymentStacksDeleteAtSubscriptionOptionalParams, + DeploymentStacksCreateOrUpdateAtSubscriptionOptionalParams, + DeploymentStacksValidateStackAtSubscriptionOptionalParams, + DeploymentStacksListAtSubscriptionOptionalParams, + DeploymentStacksGetAtSubscriptionOptionalParams, + DeploymentStacksExportTemplateAtResourceGroupOptionalParams, + DeploymentStacksDeleteAtResourceGroupOptionalParams, + DeploymentStacksCreateOrUpdateAtResourceGroupOptionalParams, + DeploymentStacksValidateStackAtResourceGroupOptionalParams, + DeploymentStacksListAtResourceGroupOptionalParams, + DeploymentStacksGetAtResourceGroupOptionalParams, +} from "../../api/deploymentStacks/options.js"; +import type { + DeploymentStack, + DeploymentStackValidateResult, + DeploymentStackTemplateDefinition, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a DeploymentStacks operations. */ +export interface DeploymentStacksOperations { + /** Exports the template used to create the Deployment stack at the specified scope. */ + exportTemplateAtManagementGroup: ( + managementGroupId: string, + deploymentStackName: string, + options?: DeploymentStacksExportTemplateAtManagementGroupOptionalParams, + ) => Promise; + /** Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. */ + deleteAtManagementGroup: ( + managementGroupId: string, + deploymentStackName: string, + options?: DeploymentStacksDeleteAtManagementGroupOptionalParams, + ) => PollerLike, void>; + /** Creates or updates a Deployment stack at the specified scope. */ + createOrUpdateAtManagementGroup: ( + managementGroupId: string, + deploymentStackName: string, + deploymentStack: DeploymentStack, + options?: DeploymentStacksCreateOrUpdateAtManagementGroupOptionalParams, + ) => PollerLike, DeploymentStack>; + /** Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager. */ + validateStackAtManagementGroup: ( + managementGroupId: string, + deploymentStackName: string, + deploymentStack: DeploymentStack, + options?: DeploymentStacksValidateStackAtManagementGroupOptionalParams, + ) => PollerLike, DeploymentStackValidateResult>; + /** Lists Deployment stacks at the specified scope. */ + listAtManagementGroup: ( + managementGroupId: string, + options?: DeploymentStacksListAtManagementGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Gets the Deployment stack with the given name. */ + getAtManagementGroup: ( + managementGroupId: string, + deploymentStackName: string, + options?: DeploymentStacksGetAtManagementGroupOptionalParams, + ) => Promise; + /** Exports the template used to create the Deployment stack at the specified scope. */ + exportTemplateAtSubscription: ( + deploymentStackName: string, + options?: DeploymentStacksExportTemplateAtSubscriptionOptionalParams, + ) => Promise; + /** Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. */ + deleteAtSubscription: ( + deploymentStackName: string, + options?: DeploymentStacksDeleteAtSubscriptionOptionalParams, + ) => PollerLike, void>; + /** Creates or updates a Deployment stack at the specified scope. */ + createOrUpdateAtSubscription: ( + deploymentStackName: string, + deploymentStack: DeploymentStack, + options?: DeploymentStacksCreateOrUpdateAtSubscriptionOptionalParams, + ) => PollerLike, DeploymentStack>; + /** Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager. */ + validateStackAtSubscription: ( + deploymentStackName: string, + deploymentStack: DeploymentStack, + options?: DeploymentStacksValidateStackAtSubscriptionOptionalParams, + ) => PollerLike, DeploymentStackValidateResult>; + /** Lists Deployment stacks at the specified scope. */ + listAtSubscription: ( + options?: DeploymentStacksListAtSubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; + /** Gets the Deployment stack with the given name. */ + getAtSubscription: ( + deploymentStackName: string, + options?: DeploymentStacksGetAtSubscriptionOptionalParams, + ) => Promise; + /** Exports the template used to create the Deployment stack at the specified scope. */ + exportTemplateAtResourceGroup: ( + resourceGroupName: string, + deploymentStackName: string, + options?: DeploymentStacksExportTemplateAtResourceGroupOptionalParams, + ) => Promise; + /** Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. */ + deleteAtResourceGroup: ( + resourceGroupName: string, + deploymentStackName: string, + options?: DeploymentStacksDeleteAtResourceGroupOptionalParams, + ) => PollerLike, void>; + /** Creates or updates a Deployment stack at the specified scope. */ + createOrUpdateAtResourceGroup: ( + resourceGroupName: string, + deploymentStackName: string, + deploymentStack: DeploymentStack, + options?: DeploymentStacksCreateOrUpdateAtResourceGroupOptionalParams, + ) => PollerLike, DeploymentStack>; + /** Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager. */ + validateStackAtResourceGroup: ( + resourceGroupName: string, + deploymentStackName: string, + deploymentStack: DeploymentStack, + options?: DeploymentStacksValidateStackAtResourceGroupOptionalParams, + ) => PollerLike, DeploymentStackValidateResult>; + /** Lists Deployment stacks at the specified scope. */ + listAtResourceGroup: ( + resourceGroupName: string, + options?: DeploymentStacksListAtResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Gets the Deployment stack with the given name. */ + getAtResourceGroup: ( + resourceGroupName: string, + deploymentStackName: string, + options?: DeploymentStacksGetAtResourceGroupOptionalParams, + ) => Promise; +} + +function _getDeploymentStacks(context: DeploymentStacksContext) { + return { + exportTemplateAtManagementGroup: ( + managementGroupId: string, + deploymentStackName: string, + options?: DeploymentStacksExportTemplateAtManagementGroupOptionalParams, + ) => exportTemplateAtManagementGroup(context, managementGroupId, deploymentStackName, options), + deleteAtManagementGroup: ( + managementGroupId: string, + deploymentStackName: string, + options?: DeploymentStacksDeleteAtManagementGroupOptionalParams, + ) => deleteAtManagementGroup(context, managementGroupId, deploymentStackName, options), + createOrUpdateAtManagementGroup: ( + managementGroupId: string, + deploymentStackName: string, + deploymentStack: DeploymentStack, + options?: DeploymentStacksCreateOrUpdateAtManagementGroupOptionalParams, + ) => + createOrUpdateAtManagementGroup( + context, + managementGroupId, + deploymentStackName, + deploymentStack, + options, + ), + validateStackAtManagementGroup: ( + managementGroupId: string, + deploymentStackName: string, + deploymentStack: DeploymentStack, + options?: DeploymentStacksValidateStackAtManagementGroupOptionalParams, + ) => + validateStackAtManagementGroup( + context, + managementGroupId, + deploymentStackName, + deploymentStack, + options, + ), + listAtManagementGroup: ( + managementGroupId: string, + options?: DeploymentStacksListAtManagementGroupOptionalParams, + ) => listAtManagementGroup(context, managementGroupId, options), + getAtManagementGroup: ( + managementGroupId: string, + deploymentStackName: string, + options?: DeploymentStacksGetAtManagementGroupOptionalParams, + ) => getAtManagementGroup(context, managementGroupId, deploymentStackName, options), + exportTemplateAtSubscription: ( + deploymentStackName: string, + options?: DeploymentStacksExportTemplateAtSubscriptionOptionalParams, + ) => exportTemplateAtSubscription(context, deploymentStackName, options), + deleteAtSubscription: ( + deploymentStackName: string, + options?: DeploymentStacksDeleteAtSubscriptionOptionalParams, + ) => deleteAtSubscription(context, deploymentStackName, options), + createOrUpdateAtSubscription: ( + deploymentStackName: string, + deploymentStack: DeploymentStack, + options?: DeploymentStacksCreateOrUpdateAtSubscriptionOptionalParams, + ) => createOrUpdateAtSubscription(context, deploymentStackName, deploymentStack, options), + validateStackAtSubscription: ( + deploymentStackName: string, + deploymentStack: DeploymentStack, + options?: DeploymentStacksValidateStackAtSubscriptionOptionalParams, + ) => validateStackAtSubscription(context, deploymentStackName, deploymentStack, options), + listAtSubscription: (options?: DeploymentStacksListAtSubscriptionOptionalParams) => + listAtSubscription(context, options), + getAtSubscription: ( + deploymentStackName: string, + options?: DeploymentStacksGetAtSubscriptionOptionalParams, + ) => getAtSubscription(context, deploymentStackName, options), + exportTemplateAtResourceGroup: ( + resourceGroupName: string, + deploymentStackName: string, + options?: DeploymentStacksExportTemplateAtResourceGroupOptionalParams, + ) => exportTemplateAtResourceGroup(context, resourceGroupName, deploymentStackName, options), + deleteAtResourceGroup: ( + resourceGroupName: string, + deploymentStackName: string, + options?: DeploymentStacksDeleteAtResourceGroupOptionalParams, + ) => deleteAtResourceGroup(context, resourceGroupName, deploymentStackName, options), + createOrUpdateAtResourceGroup: ( + resourceGroupName: string, + deploymentStackName: string, + deploymentStack: DeploymentStack, + options?: DeploymentStacksCreateOrUpdateAtResourceGroupOptionalParams, + ) => + createOrUpdateAtResourceGroup( + context, + resourceGroupName, + deploymentStackName, + deploymentStack, + options, + ), + validateStackAtResourceGroup: ( + resourceGroupName: string, + deploymentStackName: string, + deploymentStack: DeploymentStack, + options?: DeploymentStacksValidateStackAtResourceGroupOptionalParams, + ) => + validateStackAtResourceGroup( + context, + resourceGroupName, + deploymentStackName, + deploymentStack, + options, + ), + listAtResourceGroup: ( + resourceGroupName: string, + options?: DeploymentStacksListAtResourceGroupOptionalParams, + ) => listAtResourceGroup(context, resourceGroupName, options), + getAtResourceGroup: ( + resourceGroupName: string, + deploymentStackName: string, + options?: DeploymentStacksGetAtResourceGroupOptionalParams, + ) => getAtResourceGroup(context, resourceGroupName, deploymentStackName, options), + }; +} + +export function _getDeploymentStacksOperations( + context: DeploymentStacksContext, +): DeploymentStacksOperations { + return { + ..._getDeploymentStacks(context), + }; +} diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/classic/deploymentStacksWhatIfResultsAtManagementGroup/index.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/classic/deploymentStacksWhatIfResultsAtManagementGroup/index.ts new file mode 100644 index 000000000000..7452127a9738 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/classic/deploymentStacksWhatIfResultsAtManagementGroup/index.ts @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { DeploymentStacksContext } from "../../api/deploymentStacksContext.js"; +import { + whatIf, + $delete, + createOrUpdate, + list, + get, +} from "../../api/deploymentStacksWhatIfResultsAtManagementGroup/operations.js"; +import type { + DeploymentStacksWhatIfResultsAtManagementGroupWhatIfOptionalParams, + DeploymentStacksWhatIfResultsAtManagementGroupDeleteOptionalParams, + DeploymentStacksWhatIfResultsAtManagementGroupCreateOrUpdateOptionalParams, + DeploymentStacksWhatIfResultsAtManagementGroupListOptionalParams, + DeploymentStacksWhatIfResultsAtManagementGroupGetOptionalParams, +} from "../../api/deploymentStacksWhatIfResultsAtManagementGroup/options.js"; +import type { DeploymentStacksWhatIfResult } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a DeploymentStacksWhatIfResultsAtManagementGroup operations. */ +export interface DeploymentStacksWhatIfResultsAtManagementGroupOperations { + /** Returns property-level changes that will be made by the deployment if executed. */ + whatIf: ( + managementGroupId: string, + deploymentStacksWhatIfResultName: string, + options?: DeploymentStacksWhatIfResultsAtManagementGroupWhatIfOptionalParams, + ) => PollerLike, DeploymentStacksWhatIfResult>; + /** Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + managementGroupId: string, + deploymentStacksWhatIfResultName: string, + options?: DeploymentStacksWhatIfResultsAtManagementGroupDeleteOptionalParams, + ) => Promise; + /** Creates or updates a Deployment stack at the specified scope. */ + createOrUpdate: ( + managementGroupId: string, + deploymentStacksWhatIfResultName: string, + resource: DeploymentStacksWhatIfResult, + options?: DeploymentStacksWhatIfResultsAtManagementGroupCreateOrUpdateOptionalParams, + ) => PollerLike, DeploymentStacksWhatIfResult>; + /** Lists Deployment stacks at the specified scope. */ + list: ( + managementGroupId: string, + options?: DeploymentStacksWhatIfResultsAtManagementGroupListOptionalParams, + ) => PagedAsyncIterableIterator; + /** Gets the Deployment stack with the given name. */ + get: ( + managementGroupId: string, + deploymentStacksWhatIfResultName: string, + options?: DeploymentStacksWhatIfResultsAtManagementGroupGetOptionalParams, + ) => Promise; +} + +function _getDeploymentStacksWhatIfResultsAtManagementGroup(context: DeploymentStacksContext) { + return { + whatIf: ( + managementGroupId: string, + deploymentStacksWhatIfResultName: string, + options?: DeploymentStacksWhatIfResultsAtManagementGroupWhatIfOptionalParams, + ) => whatIf(context, managementGroupId, deploymentStacksWhatIfResultName, options), + delete: ( + managementGroupId: string, + deploymentStacksWhatIfResultName: string, + options?: DeploymentStacksWhatIfResultsAtManagementGroupDeleteOptionalParams, + ) => $delete(context, managementGroupId, deploymentStacksWhatIfResultName, options), + createOrUpdate: ( + managementGroupId: string, + deploymentStacksWhatIfResultName: string, + resource: DeploymentStacksWhatIfResult, + options?: DeploymentStacksWhatIfResultsAtManagementGroupCreateOrUpdateOptionalParams, + ) => + createOrUpdate( + context, + managementGroupId, + deploymentStacksWhatIfResultName, + resource, + options, + ), + list: ( + managementGroupId: string, + options?: DeploymentStacksWhatIfResultsAtManagementGroupListOptionalParams, + ) => list(context, managementGroupId, options), + get: ( + managementGroupId: string, + deploymentStacksWhatIfResultName: string, + options?: DeploymentStacksWhatIfResultsAtManagementGroupGetOptionalParams, + ) => get(context, managementGroupId, deploymentStacksWhatIfResultName, options), + }; +} + +export function _getDeploymentStacksWhatIfResultsAtManagementGroupOperations( + context: DeploymentStacksContext, +): DeploymentStacksWhatIfResultsAtManagementGroupOperations { + return { + ..._getDeploymentStacksWhatIfResultsAtManagementGroup(context), + }; +} diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/classic/deploymentStacksWhatIfResultsAtResourceGroup/index.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/classic/deploymentStacksWhatIfResultsAtResourceGroup/index.ts new file mode 100644 index 000000000000..4ce5f7b39aaf --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/classic/deploymentStacksWhatIfResultsAtResourceGroup/index.ts @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { DeploymentStacksContext } from "../../api/deploymentStacksContext.js"; +import { + whatIf, + $delete, + createOrUpdate, + list, + get, +} from "../../api/deploymentStacksWhatIfResultsAtResourceGroup/operations.js"; +import type { + DeploymentStacksWhatIfResultsAtResourceGroupWhatIfOptionalParams, + DeploymentStacksWhatIfResultsAtResourceGroupDeleteOptionalParams, + DeploymentStacksWhatIfResultsAtResourceGroupCreateOrUpdateOptionalParams, + DeploymentStacksWhatIfResultsAtResourceGroupListOptionalParams, + DeploymentStacksWhatIfResultsAtResourceGroupGetOptionalParams, +} from "../../api/deploymentStacksWhatIfResultsAtResourceGroup/options.js"; +import type { DeploymentStacksWhatIfResult } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a DeploymentStacksWhatIfResultsAtResourceGroup operations. */ +export interface DeploymentStacksWhatIfResultsAtResourceGroupOperations { + /** Returns property-level changes that will be made by the deployment if executed. */ + whatIf: ( + resourceGroupName: string, + deploymentStacksWhatIfResultName: string, + options?: DeploymentStacksWhatIfResultsAtResourceGroupWhatIfOptionalParams, + ) => PollerLike, DeploymentStacksWhatIfResult>; + /** Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + deploymentStacksWhatIfResultName: string, + options?: DeploymentStacksWhatIfResultsAtResourceGroupDeleteOptionalParams, + ) => Promise; + /** Creates or updates a Deployment stack at the specified scope. */ + createOrUpdate: ( + resourceGroupName: string, + deploymentStacksWhatIfResultName: string, + resource: DeploymentStacksWhatIfResult, + options?: DeploymentStacksWhatIfResultsAtResourceGroupCreateOrUpdateOptionalParams, + ) => PollerLike, DeploymentStacksWhatIfResult>; + /** Lists Deployment stacks at the specified scope. */ + list: ( + resourceGroupName: string, + options?: DeploymentStacksWhatIfResultsAtResourceGroupListOptionalParams, + ) => PagedAsyncIterableIterator; + /** Gets the Deployment stack with the given name. */ + get: ( + resourceGroupName: string, + deploymentStacksWhatIfResultName: string, + options?: DeploymentStacksWhatIfResultsAtResourceGroupGetOptionalParams, + ) => Promise; +} + +function _getDeploymentStacksWhatIfResultsAtResourceGroup(context: DeploymentStacksContext) { + return { + whatIf: ( + resourceGroupName: string, + deploymentStacksWhatIfResultName: string, + options?: DeploymentStacksWhatIfResultsAtResourceGroupWhatIfOptionalParams, + ) => whatIf(context, resourceGroupName, deploymentStacksWhatIfResultName, options), + delete: ( + resourceGroupName: string, + deploymentStacksWhatIfResultName: string, + options?: DeploymentStacksWhatIfResultsAtResourceGroupDeleteOptionalParams, + ) => $delete(context, resourceGroupName, deploymentStacksWhatIfResultName, options), + createOrUpdate: ( + resourceGroupName: string, + deploymentStacksWhatIfResultName: string, + resource: DeploymentStacksWhatIfResult, + options?: DeploymentStacksWhatIfResultsAtResourceGroupCreateOrUpdateOptionalParams, + ) => + createOrUpdate( + context, + resourceGroupName, + deploymentStacksWhatIfResultName, + resource, + options, + ), + list: ( + resourceGroupName: string, + options?: DeploymentStacksWhatIfResultsAtResourceGroupListOptionalParams, + ) => list(context, resourceGroupName, options), + get: ( + resourceGroupName: string, + deploymentStacksWhatIfResultName: string, + options?: DeploymentStacksWhatIfResultsAtResourceGroupGetOptionalParams, + ) => get(context, resourceGroupName, deploymentStacksWhatIfResultName, options), + }; +} + +export function _getDeploymentStacksWhatIfResultsAtResourceGroupOperations( + context: DeploymentStacksContext, +): DeploymentStacksWhatIfResultsAtResourceGroupOperations { + return { + ..._getDeploymentStacksWhatIfResultsAtResourceGroup(context), + }; +} diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/classic/deploymentStacksWhatIfResultsAtSubscription/index.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/classic/deploymentStacksWhatIfResultsAtSubscription/index.ts new file mode 100644 index 000000000000..3c9acbb76815 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/classic/deploymentStacksWhatIfResultsAtSubscription/index.ts @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { DeploymentStacksContext } from "../../api/deploymentStacksContext.js"; +import { + whatIf, + $delete, + createOrUpdate, + list, + get, +} from "../../api/deploymentStacksWhatIfResultsAtSubscription/operations.js"; +import type { + DeploymentStacksWhatIfResultsAtSubscriptionWhatIfOptionalParams, + DeploymentStacksWhatIfResultsAtSubscriptionDeleteOptionalParams, + DeploymentStacksWhatIfResultsAtSubscriptionCreateOrUpdateOptionalParams, + DeploymentStacksWhatIfResultsAtSubscriptionListOptionalParams, + DeploymentStacksWhatIfResultsAtSubscriptionGetOptionalParams, +} from "../../api/deploymentStacksWhatIfResultsAtSubscription/options.js"; +import type { DeploymentStacksWhatIfResult } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a DeploymentStacksWhatIfResultsAtSubscription operations. */ +export interface DeploymentStacksWhatIfResultsAtSubscriptionOperations { + /** Returns property-level changes that will be made by the deployment if executed. */ + whatIf: ( + deploymentStacksWhatIfResultName: string, + options?: DeploymentStacksWhatIfResultsAtSubscriptionWhatIfOptionalParams, + ) => PollerLike, DeploymentStacksWhatIfResult>; + /** Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned without content. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + deploymentStacksWhatIfResultName: string, + options?: DeploymentStacksWhatIfResultsAtSubscriptionDeleteOptionalParams, + ) => Promise; + /** Creates or updates a Deployment stack at the specified scope. */ + createOrUpdate: ( + deploymentStacksWhatIfResultName: string, + resource: DeploymentStacksWhatIfResult, + options?: DeploymentStacksWhatIfResultsAtSubscriptionCreateOrUpdateOptionalParams, + ) => PollerLike, DeploymentStacksWhatIfResult>; + /** Lists Deployment stacks at the specified scope. */ + list: ( + options?: DeploymentStacksWhatIfResultsAtSubscriptionListOptionalParams, + ) => PagedAsyncIterableIterator; + /** Gets the Deployment stack with the given name. */ + get: ( + deploymentStacksWhatIfResultName: string, + options?: DeploymentStacksWhatIfResultsAtSubscriptionGetOptionalParams, + ) => Promise; +} + +function _getDeploymentStacksWhatIfResultsAtSubscription(context: DeploymentStacksContext) { + return { + whatIf: ( + deploymentStacksWhatIfResultName: string, + options?: DeploymentStacksWhatIfResultsAtSubscriptionWhatIfOptionalParams, + ) => whatIf(context, deploymentStacksWhatIfResultName, options), + delete: ( + deploymentStacksWhatIfResultName: string, + options?: DeploymentStacksWhatIfResultsAtSubscriptionDeleteOptionalParams, + ) => $delete(context, deploymentStacksWhatIfResultName, options), + createOrUpdate: ( + deploymentStacksWhatIfResultName: string, + resource: DeploymentStacksWhatIfResult, + options?: DeploymentStacksWhatIfResultsAtSubscriptionCreateOrUpdateOptionalParams, + ) => createOrUpdate(context, deploymentStacksWhatIfResultName, resource, options), + list: (options?: DeploymentStacksWhatIfResultsAtSubscriptionListOptionalParams) => + list(context, options), + get: ( + deploymentStacksWhatIfResultName: string, + options?: DeploymentStacksWhatIfResultsAtSubscriptionGetOptionalParams, + ) => get(context, deploymentStacksWhatIfResultName, options), + }; +} + +export function _getDeploymentStacksWhatIfResultsAtSubscriptionOperations( + context: DeploymentStacksContext, +): DeploymentStacksWhatIfResultsAtSubscriptionOperations { + return { + ..._getDeploymentStacksWhatIfResultsAtSubscription(context), + }; +} diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/classic/index.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/classic/index.ts new file mode 100644 index 000000000000..53fd943447da --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/classic/index.ts @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { DeploymentStacksOperations } from "./deploymentStacks/index.js"; +export { DeploymentStacksWhatIfResultsAtManagementGroupOperations } from "./deploymentStacksWhatIfResultsAtManagementGroup/index.js"; +export { DeploymentStacksWhatIfResultsAtResourceGroupOperations } from "./deploymentStacksWhatIfResultsAtResourceGroup/index.js"; +export { DeploymentStacksWhatIfResultsAtSubscriptionOperations } from "./deploymentStacksWhatIfResultsAtSubscription/index.js"; diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/deploymentStacksClient.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/deploymentStacksClient.ts index 9291c9718676..906a9204fa5f 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/deploymentStacksClient.ts +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/deploymentStacksClient.ts @@ -1,52 +1,38 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. -import * as coreClient from "@azure/core-client"; -import * as coreRestPipeline from "@azure/core-rest-pipeline"; -import { - PipelineRequest, - PipelineResponse, - SendRequest, -} from "@azure/core-rest-pipeline"; -import * as coreAuth from "@azure/core-auth"; -import { DeploymentStacksImpl } from "./operations/index.js"; -import { DeploymentStacks } from "./operationsInterfaces/index.js"; -import { DeploymentStacksClientOptionalParams } from "./models/index.js"; +import type { DeploymentStacksContext, DeploymentStacksClientOptionalParams } from "./api/index.js"; +import { createDeploymentStacks } from "./api/index.js"; +import type { DeploymentStacksOperations } from "./classic/deploymentStacks/index.js"; +import { _getDeploymentStacksOperations } from "./classic/deploymentStacks/index.js"; +import type { DeploymentStacksWhatIfResultsAtManagementGroupOperations } from "./classic/deploymentStacksWhatIfResultsAtManagementGroup/index.js"; +import { _getDeploymentStacksWhatIfResultsAtManagementGroupOperations } from "./classic/deploymentStacksWhatIfResultsAtManagementGroup/index.js"; +import type { DeploymentStacksWhatIfResultsAtResourceGroupOperations } from "./classic/deploymentStacksWhatIfResultsAtResourceGroup/index.js"; +import { _getDeploymentStacksWhatIfResultsAtResourceGroupOperations } from "./classic/deploymentStacksWhatIfResultsAtResourceGroup/index.js"; +import type { DeploymentStacksWhatIfResultsAtSubscriptionOperations } from "./classic/deploymentStacksWhatIfResultsAtSubscription/index.js"; +import { _getDeploymentStacksWhatIfResultsAtSubscriptionOperations } from "./classic/deploymentStacksWhatIfResultsAtSubscription/index.js"; +import type { TokenCredential } from "@azure/core-auth"; +import type { Pipeline } from "@azure/core-rest-pipeline"; -export class DeploymentStacksClient extends coreClient.ServiceClient { - $host: string; - subscriptionId?: string; - apiVersion: string; +export { DeploymentStacksClientOptionalParams } from "./api/deploymentStacksContext.js"; - /** - * Initializes a new instance of the DeploymentStacksClient class. - * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId The ID of the target subscription. The value must be an UUID. - * @param options The parameter options - */ +export class DeploymentStacksClient { + private _client: DeploymentStacksContext; + /** The pipeline used by this client to make requests */ + public readonly pipeline: Pipeline; + + constructor(credential: TokenCredential, options?: DeploymentStacksClientOptionalParams); constructor( - credentials: coreAuth.TokenCredential, + credential: TokenCredential, subscriptionId: string, options?: DeploymentStacksClientOptionalParams, ); + /** The APIs listed in this specification can be used to manage Deployment stack resources through the Azure Resource Manager. */ constructor( - credentials: coreAuth.TokenCredential, - options?: DeploymentStacksClientOptionalParams, - ); - constructor( - credentials: coreAuth.TokenCredential, - subscriptionIdOrOptions?: DeploymentStacksClientOptionalParams | string, + credential: TokenCredential, + subscriptionIdOrOptions?: string | DeploymentStacksClientOptionalParams, options?: DeploymentStacksClientOptionalParams, ) { - if (credentials === undefined) { - throw new Error("'credentials' cannot be null"); - } - let subscriptionId: string | undefined; if (typeof subscriptionIdOrOptions === "string") { @@ -55,101 +41,31 @@ export class DeploymentStacksClient extends coreClient.ServiceClient { options = subscriptionIdOrOptions; } - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: DeploymentStacksClientOptionalParams = { - requestContentType: "application/json; charset=utf-8", - credential: credentials, - }; - - const packageDetails = `azsdk-js-arm-resourcesdeploymentstacks/1.0.2`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, + options = options ?? {}; + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} azsdk-js-client` + : `azsdk-js-client`; + this._client = createDeploymentStacks(credential, subscriptionId ?? "", { ...options, - userAgentOptions: { - userAgentPrefix, - }, - endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com", - }; - super(optionsWithDefaults); - - let bearerTokenAuthenticationPolicyFound: boolean = false; - if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { - const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = - options.pipeline.getOrderedPolicies(); - bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( - (pipelinePolicy) => - pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName, - ); - } - if ( - !options || - !options.pipeline || - options.pipeline.getOrderedPolicies().length == 0 || - !bearerTokenAuthenticationPolicyFound - ) { - this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName, - }); - this.pipeline.addPolicy( - coreRestPipeline.bearerTokenAuthenticationPolicy({ - credential: credentials, - scopes: - optionsWithDefaults.credentialScopes ?? - `${optionsWithDefaults.endpoint}/.default`, - challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge, - }, - }), - ); - } - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2024-03-01"; - this.deploymentStacks = new DeploymentStacksImpl(this); - this.addCustomApiVersionPolicy(options.apiVersion); - } - - /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ - private addCustomApiVersionPolicy(apiVersion?: string) { - if (!apiVersion) { - return; - } - const apiVersionPolicy = { - name: "CustomApiVersionPolicy", - async sendRequest( - request: PipelineRequest, - next: SendRequest, - ): Promise { - const param = request.url.split("?"); - if (param.length > 1) { - const newParams = param[1].split("&").map((item) => { - if (item.indexOf("api-version") > -1) { - return "api-version=" + apiVersion; - } else { - return item; - } - }); - request.url = param[0] + "?" + newParams.join("&"); - } - return next(request); - }, - }; - this.pipeline.addPolicy(apiVersionPolicy); + userAgentOptions: { userAgentPrefix }, + }); + this.pipeline = this._client.pipeline; + this.deploymentStacks = _getDeploymentStacksOperations(this._client); + this.deploymentStacksWhatIfResultsAtManagementGroup = + _getDeploymentStacksWhatIfResultsAtManagementGroupOperations(this._client); + this.deploymentStacksWhatIfResultsAtSubscription = + _getDeploymentStacksWhatIfResultsAtSubscriptionOperations(this._client); + this.deploymentStacksWhatIfResultsAtResourceGroup = + _getDeploymentStacksWhatIfResultsAtResourceGroupOperations(this._client); } - deploymentStacks: DeploymentStacks; + /** The operation groups for deploymentStacks */ + public readonly deploymentStacks: DeploymentStacksOperations; + /** The operation groups for deploymentStacksWhatIfResultsAtManagementGroup */ + public readonly deploymentStacksWhatIfResultsAtManagementGroup: DeploymentStacksWhatIfResultsAtManagementGroupOperations; + /** The operation groups for deploymentStacksWhatIfResultsAtSubscription */ + public readonly deploymentStacksWhatIfResultsAtSubscription: DeploymentStacksWhatIfResultsAtSubscriptionOperations; + /** The operation groups for deploymentStacksWhatIfResultsAtResourceGroup */ + public readonly deploymentStacksWhatIfResultsAtResourceGroup: DeploymentStacksWhatIfResultsAtResourceGroupOperations; } diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/index.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/index.ts index e39716dbfe3f..51b6fc8d5bfa 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/index.ts +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/index.ts @@ -1,13 +1,129 @@ -/* - * 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 { AzureClouds, AzureSupportedClouds } from "./static-helpers/cloudSettingHelpers.js"; +import { + PageSettings, + ContinuablePage, + PagedAsyncIterableIterator, +} from "./static-helpers/pagingHelpers.js"; -/// -export { getContinuationToken } from "./pagingHelper.js"; -export * from "./models/index.js"; export { DeploymentStacksClient } from "./deploymentStacksClient.js"; -export * from "./operationsInterfaces/index.js"; +export { restorePoller, RestorePollerOptions } from "./restorePollerHelpers.js"; +export { + DeploymentStacksWhatIfResult, + DeploymentStacksWhatIfResultProperties, + ErrorDetail, + ErrorAdditionalInfo, + DeploymentStacksTemplateLink, + DeploymentParameter, + KeyVaultParameterReference, + KeyVaultReference, + DeploymentStacksParametersLink, + DeploymentExtensionConfig, + DeploymentExtensionConfigItem, + DeploymentExternalInput, + DeploymentExternalInputDefinition, + ActionOnUnmanage, + KnownDeploymentStacksDeleteDetachEnum, + DeploymentStacksDeleteDetachEnum, + KnownDeploymentStacksResourcesWithoutDeleteSupportEnum, + DeploymentStacksResourcesWithoutDeleteSupportEnum, + DeploymentStacksDebugSetting, + DenySettings, + KnownDenySettingsMode, + DenySettingsMode, + KnownDeploymentStackProvisioningState, + DeploymentStackProvisioningState, + KnownValidationLevel, + ValidationLevel, + DeploymentStacksWhatIfChange, + DeploymentStacksWhatIfResourceChange, + DeploymentExtension, + KnownDeploymentStacksWhatIfChangeType, + DeploymentStacksWhatIfChangeType, + KnownDeploymentStacksWhatIfChangeCertainty, + DeploymentStacksWhatIfChangeCertainty, + DeploymentStacksChangeBaseDeploymentStacksManagementStatus, + KnownDeploymentStacksManagementStatus, + DeploymentStacksManagementStatus, + DeploymentStacksChangeBaseDenyStatusMode, + KnownDenyStatusMode, + DenyStatusMode, + DeploymentStacksChangeDeltaRecord, + DeploymentStacksWhatIfPropertyChange, + KnownDeploymentStacksWhatIfPropertyChangeType, + DeploymentStacksWhatIfPropertyChangeType, + DeploymentStacksChangeDeltaDenySettings, + DeploymentStacksChangeBase, + DeploymentStacksDiagnostic, + KnownDeploymentStacksDiagnosticLevel, + DeploymentStacksDiagnosticLevel, + ProxyResource, + Resource, + SystemData, + KnownCreatedByType, + CreatedByType, + ErrorResponse, + DeploymentStack, + DeploymentStackProperties, + ResourceReference, + ResourceReferenceExtended, + ManagedResourceReference, + KnownResourceStatusMode, + ResourceStatusMode, + DeploymentStackValidateResult, + DeploymentStackValidateProperties, + DeploymentStackTemplateDefinition, + KnownVersions, +} from "./models/index.js"; +export { DeploymentStacksClientOptionalParams } from "./api/index.js"; +export { + DeploymentStacksExportTemplateAtManagementGroupOptionalParams, + DeploymentStacksDeleteAtManagementGroupOptionalParams, + DeploymentStacksCreateOrUpdateAtManagementGroupOptionalParams, + DeploymentStacksValidateStackAtManagementGroupOptionalParams, + DeploymentStacksListAtManagementGroupOptionalParams, + DeploymentStacksGetAtManagementGroupOptionalParams, + DeploymentStacksExportTemplateAtSubscriptionOptionalParams, + DeploymentStacksDeleteAtSubscriptionOptionalParams, + DeploymentStacksCreateOrUpdateAtSubscriptionOptionalParams, + DeploymentStacksValidateStackAtSubscriptionOptionalParams, + DeploymentStacksListAtSubscriptionOptionalParams, + DeploymentStacksGetAtSubscriptionOptionalParams, + DeploymentStacksExportTemplateAtResourceGroupOptionalParams, + DeploymentStacksDeleteAtResourceGroupOptionalParams, + DeploymentStacksCreateOrUpdateAtResourceGroupOptionalParams, + DeploymentStacksValidateStackAtResourceGroupOptionalParams, + DeploymentStacksListAtResourceGroupOptionalParams, + DeploymentStacksGetAtResourceGroupOptionalParams, +} from "./api/deploymentStacks/index.js"; +export { + DeploymentStacksWhatIfResultsAtManagementGroupWhatIfOptionalParams, + DeploymentStacksWhatIfResultsAtManagementGroupDeleteOptionalParams, + DeploymentStacksWhatIfResultsAtManagementGroupCreateOrUpdateOptionalParams, + DeploymentStacksWhatIfResultsAtManagementGroupListOptionalParams, + DeploymentStacksWhatIfResultsAtManagementGroupGetOptionalParams, +} from "./api/deploymentStacksWhatIfResultsAtManagementGroup/index.js"; +export { + DeploymentStacksWhatIfResultsAtResourceGroupWhatIfOptionalParams, + DeploymentStacksWhatIfResultsAtResourceGroupDeleteOptionalParams, + DeploymentStacksWhatIfResultsAtResourceGroupCreateOrUpdateOptionalParams, + DeploymentStacksWhatIfResultsAtResourceGroupListOptionalParams, + DeploymentStacksWhatIfResultsAtResourceGroupGetOptionalParams, +} from "./api/deploymentStacksWhatIfResultsAtResourceGroup/index.js"; +export { + DeploymentStacksWhatIfResultsAtSubscriptionWhatIfOptionalParams, + DeploymentStacksWhatIfResultsAtSubscriptionDeleteOptionalParams, + DeploymentStacksWhatIfResultsAtSubscriptionCreateOrUpdateOptionalParams, + DeploymentStacksWhatIfResultsAtSubscriptionListOptionalParams, + DeploymentStacksWhatIfResultsAtSubscriptionGetOptionalParams, +} from "./api/deploymentStacksWhatIfResultsAtSubscription/index.js"; +export { + DeploymentStacksOperations, + DeploymentStacksWhatIfResultsAtManagementGroupOperations, + DeploymentStacksWhatIfResultsAtResourceGroupOperations, + DeploymentStacksWhatIfResultsAtSubscriptionOperations, +} from "./classic/index.js"; +export { PageSettings, ContinuablePage, PagedAsyncIterableIterator }; +export { AzureClouds, AzureSupportedClouds }; diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/logger.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/logger.ts new file mode 100644 index 000000000000..153a71f085ed --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/logger.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { createClientLogger } from "@azure/logger"; +export const logger = createClientLogger("arm-resourcesdeploymentstacks"); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/lroImpl.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/lroImpl.ts deleted file mode 100644 index d8bc98987053..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/lroImpl.ts +++ /dev/null @@ -1,38 +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. - */ -import { AbortSignalLike } from "@azure/abort-controller"; -import { LongRunningOperation, LroResponse } from "@azure/core-lro"; - -export function createLroSpec(inputs: { - sendOperationFn: (args: any, spec: any) => Promise>; - args: Record; - spec: { - readonly requestBody?: unknown; - readonly path?: string; - readonly httpMethod: string; - } & Record; -}): LongRunningOperation { - const { args, spec, sendOperationFn } = inputs; - return { - requestMethod: spec.httpMethod, - requestPath: spec.path!, - sendInitialRequest: () => sendOperationFn(args, spec), - sendPollRequest: ( - path: string, - options?: { abortSignal?: AbortSignalLike }, - ) => { - const { requestBody, ...restSpec } = spec; - return sendOperationFn(args, { - ...restSpec, - httpMethod: "GET", - path, - abortSignal: options?.abortSignal, - }); - }, - }; -} diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/models/index.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/models/index.ts index dd6955ca1a95..823e5aa9b891 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/models/index.ts +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/models/index.ts @@ -1,804 +1,70 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; - -/** List of Deployment stacks. */ -export interface DeploymentStackListResult { - /** An array of Deployment stacks. */ - value?: DeploymentStack[]; - /** - * 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; -} - -/** Entity representing the reference to the template. */ -export interface DeploymentStacksTemplateLink { - /** The URI of the template to deploy. Use either the uri or id property, but not both. */ - uri?: string; - /** The resourceId 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. */ - relativePath?: string; - /** The query string (for example, a SAS token) to be used with the templateLink URI. */ - queryString?: string; - /** If included, must match the ContentVersion in the template. */ - contentVersion?: string; -} - -/** Deployment parameter for the template. */ -export interface DeploymentParameter { - /** Input value to the parameter. */ - value?: any; - /** Type of the value. */ - type?: string; - /** Azure Key Vault parameter reference. */ - reference?: KeyVaultParameterReference; -} - -/** Azure Key Vault parameter reference. */ -export interface KeyVaultParameterReference { - /** Azure Key Vault reference. */ - keyVault: KeyVaultReference; - /** Azure Key Vault secret name. */ - secretName: string; - /** Azure Key Vault secret version. */ - secretVersion?: string; -} - -/** Azure Key Vault reference. */ -export interface KeyVaultReference { - /** Azure Key Vault resourceId. */ - id: string; -} - -/** Entity representing the reference to the deployment parameters. */ -export interface DeploymentStacksParametersLink { - /** The URI of the parameters file. */ - uri: string; - /** If included, must match the ContentVersion in the template. */ - contentVersion?: string; -} - -/** Defines the behavior of resources that are no longer managed after the stack is updated or deleted. */ -export interface ActionOnUnmanage { - /** Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. */ - resources: DeploymentStacksDeleteDetachEnum; - /** Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. */ - resourceGroups?: DeploymentStacksDeleteDetachEnum; - /** Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. */ - managementGroups?: DeploymentStacksDeleteDetachEnum; -} - -/** The debug setting. */ -export interface DeploymentStacksDebugSetting { - /** 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 that is being passed in during deployment. By logging information about the request or response, sensitive data that is retrieved through the deployment operations could potentially be exposed. */ - detailLevel?: string; -} - -/** Defines how resources deployed by the Deployment stack are locked. */ -export interface DenySettings { - /** denySettings Mode that defines denied actions. */ - mode: DenySettingsMode; - /** List of AAD principal IDs excluded from the lock. Up to 5 principals are permitted. */ - excludedPrincipals?: string[]; - /** List of role-based management operations that are excluded from the denySettings. Up to 200 actions are permitted. If the denySetting mode is set to 'denyWriteAndDelete', then the following actions are automatically appended to 'excludedActions': '*\/read' and 'Microsoft.Authorization/locks/delete'. If the denySetting mode is set to 'denyDelete', then the following actions are automatically appended to 'excludedActions': 'Microsoft.Authorization/locks/delete'. Duplicate actions will be removed. */ - excludedActions?: string[]; - /** DenySettings will be applied to child resource scopes of every managed resource with a deny assignment. */ - applyToChildScopes?: boolean; -} - -/** The resourceId model. */ -export interface ResourceReference { - /** - * The resourceId of a resource managed by the deployment stack. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; -} - -/** Deployment Stacks error response. */ -export interface DeploymentStacksError { - /** The error detail. */ - error?: ErrorDetail; -} - -/** The error detail. */ -export interface ErrorDetail { - /** - * The error code. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly code?: string; - /** - * The error message. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly message?: string; - /** - * The error target. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly target?: string; - /** - * The error details. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly details?: ErrorDetail[]; - /** - * The error additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly additionalInfo?: ErrorAdditionalInfo[]; -} - -/** The resource management error additional info. */ -export interface ErrorAdditionalInfo { - /** - * The additional info type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * The additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly info?: Record; -} - -/** Common properties for all Azure resources. */ -export interface AzureResourceBase { - /** - * String Id used to locate any resource on Azure. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * Name of this resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Type of this resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; -} - -/** Metadata pertaining to creation and last modification of the resource. */ -export interface SystemData { - /** The identity that created the resource. */ - createdBy?: string; - /** The type of identity that created the resource. */ - createdByType?: CreatedByType; - /** The timestamp of resource creation (UTC). */ - createdAt?: Date; - /** The identity that last modified the resource. */ - lastModifiedBy?: string; - /** The type of identity that last modified the resource. */ - lastModifiedByType?: CreatedByType; - /** The timestamp of resource last modification (UTC) */ - lastModifiedAt?: Date; -} - -/** Export Template specific properties of the Deployment stack. */ -export interface DeploymentStackTemplateDefinition { - /** The template content. Use this element 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?: DeploymentStacksTemplateLink; -} - -/** The Deployment stack validation result details. */ -export interface DeploymentStackValidateProperties { - /** Defines the behavior of resources that are no longer managed after the Deployment stack is updated or deleted. */ - actionOnUnmanage?: ActionOnUnmanage; - /** The correlation id of the Deployment stack validate operation. It is in GUID format and is used for tracing. */ - correlationId?: string; - /** The Deployment stack deny settings. */ - denySettings?: DenySettings; - /** The Deployment stack deployment scope. */ - deploymentScope?: string; - /** The Deployment stack validation description. */ - description?: string; - /** Deployment parameters. */ - parameters?: { [propertyName: string]: DeploymentParameter }; - /** The URI of the template. */ - templateLink?: DeploymentStacksTemplateLink; - /** The array of resources that were validated. */ - validatedResources?: ResourceReference[]; -} - -/** The resourceId extended model. This is used to document failed resources with a resourceId and a corresponding error. */ -export interface ResourceReferenceExtended - extends ResourceReference, - DeploymentStacksError {} - -/** The managed resource model. */ -export interface ManagedResourceReference extends ResourceReference { - /** Current management state of the resource in the deployment stack. */ - status?: ResourceStatusMode; - /** denyAssignment settings applied to the resource. */ - denyStatus?: DenyStatusMode; -} - -/** Deployment stack properties. */ -export interface DeploymentStackProperties extends DeploymentStacksError { - /** 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?: DeploymentStacksTemplateLink; - /** Name and value pairs that define the deployment parameters for the template. Use this element when providing the parameter values directly in the request, rather than linking to an existing parameter file. Use either the parametersLink property or the parameters property, but not both. */ - parameters?: { [propertyName: string]: DeploymentParameter }; - /** The URI of parameters file. Use this element to link to an existing parameters file. Use either the parametersLink property or the parameters property, but not both. */ - parametersLink?: DeploymentStacksParametersLink; - /** Defines the behavior of resources that are no longer managed after the Deployment stack is updated or deleted. */ - actionOnUnmanage: ActionOnUnmanage; - /** The debug setting of the deployment. */ - debugSetting?: DeploymentStacksDebugSetting; - /** Flag to bypass service errors that indicate the stack resource list is not correctly synchronized. */ - bypassStackOutOfSyncError?: boolean; - /** The scope at which the initial deployment should be created. If a scope is not specified, it will default to the scope of the deployment stack. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroupId}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'). */ - deploymentScope?: string; - /** Deployment stack description. Max length of 4096 characters. */ - description?: string; - /** Defines how resources deployed by the stack are locked. */ - denySettings: DenySettings; - /** - * State of the deployment stack. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: DeploymentStackProvisioningState; - /** - * The correlation id of the last Deployment stack upsert or delete operation. It is in GUID format and is used for tracing. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly correlationId?: string; - /** - * An array of resources that were detached during the most recent Deployment stack update. Detached means that the resource was removed from the template, but no relevant deletion operations were specified. So, the resource still exists while no longer being associated with the stack. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly detachedResources?: ResourceReference[]; - /** - * An array of resources that were deleted during the most recent Deployment stack update. Deleted means that the resource was removed from the template and relevant deletion operations were specified. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly deletedResources?: ResourceReference[]; - /** - * An array of resources that failed to reach goal state during the most recent update. Each resourceId is accompanied by an error message. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly failedResources?: ResourceReferenceExtended[]; - /** - * An array of resources currently managed by the deployment stack. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly resources?: ManagedResourceReference[]; - /** - * The resourceId of the deployment resource created by the deployment stack. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly deploymentId?: string; - /** - * The outputs of the deployment resource created by the deployment stack. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly outputs?: Record; - /** - * The duration of the last successful Deployment stack update. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly duration?: string; -} - -/** The Deployment stack validation result. */ -export interface DeploymentStackValidateResult - extends AzureResourceBase, - DeploymentStacksError { - /** The validation result details. */ - properties?: DeploymentStackValidateProperties; -} - -/** Deployment stack object. */ -export interface DeploymentStack extends AzureResourceBase { - /** The location of the Deployment stack. It cannot be changed after creation. It must be one of the supported Azure locations. */ - location?: string; - /** Deployment stack resource tags. */ - tags?: { [propertyName: string]: string }; - /** Deployment stack properties. */ - properties?: DeploymentStackProperties; -} - -/** Defines headers for DeploymentStacks_deleteAtResourceGroup operation. */ -export interface DeploymentStacksDeleteAtResourceGroupHeaders { - location?: string; -} - -/** Defines headers for DeploymentStacks_deleteAtSubscription operation. */ -export interface DeploymentStacksDeleteAtSubscriptionHeaders { - location?: string; -} - -/** Defines headers for DeploymentStacks_deleteAtManagementGroup operation. */ -export interface DeploymentStacksDeleteAtManagementGroupHeaders { - location?: string; -} - -/** Defines headers for DeploymentStacks_validateStackAtResourceGroup operation. */ -export interface DeploymentStacksValidateStackAtResourceGroupHeaders { - location?: string; - /** Number of seconds to wait before polling for status. */ - retryAfter?: string; -} - -/** Defines headers for DeploymentStacks_validateStackAtSubscription operation. */ -export interface DeploymentStacksValidateStackAtSubscriptionHeaders { - location?: string; - /** Number of seconds to wait before polling for status. */ - retryAfter?: string; -} - -/** Defines headers for DeploymentStacks_validateStackAtManagementGroup operation. */ -export interface DeploymentStacksValidateStackAtManagementGroupHeaders { - location?: string; - /** Number of seconds to wait before polling for status. */ - retryAfter?: string; -} - -/** Known values of {@link DeploymentStacksDeleteDetachEnum} that the service accepts. */ -export enum KnownDeploymentStacksDeleteDetachEnum { - /** Delete */ - Delete = "delete", - /** Detach */ - Detach = "detach", -} - -/** - * Defines values for DeploymentStacksDeleteDetachEnum. \ - * {@link KnownDeploymentStacksDeleteDetachEnum} can be used interchangeably with DeploymentStacksDeleteDetachEnum, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **delete** \ - * **detach** - */ -export type DeploymentStacksDeleteDetachEnum = string; - -/** Known values of {@link DenySettingsMode} that the service accepts. */ -export enum KnownDenySettingsMode { - /** Authorized users are able to read and modify the resources, but cannot delete. */ - DenyDelete = "denyDelete", - /** Authorized users can read from a resource, but cannot modify or delete it. */ - DenyWriteAndDelete = "denyWriteAndDelete", - /** No denyAssignments have been applied. */ - None = "none", -} - -/** - * Defines values for DenySettingsMode. \ - * {@link KnownDenySettingsMode} can be used interchangeably with DenySettingsMode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **denyDelete**: Authorized users are able to read and modify the resources, but cannot delete. \ - * **denyWriteAndDelete**: Authorized users can read from a resource, but cannot modify or delete it. \ - * **none**: No denyAssignments have been applied. - */ -export type DenySettingsMode = string; - -/** Known values of {@link DeploymentStackProvisioningState} that the service accepts. */ -export enum KnownDeploymentStackProvisioningState { - /** Creating */ - Creating = "creating", - /** Validating */ - Validating = "validating", - /** Waiting */ - Waiting = "waiting", - /** Deploying */ - Deploying = "deploying", - /** Canceling */ - Canceling = "canceling", - /** UpdatingDenyAssignments */ - UpdatingDenyAssignments = "updatingDenyAssignments", - /** DeletingResources */ - DeletingResources = "deletingResources", - /** Succeeded */ - Succeeded = "succeeded", - /** Failed */ - Failed = "failed", - /** Canceled */ - Canceled = "canceled", - /** Deleting */ - Deleting = "deleting", -} - -/** - * Defines values for DeploymentStackProvisioningState. \ - * {@link KnownDeploymentStackProvisioningState} can be used interchangeably with DeploymentStackProvisioningState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **creating** \ - * **validating** \ - * **waiting** \ - * **deploying** \ - * **canceling** \ - * **updatingDenyAssignments** \ - * **deletingResources** \ - * **succeeded** \ - * **failed** \ - * **canceled** \ - * **deleting** - */ -export type DeploymentStackProvisioningState = string; - -/** Known values of {@link ResourceStatusMode} that the service accepts. */ -export enum KnownResourceStatusMode { - /** This resource is managed by the deployment stack. */ - Managed = "managed", - /** Unable to remove the deny assignment on resource. */ - RemoveDenyFailed = "removeDenyFailed", - /** Unable to delete the resource from Azure. The delete will be retried on the next stack deployment, or can be deleted manually. */ - DeleteFailed = "deleteFailed", -} - -/** - * Defines values for ResourceStatusMode. \ - * {@link KnownResourceStatusMode} can be used interchangeably with ResourceStatusMode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **managed**: This resource is managed by the deployment stack. \ - * **removeDenyFailed**: Unable to remove the deny assignment on resource. \ - * **deleteFailed**: Unable to delete the resource from Azure. The delete will be retried on the next stack deployment, or can be deleted manually. - */ -export type ResourceStatusMode = string; - -/** Known values of {@link DenyStatusMode} that the service accepts. */ -export enum KnownDenyStatusMode { - /** Authorized users are able to read and modify the resources, but cannot delete. */ - DenyDelete = "denyDelete", - /** Resource type does not support denyAssignments. */ - NotSupported = "notSupported", - /** denyAssignments are not supported on resources outside the scope of the deployment stack. */ - Inapplicable = "inapplicable", - /** Authorized users can only read from a resource, but cannot modify or delete it. */ - DenyWriteAndDelete = "denyWriteAndDelete", - /** Deny assignment has been removed by Azure due to a resource management change (management group move, etc.) */ - RemovedBySystem = "removedBySystem", - /** No denyAssignments have been applied. */ - None = "none", -} - -/** - * Defines values for DenyStatusMode. \ - * {@link KnownDenyStatusMode} can be used interchangeably with DenyStatusMode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **denyDelete**: Authorized users are able to read and modify the resources, but cannot delete. \ - * **notSupported**: Resource type does not support denyAssignments. \ - * **inapplicable**: denyAssignments are not supported on resources outside the scope of the deployment stack. \ - * **denyWriteAndDelete**: Authorized users can only read from a resource, but cannot modify or delete it. \ - * **removedBySystem**: Deny assignment has been removed by Azure due to a resource management change (management group move, etc.) \ - * **none**: No denyAssignments have been applied. - */ -export type DenyStatusMode = string; - -/** Known values of {@link CreatedByType} that the service accepts. */ -export enum KnownCreatedByType { - /** User */ - User = "User", - /** Application */ - Application = "Application", - /** ManagedIdentity */ - ManagedIdentity = "ManagedIdentity", - /** Key */ - Key = "Key", -} - -/** - * Defines values for CreatedByType. \ - * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **User** \ - * **Application** \ - * **ManagedIdentity** \ - * **Key** - */ -export type CreatedByType = string; - -/** Known values of {@link UnmanageActionResourceMode} that the service accepts. */ -export enum KnownUnmanageActionResourceMode { - /** Delete */ - Delete = "delete", - /** Detach */ - Detach = "detach", -} - -/** - * Defines values for UnmanageActionResourceMode. \ - * {@link KnownUnmanageActionResourceMode} can be used interchangeably with UnmanageActionResourceMode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **delete** \ - * **detach** - */ -export type UnmanageActionResourceMode = string; - -/** Known values of {@link UnmanageActionResourceGroupMode} that the service accepts. */ -export enum KnownUnmanageActionResourceGroupMode { - /** Delete */ - Delete = "delete", - /** Detach */ - Detach = "detach", -} - -/** - * Defines values for UnmanageActionResourceGroupMode. \ - * {@link KnownUnmanageActionResourceGroupMode} can be used interchangeably with UnmanageActionResourceGroupMode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **delete** \ - * **detach** - */ -export type UnmanageActionResourceGroupMode = string; - -/** Known values of {@link UnmanageActionManagementGroupMode} that the service accepts. */ -export enum KnownUnmanageActionManagementGroupMode { - /** Delete */ - Delete = "delete", - /** Detach */ - Detach = "detach", -} - -/** - * Defines values for UnmanageActionManagementGroupMode. \ - * {@link KnownUnmanageActionManagementGroupMode} can be used interchangeably with UnmanageActionManagementGroupMode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **delete** \ - * **detach** - */ -export type UnmanageActionManagementGroupMode = string; - -/** Optional parameters. */ -export interface DeploymentStacksListAtResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listAtResourceGroup operation. */ -export type DeploymentStacksListAtResourceGroupResponse = - DeploymentStackListResult; - -/** Optional parameters. */ -export interface DeploymentStacksListAtSubscriptionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listAtSubscription operation. */ -export type DeploymentStacksListAtSubscriptionResponse = - DeploymentStackListResult; - -/** Optional parameters. */ -export interface DeploymentStacksListAtManagementGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listAtManagementGroup operation. */ -export type DeploymentStacksListAtManagementGroupResponse = - DeploymentStackListResult; - -/** Optional parameters. */ -export interface DeploymentStacksCreateOrUpdateAtResourceGroupOptionalParams - 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 createOrUpdateAtResourceGroup operation. */ -export type DeploymentStacksCreateOrUpdateAtResourceGroupResponse = - DeploymentStack; - -/** Optional parameters. */ -export interface DeploymentStacksGetAtResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getAtResourceGroup operation. */ -export type DeploymentStacksGetAtResourceGroupResponse = DeploymentStack; - -/** Optional parameters. */ -export interface DeploymentStacksDeleteAtResourceGroupOptionalParams - extends coreClient.OperationOptions { - /** Flag to indicate delete rather than detach for unmanaged resources. */ - unmanageActionResources?: UnmanageActionResourceMode; - /** Flag to indicate delete rather than detach for unmanaged resource groups. */ - unmanageActionResourceGroups?: UnmanageActionResourceGroupMode; - /** Flag to indicate delete rather than detach for unmanaged management groups. */ - unmanageActionManagementGroups?: UnmanageActionManagementGroupMode; - /** Flag to bypass service errors that indicate the stack resource list is not correctly synchronized. */ - bypassStackOutOfSyncError?: boolean; - /** 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 DeploymentStacksCreateOrUpdateAtSubscriptionOptionalParams - 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 createOrUpdateAtSubscription operation. */ -export type DeploymentStacksCreateOrUpdateAtSubscriptionResponse = - DeploymentStack; - -/** Optional parameters. */ -export interface DeploymentStacksGetAtSubscriptionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getAtSubscription operation. */ -export type DeploymentStacksGetAtSubscriptionResponse = DeploymentStack; - -/** Optional parameters. */ -export interface DeploymentStacksDeleteAtSubscriptionOptionalParams - extends coreClient.OperationOptions { - /** Flag to indicate delete rather than detach for unmanaged resources. */ - unmanageActionResources?: UnmanageActionResourceMode; - /** Flag to indicate delete rather than detach for unmanaged resource groups. */ - unmanageActionResourceGroups?: UnmanageActionResourceGroupMode; - /** Flag to indicate delete rather than detach for unmanaged management groups. */ - unmanageActionManagementGroups?: UnmanageActionManagementGroupMode; - /** Flag to bypass service errors that indicate the stack resource list is not correctly synchronized. */ - bypassStackOutOfSyncError?: boolean; - /** 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 DeploymentStacksCreateOrUpdateAtManagementGroupOptionalParams - 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 createOrUpdateAtManagementGroup operation. */ -export type DeploymentStacksCreateOrUpdateAtManagementGroupResponse = - DeploymentStack; - -/** Optional parameters. */ -export interface DeploymentStacksGetAtManagementGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getAtManagementGroup operation. */ -export type DeploymentStacksGetAtManagementGroupResponse = DeploymentStack; - -/** Optional parameters. */ -export interface DeploymentStacksDeleteAtManagementGroupOptionalParams - extends coreClient.OperationOptions { - /** Flag to indicate delete rather than detach for unmanaged resources. */ - unmanageActionResources?: UnmanageActionResourceMode; - /** Flag to indicate delete rather than detach for unmanaged resource groups. */ - unmanageActionResourceGroups?: UnmanageActionResourceGroupMode; - /** Flag to indicate delete rather than detach for unmanaged management groups. */ - unmanageActionManagementGroups?: UnmanageActionManagementGroupMode; - /** Flag to bypass service errors that indicate the stack resource list is not correctly synchronized. */ - bypassStackOutOfSyncError?: boolean; - /** 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 DeploymentStacksExportTemplateAtResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the exportTemplateAtResourceGroup operation. */ -export type DeploymentStacksExportTemplateAtResourceGroupResponse = - DeploymentStackTemplateDefinition; - -/** Optional parameters. */ -export interface DeploymentStacksExportTemplateAtSubscriptionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the exportTemplateAtSubscription operation. */ -export type DeploymentStacksExportTemplateAtSubscriptionResponse = - DeploymentStackTemplateDefinition; - -/** Optional parameters. */ -export interface DeploymentStacksExportTemplateAtManagementGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the exportTemplateAtManagementGroup operation. */ -export type DeploymentStacksExportTemplateAtManagementGroupResponse = - DeploymentStackTemplateDefinition; - -/** Optional parameters. */ -export interface DeploymentStacksValidateStackAtResourceGroupOptionalParams - 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 validateStackAtResourceGroup operation. */ -export type DeploymentStacksValidateStackAtResourceGroupResponse = - DeploymentStackValidateResult; - -/** Optional parameters. */ -export interface DeploymentStacksValidateStackAtSubscriptionOptionalParams - 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 validateStackAtSubscription operation. */ -export type DeploymentStacksValidateStackAtSubscriptionResponse = - DeploymentStackValidateResult; - -/** Optional parameters. */ -export interface DeploymentStacksValidateStackAtManagementGroupOptionalParams - 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 validateStackAtManagementGroup operation. */ -export type DeploymentStacksValidateStackAtManagementGroupResponse = - DeploymentStackValidateResult; - -/** Optional parameters. */ -export interface DeploymentStacksListAtResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listAtResourceGroupNext operation. */ -export type DeploymentStacksListAtResourceGroupNextResponse = - DeploymentStackListResult; - -/** Optional parameters. */ -export interface DeploymentStacksListAtSubscriptionNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listAtSubscriptionNext operation. */ -export type DeploymentStacksListAtSubscriptionNextResponse = - DeploymentStackListResult; - -/** Optional parameters. */ -export interface DeploymentStacksListAtManagementGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listAtManagementGroupNext operation. */ -export type DeploymentStacksListAtManagementGroupNextResponse = - DeploymentStackListResult; - -/** Optional parameters. */ -export interface DeploymentStacksClientOptionalParams - extends coreClient.ServiceClientOptions { - /** server parameter */ - $host?: string; - /** Api Version */ - apiVersion?: string; - /** Overrides client endpoint. */ - endpoint?: string; -} +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + DeploymentStacksWhatIfResult, + DeploymentStacksWhatIfResultProperties, + ErrorDetail, + ErrorAdditionalInfo, + DeploymentStacksTemplateLink, + DeploymentParameter, + KeyVaultParameterReference, + KeyVaultReference, + DeploymentStacksParametersLink, + DeploymentExtensionConfig, + DeploymentExtensionConfigItem, + DeploymentExternalInput, + DeploymentExternalInputDefinition, + ActionOnUnmanage, + KnownDeploymentStacksDeleteDetachEnum, + DeploymentStacksDeleteDetachEnum, + KnownDeploymentStacksResourcesWithoutDeleteSupportEnum, + DeploymentStacksResourcesWithoutDeleteSupportEnum, + DeploymentStacksDebugSetting, + DenySettings, + KnownDenySettingsMode, + DenySettingsMode, + KnownDeploymentStackProvisioningState, + DeploymentStackProvisioningState, + KnownValidationLevel, + ValidationLevel, + DeploymentStacksWhatIfChange, + DeploymentStacksWhatIfResourceChange, + DeploymentExtension, + KnownDeploymentStacksWhatIfChangeType, + DeploymentStacksWhatIfChangeType, + KnownDeploymentStacksWhatIfChangeCertainty, + DeploymentStacksWhatIfChangeCertainty, + DeploymentStacksChangeBaseDeploymentStacksManagementStatus, + KnownDeploymentStacksManagementStatus, + DeploymentStacksManagementStatus, + DeploymentStacksChangeBaseDenyStatusMode, + KnownDenyStatusMode, + DenyStatusMode, + DeploymentStacksChangeDeltaRecord, + DeploymentStacksWhatIfPropertyChange, + KnownDeploymentStacksWhatIfPropertyChangeType, + DeploymentStacksWhatIfPropertyChangeType, + DeploymentStacksChangeDeltaDenySettings, + DeploymentStacksChangeBase, + DeploymentStacksDiagnostic, + KnownDeploymentStacksDiagnosticLevel, + DeploymentStacksDiagnosticLevel, + ProxyResource, + Resource, + SystemData, + KnownCreatedByType, + CreatedByType, + ErrorResponse, + DeploymentStack, + DeploymentStackProperties, + ResourceReference, + ResourceReferenceExtended, + ManagedResourceReference, + KnownResourceStatusMode, + ResourceStatusMode, + DeploymentStackValidateResult, + DeploymentStackValidateProperties, + DeploymentStackTemplateDefinition, + KnownVersions, +} from "./models.js"; diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/models/mappers.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/models/mappers.ts deleted file mode 100644 index 594bd50aab3e..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/models/mappers.ts +++ /dev/null @@ -1,910 +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. - */ - -import * as coreClient from "@azure/core-client"; - -export const DeploymentStackListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DeploymentStackListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DeploymentStack", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DeploymentStacksTemplateLink: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DeploymentStacksTemplateLink", - modelProperties: { - uri: { - serializedName: "uri", - type: { - name: "String", - }, - }, - id: { - serializedName: "id", - type: { - name: "String", - }, - }, - relativePath: { - serializedName: "relativePath", - type: { - name: "String", - }, - }, - queryString: { - serializedName: "queryString", - type: { - name: "String", - }, - }, - contentVersion: { - serializedName: "contentVersion", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DeploymentParameter: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DeploymentParameter", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "any", - }, - }, - type: { - serializedName: "type", - type: { - name: "String", - }, - }, - reference: { - serializedName: "reference", - type: { - name: "Composite", - className: "KeyVaultParameterReference", - }, - }, - }, - }, -}; - -export const KeyVaultParameterReference: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "KeyVaultParameterReference", - modelProperties: { - keyVault: { - serializedName: "keyVault", - type: { - name: "Composite", - className: "KeyVaultReference", - }, - }, - secretName: { - serializedName: "secretName", - required: true, - type: { - name: "String", - }, - }, - secretVersion: { - serializedName: "secretVersion", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const KeyVaultReference: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "KeyVaultReference", - modelProperties: { - id: { - serializedName: "id", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DeploymentStacksParametersLink: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DeploymentStacksParametersLink", - modelProperties: { - uri: { - serializedName: "uri", - required: true, - type: { - name: "String", - }, - }, - contentVersion: { - serializedName: "contentVersion", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ActionOnUnmanage: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ActionOnUnmanage", - modelProperties: { - resources: { - serializedName: "resources", - required: true, - type: { - name: "String", - }, - }, - resourceGroups: { - serializedName: "resourceGroups", - type: { - name: "String", - }, - }, - managementGroups: { - serializedName: "managementGroups", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DeploymentStacksDebugSetting: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DeploymentStacksDebugSetting", - modelProperties: { - detailLevel: { - serializedName: "detailLevel", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DenySettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DenySettings", - modelProperties: { - mode: { - serializedName: "mode", - required: true, - type: { - name: "String", - }, - }, - excludedPrincipals: { - serializedName: "excludedPrincipals", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - excludedActions: { - serializedName: "excludedActions", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - applyToChildScopes: { - serializedName: "applyToChildScopes", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const ResourceReference: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceReference", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DeploymentStacksError: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DeploymentStacksError", - modelProperties: { - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ErrorDetail", - }, - }, - }, - }, -}; - -export const ErrorDetail: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorDetail", - modelProperties: { - code: { - serializedName: "code", - readOnly: true, - type: { - name: "String", - }, - }, - message: { - serializedName: "message", - readOnly: true, - type: { - name: "String", - }, - }, - target: { - serializedName: "target", - readOnly: true, - type: { - name: "String", - }, - }, - details: { - serializedName: "details", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorDetail", - }, - }, - }, - }, - additionalInfo: { - serializedName: "additionalInfo", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorAdditionalInfo", - }, - }, - }, - }, - }, - }, -}; - -export const ErrorAdditionalInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorAdditionalInfo", - modelProperties: { - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - info: { - serializedName: "info", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "any" } }, - }, - }, - }, - }, -}; - -export const AzureResourceBase: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AzureResourceBase", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData", - }, - }, - }, - }, -}; - -export const SystemData: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SystemData", - modelProperties: { - createdBy: { - serializedName: "createdBy", - type: { - name: "String", - }, - }, - createdByType: { - serializedName: "createdByType", - type: { - name: "String", - }, - }, - createdAt: { - serializedName: "createdAt", - type: { - name: "DateTime", - }, - }, - lastModifiedBy: { - serializedName: "lastModifiedBy", - type: { - name: "String", - }, - }, - lastModifiedByType: { - serializedName: "lastModifiedByType", - type: { - name: "String", - }, - }, - lastModifiedAt: { - serializedName: "lastModifiedAt", - type: { - name: "DateTime", - }, - }, - }, - }, -}; - -export const DeploymentStackTemplateDefinition: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DeploymentStackTemplateDefinition", - modelProperties: { - template: { - serializedName: "template", - type: { - name: "Dictionary", - value: { type: { name: "any" } }, - }, - }, - templateLink: { - serializedName: "templateLink", - type: { - name: "Composite", - className: "DeploymentStacksTemplateLink", - }, - }, - }, - }, -}; - -export const DeploymentStackValidateProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DeploymentStackValidateProperties", - modelProperties: { - actionOnUnmanage: { - serializedName: "actionOnUnmanage", - type: { - name: "Composite", - className: "ActionOnUnmanage", - }, - }, - correlationId: { - serializedName: "correlationId", - type: { - name: "String", - }, - }, - denySettings: { - serializedName: "denySettings", - type: { - name: "Composite", - className: "DenySettings", - }, - }, - deploymentScope: { - serializedName: "deploymentScope", - type: { - name: "String", - }, - }, - description: { - serializedName: "description", - type: { - name: "String", - }, - }, - parameters: { - serializedName: "parameters", - type: { - name: "Dictionary", - value: { - type: { name: "Composite", className: "DeploymentParameter" }, - }, - }, - }, - templateLink: { - serializedName: "templateLink", - type: { - name: "Composite", - className: "DeploymentStacksTemplateLink", - }, - }, - validatedResources: { - serializedName: "validatedResources", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceReference", - }, - }, - }, - }, - }, - }, -}; - -export const ResourceReferenceExtended: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceReferenceExtended", - modelProperties: { - ...ResourceReference.type.modelProperties, - ...DeploymentStacksError.type.modelProperties, - }, - }, -}; - -export const ManagedResourceReference: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ManagedResourceReference", - modelProperties: { - ...ResourceReference.type.modelProperties, - status: { - serializedName: "status", - type: { - name: "String", - }, - }, - denyStatus: { - defaultValue: "none", - serializedName: "denyStatus", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DeploymentStackProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DeploymentStackProperties", - modelProperties: { - ...DeploymentStacksError.type.modelProperties, - template: { - serializedName: "template", - type: { - name: "Dictionary", - value: { type: { name: "any" } }, - }, - }, - templateLink: { - serializedName: "templateLink", - type: { - name: "Composite", - className: "DeploymentStacksTemplateLink", - }, - }, - parameters: { - serializedName: "parameters", - type: { - name: "Dictionary", - value: { - type: { name: "Composite", className: "DeploymentParameter" }, - }, - }, - }, - parametersLink: { - serializedName: "parametersLink", - type: { - name: "Composite", - className: "DeploymentStacksParametersLink", - }, - }, - actionOnUnmanage: { - serializedName: "actionOnUnmanage", - type: { - name: "Composite", - className: "ActionOnUnmanage", - }, - }, - debugSetting: { - serializedName: "debugSetting", - type: { - name: "Composite", - className: "DeploymentStacksDebugSetting", - }, - }, - bypassStackOutOfSyncError: { - serializedName: "bypassStackOutOfSyncError", - type: { - name: "Boolean", - }, - }, - deploymentScope: { - serializedName: "deploymentScope", - type: { - name: "String", - }, - }, - description: { - constraints: { - MaxLength: 4096, - }, - serializedName: "description", - type: { - name: "String", - }, - }, - denySettings: { - serializedName: "denySettings", - type: { - name: "Composite", - className: "DenySettings", - }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - correlationId: { - serializedName: "correlationId", - readOnly: true, - type: { - name: "String", - }, - }, - detachedResources: { - serializedName: "detachedResources", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceReference", - }, - }, - }, - }, - deletedResources: { - serializedName: "deletedResources", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceReference", - }, - }, - }, - }, - failedResources: { - serializedName: "failedResources", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceReferenceExtended", - }, - }, - }, - }, - resources: { - serializedName: "resources", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ManagedResourceReference", - }, - }, - }, - }, - deploymentId: { - serializedName: "deploymentId", - readOnly: true, - type: { - name: "String", - }, - }, - outputs: { - serializedName: "outputs", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "any" } }, - }, - }, - duration: { - serializedName: "duration", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DeploymentStackValidateResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DeploymentStackValidateResult", - modelProperties: { - ...AzureResourceBase.type.modelProperties, - ...DeploymentStacksError.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "DeploymentStackValidateProperties", - }, - }, - }, - }, -}; - -export const DeploymentStack: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DeploymentStack", - modelProperties: { - ...AzureResourceBase.type.modelProperties, - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "DeploymentStackProperties", - }, - }, - }, - }, -}; - -export const DeploymentStacksDeleteAtResourceGroupHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "DeploymentStacksDeleteAtResourceGroupHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - }, - }, - }; - -export const DeploymentStacksDeleteAtSubscriptionHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "DeploymentStacksDeleteAtSubscriptionHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - }, - }, - }; - -export const DeploymentStacksDeleteAtManagementGroupHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "DeploymentStacksDeleteAtManagementGroupHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - }, - }, - }; - -export const DeploymentStacksValidateStackAtResourceGroupHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "DeploymentStacksValidateStackAtResourceGroupHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "String", - }, - }, - }, - }, - }; - -export const DeploymentStacksValidateStackAtSubscriptionHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "DeploymentStacksValidateStackAtSubscriptionHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "String", - }, - }, - }, - }, - }; - -export const DeploymentStacksValidateStackAtManagementGroupHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "DeploymentStacksValidateStackAtManagementGroupHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "String", - }, - }, - }, - }, - }; diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/models/models.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/models/models.ts new file mode 100644 index 000000000000..d062f4cecca0 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/models/models.ts @@ -0,0 +1,1976 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { areAllPropsUndefined } from "../static-helpers/serialization/check-prop-undefined.js"; +import { serializeRecord } from "../static-helpers/serialization/serialize-record.js"; + +/** + * This file contains only generated model types and their (de)serializers. + * Disable the following rules for internal models with '_' prefix and deserializers which require 'any' for raw JSON input. + */ +/* eslint-disable @typescript-eslint/naming-convention */ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ +/** Deployment stack object. */ +export interface DeploymentStacksWhatIfResult extends ProxyResource { + /** The resource-specific properties for this resource. */ + properties?: DeploymentStacksWhatIfResultProperties; + /** The geo-location where the resource lives. Required for subscription and management group scoped stacks. The location is inherited from the resource group for resource group scoped stacks. */ + location?: string; + /** Resource tags. */ + tags?: Record; +} + +export function deploymentStacksWhatIfResultSerializer(item: DeploymentStacksWhatIfResult): any { + return { + properties: !item["properties"] + ? item["properties"] + : deploymentStacksWhatIfResultPropertiesSerializer(item["properties"]), + location: item["location"], + tags: item["tags"], + }; +} + +export function deploymentStacksWhatIfResultDeserializer(item: any): DeploymentStacksWhatIfResult { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : deploymentStacksWhatIfResultPropertiesDeserializer(item["properties"]), + location: item["location"], + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + }; +} + +/** DeploymentStack WhatIfResult Properties */ +export interface DeploymentStacksWhatIfResultProperties { + /** The error detail. */ + error?: ErrorDetail; + /** 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?: DeploymentStacksTemplateLink; + /** Name and value pairs that define the deployment parameters for the template. Use this element when providing the parameter values directly in the request, rather than linking to an existing parameter file. Use either the parametersLink property or the parameters property, but not both. */ + parameters?: Record; + /** The URI of parameters file. Use this element to link to an existing parameters file. Use either the parametersLink property or the parameters property, but not both. */ + parametersLink?: DeploymentStacksParametersLink; + /** The deployment extension configs. Keys of this object are extension aliases as defined in the deployment template. */ + extensionConfigs?: Record; + /** External input values, used by external tooling for parameter evaluation. */ + externalInputs?: Record; + /** External input definitions, used by external tooling to define expected external input values. */ + externalInputDefinitions?: Record; + /** Defines the behavior of resources that are no longer managed after the Deployment stack is updated or deleted. */ + actionOnUnmanage: ActionOnUnmanage; + /** The debug setting of the deployment. */ + debugSetting?: DeploymentStacksDebugSetting; + /** The scope at which the initial deployment should be created. If a scope is not specified, it will default to the scope of the deployment stack. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroupId}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'). */ + deploymentScope?: string; + /** Deployment stack description. Max length of 4096 characters. */ + description?: string; + /** Defines how resources deployed by the stack are locked. */ + denySettings: DenySettings; + /** State of the deployment stack. */ + readonly provisioningState?: DeploymentStackProvisioningState; + /** The correlation id of the last Deployment stack upsert or delete operation. It is in GUID format and is used for tracing. */ + readonly correlationId?: string; + /** The validation level of the deployment stack */ + validationLevel?: ValidationLevel; + /** The deployment stack id to use as the basis for comparison. */ + deploymentStackResourceId: string; + /** The timestamp for when the deployment stack was last modified. This can be used to determine if the what-if data is still current. */ + readonly deploymentStackLastModified?: Date; + /** The interval to persist the deployment stack what-if result in ISO 8601 format. */ + retentionInterval: string; + /** All of the changes predicted by the deployment stack what-if operation. */ + readonly changes?: DeploymentStacksWhatIfChange; + /** List of resource diagnostics detected by What-If operation. */ + readonly diagnostics?: DeploymentStacksDiagnostic[]; +} + +export function deploymentStacksWhatIfResultPropertiesSerializer( + item: DeploymentStacksWhatIfResultProperties, +): any { + return { + error: !item["error"] ? item["error"] : errorDetailSerializer(item["error"]), + template: item["template"], + templateLink: !item["templateLink"] + ? item["templateLink"] + : deploymentStacksTemplateLinkSerializer(item["templateLink"]), + parameters: !item["parameters"] + ? item["parameters"] + : deploymentParameterRecordSerializer(item["parameters"]), + parametersLink: !item["parametersLink"] + ? item["parametersLink"] + : deploymentStacksParametersLinkSerializer(item["parametersLink"]), + extensionConfigs: !item["extensionConfigs"] + ? item["extensionConfigs"] + : deploymentExtensionConfigRecordSerializer(item["extensionConfigs"]), + externalInputs: !item["externalInputs"] + ? item["externalInputs"] + : deploymentExternalInputRecordSerializer(item["externalInputs"]), + externalInputDefinitions: !item["externalInputDefinitions"] + ? item["externalInputDefinitions"] + : deploymentExternalInputDefinitionRecordSerializer(item["externalInputDefinitions"]), + actionOnUnmanage: actionOnUnmanageSerializer(item["actionOnUnmanage"]), + debugSetting: !item["debugSetting"] + ? item["debugSetting"] + : deploymentStacksDebugSettingSerializer(item["debugSetting"]), + deploymentScope: item["deploymentScope"], + description: item["description"], + denySettings: denySettingsSerializer(item["denySettings"]), + validationLevel: item["validationLevel"], + deploymentStackResourceId: item["deploymentStackResourceId"], + retentionInterval: item["retentionInterval"], + }; +} + +export function deploymentStacksWhatIfResultPropertiesDeserializer( + item: any, +): DeploymentStacksWhatIfResultProperties { + return { + error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]), + template: !item["template"] + ? item["template"] + : Object.fromEntries(Object.entries(item["template"]).map(([k, p]: [string, any]) => [k, p])), + templateLink: !item["templateLink"] + ? item["templateLink"] + : deploymentStacksTemplateLinkDeserializer(item["templateLink"]), + parameters: !item["parameters"] + ? item["parameters"] + : deploymentParameterRecordDeserializer(item["parameters"]), + parametersLink: !item["parametersLink"] + ? item["parametersLink"] + : deploymentStacksParametersLinkDeserializer(item["parametersLink"]), + extensionConfigs: !item["extensionConfigs"] + ? item["extensionConfigs"] + : deploymentExtensionConfigRecordDeserializer(item["extensionConfigs"]), + externalInputs: !item["externalInputs"] + ? item["externalInputs"] + : deploymentExternalInputRecordDeserializer(item["externalInputs"]), + externalInputDefinitions: !item["externalInputDefinitions"] + ? item["externalInputDefinitions"] + : deploymentExternalInputDefinitionRecordDeserializer(item["externalInputDefinitions"]), + actionOnUnmanage: actionOnUnmanageDeserializer(item["actionOnUnmanage"]), + debugSetting: !item["debugSetting"] + ? item["debugSetting"] + : deploymentStacksDebugSettingDeserializer(item["debugSetting"]), + deploymentScope: item["deploymentScope"], + description: item["description"], + denySettings: denySettingsDeserializer(item["denySettings"]), + provisioningState: item["provisioningState"], + correlationId: item["correlationId"], + validationLevel: item["validationLevel"], + deploymentStackResourceId: item["deploymentStackResourceId"], + deploymentStackLastModified: !item["deploymentStackLastModified"] + ? item["deploymentStackLastModified"] + : new Date(item["deploymentStackLastModified"]), + retentionInterval: item["retentionInterval"], + changes: !item["changes"] + ? item["changes"] + : deploymentStacksWhatIfChangeDeserializer(item["changes"]), + diagnostics: !item["diagnostics"] + ? item["diagnostics"] + : deploymentStacksDiagnosticArrayDeserializer(item["diagnostics"]), + }; +} + +/** The error detail. */ +export interface ErrorDetail { + /** The error code. */ + readonly code?: string; + /** The error message. */ + readonly message?: string; + /** The error target. */ + readonly target?: string; + /** The error details. */ + readonly details?: ErrorDetail[]; + /** The error additional info. */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +export function errorDetailSerializer(item: ErrorDetail): any { + return item; +} + +export function errorDetailDeserializer(item: any): ErrorDetail { + return { + code: item["code"], + message: item["message"], + target: item["target"], + details: !item["details"] ? item["details"] : errorDetailArrayDeserializer(item["details"]), + additionalInfo: !item["additionalInfo"] + ? item["additionalInfo"] + : errorAdditionalInfoArrayDeserializer(item["additionalInfo"]), + }; +} + +export function errorDetailArraySerializer(result: Array): any[] { + return result.map((item) => { + return errorDetailSerializer(item); + }); +} + +export function errorDetailArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return errorDetailDeserializer(item); + }); +} + +export function errorAdditionalInfoArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return errorAdditionalInfoDeserializer(item); + }); +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** The additional info type. */ + readonly type?: string; + /** The additional info. */ + readonly info?: any; +} + +export function errorAdditionalInfoDeserializer(item: any): ErrorAdditionalInfo { + return { + type: item["type"], + info: item["info"], + }; +} + +/** Entity representing the reference to the template. */ +export interface DeploymentStacksTemplateLink { + /** The URI of the template to deploy. Use either the uri or id property, but not both. */ + uri?: string; + /** The resourceId 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. */ + relativePath?: string; + /** The query string (for example, a SAS token) to be used with the templateLink URI. */ + queryString?: string; + /** If included, must match the ContentVersion in the template. */ + contentVersion?: string; +} + +export function deploymentStacksTemplateLinkSerializer(item: DeploymentStacksTemplateLink): any { + return { + uri: item["uri"], + id: item["id"], + relativePath: item["relativePath"], + queryString: item["queryString"], + contentVersion: item["contentVersion"], + }; +} + +export function deploymentStacksTemplateLinkDeserializer(item: any): DeploymentStacksTemplateLink { + return { + uri: item["uri"], + id: item["id"], + relativePath: item["relativePath"], + queryString: item["queryString"], + contentVersion: item["contentVersion"], + }; +} + +export function deploymentParameterRecordSerializer( + item: Record, +): Record { + const result: Record = {}; + Object.keys(item).map((key) => { + result[key] = !item[key] ? item[key] : deploymentParameterSerializer(item[key]); + }); + return result; +} + +export function deploymentParameterRecordDeserializer( + item: Record, +): Record { + const result: Record = {}; + Object.keys(item).map((key) => { + result[key] = !item[key] ? item[key] : deploymentParameterDeserializer(item[key]); + }); + return result; +} + +/** Deployment parameter for the template. */ +export interface DeploymentParameter { + /** Input value to the parameter. */ + value?: any; + /** Type of the value. */ + type?: string; + /** Azure Key Vault parameter reference. */ + reference?: KeyVaultParameterReference; + /** Input expression to the parameter. */ + expression?: string; +} + +export function deploymentParameterSerializer(item: DeploymentParameter): any { + return { + value: item["value"], + type: item["type"], + reference: !item["reference"] + ? item["reference"] + : keyVaultParameterReferenceSerializer(item["reference"]), + expression: item["expression"], + }; +} + +export function deploymentParameterDeserializer(item: any): DeploymentParameter { + return { + value: item["value"], + type: item["type"], + reference: !item["reference"] + ? item["reference"] + : keyVaultParameterReferenceDeserializer(item["reference"]), + expression: item["expression"], + }; +} + +/** Azure Key Vault parameter reference. */ +export interface KeyVaultParameterReference { + /** Azure Key Vault reference. */ + keyVault: KeyVaultReference; + /** Azure Key Vault secret name. */ + secretName: string; + /** Azure Key Vault secret version. */ + secretVersion?: string; +} + +export function keyVaultParameterReferenceSerializer(item: KeyVaultParameterReference): any { + return { + keyVault: keyVaultReferenceSerializer(item["keyVault"]), + secretName: item["secretName"], + secretVersion: item["secretVersion"], + }; +} + +export function keyVaultParameterReferenceDeserializer(item: any): KeyVaultParameterReference { + return { + keyVault: keyVaultReferenceDeserializer(item["keyVault"]), + secretName: item["secretName"], + secretVersion: item["secretVersion"], + }; +} + +/** Azure Key Vault reference. */ +export interface KeyVaultReference { + /** Azure Key Vault resourceId. */ + id: string; +} + +export function keyVaultReferenceSerializer(item: KeyVaultReference): any { + return { id: item["id"] }; +} + +export function keyVaultReferenceDeserializer(item: any): KeyVaultReference { + return { + id: item["id"], + }; +} + +/** Entity representing the reference to the deployment parameters. */ +export interface DeploymentStacksParametersLink { + /** The URI of the parameters file. */ + uri: string; + /** If included, must match the ContentVersion in the template. */ + contentVersion?: string; +} + +export function deploymentStacksParametersLinkSerializer( + item: DeploymentStacksParametersLink, +): any { + return { uri: item["uri"], contentVersion: item["contentVersion"] }; +} + +export function deploymentStacksParametersLinkDeserializer( + item: any, +): DeploymentStacksParametersLink { + return { + uri: item["uri"], + contentVersion: item["contentVersion"], + }; +} + +export function deploymentExtensionConfigRecordSerializer( + item: Record, +): Record { + const result: Record = {}; + Object.keys(item).map((key) => { + result[key] = !item[key] ? item[key] : deploymentExtensionConfigSerializer(item[key]); + }); + return result; +} + +export function deploymentExtensionConfigRecordDeserializer( + item: Record, +): Record { + const result: Record = {}; + Object.keys(item).map((key) => { + result[key] = !item[key] ? item[key] : deploymentExtensionConfigDeserializer(item[key]); + }); + return result; +} + +/** The configuration of a deployment extension. The keys of this object should align with the extension config schema. */ +export interface DeploymentExtensionConfig { + /** Additional properties */ + additionalProperties?: Record; +} + +export function deploymentExtensionConfigSerializer(item: DeploymentExtensionConfig): any { + return { + ...serializeRecord( + item.additionalProperties ?? {}, + undefined, + deploymentExtensionConfigItemSerializer, + ), + }; +} + +export function deploymentExtensionConfigDeserializer(item: any): DeploymentExtensionConfig { + return { + additionalProperties: serializeRecord(item, [], deploymentExtensionConfigItemDeserializer), + }; +} + +/** The value or how to get a value for an extension config property. */ +export interface DeploymentExtensionConfigItem { + /** The type of the value. */ + readonly type?: string; + /** The value of the config item. The type is determined by the extension config schema. */ + value?: any; + /** The key vault reference of the config item. */ + keyVaultReference?: KeyVaultParameterReference; +} + +export function deploymentExtensionConfigItemSerializer(item: DeploymentExtensionConfigItem): any { + return { + value: item["value"], + keyVaultReference: !item["keyVaultReference"] + ? item["keyVaultReference"] + : keyVaultParameterReferenceSerializer(item["keyVaultReference"]), + }; +} + +export function deploymentExtensionConfigItemDeserializer( + item: any, +): DeploymentExtensionConfigItem { + return { + type: item["type"], + value: item["value"], + keyVaultReference: !item["keyVaultReference"] + ? item["keyVaultReference"] + : keyVaultParameterReferenceDeserializer(item["keyVaultReference"]), + }; +} + +export function deploymentExternalInputRecordSerializer( + item: Record, +): Record { + const result: Record = {}; + Object.keys(item).map((key) => { + result[key] = !item[key] ? item[key] : deploymentExternalInputSerializer(item[key]); + }); + return result; +} + +export function deploymentExternalInputRecordDeserializer( + item: Record, +): Record { + const result: Record = {}; + Object.keys(item).map((key) => { + result[key] = !item[key] ? item[key] : deploymentExternalInputDeserializer(item[key]); + }); + return result; +} + +/** Deployment external input for parameterization. */ +export interface DeploymentExternalInput { + /** External input value. */ + value: any; +} + +export function deploymentExternalInputSerializer(item: DeploymentExternalInput): any { + return { value: item["value"] }; +} + +export function deploymentExternalInputDeserializer(item: any): DeploymentExternalInput { + return { + value: item["value"], + }; +} + +export function deploymentExternalInputDefinitionRecordSerializer( + item: Record, +): Record { + const result: Record = {}; + Object.keys(item).map((key) => { + result[key] = !item[key] ? item[key] : deploymentExternalInputDefinitionSerializer(item[key]); + }); + return result; +} + +export function deploymentExternalInputDefinitionRecordDeserializer( + item: Record, +): Record { + const result: Record = {}; + Object.keys(item).map((key) => { + result[key] = !item[key] ? item[key] : deploymentExternalInputDefinitionDeserializer(item[key]); + }); + return result; +} + +/** Deployment external input definition for parameterization. */ +export interface DeploymentExternalInputDefinition { + /** The kind of external input. */ + kind: string; + /** Configuration for the external input. */ + config?: any; +} + +export function deploymentExternalInputDefinitionSerializer( + item: DeploymentExternalInputDefinition, +): any { + return { kind: item["kind"], config: item["config"] }; +} + +export function deploymentExternalInputDefinitionDeserializer( + item: any, +): DeploymentExternalInputDefinition { + return { + kind: item["kind"], + config: item["config"], + }; +} + +/** Defines the behavior of resources that are no longer managed after the stack is updated or deleted. */ +export interface ActionOnUnmanage { + /** Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. */ + resources: DeploymentStacksDeleteDetachEnum; + /** Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. */ + resourceGroups?: DeploymentStacksDeleteDetachEnum; + /** Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. */ + managementGroups?: DeploymentStacksDeleteDetachEnum; + /** Some resources do not support deletion. This flag will denote how the stack should handle those resources. */ + resourcesWithoutDeleteSupport?: DeploymentStacksResourcesWithoutDeleteSupportEnum; +} + +export function actionOnUnmanageSerializer(item: ActionOnUnmanage): any { + return { + resources: item["resources"], + resourceGroups: item["resourceGroups"], + managementGroups: item["managementGroups"], + resourcesWithoutDeleteSupport: item["resourcesWithoutDeleteSupport"], + }; +} + +export function actionOnUnmanageDeserializer(item: any): ActionOnUnmanage { + return { + resources: item["resources"], + resourceGroups: item["resourceGroups"], + managementGroups: item["managementGroups"], + resourcesWithoutDeleteSupport: item["resourcesWithoutDeleteSupport"], + }; +} + +/** Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. */ +export enum KnownDeploymentStacksDeleteDetachEnum { + /** Delete the specified resources from Azure */ + Delete = "delete", + /** Keep the specified resources in Azure */ + Detach = "detach", +} + +/** + * Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. \ + * {@link KnownDeploymentStacksDeleteDetachEnum} can be used interchangeably with DeploymentStacksDeleteDetachEnum, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **delete**: Delete the specified resources from Azure \ + * **detach**: Keep the specified resources in Azure + */ +export type DeploymentStacksDeleteDetachEnum = string; + +/** Specifies an action for resources that do not support deletion. */ +export enum KnownDeploymentStacksResourcesWithoutDeleteSupportEnum { + /** Detach the specified resources from the deployment stack and continue */ + Detach = "detach", + /** Fail the deployment stack if resources cannot be deleted */ + Fail = "fail", +} + +/** + * Specifies an action for resources that do not support deletion. \ + * {@link KnownDeploymentStacksResourcesWithoutDeleteSupportEnum} can be used interchangeably with DeploymentStacksResourcesWithoutDeleteSupportEnum, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **detach**: Detach the specified resources from the deployment stack and continue \ + * **fail**: Fail the deployment stack if resources cannot be deleted + */ +export type DeploymentStacksResourcesWithoutDeleteSupportEnum = string; + +/** The debug setting. */ +export interface DeploymentStacksDebugSetting { + /** 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 that is being passed in during deployment. By logging information about the request or response, sensitive data that is retrieved through the deployment operations could potentially be exposed. */ + detailLevel?: string; +} + +export function deploymentStacksDebugSettingSerializer(item: DeploymentStacksDebugSetting): any { + return { detailLevel: item["detailLevel"] }; +} + +export function deploymentStacksDebugSettingDeserializer(item: any): DeploymentStacksDebugSetting { + return { + detailLevel: item["detailLevel"], + }; +} + +/** Defines how resources deployed by the Deployment stack are locked. */ +export interface DenySettings { + /** denySettings Mode that defines denied actions. */ + mode: DenySettingsMode; + /** List of AAD principal IDs excluded from the lock. Up to 5 principals are permitted. */ + excludedPrincipals?: string[]; + /** List of role-based management operations that are excluded from the denySettings. Up to 200 actions are permitted. If the denySetting mode is set to 'denyWriteAndDelete', then the following actions are automatically appended to 'excludedActions': '*\/read' and 'Microsoft.Authorization/locks/delete'. If the denySetting mode is set to 'denyDelete', then the following actions are automatically appended to 'excludedActions': 'Microsoft.Authorization/locks/delete'. Duplicate actions will be removed. */ + excludedActions?: string[]; + /** DenySettings will be applied to child resource scopes of every managed resource with a deny assignment. */ + applyToChildScopes?: boolean; +} + +export function denySettingsSerializer(item: DenySettings): any { + return { + mode: item["mode"], + excludedPrincipals: !item["excludedPrincipals"] + ? item["excludedPrincipals"] + : item["excludedPrincipals"].map((p: any) => { + return p; + }), + excludedActions: !item["excludedActions"] + ? item["excludedActions"] + : item["excludedActions"].map((p: any) => { + return p; + }), + applyToChildScopes: item["applyToChildScopes"], + }; +} + +export function denySettingsDeserializer(item: any): DenySettings { + return { + mode: item["mode"], + excludedPrincipals: !item["excludedPrincipals"] + ? item["excludedPrincipals"] + : item["excludedPrincipals"].map((p: any) => { + return p; + }), + excludedActions: !item["excludedActions"] + ? item["excludedActions"] + : item["excludedActions"].map((p: any) => { + return p; + }), + applyToChildScopes: item["applyToChildScopes"], + }; +} + +/** denySettings Mode that defines denied actions. */ +export enum KnownDenySettingsMode { + /** Authorized users are able to read and modify the resources, but cannot delete. */ + DenyDelete = "denyDelete", + /** Authorized users can read from a resource, but cannot modify or delete it. */ + DenyWriteAndDelete = "denyWriteAndDelete", + /** No denyAssignments have been applied. */ + None = "none", +} + +/** + * denySettings Mode that defines denied actions. \ + * {@link KnownDenySettingsMode} can be used interchangeably with DenySettingsMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **denyDelete**: Authorized users are able to read and modify the resources, but cannot delete. \ + * **denyWriteAndDelete**: Authorized users can read from a resource, but cannot modify or delete it. \ + * **none**: No denyAssignments have been applied. + */ +export type DenySettingsMode = string; + +/** State of the deployment stack. */ +export enum KnownDeploymentStackProvisioningState { + /** The deployment stack is currently being created */ + Creating = "creating", + /** The deployment stack is currently being validated */ + Validating = "validating", + /** The deployment stack is currently waiting */ + Waiting = "waiting", + /** The deployment stack is currently deploying */ + Deploying = "deploying", + /** The deployment stack is being cancelled */ + Canceling = "canceling", + /** The deployment stack is updating deny assignments */ + UpdatingDenyAssignments = "updatingDenyAssignments", + /** The deployment stack is deleting resources */ + DeletingResources = "deletingResources", + /** The deployment stack completed successfully */ + Succeeded = "succeeded", + /** The deployment stack has failed */ + Failed = "failed", + /** The deployment stack has been cancelled */ + Canceled = "canceled", + /** The deployment stack is being deleted */ + Deleting = "deleting", + /** The deployment stack is currently being initialized */ + Initializing = "initializing", + /** The deployment stack is currently performing an operation */ + Running = "running", +} + +/** + * State of the deployment stack. \ + * {@link KnownDeploymentStackProvisioningState} can be used interchangeably with DeploymentStackProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **creating**: The deployment stack is currently being created \ + * **validating**: The deployment stack is currently being validated \ + * **waiting**: The deployment stack is currently waiting \ + * **deploying**: The deployment stack is currently deploying \ + * **canceling**: The deployment stack is being cancelled \ + * **updatingDenyAssignments**: The deployment stack is updating deny assignments \ + * **deletingResources**: The deployment stack is deleting resources \ + * **succeeded**: The deployment stack completed successfully \ + * **failed**: The deployment stack has failed \ + * **canceled**: The deployment stack has been cancelled \ + * **deleting**: The deployment stack is being deleted \ + * **initializing**: The deployment stack is currently being initialized \ + * **running**: The deployment stack is currently performing an operation + */ +export type DeploymentStackProvisioningState = string; + +/** The level of validation performed on the deployment. */ +export enum KnownValidationLevel { + /** Static analysis of the template is performed. */ + Template = "Template", + /** Static analysis of the template is performed and resource declarations are sent to resource providers for semantic validation. Validates that the caller has RBAC write permissions on each resource. */ + Provider = "Provider", + /** Static analysis of the template is performed and resource declarations are sent to resource providers for semantic validation. Skips validating that the caller has RBAC write permissions on each resource. */ + ProviderNoRbac = "ProviderNoRbac", +} + +/** + * The level of validation performed on the deployment. \ + * {@link KnownValidationLevel} can be used interchangeably with ValidationLevel, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Template**: Static analysis of the template is performed. \ + * **Provider**: Static analysis of the template is performed and resource declarations are sent to resource providers for semantic validation. Validates that the caller has RBAC write permissions on each resource. \ + * **ProviderNoRbac**: Static analysis of the template is performed and resource declarations are sent to resource providers for semantic validation. Skips validating that the caller has RBAC write permissions on each resource. + */ +export type ValidationLevel = string; + +/** Changes predicted to the deployment stack as a result of the what-if operation. */ +export interface DeploymentStacksWhatIfChange { + /** List of resource changes predicted by What-If operation. */ + resourceChanges: DeploymentStacksWhatIfResourceChange[]; + /** Predicted changes to the deployment stack deny settings. */ + denySettingsChange: DeploymentStacksChangeDeltaDenySettings; + /** Predicted changes to the deployment scope for the deployment stack. */ + deploymentScopeChange?: DeploymentStacksChangeBase; +} + +export function deploymentStacksWhatIfChangeDeserializer(item: any): DeploymentStacksWhatIfChange { + return { + resourceChanges: deploymentStacksWhatIfResourceChangeArrayDeserializer(item["resourceChanges"]), + denySettingsChange: deploymentStacksChangeDeltaDenySettingsDeserializer( + item["denySettingsChange"], + ), + deploymentScopeChange: !item["deploymentScopeChange"] + ? item["deploymentScopeChange"] + : deploymentStacksChangeBaseDeserializer(item["deploymentScopeChange"]), + }; +} + +export function deploymentStacksWhatIfResourceChangeArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return deploymentStacksWhatIfResourceChangeDeserializer(item); + }); +} + +/** Information about a single resource change predicted by What-If operation. */ +export interface DeploymentStacksWhatIfResourceChange { + /** The ARM Resource ID of a resource managed by the deployment stack. */ + readonly id?: string; + /** The extension the resource was deployed with. */ + readonly extension?: DeploymentExtension; + /** The resource type. */ + readonly type?: string; + /** The extensible resource identifiers. */ + readonly identifiers?: Record; + /** The API version the resource was deployed with */ + readonly apiVersion?: string; + /** The resource id of the Deployment responsible for this change. */ + deploymentId?: string; + /** The symbolic name of the resource being changed. */ + symbolicName?: string; + /** Type of change that will be made to the resource when the deployment is executed. */ + changeType: DeploymentStacksWhatIfChangeType; + /** The confidence level of the predicted change. */ + changeCertainty: DeploymentStacksWhatIfChangeCertainty; + /** The predicted changes to the deployment stack management status of the resource. */ + managementStatusChange?: DeploymentStacksChangeBaseDeploymentStacksManagementStatus; + /** The predicted changes to the deployment stack deny status of the resource. */ + denyStatusChange?: DeploymentStacksChangeBaseDenyStatusMode; + /** The explanation about why the resource is unsupported by What-If. */ + unsupportedReason?: string; + /** The predicted changes to the resource configuration. */ + resourceConfigurationChanges?: DeploymentStacksChangeDeltaRecord; +} + +export function deploymentStacksWhatIfResourceChangeDeserializer( + item: any, +): DeploymentStacksWhatIfResourceChange { + return { + id: item["id"], + extension: !item["extension"] + ? item["extension"] + : deploymentExtensionDeserializer(item["extension"]), + type: item["type"], + identifiers: !item["identifiers"] + ? item["identifiers"] + : Object.fromEntries( + Object.entries(item["identifiers"]).map(([k, p]: [string, any]) => [k, p]), + ), + apiVersion: item["apiVersion"], + deploymentId: item["deploymentId"], + symbolicName: item["symbolicName"], + changeType: item["changeType"], + changeCertainty: item["changeCertainty"], + managementStatusChange: !item["managementStatusChange"] + ? item["managementStatusChange"] + : deploymentStacksChangeBaseDeploymentStacksManagementStatusDeserializer( + item["managementStatusChange"], + ), + denyStatusChange: !item["denyStatusChange"] + ? item["denyStatusChange"] + : deploymentStacksChangeBaseDenyStatusModeDeserializer(item["denyStatusChange"]), + unsupportedReason: item["unsupportedReason"], + resourceConfigurationChanges: !item["resourceConfigurationChanges"] + ? item["resourceConfigurationChanges"] + : deploymentStacksChangeDeltaRecordDeserializer(item["resourceConfigurationChanges"]), + }; +} + +/** Details about the usage of a deployment extension. */ +export interface DeploymentExtension { + /** The extension name. */ + name: string; + /** The extension version. */ + version: string; + /** The configuration ID of the extension usage. It uniquely identifies a target the extension deploys to. */ + configId?: string; + /** The configuration used for deployment. The keys of this object should align with the extension config schema. */ + config?: DeploymentExtensionConfig; +} + +export function deploymentExtensionDeserializer(item: any): DeploymentExtension { + return { + name: item["name"], + version: item["version"], + configId: item["configId"], + config: !item["config"] + ? item["config"] + : deploymentExtensionConfigDeserializer(item["config"]), + }; +} + +/** Type of change that will be made to the resource when the deployment is executed. */ +export enum KnownDeploymentStacksWhatIfChangeType { + /** The resource does not exist in the current state but is present in the desired state. The resource will be created when the deployment is executed. */ + Create = "create", + /** The resource exists in the current state and is missing from the desired state. The resource will be deleted from Azure after the deployment is executed. */ + Delete = "delete", + /** The resource exists in the current state and is missing from the desired state. The resource will be removed from the deployment stack, but will remain in Azure, after the deployment is executed. */ + Detach = "detach", + /** The resource exists in the current state and the desired state and will be redeployed when the deployment is executed. The properties of the resource will change. */ + Modify = "modify", + /** The resource exists in the current state and the desired state and will be redeployed when the deployment is executed. The properties of the resource will not change. */ + NoChange = "noChange", + /** The resource is not supported by What-If. */ + Unsupported = "unsupported", +} + +/** + * Type of change that will be made to the resource when the deployment is executed. \ + * {@link KnownDeploymentStacksWhatIfChangeType} can be used interchangeably with DeploymentStacksWhatIfChangeType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **create**: The resource does not exist in the current state but is present in the desired state. The resource will be created when the deployment is executed. \ + * **delete**: The resource exists in the current state and is missing from the desired state. The resource will be deleted from Azure after the deployment is executed. \ + * **detach**: The resource exists in the current state and is missing from the desired state. The resource will be removed from the deployment stack, but will remain in Azure, after the deployment is executed. \ + * **modify**: The resource exists in the current state and the desired state and will be redeployed when the deployment is executed. The properties of the resource will change. \ + * **noChange**: The resource exists in the current state and the desired state and will be redeployed when the deployment is executed. The properties of the resource will not change. \ + * **unsupported**: The resource is not supported by What-If. + */ +export type DeploymentStacksWhatIfChangeType = string; + +/** Denotes the confidence level of the predicted change. */ +export enum KnownDeploymentStacksWhatIfChangeCertainty { + /** The change is definite. */ + Definite = "definite", + /** The change may or may not happen, based on deployment-time conditions. */ + Potential = "potential", +} + +/** + * Denotes the confidence level of the predicted change. \ + * {@link KnownDeploymentStacksWhatIfChangeCertainty} can be used interchangeably with DeploymentStacksWhatIfChangeCertainty, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **definite**: The change is definite. \ + * **potential**: The change may or may not happen, based on deployment-time conditions. + */ +export type DeploymentStacksWhatIfChangeCertainty = string; + +/** Base model for properties with the before-and-after property values. */ +export interface DeploymentStacksChangeBaseDeploymentStacksManagementStatus { + /** The predicted value before the deployment is executed. */ + before?: DeploymentStacksManagementStatus; + /** The predicted value after the deployment is executed. */ + after?: DeploymentStacksManagementStatus; +} + +export function deploymentStacksChangeBaseDeploymentStacksManagementStatusDeserializer( + item: any, +): DeploymentStacksChangeBaseDeploymentStacksManagementStatus { + return { + before: item["before"], + after: item["after"], + }; +} + +/** The management status of the deployment stack resource. */ +export enum KnownDeploymentStacksManagementStatus { + /** The resource is managed by the deployment stack. */ + Managed = "managed", + /** The resource is not managed by the deployment stack. */ + Unmanaged = "unmanaged", + /** The management state of the resource could not be determined. */ + Unknown = "unknown", +} + +/** + * The management status of the deployment stack resource. \ + * {@link KnownDeploymentStacksManagementStatus} can be used interchangeably with DeploymentStacksManagementStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **managed**: The resource is managed by the deployment stack. \ + * **unmanaged**: The resource is not managed by the deployment stack. \ + * **unknown**: The management state of the resource could not be determined. + */ +export type DeploymentStacksManagementStatus = string; + +/** Base model for properties with the before-and-after property values. */ +export interface DeploymentStacksChangeBaseDenyStatusMode { + /** The predicted value before the deployment is executed. */ + before?: DenyStatusMode; + /** The predicted value after the deployment is executed. */ + after?: DenyStatusMode; +} + +export function deploymentStacksChangeBaseDenyStatusModeDeserializer( + item: any, +): DeploymentStacksChangeBaseDenyStatusMode { + return { + before: item["before"], + after: item["after"], + }; +} + +/** denyAssignment settings applied to the resource. */ +export enum KnownDenyStatusMode { + /** Authorized users are able to read and modify the resources, but cannot delete. */ + DenyDelete = "denyDelete", + /** Resource type does not support denyAssignments. */ + NotSupported = "notSupported", + /** denyAssignments are not supported on resources outside the scope of the deployment stack. */ + Inapplicable = "inapplicable", + /** Authorized users can only read from a resource, but cannot modify or delete it. */ + DenyWriteAndDelete = "denyWriteAndDelete", + /** Deny assignment has been removed by Azure due to a resource management change (management group move, etc.) */ + RemovedBySystem = "removedBySystem", + /** No denyAssignments have been applied. */ + None = "none", + /** The denyAssignment status is unknown. */ + Unknown = "unknown", +} + +/** + * denyAssignment settings applied to the resource. \ + * {@link KnownDenyStatusMode} can be used interchangeably with DenyStatusMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **denyDelete**: Authorized users are able to read and modify the resources, but cannot delete. \ + * **notSupported**: Resource type does not support denyAssignments. \ + * **inapplicable**: denyAssignments are not supported on resources outside the scope of the deployment stack. \ + * **denyWriteAndDelete**: Authorized users can only read from a resource, but cannot modify or delete it. \ + * **removedBySystem**: Deny assignment has been removed by Azure due to a resource management change (management group move, etc.) \ + * **none**: No denyAssignments have been applied. \ + * **unknown**: The denyAssignment status is unknown. + */ +export type DenyStatusMode = string; + +/** Model to show the before-and-after property values, along with the delta between them. */ +export interface DeploymentStacksChangeDeltaRecord { + /** The predicted value before the deployment is executed. */ + before?: Record; + /** The predicted value after the deployment is executed. */ + after?: Record; + /** The predicted changes to the properties." */ + delta?: DeploymentStacksWhatIfPropertyChange[]; +} + +export function deploymentStacksChangeDeltaRecordDeserializer( + item: any, +): DeploymentStacksChangeDeltaRecord { + return { + before: !item["before"] + ? item["before"] + : Object.fromEntries(Object.entries(item["before"]).map(([k, p]: [string, any]) => [k, p])), + after: !item["after"] + ? item["after"] + : Object.fromEntries(Object.entries(item["after"]).map(([k, p]: [string, any]) => [k, p])), + delta: !item["delta"] + ? item["delta"] + : deploymentStacksWhatIfPropertyChangeArrayDeserializer(item["delta"]), + }; +} + +export function deploymentStacksWhatIfPropertyChangeArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return deploymentStacksWhatIfPropertyChangeDeserializer(item); + }); +} + +/** The predicted change to the resource property. */ +export interface DeploymentStacksWhatIfPropertyChange { + /** The predicted value before the deployment is executed. */ + before?: any; + /** The predicted value after the deployment is executed. */ + after?: any; + /** Type of change that will be made to the resource when the deployment is executed. */ + path: string; + /** Type of change that will be made to the resource when the deployment is executed. */ + changeType: DeploymentStacksWhatIfPropertyChangeType; + /** Nested property changes. */ + children?: DeploymentStacksWhatIfPropertyChange[]; +} + +export function deploymentStacksWhatIfPropertyChangeDeserializer( + item: any, +): DeploymentStacksWhatIfPropertyChange { + return { + before: item["before"], + after: item["after"], + path: item["path"], + changeType: item["changeType"], + children: !item["children"] + ? item["children"] + : deploymentStacksWhatIfPropertyChangeArrayDeserializer(item["children"]), + }; +} + +/** The type of property change. */ +export enum KnownDeploymentStacksWhatIfPropertyChangeType { + /** The property is an array and contains nested changes. */ + Array = "array", + /** The property does not exist in the current state but is present in the desired state. The property will be created when the deployment is executed. */ + Create = "create", + /** The property exists in the current state and is missing from the desired state. It will be deleted when the deployment is executed. */ + Delete = "delete", + /** The property exists in both current and desired state and is different. The value of the property will change when the deployment is executed. */ + Modify = "modify", + /** The property will not be set or updated. */ + NoEffect = "noEffect", +} + +/** + * The type of property change. \ + * {@link KnownDeploymentStacksWhatIfPropertyChangeType} can be used interchangeably with DeploymentStacksWhatIfPropertyChangeType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **array**: The property is an array and contains nested changes. \ + * **create**: The property does not exist in the current state but is present in the desired state. The property will be created when the deployment is executed. \ + * **delete**: The property exists in the current state and is missing from the desired state. It will be deleted when the deployment is executed. \ + * **modify**: The property exists in both current and desired state and is different. The value of the property will change when the deployment is executed. \ + * **noEffect**: The property will not be set or updated. + */ +export type DeploymentStacksWhatIfPropertyChangeType = string; + +/** Model to show the before-and-after property values, along with the delta between them. */ +export interface DeploymentStacksChangeDeltaDenySettings { + /** The predicted value before the deployment is executed. */ + before?: DenySettings; + /** The predicted value after the deployment is executed. */ + after?: DenySettings; + /** The predicted changes to the properties." */ + delta?: DeploymentStacksWhatIfPropertyChange[]; +} + +export function deploymentStacksChangeDeltaDenySettingsDeserializer( + item: any, +): DeploymentStacksChangeDeltaDenySettings { + return { + before: !item["before"] ? item["before"] : denySettingsDeserializer(item["before"]), + after: !item["after"] ? item["after"] : denySettingsDeserializer(item["after"]), + delta: !item["delta"] + ? item["delta"] + : deploymentStacksWhatIfPropertyChangeArrayDeserializer(item["delta"]), + }; +} + +/** Base model for properties with the before-and-after property values. */ +export interface DeploymentStacksChangeBase { + /** The predicted value before the deployment is executed. */ + before?: string; + /** The predicted value after the deployment is executed. */ + after?: string; +} + +export function deploymentStacksChangeBaseDeserializer(item: any): DeploymentStacksChangeBase { + return { + before: item["before"], + after: item["after"], + }; +} + +export function deploymentStacksDiagnosticArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return deploymentStacksDiagnosticDeserializer(item); + }); +} + +/** The error additional info */ +export interface DeploymentStacksDiagnostic { + /** Denotes the additional response level. */ + level: DeploymentStacksDiagnosticLevel; + /** The error code. */ + code: string; + /** The error message. */ + message: string; + /** The error target. */ + target?: string; + /** Additional error information. */ + additionalInfo?: ErrorAdditionalInfo[]; +} + +export function deploymentStacksDiagnosticDeserializer(item: any): DeploymentStacksDiagnostic { + return { + level: item["level"], + code: item["code"], + message: item["message"], + target: item["target"], + additionalInfo: !item["additionalInfo"] + ? item["additionalInfo"] + : errorAdditionalInfoArrayDeserializer(item["additionalInfo"]), + }; +} + +/** Denotes the additional response level. */ +export enum KnownDeploymentStacksDiagnosticLevel { + /** Informational message. */ + Info = "info", + /** Warning message. */ + Warning = "warning", + /** Error message. */ + Error = "error", +} + +/** + * Denotes the additional response level. \ + * {@link KnownDeploymentStacksDiagnosticLevel} can be used interchangeably with DeploymentStacksDiagnosticLevel, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **info**: Informational message. \ + * **warning**: Warning message. \ + * **error**: Error message. + */ +export type DeploymentStacksDiagnosticLevel = string; + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export interface ProxyResource extends Resource {} + +export function proxyResourceSerializer(item: ProxyResource): any { + return item; +} + +export function proxyResourceDeserializer(item: any): ProxyResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + }; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} */ + readonly id?: string; + /** The name of the resource */ + readonly name?: string; + /** The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" */ + readonly type?: string; + /** Azure Resource Manager metadata containing createdBy and modifiedBy information. */ + readonly systemData?: SystemData; +} + +export function resourceSerializer(item: Resource): any { + return item; +} + +export function resourceDeserializer(item: any): Resource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + }; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +export function systemDataDeserializer(item: any): SystemData { + return { + createdBy: item["createdBy"], + createdByType: item["createdByType"], + createdAt: !item["createdAt"] ? item["createdAt"] : new Date(item["createdAt"]), + lastModifiedBy: item["lastModifiedBy"], + lastModifiedByType: item["lastModifiedByType"], + lastModifiedAt: !item["lastModifiedAt"] + ? item["lastModifiedAt"] + : new Date(item["lastModifiedAt"]), + }; +} + +/** The kind of entity that created the resource. */ +export enum KnownCreatedByType { + /** The entity was created by a user. */ + User = "User", + /** The entity was created by an application. */ + Application = "Application", + /** The entity was created by a managed identity. */ + ManagedIdentity = "ManagedIdentity", + /** The entity was created by a key. */ + Key = "Key", +} + +/** + * The kind of entity that created the resource. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User**: The entity was created by a user. \ + * **Application**: The entity was created by an application. \ + * **ManagedIdentity**: The entity was created by a managed identity. \ + * **Key**: The entity was created by a key. + */ +export type CreatedByType = string; + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +export function errorResponseDeserializer(item: any): ErrorResponse { + return { + error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]), + }; +} + +/** The response of a DeploymentStacksWhatIfResult list operation. */ +export interface _DeploymentStacksWhatIfResultListResult { + /** The DeploymentStacksWhatIfResult items on this page */ + value: DeploymentStacksWhatIfResult[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _deploymentStacksWhatIfResultListResultDeserializer( + item: any, +): _DeploymentStacksWhatIfResultListResult { + return { + value: deploymentStacksWhatIfResultArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function deploymentStacksWhatIfResultArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return deploymentStacksWhatIfResultSerializer(item); + }); +} + +export function deploymentStacksWhatIfResultArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return deploymentStacksWhatIfResultDeserializer(item); + }); +} + +/** Deployment stack object. */ +export interface DeploymentStack extends ProxyResource { + /** The geo-location where the resource lives. Required for subscription and management group scoped stacks. The location is inherited from the resource group for resource group scoped stacks. */ + location?: string; + /** Resource tags. */ + tags?: Record; + /** The error detail. */ + error?: ErrorDetail; + /** 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?: DeploymentStacksTemplateLink; + /** Name and value pairs that define the deployment parameters for the template. Use this element when providing the parameter values directly in the request, rather than linking to an existing parameter file. Use either the parametersLink property or the parameters property, but not both. */ + parameters?: Record; + /** The URI of parameters file. Use this element to link to an existing parameters file. Use either the parametersLink property or the parameters property, but not both. */ + parametersLink?: DeploymentStacksParametersLink; + /** The deployment extension configs. Keys of this object are extension aliases as defined in the deployment template. */ + extensionConfigs?: Record; + /** External input values, used by external tooling for parameter evaluation. */ + externalInputs?: Record; + /** External input definitions, used by external tooling to define expected external input values. */ + externalInputDefinitions?: Record; + /** Defines the behavior of resources that are no longer managed after the Deployment stack is updated or deleted. */ + actionOnUnmanage?: ActionOnUnmanage; + /** The debug setting of the deployment. */ + debugSetting?: DeploymentStacksDebugSetting; + /** The scope at which the initial deployment should be created. If a scope is not specified, it will default to the scope of the deployment stack. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroupId}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'). */ + deploymentScope?: string; + /** Deployment stack description. Max length of 4096 characters. */ + description?: string; + /** Defines how resources deployed by the stack are locked. */ + denySettings?: DenySettings; + /** State of the deployment stack. */ + readonly provisioningState?: DeploymentStackProvisioningState; + /** The correlation id of the last Deployment stack upsert or delete operation. It is in GUID format and is used for tracing. */ + readonly correlationId?: string; + /** The validation level of the deployment stack */ + validationLevel?: ValidationLevel; + /** Flag to bypass service errors that indicate the stack resource list is not correctly synchronized. */ + bypassStackOutOfSyncError?: boolean; + /** An array of resources that were detached during the most recent Deployment stack update. Detached means that the resource was removed from the template, but no relevant deletion operations were specified. So, the resource still exists while no longer being associated with the stack. */ + readonly detachedResources?: ResourceReference[]; + /** An array of resources that were deleted during the most recent Deployment stack update. Deleted means that the resource was removed from the template and relevant deletion operations were specified. */ + readonly deletedResources?: ResourceReference[]; + /** An array of resources that failed to reach goal state during the most recent update. Each resourceId is accompanied by an error message. */ + readonly failedResources?: ResourceReferenceExtended[]; + /** An array of resources currently managed by the deployment stack. */ + readonly resources?: ManagedResourceReference[]; + /** The extensions used during deployment. Contains extension data for all extensible resources managed by the stack. */ + readonly deploymentExtensions?: DeploymentExtension[]; + /** The resourceId of the deployment resource created by the deployment stack. */ + readonly deploymentId?: string; + /** The outputs of the deployment resource created by the deployment stack. */ + readonly outputs?: Record; + /** The duration of the last successful Deployment stack update. */ + readonly duration?: string; +} + +export function deploymentStackSerializer(item: DeploymentStack): any { + return { + properties: areAllPropsUndefined(item, [ + "error", + "template", + "templateLink", + "parameters", + "parametersLink", + "extensionConfigs", + "externalInputs", + "externalInputDefinitions", + "actionOnUnmanage", + "debugSetting", + "deploymentScope", + "description", + "denySettings", + "validationLevel", + "bypassStackOutOfSyncError", + ]) + ? undefined + : _deploymentStackPropertiesSerializer(item), + location: item["location"], + tags: item["tags"], + }; +} + +export function deploymentStackDeserializer(item: any): DeploymentStack { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _deploymentStackPropertiesDeserializer(item["properties"])), + location: item["location"], + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + }; +} + +/** Deployment stack properties. */ +export interface DeploymentStackProperties { + /** The error detail. */ + error?: ErrorDetail; + /** 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?: DeploymentStacksTemplateLink; + /** Name and value pairs that define the deployment parameters for the template. Use this element when providing the parameter values directly in the request, rather than linking to an existing parameter file. Use either the parametersLink property or the parameters property, but not both. */ + parameters?: Record; + /** The URI of parameters file. Use this element to link to an existing parameters file. Use either the parametersLink property or the parameters property, but not both. */ + parametersLink?: DeploymentStacksParametersLink; + /** The deployment extension configs. Keys of this object are extension aliases as defined in the deployment template. */ + extensionConfigs?: Record; + /** External input values, used by external tooling for parameter evaluation. */ + externalInputs?: Record; + /** External input definitions, used by external tooling to define expected external input values. */ + externalInputDefinitions?: Record; + /** Defines the behavior of resources that are no longer managed after the Deployment stack is updated or deleted. */ + actionOnUnmanage: ActionOnUnmanage; + /** The debug setting of the deployment. */ + debugSetting?: DeploymentStacksDebugSetting; + /** The scope at which the initial deployment should be created. If a scope is not specified, it will default to the scope of the deployment stack. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroupId}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'). */ + deploymentScope?: string; + /** Deployment stack description. Max length of 4096 characters. */ + description?: string; + /** Defines how resources deployed by the stack are locked. */ + denySettings: DenySettings; + /** State of the deployment stack. */ + readonly provisioningState?: DeploymentStackProvisioningState; + /** The correlation id of the last Deployment stack upsert or delete operation. It is in GUID format and is used for tracing. */ + readonly correlationId?: string; + /** The validation level of the deployment stack */ + validationLevel?: ValidationLevel; + /** Flag to bypass service errors that indicate the stack resource list is not correctly synchronized. */ + bypassStackOutOfSyncError?: boolean; + /** An array of resources that were detached during the most recent Deployment stack update. Detached means that the resource was removed from the template, but no relevant deletion operations were specified. So, the resource still exists while no longer being associated with the stack. */ + readonly detachedResources?: ResourceReference[]; + /** An array of resources that were deleted during the most recent Deployment stack update. Deleted means that the resource was removed from the template and relevant deletion operations were specified. */ + readonly deletedResources?: ResourceReference[]; + /** An array of resources that failed to reach goal state during the most recent update. Each resourceId is accompanied by an error message. */ + readonly failedResources?: ResourceReferenceExtended[]; + /** An array of resources currently managed by the deployment stack. */ + readonly resources?: ManagedResourceReference[]; + /** The extensions used during deployment. Contains extension data for all extensible resources managed by the stack. */ + readonly deploymentExtensions?: DeploymentExtension[]; + /** The resourceId of the deployment resource created by the deployment stack. */ + readonly deploymentId?: string; + /** The outputs of the deployment resource created by the deployment stack. */ + readonly outputs?: Record; + /** The duration of the last successful Deployment stack update. */ + readonly duration?: string; +} + +export function deploymentStackPropertiesSerializer(item: DeploymentStackProperties): any { + return { + error: !item["error"] ? item["error"] : errorDetailSerializer(item["error"]), + template: item["template"], + templateLink: !item["templateLink"] + ? item["templateLink"] + : deploymentStacksTemplateLinkSerializer(item["templateLink"]), + parameters: !item["parameters"] + ? item["parameters"] + : deploymentParameterRecordSerializer(item["parameters"]), + parametersLink: !item["parametersLink"] + ? item["parametersLink"] + : deploymentStacksParametersLinkSerializer(item["parametersLink"]), + extensionConfigs: !item["extensionConfigs"] + ? item["extensionConfigs"] + : deploymentExtensionConfigRecordSerializer(item["extensionConfigs"]), + externalInputs: !item["externalInputs"] + ? item["externalInputs"] + : deploymentExternalInputRecordSerializer(item["externalInputs"]), + externalInputDefinitions: !item["externalInputDefinitions"] + ? item["externalInputDefinitions"] + : deploymentExternalInputDefinitionRecordSerializer(item["externalInputDefinitions"]), + actionOnUnmanage: actionOnUnmanageSerializer(item["actionOnUnmanage"]), + debugSetting: !item["debugSetting"] + ? item["debugSetting"] + : deploymentStacksDebugSettingSerializer(item["debugSetting"]), + deploymentScope: item["deploymentScope"], + description: item["description"], + denySettings: denySettingsSerializer(item["denySettings"]), + validationLevel: item["validationLevel"], + bypassStackOutOfSyncError: item["bypassStackOutOfSyncError"], + }; +} + +export function deploymentStackPropertiesDeserializer(item: any): DeploymentStackProperties { + return { + error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]), + template: !item["template"] + ? item["template"] + : Object.fromEntries(Object.entries(item["template"]).map(([k, p]: [string, any]) => [k, p])), + templateLink: !item["templateLink"] + ? item["templateLink"] + : deploymentStacksTemplateLinkDeserializer(item["templateLink"]), + parameters: !item["parameters"] + ? item["parameters"] + : deploymentParameterRecordDeserializer(item["parameters"]), + parametersLink: !item["parametersLink"] + ? item["parametersLink"] + : deploymentStacksParametersLinkDeserializer(item["parametersLink"]), + extensionConfigs: !item["extensionConfigs"] + ? item["extensionConfigs"] + : deploymentExtensionConfigRecordDeserializer(item["extensionConfigs"]), + externalInputs: !item["externalInputs"] + ? item["externalInputs"] + : deploymentExternalInputRecordDeserializer(item["externalInputs"]), + externalInputDefinitions: !item["externalInputDefinitions"] + ? item["externalInputDefinitions"] + : deploymentExternalInputDefinitionRecordDeserializer(item["externalInputDefinitions"]), + actionOnUnmanage: actionOnUnmanageDeserializer(item["actionOnUnmanage"]), + debugSetting: !item["debugSetting"] + ? item["debugSetting"] + : deploymentStacksDebugSettingDeserializer(item["debugSetting"]), + deploymentScope: item["deploymentScope"], + description: item["description"], + denySettings: denySettingsDeserializer(item["denySettings"]), + provisioningState: item["provisioningState"], + correlationId: item["correlationId"], + validationLevel: item["validationLevel"], + bypassStackOutOfSyncError: item["bypassStackOutOfSyncError"], + detachedResources: !item["detachedResources"] + ? item["detachedResources"] + : resourceReferenceArrayDeserializer(item["detachedResources"]), + deletedResources: !item["deletedResources"] + ? item["deletedResources"] + : resourceReferenceArrayDeserializer(item["deletedResources"]), + failedResources: !item["failedResources"] + ? item["failedResources"] + : resourceReferenceExtendedArrayDeserializer(item["failedResources"]), + resources: !item["resources"] + ? item["resources"] + : managedResourceReferenceArrayDeserializer(item["resources"]), + deploymentExtensions: !item["deploymentExtensions"] + ? item["deploymentExtensions"] + : deploymentExtensionArrayDeserializer(item["deploymentExtensions"]), + deploymentId: item["deploymentId"], + outputs: !item["outputs"] + ? item["outputs"] + : Object.fromEntries(Object.entries(item["outputs"]).map(([k, p]: [string, any]) => [k, p])), + duration: item["duration"], + }; +} + +export function resourceReferenceArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return resourceReferenceDeserializer(item); + }); +} + +/** The resourceId model. */ +export interface ResourceReference { + /** The ARM Resource ID of a resource managed by the deployment stack. */ + readonly id?: string; + /** The extension the resource was deployed with. */ + readonly extension?: DeploymentExtension; + /** The resource type. */ + readonly type?: string; + /** The extensible resource identifiers. */ + readonly identifiers?: Record; + /** The API version the resource was deployed with */ + readonly apiVersion?: string; +} + +export function resourceReferenceDeserializer(item: any): ResourceReference { + return { + id: item["id"], + extension: !item["extension"] + ? item["extension"] + : deploymentExtensionDeserializer(item["extension"]), + type: item["type"], + identifiers: !item["identifiers"] + ? item["identifiers"] + : Object.fromEntries( + Object.entries(item["identifiers"]).map(([k, p]: [string, any]) => [k, p]), + ), + apiVersion: item["apiVersion"], + }; +} + +export function resourceReferenceExtendedArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return resourceReferenceExtendedDeserializer(item); + }); +} + +/** The resourceId extended model. This is used to document failed resources with a resourceId and a corresponding error. */ +export interface ResourceReferenceExtended { + /** The ARM Resource ID of a resource managed by the deployment stack. */ + readonly id?: string; + /** The extension the resource was deployed with. */ + readonly extension?: DeploymentExtension; + /** The resource type. */ + readonly type?: string; + /** The extensible resource identifiers. */ + readonly identifiers?: Record; + /** The API version the resource was deployed with */ + readonly apiVersion?: string; + /** The error detail. */ + error?: ErrorDetail; +} + +export function resourceReferenceExtendedDeserializer(item: any): ResourceReferenceExtended { + return { + id: item["id"], + extension: !item["extension"] + ? item["extension"] + : deploymentExtensionDeserializer(item["extension"]), + type: item["type"], + identifiers: !item["identifiers"] + ? item["identifiers"] + : Object.fromEntries( + Object.entries(item["identifiers"]).map(([k, p]: [string, any]) => [k, p]), + ), + apiVersion: item["apiVersion"], + error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]), + }; +} + +export function managedResourceReferenceArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return managedResourceReferenceDeserializer(item); + }); +} + +/** The managed resource model. */ +export interface ManagedResourceReference extends ResourceReference { + /** Current management state of the resource in the deployment stack. */ + status?: ResourceStatusMode; + /** denyAssignment settings applied to the resource. */ + denyStatus?: DenyStatusMode; +} + +export function managedResourceReferenceDeserializer(item: any): ManagedResourceReference { + return { + id: item["id"], + extension: !item["extension"] + ? item["extension"] + : deploymentExtensionDeserializer(item["extension"]), + type: item["type"], + identifiers: !item["identifiers"] + ? item["identifiers"] + : Object.fromEntries( + Object.entries(item["identifiers"]).map(([k, p]: [string, any]) => [k, p]), + ), + apiVersion: item["apiVersion"], + status: item["status"], + denyStatus: item["denyStatus"], + }; +} + +/** Current management state of the resource in the deployment stack. */ +export enum KnownResourceStatusMode { + /** This resource is managed by the deployment stack. */ + Managed = "managed", + /** Unable to remove the deny assignment on resource. */ + RemoveDenyFailed = "removeDenyFailed", + /** Unable to delete the resource from Azure. The delete will be retried on the next stack deployment, or can be deleted manually. */ + DeleteFailed = "deleteFailed", +} + +/** + * Current management state of the resource in the deployment stack. \ + * {@link KnownResourceStatusMode} can be used interchangeably with ResourceStatusMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **managed**: This resource is managed by the deployment stack. \ + * **removeDenyFailed**: Unable to remove the deny assignment on resource. \ + * **deleteFailed**: Unable to delete the resource from Azure. The delete will be retried on the next stack deployment, or can be deleted manually. + */ +export type ResourceStatusMode = string; + +export function deploymentExtensionArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return deploymentExtensionDeserializer(item); + }); +} + +/** The response of a DeploymentStack list operation. */ +export interface _DeploymentStackListResult { + /** The DeploymentStack items on this page */ + value: DeploymentStack[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _deploymentStackListResultDeserializer(item: any): _DeploymentStackListResult { + return { + value: deploymentStackArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function deploymentStackArraySerializer(result: Array): any[] { + return result.map((item) => { + return deploymentStackSerializer(item); + }); +} + +export function deploymentStackArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return deploymentStackDeserializer(item); + }); +} + +/** The Deployment stack validation result. */ +export interface DeploymentStackValidateResult { + /** String Id used to locate any resource on Azure. */ + readonly id?: string; + /** Name of this resource. */ + readonly name?: string; + /** Type of this resource. */ + readonly type?: string; + /** Azure Resource Manager metadata containing createdBy and modifiedBy information. */ + readonly systemData?: SystemData; + /** The error detail. */ + error?: ErrorDetail; + /** The validation result details. */ + properties?: DeploymentStackValidateProperties; +} + +export function deploymentStackValidateResultDeserializer( + item: any, +): DeploymentStackValidateResult { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]), + properties: !item["properties"] + ? item["properties"] + : deploymentStackValidatePropertiesDeserializer(item["properties"]), + }; +} + +/** The Deployment stack validation result details. */ +export interface DeploymentStackValidateProperties { + /** Defines the behavior of resources that are no longer managed after the Deployment stack is updated or deleted. */ + actionOnUnmanage?: ActionOnUnmanage; + /** The correlation id of the Deployment stack validate operation. It is in GUID format and is used for tracing. */ + correlationId?: string; + /** The Deployment stack deny settings. */ + denySettings?: DenySettings; + /** The Deployment stack deployment scope. */ + deploymentScope?: string; + /** The Deployment stack validation description. */ + description?: string; + /** Deployment parameters. */ + parameters?: Record; + /** The URI of the template. */ + templateLink?: DeploymentStacksTemplateLink; + /** The array of resources that were validated. */ + validatedResources?: ResourceReference[]; + /** The deployment extensions. */ + deploymentExtensions?: DeploymentExtension[]; + /** The validation level of the deployment stack */ + validationLevel?: ValidationLevel; +} + +export function deploymentStackValidatePropertiesDeserializer( + item: any, +): DeploymentStackValidateProperties { + return { + actionOnUnmanage: !item["actionOnUnmanage"] + ? item["actionOnUnmanage"] + : actionOnUnmanageDeserializer(item["actionOnUnmanage"]), + correlationId: item["correlationId"], + denySettings: !item["denySettings"] + ? item["denySettings"] + : denySettingsDeserializer(item["denySettings"]), + deploymentScope: item["deploymentScope"], + description: item["description"], + parameters: !item["parameters"] + ? item["parameters"] + : deploymentParameterRecordDeserializer(item["parameters"]), + templateLink: !item["templateLink"] + ? item["templateLink"] + : deploymentStacksTemplateLinkDeserializer(item["templateLink"]), + validatedResources: !item["validatedResources"] + ? item["validatedResources"] + : resourceReferenceArrayDeserializer(item["validatedResources"]), + deploymentExtensions: !item["deploymentExtensions"] + ? item["deploymentExtensions"] + : deploymentExtensionArrayDeserializer(item["deploymentExtensions"]), + validationLevel: item["validationLevel"], + }; +} + +/** Export Template specific properties of the Deployment stack. */ +export interface DeploymentStackTemplateDefinition { + /** The template content. Use this element 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?: DeploymentStacksTemplateLink; +} + +export function deploymentStackTemplateDefinitionDeserializer( + item: any, +): DeploymentStackTemplateDefinition { + return { + template: !item["template"] + ? item["template"] + : Object.fromEntries(Object.entries(item["template"]).map(([k, p]: [string, any]) => [k, p])), + templateLink: !item["templateLink"] + ? item["templateLink"] + : deploymentStacksTemplateLinkDeserializer(item["templateLink"]), + }; +} + +/** The available API versions. */ +export enum KnownVersions { + /** The 2024-03-01 API version. */ + V20240301 = "2024-03-01", + /** The 2025-07-01 API version. */ + V20250701 = "2025-07-01", +} + +export function _deploymentStackPropertiesSerializer(item: DeploymentStack): any { + return { + error: !item["error"] ? item["error"] : errorDetailSerializer(item["error"]), + template: item["template"], + templateLink: !item["templateLink"] + ? item["templateLink"] + : deploymentStacksTemplateLinkSerializer(item["templateLink"]), + parameters: !item["parameters"] + ? item["parameters"] + : deploymentParameterRecordSerializer(item["parameters"]), + parametersLink: !item["parametersLink"] + ? item["parametersLink"] + : deploymentStacksParametersLinkSerializer(item["parametersLink"]), + extensionConfigs: !item["extensionConfigs"] + ? item["extensionConfigs"] + : deploymentExtensionConfigRecordSerializer(item["extensionConfigs"]), + externalInputs: !item["externalInputs"] + ? item["externalInputs"] + : deploymentExternalInputRecordSerializer(item["externalInputs"]), + externalInputDefinitions: !item["externalInputDefinitions"] + ? item["externalInputDefinitions"] + : deploymentExternalInputDefinitionRecordSerializer(item["externalInputDefinitions"]), + actionOnUnmanage: !item["actionOnUnmanage"] + ? item["actionOnUnmanage"] + : actionOnUnmanageSerializer(item["actionOnUnmanage"]), + debugSetting: !item["debugSetting"] + ? item["debugSetting"] + : deploymentStacksDebugSettingSerializer(item["debugSetting"]), + deploymentScope: item["deploymentScope"], + description: item["description"], + denySettings: !item["denySettings"] + ? item["denySettings"] + : denySettingsSerializer(item["denySettings"]), + validationLevel: item["validationLevel"], + bypassStackOutOfSyncError: item["bypassStackOutOfSyncError"], + }; +} + +export function _deploymentStackPropertiesDeserializer(item: any) { + return { + error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]), + template: !item["template"] + ? item["template"] + : Object.fromEntries(Object.entries(item["template"]).map(([k, p]: [string, any]) => [k, p])), + templateLink: !item["templateLink"] + ? item["templateLink"] + : deploymentStacksTemplateLinkDeserializer(item["templateLink"]), + parameters: !item["parameters"] + ? item["parameters"] + : deploymentParameterRecordDeserializer(item["parameters"]), + parametersLink: !item["parametersLink"] + ? item["parametersLink"] + : deploymentStacksParametersLinkDeserializer(item["parametersLink"]), + extensionConfigs: !item["extensionConfigs"] + ? item["extensionConfigs"] + : deploymentExtensionConfigRecordDeserializer(item["extensionConfigs"]), + externalInputs: !item["externalInputs"] + ? item["externalInputs"] + : deploymentExternalInputRecordDeserializer(item["externalInputs"]), + externalInputDefinitions: !item["externalInputDefinitions"] + ? item["externalInputDefinitions"] + : deploymentExternalInputDefinitionRecordDeserializer(item["externalInputDefinitions"]), + actionOnUnmanage: !item["actionOnUnmanage"] + ? item["actionOnUnmanage"] + : actionOnUnmanageDeserializer(item["actionOnUnmanage"]), + debugSetting: !item["debugSetting"] + ? item["debugSetting"] + : deploymentStacksDebugSettingDeserializer(item["debugSetting"]), + deploymentScope: item["deploymentScope"], + description: item["description"], + denySettings: !item["denySettings"] + ? item["denySettings"] + : denySettingsDeserializer(item["denySettings"]), + provisioningState: item["provisioningState"], + correlationId: item["correlationId"], + validationLevel: item["validationLevel"], + bypassStackOutOfSyncError: item["bypassStackOutOfSyncError"], + detachedResources: !item["detachedResources"] + ? item["detachedResources"] + : resourceReferenceArrayDeserializer(item["detachedResources"]), + deletedResources: !item["deletedResources"] + ? item["deletedResources"] + : resourceReferenceArrayDeserializer(item["deletedResources"]), + failedResources: !item["failedResources"] + ? item["failedResources"] + : resourceReferenceExtendedArrayDeserializer(item["failedResources"]), + resources: !item["resources"] + ? item["resources"] + : managedResourceReferenceArrayDeserializer(item["resources"]), + deploymentExtensions: !item["deploymentExtensions"] + ? item["deploymentExtensions"] + : deploymentExtensionArrayDeserializer(item["deploymentExtensions"]), + deploymentId: item["deploymentId"], + outputs: !item["outputs"] + ? item["outputs"] + : Object.fromEntries(Object.entries(item["outputs"]).map(([k, p]: [string, any]) => [k, p])), + duration: item["duration"], + }; +} diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/models/parameters.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/models/parameters.ts deleted file mode 100644 index 08a923ef1667..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/models/parameters.ts +++ /dev/null @@ -1,177 +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. - */ - -import { - OperationParameter, - OperationURLParameter, - OperationQueryParameter, -} from "@azure/core-client"; -import { DeploymentStack as DeploymentStackMapper } from "../models/mappers.js"; - -export const accept: OperationParameter = { - parameterPath: "accept", - mapper: { - defaultValue: "application/json", - isConstant: true, - serializedName: "Accept", - type: { - name: "String", - }, - }, -}; - -export const $host: OperationURLParameter = { - parameterPath: "$host", - mapper: { - serializedName: "$host", - required: true, - type: { - name: "String", - }, - }, - skipEncoding: true, -}; - -export const subscriptionId: OperationURLParameter = { - parameterPath: "subscriptionId", - mapper: { - serializedName: "subscriptionId", - required: true, - type: { - name: "Uuid", - }, - }, -}; - -export const resourceGroupName: OperationURLParameter = { - parameterPath: "resourceGroupName", - mapper: { - constraints: { - MaxLength: 90, - MinLength: 1, - }, - serializedName: "resourceGroupName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const apiVersion: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2024-03-01", - isConstant: true, - serializedName: "api-version", - type: { - name: "String", - }, - }, -}; - -export const managementGroupId: OperationURLParameter = { - parameterPath: "managementGroupId", - mapper: { - constraints: { - Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), - MaxLength: 90, - MinLength: 1, - }, - serializedName: "managementGroupId", - required: true, - type: { - name: "String", - }, - }, -}; - -export const contentType: OperationParameter = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/json", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String", - }, - }, -}; - -export const deploymentStack: OperationParameter = { - parameterPath: "deploymentStack", - mapper: DeploymentStackMapper, -}; - -export const deploymentStackName: OperationURLParameter = { - parameterPath: "deploymentStackName", - mapper: { - constraints: { - Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), - MaxLength: 90, - MinLength: 1, - }, - serializedName: "deploymentStackName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const unmanageActionResources: OperationQueryParameter = { - parameterPath: ["options", "unmanageActionResources"], - mapper: { - serializedName: "unmanageAction.Resources", - type: { - name: "String", - }, - }, -}; - -export const unmanageActionResourceGroups: OperationQueryParameter = { - parameterPath: ["options", "unmanageActionResourceGroups"], - mapper: { - serializedName: "unmanageAction.ResourceGroups", - type: { - name: "String", - }, - }, -}; - -export const unmanageActionManagementGroups: OperationQueryParameter = { - parameterPath: ["options", "unmanageActionManagementGroups"], - mapper: { - serializedName: "unmanageAction.ManagementGroups", - type: { - name: "String", - }, - }, -}; - -export const bypassStackOutOfSyncError: OperationQueryParameter = { - parameterPath: ["options", "bypassStackOutOfSyncError"], - mapper: { - serializedName: "bypassStackOutOfSyncError", - type: { - name: "Boolean", - }, - }, -}; - -export const nextLink: OperationURLParameter = { - parameterPath: "nextLink", - mapper: { - serializedName: "nextLink", - required: true, - type: { - name: "String", - }, - }, - skipEncoding: true, -}; diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/operations/deploymentStacks.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/operations/deploymentStacks.ts deleted file mode 100644 index edb156bcc82b..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/operations/deploymentStacks.ts +++ /dev/null @@ -1,1800 +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. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import { DeploymentStacks } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { DeploymentStacksClient } from "../deploymentStacksClient.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import { - DeploymentStack, - DeploymentStacksListAtResourceGroupNextOptionalParams, - DeploymentStacksListAtResourceGroupOptionalParams, - DeploymentStacksListAtResourceGroupResponse, - DeploymentStacksListAtSubscriptionNextOptionalParams, - DeploymentStacksListAtSubscriptionOptionalParams, - DeploymentStacksListAtSubscriptionResponse, - DeploymentStacksListAtManagementGroupNextOptionalParams, - DeploymentStacksListAtManagementGroupOptionalParams, - DeploymentStacksListAtManagementGroupResponse, - DeploymentStacksCreateOrUpdateAtResourceGroupOptionalParams, - DeploymentStacksCreateOrUpdateAtResourceGroupResponse, - DeploymentStacksGetAtResourceGroupOptionalParams, - DeploymentStacksGetAtResourceGroupResponse, - DeploymentStacksDeleteAtResourceGroupOptionalParams, - DeploymentStacksCreateOrUpdateAtSubscriptionOptionalParams, - DeploymentStacksCreateOrUpdateAtSubscriptionResponse, - DeploymentStacksGetAtSubscriptionOptionalParams, - DeploymentStacksGetAtSubscriptionResponse, - DeploymentStacksDeleteAtSubscriptionOptionalParams, - DeploymentStacksCreateOrUpdateAtManagementGroupOptionalParams, - DeploymentStacksCreateOrUpdateAtManagementGroupResponse, - DeploymentStacksGetAtManagementGroupOptionalParams, - DeploymentStacksGetAtManagementGroupResponse, - DeploymentStacksDeleteAtManagementGroupOptionalParams, - DeploymentStacksExportTemplateAtResourceGroupOptionalParams, - DeploymentStacksExportTemplateAtResourceGroupResponse, - DeploymentStacksExportTemplateAtSubscriptionOptionalParams, - DeploymentStacksExportTemplateAtSubscriptionResponse, - DeploymentStacksExportTemplateAtManagementGroupOptionalParams, - DeploymentStacksExportTemplateAtManagementGroupResponse, - DeploymentStacksValidateStackAtResourceGroupOptionalParams, - DeploymentStacksValidateStackAtResourceGroupResponse, - DeploymentStacksValidateStackAtSubscriptionOptionalParams, - DeploymentStacksValidateStackAtSubscriptionResponse, - DeploymentStacksValidateStackAtManagementGroupOptionalParams, - DeploymentStacksValidateStackAtManagementGroupResponse, - DeploymentStacksListAtResourceGroupNextResponse, - DeploymentStacksListAtSubscriptionNextResponse, - DeploymentStacksListAtManagementGroupNextResponse, -} from "../models/index.js"; - -/// -/** Class containing DeploymentStacks operations. */ -export class DeploymentStacksImpl implements DeploymentStacks { - private readonly client: DeploymentStacksClient; - - /** - * Initialize a new instance of the class DeploymentStacks class. - * @param client Reference to the service client - */ - constructor(client: DeploymentStacksClient) { - this.client = client; - } - - /** - * Lists all the Deployment stacks within the specified Resource Group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public listAtResourceGroup( - resourceGroupName: string, - options?: DeploymentStacksListAtResourceGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listAtResourceGroupPagingAll(resourceGroupName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listAtResourceGroupPagingPage( - resourceGroupName, - options, - settings, - ); - }, - }; - } - - private async *listAtResourceGroupPagingPage( - resourceGroupName: string, - options?: DeploymentStacksListAtResourceGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DeploymentStacksListAtResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listAtResourceGroup(resourceGroupName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listAtResourceGroupNext( - resourceGroupName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listAtResourceGroupPagingAll( - resourceGroupName: string, - options?: DeploymentStacksListAtResourceGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listAtResourceGroupPagingPage( - resourceGroupName, - options, - )) { - yield* page; - } - } - - /** - * Lists all the Deployment stacks within the specified Subscription. - * @param options The options parameters. - */ - public listAtSubscription( - options?: DeploymentStacksListAtSubscriptionOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listAtSubscriptionPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listAtSubscriptionPagingPage(options, settings); - }, - }; - } - - private async *listAtSubscriptionPagingPage( - options?: DeploymentStacksListAtSubscriptionOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DeploymentStacksListAtSubscriptionResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listAtSubscription(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listAtSubscriptionNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listAtSubscriptionPagingAll( - options?: DeploymentStacksListAtSubscriptionOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listAtSubscriptionPagingPage(options)) { - yield* page; - } - } - - /** - * Lists all the Deployment stacks within the specified Management Group. - * @param managementGroupId Management Group id. - * @param options The options parameters. - */ - public listAtManagementGroup( - managementGroupId: string, - options?: DeploymentStacksListAtManagementGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listAtManagementGroupPagingAll( - managementGroupId, - options, - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listAtManagementGroupPagingPage( - managementGroupId, - options, - settings, - ); - }, - }; - } - - private async *listAtManagementGroupPagingPage( - managementGroupId: string, - options?: DeploymentStacksListAtManagementGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DeploymentStacksListAtManagementGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listAtManagementGroup(managementGroupId, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listAtManagementGroupNext( - managementGroupId, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listAtManagementGroupPagingAll( - managementGroupId: string, - options?: DeploymentStacksListAtManagementGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listAtManagementGroupPagingPage( - managementGroupId, - options, - )) { - yield* page; - } - } - - /** - * Lists all the Deployment stacks within the specified Resource Group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listAtResourceGroup( - resourceGroupName: string, - options?: DeploymentStacksListAtResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listAtResourceGroupOperationSpec, - ); - } - - /** - * Lists all the Deployment stacks within the specified Subscription. - * @param options The options parameters. - */ - private _listAtSubscription( - options?: DeploymentStacksListAtSubscriptionOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { options }, - listAtSubscriptionOperationSpec, - ); - } - - /** - * Lists all the Deployment stacks within the specified Management Group. - * @param managementGroupId Management Group id. - * @param options The options parameters. - */ - private _listAtManagementGroup( - managementGroupId: string, - options?: DeploymentStacksListAtManagementGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { managementGroupId, options }, - listAtManagementGroupOperationSpec, - ); - } - - /** - * Creates or updates a Deployment stack at Resource Group scope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAtResourceGroup( - resourceGroupName: string, - deploymentStackName: string, - deploymentStack: DeploymentStack, - options?: DeploymentStacksCreateOrUpdateAtResourceGroupOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentStacksCreateOrUpdateAtResourceGroupResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - deploymentStackName, - deploymentStack, - options, - }, - spec: createOrUpdateAtResourceGroupOperationSpec, - }); - const poller = await createHttpPoller< - DeploymentStacksCreateOrUpdateAtResourceGroupResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation", - }); - await poller.poll(); - return poller; - } - - /** - * Creates or updates a Deployment stack at Resource Group scope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAtResourceGroupAndWait( - resourceGroupName: string, - deploymentStackName: string, - deploymentStack: DeploymentStack, - options?: DeploymentStacksCreateOrUpdateAtResourceGroupOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdateAtResourceGroup( - resourceGroupName, - deploymentStackName, - deploymentStack, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Gets a Deployment stack with a given name at Resource Group scope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentStackName Name of the deployment stack. - * @param options The options parameters. - */ - getAtResourceGroup( - resourceGroupName: string, - deploymentStackName: string, - options?: DeploymentStacksGetAtResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, deploymentStackName, options }, - getAtResourceGroupOperationSpec, - ); - } - - /** - * Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code - * 200 returned without content. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentStackName Name of the deployment stack. - * @param options The options parameters. - */ - async beginDeleteAtResourceGroup( - resourceGroupName: string, - deploymentStackName: string, - options?: DeploymentStacksDeleteAtResourceGroupOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, deploymentStackName, options }, - spec: deleteAtResourceGroupOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code - * 200 returned without content. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentStackName Name of the deployment stack. - * @param options The options parameters. - */ - async beginDeleteAtResourceGroupAndWait( - resourceGroupName: string, - deploymentStackName: string, - options?: DeploymentStacksDeleteAtResourceGroupOptionalParams, - ): Promise { - const poller = await this.beginDeleteAtResourceGroup( - resourceGroupName, - deploymentStackName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Creates or updates a Deployment stack at Subscription scope. - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAtSubscription( - deploymentStackName: string, - deploymentStack: DeploymentStack, - options?: DeploymentStacksCreateOrUpdateAtSubscriptionOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentStacksCreateOrUpdateAtSubscriptionResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { deploymentStackName, deploymentStack, options }, - spec: createOrUpdateAtSubscriptionOperationSpec, - }); - const poller = await createHttpPoller< - DeploymentStacksCreateOrUpdateAtSubscriptionResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation", - }); - await poller.poll(); - return poller; - } - - /** - * Creates or updates a Deployment stack at Subscription scope. - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAtSubscriptionAndWait( - deploymentStackName: string, - deploymentStack: DeploymentStack, - options?: DeploymentStacksCreateOrUpdateAtSubscriptionOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdateAtSubscription( - deploymentStackName, - deploymentStack, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Gets a Deployment stack with a given name at Subscription scope. - * @param deploymentStackName Name of the deployment stack. - * @param options The options parameters. - */ - getAtSubscription( - deploymentStackName: string, - options?: DeploymentStacksGetAtSubscriptionOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { deploymentStackName, options }, - getAtSubscriptionOperationSpec, - ); - } - - /** - * Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 - * returned without content. - * @param deploymentStackName Name of the deployment stack. - * @param options The options parameters. - */ - async beginDeleteAtSubscription( - deploymentStackName: string, - options?: DeploymentStacksDeleteAtSubscriptionOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { deploymentStackName, options }, - spec: deleteAtSubscriptionOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 - * returned without content. - * @param deploymentStackName Name of the deployment stack. - * @param options The options parameters. - */ - async beginDeleteAtSubscriptionAndWait( - deploymentStackName: string, - options?: DeploymentStacksDeleteAtSubscriptionOptionalParams, - ): Promise { - const poller = await this.beginDeleteAtSubscription( - deploymentStackName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Creates or updates a Deployment stack at Management Group scope. - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAtManagementGroup( - managementGroupId: string, - deploymentStackName: string, - deploymentStack: DeploymentStack, - options?: DeploymentStacksCreateOrUpdateAtManagementGroupOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentStacksCreateOrUpdateAtManagementGroupResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { - managementGroupId, - deploymentStackName, - deploymentStack, - options, - }, - spec: createOrUpdateAtManagementGroupOperationSpec, - }); - const poller = await createHttpPoller< - DeploymentStacksCreateOrUpdateAtManagementGroupResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation", - }); - await poller.poll(); - return poller; - } - - /** - * Creates or updates a Deployment stack at Management Group scope. - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAtManagementGroupAndWait( - managementGroupId: string, - deploymentStackName: string, - deploymentStack: DeploymentStack, - options?: DeploymentStacksCreateOrUpdateAtManagementGroupOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdateAtManagementGroup( - managementGroupId, - deploymentStackName, - deploymentStack, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Gets a Deployment stack with a given name at Management Group scope. - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @param options The options parameters. - */ - getAtManagementGroup( - managementGroupId: string, - deploymentStackName: string, - options?: DeploymentStacksGetAtManagementGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { managementGroupId, deploymentStackName, options }, - getAtManagementGroupOperationSpec, - ); - } - - /** - * Deletes a Deployment stack by name at Management Group scope. When operation completes, status code - * 200 returned without content. - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @param options The options parameters. - */ - async beginDeleteAtManagementGroup( - managementGroupId: string, - deploymentStackName: string, - options?: DeploymentStacksDeleteAtManagementGroupOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { managementGroupId, deploymentStackName, options }, - spec: deleteAtManagementGroupOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Deletes a Deployment stack by name at Management Group scope. When operation completes, status code - * 200 returned without content. - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @param options The options parameters. - */ - async beginDeleteAtManagementGroupAndWait( - managementGroupId: string, - deploymentStackName: string, - options?: DeploymentStacksDeleteAtManagementGroupOptionalParams, - ): Promise { - const poller = await this.beginDeleteAtManagementGroup( - managementGroupId, - deploymentStackName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Exports the template used to create the Deployment stack at Resource Group scope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentStackName Name of the deployment stack. - * @param options The options parameters. - */ - exportTemplateAtResourceGroup( - resourceGroupName: string, - deploymentStackName: string, - options?: DeploymentStacksExportTemplateAtResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, deploymentStackName, options }, - exportTemplateAtResourceGroupOperationSpec, - ); - } - - /** - * Exports the template used to create the Deployment stack at Subscription scope. - * @param deploymentStackName Name of the deployment stack. - * @param options The options parameters. - */ - exportTemplateAtSubscription( - deploymentStackName: string, - options?: DeploymentStacksExportTemplateAtSubscriptionOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { deploymentStackName, options }, - exportTemplateAtSubscriptionOperationSpec, - ); - } - - /** - * Exports the template used to create the Deployment stack at Management Group scope. - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @param options The options parameters. - */ - exportTemplateAtManagementGroup( - managementGroupId: string, - deploymentStackName: string, - options?: DeploymentStacksExportTemplateAtManagementGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { managementGroupId, deploymentStackName, options }, - exportTemplateAtManagementGroupOperationSpec, - ); - } - - /** - * Runs preflight validation on the Resource Group scoped Deployment stack template to verify its - * acceptance to Azure Resource Manager. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. - * @param options The options parameters. - */ - async beginValidateStackAtResourceGroup( - resourceGroupName: string, - deploymentStackName: string, - deploymentStack: DeploymentStack, - options?: DeploymentStacksValidateStackAtResourceGroupOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentStacksValidateStackAtResourceGroupResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - deploymentStackName, - deploymentStack, - options, - }, - spec: validateStackAtResourceGroupOperationSpec, - }); - const poller = await createHttpPoller< - DeploymentStacksValidateStackAtResourceGroupResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Runs preflight validation on the Resource Group scoped Deployment stack template to verify its - * acceptance to Azure Resource Manager. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. - * @param options The options parameters. - */ - async beginValidateStackAtResourceGroupAndWait( - resourceGroupName: string, - deploymentStackName: string, - deploymentStack: DeploymentStack, - options?: DeploymentStacksValidateStackAtResourceGroupOptionalParams, - ): Promise { - const poller = await this.beginValidateStackAtResourceGroup( - resourceGroupName, - deploymentStackName, - deploymentStack, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Runs preflight validation on the Subscription scoped Deployment stack template to verify its - * acceptance to Azure Resource Manager. - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. - * @param options The options parameters. - */ - async beginValidateStackAtSubscription( - deploymentStackName: string, - deploymentStack: DeploymentStack, - options?: DeploymentStacksValidateStackAtSubscriptionOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentStacksValidateStackAtSubscriptionResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { deploymentStackName, deploymentStack, options }, - spec: validateStackAtSubscriptionOperationSpec, - }); - const poller = await createHttpPoller< - DeploymentStacksValidateStackAtSubscriptionResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Runs preflight validation on the Subscription scoped Deployment stack template to verify its - * acceptance to Azure Resource Manager. - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. - * @param options The options parameters. - */ - async beginValidateStackAtSubscriptionAndWait( - deploymentStackName: string, - deploymentStack: DeploymentStack, - options?: DeploymentStacksValidateStackAtSubscriptionOptionalParams, - ): Promise { - const poller = await this.beginValidateStackAtSubscription( - deploymentStackName, - deploymentStack, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Runs preflight validation on the Management Group scoped Deployment stack template to verify its - * acceptance to Azure Resource Manager. - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. - * @param options The options parameters. - */ - async beginValidateStackAtManagementGroup( - managementGroupId: string, - deploymentStackName: string, - deploymentStack: DeploymentStack, - options?: DeploymentStacksValidateStackAtManagementGroupOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentStacksValidateStackAtManagementGroupResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { - managementGroupId, - deploymentStackName, - deploymentStack, - options, - }, - spec: validateStackAtManagementGroupOperationSpec, - }); - const poller = await createHttpPoller< - DeploymentStacksValidateStackAtManagementGroupResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Runs preflight validation on the Management Group scoped Deployment stack template to verify its - * acceptance to Azure Resource Manager. - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. - * @param options The options parameters. - */ - async beginValidateStackAtManagementGroupAndWait( - managementGroupId: string, - deploymentStackName: string, - deploymentStack: DeploymentStack, - options?: DeploymentStacksValidateStackAtManagementGroupOptionalParams, - ): Promise { - const poller = await this.beginValidateStackAtManagementGroup( - managementGroupId, - deploymentStackName, - deploymentStack, - options, - ); - return poller.pollUntilDone(); - } - - /** - * ListAtResourceGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListAtResourceGroup method. - * @param options The options parameters. - */ - private _listAtResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: DeploymentStacksListAtResourceGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listAtResourceGroupNextOperationSpec, - ); - } - - /** - * ListAtSubscriptionNext - * @param nextLink The nextLink from the previous successful call to the ListAtSubscription method. - * @param options The options parameters. - */ - private _listAtSubscriptionNext( - nextLink: string, - options?: DeploymentStacksListAtSubscriptionNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listAtSubscriptionNextOperationSpec, - ); - } - - /** - * ListAtManagementGroupNext - * @param managementGroupId Management Group id. - * @param nextLink The nextLink from the previous successful call to the ListAtManagementGroup method. - * @param options The options parameters. - */ - private _listAtManagementGroupNext( - managementGroupId: string, - nextLink: string, - options?: DeploymentStacksListAtManagementGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { managementGroupId, nextLink, options }, - listAtManagementGroupNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listAtResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacks", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentStackListResult, - }, - default: { - bodyMapper: Mappers.DeploymentStacksError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listAtSubscriptionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentStackListResult, - }, - default: { - bodyMapper: Mappers.DeploymentStacksError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listAtManagementGroupOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentStackListResult, - }, - default: { - bodyMapper: Mappers.DeploymentStacksError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.managementGroupId], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateAtResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.DeploymentStack, - }, - 201: { - bodyMapper: Mappers.DeploymentStack, - }, - 202: { - bodyMapper: Mappers.DeploymentStack, - }, - 204: { - bodyMapper: Mappers.DeploymentStack, - }, - default: { - bodyMapper: Mappers.DeploymentStacksError, - }, - }, - requestBody: Parameters.deploymentStack, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.deploymentStackName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const getAtResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentStack, - }, - default: { - bodyMapper: Mappers.DeploymentStacksError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.deploymentStackName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const deleteAtResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.DeploymentStacksError, - }, - }, - queryParameters: [ - Parameters.apiVersion, - Parameters.unmanageActionResources, - Parameters.unmanageActionResourceGroups, - Parameters.unmanageActionManagementGroups, - Parameters.bypassStackOutOfSyncError, - ], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.deploymentStackName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateAtSubscriptionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.DeploymentStack, - }, - 201: { - bodyMapper: Mappers.DeploymentStack, - }, - 202: { - bodyMapper: Mappers.DeploymentStack, - }, - 204: { - bodyMapper: Mappers.DeploymentStack, - }, - default: { - bodyMapper: Mappers.DeploymentStacksError, - }, - }, - requestBody: Parameters.deploymentStack, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.deploymentStackName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const getAtSubscriptionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentStack, - }, - default: { - bodyMapper: Mappers.DeploymentStacksError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.deploymentStackName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const deleteAtSubscriptionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.DeploymentStacksError, - }, - }, - queryParameters: [ - Parameters.apiVersion, - Parameters.unmanageActionResources, - Parameters.unmanageActionResourceGroups, - Parameters.unmanageActionManagementGroups, - Parameters.bypassStackOutOfSyncError, - ], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.deploymentStackName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateAtManagementGroupOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.DeploymentStack, - }, - 201: { - bodyMapper: Mappers.DeploymentStack, - }, - 202: { - bodyMapper: Mappers.DeploymentStack, - }, - 204: { - bodyMapper: Mappers.DeploymentStack, - }, - default: { - bodyMapper: Mappers.DeploymentStacksError, - }, - }, - requestBody: Parameters.deploymentStack, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.managementGroupId, - Parameters.deploymentStackName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const getAtManagementGroupOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentStack, - }, - default: { - bodyMapper: Mappers.DeploymentStacksError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.managementGroupId, - Parameters.deploymentStackName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const deleteAtManagementGroupOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.DeploymentStacksError, - }, - }, - queryParameters: [ - Parameters.apiVersion, - Parameters.unmanageActionResources, - Parameters.unmanageActionResourceGroups, - Parameters.unmanageActionManagementGroups, - Parameters.bypassStackOutOfSyncError, - ], - urlParameters: [ - Parameters.$host, - Parameters.managementGroupId, - Parameters.deploymentStackName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const exportTemplateAtResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/exportTemplate", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.DeploymentStackTemplateDefinition, - }, - default: { - bodyMapper: Mappers.DeploymentStacksError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.deploymentStackName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const exportTemplateAtSubscriptionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/exportTemplate", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.DeploymentStackTemplateDefinition, - }, - default: { - bodyMapper: Mappers.DeploymentStacksError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.deploymentStackName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const exportTemplateAtManagementGroupOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/exportTemplate", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.DeploymentStackTemplateDefinition, - }, - default: { - bodyMapper: Mappers.DeploymentStacksError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.managementGroupId, - Parameters.deploymentStackName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const validateStackAtResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/validate", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.DeploymentStackValidateResult, - }, - 201: { - bodyMapper: Mappers.DeploymentStackValidateResult, - }, - 202: { - bodyMapper: Mappers.DeploymentStackValidateResult, - }, - 204: { - bodyMapper: Mappers.DeploymentStackValidateResult, - }, - default: { - bodyMapper: Mappers.DeploymentStacksError, - }, - }, - requestBody: Parameters.deploymentStack, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.deploymentStackName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const validateStackAtSubscriptionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/validate", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.DeploymentStackValidateResult, - }, - 201: { - bodyMapper: Mappers.DeploymentStackValidateResult, - }, - 202: { - bodyMapper: Mappers.DeploymentStackValidateResult, - }, - 204: { - bodyMapper: Mappers.DeploymentStackValidateResult, - }, - default: { - bodyMapper: Mappers.DeploymentStacksError, - }, - }, - requestBody: Parameters.deploymentStack, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.deploymentStackName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const validateStackAtManagementGroupOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/validate", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.DeploymentStackValidateResult, - }, - 201: { - bodyMapper: Mappers.DeploymentStackValidateResult, - }, - 202: { - bodyMapper: Mappers.DeploymentStackValidateResult, - }, - 204: { - bodyMapper: Mappers.DeploymentStackValidateResult, - }, - default: { - bodyMapper: Mappers.DeploymentStacksError, - }, - }, - requestBody: Parameters.deploymentStack, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.managementGroupId, - Parameters.deploymentStackName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const listAtResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentStackListResult, - }, - default: { - bodyMapper: Mappers.DeploymentStacksError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listAtSubscriptionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentStackListResult, - }, - default: { - bodyMapper: Mappers.DeploymentStacksError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listAtManagementGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentStackListResult, - }, - default: { - bodyMapper: Mappers.DeploymentStacksError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.managementGroupId, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/operations/index.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/operations/index.ts deleted file mode 100644 index e083917c2903..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/operations/index.ts +++ /dev/null @@ -1,9 +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 * from "./deploymentStacks.js"; diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/operationsInterfaces/deploymentStacks.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/operationsInterfaces/deploymentStacks.ts deleted file mode 100644 index eb1700a1c5b0..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/operationsInterfaces/deploymentStacks.ts +++ /dev/null @@ -1,387 +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. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - DeploymentStack, - DeploymentStacksListAtResourceGroupOptionalParams, - DeploymentStacksListAtSubscriptionOptionalParams, - DeploymentStacksListAtManagementGroupOptionalParams, - DeploymentStacksCreateOrUpdateAtResourceGroupOptionalParams, - DeploymentStacksCreateOrUpdateAtResourceGroupResponse, - DeploymentStacksGetAtResourceGroupOptionalParams, - DeploymentStacksGetAtResourceGroupResponse, - DeploymentStacksDeleteAtResourceGroupOptionalParams, - DeploymentStacksCreateOrUpdateAtSubscriptionOptionalParams, - DeploymentStacksCreateOrUpdateAtSubscriptionResponse, - DeploymentStacksGetAtSubscriptionOptionalParams, - DeploymentStacksGetAtSubscriptionResponse, - DeploymentStacksDeleteAtSubscriptionOptionalParams, - DeploymentStacksCreateOrUpdateAtManagementGroupOptionalParams, - DeploymentStacksCreateOrUpdateAtManagementGroupResponse, - DeploymentStacksGetAtManagementGroupOptionalParams, - DeploymentStacksGetAtManagementGroupResponse, - DeploymentStacksDeleteAtManagementGroupOptionalParams, - DeploymentStacksExportTemplateAtResourceGroupOptionalParams, - DeploymentStacksExportTemplateAtResourceGroupResponse, - DeploymentStacksExportTemplateAtSubscriptionOptionalParams, - DeploymentStacksExportTemplateAtSubscriptionResponse, - DeploymentStacksExportTemplateAtManagementGroupOptionalParams, - DeploymentStacksExportTemplateAtManagementGroupResponse, - DeploymentStacksValidateStackAtResourceGroupOptionalParams, - DeploymentStacksValidateStackAtResourceGroupResponse, - DeploymentStacksValidateStackAtSubscriptionOptionalParams, - DeploymentStacksValidateStackAtSubscriptionResponse, - DeploymentStacksValidateStackAtManagementGroupOptionalParams, - DeploymentStacksValidateStackAtManagementGroupResponse, -} from "../models/index.js"; - -/// -/** Interface representing a DeploymentStacks. */ -export interface DeploymentStacks { - /** - * Lists all the Deployment stacks within the specified Resource Group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listAtResourceGroup( - resourceGroupName: string, - options?: DeploymentStacksListAtResourceGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Lists all the Deployment stacks within the specified Subscription. - * @param options The options parameters. - */ - listAtSubscription( - options?: DeploymentStacksListAtSubscriptionOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Lists all the Deployment stacks within the specified Management Group. - * @param managementGroupId Management Group id. - * @param options The options parameters. - */ - listAtManagementGroup( - managementGroupId: string, - options?: DeploymentStacksListAtManagementGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Creates or updates a Deployment stack at Resource Group scope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAtResourceGroup( - resourceGroupName: string, - deploymentStackName: string, - deploymentStack: DeploymentStack, - options?: DeploymentStacksCreateOrUpdateAtResourceGroupOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentStacksCreateOrUpdateAtResourceGroupResponse - > - >; - /** - * Creates or updates a Deployment stack at Resource Group scope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAtResourceGroupAndWait( - resourceGroupName: string, - deploymentStackName: string, - deploymentStack: DeploymentStack, - options?: DeploymentStacksCreateOrUpdateAtResourceGroupOptionalParams, - ): Promise; - /** - * Gets a Deployment stack with a given name at Resource Group scope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentStackName Name of the deployment stack. - * @param options The options parameters. - */ - getAtResourceGroup( - resourceGroupName: string, - deploymentStackName: string, - options?: DeploymentStacksGetAtResourceGroupOptionalParams, - ): Promise; - /** - * Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code - * 200 returned without content. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentStackName Name of the deployment stack. - * @param options The options parameters. - */ - beginDeleteAtResourceGroup( - resourceGroupName: string, - deploymentStackName: string, - options?: DeploymentStacksDeleteAtResourceGroupOptionalParams, - ): Promise, void>>; - /** - * Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code - * 200 returned without content. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentStackName Name of the deployment stack. - * @param options The options parameters. - */ - beginDeleteAtResourceGroupAndWait( - resourceGroupName: string, - deploymentStackName: string, - options?: DeploymentStacksDeleteAtResourceGroupOptionalParams, - ): Promise; - /** - * Creates or updates a Deployment stack at Subscription scope. - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAtSubscription( - deploymentStackName: string, - deploymentStack: DeploymentStack, - options?: DeploymentStacksCreateOrUpdateAtSubscriptionOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentStacksCreateOrUpdateAtSubscriptionResponse - > - >; - /** - * Creates or updates a Deployment stack at Subscription scope. - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAtSubscriptionAndWait( - deploymentStackName: string, - deploymentStack: DeploymentStack, - options?: DeploymentStacksCreateOrUpdateAtSubscriptionOptionalParams, - ): Promise; - /** - * Gets a Deployment stack with a given name at Subscription scope. - * @param deploymentStackName Name of the deployment stack. - * @param options The options parameters. - */ - getAtSubscription( - deploymentStackName: string, - options?: DeploymentStacksGetAtSubscriptionOptionalParams, - ): Promise; - /** - * Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 - * returned without content. - * @param deploymentStackName Name of the deployment stack. - * @param options The options parameters. - */ - beginDeleteAtSubscription( - deploymentStackName: string, - options?: DeploymentStacksDeleteAtSubscriptionOptionalParams, - ): Promise, void>>; - /** - * Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 - * returned without content. - * @param deploymentStackName Name of the deployment stack. - * @param options The options parameters. - */ - beginDeleteAtSubscriptionAndWait( - deploymentStackName: string, - options?: DeploymentStacksDeleteAtSubscriptionOptionalParams, - ): Promise; - /** - * Creates or updates a Deployment stack at Management Group scope. - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAtManagementGroup( - managementGroupId: string, - deploymentStackName: string, - deploymentStack: DeploymentStack, - options?: DeploymentStacksCreateOrUpdateAtManagementGroupOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentStacksCreateOrUpdateAtManagementGroupResponse - > - >; - /** - * Creates or updates a Deployment stack at Management Group scope. - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAtManagementGroupAndWait( - managementGroupId: string, - deploymentStackName: string, - deploymentStack: DeploymentStack, - options?: DeploymentStacksCreateOrUpdateAtManagementGroupOptionalParams, - ): Promise; - /** - * Gets a Deployment stack with a given name at Management Group scope. - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @param options The options parameters. - */ - getAtManagementGroup( - managementGroupId: string, - deploymentStackName: string, - options?: DeploymentStacksGetAtManagementGroupOptionalParams, - ): Promise; - /** - * Deletes a Deployment stack by name at Management Group scope. When operation completes, status code - * 200 returned without content. - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @param options The options parameters. - */ - beginDeleteAtManagementGroup( - managementGroupId: string, - deploymentStackName: string, - options?: DeploymentStacksDeleteAtManagementGroupOptionalParams, - ): Promise, void>>; - /** - * Deletes a Deployment stack by name at Management Group scope. When operation completes, status code - * 200 returned without content. - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @param options The options parameters. - */ - beginDeleteAtManagementGroupAndWait( - managementGroupId: string, - deploymentStackName: string, - options?: DeploymentStacksDeleteAtManagementGroupOptionalParams, - ): Promise; - /** - * Exports the template used to create the Deployment stack at Resource Group scope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentStackName Name of the deployment stack. - * @param options The options parameters. - */ - exportTemplateAtResourceGroup( - resourceGroupName: string, - deploymentStackName: string, - options?: DeploymentStacksExportTemplateAtResourceGroupOptionalParams, - ): Promise; - /** - * Exports the template used to create the Deployment stack at Subscription scope. - * @param deploymentStackName Name of the deployment stack. - * @param options The options parameters. - */ - exportTemplateAtSubscription( - deploymentStackName: string, - options?: DeploymentStacksExportTemplateAtSubscriptionOptionalParams, - ): Promise; - /** - * Exports the template used to create the Deployment stack at Management Group scope. - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @param options The options parameters. - */ - exportTemplateAtManagementGroup( - managementGroupId: string, - deploymentStackName: string, - options?: DeploymentStacksExportTemplateAtManagementGroupOptionalParams, - ): Promise; - /** - * Runs preflight validation on the Resource Group scoped Deployment stack template to verify its - * acceptance to Azure Resource Manager. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. - * @param options The options parameters. - */ - beginValidateStackAtResourceGroup( - resourceGroupName: string, - deploymentStackName: string, - deploymentStack: DeploymentStack, - options?: DeploymentStacksValidateStackAtResourceGroupOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentStacksValidateStackAtResourceGroupResponse - > - >; - /** - * Runs preflight validation on the Resource Group scoped Deployment stack template to verify its - * acceptance to Azure Resource Manager. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. - * @param options The options parameters. - */ - beginValidateStackAtResourceGroupAndWait( - resourceGroupName: string, - deploymentStackName: string, - deploymentStack: DeploymentStack, - options?: DeploymentStacksValidateStackAtResourceGroupOptionalParams, - ): Promise; - /** - * Runs preflight validation on the Subscription scoped Deployment stack template to verify its - * acceptance to Azure Resource Manager. - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. - * @param options The options parameters. - */ - beginValidateStackAtSubscription( - deploymentStackName: string, - deploymentStack: DeploymentStack, - options?: DeploymentStacksValidateStackAtSubscriptionOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentStacksValidateStackAtSubscriptionResponse - > - >; - /** - * Runs preflight validation on the Subscription scoped Deployment stack template to verify its - * acceptance to Azure Resource Manager. - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. - * @param options The options parameters. - */ - beginValidateStackAtSubscriptionAndWait( - deploymentStackName: string, - deploymentStack: DeploymentStack, - options?: DeploymentStacksValidateStackAtSubscriptionOptionalParams, - ): Promise; - /** - * Runs preflight validation on the Management Group scoped Deployment stack template to verify its - * acceptance to Azure Resource Manager. - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. - * @param options The options parameters. - */ - beginValidateStackAtManagementGroup( - managementGroupId: string, - deploymentStackName: string, - deploymentStack: DeploymentStack, - options?: DeploymentStacksValidateStackAtManagementGroupOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentStacksValidateStackAtManagementGroupResponse - > - >; - /** - * Runs preflight validation on the Management Group scoped Deployment stack template to verify its - * acceptance to Azure Resource Manager. - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. - * @param options The options parameters. - */ - beginValidateStackAtManagementGroupAndWait( - managementGroupId: string, - deploymentStackName: string, - deploymentStack: DeploymentStack, - options?: DeploymentStacksValidateStackAtManagementGroupOptionalParams, - ): Promise; -} diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/operationsInterfaces/index.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/operationsInterfaces/index.ts deleted file mode 100644 index e083917c2903..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/operationsInterfaces/index.ts +++ /dev/null @@ -1,9 +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 * from "./deploymentStacks.js"; diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/pagingHelper.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/pagingHelper.ts deleted file mode 100644 index 205cccc26592..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/pagingHelper.ts +++ /dev/null @@ -1,39 +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 interface PageInfo { - continuationToken?: string; -} - -const pageMap = new WeakMap(); - -/** - * Given the last `.value` produced by the `byPage` iterator, - * returns a continuation token that can be used to begin paging from - * that point later. - * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. - * @returns The continuation token that can be passed into byPage() during future calls. - */ -export function getContinuationToken(page: unknown): string | undefined { - if (typeof page !== "object" || page === null) { - return undefined; - } - return pageMap.get(page)?.continuationToken; -} - -export function setContinuationToken( - page: unknown, - continuationToken: string | undefined, -): void { - if (typeof page !== "object" || page === null || !continuationToken) { - return; - } - const pageInfo = pageMap.get(page) ?? {}; - pageInfo.continuationToken = continuationToken; - pageMap.set(page, pageInfo); -} diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/restorePollerHelpers.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/restorePollerHelpers.ts new file mode 100644 index 000000000000..701e163abbeb --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/restorePollerHelpers.ts @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { DeploymentStacksClient } from "./deploymentStacksClient.js"; +import { + _deleteAtManagementGroupDeserialize, + _createOrUpdateAtManagementGroupDeserialize, + _validateStackAtManagementGroupDeserialize, + _deleteAtSubscriptionDeserialize, + _createOrUpdateAtSubscriptionDeserialize, + _validateStackAtSubscriptionDeserialize, + _deleteAtResourceGroupDeserialize, + _createOrUpdateAtResourceGroupDeserialize, + _validateStackAtResourceGroupDeserialize, +} from "./api/deploymentStacks/operations.js"; +import { + _whatIfDeserialize, + _createOrUpdateDeserialize, +} from "./api/deploymentStacksWhatIfResultsAtManagementGroup/operations.js"; +import { + _whatIfDeserialize as _whatIfDeserializeDeploymentStacksWhatIfResultsAtSubscription, + _createOrUpdateDeserialize as _createOrUpdateDeserializeDeploymentStacksWhatIfResultsAtSubscription, +} from "./api/deploymentStacksWhatIfResultsAtSubscription/operations.js"; +import { + _whatIfDeserialize as _whatIfDeserializeDeploymentStacksWhatIfResultsAtResourceGroup, + _createOrUpdateDeserialize as _createOrUpdateDeserializeDeploymentStacksWhatIfResultsAtResourceGroup, +} from "./api/deploymentStacksWhatIfResultsAtResourceGroup/operations.js"; +import { getLongRunningPoller } from "./static-helpers/pollingHelpers.js"; +import type { OperationOptions, PathUncheckedResponse } from "@azure-rest/core-client"; +import type { AbortSignalLike } from "@azure/abort-controller"; +import type { PollerLike, OperationState, ResourceLocationConfig } from "@azure/core-lro"; +import { deserializeState } from "@azure/core-lro"; + +export interface RestorePollerOptions< + TResult, + TResponse extends PathUncheckedResponse = PathUncheckedResponse, +> extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** + * The signal which can be used to abort requests. + */ + abortSignal?: AbortSignalLike; + /** Deserialization function for raw response body */ + processResponseBody?: (result: TResponse) => Promise; +} + +/** + * Creates a poller from the serialized state of another poller. This can be + * useful when you want to create pollers on a different host or a poller + * needs to be constructed after the original one is not in scope. + */ +export function restorePoller( + client: DeploymentStacksClient, + serializedState: string, + sourceOperation: (...args: any[]) => PollerLike, TResult>, + options?: RestorePollerOptions, +): PollerLike, TResult> { + const pollerConfig = deserializeState(serializedState).config; + const { initialRequestUrl, requestMethod, metadata } = pollerConfig; + if (!initialRequestUrl || !requestMethod) { + throw new Error( + `Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation?.name}`, + ); + } + const resourceLocationConfig = metadata?.["resourceLocationConfig"] as + | ResourceLocationConfig + | undefined; + const { deserializer, expectedStatuses = [] } = + getDeserializationHelper(initialRequestUrl, requestMethod) ?? {}; + const deserializeHelper = options?.processResponseBody ?? deserializer; + if (!deserializeHelper) { + throw new Error( + `Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`, + ); + } + return getLongRunningPoller( + (client as any)["_client"] ?? client, + deserializeHelper as (result: TResponse) => Promise, + expectedStatuses, + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + resourceLocationConfig, + restoreFrom: serializedState, + initialRequestUrl, + }, + ); +} + +interface DeserializationHelper { + deserializer: (result: PathUncheckedResponse) => Promise; + expectedStatuses: string[]; +} + +const deserializeMap: Record = { + "DELETE /providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}": + { deserializer: _deleteAtManagementGroupDeserialize, expectedStatuses: ["200", "202", "204"] }, + "PUT /providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}": + { + deserializer: _createOrUpdateAtManagementGroupDeserialize, + expectedStatuses: ["200", "201", "202"], + }, + "POST /providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/validate": + { + deserializer: _validateStackAtManagementGroupDeserialize, + expectedStatuses: ["202", "200", "400", "201"], + }, + "DELETE /subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}": + { deserializer: _deleteAtSubscriptionDeserialize, expectedStatuses: ["200", "202", "204"] }, + "PUT /subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}": + { + deserializer: _createOrUpdateAtSubscriptionDeserialize, + expectedStatuses: ["200", "201", "202"], + }, + "POST /subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/validate": + { + deserializer: _validateStackAtSubscriptionDeserialize, + expectedStatuses: ["202", "200", "400", "201"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}": + { deserializer: _deleteAtResourceGroupDeserialize, expectedStatuses: ["200", "202", "204"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}": + { + deserializer: _createOrUpdateAtResourceGroupDeserialize, + expectedStatuses: ["200", "201", "202"], + }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/validate": + { + deserializer: _validateStackAtResourceGroupDeserialize, + expectedStatuses: ["202", "200", "400", "201"], + }, + "POST /providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacksWhatIfResults/{deploymentStacksWhatIfResultName}/whatIf": + { deserializer: _whatIfDeserialize, expectedStatuses: ["202", "200", "201"] }, + "PUT /providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacksWhatIfResults/{deploymentStacksWhatIfResultName}": + { deserializer: _createOrUpdateDeserialize, expectedStatuses: ["200", "201", "202"] }, + "POST /subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacksWhatIfResults/{deploymentStacksWhatIfResultName}/whatIf": + { + deserializer: _whatIfDeserializeDeploymentStacksWhatIfResultsAtSubscription, + expectedStatuses: ["202", "200", "201"], + }, + "PUT /subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacksWhatIfResults/{deploymentStacksWhatIfResultName}": + { + deserializer: _createOrUpdateDeserializeDeploymentStacksWhatIfResultsAtSubscription, + expectedStatuses: ["200", "201", "202"], + }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacksWhatIfResults/{deploymentStacksWhatIfResultName}/whatIf": + { + deserializer: _whatIfDeserializeDeploymentStacksWhatIfResultsAtResourceGroup, + expectedStatuses: ["202", "200", "201"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacksWhatIfResults/{deploymentStacksWhatIfResultName}": + { + deserializer: _createOrUpdateDeserializeDeploymentStacksWhatIfResultsAtResourceGroup, + expectedStatuses: ["200", "201", "202"], + }, +}; + +function getDeserializationHelper( + urlStr: string, + method: string, +): DeserializationHelper | undefined { + const path = new URL(urlStr).pathname; + const pathParts = path.split("/"); + + // Traverse list to match the longest candidate + // matchedLen: the length of candidate path + // matchedValue: the matched status code array + let matchedLen = -1, + matchedValue: DeserializationHelper | undefined; + + // Iterate the responseMap to find a match + for (const [key, value] of Object.entries(deserializeMap)) { + // Extracting the path from the map key which is in format + // GET /path/foo + if (!key.startsWith(method)) { + continue; + } + const candidatePath = getPathFromMapKey(key); + // Get each part of the url path + const candidateParts = candidatePath.split("/"); + + // track if we have found a match to return the values found. + let found = true; + for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) { + if (candidateParts[i]?.startsWith("{") && candidateParts[i]?.indexOf("}") !== -1) { + const start = candidateParts[i]!.indexOf("}") + 1, + end = candidateParts[i]?.length; + // If the current part of the candidate is a "template" part + // Try to use the suffix of pattern to match the path + // {guid} ==> $ + // {guid}:export ==> :export$ + const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test( + pathParts[j] || "", + ); + + if (!isMatched) { + found = false; + break; + } + continue; + } + + // If the candidate part is not a template and + // the parts don't match mark the candidate as not found + // to move on with the next candidate path. + if (candidateParts[i] !== pathParts[j]) { + found = false; + break; + } + } + + // We finished evaluating the current candidate parts + // Update the matched value if and only if we found the longer pattern + if (found && candidatePath.length > matchedLen) { + matchedLen = candidatePath.length; + matchedValue = value; + } + } + + return matchedValue; +} + +function getPathFromMapKey(mapKey: string): string { + const pathStart = mapKey.indexOf("/"); + return mapKey.slice(pathStart); +} diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/static-helpers/cloudSettingHelpers.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/static-helpers/cloudSettingHelpers.ts new file mode 100644 index 000000000000..613112c6e397 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/static-helpers/cloudSettingHelpers.ts @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * An enum to describe Azure Cloud environments. + * @enum {string} + */ +export enum AzureClouds { + /** Azure public cloud, which is the default cloud for Azure SDKs. */ + AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD", + /** Azure China cloud */ + AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD", + /** Azure US government cloud */ + AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT", +} + +/** The supported values for cloud setting as a string literal type */ +export type AzureSupportedClouds = `${AzureClouds}`; + +/** + * Gets the Azure Resource Manager endpoint URL for the specified cloud setting. + * @param cloudSetting - The Azure cloud environment setting. Use one of the AzureClouds enum values. + * @returns The ARM endpoint URL for the specified cloud, or undefined if cloudSetting is undefined. + * @throws {Error} Throws an error if an unknown cloud setting is provided. + */ +export function getArmEndpoint(cloudSetting?: AzureSupportedClouds): string | undefined { + if (cloudSetting === undefined) { + return undefined; + } + const cloudEndpoints: Record = { + AZURE_CHINA_CLOUD: "https://management.chinacloudapi.cn/", + AZURE_US_GOVERNMENT: "https://management.usgovcloudapi.net/", + AZURE_PUBLIC_CLOUD: "https://management.azure.com/", + }; + if (cloudSetting in cloudEndpoints) { + return cloudEndpoints[cloudSetting]; + } else { + throw new Error( + `Unknown cloud setting: ${cloudSetting}. Please refer to the enum AzureClouds for possible values.`, + ); + } +} diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/static-helpers/pagingHelpers.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/static-helpers/pagingHelpers.ts new file mode 100644 index 000000000000..6f219e3c88cf --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/static-helpers/pagingHelpers.ts @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { Client, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError } from "@azure-rest/core-client"; +import { RestError } from "@azure/core-rest-pipeline"; + +/** + * Options for the byPage method + */ +export interface PageSettings { + /** + * A reference to a specific page to start iterating from. + */ + continuationToken?: string; +} + +/** + * An interface that describes a page of results. + */ +export type ContinuablePage = TPage & { + /** + * The token that keeps track of where to continue the iterator + */ + continuationToken?: string; +}; + +/** + * An interface that allows async iterable iteration both to completion and by page. + */ +export interface PagedAsyncIterableIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +> { + /** + * The next method, part of the iteration protocol + */ + next(): Promise>; + /** + * The connection to the async iterator, part of the iteration protocol + */ + [Symbol.asyncIterator](): PagedAsyncIterableIterator; + /** + * Return an AsyncIterableIterator that works a page at a time + */ + byPage: (settings?: TPageSettings) => AsyncIterableIterator>; +} + +/** + * An interface that describes how to communicate with the service. + */ +export interface PagedResult< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +> { + /** + * Link to the first page of results. + */ + firstPageLink?: string; + /** + * A method that returns a page of results. + */ + getPage: (pageLink?: string) => Promise<{ page: TPage; nextPageLink?: string } | undefined>; + /** + * a function to implement the `byPage` method on the paged async iterator. + */ + byPage?: (settings?: TPageSettings) => AsyncIterableIterator>; + + /** + * A function to extract elements from a page. + */ + toElements?: (page: TPage) => TElement[]; +} + +/** + * Options for the paging helper + */ +export interface BuildPagedAsyncIteratorOptions { + itemName?: string; + nextLinkName?: string; + nextLinkMethod?: "GET" | "POST"; +} + +/** + * Helper to paginate results in a generic way and return a PagedAsyncIterableIterator + */ +export function buildPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, + TResponse extends PathUncheckedResponse = PathUncheckedResponse, +>( + client: Client, + getInitialResponse: () => PromiseLike, + processResponseBody: (result: TResponse) => PromiseLike, + expectedStatuses: string[], + options: BuildPagedAsyncIteratorOptions = {}, +): PagedAsyncIterableIterator { + const itemName = options.itemName ?? "value"; + const nextLinkName = options.nextLinkName ?? "nextLink"; + const nextLinkMethod = options.nextLinkMethod ?? "GET"; + const pagedResult: PagedResult = { + getPage: async (pageLink?: string) => { + const result = + pageLink === undefined + ? await getInitialResponse() + : nextLinkMethod === "POST" + ? await client.pathUnchecked(pageLink).post() + : await client.pathUnchecked(pageLink).get(); + checkPagingRequest(result, expectedStatuses); + const results = await processResponseBody(result as TResponse); + const nextLink = getNextLink(results, nextLinkName); + const values = getElements(results, itemName) as TPage; + return { + page: values, + nextPageLink: nextLink, + }; + }, + byPage: (settings?: TPageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + }); + }, + }; + return getPagedAsyncIterator(pagedResult); +} + +/** + * returns an async iterator that iterates over results. It also has a `byPage` + * method that returns pages of items at once. + * + * @param pagedResult - an object that specifies how to get pages. + * @returns a paged async iterator that iterates over results. + */ + +function getPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +>( + pagedResult: PagedResult, +): PagedAsyncIterableIterator { + const iter = getItemAsyncIterator(pagedResult); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: + pagedResult?.byPage ?? + ((settings?: TPageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + }); + }), + }; +} + +async function* getItemAsyncIterator( + pagedResult: PagedResult, +): AsyncIterableIterator { + const pages = getPageAsyncIterator(pagedResult); + for await (const page of pages) { + yield* page as unknown as TElement[]; + } +} + +async function* getPageAsyncIterator( + pagedResult: PagedResult, + options: { + pageLink?: string; + } = {}, +): AsyncIterableIterator> { + const { pageLink } = options; + let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink); + if (!response) { + return; + } + let result = response.page as ContinuablePage; + result.continuationToken = response.nextPageLink; + yield result; + while (response.nextPageLink) { + response = await pagedResult.getPage(response.nextPageLink); + if (!response) { + return; + } + result = response.page as ContinuablePage; + result.continuationToken = response.nextPageLink; + yield result; + } +} + +/** + * Gets for the value of nextLink in the body + */ +function getNextLink(body: unknown, nextLinkName?: string): string | undefined { + if (!nextLinkName) { + return undefined; + } + + const nextLink = (body as Record)[nextLinkName]; + + if (typeof nextLink !== "string" && typeof nextLink !== "undefined" && nextLink !== null) { + throw new RestError( + `Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`, + ); + } + + if (nextLink === null) { + return undefined; + } + + return nextLink; +} + +/** + * Gets the elements of the current request in the body. + */ +function getElements(body: unknown, itemName: string): T[] { + const value = (body as Record)[itemName] as T[]; + if (!Array.isArray(value)) { + throw new RestError( + `Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`, + ); + } + + return value ?? []; +} + +/** + * Checks if a request failed + */ +function checkPagingRequest(response: PathUncheckedResponse, expectedStatuses: string[]): void { + if (!expectedStatuses.includes(response.status)) { + throw createRestError( + `Pagination failed with unexpected statusCode ${response.status}`, + response, + ); + } +} diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/static-helpers/pollingHelpers.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/static-helpers/pollingHelpers.ts new file mode 100644 index 000000000000..63b3c201e5a8 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/static-helpers/pollingHelpers.ts @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { + PollerLike, + OperationState, + ResourceLocationConfig, + RunningOperation, + OperationResponse, +} from "@azure/core-lro"; +import { createHttpPoller } from "@azure/core-lro"; + +import type { Client, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError } from "@azure-rest/core-client"; +import type { AbortSignalLike } from "@azure/abort-controller"; + +export interface GetLongRunningPollerOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** + * The signal which can be used to abort requests. + */ + abortSignal?: AbortSignalLike; + /** + * The potential location of the result of the LRO if specified by the LRO extension in the swagger. + */ + resourceLocationConfig?: ResourceLocationConfig; + /** + * The original url of the LRO + * Should not be null when restoreFrom is set + */ + initialRequestUrl?: string; + /** + * A serialized poller which can be used to resume an existing paused Long-Running-Operation. + */ + restoreFrom?: string; + /** + * The function to get the initial response + */ + getInitialResponse?: () => PromiseLike; +} +export function getLongRunningPoller( + client: Client, + processResponseBody: (result: TResponse) => Promise, + expectedStatuses: string[], + options: GetLongRunningPollerOptions, +): PollerLike, TResult> { + const { restoreFrom, getInitialResponse } = options; + if (!restoreFrom && !getInitialResponse) { + throw new Error("Either restoreFrom or getInitialResponse must be specified"); + } + let initialResponse: TResponse | undefined = undefined; + const pollAbortController = new AbortController(); + const poller: RunningOperation = { + sendInitialRequest: async () => { + if (!getInitialResponse) { + throw new Error("getInitialResponse is required when initializing a new poller"); + } + initialResponse = await getInitialResponse(); + return getLroResponse(initialResponse, expectedStatuses); + }, + sendPollRequest: async ( + path: string, + pollOptions?: { + abortSignal?: AbortSignalLike; + }, + ) => { + // The poll request would both listen to the user provided abort signal and the poller's own abort signal + function abortListener(): void { + pollAbortController.abort(); + } + const abortSignal = pollAbortController.signal; + if (options.abortSignal?.aborted) { + pollAbortController.abort(); + } else if (pollOptions?.abortSignal?.aborted) { + pollAbortController.abort(); + } else if (!abortSignal.aborted) { + options.abortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + pollOptions?.abortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + } + let response; + try { + response = await client.pathUnchecked(path).get({ abortSignal }); + } finally { + options.abortSignal?.removeEventListener("abort", abortListener); + pollOptions?.abortSignal?.removeEventListener("abort", abortListener); + } + + return getLroResponse(response as TResponse, expectedStatuses); + }, + }; + return createHttpPoller(poller, { + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: options?.resourceLocationConfig, + restoreFrom: options?.restoreFrom, + processResult: (result: unknown) => { + return processResponseBody(result as TResponse); + }, + }); +} +/** + * Converts a Rest Client response to a response that the LRO implementation understands + * @param response - a rest client http response + * @param deserializeFn - deserialize function to convert Rest response to modular output + * @returns - An LRO response that the LRO implementation understands + */ +function getLroResponse( + response: TResponse, + expectedStatuses: string[], +): OperationResponse { + if (!expectedStatuses.includes(response.status)) { + throw createRestError(response); + } + + return { + flatResponse: response, + rawResponse: { + ...response, + statusCode: Number.parseInt(response.status), + body: response.body, + }, + }; +} diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/static-helpers/serialization/check-prop-undefined.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/static-helpers/serialization/check-prop-undefined.ts new file mode 100644 index 000000000000..50f78829e491 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/static-helpers/serialization/check-prop-undefined.ts @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * Returns true if all specified properties of the item are undefined. + * @param item The object to check. + * @param properties The list of property names to check on the item. + * @returns True if all specified properties are undefined, otherwise false. + */ +export function areAllPropsUndefined(item: Record, properties: string[]): boolean { + for (const property of properties) { + if (item[property] !== undefined) { + return false; + } + } + return true; +} diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/static-helpers/serialization/serialize-record.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/static-helpers/serialization/serialize-record.ts new file mode 100644 index 000000000000..f2d3a221fef7 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/static-helpers/serialization/serialize-record.ts @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export function serializeRecord(item: any, excludes?: string[], serializer?: (item: any) => any) { + excludes = excludes ?? []; + const res: any = {}; + for (const key of Object.keys(item)) { + if (excludes.includes(key) || item[key] === undefined) { + continue; + } + if (serializer) { + res[key] = serializer(item[key]); + } else { + res[key] = item[key] as any; + } + } + return res; +} diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/static-helpers/urlTemplate.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/static-helpers/urlTemplate.ts new file mode 100644 index 000000000000..c7109898692a --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/static-helpers/urlTemplate.ts @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// --------------------- +// interfaces +// --------------------- +interface ValueOptions { + isFirst: boolean; // is first value in the expression + op?: string; // operator + varValue?: any; // variable value + varName?: string; // variable name + modifier?: string; // modifier e.g * + reserved?: boolean; // if true we'll keep reserved words with not encoding +} + +export interface UrlTemplateOptions { + // if set to true, reserved characters will not be encoded + allowReserved?: boolean; +} + +// --------------------- +// helpers +// --------------------- +function encodeComponent(val: string, reserved?: boolean, op?: string): string { + return (reserved ?? op === "+") || op === "#" + ? encodeReservedComponent(val) + : encodeRFC3986URIComponent(val); +} + +function encodeReservedComponent(str: string): string { + return str + .split(/(%[0-9A-Fa-f]{2})/g) + .map((part) => (!/%[0-9A-Fa-f]/.test(part) ? encodeURI(part) : part)) + .join(""); +} + +function encodeRFC3986URIComponent(str: string): string { + return encodeURIComponent(str).replace( + /[!'()*]/g, + (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`, + ); +} + +function isDefined(val: any): boolean { + return val !== undefined && val !== null; +} + +function getNamedAndIfEmpty(op?: string): [boolean, string] { + return [!!op && [";", "?", "&"].includes(op), !!op && ["?", "&"].includes(op) ? "=" : ""]; +} + +function getFirstOrSep(op?: string, isFirst = false): string { + if (isFirst) { + return !op || op === "+" ? "" : op; + } else if (!op || op === "+" || op === "#") { + return ","; + } else if (op === "?") { + return "&"; + } else { + return op; + } +} + +function getExpandedValue(option: ValueOptions): string { + let isFirst = option.isFirst; + const { op, varName, varValue: value, reserved } = option; + const vals: string[] = []; + const [named, ifEmpty] = getNamedAndIfEmpty(op); + + if (Array.isArray(value)) { + for (const val of value.filter(isDefined)) { + // prepare the following parts: separator, varName, value + vals.push(`${getFirstOrSep(op, isFirst)}`); + if (named && varName) { + vals.push(`${encodeURIComponent(varName)}`); + if (val === "") { + vals.push(ifEmpty); + } else { + vals.push("="); + } + } + vals.push(encodeComponent(val, reserved, op)); + isFirst = false; + } + } else if (typeof value === "object") { + for (const key of Object.keys(value)) { + const val = value[key]; + if (!isDefined(val)) { + continue; + } + // prepare the following parts: separator, key, value + vals.push(`${getFirstOrSep(op, isFirst)}`); + if (key) { + vals.push(`${encodeURIComponent(key)}`); + if (named && val === "") { + vals.push(ifEmpty); + } else { + vals.push("="); + } + } + vals.push(encodeComponent(val, reserved, op)); + isFirst = false; + } + } + return vals.join(""); +} + +function getNonExpandedValue(option: ValueOptions): string | undefined { + const { op, varName, varValue: value, isFirst, reserved } = option; + const vals: string[] = []; + const first = getFirstOrSep(op, isFirst); + const [named, ifEmpty] = getNamedAndIfEmpty(op); + if (named && varName) { + vals.push(encodeComponent(varName, reserved, op)); + if (value === "") { + if (!ifEmpty) { + vals.push(ifEmpty); + } + return !vals.join("") ? undefined : `${first}${vals.join("")}`; + } + vals.push("="); + } + + const items = []; + if (Array.isArray(value)) { + for (const val of value.filter(isDefined)) { + items.push(encodeComponent(val, reserved, op)); + } + } else if (typeof value === "object") { + for (const key of Object.keys(value)) { + if (!isDefined(value[key])) { + continue; + } + items.push(encodeRFC3986URIComponent(key)); + items.push(encodeComponent(value[key], reserved, op)); + } + } + vals.push(items.join(",")); + return !vals.join(",") ? undefined : `${first}${vals.join("")}`; +} + +function getVarValue(option: ValueOptions): string | undefined { + const { op, varName, modifier, isFirst, reserved, varValue: value } = option; + + if (!isDefined(value)) { + return undefined; + } else if (["string", "number", "boolean"].includes(typeof value)) { + let val = value.toString(); + const [named, ifEmpty] = getNamedAndIfEmpty(op); + const vals: string[] = [getFirstOrSep(op, isFirst)]; + if (named && varName) { + // No need to encode varName considering it is already encoded + vals.push(varName); + if (val === "") { + vals.push(ifEmpty); + } else { + vals.push("="); + } + } + if (modifier && modifier !== "*") { + val = val.substring(0, parseInt(modifier, 10)); + } + vals.push(encodeComponent(val, reserved, op)); + return vals.join(""); + } else if (modifier === "*") { + return getExpandedValue(option); + } else { + return getNonExpandedValue(option); + } +} + +// --------------------------------------------------------------------------------------------------- +// This is an implementation of RFC 6570 URI Template: https://datatracker.ietf.org/doc/html/rfc6570. +// --------------------------------------------------------------------------------------------------- +export function expandUrlTemplate( + template: string, + context: Record, + option?: UrlTemplateOptions, +): string { + const result = template.replace(/\{([^{}]+)\}|([^{}]+)/g, (_, expr, text) => { + if (!expr) { + return encodeReservedComponent(text); + } + let op; + if (["+", "#", ".", "/", ";", "?", "&"].includes(expr[0])) { + op = expr[0]; + expr = expr.slice(1); + } + const varList = expr.split(/,/g); + const result = []; + for (const varSpec of varList) { + const varMatch = /([^:*]*)(?::(\d+)|(\*))?/.exec(varSpec); + if (!varMatch || !varMatch[1]) { + continue; + } + const varValue = getVarValue({ + isFirst: result.length === 0, + op, + varValue: context[varMatch[1]], + varName: varMatch[1], + modifier: varMatch[2] || varMatch[3], + reserved: option?.allowReserved, + }); + if (varValue) { + result.push(varValue); + } + } + return result.join(""); + }); + + return normalizeUnreserved(result); +} + +/** + * Normalize an expanded URI by decoding percent-encoded unreserved characters. + * RFC 3986 unreserved: "-" / "." / "~" + */ +function normalizeUnreserved(uri: string): string { + return uri.replace(/%([0-9A-Fa-f]{2})/g, (match, hex) => { + const char = String.fromCharCode(parseInt(hex, 16)); + // Decode only if it's unreserved + if (/[\-.~]/.test(char)) { + return char; + } + return match; // leave other encodings intact + }); +} diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/test/public/sampleTest.spec.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/test/public/sampleTest.spec.ts new file mode 100644 index 000000000000..19cf10ee4956 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/test/public/sampleTest.spec.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// import { Recorder } from "@azure-tools/test-recorder"; +// import { createRecorder } from "./utils/recordedClient.js"; +import { + assert, + // beforeEach, + // afterEach, + it, + describe, +} from "vitest"; + +describe("My test", () => { + // let recorder: Recorder; + + // beforeEach(async function(ctx) { + // recorder = await createRecorder(ctx); + // }); + + // afterEach(async function() { + // await recorder.stop(); + // ); + + it("sample test", async function () { + assert.equal(1, 1); + }); +}); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/test/public/utils/recordedClient.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/test/public/utils/recordedClient.ts new file mode 100644 index 000000000000..285e4643c45e --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/test/public/utils/recordedClient.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { RecorderStartOptions, VitestTestContext } from "@azure-tools/test-recorder"; +import { Recorder } from "@azure-tools/test-recorder"; + +const replaceableVariables: Record = { + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderEnvSetup: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +/** + * creates the recorder and reads the environment variables from the `.env` file. + * Should be called first in the test suite to make sure environment variables are + * read before they are being used. + */ +export async function createRecorder(context: VitestTestContext): Promise { + const recorder = new Recorder(context); + await recorder.start(recorderEnvSetup); + return recorder; +} diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/test/resourcesdeploymentstacks_operations_test.spec.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/test/resourcesdeploymentstacks_operations_test.spec.ts deleted file mode 100644 index 71fd0458196c..000000000000 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/test/resourcesdeploymentstacks_operations_test.spec.ts +++ /dev/null @@ -1,138 +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. - */ - -import { env, Recorder, RecorderStartOptions, isPlaybackMode } from "@azure-tools/test-recorder"; -import { createTestCredential } from "@azure-tools/test-credential"; -import { DeploymentStacksClient } from "../src/deploymentStacksClient.js"; -import { describe, it, assert, beforeEach, afterEach } from "vitest"; - -const replaceableVariables: Record = { - SUBSCRIPTION_ID: "88888888-8888-8888-8888-888888888888", -}; - -const recorderOptions: RecorderStartOptions = { - envSetupForPlayback: replaceableVariables, - removeCentralSanitizers: [ - "AZSDK3493", // .name in the body is not a secret and is listed below in the beforeEach section - "AZSDK3430", // .id in the body is not a secret and is listed below in the beforeEach section - ], -}; - -export const testPollingOptions = { - updateIntervalInMs: isPlaybackMode() ? 0 : undefined, -}; - -describe("DeploymentStacks test", () => { - let recorder: Recorder; - let subscriptionId: string; - let client: DeploymentStacksClient; - let resourceGroup: string; - let resourcename: string; - - beforeEach(async (ctx) => { - recorder = new Recorder(ctx); - await recorder.start(recorderOptions); - subscriptionId = env.SUBSCRIPTION_ID || ""; - // This is an example of how the environment variables are used - const credential = createTestCredential(); - client = new DeploymentStacksClient( - credential, - subscriptionId, - recorder.configureClientOptions({}), - ); - resourceGroup = "myjstest"; - resourcename = "resourcetest"; - }); - - afterEach(async () => { - await recorder.stop(); - }); - - it("deploymentStacks create test", async () => { - const res = await client.deploymentStacks.beginCreateOrUpdateAtResourceGroupAndWait( - resourceGroup, - resourcename, - { - properties: { - actionOnUnmanage: { - resources: "delete", - }, - denySettings: { - applyToChildScopes: false, - excludedActions: ["action"], - excludedPrincipals: ["principal"], - mode: "none", - }, - template: { - $schema: - "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - contentVersion: "1.0.0.0", - parameters: { - foo: { - type: "string", - defaultValue: "foo", - metadata: { - description: "description", - }, - }, - bar: { - type: "string", - defaultValue: "bar", - metadata: { - description: "description", - }, - }, - }, - functions: [], - variables: {}, - resources: [], - outputs: { - foo: { - type: "string", - value: "[parameters('foo')]", - }, - bar: { - type: "string", - value: "[parameters('bar')]", - }, - }, - }, - }, - tags: { tagkey: "tagVal" }, - }, - testPollingOptions, - ); - assert.equal(res.name, resourcename); - }); - - it("deploymentStacks get test", async () => { - const res = await client.deploymentStacks.getAtResourceGroup(resourceGroup, resourcename); - assert.equal(res.name, resourcename); - }); - - it("deploymentStacks list test", async () => { - const resArray = new Array(); - for await (let item of client.deploymentStacks.listAtResourceGroup(resourceGroup)) { - resArray.push(item); - } - // assert.equal(resArray.length, 1); - }); - - it("deploymentStacks delete test", async () => { - const resArray = new Array(); - await client.deploymentStacks.beginDeleteAtResourceGroupAndWait( - resourceGroup, - resourcename, - testPollingOptions, - ); - for await (let item of client.deploymentStacks.listAtResourceGroup(resourceGroup)) { - resArray.push(item); - } - assert.equal(resArray.length, 0); - }); -}); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/test/snippets.spec.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/test/snippets.spec.ts index 55d34b8b17b7..bd52a81914c8 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/test/snippets.spec.ts +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/test/snippets.spec.ts @@ -13,11 +13,11 @@ describe("snippets", () => { }); it("ReadmeSampleCreateClient_Browser", async () => { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", clientId: "", }); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new DeploymentStacksClient(credential, subscriptionId); }); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/tsconfig.json b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/tsconfig.json index d466f1460665..0e57dbd186e5 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/tsconfig.json +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/tsconfig.json @@ -12,6 +12,5 @@ { "path": "./tsconfig.snippets.json" } - ], - "files": [] + ] } diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/tsconfig.samples.json b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/tsconfig.samples.json index 268e9bfd3a61..527639ac5343 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/tsconfig.samples.json +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/tsconfig.samples.json @@ -2,9 +2,7 @@ "extends": "../../../tsconfig.samples.base.json", "compilerOptions": { "paths": { - "@azure/arm-resourcesdeploymentstacks": [ - "./dist/esm" - ] + "@azure/arm-resourcesdeploymentstacks": ["./dist/esm"] } } } diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/tsp-location.yaml b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/tsp-location.yaml new file mode 100644 index 000000000000..3c8c37b66158 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/resources/resource-manager/Microsoft.Resources/deploymentStacks +commit: 652ad4cb131256f10a90ea2df207b38cf35d6671 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/vitest.config.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/vitest.config.ts index cc5cd85d4131..0dfa15cc4498 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/vitest.config.ts +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/vitest.config.ts @@ -1,4 +1,3 @@ - // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/vitest.esm.config.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/vitest.esm.config.ts new file mode 100644 index 000000000000..5e9735e9b144 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/vitest.esm.config.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { mergeConfig } from "vitest/config"; +import vitestConfig from "./vitest.config.ts"; +import vitestEsmConfig from "../../../vitest.esm.shared.config.ts"; + +export default mergeConfig(vitestConfig, vitestEsmConfig); diff --git a/sdk/resourcesdeploymentstacks/ci.mgmt.yml b/sdk/resourcesdeploymentstacks/ci.mgmt.yml index 13e6cc070121..39bcfc304013 100644 --- a/sdk/resourcesdeploymentstacks/ci.mgmt.yml +++ b/sdk/resourcesdeploymentstacks/ci.mgmt.yml @@ -1,5 +1,5 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - + trigger: branches: include: @@ -13,7 +13,6 @@ trigger: include: - sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks - sdk/resourcesdeploymentstacks/ci.mgmt.yml - pr: branches: include: @@ -27,7 +26,6 @@ pr: include: - sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks - sdk/resourcesdeploymentstacks/ci.mgmt.yml - extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: @@ -35,4 +33,3 @@ extends: Artifacts: - name: azure-arm-resourcesdeploymentstacks safeName: azurearmresourcesdeploymentstacks - \ No newline at end of file