From b32a0e811bc7780045f49182fd2f1437355f76d1 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 28 Apr 2025 13:39:21 +0000 Subject: [PATCH] CodeGen from PR 34190 in Azure/azure-rest-api-specs Merge e0921a93862786f1849e148050b399e18c0e4b25 into 17365a7eb28d3ee578e5307f6091ee172bdfbfa3 --- common/config/rush/pnpm-lock.yaml | 40 +- sdk/changes/arm-changes/CHANGELOG.md | 18 +- sdk/changes/arm-changes/LICENSE | 2 +- sdk/changes/arm-changes/README.md | 8 +- sdk/changes/arm-changes/_meta.json | 10 +- sdk/changes/arm-changes/api-extractor.json | 2 +- sdk/changes/arm-changes/package.json | 36 +- .../arm-changes/review/arm-changes.api.md | 2 - sdk/changes/arm-changes/sample.env | 5 +- .../v1/typescript/src/changesGetSample.ts | 2 +- .../v1/typescript/src/changesListSample.ts | 2 +- sdk/changes/arm-changes/src/changesClient.ts | 42 +- sdk/changes/arm-changes/src/models/index.ts | 11 +- sdk/changes/arm-changes/src/models/mappers.ts | 178 +- .../arm-changes/src/models/parameters.ts | 76 +- .../arm-changes/src/operations/changes.ts | 85 +- .../src/operationsInterfaces/changes.ts | 6 +- sdk/changes/arm-changes/src/pagingHelper.ts | 13 +- .../arm-changes/test/sampleTest.spec.ts | 11 +- sdk/changes/arm-changes/test/snippets.spec.ts | 9 +- .../arm-changes/tsconfig.browser.config.json | 16 +- sdk/changes/arm-changes/tsconfig.json | 22 +- sdk/changes/arm-changes/tsconfig.samples.json | 4 +- sdk/changes/arm-changes/tsconfig.test.json | 5 +- .../arm-changes/vitest.browser.config.ts | 6 +- sdk/changes/arm-changes/vitest.config.ts | 3 +- .../arm-databoundaries/CHANGELOG.md | 14 +- sdk/databoundaries/arm-databoundaries/LICENSE | 2 +- .../arm-databoundaries/README.md | 14 +- .../arm-databoundaries/_meta.json | 8 +- .../arm-databoundaries/api-extractor.json | 2 +- .../arm-databoundaries/package.json | 33 +- .../review/arm-databoundaries.api.md | 66 + .../arm-databoundaries/sample.env | 2 +- .../src/databoundariesManegementClient.ts | 31 +- .../arm-databoundaries/src/index.ts | 2 + .../arm-databoundaries/src/models/index.ts | 181 +- .../arm-databoundaries/src/models/mappers.ts | 194 +- .../src/models/parameters.ts | 46 +- .../src/operations/dataBoundaries.ts | 7 +- .../src/operations/index.ts | 1 + .../src/operations/operations.ts | 142 + .../src/operationsInterfaces/index.ts | 1 + .../src/operationsInterfaces/operations.ts | 20 + .../arm-databoundaries/src/pagingHelper.ts | 36 + .../test/sampleTest.spec.ts | 38 + .../arm-databoundaries/test/snippets.spec.ts | 17 +- .../tsconfig.browser.config.json | 5 +- .../arm-databoundaries/tsconfig.json | 25 +- .../arm-databoundaries/tsconfig.samples.json | 4 +- .../arm-databoundaries/tsconfig.test.json | 5 +- sdk/features/arm-features/CHANGELOG.md | 19 +- sdk/features/arm-features/LICENSE | 2 +- sdk/features/arm-features/README.md | 8 +- sdk/features/arm-features/_meta.json | 10 +- sdk/features/arm-features/api-extractor.json | 2 +- sdk/features/arm-features/package.json | 35 +- .../arm-features/review/arm-features.api.md | 3 +- sdk/features/arm-features/sample.env | 5 +- .../arm-features/src/featureClient.ts | 111 +- sdk/features/arm-features/src/models/index.ts | 49 +- .../arm-features/src/models/mappers.ts | 273 +- .../arm-features/src/models/parameters.ts | 64 +- .../arm-features/src/operations/features.ts | 152 +- .../subscriptionFeatureRegistrations.ts | 169 +- .../src/operationsInterfaces/features.ts | 14 +- .../subscriptionFeatureRegistrations.ts | 12 +- sdk/features/arm-features/src/pagingHelper.ts | 13 +- .../arm-features/test/sampleTest.spec.ts | 38 + .../arm-features/test/snippets.spec.ts | 9 +- sdk/features/arm-features/tsconfig.json | 4 +- .../arm-features/vitest.browser.config.ts | 3 +- sdk/features/arm-features/vitest.config.ts | 1 + .../arm-features/vitest.esm.config.ts | 6 +- sdk/links/arm-links/CHANGELOG.md | 21 +- sdk/links/arm-links/LICENSE | 2 +- sdk/links/arm-links/README.md | 8 +- sdk/links/arm-links/_meta.json | 10 +- sdk/links/arm-links/api-extractor.json | 2 +- sdk/links/arm-links/package.json | 28 +- sdk/links/arm-links/review/arm-links.api.md | 4 +- sdk/links/arm-links/sample.env | 5 +- .../arm-links/src/managementLinkClient.ts | 59 +- sdk/links/arm-links/src/models/index.ts | 29 +- sdk/links/arm-links/src/models/mappers.ts | 122 +- sdk/links/arm-links/src/models/parameters.ts | 64 +- .../arm-links/src/operations/operations.ts | 36 +- .../arm-links/src/operations/resourceLinks.ts | 118 +- .../src/operationsInterfaces/operations.ts | 4 +- .../src/operationsInterfaces/resourceLinks.ts | 18 +- sdk/links/arm-links/src/pagingHelper.ts | 13 +- sdk/links/arm-links/test/sampleTest.spec.ts | 38 + sdk/links/arm-links/test/snippets.spec.ts | 9 +- sdk/links/arm-links/tsconfig.json | 13 +- sdk/links/arm-links/vitest.browser.config.ts | 3 +- sdk/links/arm-links/vitest.config.ts | 1 + sdk/links/arm-links/vitest.esm.config.ts | 6 +- sdk/locks/arm-locks/CHANGELOG.md | 21 +- sdk/locks/arm-locks/LICENSE | 2 +- sdk/locks/arm-locks/README.md | 8 +- sdk/locks/arm-locks/_meta.json | 8 +- sdk/locks/arm-locks/api-extractor.json | 2 +- sdk/locks/arm-locks/package.json | 35 +- sdk/locks/arm-locks/review/arm-locks.api.md | 7 +- sdk/locks/arm-locks/sample.env | 5 +- .../arm-locks/src/managementLockClient.ts | 64 +- sdk/locks/arm-locks/src/models/index.ts | 40 +- sdk/locks/arm-locks/src/models/mappers.ts | 204 +- sdk/locks/arm-locks/src/models/parameters.ts | 90 +- .../src/operations/authorizationOperations.ts | 36 +- .../src/operations/managementLocks.ts | 414 +- .../authorizationOperations.ts | 9 +- .../operationsInterfaces/managementLocks.ts | 34 +- sdk/locks/arm-locks/src/pagingHelper.ts | 13 +- sdk/locks/arm-locks/test/sampleTest.spec.ts | 38 + sdk/locks/arm-locks/test/snippets.spec.ts | 9 +- sdk/locks/arm-locks/tsconfig.json | 7 +- sdk/locks/arm-locks/vitest.browser.config.ts | 3 +- sdk/locks/arm-locks/vitest.config.ts | 1 + sdk/locks/arm-locks/vitest.esm.config.ts | 6 +- .../arm-managedapplications/CHANGELOG.md | 117 +- .../arm-managedapplications/LICENSE | 2 +- .../arm-managedapplications/README.md | 8 +- .../arm-managedapplications/_meta.json | 10 +- .../api-extractor.json | 2 +- .../arm-managedapplications/package.json | 32 +- .../review/arm-managedapplications.api.md | 574 +-- .../arm-managedapplications/sample.env | 5 +- .../src/applicationClient.ts | 100 +- .../arm-managedapplications/src/lroImpl.ts | 10 +- .../src/models/index.ts | 1093 +---- .../src/models/mappers.ts | 1640 ++----- .../src/models/parameters.ts | 152 +- .../src/operations/applicationDefinitions.ts | 677 +-- .../src/operations/applications.ts | 849 +--- .../src/operations/index.ts | 1 - .../src/operations/jitRequests.ts | 366 -- .../applicationDefinitions.ts | 102 +- .../src/operationsInterfaces/applications.ts | 162 +- .../src/operationsInterfaces/index.ts | 1 - .../src/operationsInterfaces/jitRequests.ts | 110 - .../src/pagingHelper.ts | 5 +- .../test/sampleTest.spec.ts | 38 + .../test/snippets.spec.ts | 9 +- .../arm-managedapplications/tsconfig.json | 16 +- .../vitest.browser.config.ts | 3 +- .../arm-managedapplications/vitest.config.ts | 1 + .../vitest.esm.config.ts | 6 +- sdk/policy/arm-policy/CHANGELOG.md | 35 + sdk/policy/arm-policy/README.md | 7 +- sdk/policy/arm-policy/_meta.json | 8 +- sdk/policy/arm-policy/api-extractor.json | 2 +- sdk/policy/arm-policy/package.json | 71 +- .../arm-policy/review/arm-policy.api.md | 136 +- sdk/policy/arm-policy/src/lroImpl.ts | 36 + sdk/policy/arm-policy/src/models/index.ts | 1160 ++--- sdk/policy/arm-policy/src/models/mappers.ts | 1292 ++++-- .../arm-policy/src/models/parameters.ts | 252 +- sdk/policy/arm-policy/src/operations/index.ts | 3 +- .../src/operations/policyAssignments.ts | 70 +- .../operations/policyDefinitionVersions.ts | 54 +- .../src/operations/policyDefinitions.ts | 48 +- .../operations/policySetDefinitionVersions.ts | 54 +- .../src/operations/policySetDefinitions.ts | 48 +- .../arm-policy/src/operations/policyTokens.ts | 141 + .../src/operationsInterfaces/index.ts | 3 +- .../operationsInterfaces/policyAssignments.ts | 4 +- .../policyDefinitionVersions.ts | 4 +- .../operationsInterfaces/policyDefinitions.ts | 4 +- .../policySetDefinitionVersions.ts | 4 +- .../policySetDefinitions.ts | 4 +- .../src/operationsInterfaces/policyTokens.ts | 38 + sdk/policy/arm-policy/src/policyClient.ts | 26 +- sdk/policy/arm-policy/test/sampleTest.spec.ts | 38 + .../arm-policy/tsconfig.browser.config.json | 4 +- sdk/policy/arm-policy/tsconfig.json | 10 +- .../arm-policy/vitest.browser.config.ts | 12 +- sdk/policy/arm-policy/vitest.config.ts | 10 +- sdk/policy/arm-policy/vitest.esm.config.ts | 15 +- .../arm-resources-subscriptions/LICENSE | 2 +- .../arm-resources-subscriptions/README.md | 10 +- .../arm-resources-subscriptions/_meta.json | 10 +- .../api-extractor.json | 2 +- .../arm-resources-subscriptions/package.json | 40 +- .../arm-resources-subscriptions/sample.env | 5 +- .../src/models/index.ts | 50 +- .../src/models/mappers.ts | 632 +-- .../src/models/parameters.ts | 50 +- .../src/operations/operations.ts | 39 +- .../src/operations/subscriptions.ts | 94 +- .../src/operations/tenants.ts | 37 +- .../src/operationsInterfaces/operations.ts | 4 +- .../src/operationsInterfaces/subscriptions.ts | 12 +- .../src/operationsInterfaces/tenants.ts | 4 +- .../src/pagingHelper.ts | 5 +- .../src/subscriptionClient.ts | 64 +- .../test/sampleTest.spec.ts | 38 + .../test/snippets.spec.ts | 9 +- .../tsconfig.browser.config.json | 5 +- .../arm-resources-subscriptions/tsconfig.json | 19 +- .../tsconfig.samples.json | 4 +- .../tsconfig.test.json | 5 +- sdk/resources/arm-resources/CHANGELOG.md | 22 +- sdk/resources/arm-resources/LICENSE | 2 +- sdk/resources/arm-resources/README.md | 6 +- sdk/resources/arm-resources/_meta.json | 10 +- .../arm-resources/api-extractor.json | 2 +- sdk/resources/arm-resources/package.json | 40 +- .../arm-resources/review/arm-resources.api.md | 951 +--- sdk/resources/arm-resources/src/lroImpl.ts | 8 +- .../arm-resources/src/models/index.ts | 1470 +------ .../arm-resources/src/models/mappers.ts | 1945 ++------- .../arm-resources/src/models/parameters.ts | 157 +- .../src/operations/deploymentOperations.ts | 1006 ----- .../src/operations/deployments.ts | 3805 ----------------- .../arm-resources/src/operations/index.ts | 2 - .../src/operations/operations.ts | 13 +- .../src/operations/providerResourceTypes.ts | 2 +- .../arm-resources/src/operations/providers.ts | 38 +- .../src/operations/resourceGroups.ts | 80 +- .../arm-resources/src/operations/resources.ts | 148 +- .../src/operations/tagsOperations.ts | 72 +- .../deploymentOperations.ts | 144 - .../src/operationsInterfaces/deployments.ts | 957 ----- .../src/operationsInterfaces/index.ts | 2 - .../src/operationsInterfaces/operations.ts | 4 +- .../src/operationsInterfaces/providers.ts | 4 +- .../operationsInterfaces/resourceGroups.ts | 4 +- .../src/operationsInterfaces/resources.ts | 16 +- .../operationsInterfaces/tagsOperations.ts | 9 +- .../arm-resources/src/pagingHelper.ts | 5 +- .../src/resourceManagementClient.ts | 35 +- .../test/resources_examples.spec.ts | 1 - .../arm-resources/test/sampleTest.spec.ts | 38 + .../arm-resources/test/snippets.spec.ts | 9 +- .../tsconfig.browser.config.json | 5 +- sdk/resources/arm-resources/tsconfig.json | 5 +- .../arm-resources/tsconfig.samples.json | 4 +- .../arm-resources/tsconfig.test.json | 5 +- 239 files changed, 7004 insertions(+), 19027 deletions(-) create mode 100644 sdk/databoundaries/arm-databoundaries/src/operations/operations.ts create mode 100644 sdk/databoundaries/arm-databoundaries/src/operationsInterfaces/operations.ts create mode 100644 sdk/databoundaries/arm-databoundaries/src/pagingHelper.ts create mode 100644 sdk/databoundaries/arm-databoundaries/test/sampleTest.spec.ts create mode 100644 sdk/features/arm-features/test/sampleTest.spec.ts create mode 100644 sdk/links/arm-links/test/sampleTest.spec.ts create mode 100644 sdk/locks/arm-locks/test/sampleTest.spec.ts delete mode 100644 sdk/managedapplications/arm-managedapplications/src/operations/jitRequests.ts delete mode 100644 sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/jitRequests.ts create mode 100644 sdk/managedapplications/arm-managedapplications/test/sampleTest.spec.ts create mode 100644 sdk/policy/arm-policy/src/lroImpl.ts create mode 100644 sdk/policy/arm-policy/src/operations/policyTokens.ts create mode 100644 sdk/policy/arm-policy/src/operationsInterfaces/policyTokens.ts create mode 100644 sdk/policy/arm-policy/test/sampleTest.spec.ts create mode 100644 sdk/resources-subscriptions/arm-resources-subscriptions/test/sampleTest.spec.ts delete mode 100644 sdk/resources/arm-resources/src/operations/deploymentOperations.ts delete mode 100644 sdk/resources/arm-resources/src/operations/deployments.ts delete mode 100644 sdk/resources/arm-resources/src/operationsInterfaces/deploymentOperations.ts delete mode 100644 sdk/resources/arm-resources/src/operationsInterfaces/deployments.ts create mode 100644 sdk/resources/arm-resources/test/sampleTest.spec.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index a2deb96c2e83..b5a9a726ab3f 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -1322,10 +1322,6 @@ packages: resolution: {integrity: sha512-+BsxHcFzJH28hMAsyI+bbAYVw79d12WagttmFvoidXXq76/5KpNCA2NWTGSV0AlJ+QaCF6+7I7P91PRYnJsr+w==} engines: {node: '>=14.0.0'} - '@azure/arm-resources@5.2.0': - resolution: {integrity: sha512-wQyuhL8WQsLkW/KMdik8bLJIJCz3Z6mg/+AKm0KedgK73SKhicSqYP+ed3t+43tLlRFltcrmGKMcHLQ+Jhv/6A==} - engines: {node: '>=14.0.0'} - '@azure/arm-search@3.2.0': resolution: {integrity: sha512-KxbVA8jsoBj/PrtF7Dh/1mGNatGzKIHooYiKD59K78io3jE7jT0Y6L0ngUx4hImW5G+AGlZBB8rSeGIvIfjuDA==} engines: {node: '>=16.0.0'} @@ -2524,7 +2520,7 @@ packages: version: 0.0.0 '@rush-temp/arm-changes@file:projects/arm-changes.tgz': - resolution: {integrity: sha512-O8bkam5n8MQmqhrtOm4xMHoB8RQLcJoOk9HXWPnLIglQu7V3HmSgZOrhB90fI/juNoR2gHRNWGHSQijL46ECcA==, tarball: file:projects/arm-changes.tgz} + resolution: {integrity: sha512-PNGdme58ZpvwH7C+rWiV8ojtP2McpPA1yJ+HSJOKvzRmdVM9GWA8EtHHvPrPeKt/hKXH3pIal1TNIhJeFeJsJg==, tarball: file:projects/arm-changes.tgz} version: 0.0.0 '@rush-temp/arm-chaos@file:projects/arm-chaos.tgz': @@ -2640,7 +2636,7 @@ packages: version: 0.0.0 '@rush-temp/arm-databoundaries@file:projects/arm-databoundaries.tgz': - resolution: {integrity: sha512-aykdaWjFLHFfaaEcB3WJq+ksQUIemsODGgJQuIfeg/gQj2zpPqXygYljlXwvFyEPWopX8rwOgQ4+LzNsDaNMcA==, tarball: file:projects/arm-databoundaries.tgz} + resolution: {integrity: sha512-8t1gLl6YhhH/wdqft+cnM3UL1U5b77xLYtU2bn7iIR0XV2OUcqj/5pPKCCw+/pMe3cbj51i3fVj0w1EyZoS5Pw==, tarball: file:projects/arm-databoundaries.tgz} version: 0.0.0 '@rush-temp/arm-databox@file:projects/arm-databox.tgz': @@ -2796,7 +2792,7 @@ packages: version: 0.0.0 '@rush-temp/arm-features@file:projects/arm-features.tgz': - resolution: {integrity: sha512-u+ef83YbMGbznuM6QofrygLENrHKu7sXNdAv8BcpraRx1+CbVBYf19WB54kaIGrLmrXBABYnrMhhWA5Jg6v+2A==, tarball: file:projects/arm-features.tgz} + resolution: {integrity: sha512-pI8zGBXvZ4qBwWv0Sm4OX8dySSX3qkqDT1Zmn3FKjwzrSzutF2ZkSEyRlFbDpEjYe389O7Spj3A2GkVUUNNwCw==, tarball: file:projects/arm-features.tgz} version: 0.0.0 '@rush-temp/arm-fluidrelay@file:projects/arm-fluidrelay.tgz': @@ -2880,7 +2876,7 @@ packages: version: 0.0.0 '@rush-temp/arm-iotfirmwaredefense@file:projects/arm-iotfirmwaredefense.tgz': - resolution: {integrity: sha512-uG5UwXuZw39+ZtzQIWjrncKO9wTGuCru8h/T7RskNv8CKxuy+Q3Rv22x0GIVP7jfPgIshSv3KmXpK4WYvnYs0Q==, tarball: file:projects/arm-iotfirmwaredefense.tgz} + resolution: {integrity: sha512-VosDsn3Jyydk96qaX2fTcLg+gTL+N1kbIOh52JrEaaDdcELmtJcJ+Vz6BwJbFm/ByQFpKcvGELMXuZFw/QI7nQ==, tarball: file:projects/arm-iotfirmwaredefense.tgz} version: 0.0.0 '@rush-temp/arm-iothub-profile-2020-09-01-hybrid@file:projects/arm-iothub-profile-2020-09-01-hybrid.tgz': @@ -2924,7 +2920,7 @@ packages: version: 0.0.0 '@rush-temp/arm-links@file:projects/arm-links.tgz': - resolution: {integrity: sha512-/FYKqWx00GkmI7PWY9aYsTYeQHq5z630d224CnfKR2IrXmjBVs5291AKowt5zBaR21Mk0KanF19kV8C+COfnYw==, tarball: file:projects/arm-links.tgz} + resolution: {integrity: sha512-Jt5O7v9IRbfpaD1EcLSINbwAvnSMufDV8IUI8Dky30hw/Yh9YsBst2lvn569QPUQtuZptqtJDR9vYHipZpmAug==, tarball: file:projects/arm-links.tgz} version: 0.0.0 '@rush-temp/arm-loadtesting@file:projects/arm-loadtesting.tgz': @@ -2936,7 +2932,7 @@ packages: version: 0.0.0 '@rush-temp/arm-locks@file:projects/arm-locks.tgz': - resolution: {integrity: sha512-ygVGZkzUbPfGlZmQx/9M/QR9QWVoTPQovA2grQIHptb7eKx/NixXSVjeNDyLK8LaKfa3XS01GU1fDIpaHTpRIA==, tarball: file:projects/arm-locks.tgz} + resolution: {integrity: sha512-6OKavh/94i1QMqPplDnGoJPkqmYaBwWuYItMFnpsPz9AyU1OImE9f0HZL8glpKzE6ZhcJOpnWXpzM4DMomBgtQ==, tarball: file:projects/arm-locks.tgz} version: 0.0.0 '@rush-temp/arm-logic@file:projects/arm-logic.tgz': @@ -3116,7 +3112,7 @@ packages: version: 0.0.0 '@rush-temp/arm-policy@file:projects/arm-policy.tgz': - resolution: {integrity: sha512-eG2msw9BjjdYyVmU8OIbHWkhosPcUSedfWbK6D4nGNLtwWpwBlL8wtWG0Sn1zz8kSm4/Z0O4tzGKZBiV53qknw==, tarball: file:projects/arm-policy.tgz} + resolution: {integrity: sha512-7MHCxxqtjwmga8Wf4kfrw32jlYekcidvSeaTaPASwawxdveV0Id7hKYljlWkoP1dxb1QneAKaXCq3jq3mAJMdA==, tarball: file:projects/arm-policy.tgz} version: 0.0.0 '@rush-temp/arm-policyinsights@file:projects/arm-policyinsights.tgz': @@ -3232,7 +3228,7 @@ packages: version: 0.0.0 '@rush-temp/arm-resources@file:projects/arm-resources.tgz': - resolution: {integrity: sha512-57n2SVw1pGJQZ5elm5bvsD46REaPIsFssfaamhneMTyJW3BT/VjCBUMUcbhAxmbZKXqnlr2jceDe3wAirDVmTQ==, tarball: file:projects/arm-resources.tgz} + resolution: {integrity: sha512-wod9We6VhClsyIu9XGjEjQQe73lNx0sCQQGA0NWmlFeSdLGummD3PfH7Id2U9DRLGnNK1mpBphRqMpRqMdnEOA==, tarball: file:projects/arm-resources.tgz} version: 0.0.0 '@rush-temp/arm-resourcesdeploymentstacks@file:projects/arm-resourcesdeploymentstacks.tgz': @@ -7299,18 +7295,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@azure/arm-resources@5.2.0': - dependencies: - '@azure/abort-controller': 1.1.0 - '@azure/core-auth': 1.9.0 - '@azure/core-client': 1.9.3 - '@azure/core-lro': 2.7.2 - '@azure/core-paging': 1.6.2 - '@azure/core-rest-pipeline': 1.19.1 - tslib: 2.8.1 - transitivePeerDependencies: - - supports-color - '@azure/arm-search@3.2.0': dependencies: '@azure/abort-controller': 1.1.0 @@ -10407,6 +10391,7 @@ snapshots: '@types/node': 18.19.86 '@vitest/browser': 3.1.2(playwright@1.52.0)(vite@6.3.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.1))(vitest@3.1.2) '@vitest/coverage-istanbul': 3.1.2(vitest@3.1.2) + dotenv: 16.5.0 playwright: 1.52.0 tslib: 2.8.1 typescript: 5.8.3 @@ -12775,6 +12760,7 @@ snapshots: '@types/node': 18.19.86 '@vitest/browser': 3.1.2(playwright@1.52.0)(vite@6.3.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.1))(vitest@3.1.2) '@vitest/coverage-istanbul': 3.1.2(vitest@3.1.2) + dotenv: 16.5.0 playwright: 1.52.0 tslib: 2.8.1 typescript: 5.8.3 @@ -13888,10 +13874,10 @@ snapshots: '@rush-temp/arm-links@file:projects/arm-links.tgz(@types/debug@4.1.12)(tsx@4.19.3)(vite@6.3.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.1))(yaml@2.7.1)': dependencies: - '@azure/arm-resources': 5.2.0 '@types/node': 18.19.86 '@vitest/browser': 3.1.2(playwright@1.52.0)(vite@6.3.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.1))(vitest@3.1.2) '@vitest/coverage-istanbul': 3.1.2(vitest@3.1.2) + dotenv: 16.5.0 playwright: 1.52.0 tslib: 2.8.1 typescript: 5.8.3 @@ -13994,6 +13980,7 @@ snapshots: '@types/node': 18.19.86 '@vitest/browser': 3.1.2(playwright@1.52.0)(vite@6.3.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.1))(vitest@3.1.2) '@vitest/coverage-istanbul': 3.1.2(vitest@3.1.2) + dotenv: 16.5.0 playwright: 1.52.0 tslib: 2.8.1 typescript: 5.8.3 @@ -15550,13 +15537,14 @@ snapshots: '@rush-temp/arm-policy@file:projects/arm-policy.tgz(@types/debug@4.1.12)(tsx@4.19.3)(vite@6.3.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.1))(yaml@2.7.1)': dependencies: + '@azure/core-lro': 2.7.2 '@types/node': 18.19.86 '@vitest/browser': 3.1.2(playwright@1.52.0)(vite@6.3.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.1))(vitest@3.1.2) '@vitest/coverage-istanbul': 3.1.2(vitest@3.1.2) dotenv: 16.5.0 playwright: 1.52.0 tslib: 2.8.1 - typescript: 5.7.3 + typescript: 5.8.3 vitest: 3.1.2(@types/debug@4.1.12)(@types/node@18.19.86)(@vitest/browser@3.1.2)(tsx@4.19.3)(yaml@2.7.1) transitivePeerDependencies: - '@edge-runtime/vm' diff --git a/sdk/changes/arm-changes/CHANGELOG.md b/sdk/changes/arm-changes/CHANGELOG.md index 60ff25a11e58..33d45d8e357d 100644 --- a/sdk/changes/arm-changes/CHANGELOG.md +++ b/sdk/changes/arm-changes/CHANGELOG.md @@ -1,15 +1,13 @@ # Release History - -## 1.1.1 (Unreleased) - -### Features Added - + +## 2.0.0 (2025-04-28) + ### Breaking Changes -### Bugs Fixed - -### Other Changes - + - Interface ChangesListNextOptionalParams no longer has parameter skipToken + - Interface ChangesListNextOptionalParams no longer has parameter top + + ## 1.1.0 (2022-11-17) ### Features Added @@ -19,4 +17,4 @@ ## 1.0.0 (2022-05-09) -The package of @azure/arm-changes is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ). +The package of @azure/arm-changes is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart). diff --git a/sdk/changes/arm-changes/LICENSE b/sdk/changes/arm-changes/LICENSE index b2f52a2bad4e..63447fd8bbbf 100644 --- a/sdk/changes/arm-changes/LICENSE +++ b/sdk/changes/arm-changes/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/changes/arm-changes/README.md b/sdk/changes/arm-changes/README.md index 103b185e610e..3ad195e9ebc9 100644 --- a/sdk/changes/arm-changes/README.md +++ b/sdk/changes/arm-changes/README.md @@ -44,7 +44,6 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure Changes** 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 +63,14 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur import { InteractiveBrowserCredential } from "@azure/identity"; import { ChangesClient } from "@azure/arm-changes"; -const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", - clientId: "", -}); + clientId: "" + }); const client = new ChangesClient(credential, subscriptionId); ``` ### JavaScript Bundle - To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). ## Key concepts @@ -109,7 +106,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/ diff --git a/sdk/changes/arm-changes/_meta.json b/sdk/changes/arm-changes/_meta.json index 1bf4df740730..c37acc89bcac 100644 --- a/sdk/changes/arm-changes/_meta.json +++ b/sdk/changes/arm-changes/_meta.json @@ -1,8 +1,8 @@ { - "commit": "20df2424a278ca19437e437a7dbf3a7857a0dd9d", + "commit": "fcbc290cc06b0d69207105d83bb7dac49c21675b", "readme": "specification/resources/resource-manager/readme.md", - "autorest_command": "autorest --version=3.8.4 --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.0-rc.3.20221108.1 --generate-sample=true", + "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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/resources/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", - "use": "@autorest/typescript@6.0.0-rc.3.20221108.1" -} \ No newline at end of file + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.26", + "use": "@autorest/typescript@^6.0.12" +} diff --git a/sdk/changes/arm-changes/api-extractor.json b/sdk/changes/arm-changes/api-extractor.json index abb49f21d093..5186ed2dc607 100644 --- a/sdk/changes/arm-changes/api-extractor.json +++ b/sdk/changes/arm-changes/api-extractor.json @@ -28,4 +28,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/changes/arm-changes/package.json b/sdk/changes/arm-changes/package.json index 3a701fc7e370..b1adf4e4d7dc 100644 --- a/sdk/changes/arm-changes/package.json +++ b/sdk/changes/arm-changes/package.json @@ -3,15 +3,15 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ChangesClient.", - "version": "1.1.1", + "version": "2.0.0", "engines": { "node": ">=18.0.0" }, "dependencies": { "@azure/core-auth": "^1.9.0", - "@azure/core-client": "^1.9.2", + "@azure/core-client": "^1.9.3", "@azure/core-paging": "^1.6.2", - "@azure/core-rest-pipeline": "^1.18.2", + "@azure/core-rest-pipeline": "^1.19.1", "tslib": "^2.8.1" }, "keywords": [ @@ -26,20 +26,22 @@ "main": "./dist/commonjs/index.js", "module": "./dist/esm/index.js", "types": "./dist/commonjs/index.d.ts", + "type": "module", "devDependencies": { "@azure-tools/test-credential": "^2.0.0", "@azure-tools/test-recorder": "^4.1.0", "@azure-tools/test-utils-vitest": "^1.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.5.0", + "@azure/identity": "^4.9.1", + "@azure/logger": "^1.1.4", "@types/node": "^18.0.0", "@vitest/browser": "^3.0.9", "@vitest/coverage-istanbul": "^3.0.9", - "playwright": "^1.49.1", + "dotenv": "^16.0.0", + "playwright": "^1.52.0", "typescript": "~5.8.2", "vitest": "^3.0.9" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/changes/arm-changes", "repository": "github:Azure/azure-sdk-for-js", "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" @@ -57,16 +59,16 @@ "build:node": "echo skipped", "build:samples": "echo skipped.", "build:test": "echo skipped", - "check-format": "echo skipped", + "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", "clean": "dev-tool run vendored 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", + "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "integration-test:browser": "echo skipped", "integration-test:node": "dev-tool run test:vitest --esm", "lint": "echo skipped", - "minify": "echo skipped", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", "pack": "npm pack 2>&1", "prepack": "npm run build", "test": "npm run integration-test", @@ -87,15 +89,9 @@ ] }, "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-changes?view=azure-node-preview" - }, - "type": "module", + "browser": "./dist/browser/index.js", + "react-native": "./dist/react-native/index.js", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/changes/arm-changes", "tshy": { "project": "./tsconfig.src.json", "exports": { @@ -112,8 +108,6 @@ ], "selfLink": false }, - "browser": "./dist/browser/index.js", - "react-native": "./dist/react-native/index.js", "exports": { "./package.json": "./package.json", ".": { @@ -135,4 +129,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/changes/arm-changes/review/arm-changes.api.md b/sdk/changes/arm-changes/review/arm-changes.api.md index d28e3c8b3d3c..7f23d1894d55 100644 --- a/sdk/changes/arm-changes/review/arm-changes.api.md +++ b/sdk/changes/arm-changes/review/arm-changes.api.md @@ -85,8 +85,6 @@ export type ChangesGetResponse = ChangeResourceResult; // @public export interface ChangesListNextOptionalParams extends coreClient.OperationOptions { - skipToken?: string; - top?: number; } // @public diff --git a/sdk/changes/arm-changes/sample.env b/sdk/changes/arm-changes/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/changes/arm-changes/sample.env +++ b/sdk/changes/arm-changes/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/changes/arm-changes/samples/v1/typescript/src/changesGetSample.ts b/sdk/changes/arm-changes/samples/v1/typescript/src/changesGetSample.ts index a562e7a0bd8b..6c8038b8e895 100644 --- a/sdk/changes/arm-changes/samples/v1/typescript/src/changesGetSample.ts +++ b/sdk/changes/arm-changes/samples/v1/typescript/src/changesGetSample.ts @@ -14,7 +14,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * @summary Obtains the specified change resource for the target resource * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-05-01/examples/GetChange.json */ -async function getChange() { +async function getChange(): Promise { const subscriptionId = "subscriptionId1"; const resourceGroupName = "resourceGroup1"; const resourceProviderNamespace = "resourceProvider1"; diff --git a/sdk/changes/arm-changes/samples/v1/typescript/src/changesListSample.ts b/sdk/changes/arm-changes/samples/v1/typescript/src/changesListSample.ts index ea0dab5599de..4e87f8a5726a 100644 --- a/sdk/changes/arm-changes/samples/v1/typescript/src/changesListSample.ts +++ b/sdk/changes/arm-changes/samples/v1/typescript/src/changesListSample.ts @@ -14,7 +14,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * @summary Obtains a list of change resources from the past 14 days for the target resource * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-05-01/examples/ListChanges.json */ -async function listChanges() { +async function listChanges(): Promise { const subscriptionId = "subscriptionId1"; const resourceGroupName = "resourceGroup1"; const resourceProviderNamespace = "resourceProvider1"; diff --git a/sdk/changes/arm-changes/src/changesClient.ts b/sdk/changes/arm-changes/src/changesClient.ts index 6fabfe9185a6..c512d6890348 100644 --- a/sdk/changes/arm-changes/src/changesClient.ts +++ b/sdk/changes/arm-changes/src/changesClient.ts @@ -8,11 +8,7 @@ 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 { PipelineRequest, PipelineResponse, SendRequest } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { ChangesImpl } from "./operations/index.js"; import { Changes } from "./operationsInterfaces/index.js"; @@ -33,7 +29,7 @@ export class ChangesClient extends coreClient.ServiceClient { constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: ChangesClientOptionalParams + options?: ChangesClientOptionalParams, ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); @@ -48,10 +44,10 @@ export class ChangesClient extends coreClient.ServiceClient { } const defaults: ChangesClientOptionalParams = { requestContentType: "application/json; charset=utf-8", - credential: credentials + credential: credentials, }; - const packageDetails = `azsdk-js-arm-changes/1.1.1`; + const packageDetails = `azsdk-js-arm-changes/2.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -61,20 +57,19 @@ export class ChangesClient extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, - endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + 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(); + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => - pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName + pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -84,19 +79,17 @@ export class ChangesClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ credential: credentials, scopes: - optionsWithDefaults.credentialScopes ?? - `${optionsWithDefaults.endpoint}/.default`, + optionsWithDefaults.credentialScopes ?? `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -116,10 +109,7 @@ export class ChangesClient extends coreClient.ServiceClient { } const apiVersionPolicy = { name: "CustomApiVersionPolicy", - async sendRequest( - request: PipelineRequest, - next: SendRequest - ): Promise { + async sendRequest(request: PipelineRequest, next: SendRequest): Promise { const param = request.url.split("?"); if (param.length > 1) { const newParams = param[1].split("&").map((item) => { @@ -132,7 +122,7 @@ export class ChangesClient extends coreClient.ServiceClient { request.url = param[0] + "?" + newParams.join("&"); } return next(request); - } + }, }; this.pipeline.addPolicy(apiVersionPolicy); } diff --git a/sdk/changes/arm-changes/src/models/index.ts b/sdk/changes/arm-changes/src/models/index.ts index ad228aaa3b0b..dbe5776f0646 100644 --- a/sdk/changes/arm-changes/src/models/index.ts +++ b/sdk/changes/arm-changes/src/models/index.ts @@ -191,20 +191,13 @@ export interface ChangesGetOptionalParams extends coreClient.OperationOptions {} export type ChangesGetResponse = ChangeResourceResult; /** Optional parameters. */ -export interface ChangesListNextOptionalParams - extends coreClient.OperationOptions { - /** (Optional) Set the maximum number of results per response. */ - top?: number; - /** (Optional) The page-continuation token */ - skipToken?: string; -} +export interface ChangesListNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type ChangesListNextResponse = ChangeResourceListResult; /** Optional parameters. */ -export interface ChangesClientOptionalParams - extends coreClient.ServiceClientOptions { +export interface ChangesClientOptionalParams extends coreClient.ServiceClientOptions { /** server parameter */ $host?: string; /** Api Version */ diff --git a/sdk/changes/arm-changes/src/models/mappers.ts b/sdk/changes/arm-changes/src/models/mappers.ts index 440d71224353..576f47c739df 100644 --- a/sdk/changes/arm-changes/src/models/mappers.ts +++ b/sdk/changes/arm-changes/src/models/mappers.ts @@ -16,8 +16,8 @@ export const ChangeResourceListResult: coreClient.CompositeMapper = { nextLink: { serializedName: "nextLink", type: { - name: "String" - } + name: "String", + }, }, value: { serializedName: "value", @@ -26,13 +26,13 @@ export const ChangeResourceListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ChangeResourceResult" - } - } - } - } - } - } + className: "ChangeResourceResult", + }, + }, + }, + }, + }, + }, }; export const ChangeProperties: coreClient.CompositeMapper = { @@ -44,40 +44,40 @@ export const ChangeProperties: coreClient.CompositeMapper = { serializedName: "targetResourceId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, targetResourceType: { serializedName: "targetResourceType", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, changeType: { serializedName: "changeType", readOnly: true, type: { name: "Enum", - allowedValues: ["Update", "Delete", "Create"] - } + allowedValues: ["Update", "Delete", "Create"], + }, }, changeAttributes: { serializedName: "changeAttributes", type: { name: "Composite", - className: "ChangeAttributes" - } + className: "ChangeAttributes", + }, }, changes: { serializedName: "changes", type: { name: "Dictionary", - value: { type: { name: "Composite", className: "ChangeBase" } } - } - } - } - } + value: { type: { name: "Composite", className: "ChangeBase" } }, + }, + }, + }, + }, }; export const ChangeAttributes: coreClient.CompositeMapper = { @@ -89,39 +89,39 @@ export const ChangeAttributes: coreClient.CompositeMapper = { serializedName: "correlationId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, timestamp: { serializedName: "timestamp", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, changesCount: { serializedName: "changesCount", readOnly: true, type: { - name: "Number" - } + name: "Number", + }, }, previousResourceSnapshotId: { serializedName: "previousResourceSnapshotId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, newResourceSnapshotId: { serializedName: "newResourceSnapshotId", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ChangeBase: coreClient.CompositeMapper = { @@ -134,33 +134,33 @@ export const ChangeBase: coreClient.CompositeMapper = { readOnly: true, type: { name: "Enum", - allowedValues: ["Update", "Insert", "Remove"] - } + allowedValues: ["Update", "Insert", "Remove"], + }, }, changeCategory: { serializedName: "changeCategory", readOnly: true, type: { name: "Enum", - allowedValues: ["User", "System"] - } + allowedValues: ["User", "System"], + }, }, previousValue: { serializedName: "previousValue", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, newValue: { serializedName: "newValue", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Resource: coreClient.CompositeMapper = { @@ -172,25 +172,25 @@ export const Resource: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ErrorResponse: coreClient.CompositeMapper = { @@ -202,11 +202,11 @@ export const ErrorResponse: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorDetail" - } - } - } - } + className: "ErrorDetail", + }, + }, + }, + }, }; export const ErrorDetail: coreClient.CompositeMapper = { @@ -218,22 +218,22 @@ export const ErrorDetail: coreClient.CompositeMapper = { serializedName: "code", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, message: { serializedName: "message", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, target: { serializedName: "target", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, details: { serializedName: "details", @@ -243,10 +243,10 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorDetail" - } - } - } + className: "ErrorDetail", + }, + }, + }, }, additionalInfo: { serializedName: "additionalInfo", @@ -256,13 +256,13 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorAdditionalInfo" - } - } - } - } - } - } + className: "ErrorAdditionalInfo", + }, + }, + }, + }, + }, + }, }; export const ErrorAdditionalInfo: coreClient.CompositeMapper = { @@ -274,19 +274,19 @@ export const ErrorAdditionalInfo: coreClient.CompositeMapper = { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, info: { serializedName: "info", readOnly: true, type: { name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } + value: { type: { name: "any" } }, + }, + }, + }, + }, }; export const ChangeResourceResult: coreClient.CompositeMapper = { @@ -299,9 +299,9 @@ export const ChangeResourceResult: coreClient.CompositeMapper = { serializedName: "properties", type: { name: "Composite", - className: "ChangeProperties" - } - } - } - } + className: "ChangeProperties", + }, + }, + }, + }, }; diff --git a/sdk/changes/arm-changes/src/models/parameters.ts b/sdk/changes/arm-changes/src/models/parameters.ts index 8d270640fffc..993d6cabbfeb 100644 --- a/sdk/changes/arm-changes/src/models/parameters.ts +++ b/sdk/changes/arm-changes/src/models/parameters.ts @@ -9,7 +9,7 @@ import { OperationParameter, OperationURLParameter, - OperationQueryParameter + OperationQueryParameter, } from "@azure/core-client"; export const accept: OperationParameter = { @@ -19,9 +19,9 @@ export const accept: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const $host: OperationURLParameter = { @@ -30,10 +30,10 @@ export const $host: OperationURLParameter = { serializedName: "$host", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const subscriptionId: OperationURLParameter = { @@ -42,9 +42,9 @@ export const subscriptionId: OperationURLParameter = { serializedName: "subscriptionId", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const resourceGroupName: OperationURLParameter = { @@ -53,9 +53,9 @@ export const resourceGroupName: OperationURLParameter = { serializedName: "resourceGroupName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const resourceProviderNamespace: OperationURLParameter = { @@ -64,9 +64,9 @@ export const resourceProviderNamespace: OperationURLParameter = { serializedName: "resourceProviderNamespace", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const resourceType: OperationURLParameter = { @@ -75,9 +75,9 @@ export const resourceType: OperationURLParameter = { serializedName: "resourceType", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const resourceName: OperationURLParameter = { @@ -86,9 +86,9 @@ export const resourceName: OperationURLParameter = { serializedName: "resourceName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const apiVersion: OperationQueryParameter = { @@ -98,9 +98,9 @@ export const apiVersion: OperationQueryParameter = { isConstant: true, serializedName: "api-version", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const top: OperationQueryParameter = { @@ -109,13 +109,13 @@ export const top: OperationQueryParameter = { defaultValue: 100, constraints: { InclusiveMaximum: 100, - InclusiveMinimum: 1 + InclusiveMinimum: 1, }, serializedName: "$top", type: { - name: "Number" - } - } + name: "Number", + }, + }, }; export const skipToken: OperationQueryParameter = { @@ -123,9 +123,9 @@ export const skipToken: OperationQueryParameter = { mapper: { serializedName: "$skipToken", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const changeResourceId: OperationURLParameter = { @@ -134,9 +134,9 @@ export const changeResourceId: OperationURLParameter = { serializedName: "changeResourceId", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const nextLink: OperationURLParameter = { @@ -145,8 +145,8 @@ export const nextLink: OperationURLParameter = { serializedName: "nextLink", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; diff --git a/sdk/changes/arm-changes/src/operations/changes.ts b/sdk/changes/arm-changes/src/operations/changes.ts index 05ba10181d18..024988a304e3 100644 --- a/sdk/changes/arm-changes/src/operations/changes.ts +++ b/sdk/changes/arm-changes/src/operations/changes.ts @@ -20,7 +20,7 @@ import { ChangesListResponse, ChangesGetOptionalParams, ChangesGetResponse, - ChangesListNextResponse + ChangesListNextResponse, } from "../models/index.js"; /// @@ -49,14 +49,14 @@ export class ChangesImpl implements Changes { resourceProviderNamespace: string, resourceType: string, resourceName: string, - options?: ChangesListOptionalParams + options?: ChangesListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll( resourceGroupName, resourceProviderNamespace, resourceType, resourceName, - options + options, ); return { next() { @@ -75,9 +75,9 @@ export class ChangesImpl implements Changes { resourceType, resourceName, options, - settings + settings, ); - } + }, }; } @@ -87,7 +87,7 @@ export class ChangesImpl implements Changes { resourceType: string, resourceName: string, options?: ChangesListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ChangesListResponse; let continuationToken = settings?.continuationToken; @@ -97,7 +97,7 @@ export class ChangesImpl implements Changes { resourceProviderNamespace, resourceType, resourceName, - options + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -111,7 +111,7 @@ export class ChangesImpl implements Changes { resourceType, resourceName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -125,14 +125,14 @@ export class ChangesImpl implements Changes { resourceProviderNamespace: string, resourceType: string, resourceName: string, - options?: ChangesListOptionalParams + options?: ChangesListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage( resourceGroupName, resourceProviderNamespace, resourceType, resourceName, - options + options, )) { yield* page; } @@ -151,7 +151,7 @@ export class ChangesImpl implements Changes { resourceProviderNamespace: string, resourceType: string, resourceName: string, - options?: ChangesListOptionalParams + options?: ChangesListOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -159,9 +159,9 @@ export class ChangesImpl implements Changes { resourceProviderNamespace, resourceType, resourceName, - options + options, }, - listOperationSpec + listOperationSpec, ); } @@ -180,7 +180,7 @@ export class ChangesImpl implements Changes { resourceType: string, resourceName: string, changeResourceId: string, - options?: ChangesGetOptionalParams + options?: ChangesGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -189,9 +189,9 @@ export class ChangesImpl implements Changes { resourceType, resourceName, changeResourceId, - options + options, }, - getOperationSpec + getOperationSpec, ); } @@ -210,7 +210,7 @@ export class ChangesImpl implements Changes { resourceType: string, resourceName: string, nextLink: string, - options?: ChangesListNextOptionalParams + options?: ChangesListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -219,9 +219,9 @@ export class ChangesImpl implements Changes { resourceType, resourceName, nextLink, - options + options, }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -229,44 +229,38 @@ export class ChangesImpl implements Changes { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Resources/changes", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Resources/changes", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ChangeResourceListResult + bodyMapper: Mappers.ChangeResourceListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [ - Parameters.apiVersion, - Parameters.top, - Parameters.skipToken - ], + queryParameters: [Parameters.apiVersion, Parameters.top, Parameters.skipToken], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceProviderNamespace, Parameters.resourceType, - Parameters.resourceName + Parameters.resourceName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Resources/changes/{changeResourceId}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Resources/changes/{changeResourceId}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ChangeResourceResult + bodyMapper: Mappers.ChangeResourceResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -276,27 +270,22 @@ const getOperationSpec: coreClient.OperationSpec = { Parameters.resourceProviderNamespace, Parameters.resourceType, Parameters.resourceName, - Parameters.changeResourceId + Parameters.changeResourceId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ChangeResourceListResult + bodyMapper: Mappers.ChangeResourceListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [ - Parameters.apiVersion, - Parameters.top, - Parameters.skipToken - ], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -304,8 +293,8 @@ const listNextOperationSpec: coreClient.OperationSpec = { Parameters.resourceProviderNamespace, Parameters.resourceType, Parameters.resourceName, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/changes/arm-changes/src/operationsInterfaces/changes.ts b/sdk/changes/arm-changes/src/operationsInterfaces/changes.ts index ab5f2cdd54a3..95004fb532e4 100644 --- a/sdk/changes/arm-changes/src/operationsInterfaces/changes.ts +++ b/sdk/changes/arm-changes/src/operationsInterfaces/changes.ts @@ -11,7 +11,7 @@ import { ChangeResourceResult, ChangesListOptionalParams, ChangesGetOptionalParams, - ChangesGetResponse + ChangesGetResponse, } from "../models/index.js"; /// @@ -30,7 +30,7 @@ export interface Changes { resourceProviderNamespace: string, resourceType: string, resourceName: string, - options?: ChangesListOptionalParams + options?: ChangesListOptionalParams, ): PagedAsyncIterableIterator; /** * Obtains the specified change resource for the target resource @@ -47,6 +47,6 @@ export interface Changes { resourceType: string, resourceName: string, changeResourceId: string, - options?: ChangesGetOptionalParams + options?: ChangesGetOptionalParams, ): Promise; } diff --git a/sdk/changes/arm-changes/src/pagingHelper.ts b/sdk/changes/arm-changes/src/pagingHelper.ts index d85fc13bce1e..e362819bdfc4 100644 --- a/sdk/changes/arm-changes/src/pagingHelper.ts +++ b/sdk/changes/arm-changes/src/pagingHelper.ts @@ -13,11 +13,11 @@ export interface PageInfo { const pageMap = new WeakMap(); /** - * Given a result page from a pageable operation, returns a - * continuation token that can be used to begin paging from + * 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 A result object from calling .byPage() on a paged operation. - * @returns The continuation token that can be passed into byPage(). + * @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) { @@ -26,10 +26,7 @@ export function getContinuationToken(page: unknown): string | undefined { return pageMap.get(page)?.continuationToken; } -export function setContinuationToken( - page: unknown, - continuationToken: string | undefined -): void { +export function setContinuationToken(page: unknown, continuationToken: string | undefined): void { if (typeof page !== "object" || page === null || !continuationToken) { return; } diff --git a/sdk/changes/arm-changes/test/sampleTest.spec.ts b/sdk/changes/arm-changes/test/sampleTest.spec.ts index 86a13f7a74a4..90b3c8a868b4 100644 --- a/sdk/changes/arm-changes/test/sampleTest.spec.ts +++ b/sdk/changes/arm-changes/test/sampleTest.spec.ts @@ -6,8 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import type { RecorderStartOptions } from "@azure-tools/test-recorder"; -import { Recorder } from "@azure-tools/test-recorder"; +import { Recorder, RecorderStartOptions } from "@azure-tools/test-recorder"; import { afterEach, beforeEach, describe, it, assert } from "vitest"; const replaceableVariables: Record = { @@ -19,17 +18,13 @@ const replaceableVariables: Record = { 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 - ], }; describe("My test", () => { let recorder: Recorder; - beforeEach(async (ctx) => { - recorder = new Recorder(ctx); + beforeEach(async () => { + recorder = new Recorder(); await recorder.start(recorderOptions); }); diff --git a/sdk/changes/arm-changes/test/snippets.spec.ts b/sdk/changes/arm-changes/test/snippets.spec.ts index 4213275ba20d..7278ce8f5a3a 100644 --- a/sdk/changes/arm-changes/test/snippets.spec.ts +++ b/sdk/changes/arm-changes/test/snippets.spec.ts @@ -1,5 +1,10 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. +/* + * 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 { ChangesClient } from "../src/index.js"; import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; diff --git a/sdk/changes/arm-changes/tsconfig.browser.config.json b/sdk/changes/arm-changes/tsconfig.browser.config.json index b6586181d006..75871518e3a0 100644 --- a/sdk/changes/arm-changes/tsconfig.browser.config.json +++ b/sdk/changes/arm-changes/tsconfig.browser.config.json @@ -1,17 +1,3 @@ { - "extends": "./.tshy/build.json", - "include": [ - "./src/**/*.ts", - "./src/**/*.mts", - "./test/**/*.spec.ts", - "./test/**/*.mts" - ], - "exclude": [ - "./test/**/node/**/*.ts" - ], - "compilerOptions": { - "outDir": "./dist-test/browser", - "rootDir": ".", - "skipLibCheck": true - } + "extends": ["./tsconfig.test.json", "../../../tsconfig.browser.base.json"] } diff --git a/sdk/changes/arm-changes/tsconfig.json b/sdk/changes/arm-changes/tsconfig.json index 19ceb382b521..a60f68f3382e 100644 --- a/sdk/changes/arm-changes/tsconfig.json +++ b/sdk/changes/arm-changes/tsconfig.json @@ -4,10 +4,28 @@ "path": "./tsconfig.src.json" }, { - "path": "./tsconfig.samples.json" + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.test.json" }, { "path": "./tsconfig.test.json" } ] -} +} \ No newline at end of file diff --git a/sdk/changes/arm-changes/tsconfig.samples.json b/sdk/changes/arm-changes/tsconfig.samples.json index d26cef4635a5..8f02551fefe3 100644 --- a/sdk/changes/arm-changes/tsconfig.samples.json +++ b/sdk/changes/arm-changes/tsconfig.samples.json @@ -2,9 +2,7 @@ "extends": "../../../tsconfig.samples.base.json", "compilerOptions": { "paths": { - "@azure/arm-changes": [ - "./dist/esm" - ] + "@azure/arm-changes": ["./dist/esm"] } } } diff --git a/sdk/changes/arm-changes/tsconfig.test.json b/sdk/changes/arm-changes/tsconfig.test.json index 3c2b783a8c1b..290ca214aebc 100644 --- a/sdk/changes/arm-changes/tsconfig.test.json +++ b/sdk/changes/arm-changes/tsconfig.test.json @@ -1,6 +1,3 @@ { - "extends": [ - "./tsconfig.src.json", - "../../../tsconfig.test.base.json" - ] + "extends": ["./tsconfig.src.json", "../../../tsconfig.test.base.json"] } diff --git a/sdk/changes/arm-changes/vitest.browser.config.ts b/sdk/changes/arm-changes/vitest.browser.config.ts index b48c61b2ef46..182729ab5ce9 100644 --- a/sdk/changes/arm-changes/vitest.browser.config.ts +++ b/sdk/changes/arm-changes/vitest.browser.config.ts @@ -9,9 +9,9 @@ export default mergeConfig( viteConfig, defineConfig({ test: { - include: [ - "dist-test/browser/test/**/*.spec.js", - ], + include: ["dist-test/browser/test/**/*.spec.js",], + testTimeout: 1200000, + hookTimeout: 1200000, }, }), ); diff --git a/sdk/changes/arm-changes/vitest.config.ts b/sdk/changes/arm-changes/vitest.config.ts index 2a4750c84292..40e031385dd8 100644 --- a/sdk/changes/arm-changes/vitest.config.ts +++ b/sdk/changes/arm-changes/vitest.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. @@ -8,8 +9,8 @@ export default mergeConfig( viteConfig, defineConfig({ test: { - hookTimeout: 1200000, testTimeout: 1200000, + hookTimeout: 1200000, }, }), ); diff --git a/sdk/databoundaries/arm-databoundaries/CHANGELOG.md b/sdk/databoundaries/arm-databoundaries/CHANGELOG.md index 3dc43897b64a..b1d61a573ab3 100644 --- a/sdk/databoundaries/arm-databoundaries/CHANGELOG.md +++ b/sdk/databoundaries/arm-databoundaries/CHANGELOG.md @@ -1,16 +1,6 @@ # Release History - -## 1.0.0-beta.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 1.0.0-beta.1 (2024-10-25) + +## 1.0.0 (2025-04-28) ### Features Added diff --git a/sdk/databoundaries/arm-databoundaries/LICENSE b/sdk/databoundaries/arm-databoundaries/LICENSE index b2f52a2bad4e..63447fd8bbbf 100644 --- a/sdk/databoundaries/arm-databoundaries/LICENSE +++ b/sdk/databoundaries/arm-databoundaries/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/databoundaries/arm-databoundaries/README.md b/sdk/databoundaries/arm-databoundaries/README.md index ace8a27c81d4..1bd99b530cc0 100644 --- a/sdk/databoundaries/arm-databoundaries/README.md +++ b/sdk/databoundaries/arm-databoundaries/README.md @@ -6,7 +6,7 @@ Provides APIs for data boundary operations. [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/databoundaries/arm-databoundaries) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-databoundaries) | -[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-databoundaries?view=azure-node-preview) | +[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-databoundaries) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started @@ -44,7 +44,6 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure DataboundariesManegement** 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). @@ -54,7 +53,8 @@ Using Node.js and Node-like environments, you can use the `DefaultAzureCredentia import { DataboundariesManegementClient } from "@azure/arm-databoundaries"; import { DefaultAzureCredential } from "@azure/identity"; -const client = new DataboundariesManegementClient(new DefaultAzureCredential()); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new DataboundariesManegementClient(new DefaultAzureCredential(), subscriptionId); ``` For browser environments, use the `InteractiveBrowserCredential` from the `@azure/identity` package to authenticate. @@ -65,13 +65,12 @@ import { DataboundariesManegementClient } from "@azure/arm-databoundaries"; const credential = new InteractiveBrowserCredential({ tenantId: "", - clientId: "", -}); -const client = new DataboundariesManegementClient(credential); + clientId: "" + }); +const client = new DataboundariesManegementClient(credential, subscriptionId); ``` ### JavaScript Bundle - To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). ## Key concepts @@ -107,7 +106,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/ diff --git a/sdk/databoundaries/arm-databoundaries/_meta.json b/sdk/databoundaries/arm-databoundaries/_meta.json index ded7b86c8a32..c37acc89bcac 100644 --- a/sdk/databoundaries/arm-databoundaries/_meta.json +++ b/sdk/databoundaries/arm-databoundaries/_meta.json @@ -1,8 +1,8 @@ { - "commit": "bc3aa2bbc4494553649019585c3bc8a4229a25d0", + "commit": "fcbc290cc06b0d69207105d83bb7dac49c21675b", "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.27 --generate-sample=true", + "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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/resources/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.15", - "use": "@autorest/typescript@6.0.27" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.26", + "use": "@autorest/typescript@^6.0.12" } diff --git a/sdk/databoundaries/arm-databoundaries/api-extractor.json b/sdk/databoundaries/arm-databoundaries/api-extractor.json index 25f21ad8c7a8..0815e9b8fc4e 100644 --- a/sdk/databoundaries/arm-databoundaries/api-extractor.json +++ b/sdk/databoundaries/arm-databoundaries/api-extractor.json @@ -28,4 +28,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/databoundaries/arm-databoundaries/package.json b/sdk/databoundaries/arm-databoundaries/package.json index dc10154b9b96..73504837c3fc 100644 --- a/sdk/databoundaries/arm-databoundaries/package.json +++ b/sdk/databoundaries/arm-databoundaries/package.json @@ -3,14 +3,15 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for DataboundariesManegementClient.", - "version": "1.0.0-beta.2", + "version": "1.0.0", "engines": { "node": ">=18.0.0" }, "dependencies": { "@azure/core-auth": "^1.9.0", - "@azure/core-client": "^1.9.2", - "@azure/core-rest-pipeline": "^1.18.2", + "@azure/core-client": "^1.9.3", + "@azure/core-paging": "^1.6.2", + "@azure/core-rest-pipeline": "^1.19.1", "tslib": "^2.8.1" }, "keywords": [ @@ -25,18 +26,19 @@ "main": "./dist/commonjs/index.js", "module": "./dist/esm/index.js", "types": "./dist/commonjs/index.d.ts", + "type": "module", "devDependencies": { "@azure-tools/test-credential": "^2.0.0", "@azure-tools/test-recorder": "^4.1.0", "@azure-tools/test-utils-vitest": "^1.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.6.0", + "@azure/identity": "^4.9.1", "@azure/logger": "^1.1.4", "@types/node": "^18.0.0", "@vitest/browser": "^3.0.9", "@vitest/coverage-istanbul": "^3.0.9", "dotenv": "^16.0.0", - "playwright": "^1.50.0", + "playwright": "^1.52.0", "typescript": "~5.8.2", "vitest": "^3.0.9" }, @@ -57,16 +59,16 @@ "build:node": "echo skipped", "build:samples": "echo skipped.", "build:test": "echo skipped", - "check-format": "echo skipped", + "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", "clean": "dev-tool run vendored 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", + "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "integration-test:browser": "echo skipped", "integration-test:node": "dev-tool run test:vitest --esm", "lint": "echo skipped", - "minify": "echo skipped", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", "pack": "npm pack 2>&1", "prepack": "npm run build", "test": "npm run integration-test", @@ -87,16 +89,9 @@ ] }, "autoPublish": true, + "browser": "./dist/browser/index.js", + "react-native": "./dist/react-native/index.js", "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/databoundaries/arm-databoundaries", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-databoundaries?view=azure-node-preview" - }, - "type": "module", "tshy": { "project": "./tsconfig.src.json", "exports": { @@ -113,8 +108,6 @@ ], "selfLink": false }, - "browser": "./dist/browser/index.js", - "react-native": "./dist/react-native/index.js", "exports": { "./package.json": "./package.json", ".": { @@ -136,4 +129,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/databoundaries/arm-databoundaries/review/arm-databoundaries.api.md b/sdk/databoundaries/arm-databoundaries/review/arm-databoundaries.api.md index d23a5c8294e3..1e0090389a26 100644 --- a/sdk/databoundaries/arm-databoundaries/review/arm-databoundaries.api.md +++ b/sdk/databoundaries/arm-databoundaries/review/arm-databoundaries.api.md @@ -6,6 +6,10 @@ import * as coreAuth from '@azure/core-auth'; import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; + +// @public +export type ActionType = string; // @public export type CreatedByType = string; @@ -40,6 +44,8 @@ export class DataboundariesManegementClient extends coreClient.ServiceClient { apiVersion: string; // (undocumented) dataBoundaries: DataBoundaries; + // (undocumented) + operations: Operations; } // @public @@ -93,6 +99,14 @@ export interface ErrorResponse { error?: ErrorDetail; } +// @public +export function getContinuationToken(page: unknown): string | undefined; + +// @public +export enum KnownActionType { + Internal = "Internal" +} + // @public export enum KnownCreatedByType { Application = "Application", @@ -113,6 +127,13 @@ export enum KnownDefaultName { Default = "default" } +// @public +export enum KnownOrigin { + System = "system", + User = "user", + UserSystem = "user,system" +} + // @public export enum KnownProvisioningState { Accepted = "Accepted", @@ -124,6 +145,51 @@ export enum KnownProvisioningState { Updating = "Updating" } +// @public +export interface Operation { + readonly actionType?: ActionType; + display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationListResult { + readonly nextLink?: string; + readonly value?: Operation[]; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationListResult; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public +export type Origin = string; + // @public export type ProvisioningState = string; diff --git a/sdk/databoundaries/arm-databoundaries/sample.env b/sdk/databoundaries/arm-databoundaries/sample.env index efbc7787bd3b..508439fc7d62 100644 --- a/sdk/databoundaries/arm-databoundaries/sample.env +++ b/sdk/databoundaries/arm-databoundaries/sample.env @@ -1 +1 @@ -# Feel free to add your own environment variables. +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/databoundaries/arm-databoundaries/src/databoundariesManegementClient.ts b/sdk/databoundaries/arm-databoundaries/src/databoundariesManegementClient.ts index dd3b2f4c79cd..7c0c816fd374 100644 --- a/sdk/databoundaries/arm-databoundaries/src/databoundariesManegementClient.ts +++ b/sdk/databoundaries/arm-databoundaries/src/databoundariesManegementClient.ts @@ -8,14 +8,10 @@ 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 { PipelineRequest, PipelineResponse, SendRequest } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; -import { DataBoundariesImpl } from "./operations/index.js"; -import { DataBoundaries } from "./operationsInterfaces/index.js"; +import { OperationsImpl, DataBoundariesImpl } from "./operations/index.js"; +import { Operations, DataBoundaries } from "./operationsInterfaces/index.js"; import { DataboundariesManegementClientOptionalParams } from "./models/index.js"; export class DataboundariesManegementClient extends coreClient.ServiceClient { @@ -44,7 +40,7 @@ export class DataboundariesManegementClient extends coreClient.ServiceClient { credential: credentials, }; - const packageDetails = `azsdk-js-arm-databoundaries/1.0.0-beta.2`; + const packageDetails = `azsdk-js-arm-databoundaries/1.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -56,8 +52,7 @@ export class DataboundariesManegementClient extends coreClient.ServiceClient { userAgentOptions: { userAgentPrefix, }, - endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com", + endpoint: options.endpoint ?? options.baseUri ?? "https://management.azure.com", }; super(optionsWithDefaults); @@ -67,8 +62,7 @@ export class DataboundariesManegementClient extends coreClient.ServiceClient { options.pipeline.getOrderedPolicies(); bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => - pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName, + pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -84,11 +78,9 @@ export class DataboundariesManegementClient extends coreClient.ServiceClient { coreRestPipeline.bearerTokenAuthenticationPolicy({ credential: credentials, scopes: - optionsWithDefaults.credentialScopes ?? - `${optionsWithDefaults.endpoint}/.default`, + optionsWithDefaults.credentialScopes ?? `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge, + authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge, }, }), ); @@ -97,6 +89,7 @@ export class DataboundariesManegementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; this.apiVersion = options.apiVersion || "2024-08-01"; + this.operations = new OperationsImpl(this); this.dataBoundaries = new DataBoundariesImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -108,10 +101,7 @@ export class DataboundariesManegementClient extends coreClient.ServiceClient { } const apiVersionPolicy = { name: "CustomApiVersionPolicy", - async sendRequest( - request: PipelineRequest, - next: SendRequest, - ): Promise { + async sendRequest(request: PipelineRequest, next: SendRequest): Promise { const param = request.url.split("?"); if (param.length > 1) { const newParams = param[1].split("&").map((item) => { @@ -129,5 +119,6 @@ export class DataboundariesManegementClient extends coreClient.ServiceClient { this.pipeline.addPolicy(apiVersionPolicy); } + operations: Operations; dataBoundaries: DataBoundaries; } diff --git a/sdk/databoundaries/arm-databoundaries/src/index.ts b/sdk/databoundaries/arm-databoundaries/src/index.ts index bf041645a17c..a7731b71e581 100644 --- a/sdk/databoundaries/arm-databoundaries/src/index.ts +++ b/sdk/databoundaries/arm-databoundaries/src/index.ts @@ -6,6 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +/// +export { getContinuationToken } from "./pagingHelper.js"; export * from "./models/index.js"; export { DataboundariesManegementClient } from "./databoundariesManegementClient.js"; export * from "./operationsInterfaces/index.js"; diff --git a/sdk/databoundaries/arm-databoundaries/src/models/index.ts b/sdk/databoundaries/arm-databoundaries/src/models/index.ts index f2a0c67411cb..2d5daaaa11a1 100644 --- a/sdk/databoundaries/arm-databoundaries/src/models/index.ts +++ b/sdk/databoundaries/arm-databoundaries/src/models/index.ts @@ -8,55 +8,68 @@ import * as coreClient from "@azure/core-client"; -/** Data boundary properties */ -export interface DataBoundaryProperties { - /** The data boundary definition. */ - dataBoundary?: DataBoundary; +/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ +export interface OperationListResult { /** - * Denotes the state of provisioning. + * List of operations supported by the resource provider * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provisioningState?: ProvisioningState; + readonly value?: Operation[]; + /** + * URL to get the next set of operation list results (if there are any). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; } -/** Common fields that are returned in the response for all Azure Resource Manager resources */ -export interface Resource { +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { /** - * Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; + readonly name?: string; /** - * The name of the resource + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplay; /** - * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; + readonly origin?: Origin; /** - * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly systemData?: SystemData; + readonly actionType?: ActionType; } -/** 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; +/** Localized display information for this particular operation. */ +export interface OperationDisplay { + /** + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provider?: string; + /** + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resource?: string; + /** + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly operation?: string; + /** + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; } /** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ @@ -108,6 +121,57 @@ export interface ErrorAdditionalInfo { readonly info?: Record; } +/** Data boundary properties */ +export interface DataBoundaryProperties { + /** The data boundary definition. */ + dataBoundary?: DataBoundary; + /** + * Denotes the state of provisioning. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** + * Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * 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; +} + /** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ export interface ProxyResource extends Resource {} @@ -117,6 +181,42 @@ export interface DataBoundaryDefinition extends ProxyResource { properties?: DataBoundaryProperties; } +/** Known values of {@link Origin} that the service accepts. */ +export enum KnownOrigin { + /** User */ + User = "user", + /** System */ + System = "system", + /** UserSystem */ + UserSystem = "user,system", +} + +/** + * Defines values for Origin. \ + * {@link KnownOrigin} can be used interchangeably with Origin, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user** \ + * **system** \ + * **user,system** + */ +export type Origin = string; + +/** Known values of {@link ActionType} that the service accepts. */ +export enum KnownActionType { + /** Internal */ + Internal = "Internal", +} + +/** + * Defines values for ActionType. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal** + */ +export type ActionType = string; + /** Known values of {@link DefaultName} that the service accepts. */ export enum KnownDefaultName { /** Default */ @@ -211,22 +311,31 @@ export enum KnownCreatedByType { export type CreatedByType = string; /** Optional parameters. */ -export interface DataBoundariesPutOptionalParams - extends coreClient.OperationOptions {} +export interface OperationsListOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; + +/** Optional parameters. */ +export interface DataBoundariesPutOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the put operation. */ export type DataBoundariesPutResponse = DataBoundaryDefinition; /** Optional parameters. */ -export interface DataBoundariesGetTenantOptionalParams - extends coreClient.OperationOptions {} +export interface DataBoundariesGetTenantOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the getTenant operation. */ export type DataBoundariesGetTenantResponse = DataBoundaryDefinition; /** Optional parameters. */ -export interface DataBoundariesGetScopeOptionalParams - extends coreClient.OperationOptions {} +export interface DataBoundariesGetScopeOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the getScope operation. */ export type DataBoundariesGetScopeResponse = DataBoundaryDefinition; diff --git a/sdk/databoundaries/arm-databoundaries/src/models/mappers.ts b/sdk/databoundaries/arm-databoundaries/src/models/mappers.ts index 9c5363c70d88..c3737b18b0c7 100644 --- a/sdk/databoundaries/arm-databoundaries/src/models/mappers.ts +++ b/sdk/databoundaries/arm-databoundaries/src/models/mappers.ts @@ -8,19 +8,26 @@ import * as coreClient from "@azure/core-client"; -export const DataBoundaryProperties: coreClient.CompositeMapper = { +export const OperationListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataBoundaryProperties", + className: "OperationListResult", modelProperties: { - dataBoundary: { - serializedName: "dataBoundary", + value: { + serializedName: "value", + readOnly: true, type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation", + }, + }, }, }, - provisioningState: { - serializedName: "provisioningState", + nextLink: { + serializedName: "nextLink", readOnly: true, type: { name: "String", @@ -30,84 +37,83 @@ export const DataBoundaryProperties: coreClient.CompositeMapper = { }, }; -export const Resource: coreClient.CompositeMapper = { +export const Operation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "Operation", modelProperties: { - id: { - serializedName: "id", + name: { + serializedName: "name", readOnly: true, type: { name: "String", }, }, - name: { - serializedName: "name", + isDataAction: { + serializedName: "isDataAction", readOnly: true, type: { - name: "String", + name: "Boolean", }, }, - type: { - serializedName: "type", + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay", + }, + }, + origin: { + serializedName: "origin", readOnly: true, type: { name: "String", }, }, - systemData: { - serializedName: "systemData", + actionType: { + serializedName: "actionType", + readOnly: true, type: { - name: "Composite", - className: "SystemData", + name: "String", }, }, }, }, }; -export const SystemData: coreClient.CompositeMapper = { +export const OperationDisplay: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SystemData", + className: "OperationDisplay", modelProperties: { - createdBy: { - serializedName: "createdBy", + provider: { + serializedName: "provider", + readOnly: true, type: { name: "String", }, }, - createdByType: { - serializedName: "createdByType", + resource: { + serializedName: "resource", + readOnly: true, type: { name: "String", }, }, - createdAt: { - serializedName: "createdAt", - type: { - name: "DateTime", - }, - }, - lastModifiedBy: { - serializedName: "lastModifiedBy", + operation: { + serializedName: "operation", + readOnly: true, type: { name: "String", }, }, - lastModifiedByType: { - serializedName: "lastModifiedByType", + description: { + serializedName: "description", + readOnly: true, type: { name: "String", }, }, - lastModifiedAt: { - serializedName: "lastModifiedAt", - type: { - name: "DateTime", - }, - }, }, }, }; @@ -208,6 +214,110 @@ export const ErrorAdditionalInfo: coreClient.CompositeMapper = { }, }; +export const DataBoundaryProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataBoundaryProperties", + modelProperties: { + dataBoundary: { + serializedName: "dataBoundary", + type: { + name: "String", + }, + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String", + }, + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String", + }, + }, + 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 ProxyResource: coreClient.CompositeMapper = { type: { name: "Composite", diff --git a/sdk/databoundaries/arm-databoundaries/src/models/parameters.ts b/sdk/databoundaries/arm-databoundaries/src/models/parameters.ts index 2db1a66c3a60..e92d69b2e49a 100644 --- a/sdk/databoundaries/arm-databoundaries/src/models/parameters.ts +++ b/sdk/databoundaries/arm-databoundaries/src/models/parameters.ts @@ -13,23 +13,6 @@ import { } from "@azure/core-client"; import { DataBoundaryDefinition as DataBoundaryDefinitionMapper } from "../models/mappers.js"; -export const contentType: OperationParameter = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/json", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String", - }, - }, -}; - -export const dataBoundaryDefinition: OperationParameter = { - parameterPath: "dataBoundaryDefinition", - mapper: DataBoundaryDefinitionMapper, -}; - export const accept: OperationParameter = { parameterPath: "accept", mapper: { @@ -66,6 +49,35 @@ export const apiVersion: OperationQueryParameter = { }, }; +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String", + }, + }, + skipEncoding: true, +}; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String", + }, + }, +}; + +export const dataBoundaryDefinition: OperationParameter = { + parameterPath: "dataBoundaryDefinition", + mapper: DataBoundaryDefinitionMapper, +}; + export const defaultParam: OperationURLParameter = { parameterPath: "defaultParam", mapper: { diff --git a/sdk/databoundaries/arm-databoundaries/src/operations/dataBoundaries.ts b/sdk/databoundaries/arm-databoundaries/src/operations/dataBoundaries.ts index ae770e3fe9bc..26c266548389 100644 --- a/sdk/databoundaries/arm-databoundaries/src/operations/dataBoundaries.ts +++ b/sdk/databoundaries/arm-databoundaries/src/operations/dataBoundaries.ts @@ -60,10 +60,7 @@ export class DataBoundariesImpl implements DataBoundaries { defaultParam: DefaultName, options?: DataBoundariesGetTenantOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { defaultParam, options }, - getTenantOperationSpec, - ); + return this.client.sendOperationRequest({ defaultParam, options }, getTenantOperationSpec); } /** @@ -103,7 +100,7 @@ const putOperationSpec: coreClient.OperationSpec = { requestBody: Parameters.dataBoundaryDefinition, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.defaultParam], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer, }; diff --git a/sdk/databoundaries/arm-databoundaries/src/operations/index.ts b/sdk/databoundaries/arm-databoundaries/src/operations/index.ts index 35498d6399ac..7486600af137 100644 --- a/sdk/databoundaries/arm-databoundaries/src/operations/index.ts +++ b/sdk/databoundaries/arm-databoundaries/src/operations/index.ts @@ -6,4 +6,5 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +export * from "./operations.js"; export * from "./dataBoundaries.js"; diff --git a/sdk/databoundaries/arm-databoundaries/src/operations/operations.ts b/sdk/databoundaries/arm-databoundaries/src/operations/operations.ts new file mode 100644 index 000000000000..595c17b181d8 --- /dev/null +++ b/sdk/databoundaries/arm-databoundaries/src/operations/operations.ts @@ -0,0 +1,142 @@ +/* + * 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 { Operations } 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 { DataboundariesManegementClient } from "../databoundariesManegementClient.js"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse, +} from "../models/index.js"; + +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: DataboundariesManegementClient; + + /** + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client + */ + constructor(client: DataboundariesManegementClient) { + this.client = client; + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * @param options The options parameters. + */ + public list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); + }, + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: OperationsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * @param options The options parameters. + */ + private _list(options?: OperationsListOptionalParams): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Resources/operations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/databoundaries/arm-databoundaries/src/operationsInterfaces/index.ts b/sdk/databoundaries/arm-databoundaries/src/operationsInterfaces/index.ts index 35498d6399ac..7486600af137 100644 --- a/sdk/databoundaries/arm-databoundaries/src/operationsInterfaces/index.ts +++ b/sdk/databoundaries/arm-databoundaries/src/operationsInterfaces/index.ts @@ -6,4 +6,5 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +export * from "./operations.js"; export * from "./dataBoundaries.js"; diff --git a/sdk/databoundaries/arm-databoundaries/src/operationsInterfaces/operations.ts b/sdk/databoundaries/arm-databoundaries/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..e09c02a0606b --- /dev/null +++ b/sdk/databoundaries/arm-databoundaries/src/operationsInterfaces/operations.ts @@ -0,0 +1,20 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operation, OperationsListOptionalParams } from "../models/index.js"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * Lists all of the available Microsoft.Resources REST API operations. + * @param options The options parameters. + */ + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} diff --git a/sdk/databoundaries/arm-databoundaries/src/pagingHelper.ts b/sdk/databoundaries/arm-databoundaries/src/pagingHelper.ts new file mode 100644 index 000000000000..e362819bdfc4 --- /dev/null +++ b/sdk/databoundaries/arm-databoundaries/src/pagingHelper.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +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/databoundaries/arm-databoundaries/test/sampleTest.spec.ts b/sdk/databoundaries/arm-databoundaries/test/sampleTest.spec.ts new file mode 100644 index 000000000000..90b3c8a868b4 --- /dev/null +++ b/sdk/databoundaries/arm-databoundaries/test/sampleTest.spec.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { Recorder, RecorderStartOptions } from "@azure-tools/test-recorder"; +import { afterEach, beforeEach, describe, it, assert } from "vitest"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async () => { + recorder = new Recorder(); + await recorder.start(recorderOptions); + }); + + afterEach(async () => { + await recorder.stop(); + }); + + it("sample test", async () => { + assert(true); + }); +}); diff --git a/sdk/databoundaries/arm-databoundaries/test/snippets.spec.ts b/sdk/databoundaries/arm-databoundaries/test/snippets.spec.ts index 18b146521ace..45edea8e642c 100644 --- a/sdk/databoundaries/arm-databoundaries/test/snippets.spec.ts +++ b/sdk/databoundaries/arm-databoundaries/test/snippets.spec.ts @@ -1,5 +1,10 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. +/* + * 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 { DataboundariesManegementClient } from "../src/index.js"; import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; @@ -8,18 +13,20 @@ import { describe, it } from "vitest"; describe("snippets", () => { it("ReadmeSampleCreateClient_Node", async () => { - const client = new DataboundariesManegementClient(new DefaultAzureCredential()); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new DataboundariesManegementClient(new DefaultAzureCredential(), subscriptionId); }); it("ReadmeSampleCreateClient_Browser", async () => { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", clientId: "", }); - const client = new DataboundariesManegementClient(credential); + const client = new DataboundariesManegementClient(credential, subscriptionId); }); it("SetLogLevel", async () => { setLogLevel("info"); }); -}); \ No newline at end of file +}); diff --git a/sdk/databoundaries/arm-databoundaries/tsconfig.browser.config.json b/sdk/databoundaries/arm-databoundaries/tsconfig.browser.config.json index 0c8bafa97126..75871518e3a0 100644 --- a/sdk/databoundaries/arm-databoundaries/tsconfig.browser.config.json +++ b/sdk/databoundaries/arm-databoundaries/tsconfig.browser.config.json @@ -1,6 +1,3 @@ { - "extends": [ - "./tsconfig.test.json", - "../../../tsconfig.browser.base.json" - ] + "extends": ["./tsconfig.test.json", "../../../tsconfig.browser.base.json"] } diff --git a/sdk/databoundaries/arm-databoundaries/tsconfig.json b/sdk/databoundaries/arm-databoundaries/tsconfig.json index 19ceb382b521..cf47dc3dd7fc 100644 --- a/sdk/databoundaries/arm-databoundaries/tsconfig.json +++ b/sdk/databoundaries/arm-databoundaries/tsconfig.json @@ -4,10 +4,31 @@ "path": "./tsconfig.src.json" }, { - "path": "./tsconfig.samples.json" + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.test.json" }, { "path": "./tsconfig.test.json" } ] -} +} \ No newline at end of file diff --git a/sdk/databoundaries/arm-databoundaries/tsconfig.samples.json b/sdk/databoundaries/arm-databoundaries/tsconfig.samples.json index e8b99452c64b..5bb762594557 100644 --- a/sdk/databoundaries/arm-databoundaries/tsconfig.samples.json +++ b/sdk/databoundaries/arm-databoundaries/tsconfig.samples.json @@ -2,9 +2,7 @@ "extends": "../../../tsconfig.samples.base.json", "compilerOptions": { "paths": { - "@azure/arm-databoundaries": [ - "./dist/esm" - ] + "@azure/arm-databoundaries": ["./dist/esm"] } } } diff --git a/sdk/databoundaries/arm-databoundaries/tsconfig.test.json b/sdk/databoundaries/arm-databoundaries/tsconfig.test.json index 3c2b783a8c1b..290ca214aebc 100644 --- a/sdk/databoundaries/arm-databoundaries/tsconfig.test.json +++ b/sdk/databoundaries/arm-databoundaries/tsconfig.test.json @@ -1,6 +1,3 @@ { - "extends": [ - "./tsconfig.src.json", - "../../../tsconfig.test.base.json" - ] + "extends": ["./tsconfig.src.json", "../../../tsconfig.test.base.json"] } diff --git a/sdk/features/arm-features/CHANGELOG.md b/sdk/features/arm-features/CHANGELOG.md index ed01550a1e65..7e8047ad9138 100644 --- a/sdk/features/arm-features/CHANGELOG.md +++ b/sdk/features/arm-features/CHANGELOG.md @@ -1,15 +1,12 @@ # Release History - -## 3.1.1 (Unreleased) - -### Features Added - + +## 4.0.0 (2025-04-28) + ### Breaking Changes -### Bugs Fixed - -### Other Changes - + - Class FeatureClient has a new signature + + ## 3.1.0 (2022-11-22) ### Features Added @@ -18,7 +15,7 @@ ## 3.0.1 (2022-04-18) -### Features Added +**features** - Bug fix @@ -30,4 +27,4 @@ To understand the detail of the change, please refer to [Changelog](https://aka. To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). -To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ). +To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart). diff --git a/sdk/features/arm-features/LICENSE b/sdk/features/arm-features/LICENSE index b2f52a2bad4e..63447fd8bbbf 100644 --- a/sdk/features/arm-features/LICENSE +++ b/sdk/features/arm-features/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/features/arm-features/README.md b/sdk/features/arm-features/README.md index 2e4debc8ffa3..cab2a542aedf 100644 --- a/sdk/features/arm-features/README.md +++ b/sdk/features/arm-features/README.md @@ -44,7 +44,6 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure Feature** 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 +63,14 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur import { InteractiveBrowserCredential } from "@azure/identity"; import { FeatureClient } from "@azure/arm-features"; -const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", - clientId: "", -}); + clientId: "" + }); const client = new FeatureClient(credential, subscriptionId); ``` ### JavaScript Bundle - To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). ## Key concepts @@ -109,7 +106,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/ diff --git a/sdk/features/arm-features/_meta.json b/sdk/features/arm-features/_meta.json index 2c0805caf40d..c37acc89bcac 100644 --- a/sdk/features/arm-features/_meta.json +++ b/sdk/features/arm-features/_meta.json @@ -1,8 +1,8 @@ { - "commit": "a42f1b58607091c4f255ead152a8ef323fa0b280", - "readme": "specification\\resources\\resource-manager\\readme.md", - "autorest_command": "autorest --version=3.8.4 --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.0-rc.3.20221108.1 --generate-sample=true", + "commit": "fcbc290cc06b0d69207105d83bb7dac49c21675b", + "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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/resources/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", - "use": "@autorest/typescript@6.0.0-rc.3.20221108.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.26", + "use": "@autorest/typescript@^6.0.12" } diff --git a/sdk/features/arm-features/api-extractor.json b/sdk/features/arm-features/api-extractor.json index 600702b41d91..40318de5cdd7 100644 --- a/sdk/features/arm-features/api-extractor.json +++ b/sdk/features/arm-features/api-extractor.json @@ -28,4 +28,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/features/arm-features/package.json b/sdk/features/arm-features/package.json index 9a3e0097e4eb..42e67bda21f4 100644 --- a/sdk/features/arm-features/package.json +++ b/sdk/features/arm-features/package.json @@ -3,15 +3,15 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for FeatureClient.", - "version": "3.1.1", + "version": "4.0.0", "engines": { "node": ">=18.0.0" }, "dependencies": { "@azure/core-auth": "^1.9.0", - "@azure/core-client": "^1.9.2", + "@azure/core-client": "^1.9.3", "@azure/core-paging": "^1.6.2", - "@azure/core-rest-pipeline": "^1.18.2", + "@azure/core-rest-pipeline": "^1.19.1", "tslib": "^2.8.1" }, "keywords": [ @@ -26,21 +26,22 @@ "main": "./dist/commonjs/index.js", "module": "./dist/esm/index.js", "types": "./dist/commonjs/index.d.ts", + "type": "module", "devDependencies": { "@azure-tools/test-credential": "^2.0.0", "@azure-tools/test-recorder": "^4.1.0", "@azure-tools/test-utils-vitest": "^1.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.6.0", + "@azure/identity": "^4.9.1", "@azure/logger": "^1.1.4", "@types/node": "^18.0.0", "@vitest/browser": "^3.0.9", "@vitest/coverage-istanbul": "^3.0.9", - "playwright": "^1.50.1", + "dotenv": "^16.0.0", + "playwright": "^1.52.0", "typescript": "~5.8.2", "vitest": "^3.0.9" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/features/arm-features", "repository": "github:Azure/azure-sdk-for-js", "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" @@ -58,16 +59,16 @@ "build:node": "echo skipped", "build:samples": "echo skipped.", "build:test": "echo skipped", - "check-format": "echo skipped", + "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", "clean": "dev-tool run vendored 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", + "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "integration-test:browser": "echo skipped", "integration-test:node": "dev-tool run test:vitest --esm", "lint": "echo skipped", - "minify": "echo skipped", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", "pack": "npm pack 2>&1", "prepack": "npm run build", "test": "npm run integration-test", @@ -88,15 +89,9 @@ ] }, "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-features?view=azure-node-preview" - }, - "type": "module", + "browser": "./dist/browser/index.js", + "react-native": "./dist/react-native/index.js", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/features/arm-features", "tshy": { "project": "./tsconfig.src.json", "exports": { @@ -113,8 +108,6 @@ ], "selfLink": false }, - "browser": "./dist/browser/index.js", - "react-native": "./dist/react-native/index.js", "exports": { "./package.json": "./package.json", ".": { @@ -136,4 +129,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/features/arm-features/review/arm-features.api.md b/sdk/features/arm-features/review/arm-features.api.md index 89f95f572452..b011cb9640a5 100644 --- a/sdk/features/arm-features/review/arm-features.api.md +++ b/sdk/features/arm-features/review/arm-features.api.md @@ -34,6 +34,7 @@ export class FeatureClient extends coreClient.ServiceClient { // (undocumented) $host: string; constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: FeatureClientOptionalParams); + constructor(credentials: coreAuth.TokenCredential, options?: FeatureClientOptionalParams); // (undocumented) apiVersion: string; // (undocumented) @@ -42,7 +43,7 @@ export class FeatureClient extends coreClient.ServiceClient { // (undocumented) subscriptionFeatureRegistrations: SubscriptionFeatureRegistrations; // (undocumented) - subscriptionId: string; + subscriptionId?: string; } // @public diff --git a/sdk/features/arm-features/sample.env b/sdk/features/arm-features/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/features/arm-features/sample.env +++ b/sdk/features/arm-features/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/features/arm-features/src/featureClient.ts b/sdk/features/arm-features/src/featureClient.ts index 332548e410cd..9032588eba13 100644 --- a/sdk/features/arm-features/src/featureClient.ts +++ b/sdk/features/arm-features/src/featureClient.ts @@ -8,22 +8,12 @@ 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 { PipelineRequest, PipelineResponse, SendRequest } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { setContinuationToken } from "./pagingHelper.js"; -import { - FeaturesImpl, - SubscriptionFeatureRegistrationsImpl -} from "./operations/index.js"; -import { - Features, - SubscriptionFeatureRegistrations -} from "./operationsInterfaces/index.js"; +import { FeaturesImpl, SubscriptionFeatureRegistrationsImpl } from "./operations/index.js"; +import { Features, SubscriptionFeatureRegistrations } from "./operationsInterfaces/index.js"; import * as Parameters from "./models/parameters.js"; import * as Mappers from "./models/mappers.js"; import { @@ -32,14 +22,14 @@ import { ListOperationsNextOptionalParams, ListOperationsOptionalParams, ListOperationsResponse, - ListOperationsNextResponse + ListOperationsNextResponse, } from "./models/index.js"; /// export class FeatureClient extends coreClient.ServiceClient { $host: string; apiVersion: string; - subscriptionId: string; + subscriptionId?: string; /** * Initializes a new instance of the FeatureClient class. @@ -50,13 +40,24 @@ export class FeatureClient extends coreClient.ServiceClient { constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: FeatureClientOptionalParams + options?: FeatureClientOptionalParams, + ); + constructor(credentials: coreAuth.TokenCredential, options?: FeatureClientOptionalParams); + constructor( + credentials: coreAuth.TokenCredential, + subscriptionIdOrOptions?: FeatureClientOptionalParams | string, + options?: FeatureClientOptionalParams, ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); } - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); + + let subscriptionId: string | undefined; + + if (typeof subscriptionIdOrOptions === "string") { + subscriptionId = subscriptionIdOrOptions; + } else if (typeof subscriptionIdOrOptions === "object") { + options = subscriptionIdOrOptions; } // Initializing default values for options @@ -65,10 +66,10 @@ export class FeatureClient extends coreClient.ServiceClient { } const defaults: FeatureClientOptionalParams = { requestContentType: "application/json; charset=utf-8", - credential: credentials + credential: credentials, }; - const packageDetails = `azsdk-js-arm-features/3.1.1`; + const packageDetails = `azsdk-js-arm-features/4.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -78,20 +79,19 @@ export class FeatureClient extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, - endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + 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(); + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => - pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName + pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -101,19 +101,17 @@ export class FeatureClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ credential: credentials, scopes: - optionsWithDefaults.credentialScopes ?? - `${optionsWithDefaults.endpoint}/.default`, + optionsWithDefaults.credentialScopes ?? `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -123,9 +121,7 @@ export class FeatureClient extends coreClient.ServiceClient { this.$host = options.$host || "https://management.azure.com"; this.apiVersion = options.apiVersion || "2021-07-01"; this.features = new FeaturesImpl(this); - this.subscriptionFeatureRegistrations = new SubscriptionFeatureRegistrationsImpl( - this - ); + this.subscriptionFeatureRegistrations = new SubscriptionFeatureRegistrationsImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -136,10 +132,7 @@ export class FeatureClient extends coreClient.ServiceClient { } const apiVersionPolicy = { name: "CustomApiVersionPolicy", - async sendRequest( - request: PipelineRequest, - next: SendRequest - ): Promise { + async sendRequest(request: PipelineRequest, next: SendRequest): Promise { const param = request.url.split("?"); if (param.length > 1) { const newParams = param[1].split("&").map((item) => { @@ -152,7 +145,7 @@ export class FeatureClient extends coreClient.ServiceClient { request.url = param[0] + "?" + newParams.join("&"); } return next(request); - } + }, }; this.pipeline.addPolicy(apiVersionPolicy); } @@ -162,7 +155,7 @@ export class FeatureClient extends coreClient.ServiceClient { * @param options The options parameters. */ public listOperations( - options?: ListOperationsOptionalParams + options?: ListOperationsOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listOperationsPagingAll(options); return { @@ -177,13 +170,13 @@ export class FeatureClient extends coreClient.ServiceClient { throw new Error("maxPageSize is not supported by this operation."); } return this.listOperationsPagingPage(options, settings); - } + }, }; } private async *listOperationsPagingPage( options?: ListOperationsOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ListOperationsResponse; let continuationToken = settings?.continuationToken; @@ -204,7 +197,7 @@ export class FeatureClient extends coreClient.ServiceClient { } private async *listOperationsPagingAll( - options?: ListOperationsOptionalParams + options?: ListOperationsOptionalParams, ): AsyncIterableIterator { for await (const page of this.listOperationsPagingPage(options)) { yield* page; @@ -215,9 +208,7 @@ export class FeatureClient extends coreClient.ServiceClient { * Lists all of the available Microsoft.Features REST API operations. * @param options The options parameters. */ - private _listOperations( - options?: ListOperationsOptionalParams - ): Promise { + private _listOperations(options?: ListOperationsOptionalParams): Promise { return this.sendOperationRequest({ options }, listOperationsOperationSpec); } @@ -228,12 +219,9 @@ export class FeatureClient extends coreClient.ServiceClient { */ private _listOperationsNext( nextLink: string, - options?: ListOperationsNextOptionalParams + options?: ListOperationsNextOptionalParams, ): Promise { - return this.sendOperationRequest( - { nextLink, options }, - listOperationsNextOperationSpec - ); + return this.sendOperationRequest({ nextLink, options }, listOperationsNextOperationSpec); } features: Features; @@ -247,30 +235,29 @@ const listOperationsOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; const listOperationsNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/features/arm-features/src/models/index.ts b/sdk/features/arm-features/src/models/index.ts index 860adc9f14fa..39bbc0ae5af9 100644 --- a/sdk/features/arm-features/src/models/index.ts +++ b/sdk/features/arm-features/src/models/index.ts @@ -216,7 +216,7 @@ export enum KnownSubscriptionFeatureRegistrationState { /** Unregistering */ Unregistering = "Unregistering", /** Unregistered */ - Unregistered = "Unregistered" + Unregistered = "Unregistered", } /** @@ -241,7 +241,7 @@ export enum KnownSubscriptionFeatureRegistrationApprovalType { /** ApprovalRequired */ ApprovalRequired = "ApprovalRequired", /** AutoApproval */ - AutoApproval = "AutoApproval" + AutoApproval = "AutoApproval", } /** @@ -256,64 +256,55 @@ export enum KnownSubscriptionFeatureRegistrationApprovalType { export type SubscriptionFeatureRegistrationApprovalType = string; /** Optional parameters. */ -export interface ListOperationsOptionalParams - extends coreClient.OperationOptions {} +export interface ListOperationsOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listOperations operation. */ export type ListOperationsResponse = OperationListResult; /** Optional parameters. */ -export interface ListOperationsNextOptionalParams - extends coreClient.OperationOptions {} +export interface ListOperationsNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listOperationsNext operation. */ export type ListOperationsNextResponse = OperationListResult; /** Optional parameters. */ -export interface FeaturesListAllOptionalParams - extends coreClient.OperationOptions {} +export interface FeaturesListAllOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listAll operation. */ export type FeaturesListAllResponse = FeatureOperationsListResult; /** Optional parameters. */ -export interface FeaturesListOptionalParams - extends coreClient.OperationOptions {} +export interface FeaturesListOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the list operation. */ export type FeaturesListResponse = FeatureOperationsListResult; /** Optional parameters. */ -export interface FeaturesGetOptionalParams - extends coreClient.OperationOptions {} +export interface FeaturesGetOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ export type FeaturesGetResponse = FeatureResult; /** Optional parameters. */ -export interface FeaturesRegisterOptionalParams - extends coreClient.OperationOptions {} +export interface FeaturesRegisterOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the register operation. */ export type FeaturesRegisterResponse = FeatureResult; /** Optional parameters. */ -export interface FeaturesUnregisterOptionalParams - extends coreClient.OperationOptions {} +export interface FeaturesUnregisterOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the unregister operation. */ export type FeaturesUnregisterResponse = FeatureResult; /** Optional parameters. */ -export interface FeaturesListAllNextOptionalParams - extends coreClient.OperationOptions {} +export interface FeaturesListAllNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listAllNext operation. */ export type FeaturesListAllNextResponse = FeatureOperationsListResult; /** Optional parameters. */ -export interface FeaturesListNextOptionalParams - extends coreClient.OperationOptions {} +export interface FeaturesListNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type FeaturesListNextResponse = FeatureOperationsListResult; @@ -333,7 +324,8 @@ export interface SubscriptionFeatureRegistrationsCreateOrUpdateOptionalParams } /** Contains response data for the createOrUpdate operation. */ -export type SubscriptionFeatureRegistrationsCreateOrUpdateResponse = SubscriptionFeatureRegistration; +export type SubscriptionFeatureRegistrationsCreateOrUpdateResponse = + SubscriptionFeatureRegistration; /** Optional parameters. */ export interface SubscriptionFeatureRegistrationsDeleteOptionalParams @@ -344,32 +336,35 @@ export interface SubscriptionFeatureRegistrationsListBySubscriptionOptionalParam extends coreClient.OperationOptions {} /** Contains response data for the listBySubscription operation. */ -export type SubscriptionFeatureRegistrationsListBySubscriptionResponse = SubscriptionFeatureRegistrationList; +export type SubscriptionFeatureRegistrationsListBySubscriptionResponse = + SubscriptionFeatureRegistrationList; /** Optional parameters. */ export interface SubscriptionFeatureRegistrationsListAllBySubscriptionOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listAllBySubscription operation. */ -export type SubscriptionFeatureRegistrationsListAllBySubscriptionResponse = SubscriptionFeatureRegistrationList; +export type SubscriptionFeatureRegistrationsListAllBySubscriptionResponse = + SubscriptionFeatureRegistrationList; /** Optional parameters. */ export interface SubscriptionFeatureRegistrationsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listBySubscriptionNext operation. */ -export type SubscriptionFeatureRegistrationsListBySubscriptionNextResponse = SubscriptionFeatureRegistrationList; +export type SubscriptionFeatureRegistrationsListBySubscriptionNextResponse = + SubscriptionFeatureRegistrationList; /** Optional parameters. */ export interface SubscriptionFeatureRegistrationsListAllBySubscriptionNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listAllBySubscriptionNext operation. */ -export type SubscriptionFeatureRegistrationsListAllBySubscriptionNextResponse = SubscriptionFeatureRegistrationList; +export type SubscriptionFeatureRegistrationsListAllBySubscriptionNextResponse = + SubscriptionFeatureRegistrationList; /** Optional parameters. */ -export interface FeatureClientOptionalParams - extends coreClient.ServiceClientOptions { +export interface FeatureClientOptionalParams extends coreClient.ServiceClientOptions { /** server parameter */ $host?: string; /** Api Version */ diff --git a/sdk/features/arm-features/src/models/mappers.ts b/sdk/features/arm-features/src/models/mappers.ts index 3c1185f9501a..747b26e6281d 100644 --- a/sdk/features/arm-features/src/models/mappers.ts +++ b/sdk/features/arm-features/src/models/mappers.ts @@ -20,19 +20,19 @@ export const OperationListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Operation" - } - } - } + className: "Operation", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Operation: coreClient.CompositeMapper = { @@ -43,18 +43,18 @@ export const Operation: coreClient.CompositeMapper = { name: { serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, display: { serializedName: "display", type: { name: "Composite", - className: "OperationDisplay" - } - } - } - } + className: "OperationDisplay", + }, + }, + }, + }, }; export const OperationDisplay: coreClient.CompositeMapper = { @@ -65,23 +65,23 @@ export const OperationDisplay: coreClient.CompositeMapper = { provider: { serializedName: "provider", type: { - name: "String" - } + name: "String", + }, }, resource: { serializedName: "resource", type: { - name: "String" - } + name: "String", + }, }, operation: { serializedName: "operation", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ErrorResponse: coreClient.CompositeMapper = { @@ -93,11 +93,11 @@ export const ErrorResponse: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorDefinition" - } - } - } - } + className: "ErrorDefinition", + }, + }, + }, + }, }; export const ErrorDefinition: coreClient.CompositeMapper = { @@ -109,15 +109,15 @@ export const ErrorDefinition: coreClient.CompositeMapper = { serializedName: "code", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, message: { serializedName: "message", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, details: { serializedName: "details", @@ -126,13 +126,13 @@ export const ErrorDefinition: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorDefinition" - } - } - } - } - } - } + className: "ErrorDefinition", + }, + }, + }, + }, + }, + }, }; export const FeatureOperationsListResult: coreClient.CompositeMapper = { @@ -147,19 +147,19 @@ export const FeatureOperationsListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "FeatureResult" - } - } - } + className: "FeatureResult", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const FeatureResult: coreClient.CompositeMapper = { @@ -170,30 +170,30 @@ export const FeatureResult: coreClient.CompositeMapper = { name: { serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, properties: { serializedName: "properties", type: { name: "Composite", - className: "FeatureProperties" - } + className: "FeatureProperties", + }, }, id: { serializedName: "id", type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const FeatureProperties: coreClient.CompositeMapper = { @@ -204,11 +204,11 @@ export const FeatureProperties: coreClient.CompositeMapper = { state: { serializedName: "state", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const SubscriptionFeatureRegistrationProperties: coreClient.CompositeMapper = { @@ -220,106 +220,109 @@ export const SubscriptionFeatureRegistrationProperties: coreClient.CompositeMapp serializedName: "tenantId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, subscriptionId: { serializedName: "subscriptionId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, featureName: { serializedName: "featureName", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, displayName: { serializedName: "displayName", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, providerNamespace: { serializedName: "providerNamespace", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, state: { serializedName: "state", type: { - name: "String" - } + name: "String", + }, }, authorizationProfile: { serializedName: "authorizationProfile", type: { name: "Composite", - className: "AuthorizationProfile" - } + className: "AuthorizationProfile", + }, }, metadata: { serializedName: "metadata", type: { name: "Dictionary", - value: { type: { name: "String" }, constraints: { MaxLength: 1000 } } - } + value: { + type: { name: "String" }, + constraints: { MaxLength: 1000 }, + }, + }, }, releaseDate: { serializedName: "releaseDate", readOnly: true, type: { - name: "DateTime" - } + name: "DateTime", + }, }, registrationDate: { serializedName: "registrationDate", readOnly: true, type: { - name: "DateTime" - } + name: "DateTime", + }, }, documentationLink: { constraints: { - MaxLength: 1000 + MaxLength: 1000, }, serializedName: "documentationLink", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, approvalType: { serializedName: "approvalType", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, shouldFeatureDisplayInPortal: { defaultValue: false, serializedName: "shouldFeatureDisplayInPortal", type: { - name: "Boolean" - } + name: "Boolean", + }, }, description: { constraints: { - MaxLength: 1000 + MaxLength: 1000, }, serializedName: "description", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const AuthorizationProfile: coreClient.CompositeMapper = { @@ -331,39 +334,39 @@ export const AuthorizationProfile: coreClient.CompositeMapper = { serializedName: "requestedTime", readOnly: true, type: { - name: "DateTime" - } + name: "DateTime", + }, }, requester: { serializedName: "requester", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, requesterObjectId: { serializedName: "requesterObjectId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, approvedTime: { serializedName: "approvedTime", readOnly: true, type: { - name: "DateTime" - } + name: "DateTime", + }, }, approver: { serializedName: "approver", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ProxyResource: coreClient.CompositeMapper = { @@ -375,25 +378,25 @@ export const ProxyResource: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const SubscriptionFeatureRegistrationList: coreClient.CompositeMapper = { @@ -404,8 +407,8 @@ export const SubscriptionFeatureRegistrationList: coreClient.CompositeMapper = { nextLink: { serializedName: "nextLink", type: { - name: "String" - } + name: "String", + }, }, value: { serializedName: "value", @@ -414,13 +417,13 @@ export const SubscriptionFeatureRegistrationList: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "SubscriptionFeatureRegistration" - } - } - } - } - } - } + className: "SubscriptionFeatureRegistration", + }, + }, + }, + }, + }, + }, }; export const SubscriptionFeatureRegistration: coreClient.CompositeMapper = { @@ -433,9 +436,9 @@ export const SubscriptionFeatureRegistration: coreClient.CompositeMapper = { serializedName: "properties", type: { name: "Composite", - className: "SubscriptionFeatureRegistrationProperties" - } - } - } - } + className: "SubscriptionFeatureRegistrationProperties", + }, + }, + }, + }, }; diff --git a/sdk/features/arm-features/src/models/parameters.ts b/sdk/features/arm-features/src/models/parameters.ts index a63b1ccfe402..784aae5e9892 100644 --- a/sdk/features/arm-features/src/models/parameters.ts +++ b/sdk/features/arm-features/src/models/parameters.ts @@ -9,7 +9,7 @@ import { OperationParameter, OperationURLParameter, - OperationQueryParameter + OperationQueryParameter, } from "@azure/core-client"; import { SubscriptionFeatureRegistration as SubscriptionFeatureRegistrationMapper } from "../models/mappers.js"; @@ -20,9 +20,9 @@ export const accept: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const $host: OperationURLParameter = { @@ -31,10 +31,10 @@ export const $host: OperationURLParameter = { serializedName: "$host", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const apiVersion: OperationQueryParameter = { @@ -44,9 +44,9 @@ export const apiVersion: OperationQueryParameter = { isConstant: true, serializedName: "api-version", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const nextLink: OperationURLParameter = { @@ -55,10 +55,10 @@ export const nextLink: OperationURLParameter = { serializedName: "nextLink", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const subscriptionId: OperationURLParameter = { @@ -67,9 +67,9 @@ export const subscriptionId: OperationURLParameter = { serializedName: "subscriptionId", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const resourceProviderNamespace: OperationURLParameter = { @@ -78,9 +78,9 @@ export const resourceProviderNamespace: OperationURLParameter = { serializedName: "resourceProviderNamespace", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const featureName: OperationURLParameter = { @@ -89,9 +89,9 @@ export const featureName: OperationURLParameter = { serializedName: "featureName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const accept1: OperationParameter = { @@ -101,9 +101,9 @@ export const accept1: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const providerNamespace: OperationURLParameter = { @@ -112,9 +112,9 @@ export const providerNamespace: OperationURLParameter = { serializedName: "providerNamespace", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const contentType: OperationParameter = { @@ -124,12 +124,12 @@ export const contentType: OperationParameter = { isConstant: true, serializedName: "Content-Type", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const subscriptionFeatureRegistrationType: OperationParameter = { parameterPath: ["options", "subscriptionFeatureRegistrationType"], - mapper: SubscriptionFeatureRegistrationMapper + mapper: SubscriptionFeatureRegistrationMapper, }; diff --git a/sdk/features/arm-features/src/operations/features.ts b/sdk/features/arm-features/src/operations/features.ts index 60e960466f00..6cc848592658 100644 --- a/sdk/features/arm-features/src/operations/features.ts +++ b/sdk/features/arm-features/src/operations/features.ts @@ -28,7 +28,7 @@ import { FeaturesUnregisterOptionalParams, FeaturesUnregisterResponse, FeaturesListAllNextResponse, - FeaturesListNextResponse + FeaturesListNextResponse, } from "../models/index.js"; /// @@ -49,7 +49,7 @@ export class FeaturesImpl implements Features { * @param options The options parameters. */ public listAll( - options?: FeaturesListAllOptionalParams + options?: FeaturesListAllOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listAllPagingAll(options); return { @@ -64,13 +64,13 @@ export class FeaturesImpl implements Features { throw new Error("maxPageSize is not supported by this operation."); } return this.listAllPagingPage(options, settings); - } + }, }; } private async *listAllPagingPage( options?: FeaturesListAllOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: FeaturesListAllResponse; let continuationToken = settings?.continuationToken; @@ -91,7 +91,7 @@ export class FeaturesImpl implements Features { } private async *listAllPagingAll( - options?: FeaturesListAllOptionalParams + options?: FeaturesListAllOptionalParams, ): AsyncIterableIterator { for await (const page of this.listAllPagingPage(options)) { yield* page; @@ -106,7 +106,7 @@ export class FeaturesImpl implements Features { */ public list( resourceProviderNamespace: string, - options?: FeaturesListOptionalParams + options?: FeaturesListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(resourceProviderNamespace, options); return { @@ -120,19 +120,15 @@ export class FeaturesImpl implements Features { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listPagingPage( - resourceProviderNamespace, - options, - settings - ); - } + return this.listPagingPage(resourceProviderNamespace, options, settings); + }, }; } private async *listPagingPage( resourceProviderNamespace: string, options?: FeaturesListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: FeaturesListResponse; let continuationToken = settings?.continuationToken; @@ -144,11 +140,7 @@ export class FeaturesImpl implements Features { yield page; } while (continuationToken) { - result = await this._listNext( - resourceProviderNamespace, - continuationToken, - options - ); + result = await this._listNext(resourceProviderNamespace, continuationToken, options); continuationToken = result.nextLink; let page = result.value || []; setContinuationToken(page, continuationToken); @@ -158,12 +150,9 @@ export class FeaturesImpl implements Features { private async *listPagingAll( resourceProviderNamespace: string, - options?: FeaturesListOptionalParams + options?: FeaturesListOptionalParams, ): AsyncIterableIterator { - for await (const page of this.listPagingPage( - resourceProviderNamespace, - options - )) { + for await (const page of this.listPagingPage(resourceProviderNamespace, options)) { yield* page; } } @@ -172,9 +161,7 @@ export class FeaturesImpl implements Features { * Gets all the preview features that are available through AFEC for the subscription. * @param options The options parameters. */ - private _listAll( - options?: FeaturesListAllOptionalParams - ): Promise { + private _listAll(options?: FeaturesListAllOptionalParams): Promise { return this.client.sendOperationRequest({ options }, listAllOperationSpec); } @@ -186,11 +173,11 @@ export class FeaturesImpl implements Features { */ private _list( resourceProviderNamespace: string, - options?: FeaturesListOptionalParams + options?: FeaturesListOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceProviderNamespace, options }, - listOperationSpec + listOperationSpec, ); } @@ -203,11 +190,11 @@ export class FeaturesImpl implements Features { get( resourceProviderNamespace: string, featureName: string, - options?: FeaturesGetOptionalParams + options?: FeaturesGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceProviderNamespace, featureName, options }, - getOperationSpec + getOperationSpec, ); } @@ -220,11 +207,11 @@ export class FeaturesImpl implements Features { register( resourceProviderNamespace: string, featureName: string, - options?: FeaturesRegisterOptionalParams + options?: FeaturesRegisterOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceProviderNamespace, featureName, options }, - registerOperationSpec + registerOperationSpec, ); } @@ -237,11 +224,11 @@ export class FeaturesImpl implements Features { unregister( resourceProviderNamespace: string, featureName: string, - options?: FeaturesUnregisterOptionalParams + options?: FeaturesUnregisterOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceProviderNamespace, featureName, options }, - unregisterOperationSpec + unregisterOperationSpec, ); } @@ -252,12 +239,9 @@ export class FeaturesImpl implements Features { */ private _listAllNext( nextLink: string, - options?: FeaturesListAllNextOptionalParams + options?: FeaturesListAllNextOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listAllNextOperationSpec - ); + return this.client.sendOperationRequest({ nextLink, options }, listAllNextOperationSpec); } /** @@ -269,11 +253,11 @@ export class FeaturesImpl implements Features { private _listNext( resourceProviderNamespace: string, nextLink: string, - options?: FeaturesListNextOptionalParams + options?: FeaturesListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceProviderNamespace, nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -285,142 +269,132 @@ const listAllOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.FeatureOperationsListResult + bodyMapper: Mappers.FeatureOperationsListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.FeatureOperationsListResult + bodyMapper: Mappers.FeatureOperationsListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceProviderNamespace + Parameters.resourceProviderNamespace, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.FeatureResult + bodyMapper: Mappers.FeatureResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceProviderNamespace, - Parameters.featureName + Parameters.featureName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const registerOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}/register", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}/register", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.FeatureResult + bodyMapper: Mappers.FeatureResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceProviderNamespace, - Parameters.featureName + Parameters.featureName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const unregisterOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}/unregister", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}/unregister", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.FeatureResult + bodyMapper: Mappers.FeatureResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceProviderNamespace, - Parameters.featureName + Parameters.featureName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAllNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.FeatureOperationsListResult + bodyMapper: Mappers.FeatureOperationsListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId - ], + urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.FeatureOperationsListResult + bodyMapper: Mappers.FeatureOperationsListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.nextLink, Parameters.subscriptionId, - Parameters.resourceProviderNamespace + Parameters.resourceProviderNamespace, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/features/arm-features/src/operations/subscriptionFeatureRegistrations.ts b/sdk/features/arm-features/src/operations/subscriptionFeatureRegistrations.ts index 282d7629fc86..b527175d3045 100644 --- a/sdk/features/arm-features/src/operations/subscriptionFeatureRegistrations.ts +++ b/sdk/features/arm-features/src/operations/subscriptionFeatureRegistrations.ts @@ -27,13 +27,12 @@ import { SubscriptionFeatureRegistrationsCreateOrUpdateResponse, SubscriptionFeatureRegistrationsDeleteOptionalParams, SubscriptionFeatureRegistrationsListBySubscriptionNextResponse, - SubscriptionFeatureRegistrationsListAllBySubscriptionNextResponse + SubscriptionFeatureRegistrationsListAllBySubscriptionNextResponse, } from "../models/index.js"; /// /** Class containing SubscriptionFeatureRegistrations operations. */ -export class SubscriptionFeatureRegistrationsImpl - implements SubscriptionFeatureRegistrations { +export class SubscriptionFeatureRegistrationsImpl implements SubscriptionFeatureRegistrations { private readonly client: FeatureClient; /** @@ -51,7 +50,7 @@ export class SubscriptionFeatureRegistrationsImpl */ public listBySubscription( providerNamespace: string, - options?: SubscriptionFeatureRegistrationsListBySubscriptionOptionalParams + options?: SubscriptionFeatureRegistrationsListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listBySubscriptionPagingAll(providerNamespace, options); return { @@ -65,19 +64,15 @@ export class SubscriptionFeatureRegistrationsImpl if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listBySubscriptionPagingPage( - providerNamespace, - options, - settings - ); - } + return this.listBySubscriptionPagingPage(providerNamespace, options, settings); + }, }; } private async *listBySubscriptionPagingPage( providerNamespace: string, options?: SubscriptionFeatureRegistrationsListBySubscriptionOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: SubscriptionFeatureRegistrationsListBySubscriptionResponse; let continuationToken = settings?.continuationToken; @@ -89,11 +84,7 @@ export class SubscriptionFeatureRegistrationsImpl yield page; } while (continuationToken) { - result = await this._listBySubscriptionNext( - providerNamespace, - continuationToken, - options - ); + result = await this._listBySubscriptionNext(providerNamespace, continuationToken, options); continuationToken = result.nextLink; let page = result.value || []; setContinuationToken(page, continuationToken); @@ -103,12 +94,9 @@ export class SubscriptionFeatureRegistrationsImpl private async *listBySubscriptionPagingAll( providerNamespace: string, - options?: SubscriptionFeatureRegistrationsListBySubscriptionOptionalParams + options?: SubscriptionFeatureRegistrationsListBySubscriptionOptionalParams, ): AsyncIterableIterator { - for await (const page of this.listBySubscriptionPagingPage( - providerNamespace, - options - )) { + for await (const page of this.listBySubscriptionPagingPage(providerNamespace, options)) { yield* page; } } @@ -118,7 +106,7 @@ export class SubscriptionFeatureRegistrationsImpl * @param options The options parameters. */ public listAllBySubscription( - options?: SubscriptionFeatureRegistrationsListAllBySubscriptionOptionalParams + options?: SubscriptionFeatureRegistrationsListAllBySubscriptionOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listAllBySubscriptionPagingAll(options); return { @@ -133,13 +121,13 @@ export class SubscriptionFeatureRegistrationsImpl throw new Error("maxPageSize is not supported by this operation."); } return this.listAllBySubscriptionPagingPage(options, settings); - } + }, }; } private async *listAllBySubscriptionPagingPage( options?: SubscriptionFeatureRegistrationsListAllBySubscriptionOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: SubscriptionFeatureRegistrationsListAllBySubscriptionResponse; let continuationToken = settings?.continuationToken; @@ -151,10 +139,7 @@ export class SubscriptionFeatureRegistrationsImpl yield page; } while (continuationToken) { - result = await this._listAllBySubscriptionNext( - continuationToken, - options - ); + result = await this._listAllBySubscriptionNext(continuationToken, options); continuationToken = result.nextLink; let page = result.value || []; setContinuationToken(page, continuationToken); @@ -163,7 +148,7 @@ export class SubscriptionFeatureRegistrationsImpl } private async *listAllBySubscriptionPagingAll( - options?: SubscriptionFeatureRegistrationsListAllBySubscriptionOptionalParams + options?: SubscriptionFeatureRegistrationsListAllBySubscriptionOptionalParams, ): AsyncIterableIterator { for await (const page of this.listAllBySubscriptionPagingPage(options)) { yield* page; @@ -179,11 +164,11 @@ export class SubscriptionFeatureRegistrationsImpl get( providerNamespace: string, featureName: string, - options?: SubscriptionFeatureRegistrationsGetOptionalParams + options?: SubscriptionFeatureRegistrationsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { providerNamespace, featureName, options }, - getOperationSpec + getOperationSpec, ); } @@ -196,11 +181,11 @@ export class SubscriptionFeatureRegistrationsImpl createOrUpdate( providerNamespace: string, featureName: string, - options?: SubscriptionFeatureRegistrationsCreateOrUpdateOptionalParams + options?: SubscriptionFeatureRegistrationsCreateOrUpdateOptionalParams, ): Promise { return this.client.sendOperationRequest( { providerNamespace, featureName, options }, - createOrUpdateOperationSpec + createOrUpdateOperationSpec, ); } @@ -213,11 +198,11 @@ export class SubscriptionFeatureRegistrationsImpl delete( providerNamespace: string, featureName: string, - options?: SubscriptionFeatureRegistrationsDeleteOptionalParams + options?: SubscriptionFeatureRegistrationsDeleteOptionalParams, ): Promise { return this.client.sendOperationRequest( { providerNamespace, featureName, options }, - deleteOperationSpec + deleteOperationSpec, ); } @@ -228,11 +213,11 @@ export class SubscriptionFeatureRegistrationsImpl */ private _listBySubscription( providerNamespace: string, - options?: SubscriptionFeatureRegistrationsListBySubscriptionOptionalParams + options?: SubscriptionFeatureRegistrationsListBySubscriptionOptionalParams, ): Promise { return this.client.sendOperationRequest( { providerNamespace, options }, - listBySubscriptionOperationSpec + listBySubscriptionOperationSpec, ); } @@ -241,12 +226,9 @@ export class SubscriptionFeatureRegistrationsImpl * @param options The options parameters. */ private _listAllBySubscription( - options?: SubscriptionFeatureRegistrationsListAllBySubscriptionOptionalParams + options?: SubscriptionFeatureRegistrationsListAllBySubscriptionOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { options }, - listAllBySubscriptionOperationSpec - ); + return this.client.sendOperationRequest({ options }, listAllBySubscriptionOperationSpec); } /** @@ -258,11 +240,11 @@ export class SubscriptionFeatureRegistrationsImpl private _listBySubscriptionNext( providerNamespace: string, nextLink: string, - options?: SubscriptionFeatureRegistrationsListBySubscriptionNextOptionalParams + options?: SubscriptionFeatureRegistrationsListBySubscriptionNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { providerNamespace, nextLink, options }, - listBySubscriptionNextOperationSpec + listBySubscriptionNextOperationSpec, ); } @@ -273,13 +255,11 @@ export class SubscriptionFeatureRegistrationsImpl */ private _listAllBySubscriptionNext( nextLink: string, - options?: SubscriptionFeatureRegistrationsListAllBySubscriptionNextOptionalParams - ): Promise< - SubscriptionFeatureRegistrationsListAllBySubscriptionNextResponse - > { + options?: SubscriptionFeatureRegistrationsListAllBySubscriptionNextOptionalParams, + ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listAllBySubscriptionNextOperationSpec + listAllBySubscriptionNextOperationSpec, ); } } @@ -287,38 +267,36 @@ export class SubscriptionFeatureRegistrationsImpl const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Features/featureProviders/{providerNamespace}/subscriptionFeatureRegistrations/{featureName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Features/featureProviders/{providerNamespace}/subscriptionFeatureRegistrations/{featureName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SubscriptionFeatureRegistration + bodyMapper: Mappers.SubscriptionFeatureRegistration, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.featureName, - Parameters.providerNamespace + Parameters.providerNamespace, ], headerParameters: [Parameters.accept1], - serializer + serializer, }; const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Features/featureProviders/{providerNamespace}/subscriptionFeatureRegistrations/{featureName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Features/featureProviders/{providerNamespace}/subscriptionFeatureRegistrations/{featureName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.SubscriptionFeatureRegistration + bodyMapper: Mappers.SubscriptionFeatureRegistration, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.subscriptionFeatureRegistrationType, queryParameters: [Parameters.apiVersion], @@ -326,109 +304,96 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.subscriptionId, Parameters.featureName, - Parameters.providerNamespace + Parameters.providerNamespace, ], headerParameters: [Parameters.accept1, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Features/featureProviders/{providerNamespace}/subscriptionFeatureRegistrations/{featureName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Features/featureProviders/{providerNamespace}/subscriptionFeatureRegistrations/{featureName}", httpMethod: "DELETE", responses: { 200: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.featureName, - Parameters.providerNamespace + Parameters.providerNamespace, ], headerParameters: [Parameters.accept1], - serializer + serializer, }; const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Features/featureProviders/{providerNamespace}/subscriptionFeatureRegistrations", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Features/featureProviders/{providerNamespace}/subscriptionFeatureRegistrations", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SubscriptionFeatureRegistrationList + bodyMapper: Mappers.SubscriptionFeatureRegistrationList, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.providerNamespace - ], + urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.providerNamespace], headerParameters: [Parameters.accept1], - serializer + serializer, }; const listAllBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Features/subscriptionFeatureRegistrations", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Features/subscriptionFeatureRegistrations", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SubscriptionFeatureRegistrationList + bodyMapper: Mappers.SubscriptionFeatureRegistrationList, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept1], - serializer + serializer, }; const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SubscriptionFeatureRegistrationList + bodyMapper: Mappers.SubscriptionFeatureRegistrationList, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.nextLink, Parameters.subscriptionId, - Parameters.providerNamespace + Parameters.providerNamespace, ], headerParameters: [Parameters.accept1], - serializer + serializer, }; const listAllBySubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SubscriptionFeatureRegistrationList + bodyMapper: Mappers.SubscriptionFeatureRegistrationList, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId - ], + urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], headerParameters: [Parameters.accept1], - serializer + serializer, }; diff --git a/sdk/features/arm-features/src/operationsInterfaces/features.ts b/sdk/features/arm-features/src/operationsInterfaces/features.ts index d112cb2b8914..beea6edb49e5 100644 --- a/sdk/features/arm-features/src/operationsInterfaces/features.ts +++ b/sdk/features/arm-features/src/operationsInterfaces/features.ts @@ -16,7 +16,7 @@ import { FeaturesRegisterOptionalParams, FeaturesRegisterResponse, FeaturesUnregisterOptionalParams, - FeaturesUnregisterResponse + FeaturesUnregisterResponse, } from "../models/index.js"; /// @@ -26,9 +26,7 @@ export interface Features { * Gets all the preview features that are available through AFEC for the subscription. * @param options The options parameters. */ - listAll( - options?: FeaturesListAllOptionalParams - ): PagedAsyncIterableIterator; + listAll(options?: FeaturesListAllOptionalParams): PagedAsyncIterableIterator; /** * Gets all the preview features in a provider namespace that are available through AFEC for the * subscription. @@ -37,7 +35,7 @@ export interface Features { */ list( resourceProviderNamespace: string, - options?: FeaturesListOptionalParams + options?: FeaturesListOptionalParams, ): PagedAsyncIterableIterator; /** * Gets the preview feature with the specified name. @@ -48,7 +46,7 @@ export interface Features { get( resourceProviderNamespace: string, featureName: string, - options?: FeaturesGetOptionalParams + options?: FeaturesGetOptionalParams, ): Promise; /** * Registers the preview feature for the subscription. @@ -59,7 +57,7 @@ export interface Features { register( resourceProviderNamespace: string, featureName: string, - options?: FeaturesRegisterOptionalParams + options?: FeaturesRegisterOptionalParams, ): Promise; /** * Unregisters the preview feature for the subscription. @@ -70,6 +68,6 @@ export interface Features { unregister( resourceProviderNamespace: string, featureName: string, - options?: FeaturesUnregisterOptionalParams + options?: FeaturesUnregisterOptionalParams, ): Promise; } diff --git a/sdk/features/arm-features/src/operationsInterfaces/subscriptionFeatureRegistrations.ts b/sdk/features/arm-features/src/operationsInterfaces/subscriptionFeatureRegistrations.ts index bb7b38534e86..327930665152 100644 --- a/sdk/features/arm-features/src/operationsInterfaces/subscriptionFeatureRegistrations.ts +++ b/sdk/features/arm-features/src/operationsInterfaces/subscriptionFeatureRegistrations.ts @@ -15,7 +15,7 @@ import { SubscriptionFeatureRegistrationsGetResponse, SubscriptionFeatureRegistrationsCreateOrUpdateOptionalParams, SubscriptionFeatureRegistrationsCreateOrUpdateResponse, - SubscriptionFeatureRegistrationsDeleteOptionalParams + SubscriptionFeatureRegistrationsDeleteOptionalParams, } from "../models/index.js"; /// @@ -28,14 +28,14 @@ export interface SubscriptionFeatureRegistrations { */ listBySubscription( providerNamespace: string, - options?: SubscriptionFeatureRegistrationsListBySubscriptionOptionalParams + options?: SubscriptionFeatureRegistrationsListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator; /** * Returns subscription feature registrations for given subscription. * @param options The options parameters. */ listAllBySubscription( - options?: SubscriptionFeatureRegistrationsListAllBySubscriptionOptionalParams + options?: SubscriptionFeatureRegistrationsListAllBySubscriptionOptionalParams, ): PagedAsyncIterableIterator; /** * Returns a feature registration @@ -46,7 +46,7 @@ export interface SubscriptionFeatureRegistrations { get( providerNamespace: string, featureName: string, - options?: SubscriptionFeatureRegistrationsGetOptionalParams + options?: SubscriptionFeatureRegistrationsGetOptionalParams, ): Promise; /** * Create or update a feature registration. @@ -57,7 +57,7 @@ export interface SubscriptionFeatureRegistrations { createOrUpdate( providerNamespace: string, featureName: string, - options?: SubscriptionFeatureRegistrationsCreateOrUpdateOptionalParams + options?: SubscriptionFeatureRegistrationsCreateOrUpdateOptionalParams, ): Promise; /** * Deletes a feature registration @@ -68,6 +68,6 @@ export interface SubscriptionFeatureRegistrations { delete( providerNamespace: string, featureName: string, - options?: SubscriptionFeatureRegistrationsDeleteOptionalParams + options?: SubscriptionFeatureRegistrationsDeleteOptionalParams, ): Promise; } diff --git a/sdk/features/arm-features/src/pagingHelper.ts b/sdk/features/arm-features/src/pagingHelper.ts index d85fc13bce1e..e362819bdfc4 100644 --- a/sdk/features/arm-features/src/pagingHelper.ts +++ b/sdk/features/arm-features/src/pagingHelper.ts @@ -13,11 +13,11 @@ export interface PageInfo { const pageMap = new WeakMap(); /** - * Given a result page from a pageable operation, returns a - * continuation token that can be used to begin paging from + * 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 A result object from calling .byPage() on a paged operation. - * @returns The continuation token that can be passed into byPage(). + * @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) { @@ -26,10 +26,7 @@ export function getContinuationToken(page: unknown): string | undefined { return pageMap.get(page)?.continuationToken; } -export function setContinuationToken( - page: unknown, - continuationToken: string | undefined -): void { +export function setContinuationToken(page: unknown, continuationToken: string | undefined): void { if (typeof page !== "object" || page === null || !continuationToken) { return; } diff --git a/sdk/features/arm-features/test/sampleTest.spec.ts b/sdk/features/arm-features/test/sampleTest.spec.ts new file mode 100644 index 000000000000..90b3c8a868b4 --- /dev/null +++ b/sdk/features/arm-features/test/sampleTest.spec.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { Recorder, RecorderStartOptions } from "@azure-tools/test-recorder"; +import { afterEach, beforeEach, describe, it, assert } from "vitest"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async () => { + recorder = new Recorder(); + await recorder.start(recorderOptions); + }); + + afterEach(async () => { + await recorder.stop(); + }); + + it("sample test", async () => { + assert(true); + }); +}); diff --git a/sdk/features/arm-features/test/snippets.spec.ts b/sdk/features/arm-features/test/snippets.spec.ts index b516f6e9841c..9a59f4478984 100644 --- a/sdk/features/arm-features/test/snippets.spec.ts +++ b/sdk/features/arm-features/test/snippets.spec.ts @@ -1,5 +1,10 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. +/* + * 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 { FeatureClient } from "../src/index.js"; import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; diff --git a/sdk/features/arm-features/tsconfig.json b/sdk/features/arm-features/tsconfig.json index 19ceb382b521..74e345b627eb 100644 --- a/sdk/features/arm-features/tsconfig.json +++ b/sdk/features/arm-features/tsconfig.json @@ -4,10 +4,10 @@ "path": "./tsconfig.src.json" }, { - "path": "./tsconfig.samples.json" + "path": "./tsconfig.test.json" }, { "path": "./tsconfig.test.json" } ] -} +} \ No newline at end of file diff --git a/sdk/features/arm-features/vitest.browser.config.ts b/sdk/features/arm-features/vitest.browser.config.ts index 10e70dbfa8ee..182729ab5ce9 100644 --- a/sdk/features/arm-features/vitest.browser.config.ts +++ b/sdk/features/arm-features/vitest.browser.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. @@ -8,7 +9,7 @@ export default mergeConfig( viteConfig, defineConfig({ test: { - include: ["dist-test/browser/test/**/*.spec.js"], + include: ["dist-test/browser/test/**/*.spec.js",], testTimeout: 1200000, hookTimeout: 1200000, }, diff --git a/sdk/features/arm-features/vitest.config.ts b/sdk/features/arm-features/vitest.config.ts index 86a71911ccc2..40e031385dd8 100644 --- a/sdk/features/arm-features/vitest.config.ts +++ b/sdk/features/arm-features/vitest.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. diff --git a/sdk/features/arm-features/vitest.esm.config.ts b/sdk/features/arm-features/vitest.esm.config.ts index 5e9735e9b144..a70127279fc9 100644 --- a/sdk/features/arm-features/vitest.esm.config.ts +++ b/sdk/features/arm-features/vitest.esm.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. @@ -5,4 +6,7 @@ import { mergeConfig } from "vitest/config"; import vitestConfig from "./vitest.config.ts"; import vitestEsmConfig from "../../../vitest.esm.shared.config.ts"; -export default mergeConfig(vitestConfig, vitestEsmConfig); +export default mergeConfig( + vitestConfig, + vitestEsmConfig +); diff --git a/sdk/links/arm-links/CHANGELOG.md b/sdk/links/arm-links/CHANGELOG.md index e72b11f65d31..5699ec33e0a0 100644 --- a/sdk/links/arm-links/CHANGELOG.md +++ b/sdk/links/arm-links/CHANGELOG.md @@ -1,18 +1,19 @@ # Release History - -## 2.0.2 (2022-11-22) - + +## 3.0.0 (2025-04-28) + ### Features Added --  Exposes `getContinuationToken` helper function to extract continuation token - -### Bugs Fixed -  -- A series of small bug fixs relevant to authentication and apiVersion policy + - Added function getContinuationToken +### Breaking Changes + + - Class ManagementLinkClient has a new signature + - Interface ResourceLinksListAtSubscriptionNextOptionalParams no longer has parameter filter + ## 2.0.1 (2022-04-18) -### Features Added +**features** - Bug fix @@ -24,4 +25,4 @@ To understand the detail of the change, please refer to [Changelog](https://aka. To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). -To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ). +To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart). diff --git a/sdk/links/arm-links/LICENSE b/sdk/links/arm-links/LICENSE index b2f52a2bad4e..63447fd8bbbf 100644 --- a/sdk/links/arm-links/LICENSE +++ b/sdk/links/arm-links/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/links/arm-links/README.md b/sdk/links/arm-links/README.md index ce47fe8b86a4..ca1db39361be 100644 --- a/sdk/links/arm-links/README.md +++ b/sdk/links/arm-links/README.md @@ -44,7 +44,6 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure ManagementLink** 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 +63,14 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur import { InteractiveBrowserCredential } from "@azure/identity"; import { ManagementLinkClient } from "@azure/arm-links"; -const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", - clientId: "", -}); + clientId: "" + }); const client = new ManagementLinkClient(credential, subscriptionId); ``` ### JavaScript Bundle - To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). ## Key concepts @@ -108,6 +105,7 @@ 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/ diff --git a/sdk/links/arm-links/_meta.json b/sdk/links/arm-links/_meta.json index 2c0805caf40d..c37acc89bcac 100644 --- a/sdk/links/arm-links/_meta.json +++ b/sdk/links/arm-links/_meta.json @@ -1,8 +1,8 @@ { - "commit": "a42f1b58607091c4f255ead152a8ef323fa0b280", - "readme": "specification\\resources\\resource-manager\\readme.md", - "autorest_command": "autorest --version=3.8.4 --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.0-rc.3.20221108.1 --generate-sample=true", + "commit": "fcbc290cc06b0d69207105d83bb7dac49c21675b", + "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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/resources/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", - "use": "@autorest/typescript@6.0.0-rc.3.20221108.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.26", + "use": "@autorest/typescript@^6.0.12" } diff --git a/sdk/links/arm-links/api-extractor.json b/sdk/links/arm-links/api-extractor.json index 745f44b8b7fc..9cfdfe6cb070 100644 --- a/sdk/links/arm-links/api-extractor.json +++ b/sdk/links/arm-links/api-extractor.json @@ -28,4 +28,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/links/arm-links/package.json b/sdk/links/arm-links/package.json index 911a7597e59e..19d148fbbd70 100644 --- a/sdk/links/arm-links/package.json +++ b/sdk/links/arm-links/package.json @@ -3,15 +3,15 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ManagementLinkClient.", - "version": "2.0.2", + "version": "3.0.0", "engines": { "node": ">=18.0.0" }, "dependencies": { "@azure/core-auth": "^1.9.0", - "@azure/core-client": "^1.9.2", + "@azure/core-client": "^1.9.3", "@azure/core-paging": "^1.6.2", - "@azure/core-rest-pipeline": "^1.19.0", + "@azure/core-rest-pipeline": "^1.19.1", "tslib": "^2.8.1" }, "keywords": [ @@ -26,22 +26,22 @@ "main": "./dist/commonjs/index.js", "module": "./dist/esm/index.js", "types": "./dist/commonjs/index.d.ts", + "type": "module", "devDependencies": { "@azure-tools/test-credential": "^2.0.0", "@azure-tools/test-recorder": "^4.1.0", "@azure-tools/test-utils-vitest": "^1.0.0", - "@azure/arm-resources": "^5.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.6.0", + "@azure/identity": "^4.9.1", "@azure/logger": "^1.1.4", "@types/node": "^18.0.0", "@vitest/browser": "^3.0.9", "@vitest/coverage-istanbul": "^3.0.9", - "playwright": "^1.50.1", + "dotenv": "^16.0.0", + "playwright": "^1.52.0", "typescript": "~5.8.2", "vitest": "^3.0.9" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/links/arm-links", "repository": "github:Azure/azure-sdk-for-js", "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" @@ -59,16 +59,16 @@ "build:node": "echo skipped", "build:samples": "echo skipped.", "build:test": "echo skipped", - "check-format": "echo skipped", + "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", "clean": "dev-tool run vendored 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", + "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "integration-test:browser": "echo skipped", "integration-test:node": "dev-tool run test:vitest --esm", "lint": "echo skipped", - "minify": "echo skipped", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", "pack": "npm pack 2>&1", "prepack": "npm run build", "test": "npm run integration-test", @@ -89,7 +89,9 @@ ] }, "autoPublish": true, - "type": "module", + "browser": "./dist/browser/index.js", + "react-native": "./dist/react-native/index.js", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/links/arm-links", "tshy": { "project": "./tsconfig.src.json", "exports": { @@ -106,8 +108,6 @@ ], "selfLink": false }, - "browser": "./dist/browser/index.js", - "react-native": "./dist/react-native/index.js", "exports": { "./package.json": "./package.json", ".": { @@ -129,4 +129,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/links/arm-links/review/arm-links.api.md b/sdk/links/arm-links/review/arm-links.api.md index 0bbbaff74a79..a021f89e39ad 100644 --- a/sdk/links/arm-links/review/arm-links.api.md +++ b/sdk/links/arm-links/review/arm-links.api.md @@ -16,6 +16,7 @@ export class ManagementLinkClient extends coreClient.ServiceClient { // (undocumented) $host: string; constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ManagementLinkClientOptionalParams); + constructor(credentials: coreAuth.TokenCredential, options?: ManagementLinkClientOptionalParams); // (undocumented) apiVersion: string; // (undocumented) @@ -23,7 +24,7 @@ export class ManagementLinkClient extends coreClient.ServiceClient { // (undocumented) resourceLinks: ResourceLinks; // (undocumented) - subscriptionId: string; + subscriptionId?: string; } // @public @@ -141,7 +142,6 @@ export type ResourceLinksListAtSourceScopeResponse = ResourceLinkResult; // @public export interface ResourceLinksListAtSubscriptionNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public diff --git a/sdk/links/arm-links/sample.env b/sdk/links/arm-links/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/links/arm-links/sample.env +++ b/sdk/links/arm-links/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/links/arm-links/src/managementLinkClient.ts b/sdk/links/arm-links/src/managementLinkClient.ts index f31c7cac96b2..d413ef009961 100644 --- a/sdk/links/arm-links/src/managementLinkClient.ts +++ b/sdk/links/arm-links/src/managementLinkClient.ts @@ -8,11 +8,7 @@ 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 { PipelineRequest, PipelineResponse, SendRequest } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { OperationsImpl, ResourceLinksImpl } from "./operations/index.js"; import { Operations, ResourceLinks } from "./operationsInterfaces/index.js"; @@ -21,7 +17,7 @@ import { ManagementLinkClientOptionalParams } from "./models/index.js"; export class ManagementLinkClient extends coreClient.ServiceClient { $host: string; apiVersion: string; - subscriptionId: string; + subscriptionId?: string; /** * Initializes a new instance of the ManagementLinkClient class. @@ -32,13 +28,24 @@ export class ManagementLinkClient extends coreClient.ServiceClient { constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: ManagementLinkClientOptionalParams + options?: ManagementLinkClientOptionalParams, + ); + constructor(credentials: coreAuth.TokenCredential, options?: ManagementLinkClientOptionalParams); + constructor( + credentials: coreAuth.TokenCredential, + subscriptionIdOrOptions?: ManagementLinkClientOptionalParams | string, + options?: ManagementLinkClientOptionalParams, ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); } - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); + + let subscriptionId: string | undefined; + + if (typeof subscriptionIdOrOptions === "string") { + subscriptionId = subscriptionIdOrOptions; + } else if (typeof subscriptionIdOrOptions === "object") { + options = subscriptionIdOrOptions; } // Initializing default values for options @@ -47,10 +54,10 @@ export class ManagementLinkClient extends coreClient.ServiceClient { } const defaults: ManagementLinkClientOptionalParams = { requestContentType: "application/json; charset=utf-8", - credential: credentials + credential: credentials, }; - const packageDetails = `azsdk-js-arm-links/2.0.2`; + const packageDetails = `azsdk-js-arm-links/3.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -60,20 +67,19 @@ export class ManagementLinkClient extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, - endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + 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(); + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => - pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName + pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -83,19 +89,17 @@ export class ManagementLinkClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ credential: credentials, scopes: - optionsWithDefaults.credentialScopes ?? - `${optionsWithDefaults.endpoint}/.default`, + optionsWithDefaults.credentialScopes ?? `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -116,10 +120,7 @@ export class ManagementLinkClient extends coreClient.ServiceClient { } const apiVersionPolicy = { name: "CustomApiVersionPolicy", - async sendRequest( - request: PipelineRequest, - next: SendRequest - ): Promise { + async sendRequest(request: PipelineRequest, next: SendRequest): Promise { const param = request.url.split("?"); if (param.length > 1) { const newParams = param[1].split("&").map((item) => { @@ -132,7 +133,7 @@ export class ManagementLinkClient extends coreClient.ServiceClient { request.url = param[0] + "?" + newParams.join("&"); } return next(request); - } + }, }; this.pipeline.addPolicy(apiVersionPolicy); } diff --git a/sdk/links/arm-links/src/models/index.ts b/sdk/links/arm-links/src/models/index.ts index 1a730f96d3e2..7074f84205ab 100644 --- a/sdk/links/arm-links/src/models/index.ts +++ b/sdk/links/arm-links/src/models/index.ts @@ -88,40 +88,34 @@ export interface ResourceLinkFilter { } /** Optional parameters. */ -export interface OperationsListOptionalParams - extends coreClient.OperationOptions {} +export interface OperationsListOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the list operation. */ export type OperationsListResponse = OperationListResult; /** Optional parameters. */ -export interface OperationsListNextOptionalParams - extends coreClient.OperationOptions {} +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type OperationsListNextResponse = OperationListResult; /** Optional parameters. */ -export interface ResourceLinksDeleteOptionalParams - extends coreClient.OperationOptions {} +export interface ResourceLinksDeleteOptionalParams extends coreClient.OperationOptions {} /** Optional parameters. */ -export interface ResourceLinksCreateOrUpdateOptionalParams - extends coreClient.OperationOptions {} +export interface ResourceLinksCreateOrUpdateOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the createOrUpdate operation. */ export type ResourceLinksCreateOrUpdateResponse = ResourceLink; /** Optional parameters. */ -export interface ResourceLinksGetOptionalParams - extends coreClient.OperationOptions {} +export interface ResourceLinksGetOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ export type ResourceLinksGetResponse = ResourceLink; /** Optional parameters. */ -export interface ResourceLinksListAtSubscriptionOptionalParams - extends coreClient.OperationOptions { +export interface ResourceLinksListAtSubscriptionOptionalParams extends coreClient.OperationOptions { /** The filter to apply on the list resource links operation. The supported filter for list resource links is targetId. For example, $filter=targetId eq {value} */ filter?: string; } @@ -130,18 +124,14 @@ export interface ResourceLinksListAtSubscriptionOptionalParams export type ResourceLinksListAtSubscriptionResponse = ResourceLinkResult; /** Optional parameters. */ -export interface ResourceLinksListAtSourceScopeOptionalParams - extends coreClient.OperationOptions {} +export interface ResourceLinksListAtSourceScopeOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listAtSourceScope operation. */ export type ResourceLinksListAtSourceScopeResponse = ResourceLinkResult; /** Optional parameters. */ export interface ResourceLinksListAtSubscriptionNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the list resource links operation. The supported filter for list resource links is targetId. For example, $filter=targetId eq {value} */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listAtSubscriptionNext operation. */ export type ResourceLinksListAtSubscriptionNextResponse = ResourceLinkResult; @@ -154,8 +144,7 @@ export interface ResourceLinksListAtSourceScopeNextOptionalParams export type ResourceLinksListAtSourceScopeNextResponse = ResourceLinkResult; /** Optional parameters. */ -export interface ManagementLinkClientOptionalParams - extends coreClient.ServiceClientOptions { +export interface ManagementLinkClientOptionalParams extends coreClient.ServiceClientOptions { /** server parameter */ $host?: string; /** Api Version */ diff --git a/sdk/links/arm-links/src/models/mappers.ts b/sdk/links/arm-links/src/models/mappers.ts index 6dc8e79de789..36b97b7c05e8 100644 --- a/sdk/links/arm-links/src/models/mappers.ts +++ b/sdk/links/arm-links/src/models/mappers.ts @@ -20,19 +20,19 @@ export const OperationListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Operation" - } - } - } + className: "Operation", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Operation: coreClient.CompositeMapper = { @@ -43,18 +43,18 @@ export const Operation: coreClient.CompositeMapper = { name: { serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, display: { serializedName: "display", type: { name: "Composite", - className: "OperationDisplay" - } - } - } - } + className: "OperationDisplay", + }, + }, + }, + }, }; export const OperationDisplay: coreClient.CompositeMapper = { @@ -65,29 +65,29 @@ export const OperationDisplay: coreClient.CompositeMapper = { provider: { serializedName: "provider", type: { - name: "String" - } + name: "String", + }, }, resource: { serializedName: "resource", type: { - name: "String" - } + name: "String", + }, }, operation: { serializedName: "operation", type: { - name: "String" - } + name: "String", + }, }, description: { serializedName: "description", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ResourceLink: coreClient.CompositeMapper = { @@ -99,33 +99,33 @@ export const ResourceLink: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", readOnly: true, type: { name: "Dictionary", - value: { type: { name: "any" } } - } + value: { type: { name: "any" } }, + }, }, properties: { serializedName: "properties", type: { name: "Composite", - className: "ResourceLinkProperties" - } - } - } - } + className: "ResourceLinkProperties", + }, + }, + }, + }, }; export const ResourceLinkProperties: coreClient.CompositeMapper = { @@ -137,24 +137,24 @@ export const ResourceLinkProperties: coreClient.CompositeMapper = { serializedName: "sourceId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, targetId: { serializedName: "targetId", required: true, type: { - name: "String" - } + name: "String", + }, }, notes: { serializedName: "notes", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ResourceLinkResult: coreClient.CompositeMapper = { @@ -170,20 +170,20 @@ export const ResourceLinkResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ResourceLink" - } - } - } + className: "ResourceLink", + }, + }, + }, }, nextLink: { serializedName: "nextLink", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ResourceLinkFilter: coreClient.CompositeMapper = { @@ -195,9 +195,9 @@ export const ResourceLinkFilter: coreClient.CompositeMapper = { serializedName: "targetId", required: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; diff --git a/sdk/links/arm-links/src/models/parameters.ts b/sdk/links/arm-links/src/models/parameters.ts index 115763edfb6e..c41a88a5422f 100644 --- a/sdk/links/arm-links/src/models/parameters.ts +++ b/sdk/links/arm-links/src/models/parameters.ts @@ -9,7 +9,7 @@ import { OperationParameter, OperationURLParameter, - OperationQueryParameter + OperationQueryParameter, } from "@azure/core-client"; import { ResourceLink as ResourceLinkMapper } from "../models/mappers.js"; @@ -20,9 +20,9 @@ export const accept: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const $host: OperationURLParameter = { @@ -31,10 +31,10 @@ export const $host: OperationURLParameter = { serializedName: "$host", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const apiVersion: OperationQueryParameter = { @@ -44,9 +44,9 @@ export const apiVersion: OperationQueryParameter = { isConstant: true, serializedName: "api-version", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const nextLink: OperationURLParameter = { @@ -55,10 +55,10 @@ export const nextLink: OperationURLParameter = { serializedName: "nextLink", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const linkId: OperationURLParameter = { @@ -67,10 +67,10 @@ export const linkId: OperationURLParameter = { serializedName: "linkId", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const contentType: OperationParameter = { @@ -80,14 +80,14 @@ export const contentType: OperationParameter = { isConstant: true, serializedName: "Content-Type", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const parameters: OperationParameter = { parameterPath: "parameters", - mapper: ResourceLinkMapper + mapper: ResourceLinkMapper, }; export const filter: OperationQueryParameter = { @@ -95,9 +95,9 @@ export const filter: OperationQueryParameter = { mapper: { serializedName: "$filter", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const subscriptionId: OperationURLParameter = { @@ -106,9 +106,9 @@ export const subscriptionId: OperationURLParameter = { serializedName: "subscriptionId", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const scope: OperationURLParameter = { @@ -117,10 +117,10 @@ export const scope: OperationURLParameter = { serializedName: "scope", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const filter1: OperationQueryParameter = { @@ -130,7 +130,7 @@ export const filter1: OperationQueryParameter = { isConstant: true, serializedName: "$filter", type: { - name: "String" - } - } + name: "String", + }, + }, }; diff --git a/sdk/links/arm-links/src/operations/operations.ts b/sdk/links/arm-links/src/operations/operations.ts index 98ca64602178..10ce57fd3caf 100644 --- a/sdk/links/arm-links/src/operations/operations.ts +++ b/sdk/links/arm-links/src/operations/operations.ts @@ -18,7 +18,7 @@ import { OperationsListNextOptionalParams, OperationsListOptionalParams, OperationsListResponse, - OperationsListNextResponse + OperationsListNextResponse, } from "../models/index.js"; /// @@ -38,9 +38,7 @@ export class OperationsImpl implements Operations { * Lists all of the available Microsoft.Resources REST API operations. * @param options The options parameters. */ - public list( - options?: OperationsListOptionalParams - ): PagedAsyncIterableIterator { + public list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { next() { @@ -54,13 +52,13 @@ export class OperationsImpl implements Operations { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: OperationsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: OperationsListResponse; let continuationToken = settings?.continuationToken; @@ -81,7 +79,7 @@ export class OperationsImpl implements Operations { } private async *listPagingAll( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -92,9 +90,7 @@ export class OperationsImpl implements Operations { * Lists all of the available Microsoft.Resources REST API operations. * @param options The options parameters. */ - private _list( - options?: OperationsListOptionalParams - ): Promise { + private _list(options?: OperationsListOptionalParams): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -105,12 +101,9 @@ export class OperationsImpl implements Operations { */ private _listNext( nextLink: string, - options?: OperationsListNextOptionalParams + options?: OperationsListNextOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec - ); + return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); } } // Operation Specifications @@ -121,24 +114,23 @@ const listOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult - } + bodyMapper: Mappers.OperationListResult, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult - } + bodyMapper: Mappers.OperationListResult, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/links/arm-links/src/operations/resourceLinks.ts b/sdk/links/arm-links/src/operations/resourceLinks.ts index 0a14a9088afd..599b431337cb 100644 --- a/sdk/links/arm-links/src/operations/resourceLinks.ts +++ b/sdk/links/arm-links/src/operations/resourceLinks.ts @@ -27,7 +27,7 @@ import { ResourceLinksGetOptionalParams, ResourceLinksGetResponse, ResourceLinksListAtSubscriptionNextResponse, - ResourceLinksListAtSourceScopeNextResponse + ResourceLinksListAtSourceScopeNextResponse, } from "../models/index.js"; /// @@ -48,7 +48,7 @@ export class ResourceLinksImpl implements ResourceLinks { * @param options The options parameters. */ public listAtSubscription( - options?: ResourceLinksListAtSubscriptionOptionalParams + options?: ResourceLinksListAtSubscriptionOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listAtSubscriptionPagingAll(options); return { @@ -63,13 +63,13 @@ export class ResourceLinksImpl implements ResourceLinks { throw new Error("maxPageSize is not supported by this operation."); } return this.listAtSubscriptionPagingPage(options, settings); - } + }, }; } private async *listAtSubscriptionPagingPage( options?: ResourceLinksListAtSubscriptionOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ResourceLinksListAtSubscriptionResponse; let continuationToken = settings?.continuationToken; @@ -90,7 +90,7 @@ export class ResourceLinksImpl implements ResourceLinks { } private async *listAtSubscriptionPagingAll( - options?: ResourceLinksListAtSubscriptionOptionalParams + options?: ResourceLinksListAtSubscriptionOptionalParams, ): AsyncIterableIterator { for await (const page of this.listAtSubscriptionPagingPage(options)) { yield* page; @@ -106,7 +106,7 @@ export class ResourceLinksImpl implements ResourceLinks { */ public listAtSourceScope( scope: string, - options?: ResourceLinksListAtSourceScopeOptionalParams + options?: ResourceLinksListAtSourceScopeOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listAtSourceScopePagingAll(scope, options); return { @@ -121,14 +121,14 @@ export class ResourceLinksImpl implements ResourceLinks { throw new Error("maxPageSize is not supported by this operation."); } return this.listAtSourceScopePagingPage(scope, options, settings); - } + }, }; } private async *listAtSourceScopePagingPage( scope: string, options?: ResourceLinksListAtSourceScopeOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ResourceLinksListAtSourceScopeResponse; let continuationToken = settings?.continuationToken; @@ -140,11 +140,7 @@ export class ResourceLinksImpl implements ResourceLinks { yield page; } while (continuationToken) { - result = await this._listAtSourceScopeNext( - scope, - continuationToken, - options - ); + result = await this._listAtSourceScopeNext(scope, continuationToken, options); continuationToken = result.nextLink; let page = result.value || []; setContinuationToken(page, continuationToken); @@ -154,7 +150,7 @@ export class ResourceLinksImpl implements ResourceLinks { private async *listAtSourceScopePagingAll( scope: string, - options?: ResourceLinksListAtSourceScopeOptionalParams + options?: ResourceLinksListAtSourceScopeOptionalParams, ): AsyncIterableIterator { for await (const page of this.listAtSourceScopePagingPage(scope, options)) { yield* page; @@ -169,14 +165,8 @@ export class ResourceLinksImpl implements ResourceLinks { * /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup/Microsoft.Web/sites/mySite/Microsoft.Resources/links/myLink * @param options The options parameters. */ - delete( - linkId: string, - options?: ResourceLinksDeleteOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { linkId, options }, - deleteOperationSpec - ); + delete(linkId: string, options?: ResourceLinksDeleteOptionalParams): Promise { + return this.client.sendOperationRequest({ linkId, options }, deleteOperationSpec); } /** @@ -191,11 +181,11 @@ export class ResourceLinksImpl implements ResourceLinks { createOrUpdate( linkId: string, parameters: ResourceLink, - options?: ResourceLinksCreateOrUpdateOptionalParams + options?: ResourceLinksCreateOrUpdateOptionalParams, ): Promise { return this.client.sendOperationRequest( { linkId, parameters, options }, - createOrUpdateOperationSpec + createOrUpdateOperationSpec, ); } @@ -205,14 +195,8 @@ export class ResourceLinksImpl implements ResourceLinks { * /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup/Microsoft.Web/sites/mySite/Microsoft.Resources/links/myLink * @param options The options parameters. */ - get( - linkId: string, - options?: ResourceLinksGetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { linkId, options }, - getOperationSpec - ); + get(linkId: string, options?: ResourceLinksGetOptionalParams): Promise { + return this.client.sendOperationRequest({ linkId, options }, getOperationSpec); } /** @@ -220,12 +204,9 @@ export class ResourceLinksImpl implements ResourceLinks { * @param options The options parameters. */ private _listAtSubscription( - options?: ResourceLinksListAtSubscriptionOptionalParams + options?: ResourceLinksListAtSubscriptionOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { options }, - listAtSubscriptionOperationSpec - ); + return this.client.sendOperationRequest({ options }, listAtSubscriptionOperationSpec); } /** @@ -237,12 +218,9 @@ export class ResourceLinksImpl implements ResourceLinks { */ private _listAtSourceScope( scope: string, - options?: ResourceLinksListAtSourceScopeOptionalParams + options?: ResourceLinksListAtSourceScopeOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { scope, options }, - listAtSourceScopeOperationSpec - ); + return this.client.sendOperationRequest({ scope, options }, listAtSourceScopeOperationSpec); } /** @@ -252,11 +230,11 @@ export class ResourceLinksImpl implements ResourceLinks { */ private _listAtSubscriptionNext( nextLink: string, - options?: ResourceLinksListAtSubscriptionNextOptionalParams + options?: ResourceLinksListAtSubscriptionNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listAtSubscriptionNextOperationSpec + listAtSubscriptionNextOperationSpec, ); } @@ -271,11 +249,11 @@ export class ResourceLinksImpl implements ResourceLinks { private _listAtSourceScopeNext( scope: string, nextLink: string, - options?: ResourceLinksListAtSourceScopeNextOptionalParams + options?: ResourceLinksListAtSourceScopeNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, nextLink, options }, - listAtSourceScopeNextOperationSpec + listAtSourceScopeNextOperationSpec, ); } } @@ -288,92 +266,86 @@ const deleteOperationSpec: coreClient.OperationSpec = { responses: { 200: {}, 204: {} }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.linkId], - serializer + serializer, }; const createOrUpdateOperationSpec: coreClient.OperationSpec = { path: "/{linkId}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.ResourceLink + bodyMapper: Mappers.ResourceLink, }, 201: { - bodyMapper: Mappers.ResourceLink - } + bodyMapper: Mappers.ResourceLink, + }, }, requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.linkId], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { path: "/{linkId}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ResourceLink - } + bodyMapper: Mappers.ResourceLink, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.linkId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtSubscriptionOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/links", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ResourceLinkResult - } + bodyMapper: Mappers.ResourceLinkResult, + }, }, queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtSourceScopeOperationSpec: coreClient.OperationSpec = { path: "/{scope}/providers/Microsoft.Resources/links", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ResourceLinkResult - } + bodyMapper: Mappers.ResourceLinkResult, + }, }, queryParameters: [Parameters.apiVersion, Parameters.filter1], urlParameters: [Parameters.$host, Parameters.scope], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtSubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ResourceLinkResult - } + bodyMapper: Mappers.ResourceLinkResult, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId - ], + urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtSourceScopeNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ResourceLinkResult - } + bodyMapper: Mappers.ResourceLinkResult, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.filter1], urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.scope], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/links/arm-links/src/operationsInterfaces/operations.ts b/sdk/links/arm-links/src/operationsInterfaces/operations.ts index b2b6a973dc8e..e09c02a0606b 100644 --- a/sdk/links/arm-links/src/operationsInterfaces/operations.ts +++ b/sdk/links/arm-links/src/operationsInterfaces/operations.ts @@ -16,7 +16,5 @@ export interface Operations { * Lists all of the available Microsoft.Resources REST API operations. * @param options The options parameters. */ - list( - options?: OperationsListOptionalParams - ): PagedAsyncIterableIterator; + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; } diff --git a/sdk/links/arm-links/src/operationsInterfaces/resourceLinks.ts b/sdk/links/arm-links/src/operationsInterfaces/resourceLinks.ts index 8c0359a85e0f..da709614c504 100644 --- a/sdk/links/arm-links/src/operationsInterfaces/resourceLinks.ts +++ b/sdk/links/arm-links/src/operationsInterfaces/resourceLinks.ts @@ -15,7 +15,7 @@ import { ResourceLinksCreateOrUpdateOptionalParams, ResourceLinksCreateOrUpdateResponse, ResourceLinksGetOptionalParams, - ResourceLinksGetResponse + ResourceLinksGetResponse, } from "../models/index.js"; /// @@ -26,7 +26,7 @@ export interface ResourceLinks { * @param options The options parameters. */ listAtSubscription( - options?: ResourceLinksListAtSubscriptionOptionalParams + options?: ResourceLinksListAtSubscriptionOptionalParams, ): PagedAsyncIterableIterator; /** * Gets a list of resource links at and below the specified source scope. @@ -37,7 +37,7 @@ export interface ResourceLinks { */ listAtSourceScope( scope: string, - options?: ResourceLinksListAtSourceScopeOptionalParams + options?: ResourceLinksListAtSourceScopeOptionalParams, ): PagedAsyncIterableIterator; /** * Deletes a resource link with the specified ID. @@ -47,10 +47,7 @@ export interface ResourceLinks { * /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup/Microsoft.Web/sites/mySite/Microsoft.Resources/links/myLink * @param options The options parameters. */ - delete( - linkId: string, - options?: ResourceLinksDeleteOptionalParams - ): Promise; + delete(linkId: string, options?: ResourceLinksDeleteOptionalParams): Promise; /** * Creates or updates a resource link between the specified resources. * @param linkId The fully qualified ID of the resource link. Use the format, @@ -63,7 +60,7 @@ export interface ResourceLinks { createOrUpdate( linkId: string, parameters: ResourceLink, - options?: ResourceLinksCreateOrUpdateOptionalParams + options?: ResourceLinksCreateOrUpdateOptionalParams, ): Promise; /** * Gets a resource link with the specified ID. @@ -71,8 +68,5 @@ export interface ResourceLinks { * /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup/Microsoft.Web/sites/mySite/Microsoft.Resources/links/myLink * @param options The options parameters. */ - get( - linkId: string, - options?: ResourceLinksGetOptionalParams - ): Promise; + get(linkId: string, options?: ResourceLinksGetOptionalParams): Promise; } diff --git a/sdk/links/arm-links/src/pagingHelper.ts b/sdk/links/arm-links/src/pagingHelper.ts index d85fc13bce1e..e362819bdfc4 100644 --- a/sdk/links/arm-links/src/pagingHelper.ts +++ b/sdk/links/arm-links/src/pagingHelper.ts @@ -13,11 +13,11 @@ export interface PageInfo { const pageMap = new WeakMap(); /** - * Given a result page from a pageable operation, returns a - * continuation token that can be used to begin paging from + * 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 A result object from calling .byPage() on a paged operation. - * @returns The continuation token that can be passed into byPage(). + * @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) { @@ -26,10 +26,7 @@ export function getContinuationToken(page: unknown): string | undefined { return pageMap.get(page)?.continuationToken; } -export function setContinuationToken( - page: unknown, - continuationToken: string | undefined -): void { +export function setContinuationToken(page: unknown, continuationToken: string | undefined): void { if (typeof page !== "object" || page === null || !continuationToken) { return; } diff --git a/sdk/links/arm-links/test/sampleTest.spec.ts b/sdk/links/arm-links/test/sampleTest.spec.ts new file mode 100644 index 000000000000..90b3c8a868b4 --- /dev/null +++ b/sdk/links/arm-links/test/sampleTest.spec.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { Recorder, RecorderStartOptions } from "@azure-tools/test-recorder"; +import { afterEach, beforeEach, describe, it, assert } from "vitest"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async () => { + recorder = new Recorder(); + await recorder.start(recorderOptions); + }); + + afterEach(async () => { + await recorder.stop(); + }); + + it("sample test", async () => { + assert(true); + }); +}); diff --git a/sdk/links/arm-links/test/snippets.spec.ts b/sdk/links/arm-links/test/snippets.spec.ts index a2ec458bb7ec..97796c189408 100644 --- a/sdk/links/arm-links/test/snippets.spec.ts +++ b/sdk/links/arm-links/test/snippets.spec.ts @@ -1,5 +1,10 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. +/* + * 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 { ManagementLinkClient } from "../src/index.js"; import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; diff --git a/sdk/links/arm-links/tsconfig.json b/sdk/links/arm-links/tsconfig.json index 19ceb382b521..90e392e66417 100644 --- a/sdk/links/arm-links/tsconfig.json +++ b/sdk/links/arm-links/tsconfig.json @@ -4,10 +4,19 @@ "path": "./tsconfig.src.json" }, { - "path": "./tsconfig.samples.json" + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.test.json" }, { "path": "./tsconfig.test.json" } ] -} +} \ No newline at end of file diff --git a/sdk/links/arm-links/vitest.browser.config.ts b/sdk/links/arm-links/vitest.browser.config.ts index 10e70dbfa8ee..182729ab5ce9 100644 --- a/sdk/links/arm-links/vitest.browser.config.ts +++ b/sdk/links/arm-links/vitest.browser.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. @@ -8,7 +9,7 @@ export default mergeConfig( viteConfig, defineConfig({ test: { - include: ["dist-test/browser/test/**/*.spec.js"], + include: ["dist-test/browser/test/**/*.spec.js",], testTimeout: 1200000, hookTimeout: 1200000, }, diff --git a/sdk/links/arm-links/vitest.config.ts b/sdk/links/arm-links/vitest.config.ts index 86a71911ccc2..40e031385dd8 100644 --- a/sdk/links/arm-links/vitest.config.ts +++ b/sdk/links/arm-links/vitest.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. diff --git a/sdk/links/arm-links/vitest.esm.config.ts b/sdk/links/arm-links/vitest.esm.config.ts index 5e9735e9b144..a70127279fc9 100644 --- a/sdk/links/arm-links/vitest.esm.config.ts +++ b/sdk/links/arm-links/vitest.esm.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. @@ -5,4 +6,7 @@ import { mergeConfig } from "vitest/config"; import vitestConfig from "./vitest.config.ts"; import vitestEsmConfig from "../../../vitest.esm.shared.config.ts"; -export default mergeConfig(vitestConfig, vitestEsmConfig); +export default mergeConfig( + vitestConfig, + vitestEsmConfig +); diff --git a/sdk/locks/arm-locks/CHANGELOG.md b/sdk/locks/arm-locks/CHANGELOG.md index fa91121a0ecd..c9eb6e3d0932 100644 --- a/sdk/locks/arm-locks/CHANGELOG.md +++ b/sdk/locks/arm-locks/CHANGELOG.md @@ -1,15 +1,16 @@ # Release History - -## 2.1.1 (Unreleased) - -### Features Added - + +## 3.0.0 (2025-04-28) + ### Breaking Changes -### Bugs Fixed - -### Other Changes - + - Class ManagementLockClient has a new signature + - Interface ManagementLocksListAtResourceGroupLevelNextOptionalParams no longer has parameter filter + - Interface ManagementLocksListAtResourceLevelNextOptionalParams no longer has parameter filter + - Interface ManagementLocksListAtSubscriptionLevelNextOptionalParams no longer has parameter filter + - Interface ManagementLocksListByScopeNextOptionalParams no longer has parameter filter + + ## 2.1.0 (2022-11-22) ### Features Added @@ -31,4 +32,4 @@ To understand the detail of the change, please refer to [Changelog](https://aka. To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). -To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ). +To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart). diff --git a/sdk/locks/arm-locks/LICENSE b/sdk/locks/arm-locks/LICENSE index b2f52a2bad4e..63447fd8bbbf 100644 --- a/sdk/locks/arm-locks/LICENSE +++ b/sdk/locks/arm-locks/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/locks/arm-locks/README.md b/sdk/locks/arm-locks/README.md index af26accfee2d..2ed4c687ad58 100644 --- a/sdk/locks/arm-locks/README.md +++ b/sdk/locks/arm-locks/README.md @@ -44,7 +44,6 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure ManagementLock** 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 +63,14 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur import { InteractiveBrowserCredential } from "@azure/identity"; import { ManagementLockClient } from "@azure/arm-locks"; -const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", - clientId: "", -}); + clientId: "" + }); const client = new ManagementLockClient(credential, subscriptionId); ``` ### JavaScript Bundle - To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). ## Key concepts @@ -108,6 +105,7 @@ 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/ diff --git a/sdk/locks/arm-locks/_meta.json b/sdk/locks/arm-locks/_meta.json index 038deb20da78..c37acc89bcac 100644 --- a/sdk/locks/arm-locks/_meta.json +++ b/sdk/locks/arm-locks/_meta.json @@ -1,8 +1,8 @@ { - "commit": "a42f1b58607091c4f255ead152a8ef323fa0b280", + "commit": "fcbc290cc06b0d69207105d83bb7dac49c21675b", "readme": "specification/resources/resource-manager/readme.md", - "autorest_command": "autorest --version=3.8.4 --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.0-rc.3.20221108.1 --generate-sample=true", + "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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/resources/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", - "use": "@autorest/typescript@6.0.0-rc.3.20221108.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.26", + "use": "@autorest/typescript@^6.0.12" } diff --git a/sdk/locks/arm-locks/api-extractor.json b/sdk/locks/arm-locks/api-extractor.json index 47ca0e02dc13..d6e11b05da66 100644 --- a/sdk/locks/arm-locks/api-extractor.json +++ b/sdk/locks/arm-locks/api-extractor.json @@ -28,4 +28,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/locks/arm-locks/package.json b/sdk/locks/arm-locks/package.json index 46d7086bca85..1336b5052c8a 100644 --- a/sdk/locks/arm-locks/package.json +++ b/sdk/locks/arm-locks/package.json @@ -3,15 +3,15 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ManagementLockClient.", - "version": "2.1.1", + "version": "3.0.0", "engines": { "node": ">=18.0.0" }, "dependencies": { "@azure/core-auth": "^1.9.0", - "@azure/core-client": "^1.9.2", + "@azure/core-client": "^1.9.3", "@azure/core-paging": "^1.6.2", - "@azure/core-rest-pipeline": "^1.19.0", + "@azure/core-rest-pipeline": "^1.19.1", "tslib": "^2.8.1" }, "keywords": [ @@ -26,21 +26,22 @@ "main": "./dist/commonjs/index.js", "module": "./dist/esm/index.js", "types": "./dist/commonjs/index.d.ts", + "type": "module", "devDependencies": { "@azure-tools/test-credential": "^2.0.0", "@azure-tools/test-recorder": "^4.1.0", "@azure-tools/test-utils-vitest": "^1.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.6.0", + "@azure/identity": "^4.9.1", "@azure/logger": "^1.1.4", "@types/node": "^18.0.0", "@vitest/browser": "^3.0.9", "@vitest/coverage-istanbul": "^3.0.9", - "playwright": "^1.50.1", + "dotenv": "^16.0.0", + "playwright": "^1.52.0", "typescript": "~5.8.2", "vitest": "^3.0.9" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/locks/arm-locks", "repository": "github:Azure/azure-sdk-for-js", "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" @@ -58,16 +59,16 @@ "build:node": "echo skipped", "build:samples": "echo skipped.", "build:test": "echo skipped", - "check-format": "echo skipped", + "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", "clean": "dev-tool run vendored 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", + "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "integration-test:browser": "echo skipped", "integration-test:node": "dev-tool run test:vitest --esm", "lint": "echo skipped", - "minify": "echo skipped", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", "pack": "npm pack 2>&1", "prepack": "npm run build", "test": "npm run integration-test", @@ -88,15 +89,9 @@ ] }, "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-locks?view=azure-node-preview" - }, - "type": "module", + "browser": "./dist/browser/index.js", + "react-native": "./dist/react-native/index.js", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/locks/arm-locks", "tshy": { "project": "./tsconfig.src.json", "exports": { @@ -113,8 +108,6 @@ ], "selfLink": false }, - "browser": "./dist/browser/index.js", - "react-native": "./dist/react-native/index.js", "exports": { "./package.json": "./package.json", ".": { @@ -136,4 +129,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/locks/arm-locks/review/arm-locks.api.md b/sdk/locks/arm-locks/review/arm-locks.api.md index f0af237b239b..6e803bc7ceaf 100644 --- a/sdk/locks/arm-locks/review/arm-locks.api.md +++ b/sdk/locks/arm-locks/review/arm-locks.api.md @@ -76,6 +76,7 @@ export class ManagementLockClient extends coreClient.ServiceClient { // (undocumented) $host: string; constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ManagementLockClientOptionalParams); + constructor(credentials: coreAuth.TokenCredential, options?: ManagementLockClientOptionalParams); // (undocumented) apiVersion: string; // (undocumented) @@ -83,7 +84,7 @@ export class ManagementLockClient extends coreClient.ServiceClient { // (undocumented) managementLocks: ManagementLocks; // (undocumented) - subscriptionId: string; + subscriptionId?: string; } // @public @@ -209,7 +210,6 @@ export type ManagementLocksGetByScopeResponse = ManagementLockObject; // @public export interface ManagementLocksListAtResourceGroupLevelNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public @@ -225,7 +225,6 @@ export type ManagementLocksListAtResourceGroupLevelResponse = ManagementLockList // @public export interface ManagementLocksListAtResourceLevelNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public @@ -241,7 +240,6 @@ export type ManagementLocksListAtResourceLevelResponse = ManagementLockListResul // @public export interface ManagementLocksListAtSubscriptionLevelNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public @@ -257,7 +255,6 @@ export type ManagementLocksListAtSubscriptionLevelResponse = ManagementLockListR // @public export interface ManagementLocksListByScopeNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public diff --git a/sdk/locks/arm-locks/sample.env b/sdk/locks/arm-locks/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/locks/arm-locks/sample.env +++ b/sdk/locks/arm-locks/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/locks/arm-locks/src/managementLockClient.ts b/sdk/locks/arm-locks/src/managementLockClient.ts index 8b6f644d04be..e3224babe451 100644 --- a/sdk/locks/arm-locks/src/managementLockClient.ts +++ b/sdk/locks/arm-locks/src/managementLockClient.ts @@ -8,23 +8,16 @@ 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 { PipelineRequest, PipelineResponse, SendRequest } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { AuthorizationOperationsImpl, ManagementLocksImpl } from "./operations/index.js"; -import { - AuthorizationOperations, - ManagementLocks -} from "./operationsInterfaces/index.js"; +import { AuthorizationOperations, ManagementLocks } from "./operationsInterfaces/index.js"; import { ManagementLockClientOptionalParams } from "./models/index.js"; export class ManagementLockClient extends coreClient.ServiceClient { $host: string; apiVersion: string; - subscriptionId: string; + subscriptionId?: string; /** * Initializes a new instance of the ManagementLockClient class. @@ -35,13 +28,24 @@ export class ManagementLockClient extends coreClient.ServiceClient { constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: ManagementLockClientOptionalParams + options?: ManagementLockClientOptionalParams, + ); + constructor(credentials: coreAuth.TokenCredential, options?: ManagementLockClientOptionalParams); + constructor( + credentials: coreAuth.TokenCredential, + subscriptionIdOrOptions?: ManagementLockClientOptionalParams | string, + options?: ManagementLockClientOptionalParams, ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); } - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); + + let subscriptionId: string | undefined; + + if (typeof subscriptionIdOrOptions === "string") { + subscriptionId = subscriptionIdOrOptions; + } else if (typeof subscriptionIdOrOptions === "object") { + options = subscriptionIdOrOptions; } // Initializing default values for options @@ -50,10 +54,10 @@ export class ManagementLockClient extends coreClient.ServiceClient { } const defaults: ManagementLockClientOptionalParams = { requestContentType: "application/json; charset=utf-8", - credential: credentials + credential: credentials, }; - const packageDetails = `azsdk-js-arm-locks/2.1.1`; + const packageDetails = `azsdk-js-arm-locks/3.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -63,20 +67,19 @@ export class ManagementLockClient extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, - endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + 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(); + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => - pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName + pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -86,19 +89,17 @@ export class ManagementLockClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ credential: credentials, scopes: - optionsWithDefaults.credentialScopes ?? - `${optionsWithDefaults.endpoint}/.default`, + optionsWithDefaults.credentialScopes ?? `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -119,10 +120,7 @@ export class ManagementLockClient extends coreClient.ServiceClient { } const apiVersionPolicy = { name: "CustomApiVersionPolicy", - async sendRequest( - request: PipelineRequest, - next: SendRequest - ): Promise { + async sendRequest(request: PipelineRequest, next: SendRequest): Promise { const param = request.url.split("?"); if (param.length > 1) { const newParams = param[1].split("&").map((item) => { @@ -135,7 +133,7 @@ export class ManagementLockClient extends coreClient.ServiceClient { request.url = param[0] + "?" + newParams.join("&"); } return next(request); - } + }, }; this.pipeline.addPolicy(apiVersionPolicy); } diff --git a/sdk/locks/arm-locks/src/models/index.ts b/sdk/locks/arm-locks/src/models/index.ts index c95cb1af614b..114acbe1537a 100644 --- a/sdk/locks/arm-locks/src/models/index.ts +++ b/sdk/locks/arm-locks/src/models/index.ts @@ -150,7 +150,7 @@ export enum KnownLockLevel { /** CanNotDelete */ CanNotDelete = "CanNotDelete", /** ReadOnly */ - ReadOnly = "ReadOnly" + ReadOnly = "ReadOnly", } /** @@ -173,7 +173,7 @@ export enum KnownCreatedByType { /** ManagedIdentity */ ManagedIdentity = "ManagedIdentity", /** Key */ - Key = "Key" + Key = "Key", } /** @@ -189,8 +189,7 @@ export enum KnownCreatedByType { export type CreatedByType = string; /** Optional parameters. */ -export interface AuthorizationOperationsListOptionalParams - extends coreClient.OperationOptions {} +export interface AuthorizationOperationsListOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the list operation. */ export type AuthorizationOperationsListResponse = OperationListResult; @@ -228,12 +227,10 @@ export interface ManagementLocksCreateOrUpdateByScopeOptionalParams export type ManagementLocksCreateOrUpdateByScopeResponse = ManagementLockObject; /** Optional parameters. */ -export interface ManagementLocksDeleteByScopeOptionalParams - extends coreClient.OperationOptions {} +export interface ManagementLocksDeleteByScopeOptionalParams extends coreClient.OperationOptions {} /** Optional parameters. */ -export interface ManagementLocksGetByScopeOptionalParams - extends coreClient.OperationOptions {} +export interface ManagementLocksGetByScopeOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the getByScope operation. */ export type ManagementLocksGetByScopeResponse = ManagementLockObject; @@ -305,8 +302,7 @@ export interface ManagementLocksListAtSubscriptionLevelOptionalParams export type ManagementLocksListAtSubscriptionLevelResponse = ManagementLockListResult; /** Optional parameters. */ -export interface ManagementLocksListByScopeOptionalParams - extends coreClient.OperationOptions { +export interface ManagementLocksListByScopeOptionalParams extends coreClient.OperationOptions { /** The filter to apply on the operation. */ filter?: string; } @@ -316,47 +312,33 @@ export type ManagementLocksListByScopeResponse = ManagementLockListResult; /** Optional parameters. */ export interface ManagementLocksListAtResourceGroupLevelNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listAtResourceGroupLevelNext operation. */ export type ManagementLocksListAtResourceGroupLevelNextResponse = ManagementLockListResult; /** Optional parameters. */ export interface ManagementLocksListAtResourceLevelNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listAtResourceLevelNext operation. */ export type ManagementLocksListAtResourceLevelNextResponse = ManagementLockListResult; /** Optional parameters. */ export interface ManagementLocksListAtSubscriptionLevelNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listAtSubscriptionLevelNext operation. */ export type ManagementLocksListAtSubscriptionLevelNextResponse = ManagementLockListResult; /** Optional parameters. */ -export interface ManagementLocksListByScopeNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. */ - filter?: string; -} +export interface ManagementLocksListByScopeNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listByScopeNext operation. */ export type ManagementLocksListByScopeNextResponse = ManagementLockListResult; /** Optional parameters. */ -export interface ManagementLockClientOptionalParams - extends coreClient.ServiceClientOptions { +export interface ManagementLockClientOptionalParams extends coreClient.ServiceClientOptions { /** server parameter */ $host?: string; /** Api Version */ diff --git a/sdk/locks/arm-locks/src/models/mappers.ts b/sdk/locks/arm-locks/src/models/mappers.ts index f165718080fd..989b7a561236 100644 --- a/sdk/locks/arm-locks/src/models/mappers.ts +++ b/sdk/locks/arm-locks/src/models/mappers.ts @@ -20,19 +20,19 @@ export const OperationListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Operation" - } - } - } + className: "Operation", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Operation: coreClient.CompositeMapper = { @@ -43,18 +43,18 @@ export const Operation: coreClient.CompositeMapper = { name: { serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, display: { serializedName: "display", type: { name: "Composite", - className: "OperationDisplay" - } - } - } - } + className: "OperationDisplay", + }, + }, + }, + }, }; export const OperationDisplay: coreClient.CompositeMapper = { @@ -65,23 +65,23 @@ export const OperationDisplay: coreClient.CompositeMapper = { provider: { serializedName: "provider", type: { - name: "String" - } + name: "String", + }, }, resource: { serializedName: "resource", type: { - name: "String" - } + name: "String", + }, }, operation: { serializedName: "operation", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ErrorResponse: coreClient.CompositeMapper = { @@ -93,11 +93,11 @@ export const ErrorResponse: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorDetail" - } - } - } - } + className: "ErrorDetail", + }, + }, + }, + }, }; export const ErrorDetail: coreClient.CompositeMapper = { @@ -109,22 +109,22 @@ export const ErrorDetail: coreClient.CompositeMapper = { serializedName: "code", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, message: { serializedName: "message", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, target: { serializedName: "target", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, details: { serializedName: "details", @@ -134,10 +134,10 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorDetail" - } - } - } + className: "ErrorDetail", + }, + }, + }, }, additionalInfo: { serializedName: "additionalInfo", @@ -147,13 +147,13 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorAdditionalInfo" - } - } - } - } - } - } + className: "ErrorAdditionalInfo", + }, + }, + }, + }, + }, + }, }; export const ErrorAdditionalInfo: coreClient.CompositeMapper = { @@ -165,19 +165,19 @@ export const ErrorAdditionalInfo: coreClient.CompositeMapper = { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, info: { serializedName: "info", readOnly: true, type: { name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } + value: { type: { name: "any" } }, + }, + }, + }, + }, }; export const ManagementLockObject: coreClient.CompositeMapper = { @@ -189,42 +189,42 @@ export const ManagementLockObject: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, systemData: { serializedName: "systemData", type: { name: "Composite", - className: "SystemData" - } + className: "SystemData", + }, }, level: { serializedName: "properties.level", required: true, type: { - name: "String" - } + name: "String", + }, }, notes: { serializedName: "properties.notes", type: { - name: "String" - } + name: "String", + }, }, owners: { serializedName: "properties.owners", @@ -233,13 +233,13 @@ export const ManagementLockObject: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ManagementLockOwner" - } - } - } - } - } - } + className: "ManagementLockOwner", + }, + }, + }, + }, + }, + }, }; export const ManagementLockOwner: coreClient.CompositeMapper = { @@ -250,11 +250,11 @@ export const ManagementLockOwner: coreClient.CompositeMapper = { applicationId: { serializedName: "applicationId", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const SystemData: coreClient.CompositeMapper = { @@ -265,41 +265,41 @@ export const SystemData: coreClient.CompositeMapper = { createdBy: { serializedName: "createdBy", type: { - name: "String" - } + name: "String", + }, }, createdByType: { serializedName: "createdByType", type: { - name: "String" - } + name: "String", + }, }, createdAt: { serializedName: "createdAt", type: { - name: "DateTime" - } + name: "DateTime", + }, }, lastModifiedBy: { serializedName: "lastModifiedBy", type: { - name: "String" - } + name: "String", + }, }, lastModifiedByType: { serializedName: "lastModifiedByType", type: { - name: "String" - } + name: "String", + }, }, lastModifiedAt: { serializedName: "lastModifiedAt", type: { - name: "DateTime" - } - } - } - } + name: "DateTime", + }, + }, + }, + }, }; export const ManagementLockListResult: coreClient.CompositeMapper = { @@ -314,17 +314,17 @@ export const ManagementLockListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ManagementLockObject" - } - } - } + className: "ManagementLockObject", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; diff --git a/sdk/locks/arm-locks/src/models/parameters.ts b/sdk/locks/arm-locks/src/models/parameters.ts index 10e3631f6b87..d2d6c37fa254 100644 --- a/sdk/locks/arm-locks/src/models/parameters.ts +++ b/sdk/locks/arm-locks/src/models/parameters.ts @@ -9,7 +9,7 @@ import { OperationParameter, OperationURLParameter, - OperationQueryParameter + OperationQueryParameter, } from "@azure/core-client"; import { ManagementLockObject as ManagementLockObjectMapper } from "../models/mappers.js"; @@ -20,9 +20,9 @@ export const accept: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const $host: OperationURLParameter = { @@ -31,10 +31,10 @@ export const $host: OperationURLParameter = { serializedName: "$host", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const apiVersion: OperationQueryParameter = { @@ -44,9 +44,9 @@ export const apiVersion: OperationQueryParameter = { isConstant: true, serializedName: "api-version", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const nextLink: OperationURLParameter = { @@ -55,10 +55,10 @@ export const nextLink: OperationURLParameter = { serializedName: "nextLink", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const contentType: OperationParameter = { @@ -68,14 +68,14 @@ export const contentType: OperationParameter = { isConstant: true, serializedName: "Content-Type", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const parameters: OperationParameter = { parameterPath: "parameters", - mapper: ManagementLockObjectMapper + mapper: ManagementLockObjectMapper, }; export const resourceGroupName: OperationURLParameter = { @@ -84,14 +84,14 @@ export const resourceGroupName: OperationURLParameter = { constraints: { Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), MaxLength: 90, - MinLength: 1 + MinLength: 1, }, serializedName: "resourceGroupName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const lockName: OperationURLParameter = { @@ -100,9 +100,9 @@ export const lockName: OperationURLParameter = { serializedName: "lockName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const subscriptionId: OperationURLParameter = { @@ -111,9 +111,9 @@ export const subscriptionId: OperationURLParameter = { serializedName: "subscriptionId", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const scope: OperationURLParameter = { @@ -122,9 +122,9 @@ export const scope: OperationURLParameter = { serializedName: "scope", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const resourceProviderNamespace: OperationURLParameter = { @@ -133,9 +133,9 @@ export const resourceProviderNamespace: OperationURLParameter = { serializedName: "resourceProviderNamespace", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const parentResourcePath: OperationURLParameter = { @@ -144,10 +144,10 @@ export const parentResourcePath: OperationURLParameter = { serializedName: "parentResourcePath", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const resourceType: OperationURLParameter = { @@ -156,10 +156,10 @@ export const resourceType: OperationURLParameter = { serializedName: "resourceType", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const resourceName: OperationURLParameter = { @@ -168,9 +168,9 @@ export const resourceName: OperationURLParameter = { serializedName: "resourceName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const filter: OperationQueryParameter = { @@ -178,7 +178,7 @@ export const filter: OperationQueryParameter = { mapper: { serializedName: "$filter", type: { - name: "String" - } - } + name: "String", + }, + }, }; diff --git a/sdk/locks/arm-locks/src/operations/authorizationOperations.ts b/sdk/locks/arm-locks/src/operations/authorizationOperations.ts index 8625507d10df..67431fb8ae9f 100644 --- a/sdk/locks/arm-locks/src/operations/authorizationOperations.ts +++ b/sdk/locks/arm-locks/src/operations/authorizationOperations.ts @@ -18,7 +18,7 @@ import { AuthorizationOperationsListNextOptionalParams, AuthorizationOperationsListOptionalParams, AuthorizationOperationsListResponse, - AuthorizationOperationsListNextResponse + AuthorizationOperationsListNextResponse, } from "../models/index.js"; /// @@ -39,7 +39,7 @@ export class AuthorizationOperationsImpl implements AuthorizationOperations { * @param options The options parameters. */ public list( - options?: AuthorizationOperationsListOptionalParams + options?: AuthorizationOperationsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -54,13 +54,13 @@ export class AuthorizationOperationsImpl implements AuthorizationOperations { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: AuthorizationOperationsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: AuthorizationOperationsListResponse; let continuationToken = settings?.continuationToken; @@ -81,7 +81,7 @@ export class AuthorizationOperationsImpl implements AuthorizationOperations { } private async *listPagingAll( - options?: AuthorizationOperationsListOptionalParams + options?: AuthorizationOperationsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -93,7 +93,7 @@ export class AuthorizationOperationsImpl implements AuthorizationOperations { * @param options The options parameters. */ private _list( - options?: AuthorizationOperationsListOptionalParams + options?: AuthorizationOperationsListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -105,12 +105,9 @@ export class AuthorizationOperationsImpl implements AuthorizationOperations { */ private _listNext( nextLink: string, - options?: AuthorizationOperationsListNextOptionalParams + options?: AuthorizationOperationsListNextOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec - ); + return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); } } // Operation Specifications @@ -121,30 +118,29 @@ const listOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/locks/arm-locks/src/operations/managementLocks.ts b/sdk/locks/arm-locks/src/operations/managementLocks.ts index f9584ef4884d..546e138ae6f7 100644 --- a/sdk/locks/arm-locks/src/operations/managementLocks.ts +++ b/sdk/locks/arm-locks/src/operations/managementLocks.ts @@ -50,7 +50,7 @@ import { ManagementLocksListAtResourceGroupLevelNextResponse, ManagementLocksListAtResourceLevelNextResponse, ManagementLocksListAtSubscriptionLevelNextResponse, - ManagementLocksListByScopeNextResponse + ManagementLocksListByScopeNextResponse, } from "../models/index.js"; /// @@ -73,12 +73,9 @@ export class ManagementLocksImpl implements ManagementLocks { */ public listAtResourceGroupLevel( resourceGroupName: string, - options?: ManagementLocksListAtResourceGroupLevelOptionalParams + options?: ManagementLocksListAtResourceGroupLevelOptionalParams, ): PagedAsyncIterableIterator { - const iter = this.listAtResourceGroupLevelPagingAll( - resourceGroupName, - options - ); + const iter = this.listAtResourceGroupLevelPagingAll(resourceGroupName, options); return { next() { return iter.next(); @@ -90,19 +87,15 @@ export class ManagementLocksImpl implements ManagementLocks { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listAtResourceGroupLevelPagingPage( - resourceGroupName, - options, - settings - ); - } + return this.listAtResourceGroupLevelPagingPage(resourceGroupName, options, settings); + }, }; } private async *listAtResourceGroupLevelPagingPage( resourceGroupName: string, options?: ManagementLocksListAtResourceGroupLevelOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ManagementLocksListAtResourceGroupLevelResponse; let continuationToken = settings?.continuationToken; @@ -117,7 +110,7 @@ export class ManagementLocksImpl implements ManagementLocks { result = await this._listAtResourceGroupLevelNext( resourceGroupName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -128,12 +121,9 @@ export class ManagementLocksImpl implements ManagementLocks { private async *listAtResourceGroupLevelPagingAll( resourceGroupName: string, - options?: ManagementLocksListAtResourceGroupLevelOptionalParams + options?: ManagementLocksListAtResourceGroupLevelOptionalParams, ): AsyncIterableIterator { - for await (const page of this.listAtResourceGroupLevelPagingPage( - resourceGroupName, - options - )) { + for await (const page of this.listAtResourceGroupLevelPagingPage(resourceGroupName, options)) { yield* page; } } @@ -154,7 +144,7 @@ export class ManagementLocksImpl implements ManagementLocks { parentResourcePath: string, resourceType: string, resourceName: string, - options?: ManagementLocksListAtResourceLevelOptionalParams + options?: ManagementLocksListAtResourceLevelOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listAtResourceLevelPagingAll( resourceGroupName, @@ -162,7 +152,7 @@ export class ManagementLocksImpl implements ManagementLocks { parentResourcePath, resourceType, resourceName, - options + options, ); return { next() { @@ -182,9 +172,9 @@ export class ManagementLocksImpl implements ManagementLocks { resourceType, resourceName, options, - settings + settings, ); - } + }, }; } @@ -195,7 +185,7 @@ export class ManagementLocksImpl implements ManagementLocks { resourceType: string, resourceName: string, options?: ManagementLocksListAtResourceLevelOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ManagementLocksListAtResourceLevelResponse; let continuationToken = settings?.continuationToken; @@ -206,7 +196,7 @@ export class ManagementLocksImpl implements ManagementLocks { parentResourcePath, resourceType, resourceName, - options + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -221,7 +211,7 @@ export class ManagementLocksImpl implements ManagementLocks { resourceType, resourceName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -236,7 +226,7 @@ export class ManagementLocksImpl implements ManagementLocks { parentResourcePath: string, resourceType: string, resourceName: string, - options?: ManagementLocksListAtResourceLevelOptionalParams + options?: ManagementLocksListAtResourceLevelOptionalParams, ): AsyncIterableIterator { for await (const page of this.listAtResourceLevelPagingPage( resourceGroupName, @@ -244,7 +234,7 @@ export class ManagementLocksImpl implements ManagementLocks { parentResourcePath, resourceType, resourceName, - options + options, )) { yield* page; } @@ -255,7 +245,7 @@ export class ManagementLocksImpl implements ManagementLocks { * @param options The options parameters. */ public listAtSubscriptionLevel( - options?: ManagementLocksListAtSubscriptionLevelOptionalParams + options?: ManagementLocksListAtSubscriptionLevelOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listAtSubscriptionLevelPagingAll(options); return { @@ -270,13 +260,13 @@ export class ManagementLocksImpl implements ManagementLocks { throw new Error("maxPageSize is not supported by this operation."); } return this.listAtSubscriptionLevelPagingPage(options, settings); - } + }, }; } private async *listAtSubscriptionLevelPagingPage( options?: ManagementLocksListAtSubscriptionLevelOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ManagementLocksListAtSubscriptionLevelResponse; let continuationToken = settings?.continuationToken; @@ -288,10 +278,7 @@ export class ManagementLocksImpl implements ManagementLocks { yield page; } while (continuationToken) { - result = await this._listAtSubscriptionLevelNext( - continuationToken, - options - ); + result = await this._listAtSubscriptionLevelNext(continuationToken, options); continuationToken = result.nextLink; let page = result.value || []; setContinuationToken(page, continuationToken); @@ -300,7 +287,7 @@ export class ManagementLocksImpl implements ManagementLocks { } private async *listAtSubscriptionLevelPagingAll( - options?: ManagementLocksListAtSubscriptionLevelOptionalParams + options?: ManagementLocksListAtSubscriptionLevelOptionalParams, ): AsyncIterableIterator { for await (const page of this.listAtSubscriptionLevelPagingPage(options)) { yield* page; @@ -318,7 +305,7 @@ export class ManagementLocksImpl implements ManagementLocks { */ public listByScope( scope: string, - options?: ManagementLocksListByScopeOptionalParams + options?: ManagementLocksListByScopeOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByScopePagingAll(scope, options); return { @@ -333,14 +320,14 @@ export class ManagementLocksImpl implements ManagementLocks { throw new Error("maxPageSize is not supported by this operation."); } return this.listByScopePagingPage(scope, options, settings); - } + }, }; } private async *listByScopePagingPage( scope: string, options?: ManagementLocksListByScopeOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ManagementLocksListByScopeResponse; let continuationToken = settings?.continuationToken; @@ -362,7 +349,7 @@ export class ManagementLocksImpl implements ManagementLocks { private async *listByScopePagingAll( scope: string, - options?: ManagementLocksListByScopeOptionalParams + options?: ManagementLocksListByScopeOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByScopePagingPage(scope, options)) { yield* page; @@ -384,11 +371,11 @@ export class ManagementLocksImpl implements ManagementLocks { resourceGroupName: string, lockName: string, parameters: ManagementLockObject, - options?: ManagementLocksCreateOrUpdateAtResourceGroupLevelOptionalParams + options?: ManagementLocksCreateOrUpdateAtResourceGroupLevelOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, lockName, parameters, options }, - createOrUpdateAtResourceGroupLevelOperationSpec + createOrUpdateAtResourceGroupLevelOperationSpec, ); } @@ -403,11 +390,11 @@ export class ManagementLocksImpl implements ManagementLocks { deleteAtResourceGroupLevel( resourceGroupName: string, lockName: string, - options?: ManagementLocksDeleteAtResourceGroupLevelOptionalParams + options?: ManagementLocksDeleteAtResourceGroupLevelOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, lockName, options }, - deleteAtResourceGroupLevelOperationSpec + deleteAtResourceGroupLevelOperationSpec, ); } @@ -420,11 +407,11 @@ export class ManagementLocksImpl implements ManagementLocks { getAtResourceGroupLevel( resourceGroupName: string, lockName: string, - options?: ManagementLocksGetAtResourceGroupLevelOptionalParams + options?: ManagementLocksGetAtResourceGroupLevelOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, lockName, options }, - getAtResourceGroupLevelOperationSpec + getAtResourceGroupLevelOperationSpec, ); } @@ -443,11 +430,11 @@ export class ManagementLocksImpl implements ManagementLocks { scope: string, lockName: string, parameters: ManagementLockObject, - options?: ManagementLocksCreateOrUpdateByScopeOptionalParams + options?: ManagementLocksCreateOrUpdateByScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, lockName, parameters, options }, - createOrUpdateByScopeOperationSpec + createOrUpdateByScopeOperationSpec, ); } @@ -460,11 +447,11 @@ export class ManagementLocksImpl implements ManagementLocks { deleteByScope( scope: string, lockName: string, - options?: ManagementLocksDeleteByScopeOptionalParams + options?: ManagementLocksDeleteByScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, lockName, options }, - deleteByScopeOperationSpec + deleteByScopeOperationSpec, ); } @@ -477,12 +464,9 @@ export class ManagementLocksImpl implements ManagementLocks { getByScope( scope: string, lockName: string, - options?: ManagementLocksGetByScopeOptionalParams + options?: ManagementLocksGetByScopeOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { scope, lockName, options }, - getByScopeOperationSpec - ); + return this.client.sendOperationRequest({ scope, lockName, options }, getByScopeOperationSpec); } /** @@ -508,7 +492,7 @@ export class ManagementLocksImpl implements ManagementLocks { resourceName: string, lockName: string, parameters: ManagementLockObject, - options?: ManagementLocksCreateOrUpdateAtResourceLevelOptionalParams + options?: ManagementLocksCreateOrUpdateAtResourceLevelOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -519,9 +503,9 @@ export class ManagementLocksImpl implements ManagementLocks { resourceName, lockName, parameters, - options + options, }, - createOrUpdateAtResourceLevelOperationSpec + createOrUpdateAtResourceLevelOperationSpec, ); } @@ -546,7 +530,7 @@ export class ManagementLocksImpl implements ManagementLocks { resourceType: string, resourceName: string, lockName: string, - options?: ManagementLocksDeleteAtResourceLevelOptionalParams + options?: ManagementLocksDeleteAtResourceLevelOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -556,9 +540,9 @@ export class ManagementLocksImpl implements ManagementLocks { resourceType, resourceName, lockName, - options + options, }, - deleteAtResourceLevelOperationSpec + deleteAtResourceLevelOperationSpec, ); } @@ -579,7 +563,7 @@ export class ManagementLocksImpl implements ManagementLocks { resourceType: string, resourceName: string, lockName: string, - options?: ManagementLocksGetAtResourceLevelOptionalParams + options?: ManagementLocksGetAtResourceLevelOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -589,9 +573,9 @@ export class ManagementLocksImpl implements ManagementLocks { resourceType, resourceName, lockName, - options + options, }, - getAtResourceLevelOperationSpec + getAtResourceLevelOperationSpec, ); } @@ -608,11 +592,11 @@ export class ManagementLocksImpl implements ManagementLocks { createOrUpdateAtSubscriptionLevel( lockName: string, parameters: ManagementLockObject, - options?: ManagementLocksCreateOrUpdateAtSubscriptionLevelOptionalParams + options?: ManagementLocksCreateOrUpdateAtSubscriptionLevelOptionalParams, ): Promise { return this.client.sendOperationRequest( { lockName, parameters, options }, - createOrUpdateAtSubscriptionLevelOperationSpec + createOrUpdateAtSubscriptionLevelOperationSpec, ); } @@ -625,11 +609,11 @@ export class ManagementLocksImpl implements ManagementLocks { */ deleteAtSubscriptionLevel( lockName: string, - options?: ManagementLocksDeleteAtSubscriptionLevelOptionalParams + options?: ManagementLocksDeleteAtSubscriptionLevelOptionalParams, ): Promise { return this.client.sendOperationRequest( { lockName, options }, - deleteAtSubscriptionLevelOperationSpec + deleteAtSubscriptionLevelOperationSpec, ); } @@ -640,11 +624,11 @@ export class ManagementLocksImpl implements ManagementLocks { */ getAtSubscriptionLevel( lockName: string, - options?: ManagementLocksGetAtSubscriptionLevelOptionalParams + options?: ManagementLocksGetAtSubscriptionLevelOptionalParams, ): Promise { return this.client.sendOperationRequest( { lockName, options }, - getAtSubscriptionLevelOperationSpec + getAtSubscriptionLevelOperationSpec, ); } @@ -655,11 +639,11 @@ export class ManagementLocksImpl implements ManagementLocks { */ private _listAtResourceGroupLevel( resourceGroupName: string, - options?: ManagementLocksListAtResourceGroupLevelOptionalParams + options?: ManagementLocksListAtResourceGroupLevelOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, options }, - listAtResourceGroupLevelOperationSpec + listAtResourceGroupLevelOperationSpec, ); } @@ -679,7 +663,7 @@ export class ManagementLocksImpl implements ManagementLocks { parentResourcePath: string, resourceType: string, resourceName: string, - options?: ManagementLocksListAtResourceLevelOptionalParams + options?: ManagementLocksListAtResourceLevelOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -688,9 +672,9 @@ export class ManagementLocksImpl implements ManagementLocks { parentResourcePath, resourceType, resourceName, - options + options, }, - listAtResourceLevelOperationSpec + listAtResourceLevelOperationSpec, ); } @@ -699,12 +683,9 @@ export class ManagementLocksImpl implements ManagementLocks { * @param options The options parameters. */ private _listAtSubscriptionLevel( - options?: ManagementLocksListAtSubscriptionLevelOptionalParams + options?: ManagementLocksListAtSubscriptionLevelOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { options }, - listAtSubscriptionLevelOperationSpec - ); + return this.client.sendOperationRequest({ options }, listAtSubscriptionLevelOperationSpec); } /** @@ -718,12 +699,9 @@ export class ManagementLocksImpl implements ManagementLocks { */ private _listByScope( scope: string, - options?: ManagementLocksListByScopeOptionalParams + options?: ManagementLocksListByScopeOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { scope, options }, - listByScopeOperationSpec - ); + return this.client.sendOperationRequest({ scope, options }, listByScopeOperationSpec); } /** @@ -736,11 +714,11 @@ export class ManagementLocksImpl implements ManagementLocks { private _listAtResourceGroupLevelNext( resourceGroupName: string, nextLink: string, - options?: ManagementLocksListAtResourceGroupLevelNextOptionalParams + options?: ManagementLocksListAtResourceGroupLevelNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, nextLink, options }, - listAtResourceGroupLevelNextOperationSpec + listAtResourceGroupLevelNextOperationSpec, ); } @@ -762,7 +740,7 @@ export class ManagementLocksImpl implements ManagementLocks { resourceType: string, resourceName: string, nextLink: string, - options?: ManagementLocksListAtResourceLevelNextOptionalParams + options?: ManagementLocksListAtResourceLevelNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -772,9 +750,9 @@ export class ManagementLocksImpl implements ManagementLocks { resourceType, resourceName, nextLink, - options + options, }, - listAtResourceLevelNextOperationSpec + listAtResourceLevelNextOperationSpec, ); } @@ -786,11 +764,11 @@ export class ManagementLocksImpl implements ManagementLocks { */ private _listAtSubscriptionLevelNext( nextLink: string, - options?: ManagementLocksListAtSubscriptionLevelNextOptionalParams + options?: ManagementLocksListAtSubscriptionLevelNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listAtSubscriptionLevelNextOperationSpec + listAtSubscriptionLevelNextOperationSpec, ); } @@ -807,11 +785,11 @@ export class ManagementLocksImpl implements ManagementLocks { private _listByScopeNext( scope: string, nextLink: string, - options?: ManagementLocksListByScopeNextOptionalParams + options?: ManagementLocksListByScopeNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, nextLink, options }, - listByScopeNextOperationSpec + listByScopeNextOperationSpec, ); } } @@ -819,19 +797,18 @@ export class ManagementLocksImpl implements ManagementLocks { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const createOrUpdateAtResourceGroupLevelOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.ManagementLockObject + bodyMapper: Mappers.ManagementLockObject, }, 201: { - bodyMapper: Mappers.ManagementLockObject + bodyMapper: Mappers.ManagementLockObject, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion], @@ -839,75 +816,73 @@ const createOrUpdateAtResourceGroupLevelOperationSpec: coreClient.OperationSpec Parameters.$host, Parameters.resourceGroupName, Parameters.lockName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const deleteAtResourceGroupLevelOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}", httpMethod: "DELETE", responses: { 200: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.lockName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getAtResourceGroupLevelOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ManagementLockObject + bodyMapper: Mappers.ManagementLockObject, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.lockName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateByScopeOperationSpec: coreClient.OperationSpec = { path: "/{scope}/providers/Microsoft.Authorization/locks/{lockName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.ManagementLockObject + bodyMapper: Mappers.ManagementLockObject, }, 201: { - bodyMapper: Mappers.ManagementLockObject + bodyMapper: Mappers.ManagementLockObject, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.lockName, Parameters.scope], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const deleteByScopeOperationSpec: coreClient.OperationSpec = { path: "/{scope}/providers/Microsoft.Authorization/locks/{lockName}", @@ -916,44 +891,43 @@ const deleteByScopeOperationSpec: coreClient.OperationSpec = { 200: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.lockName, Parameters.scope], headerParameters: [Parameters.accept], - serializer + serializer, }; const getByScopeOperationSpec: coreClient.OperationSpec = { path: "/{scope}/providers/Microsoft.Authorization/locks/{lockName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ManagementLockObject + bodyMapper: Mappers.ManagementLockObject, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.lockName, Parameters.scope], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateAtResourceLevelOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}", + path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.ManagementLockObject + bodyMapper: Mappers.ManagementLockObject, }, 201: { - bodyMapper: Mappers.ManagementLockObject + bodyMapper: Mappers.ManagementLockObject, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion], @@ -965,22 +939,21 @@ const createOrUpdateAtResourceLevelOperationSpec: coreClient.OperationSpec = { Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, - Parameters.resourceName + Parameters.resourceName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const deleteAtResourceLevelOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}", + path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}", httpMethod: "DELETE", responses: { 200: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -991,22 +964,21 @@ const deleteAtResourceLevelOperationSpec: coreClient.OperationSpec = { Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, - Parameters.resourceName + Parameters.resourceName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getAtResourceLevelOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}", + path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ManagementLockObject + bodyMapper: Mappers.ManagementLockObject, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -1017,110 +989,89 @@ const getAtResourceLevelOperationSpec: coreClient.OperationSpec = { Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, - Parameters.resourceName + Parameters.resourceName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateAtSubscriptionLevelOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.ManagementLockObject + bodyMapper: Mappers.ManagementLockObject, }, 201: { - bodyMapper: Mappers.ManagementLockObject + bodyMapper: Mappers.ManagementLockObject, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.lockName, - Parameters.subscriptionId - ], + urlParameters: [Parameters.$host, Parameters.lockName, Parameters.subscriptionId], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const deleteAtSubscriptionLevelOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}", httpMethod: "DELETE", responses: { 200: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.lockName, - Parameters.subscriptionId - ], + urlParameters: [Parameters.$host, Parameters.lockName, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const getAtSubscriptionLevelOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ManagementLockObject + bodyMapper: Mappers.ManagementLockObject, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.lockName, - Parameters.subscriptionId - ], + urlParameters: [Parameters.$host, Parameters.lockName, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtResourceGroupLevelOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ManagementLockListResult + bodyMapper: Mappers.ManagementLockListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId - ], + urlParameters: [Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtResourceLevelOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks", + path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ManagementLockListResult + bodyMapper: Mappers.ManagementLockListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ @@ -1130,77 +1081,74 @@ const listAtResourceLevelOperationSpec: coreClient.OperationSpec = { Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, - Parameters.resourceName + Parameters.resourceName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtSubscriptionLevelOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ManagementLockListResult + bodyMapper: Mappers.ManagementLockListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByScopeOperationSpec: coreClient.OperationSpec = { path: "/{scope}/providers/Microsoft.Authorization/locks", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ManagementLockListResult + bodyMapper: Mappers.ManagementLockListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [Parameters.$host, Parameters.scope], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtResourceGroupLevelNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ManagementLockListResult + bodyMapper: Mappers.ManagementLockListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ Parameters.$host, Parameters.nextLink, Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtResourceLevelNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ManagementLockListResult + bodyMapper: Mappers.ManagementLockListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ Parameters.$host, Parameters.nextLink, @@ -1209,44 +1157,38 @@ const listAtResourceLevelNextOperationSpec: coreClient.OperationSpec = { Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, - Parameters.resourceName + Parameters.resourceName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listAtSubscriptionLevelNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ManagementLockListResult + bodyMapper: Mappers.ManagementLockListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId - ], + urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByScopeNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ManagementLockListResult + bodyMapper: Mappers.ManagementLockListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.scope], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/locks/arm-locks/src/operationsInterfaces/authorizationOperations.ts b/sdk/locks/arm-locks/src/operationsInterfaces/authorizationOperations.ts index 993724cd9988..c8c6f8e46371 100644 --- a/sdk/locks/arm-locks/src/operationsInterfaces/authorizationOperations.ts +++ b/sdk/locks/arm-locks/src/operationsInterfaces/authorizationOperations.ts @@ -7,10 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - Operation, - AuthorizationOperationsListOptionalParams -} from "../models/index.js"; +import { Operation, AuthorizationOperationsListOptionalParams } from "../models/index.js"; /// /** Interface representing a AuthorizationOperations. */ @@ -19,7 +16,5 @@ export interface AuthorizationOperations { * Lists all of the available Microsoft.Authorization REST API operations. * @param options The options parameters. */ - list( - options?: AuthorizationOperationsListOptionalParams - ): PagedAsyncIterableIterator; + list(options?: AuthorizationOperationsListOptionalParams): PagedAsyncIterableIterator; } diff --git a/sdk/locks/arm-locks/src/operationsInterfaces/managementLocks.ts b/sdk/locks/arm-locks/src/operationsInterfaces/managementLocks.ts index 0c97e5dd3f77..dd1da2a23f76 100644 --- a/sdk/locks/arm-locks/src/operationsInterfaces/managementLocks.ts +++ b/sdk/locks/arm-locks/src/operationsInterfaces/managementLocks.ts @@ -32,7 +32,7 @@ import { ManagementLocksCreateOrUpdateAtSubscriptionLevelResponse, ManagementLocksDeleteAtSubscriptionLevelOptionalParams, ManagementLocksGetAtSubscriptionLevelOptionalParams, - ManagementLocksGetAtSubscriptionLevelResponse + ManagementLocksGetAtSubscriptionLevelResponse, } from "../models/index.js"; /// @@ -45,7 +45,7 @@ export interface ManagementLocks { */ listAtResourceGroupLevel( resourceGroupName: string, - options?: ManagementLocksListAtResourceGroupLevelOptionalParams + options?: ManagementLocksListAtResourceGroupLevelOptionalParams, ): PagedAsyncIterableIterator; /** * Gets all the management locks for a resource or any level below resource. @@ -63,14 +63,14 @@ export interface ManagementLocks { parentResourcePath: string, resourceType: string, resourceName: string, - options?: ManagementLocksListAtResourceLevelOptionalParams + options?: ManagementLocksListAtResourceLevelOptionalParams, ): PagedAsyncIterableIterator; /** * Gets all the management locks for a subscription. * @param options The options parameters. */ listAtSubscriptionLevel( - options?: ManagementLocksListAtSubscriptionLevelOptionalParams + options?: ManagementLocksListAtSubscriptionLevelOptionalParams, ): PagedAsyncIterableIterator; /** * Gets all the management locks for a scope. @@ -83,7 +83,7 @@ export interface ManagementLocks { */ listByScope( scope: string, - options?: ManagementLocksListByScopeOptionalParams + options?: ManagementLocksListByScopeOptionalParams, ): PagedAsyncIterableIterator; /** * When you apply a lock at a parent scope, all child resources inherit the same lock. To create @@ -100,7 +100,7 @@ export interface ManagementLocks { resourceGroupName: string, lockName: string, parameters: ManagementLockObject, - options?: ManagementLocksCreateOrUpdateAtResourceGroupLevelOptionalParams + options?: ManagementLocksCreateOrUpdateAtResourceGroupLevelOptionalParams, ): Promise; /** * To delete management locks, you must have access to Microsoft.Authorization/* or @@ -113,7 +113,7 @@ export interface ManagementLocks { deleteAtResourceGroupLevel( resourceGroupName: string, lockName: string, - options?: ManagementLocksDeleteAtResourceGroupLevelOptionalParams + options?: ManagementLocksDeleteAtResourceGroupLevelOptionalParams, ): Promise; /** * Gets a management lock at the resource group level. @@ -124,7 +124,7 @@ export interface ManagementLocks { getAtResourceGroupLevel( resourceGroupName: string, lockName: string, - options?: ManagementLocksGetAtResourceGroupLevelOptionalParams + options?: ManagementLocksGetAtResourceGroupLevelOptionalParams, ): Promise; /** * Create or update a management lock by scope. @@ -141,7 +141,7 @@ export interface ManagementLocks { scope: string, lockName: string, parameters: ManagementLockObject, - options?: ManagementLocksCreateOrUpdateByScopeOptionalParams + options?: ManagementLocksCreateOrUpdateByScopeOptionalParams, ): Promise; /** * Delete a management lock by scope. @@ -152,7 +152,7 @@ export interface ManagementLocks { deleteByScope( scope: string, lockName: string, - options?: ManagementLocksDeleteByScopeOptionalParams + options?: ManagementLocksDeleteByScopeOptionalParams, ): Promise; /** * Get a management lock by scope. @@ -163,7 +163,7 @@ export interface ManagementLocks { getByScope( scope: string, lockName: string, - options?: ManagementLocksGetByScopeOptionalParams + options?: ManagementLocksGetByScopeOptionalParams, ): Promise; /** * When you apply a lock at a parent scope, all child resources inherit the same lock. To create @@ -188,7 +188,7 @@ export interface ManagementLocks { resourceName: string, lockName: string, parameters: ManagementLockObject, - options?: ManagementLocksCreateOrUpdateAtResourceLevelOptionalParams + options?: ManagementLocksCreateOrUpdateAtResourceLevelOptionalParams, ): Promise; /** * To delete management locks, you must have access to Microsoft.Authorization/* or @@ -211,7 +211,7 @@ export interface ManagementLocks { resourceType: string, resourceName: string, lockName: string, - options?: ManagementLocksDeleteAtResourceLevelOptionalParams + options?: ManagementLocksDeleteAtResourceLevelOptionalParams, ): Promise; /** * Get the management lock of a resource or any level below resource. @@ -230,7 +230,7 @@ export interface ManagementLocks { resourceType: string, resourceName: string, lockName: string, - options?: ManagementLocksGetAtResourceLevelOptionalParams + options?: ManagementLocksGetAtResourceLevelOptionalParams, ): Promise; /** * When you apply a lock at a parent scope, all child resources inherit the same lock. To create @@ -245,7 +245,7 @@ export interface ManagementLocks { createOrUpdateAtSubscriptionLevel( lockName: string, parameters: ManagementLockObject, - options?: ManagementLocksCreateOrUpdateAtSubscriptionLevelOptionalParams + options?: ManagementLocksCreateOrUpdateAtSubscriptionLevelOptionalParams, ): Promise; /** * To delete management locks, you must have access to Microsoft.Authorization/* or @@ -256,7 +256,7 @@ export interface ManagementLocks { */ deleteAtSubscriptionLevel( lockName: string, - options?: ManagementLocksDeleteAtSubscriptionLevelOptionalParams + options?: ManagementLocksDeleteAtSubscriptionLevelOptionalParams, ): Promise; /** * Gets a management lock at the subscription level. @@ -265,6 +265,6 @@ export interface ManagementLocks { */ getAtSubscriptionLevel( lockName: string, - options?: ManagementLocksGetAtSubscriptionLevelOptionalParams + options?: ManagementLocksGetAtSubscriptionLevelOptionalParams, ): Promise; } diff --git a/sdk/locks/arm-locks/src/pagingHelper.ts b/sdk/locks/arm-locks/src/pagingHelper.ts index d85fc13bce1e..e362819bdfc4 100644 --- a/sdk/locks/arm-locks/src/pagingHelper.ts +++ b/sdk/locks/arm-locks/src/pagingHelper.ts @@ -13,11 +13,11 @@ export interface PageInfo { const pageMap = new WeakMap(); /** - * Given a result page from a pageable operation, returns a - * continuation token that can be used to begin paging from + * 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 A result object from calling .byPage() on a paged operation. - * @returns The continuation token that can be passed into byPage(). + * @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) { @@ -26,10 +26,7 @@ export function getContinuationToken(page: unknown): string | undefined { return pageMap.get(page)?.continuationToken; } -export function setContinuationToken( - page: unknown, - continuationToken: string | undefined -): void { +export function setContinuationToken(page: unknown, continuationToken: string | undefined): void { if (typeof page !== "object" || page === null || !continuationToken) { return; } diff --git a/sdk/locks/arm-locks/test/sampleTest.spec.ts b/sdk/locks/arm-locks/test/sampleTest.spec.ts new file mode 100644 index 000000000000..90b3c8a868b4 --- /dev/null +++ b/sdk/locks/arm-locks/test/sampleTest.spec.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { Recorder, RecorderStartOptions } from "@azure-tools/test-recorder"; +import { afterEach, beforeEach, describe, it, assert } from "vitest"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async () => { + recorder = new Recorder(); + await recorder.start(recorderOptions); + }); + + afterEach(async () => { + await recorder.stop(); + }); + + it("sample test", async () => { + assert(true); + }); +}); diff --git a/sdk/locks/arm-locks/test/snippets.spec.ts b/sdk/locks/arm-locks/test/snippets.spec.ts index 815debc5c395..5614549bee58 100644 --- a/sdk/locks/arm-locks/test/snippets.spec.ts +++ b/sdk/locks/arm-locks/test/snippets.spec.ts @@ -1,5 +1,10 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. +/* + * 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 { ManagementLockClient } from "../src/index.js"; import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; diff --git a/sdk/locks/arm-locks/tsconfig.json b/sdk/locks/arm-locks/tsconfig.json index 19ceb382b521..415fb037497a 100644 --- a/sdk/locks/arm-locks/tsconfig.json +++ b/sdk/locks/arm-locks/tsconfig.json @@ -4,10 +4,13 @@ "path": "./tsconfig.src.json" }, { - "path": "./tsconfig.samples.json" + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.test.json" }, { "path": "./tsconfig.test.json" } ] -} +} \ No newline at end of file diff --git a/sdk/locks/arm-locks/vitest.browser.config.ts b/sdk/locks/arm-locks/vitest.browser.config.ts index 10e70dbfa8ee..182729ab5ce9 100644 --- a/sdk/locks/arm-locks/vitest.browser.config.ts +++ b/sdk/locks/arm-locks/vitest.browser.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. @@ -8,7 +9,7 @@ export default mergeConfig( viteConfig, defineConfig({ test: { - include: ["dist-test/browser/test/**/*.spec.js"], + include: ["dist-test/browser/test/**/*.spec.js",], testTimeout: 1200000, hookTimeout: 1200000, }, diff --git a/sdk/locks/arm-locks/vitest.config.ts b/sdk/locks/arm-locks/vitest.config.ts index 86a71911ccc2..40e031385dd8 100644 --- a/sdk/locks/arm-locks/vitest.config.ts +++ b/sdk/locks/arm-locks/vitest.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. diff --git a/sdk/locks/arm-locks/vitest.esm.config.ts b/sdk/locks/arm-locks/vitest.esm.config.ts index 5e9735e9b144..a70127279fc9 100644 --- a/sdk/locks/arm-locks/vitest.esm.config.ts +++ b/sdk/locks/arm-locks/vitest.esm.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. @@ -5,4 +6,7 @@ import { mergeConfig } from "vitest/config"; import vitestConfig from "./vitest.config.ts"; import vitestEsmConfig from "../../../vitest.esm.shared.config.ts"; -export default mergeConfig(vitestConfig, vitestEsmConfig); +export default mergeConfig( + vitestConfig, + vitestEsmConfig +); diff --git a/sdk/managedapplications/arm-managedapplications/CHANGELOG.md b/sdk/managedapplications/arm-managedapplications/CHANGELOG.md index 9d1f1444e5c3..a70c2a54c4a5 100644 --- a/sdk/managedapplications/arm-managedapplications/CHANGELOG.md +++ b/sdk/managedapplications/arm-managedapplications/CHANGELOG.md @@ -1,5 +1,118 @@ # Release History +## 4.0.0 (2025-04-28) + +### Features Added + + - Added operation ApplicationDefinitions.beginCreateOrUpdate + - Added operation ApplicationDefinitions.beginCreateOrUpdateAndWait + - Added operation ApplicationDefinitions.beginCreateOrUpdateById + - Added operation ApplicationDefinitions.beginCreateOrUpdateByIdAndWait + - Added operation ApplicationDefinitions.beginDelete + - Added operation ApplicationDefinitions.beginDeleteAndWait + - Added operation ApplicationDefinitions.beginDeleteById + - Added operation ApplicationDefinitions.beginDeleteByIdAndWait + - Added operation Applications.update + - Added operation Applications.updateById + - Added Interface ApplicationProviderAuthorization + - Interface ApplicationDefinitionsCreateOrUpdateByIdOptionalParams has a new optional parameter resumeFrom + - Interface ApplicationDefinitionsCreateOrUpdateByIdOptionalParams has a new optional parameter updateIntervalInMs + - Interface ApplicationDefinitionsCreateOrUpdateOptionalParams has a new optional parameter resumeFrom + - Interface ApplicationDefinitionsCreateOrUpdateOptionalParams has a new optional parameter updateIntervalInMs + - Interface ApplicationDefinitionsDeleteByIdOptionalParams has a new optional parameter resumeFrom + - Interface ApplicationDefinitionsDeleteByIdOptionalParams has a new optional parameter updateIntervalInMs + - Interface ApplicationDefinitionsDeleteOptionalParams has a new optional parameter resumeFrom + - Interface ApplicationDefinitionsDeleteOptionalParams has a new optional parameter updateIntervalInMs + - Interface ErrorResponse has a new optional parameter errorCode + - Interface ErrorResponse has a new optional parameter errorMessage + - Interface ErrorResponse has a new optional parameter httpStatus + - Interface GenericResource has a new optional parameter identity + - Enum KnownProvisioningState has a new value Created + - Enum KnownProvisioningState has a new value Creating + - Enum KnownProvisioningState has a new value Ready + +### Breaking Changes + + - Removed operation group JitRequests + - Removed operation ApplicationDefinitions.createOrUpdate + - Removed operation ApplicationDefinitions.createOrUpdateById + - Removed operation ApplicationDefinitions.delete + - Removed operation ApplicationDefinitions.deleteById + - Removed operation ApplicationDefinitions.listBySubscription + - Removed operation ApplicationDefinitions.update + - Removed operation ApplicationDefinitions.updateById + - Removed operation Applications.beginRefreshPermissions + - Removed operation Applications.beginRefreshPermissionsAndWait + - Removed operation Applications.beginUpdate + - Removed operation Applications.beginUpdateAccess + - Removed operation Applications.beginUpdateAccessAndWait + - Removed operation Applications.beginUpdateAndWait + - Removed operation Applications.beginUpdateById + - Removed operation Applications.beginUpdateByIdAndWait + - Removed operation Applications.listAllowedUpgradePlans + - Removed operation Applications.listTokens + - Interface Application no longer has parameter artifacts + - Interface Application no longer has parameter authorizations + - Interface Application no longer has parameter billingDetails + - Interface Application no longer has parameter createdBy + - Interface Application no longer has parameter customerSupport + - Interface Application no longer has parameter jitAccessPolicy + - Interface Application no longer has parameter managementMode + - Interface Application no longer has parameter publisherTenantId + - Interface Application no longer has parameter supportUrls + - Interface Application no longer has parameter updatedBy + - Interface ApplicationDefinition no longer has parameter deploymentPolicy + - Interface ApplicationDefinition no longer has parameter lockingPolicy + - Interface ApplicationDefinition no longer has parameter managementPolicy + - Interface ApplicationDefinition no longer has parameter notificationPolicy + - Interface ApplicationDefinition no longer has parameter policies + - Interface ApplicationDefinition no longer has parameter storageAccountId + - Interface ApplicationPatchable no longer has parameter artifacts + - Interface ApplicationPatchable no longer has parameter authorizations + - Interface ApplicationPatchable no longer has parameter billingDetails + - Interface ApplicationPatchable no longer has parameter createdBy + - Interface ApplicationPatchable no longer has parameter customerSupport + - Interface ApplicationPatchable no longer has parameter jitAccessPolicy + - Interface ApplicationPatchable no longer has parameter managementMode + - Interface ApplicationPatchable no longer has parameter publisherTenantId + - Interface ApplicationPatchable no longer has parameter supportUrls + - Interface ApplicationPatchable no longer has parameter updatedBy + - Interface ApplicationsUpdateByIdOptionalParams no longer has parameter resumeFrom + - Interface ApplicationsUpdateByIdOptionalParams no longer has parameter updateIntervalInMs + - Interface ApplicationsUpdateOptionalParams no longer has parameter resumeFrom + - Interface ApplicationsUpdateOptionalParams no longer has parameter updateIntervalInMs + - Interface ErrorResponse no longer has parameter error + - Interface Identity no longer has parameter userAssignedIdentities + - Interface Operation no longer has parameter actionType + - Interface Operation no longer has parameter isDataAction + - Interface Operation no longer has parameter origin + - Interface OperationDisplay no longer has parameter description + - Interface Resource no longer has parameter systemData + - Parameter managedResourceGroupId of interface Application is now required + - Parameter authorizations of interface ApplicationDefinition is now required + - Type of parameter name of interface ApplicationArtifact is changed from ApplicationArtifactName to string + - Type of parameter artifacts of interface ApplicationDefinition is changed from ApplicationDefinitionArtifact[] to ApplicationArtifact[] + - Type of parameter authorizations of interface ApplicationDefinition is changed from ApplicationAuthorization[] to ApplicationProviderAuthorization[] + - Type of parameter isEnabled of interface ApplicationDefinition is changed from boolean to string + - Type of parameter parameters of interface ApplicationsUpdateByIdOptionalParams is changed from ApplicationPatchable to Application + - Type of parameter type of interface Identity is changed from ResourceIdentityType to "SystemAssigned" + - Class ApplicationClient no longer has parameter jitRequests + - Removed Enum KnownActionType + - Removed Enum KnownApplicationArtifactName + - Removed Enum KnownApplicationDefinitionArtifactName + - Removed Enum KnownApplicationManagementMode + - Removed Enum KnownCreatedByType + - Removed Enum KnownDeploymentMode + - Removed Enum KnownJitApprovalMode + - Removed Enum KnownJitApproverType + - Removed Enum KnownJitRequestState + - Removed Enum KnownJitSchedulingType + - Removed Enum KnownOrigin + - Removed Enum KnownStatus + - Removed Enum KnownSubstatus + - Enum KnownProvisioningState no longer has value NotSpecified + + ## 3.0.0 (2023-09-06) ### Features Added @@ -195,7 +308,7 @@ ## 2.0.1 (2022-04-18) -### Features Added +**features** - Bug fix @@ -207,4 +320,4 @@ To understand the detail of the change, please refer to [Changelog](https://aka. To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). -To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ). +To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart). diff --git a/sdk/managedapplications/arm-managedapplications/LICENSE b/sdk/managedapplications/arm-managedapplications/LICENSE index b2f52a2bad4e..63447fd8bbbf 100644 --- a/sdk/managedapplications/arm-managedapplications/LICENSE +++ b/sdk/managedapplications/arm-managedapplications/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/managedapplications/arm-managedapplications/README.md b/sdk/managedapplications/arm-managedapplications/README.md index 7d6a055080d9..6fe072a4fc4d 100644 --- a/sdk/managedapplications/arm-managedapplications/README.md +++ b/sdk/managedapplications/arm-managedapplications/README.md @@ -44,7 +44,6 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure Application** 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 +63,14 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur import { InteractiveBrowserCredential } from "@azure/identity"; import { ApplicationClient } from "@azure/arm-managedapplications"; -const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", - clientId: "", -}); + clientId: "" + }); const client = new ApplicationClient(credential, subscriptionId); ``` ### JavaScript Bundle - To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). ## Key concepts @@ -108,6 +105,7 @@ 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/ diff --git a/sdk/managedapplications/arm-managedapplications/_meta.json b/sdk/managedapplications/arm-managedapplications/_meta.json index 7831af9b9a54..c37acc89bcac 100644 --- a/sdk/managedapplications/arm-managedapplications/_meta.json +++ b/sdk/managedapplications/arm-managedapplications/_meta.json @@ -1,8 +1,8 @@ { - "commit": "baa82396a21dcc1c79a6aeea185589749515012d", - "readme": "specification/solutions/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\\solutions\\resource-manager\\readme.md --use=@autorest/typescript@6.0.8 --generate-sample=true", + "commit": "fcbc290cc06b0d69207105d83bb7dac49c21675b", + "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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/resources/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.2", - "use": "@autorest/typescript@6.0.8" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.26", + "use": "@autorest/typescript@^6.0.12" } diff --git a/sdk/managedapplications/arm-managedapplications/api-extractor.json b/sdk/managedapplications/arm-managedapplications/api-extractor.json index 292b8442d8e6..1b7adbe88f15 100644 --- a/sdk/managedapplications/arm-managedapplications/api-extractor.json +++ b/sdk/managedapplications/arm-managedapplications/api-extractor.json @@ -28,4 +28,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/managedapplications/arm-managedapplications/package.json b/sdk/managedapplications/arm-managedapplications/package.json index 03d6edcca729..5bb3df86de26 100644 --- a/sdk/managedapplications/arm-managedapplications/package.json +++ b/sdk/managedapplications/arm-managedapplications/package.json @@ -3,17 +3,17 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ApplicationClient.", - "version": "3.0.0", + "version": "4.0.0", "engines": { "node": ">=18.0.0" }, "dependencies": { "@azure/abort-controller": "^2.1.2", "@azure/core-auth": "^1.9.0", - "@azure/core-client": "^1.9.2", + "@azure/core-client": "^1.9.3", "@azure/core-lro": "^2.5.4", "@azure/core-paging": "^1.6.2", - "@azure/core-rest-pipeline": "^1.19.0", + "@azure/core-rest-pipeline": "^1.19.1", "tslib": "^2.8.1" }, "keywords": [ @@ -28,18 +28,19 @@ "main": "./dist/commonjs/index.js", "module": "./dist/esm/index.js", "types": "./dist/commonjs/index.d.ts", + "type": "module", "devDependencies": { "@azure-tools/test-credential": "^2.0.0", "@azure-tools/test-recorder": "^4.1.0", "@azure-tools/test-utils-vitest": "^1.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.6.0", + "@azure/identity": "^4.9.1", "@azure/logger": "^1.1.4", "@types/node": "^18.0.0", "@vitest/browser": "^3.0.9", "@vitest/coverage-istanbul": "^3.0.9", "dotenv": "^16.0.0", - "playwright": "^1.50.1", + "playwright": "^1.52.0", "typescript": "~5.8.2", "vitest": "^3.0.9" }, @@ -60,16 +61,16 @@ "build:node": "echo skipped", "build:samples": "echo skipped.", "build:test": "echo skipped", - "check-format": "echo skipped", + "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", "clean": "dev-tool run vendored 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", + "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "integration-test:browser": "echo skipped", "integration-test:node": "dev-tool run test:vitest --esm", "lint": "echo skipped", - "minify": "echo skipped", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", "pack": "npm pack 2>&1", "prepack": "npm run build", "test": "npm run integration-test", @@ -90,16 +91,9 @@ ] }, "autoPublish": true, + "browser": "./dist/browser/index.js", + "react-native": "./dist/react-native/index.js", "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/managedapplications/arm-managedapplications", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-managedapplications?view=azure-node-preview" - }, - "type": "module", "tshy": { "project": "./tsconfig.src.json", "exports": { @@ -116,8 +110,6 @@ ], "selfLink": false }, - "browser": "./dist/browser/index.js", - "react-native": "./dist/react-native/index.js", "exports": { "./package.json": "./package.json", ".": { @@ -139,4 +131,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/managedapplications/arm-managedapplications/review/arm-managedapplications.api.md b/sdk/managedapplications/arm-managedapplications/review/arm-managedapplications.api.md index 1d237eded796..5e482eb6142f 100644 --- a/sdk/managedapplications/arm-managedapplications/review/arm-managedapplications.api.md +++ b/sdk/managedapplications/arm-managedapplications/review/arm-managedapplications.api.md @@ -10,59 +10,26 @@ import { OperationState } from '@azure/core-lro'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; import { SimplePollerLike } from '@azure/core-lro'; -// @public -export type ActionType = string; - -// @public -export interface AllowedUpgradePlansResult { - value?: Plan[]; -} - // @public export interface Application extends GenericResource { applicationDefinitionId?: string; - readonly artifacts?: ApplicationArtifact[]; - readonly authorizations?: ApplicationAuthorization[]; - readonly billingDetails?: ApplicationBillingDetailsDefinition; - readonly createdBy?: ApplicationClientDetails; - readonly customerSupport?: ApplicationPackageContact; - identity?: Identity; - jitAccessPolicy?: ApplicationJitAccessPolicy; kind: string; - managedResourceGroupId?: string; - readonly managementMode?: ApplicationManagementMode; + managedResourceGroupId: string; readonly outputs?: Record; parameters?: Record; plan?: Plan; readonly provisioningState?: ProvisioningState; - readonly publisherTenantId?: string; - readonly supportUrls?: ApplicationPackageSupportUrls; - readonly updatedBy?: ApplicationClientDetails; } // @public export interface ApplicationArtifact { - name: ApplicationArtifactName; - type: ApplicationArtifactType; - uri: string; -} - -// @public -export type ApplicationArtifactName = string; - -// @public -export type ApplicationArtifactType = "NotSpecified" | "Template" | "Custom"; - -// @public -export interface ApplicationAuthorization { - principalId: string; - roleDefinitionId: string; + name?: string; + type?: ApplicationArtifactType; + uri?: string; } // @public -export interface ApplicationBillingDetailsDefinition { - resourceUsageId?: string; -} +export type ApplicationArtifactType = "Template" | "Custom"; // @public (undocumented) export class ApplicationClient extends coreClient.ServiceClient { @@ -76,20 +43,11 @@ export class ApplicationClient extends coreClient.ServiceClient { applicationDefinitions: ApplicationDefinitions; // (undocumented) applications: Applications; - // (undocumented) - jitRequests: JitRequests; listOperations(options?: ListOperationsOptionalParams): PagedAsyncIterableIterator; // (undocumented) subscriptionId?: string; } -// @public -export interface ApplicationClientDetails { - applicationId?: string; - oid?: string; - puid?: string; -} - // @public export interface ApplicationClientOptionalParams extends coreClient.ServiceClientOptions { $host?: string; @@ -99,62 +57,42 @@ export interface ApplicationClientOptionalParams extends coreClient.ServiceClien // @public export interface ApplicationDefinition extends GenericResource { - artifacts?: ApplicationDefinitionArtifact[]; - authorizations?: ApplicationAuthorization[]; + artifacts?: ApplicationArtifact[]; + authorizations: ApplicationProviderAuthorization[]; createUiDefinition?: Record; - deploymentPolicy?: ApplicationDeploymentPolicy; description?: string; displayName?: string; - isEnabled?: boolean; - lockingPolicy?: ApplicationPackageLockingPolicyDefinition; + isEnabled?: string; lockLevel: ApplicationLockLevel; mainTemplate?: Record; - managementPolicy?: ApplicationManagementPolicy; - notificationPolicy?: ApplicationNotificationPolicy; packageFileUri?: string; - policies?: ApplicationPolicy[]; - storageAccountId?: string; } -// @public -export interface ApplicationDefinitionArtifact { - name: ApplicationDefinitionArtifactName; - type: ApplicationArtifactType; - uri: string; -} - -// @public -export type ApplicationDefinitionArtifactName = string; - // @public export interface ApplicationDefinitionListResult { nextLink?: string; value?: ApplicationDefinition[]; } -// @public -export interface ApplicationDefinitionPatchable { - tags?: { - [propertyName: string]: string; - }; -} - // @public export interface ApplicationDefinitions { - createOrUpdate(resourceGroupName: string, applicationDefinitionName: string, parameters: ApplicationDefinition, options?: ApplicationDefinitionsCreateOrUpdateOptionalParams): Promise; - createOrUpdateById(resourceGroupName: string, applicationDefinitionName: string, parameters: ApplicationDefinition, options?: ApplicationDefinitionsCreateOrUpdateByIdOptionalParams): Promise; - delete(resourceGroupName: string, applicationDefinitionName: string, options?: ApplicationDefinitionsDeleteOptionalParams): Promise; - deleteById(resourceGroupName: string, applicationDefinitionName: string, options?: ApplicationDefinitionsDeleteByIdOptionalParams): Promise; + beginCreateOrUpdate(resourceGroupName: string, applicationDefinitionName: string, parameters: ApplicationDefinition, options?: ApplicationDefinitionsCreateOrUpdateOptionalParams): Promise, ApplicationDefinitionsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, applicationDefinitionName: string, parameters: ApplicationDefinition, options?: ApplicationDefinitionsCreateOrUpdateOptionalParams): Promise; + beginCreateOrUpdateById(resourceGroupName: string, applicationDefinitionName: string, parameters: ApplicationDefinition, options?: ApplicationDefinitionsCreateOrUpdateByIdOptionalParams): Promise, ApplicationDefinitionsCreateOrUpdateByIdResponse>>; + beginCreateOrUpdateByIdAndWait(resourceGroupName: string, applicationDefinitionName: string, parameters: ApplicationDefinition, options?: ApplicationDefinitionsCreateOrUpdateByIdOptionalParams): Promise; + beginDelete(resourceGroupName: string, applicationDefinitionName: string, options?: ApplicationDefinitionsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, applicationDefinitionName: string, options?: ApplicationDefinitionsDeleteOptionalParams): Promise; + beginDeleteById(resourceGroupName: string, applicationDefinitionName: string, options?: ApplicationDefinitionsDeleteByIdOptionalParams): Promise, void>>; + beginDeleteByIdAndWait(resourceGroupName: string, applicationDefinitionName: string, options?: ApplicationDefinitionsDeleteByIdOptionalParams): Promise; get(resourceGroupName: string, applicationDefinitionName: string, options?: ApplicationDefinitionsGetOptionalParams): Promise; getById(resourceGroupName: string, applicationDefinitionName: string, options?: ApplicationDefinitionsGetByIdOptionalParams): Promise; listByResourceGroup(resourceGroupName: string, options?: ApplicationDefinitionsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; - listBySubscription(options?: ApplicationDefinitionsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; - update(resourceGroupName: string, applicationDefinitionName: string, parameters: ApplicationDefinitionPatchable, options?: ApplicationDefinitionsUpdateOptionalParams): Promise; - updateById(resourceGroupName: string, applicationDefinitionName: string, parameters: ApplicationDefinitionPatchable, options?: ApplicationDefinitionsUpdateByIdOptionalParams): Promise; } // @public export interface ApplicationDefinitionsCreateOrUpdateByIdOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public @@ -162,6 +100,8 @@ export type ApplicationDefinitionsCreateOrUpdateByIdResponse = ApplicationDefini // @public export interface ApplicationDefinitionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public @@ -169,10 +109,14 @@ export type ApplicationDefinitionsCreateOrUpdateResponse = ApplicationDefinition // @public export interface ApplicationDefinitionsDeleteByIdOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public export interface ApplicationDefinitionsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public @@ -203,47 +147,6 @@ export interface ApplicationDefinitionsListByResourceGroupOptionalParams extends // @public export type ApplicationDefinitionsListByResourceGroupResponse = ApplicationDefinitionListResult; -// @public -export interface ApplicationDefinitionsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ApplicationDefinitionsListBySubscriptionNextResponse = ApplicationDefinitionListResult; - -// @public -export interface ApplicationDefinitionsListBySubscriptionOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ApplicationDefinitionsListBySubscriptionResponse = ApplicationDefinitionListResult; - -// @public -export interface ApplicationDefinitionsUpdateByIdOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ApplicationDefinitionsUpdateByIdResponse = ApplicationDefinition; - -// @public -export interface ApplicationDefinitionsUpdateOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ApplicationDefinitionsUpdateResponse = ApplicationDefinition; - -// @public -export interface ApplicationDeploymentPolicy { - deploymentMode: DeploymentMode; -} - -// @public -export interface ApplicationJitAccessPolicy { - jitAccessEnabled: boolean; - jitApprovalMode?: JitApprovalMode; - jitApprovers?: JitApproverDefinition[]; - maximumJitAccessDuration?: string; -} - // @public export interface ApplicationListResult { nextLink?: string; @@ -253,70 +156,21 @@ export interface ApplicationListResult { // @public export type ApplicationLockLevel = "CanNotDelete" | "ReadOnly" | "None"; -// @public -export type ApplicationManagementMode = string; - -// @public -export interface ApplicationManagementPolicy { - mode?: ApplicationManagementMode; -} - -// @public -export interface ApplicationNotificationEndpoint { - uri: string; -} - -// @public -export interface ApplicationNotificationPolicy { - notificationEndpoints: ApplicationNotificationEndpoint[]; -} - -// @public -export interface ApplicationPackageContact { - contactName?: string; - email: string; - phone: string; -} - -// @public -export interface ApplicationPackageLockingPolicyDefinition { - allowedActions?: string[]; - allowedDataActions?: string[]; -} - -// @public -export interface ApplicationPackageSupportUrls { - governmentCloud?: string; - publicAzure?: string; -} - // @public export interface ApplicationPatchable extends GenericResource { applicationDefinitionId?: string; - readonly artifacts?: ApplicationArtifact[]; - readonly authorizations?: ApplicationAuthorization[]; - readonly billingDetails?: ApplicationBillingDetailsDefinition; - readonly createdBy?: ApplicationClientDetails; - readonly customerSupport?: ApplicationPackageContact; - identity?: Identity; - jitAccessPolicy?: ApplicationJitAccessPolicy; kind?: string; managedResourceGroupId?: string; - readonly managementMode?: ApplicationManagementMode; readonly outputs?: Record; parameters?: Record; plan?: PlanPatchable; readonly provisioningState?: ProvisioningState; - readonly publisherTenantId?: string; - readonly supportUrls?: ApplicationPackageSupportUrls; - readonly updatedBy?: ApplicationClientDetails; } // @public -export interface ApplicationPolicy { - name?: string; - parameters?: string; - policyDefinitionId?: string; +export interface ApplicationProviderAuthorization { + principalId: string; + roleDefinitionId: string; } // @public @@ -329,20 +183,12 @@ export interface Applications { beginDeleteAndWait(resourceGroupName: string, applicationName: string, options?: ApplicationsDeleteOptionalParams): Promise; beginDeleteById(applicationId: string, options?: ApplicationsDeleteByIdOptionalParams): Promise, void>>; beginDeleteByIdAndWait(applicationId: string, options?: ApplicationsDeleteByIdOptionalParams): Promise; - beginRefreshPermissions(resourceGroupName: string, applicationName: string, options?: ApplicationsRefreshPermissionsOptionalParams): Promise, void>>; - beginRefreshPermissionsAndWait(resourceGroupName: string, applicationName: string, options?: ApplicationsRefreshPermissionsOptionalParams): Promise; - beginUpdate(resourceGroupName: string, applicationName: string, options?: ApplicationsUpdateOptionalParams): Promise, ApplicationsUpdateResponse>>; - beginUpdateAccess(resourceGroupName: string, applicationName: string, parameters: UpdateAccessDefinition, options?: ApplicationsUpdateAccessOptionalParams): Promise, void>>; - beginUpdateAccessAndWait(resourceGroupName: string, applicationName: string, parameters: UpdateAccessDefinition, options?: ApplicationsUpdateAccessOptionalParams): Promise; - beginUpdateAndWait(resourceGroupName: string, applicationName: string, options?: ApplicationsUpdateOptionalParams): Promise; - beginUpdateById(applicationId: string, options?: ApplicationsUpdateByIdOptionalParams): Promise, ApplicationsUpdateByIdResponse>>; - beginUpdateByIdAndWait(applicationId: string, options?: ApplicationsUpdateByIdOptionalParams): Promise; get(resourceGroupName: string, applicationName: string, options?: ApplicationsGetOptionalParams): Promise; getById(applicationId: string, options?: ApplicationsGetByIdOptionalParams): Promise; - listAllowedUpgradePlans(resourceGroupName: string, applicationName: string, options?: ApplicationsListAllowedUpgradePlansOptionalParams): Promise; listByResourceGroup(resourceGroupName: string, options?: ApplicationsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; listBySubscription(options?: ApplicationsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; - listTokens(resourceGroupName: string, applicationName: string, parameters: ListTokenRequest, options?: ApplicationsListTokensOptionalParams): Promise; + update(resourceGroupName: string, applicationName: string, options?: ApplicationsUpdateOptionalParams): Promise; + updateById(applicationId: string, options?: ApplicationsUpdateByIdOptionalParams): Promise; } // @public @@ -389,13 +235,6 @@ export interface ApplicationsGetOptionalParams extends coreClient.OperationOptio // @public export type ApplicationsGetResponse = Application; -// @public -export interface ApplicationsListAllowedUpgradePlansOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ApplicationsListAllowedUpgradePlansResponse = AllowedUpgradePlansResult; - // @public export interface ApplicationsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { } @@ -424,73 +263,32 @@ export interface ApplicationsListBySubscriptionOptionalParams extends coreClient // @public export type ApplicationsListBySubscriptionResponse = ApplicationListResult; -// @public -export interface ApplicationsListTokensOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ApplicationsListTokensResponse = ManagedIdentityTokenResult; - -// @public -export interface ApplicationsRefreshPermissionsOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export interface ApplicationsUpdateAccessOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - // @public export interface ApplicationsUpdateByIdOptionalParams extends coreClient.OperationOptions { - parameters?: ApplicationPatchable; - resumeFrom?: string; - updateIntervalInMs?: number; + parameters?: Application; } // @public -export type ApplicationsUpdateByIdResponse = ApplicationPatchable; +export type ApplicationsUpdateByIdResponse = Application; // @public export interface ApplicationsUpdateOptionalParams extends coreClient.OperationOptions { parameters?: ApplicationPatchable; - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type ApplicationsUpdateResponse = ApplicationPatchable; - -// @public -export type CreatedByType = string; - -// @public -export type DeploymentMode = string; - -// @public -export interface ErrorAdditionalInfo { - readonly info?: Record; - readonly type?: string; } // @public -export interface ErrorDetail { - readonly additionalInfo?: ErrorAdditionalInfo[]; - readonly code?: string; - readonly details?: ErrorDetail[]; - readonly message?: string; - readonly target?: string; -} +export type ApplicationsUpdateResponse = Application; // @public export interface ErrorResponse { - error?: ErrorDetail; + errorCode?: string; + errorMessage?: string; + httpStatus?: string; } // @public export interface GenericResource extends Resource { + identity?: Identity; managedBy?: string; sku?: Sku; } @@ -502,241 +300,24 @@ export function getContinuationToken(page: unknown): string | undefined; export interface Identity { readonly principalId?: string; readonly tenantId?: string; - type?: ResourceIdentityType; - userAssignedIdentities?: { - [propertyName: string]: UserAssignedResourceIdentity; - }; -} - -// @public -export type JitApprovalMode = string; - -// @public -export interface JitApproverDefinition { - displayName?: string; - id: string; - type?: JitApproverType; -} - -// @public -export type JitApproverType = string; - -// @public -export interface JitAuthorizationPolicies { - principalId: string; - roleDefinitionId: string; -} - -// @public -export interface JitRequestDefinition extends Resource { - applicationResourceId?: string; - readonly createdBy?: ApplicationClientDetails; - jitAuthorizationPolicies?: JitAuthorizationPolicies[]; - readonly jitRequestState?: JitRequestState; - jitSchedulingPolicy?: JitSchedulingPolicy; - readonly provisioningState?: ProvisioningState; - readonly publisherTenantId?: string; - readonly updatedBy?: ApplicationClientDetails; -} - -// @public -export interface JitRequestDefinitionListResult { - nextLink?: string; - value?: JitRequestDefinition[]; -} - -// @public -export interface JitRequestMetadata { - originRequestId?: string; - requestorId?: string; - subjectDisplayName?: string; - tenantDisplayName?: string; -} - -// @public -export interface JitRequestPatchable { - tags?: { - [propertyName: string]: string; - }; -} - -// @public -export interface JitRequests { - beginCreateOrUpdate(resourceGroupName: string, jitRequestName: string, parameters: JitRequestDefinition, options?: JitRequestsCreateOrUpdateOptionalParams): Promise, JitRequestsCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, jitRequestName: string, parameters: JitRequestDefinition, options?: JitRequestsCreateOrUpdateOptionalParams): Promise; - delete(resourceGroupName: string, jitRequestName: string, options?: JitRequestsDeleteOptionalParams): Promise; - get(resourceGroupName: string, jitRequestName: string, options?: JitRequestsGetOptionalParams): Promise; - listByResourceGroup(resourceGroupName: string, options?: JitRequestsListByResourceGroupOptionalParams): Promise; - listBySubscription(options?: JitRequestsListBySubscriptionOptionalParams): Promise; - update(resourceGroupName: string, jitRequestName: string, parameters: JitRequestPatchable, options?: JitRequestsUpdateOptionalParams): Promise; -} - -// @public -export interface JitRequestsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type JitRequestsCreateOrUpdateResponse = JitRequestDefinition; - -// @public -export interface JitRequestsDeleteOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface JitRequestsGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type JitRequestsGetResponse = JitRequestDefinition; - -// @public -export interface JitRequestsListByResourceGroupOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type JitRequestsListByResourceGroupResponse = JitRequestDefinitionListResult; - -// @public -export interface JitRequestsListBySubscriptionOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type JitRequestsListBySubscriptionResponse = JitRequestDefinitionListResult; - -// @public -export type JitRequestState = string; - -// @public -export interface JitRequestsUpdateOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type JitRequestsUpdateResponse = JitRequestDefinition; - -// @public -export interface JitSchedulingPolicy { - duration: string; - startTime: Date; - type: JitSchedulingType; -} - -// @public -export type JitSchedulingType = string; - -// @public -export enum KnownActionType { - Internal = "Internal" -} - -// @public -export enum KnownApplicationArtifactName { - Authorizations = "Authorizations", - CustomRoleDefinition = "CustomRoleDefinition", - NotSpecified = "NotSpecified", - ViewDefinition = "ViewDefinition" -} - -// @public -export enum KnownApplicationDefinitionArtifactName { - ApplicationResourceTemplate = "ApplicationResourceTemplate", - CreateUiDefinition = "CreateUiDefinition", - MainTemplateParameters = "MainTemplateParameters", - NotSpecified = "NotSpecified" -} - -// @public -export enum KnownApplicationManagementMode { - Managed = "Managed", - NotSpecified = "NotSpecified", - Unmanaged = "Unmanaged" -} - -// @public -export enum KnownCreatedByType { - Application = "Application", - Key = "Key", - ManagedIdentity = "ManagedIdentity", - User = "User" -} - -// @public -export enum KnownDeploymentMode { - Complete = "Complete", - Incremental = "Incremental", - NotSpecified = "NotSpecified" -} - -// @public -export enum KnownJitApprovalMode { - AutoApprove = "AutoApprove", - ManualApprove = "ManualApprove", - NotSpecified = "NotSpecified" -} - -// @public -export enum KnownJitApproverType { - Group = "group", - User = "user" -} - -// @public -export enum KnownJitRequestState { - Approved = "Approved", - Canceled = "Canceled", - Denied = "Denied", - Expired = "Expired", - Failed = "Failed", - NotSpecified = "NotSpecified", - Pending = "Pending", - Timeout = "Timeout" -} - -// @public -export enum KnownJitSchedulingType { - NotSpecified = "NotSpecified", - Once = "Once", - Recurring = "Recurring" -} - -// @public -export enum KnownOrigin { - System = "system", - User = "user", - UserSystem = "user,system" + type?: "SystemAssigned"; } // @public export enum KnownProvisioningState { Accepted = "Accepted", Canceled = "Canceled", + Created = "Created", + Creating = "Creating", Deleted = "Deleted", Deleting = "Deleting", Failed = "Failed", - NotSpecified = "NotSpecified", + Ready = "Ready", Running = "Running", Succeeded = "Succeeded", Updating = "Updating" } -// @public -export enum KnownStatus { - Elevate = "Elevate", - NotSpecified = "NotSpecified", - Remove = "Remove" -} - -// @public -export enum KnownSubstatus { - Approved = "Approved", - Denied = "Denied", - Expired = "Expired", - Failed = "Failed", - NotSpecified = "NotSpecified", - Timeout = "Timeout" -} - // @public export interface ListOperationsNextOptionalParams extends coreClient.OperationOptions { } @@ -751,54 +332,25 @@ export interface ListOperationsOptionalParams extends coreClient.OperationOption // @public export type ListOperationsResponse = OperationListResult; -// @public -export interface ListTokenRequest { - authorizationAudience?: string; - userAssignedIdentities?: string[]; -} - -// @public -export interface ManagedIdentityToken { - accessToken?: string; - authorizationAudience?: string; - expiresIn?: string; - expiresOn?: string; - notBefore?: string; - resourceId?: string; - tokenType?: string; -} - -// @public -export interface ManagedIdentityTokenResult { - value?: ManagedIdentityToken[]; -} - // @public export interface Operation { - readonly actionType?: ActionType; display?: OperationDisplay; - readonly isDataAction?: boolean; - readonly name?: string; - readonly origin?: Origin; + name?: string; } // @public export interface OperationDisplay { - readonly description?: string; - readonly operation?: string; - readonly provider?: string; - readonly resource?: string; + operation?: string; + provider?: string; + resource?: string; } // @public export interface OperationListResult { - readonly nextLink?: string; - readonly value?: Operation[]; + nextLink?: string; + value?: Operation[]; } -// @public -export type Origin = string; - // @public export interface Plan { name: string; @@ -825,16 +377,12 @@ export interface Resource { readonly id?: string; location?: string; readonly name?: string; - readonly systemData?: SystemData; tags?: { [propertyName: string]: string; }; readonly type?: string; } -// @public -export type ResourceIdentityType = "SystemAssigned" | "UserAssigned" | "SystemAssigned, UserAssigned" | "None"; - // @public export interface Sku { capacity?: number; @@ -845,36 +393,6 @@ export interface Sku { tier?: string; } -// @public -export type Status = string; - -// @public -export type Substatus = string; - -// @public -export interface SystemData { - createdAt?: Date; - createdBy?: string; - createdByType?: CreatedByType; - lastModifiedAt?: Date; - lastModifiedBy?: string; - lastModifiedByType?: CreatedByType; -} - -// @public -export interface UpdateAccessDefinition { - approver?: string; - metadata: JitRequestMetadata; - status: Status; - subStatus: Substatus; -} - -// @public -export interface UserAssignedResourceIdentity { - readonly principalId?: string; - readonly tenantId?: string; -} - // (No @packageDocumentation comment for this package) ``` diff --git a/sdk/managedapplications/arm-managedapplications/sample.env b/sdk/managedapplications/arm-managedapplications/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/managedapplications/arm-managedapplications/sample.env +++ b/sdk/managedapplications/arm-managedapplications/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/managedapplications/arm-managedapplications/src/applicationClient.ts b/sdk/managedapplications/arm-managedapplications/src/applicationClient.ts index 5db616ca3a88..7ac23ee248cf 100644 --- a/sdk/managedapplications/arm-managedapplications/src/applicationClient.ts +++ b/sdk/managedapplications/arm-managedapplications/src/applicationClient.ts @@ -8,24 +8,12 @@ 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 { PipelineRequest, PipelineResponse, SendRequest } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { setContinuationToken } from "./pagingHelper.js"; -import { - ApplicationsImpl, - ApplicationDefinitionsImpl, - JitRequestsImpl -} from "./operations/index.js"; -import { - Applications, - ApplicationDefinitions, - JitRequests -} from "./operationsInterfaces/index.js"; +import { ApplicationsImpl, ApplicationDefinitionsImpl } from "./operations/index.js"; +import { Applications, ApplicationDefinitions } from "./operationsInterfaces/index.js"; import * as Parameters from "./models/parameters.js"; import * as Mappers from "./models/mappers.js"; import { @@ -34,7 +22,7 @@ import { ListOperationsNextOptionalParams, ListOperationsOptionalParams, ListOperationsResponse, - ListOperationsNextResponse + ListOperationsNextResponse, } from "./models/index.js"; /// @@ -52,16 +40,13 @@ export class ApplicationClient extends coreClient.ServiceClient { constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: ApplicationClientOptionalParams - ); - constructor( - credentials: coreAuth.TokenCredential, - options?: ApplicationClientOptionalParams + options?: ApplicationClientOptionalParams, ); + constructor(credentials: coreAuth.TokenCredential, options?: ApplicationClientOptionalParams); constructor( credentials: coreAuth.TokenCredential, subscriptionIdOrOptions?: ApplicationClientOptionalParams | string, - options?: ApplicationClientOptionalParams + options?: ApplicationClientOptionalParams, ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); @@ -81,10 +66,10 @@ export class ApplicationClient extends coreClient.ServiceClient { } const defaults: ApplicationClientOptionalParams = { requestContentType: "application/json; charset=utf-8", - credential: credentials + credential: credentials, }; - const packageDetails = `azsdk-js-arm-managedapplications/3.0.0`; + const packageDetails = `azsdk-js-arm-managedapplications/4.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -94,20 +79,19 @@ export class ApplicationClient extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, - endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + 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(); + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => - pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName + pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -117,19 +101,17 @@ export class ApplicationClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ credential: credentials, scopes: - optionsWithDefaults.credentialScopes ?? - `${optionsWithDefaults.endpoint}/.default`, + optionsWithDefaults.credentialScopes ?? `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -137,10 +119,9 @@ export class ApplicationClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-07-01"; + this.apiVersion = options.apiVersion || "2018-06-01"; this.applications = new ApplicationsImpl(this); this.applicationDefinitions = new ApplicationDefinitionsImpl(this); - this.jitRequests = new JitRequestsImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -151,10 +132,7 @@ export class ApplicationClient extends coreClient.ServiceClient { } const apiVersionPolicy = { name: "CustomApiVersionPolicy", - async sendRequest( - request: PipelineRequest, - next: SendRequest - ): Promise { + async sendRequest(request: PipelineRequest, next: SendRequest): Promise { const param = request.url.split("?"); if (param.length > 1) { const newParams = param[1].split("&").map((item) => { @@ -167,7 +145,7 @@ export class ApplicationClient extends coreClient.ServiceClient { request.url = param[0] + "?" + newParams.join("&"); } return next(request); - } + }, }; this.pipeline.addPolicy(apiVersionPolicy); } @@ -177,7 +155,7 @@ export class ApplicationClient extends coreClient.ServiceClient { * @param options The options parameters. */ public listOperations( - options?: ListOperationsOptionalParams + options?: ListOperationsOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listOperationsPagingAll(options); return { @@ -192,13 +170,13 @@ export class ApplicationClient extends coreClient.ServiceClient { throw new Error("maxPageSize is not supported by this operation."); } return this.listOperationsPagingPage(options, settings); - } + }, }; } private async *listOperationsPagingPage( options?: ListOperationsOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ListOperationsResponse; let continuationToken = settings?.continuationToken; @@ -219,7 +197,7 @@ export class ApplicationClient extends coreClient.ServiceClient { } private async *listOperationsPagingAll( - options?: ListOperationsOptionalParams + options?: ListOperationsOptionalParams, ): AsyncIterableIterator { for await (const page of this.listOperationsPagingPage(options)) { yield* page; @@ -230,9 +208,7 @@ export class ApplicationClient extends coreClient.ServiceClient { * Lists all of the available Microsoft.Solutions REST API operations. * @param options The options parameters. */ - private _listOperations( - options?: ListOperationsOptionalParams - ): Promise { + private _listOperations(options?: ListOperationsOptionalParams): Promise { return this.sendOperationRequest({ options }, listOperationsOperationSpec); } @@ -243,17 +219,13 @@ export class ApplicationClient extends coreClient.ServiceClient { */ private _listOperationsNext( nextLink: string, - options?: ListOperationsNextOptionalParams + options?: ListOperationsNextOptionalParams, ): Promise { - return this.sendOperationRequest( - { nextLink, options }, - listOperationsNextOperationSpec - ); + return this.sendOperationRequest({ nextLink, options }, listOperationsNextOperationSpec); } applications: Applications; applicationDefinitions: ApplicationDefinitions; - jitRequests: JitRequests; } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); @@ -263,29 +235,23 @@ const listOperationsOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, - default: { - bodyMapper: Mappers.ErrorResponse - } }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; const listOperationsNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, - default: { - bodyMapper: Mappers.ErrorResponse - } }, urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/managedapplications/arm-managedapplications/src/lroImpl.ts b/sdk/managedapplications/arm-managedapplications/src/lroImpl.ts index a1dab276a1b7..1b3a95e6c540 100644 --- a/sdk/managedapplications/arm-managedapplications/src/lroImpl.ts +++ b/sdk/managedapplications/arm-managedapplications/src/lroImpl.ts @@ -5,6 +5,7 @@ * 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"; @@ -22,17 +23,14 @@ export function createLroSpec(inputs: { requestMethod: spec.httpMethod, requestPath: spec.path!, sendInitialRequest: () => sendOperationFn(args, spec), - sendPollRequest: ( - path: string, - options?: { abortSignal?: AbortSignalLike } - ) => { + sendPollRequest: (path: string, options?: { abortSignal?: AbortSignalLike }) => { const { requestBody, ...restSpec } = spec; return sendOperationFn(args, { ...restSpec, httpMethod: "GET", path, - abortSignal: options?.abortSignal + abortSignal: options?.abortSignal, }); - } + }, }; } diff --git a/sdk/managedapplications/arm-managedapplications/src/models/index.ts b/sdk/managedapplications/arm-managedapplications/src/models/index.ts index 0882498520ef..2d3045177546 100644 --- a/sdk/managedapplications/arm-managedapplications/src/models/index.ts +++ b/sdk/managedapplications/arm-managedapplications/src/models/index.ts @@ -8,191 +8,30 @@ import * as coreClient from "@azure/core-client"; -/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ +/** Result of the request to list Microsoft.Solutions operations. It contains a list of operations and a URL link to get the next set of results. */ export interface OperationListResult { - /** - * List of operations supported by the resource provider - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: Operation[]; - /** - * URL to get the next set of operation list results (if there are any). - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; + /** List of Microsoft.Solutions operations. */ + value?: Operation[]; + /** URL to get the next set of operation list results if there are any. */ + nextLink?: string; } -/** Details of a REST API operation, returned from the Resource Provider Operations API */ +/** Microsoft.Solutions operation */ export interface Operation { - /** - * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isDataAction?: boolean; - /** Localized display information for this particular operation. */ + /** Operation name: {provider}/{resource}/{operation} */ + name?: string; + /** The object that represents the operation. */ display?: OperationDisplay; - /** - * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly origin?: Origin; - /** - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly actionType?: ActionType; } -/** Localized display information for this particular operation. */ +/** The object that represents the operation. */ export interface OperationDisplay { - /** - * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provider?: string; - /** - * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly resource?: string; - /** - * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly operation?: string; - /** - * The short, localized friendly description of the operation; suitable for tool tips and detailed views. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly description?: string; -} - -/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ -export interface ErrorResponse { - /** The error object. */ - error?: ErrorDetail; -} - -/** The error detail. */ -export interface ErrorDetail { - /** - * The error code. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly code?: string; - /** - * The error message. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly message?: string; - /** - * The error target. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly target?: string; - /** - * The error details. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly details?: ErrorDetail[]; - /** - * The error additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly additionalInfo?: ErrorAdditionalInfo[]; -} - -/** The resource management error additional info. */ -export interface ErrorAdditionalInfo { - /** - * The additional info type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * The additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly info?: Record; -} - -/** Managed application billing details definition. */ -export interface ApplicationBillingDetailsDefinition { - /** The managed application resource usage Id. */ - resourceUsageId?: string; -} - -/** Managed application Jit access policy. */ -export interface ApplicationJitAccessPolicy { - /** Whether the JIT access is enabled. */ - jitAccessEnabled: boolean; - /** JIT approval mode. */ - jitApprovalMode?: JitApprovalMode; - /** The JIT approvers */ - jitApprovers?: JitApproverDefinition[]; - /** The maximum duration JIT access is granted. This is an ISO8601 time period value. */ - maximumJitAccessDuration?: string; -} - -/** JIT approver definition. */ -export interface JitApproverDefinition { - /** The approver service principal Id. */ - id: string; - /** The approver type. */ - type?: JitApproverType; - /** The approver display name. */ - displayName?: string; -} - -/** The managed application provider authorization. */ -export interface ApplicationAuthorization { - /** The provider's principal identifier. This is the identity that the provider will use to call ARM to manage the managed application resources. */ - principalId: string; - /** The provider's role definition identifier. This role will define all the permissions that the provider must have on the managed application's container resource group. This role definition cannot have permission to delete the resource group. */ - roleDefinitionId: string; -} - -/** The application package contact information. */ -export interface ApplicationPackageContact { - /** The contact name. */ - contactName?: string; - /** The contact email. */ - email: string; - /** The contact phone number. */ - phone: string; -} - -/** The appliance package support URLs. */ -export interface ApplicationPackageSupportUrls { - /** The public azure support URL. */ - publicAzure?: string; - /** The government cloud support URL. */ - governmentCloud?: string; -} - -/** Managed application artifact. */ -export interface ApplicationArtifact { - /** The managed application artifact name. */ - name: ApplicationArtifactName; - /** The managed application artifact blob uri. */ - uri: string; - /** The managed application artifact type. */ - type: ApplicationArtifactType; -} - -/** The application client details to track the entity creating/updating the managed app resource. */ -export interface ApplicationClientDetails { - /** The client Oid. */ - oid?: string; - /** The client Puid */ - puid?: string; - /** The client application Id. */ - applicationId?: string; + /** Service provider: Microsoft.Solutions */ + provider?: string; + /** Resource on which the operation is performed: Application, JitRequest, etc. */ + resource?: string; + /** Operation type: Read, write, delete, etc. */ + operation?: string; } /** Plan for the managed application. */ @@ -209,40 +48,6 @@ export interface Plan { version: string; } -/** Identity for the resource. */ -export interface Identity { - /** - * The principal ID of resource identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalId?: string; - /** - * The tenant ID of resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly tenantId?: string; - /** The identity type. */ - type?: ResourceIdentityType; - /** The list of user identities associated with the resource. The user identity dictionary key references will be resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ - userAssignedIdentities?: { - [propertyName: string]: UserAssignedResourceIdentity; - }; -} - -/** Represents the user assigned identity that is contained within the UserAssignedIdentities dictionary on ResourceIdentity */ -export interface UserAssignedResourceIdentity { - /** - * The principal id of user assigned identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalId?: string; - /** - * The tenant id of user assigned identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly tenantId?: string; -} - /** SKU for the resource. */ export interface Sku { /** The SKU name. */ @@ -259,6 +64,22 @@ export interface Sku { capacity?: number; } +/** Identity for the resource. */ +export interface Identity { + /** + * The principal ID of resource identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The tenant ID of resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** The identity type. */ + type?: "SystemAssigned"; +} + /** Resource information. */ export interface Resource { /** @@ -280,27 +101,16 @@ export interface Resource { location?: string; /** Resource tags */ tags?: { [propertyName: string]: string }; - /** - * Metadata pertaining to creation and last modification of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; } -/** 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; +/** Error response indicates managed application is not able to process the incoming request. The reason is provided in the error message. */ +export interface ErrorResponse { + /** Http status code. */ + httpStatus?: string; + /** Error code. */ + errorCode?: string; + /** Error message indicating why the operation failed. */ + errorMessage?: string; } /** Plan for the managed application. */ @@ -317,62 +127,22 @@ export interface PlanPatchable { version?: string; } -/** Application definition artifact. */ -export interface ApplicationDefinitionArtifact { - /** The managed application definition artifact name. */ - name: ApplicationDefinitionArtifactName; - /** The managed application definition artifact blob uri. */ - uri: string; - /** The managed application definition artifact type. */ - type: ApplicationArtifactType; -} - -/** Managed application notification policy. */ -export interface ApplicationNotificationPolicy { - /** The managed application notification endpoint. */ - notificationEndpoints: ApplicationNotificationEndpoint[]; -} - -/** Managed application notification endpoint. */ -export interface ApplicationNotificationEndpoint { - /** The managed application notification endpoint uri. */ - uri: string; -} - -/** Managed application locking policy. */ -export interface ApplicationPackageLockingPolicyDefinition { - /** The deny assignment excluded actions. */ - allowedActions?: string[]; - /** The deny assignment excluded data actions. */ - allowedDataActions?: string[]; -} - -/** Managed application deployment policy. */ -export interface ApplicationDeploymentPolicy { - /** The managed application deployment mode. */ - deploymentMode: DeploymentMode; -} - -/** Managed application management policy. */ -export interface ApplicationManagementPolicy { - /** The managed application management mode. */ - mode?: ApplicationManagementMode; +/** The managed application provider authorization. */ +export interface ApplicationProviderAuthorization { + /** The provider's principal identifier. This is the identity that the provider will use to call ARM to manage the managed application resources. */ + principalId: string; + /** The provider's role definition identifier. This role will define all the permissions that the provider must have on the managed application's container resource group. This role definition cannot have permission to delete the resource group. */ + roleDefinitionId: string; } -/** Managed application policy. */ -export interface ApplicationPolicy { - /** The policy name */ +/** Managed application artifact. */ +export interface ApplicationArtifact { + /** The managed application artifact name. */ name?: string; - /** The policy definition Id. */ - policyDefinitionId?: string; - /** The policy parameters. */ - parameters?: string; -} - -/** Information about an application definition request. */ -export interface ApplicationDefinitionPatchable { - /** Application definition tags */ - tags?: { [propertyName: string]: string }; + /** The managed application artifact blob uri. */ + uri?: string; + /** The managed application artifact type. */ + type?: ApplicationArtifactType; } /** List of managed application definitions. */ @@ -391,141 +161,14 @@ export interface ApplicationListResult { nextLink?: string; } -/** The JIT authorization policies. */ -export interface JitAuthorizationPolicies { - /** The the principal id that will be granted JIT access. */ - principalId: string; - /** The role definition id that will be granted to the Principal. */ - roleDefinitionId: string; -} - -/** The JIT scheduling policies. */ -export interface JitSchedulingPolicy { - /** The type of JIT schedule. */ - type: JitSchedulingType; - /** The required duration of the JIT request. */ - duration: string; - /** The start time of the request. */ - startTime: Date; -} - -/** Information about JIT request. */ -export interface JitRequestPatchable { - /** Jit request tags */ - tags?: { [propertyName: string]: string }; -} - -/** List of JIT requests. */ -export interface JitRequestDefinitionListResult { - /** The array of Jit request definition. */ - value?: JitRequestDefinition[]; - /** The URL to use for getting the next set of results. */ - nextLink?: string; -} - -/** The array of plan. */ -export interface AllowedUpgradePlansResult { - /** The array of plans. */ - value?: Plan[]; -} - -/** Update access request definition. */ -export interface UpdateAccessDefinition { - /** The approver name. */ - approver?: string; - /** The JIT request metadata. */ - metadata: JitRequestMetadata; - /** The JIT status. */ - status: Status; - /** The JIT status. */ - subStatus: Substatus; -} - -/** The JIT request metadata. */ -export interface JitRequestMetadata { - /** The origin request id. */ - originRequestId?: string; - /** The requestor id. */ - requestorId?: string; - /** The publisher's tenant name. */ - tenantDisplayName?: string; - /** The subject display name. */ - subjectDisplayName?: string; -} - -/** List token request body. */ -export interface ListTokenRequest { - /** The authorization audience. */ - authorizationAudience?: string; - /** The user assigned identities. */ - userAssignedIdentities?: string[]; -} - -/** The array of managed identity tokens. */ -export interface ManagedIdentityTokenResult { - /** The array of managed identity tokens. */ - value?: ManagedIdentityToken[]; -} - -/** The managed identity token for the managed app resource. */ -export interface ManagedIdentityToken { - /** The requested access token. */ - accessToken?: string; - /** The number of seconds the access token will be valid. */ - expiresIn?: string; - /** The timespan when the access token expires. This is represented as the number of seconds from epoch. */ - expiresOn?: string; - /** The timespan when the access token takes effect. This is represented as the number of seconds from epoch. */ - notBefore?: string; - /** The aud (audience) the access token was request for. This is the same as what was provided in the listTokens request. */ - authorizationAudience?: string; - /** The Azure resource ID for the issued token. This is either the managed application ID or the user-assigned identity ID. */ - resourceId?: string; - /** The type of the token. */ - tokenType?: string; -} - /** Resource information. */ export interface GenericResource extends Resource { /** ID of the resource that manages this resource. */ managedBy?: string; /** The SKU of the resource. */ sku?: Sku; -} - -/** Information about JIT request definition. */ -export interface JitRequestDefinition extends Resource { - /** The parent application id. */ - applicationResourceId?: string; - /** - * The publisher tenant id. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly publisherTenantId?: string; - /** The JIT authorization policies. */ - jitAuthorizationPolicies?: JitAuthorizationPolicies[]; - /** The JIT request properties. */ - jitSchedulingPolicy?: JitSchedulingPolicy; - /** - * The JIT request provisioning state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningState; - /** - * The JIT request state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly jitRequestState?: JitRequestState; - /** - * The client entity that created the JIT request. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly createdBy?: ApplicationClientDetails; - /** - * The client entity that last updated the JIT request. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly updatedBy?: ApplicationClientDetails; + /** The identity of the resource. */ + identity?: Identity; } /** Information about managed application. */ @@ -534,10 +177,8 @@ export interface Application extends GenericResource { plan?: Plan; /** The kind of the managed application. Allowed values are MarketPlace and ServiceCatalog. */ kind: string; - /** The identity of the resource. */ - identity?: Identity; /** The managed resource group Id. */ - managedResourceGroupId?: string; + managedResourceGroupId: string; /** The fully qualified path of managed application definition Id. */ applicationDefinitionId?: string; /** Name and value pairs that define the managed application parameters. It can be a JObject or a well formed JSON string. */ @@ -552,53 +193,6 @@ export interface Application extends GenericResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; - /** - * The managed application billing details. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly billingDetails?: ApplicationBillingDetailsDefinition; - /** The managed application Jit access policy. */ - jitAccessPolicy?: ApplicationJitAccessPolicy; - /** - * The publisher tenant Id. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly publisherTenantId?: string; - /** - * The read-only authorizations property that is retrieved from the application package. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly authorizations?: ApplicationAuthorization[]; - /** - * The managed application management mode. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly managementMode?: ApplicationManagementMode; - /** - * The read-only customer support property that is retrieved from the application package. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly customerSupport?: ApplicationPackageContact; - /** - * The read-only support URLs property that is retrieved from the application package. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly supportUrls?: ApplicationPackageSupportUrls; - /** - * The collection of managed application artifacts. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly artifacts?: ApplicationArtifact[]; - /** - * The client entity that created the JIT request. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly createdBy?: ApplicationClientDetails; - /** - * The client entity that last updated the JIT request. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly updatedBy?: ApplicationClientDetails; } /** Information about managed application. */ @@ -607,8 +201,6 @@ export interface ApplicationPatchable extends GenericResource { plan?: PlanPatchable; /** The kind of the managed application. Allowed values are MarketPlace and ServiceCatalog. */ kind?: string; - /** The identity of the resource. */ - identity?: Identity; /** The managed resource group Id. */ managedResourceGroupId?: string; /** The fully qualified path of managed application definition Id. */ @@ -625,53 +217,6 @@ export interface ApplicationPatchable extends GenericResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; - /** - * The managed application billing details. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly billingDetails?: ApplicationBillingDetailsDefinition; - /** The managed application Jit access policy. */ - jitAccessPolicy?: ApplicationJitAccessPolicy; - /** - * The publisher tenant Id. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly publisherTenantId?: string; - /** - * The read-only authorizations property that is retrieved from the application package. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly authorizations?: ApplicationAuthorization[]; - /** - * The managed application management mode. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly managementMode?: ApplicationManagementMode; - /** - * The read-only customer support property that is retrieved from the application package. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly customerSupport?: ApplicationPackageContact; - /** - * The read-only support URLs property that is retrieved from the application package. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly supportUrls?: ApplicationPackageSupportUrls; - /** - * The collection of managed application artifacts. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly artifacts?: ApplicationArtifact[]; - /** - * The client entity that created the JIT request. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly createdBy?: ApplicationClientDetails; - /** - * The client entity that last updated the JIT request. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly updatedBy?: ApplicationClientDetails; } /** Information about managed application definition. */ @@ -681,77 +226,33 @@ export interface ApplicationDefinition extends GenericResource { /** The managed application definition display name. */ displayName?: string; /** A value indicating whether the package is enabled or not. */ - isEnabled?: boolean; + isEnabled?: string; /** The managed application provider authorizations. */ - authorizations?: ApplicationAuthorization[]; + authorizations: ApplicationProviderAuthorization[]; /** The collection of managed application artifacts. The portal will use the files specified as artifacts to construct the user experience of creating a managed application from a managed application definition. */ - artifacts?: ApplicationDefinitionArtifact[]; + artifacts?: ApplicationArtifact[]; /** The managed application definition description. */ description?: string; /** The managed application definition package file Uri. Use this element */ packageFileUri?: string; - /** The storage account id for bring your own storage scenario. */ - storageAccountId?: string; /** The inline main template json which has resources to be provisioned. It can be a JObject or well-formed JSON string. */ mainTemplate?: Record; /** The createUiDefinition json for the backing template with Microsoft.Solutions/applications resource. It can be a JObject or well-formed JSON string. */ createUiDefinition?: Record; - /** The managed application notification policy. */ - notificationPolicy?: ApplicationNotificationPolicy; - /** The managed application locking policy. */ - lockingPolicy?: ApplicationPackageLockingPolicyDefinition; - /** The managed application deployment policy. */ - deploymentPolicy?: ApplicationDeploymentPolicy; - /** The managed application management policy that determines publisher's access to the managed resource group. */ - managementPolicy?: ApplicationManagementPolicy; - /** The managed application provider policies. */ - policies?: ApplicationPolicy[]; -} - -/** Known values of {@link Origin} that the service accepts. */ -export enum KnownOrigin { - /** User */ - User = "user", - /** System */ - System = "system", - /** UserSystem */ - UserSystem = "user,system" } -/** - * Defines values for Origin. \ - * {@link KnownOrigin} can be used interchangeably with Origin, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **user** \ - * **system** \ - * **user,system** - */ -export type Origin = string; - -/** Known values of {@link ActionType} that the service accepts. */ -export enum KnownActionType { - /** Internal */ - Internal = "Internal" -} - -/** - * Defines values for ActionType. \ - * {@link KnownActionType} can be used interchangeably with ActionType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Internal** - */ -export type ActionType = string; - /** Known values of {@link ProvisioningState} that the service accepts. */ export enum KnownProvisioningState { - /** NotSpecified */ - NotSpecified = "NotSpecified", /** Accepted */ Accepted = "Accepted", /** Running */ Running = "Running", + /** Ready */ + Ready = "Ready", + /** Creating */ + Creating = "Creating", + /** Created */ + Created = "Created", /** Deleting */ Deleting = "Deleting", /** Deleted */ @@ -763,7 +264,7 @@ export enum KnownProvisioningState { /** Succeeded */ Succeeded = "Succeeded", /** Updating */ - Updating = "Updating" + Updating = "Updating", } /** @@ -771,9 +272,11 @@ export enum KnownProvisioningState { * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **NotSpecified** \ * **Accepted** \ * **Running** \ + * **Ready** \ + * **Creating** \ + * **Created** \ * **Deleting** \ * **Deleted** \ * **Canceled** \ @@ -782,302 +285,31 @@ export enum KnownProvisioningState { * **Updating** */ export type ProvisioningState = string; - -/** Known values of {@link JitApprovalMode} that the service accepts. */ -export enum KnownJitApprovalMode { - /** NotSpecified */ - NotSpecified = "NotSpecified", - /** AutoApprove */ - AutoApprove = "AutoApprove", - /** ManualApprove */ - ManualApprove = "ManualApprove" -} - -/** - * Defines values for JitApprovalMode. \ - * {@link KnownJitApprovalMode} can be used interchangeably with JitApprovalMode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **NotSpecified** \ - * **AutoApprove** \ - * **ManualApprove** - */ -export type JitApprovalMode = string; - -/** Known values of {@link JitApproverType} that the service accepts. */ -export enum KnownJitApproverType { - /** User */ - User = "user", - /** Group */ - Group = "group" -} - -/** - * Defines values for JitApproverType. \ - * {@link KnownJitApproverType} can be used interchangeably with JitApproverType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **user** \ - * **group** - */ -export type JitApproverType = string; - -/** Known values of {@link ApplicationManagementMode} that the service accepts. */ -export enum KnownApplicationManagementMode { - /** NotSpecified */ - NotSpecified = "NotSpecified", - /** Unmanaged */ - Unmanaged = "Unmanaged", - /** Managed */ - Managed = "Managed" -} - -/** - * Defines values for ApplicationManagementMode. \ - * {@link KnownApplicationManagementMode} can be used interchangeably with ApplicationManagementMode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **NotSpecified** \ - * **Unmanaged** \ - * **Managed** - */ -export type ApplicationManagementMode = string; - -/** Known values of {@link ApplicationArtifactName} that the service accepts. */ -export enum KnownApplicationArtifactName { - /** NotSpecified */ - NotSpecified = "NotSpecified", - /** ViewDefinition */ - ViewDefinition = "ViewDefinition", - /** Authorizations */ - Authorizations = "Authorizations", - /** CustomRoleDefinition */ - CustomRoleDefinition = "CustomRoleDefinition" -} - -/** - * Defines values for ApplicationArtifactName. \ - * {@link KnownApplicationArtifactName} can be used interchangeably with ApplicationArtifactName, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **NotSpecified** \ - * **ViewDefinition** \ - * **Authorizations** \ - * **CustomRoleDefinition** - */ -export type ApplicationArtifactName = 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 ApplicationDefinitionArtifactName} that the service accepts. */ -export enum KnownApplicationDefinitionArtifactName { - /** NotSpecified */ - NotSpecified = "NotSpecified", - /** ApplicationResourceTemplate */ - ApplicationResourceTemplate = "ApplicationResourceTemplate", - /** CreateUiDefinition */ - CreateUiDefinition = "CreateUiDefinition", - /** MainTemplateParameters */ - MainTemplateParameters = "MainTemplateParameters" -} - -/** - * Defines values for ApplicationDefinitionArtifactName. \ - * {@link KnownApplicationDefinitionArtifactName} can be used interchangeably with ApplicationDefinitionArtifactName, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **NotSpecified** \ - * **ApplicationResourceTemplate** \ - * **CreateUiDefinition** \ - * **MainTemplateParameters** - */ -export type ApplicationDefinitionArtifactName = string; - -/** Known values of {@link DeploymentMode} that the service accepts. */ -export enum KnownDeploymentMode { - /** NotSpecified */ - NotSpecified = "NotSpecified", - /** Incremental */ - Incremental = "Incremental", - /** Complete */ - Complete = "Complete" -} - -/** - * Defines values for DeploymentMode. \ - * {@link KnownDeploymentMode} can be used interchangeably with DeploymentMode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **NotSpecified** \ - * **Incremental** \ - * **Complete** - */ -export type DeploymentMode = string; - -/** Known values of {@link JitSchedulingType} that the service accepts. */ -export enum KnownJitSchedulingType { - /** NotSpecified */ - NotSpecified = "NotSpecified", - /** Once */ - Once = "Once", - /** Recurring */ - Recurring = "Recurring" -} - -/** - * Defines values for JitSchedulingType. \ - * {@link KnownJitSchedulingType} can be used interchangeably with JitSchedulingType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **NotSpecified** \ - * **Once** \ - * **Recurring** - */ -export type JitSchedulingType = string; - -/** Known values of {@link JitRequestState} that the service accepts. */ -export enum KnownJitRequestState { - /** NotSpecified */ - NotSpecified = "NotSpecified", - /** Pending */ - Pending = "Pending", - /** Approved */ - Approved = "Approved", - /** Denied */ - Denied = "Denied", - /** Failed */ - Failed = "Failed", - /** Canceled */ - Canceled = "Canceled", - /** Expired */ - Expired = "Expired", - /** Timeout */ - Timeout = "Timeout" -} - -/** - * Defines values for JitRequestState. \ - * {@link KnownJitRequestState} can be used interchangeably with JitRequestState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **NotSpecified** \ - * **Pending** \ - * **Approved** \ - * **Denied** \ - * **Failed** \ - * **Canceled** \ - * **Expired** \ - * **Timeout** - */ -export type JitRequestState = string; - -/** Known values of {@link Status} that the service accepts. */ -export enum KnownStatus { - /** NotSpecified */ - NotSpecified = "NotSpecified", - /** Elevate */ - Elevate = "Elevate", - /** Remove */ - Remove = "Remove" -} - -/** - * Defines values for Status. \ - * {@link KnownStatus} can be used interchangeably with Status, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **NotSpecified** \ - * **Elevate** \ - * **Remove** - */ -export type Status = string; - -/** Known values of {@link Substatus} that the service accepts. */ -export enum KnownSubstatus { - /** NotSpecified */ - NotSpecified = "NotSpecified", - /** Approved */ - Approved = "Approved", - /** Denied */ - Denied = "Denied", - /** Failed */ - Failed = "Failed", - /** Expired */ - Expired = "Expired", - /** Timeout */ - Timeout = "Timeout" -} - -/** - * Defines values for Substatus. \ - * {@link KnownSubstatus} can be used interchangeably with Substatus, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **NotSpecified** \ - * **Approved** \ - * **Denied** \ - * **Failed** \ - * **Expired** \ - * **Timeout** - */ -export type Substatus = string; -/** Defines values for ApplicationArtifactType. */ -export type ApplicationArtifactType = "NotSpecified" | "Template" | "Custom"; -/** Defines values for ResourceIdentityType. */ -export type ResourceIdentityType = - | "SystemAssigned" - | "UserAssigned" - | "SystemAssigned, UserAssigned" - | "None"; /** Defines values for ApplicationLockLevel. */ export type ApplicationLockLevel = "CanNotDelete" | "ReadOnly" | "None"; +/** Defines values for ApplicationArtifactType. */ +export type ApplicationArtifactType = "Template" | "Custom"; /** Optional parameters. */ -export interface ListOperationsOptionalParams - extends coreClient.OperationOptions {} +export interface ListOperationsOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listOperations operation. */ export type ListOperationsResponse = OperationListResult; /** Optional parameters. */ -export interface ListOperationsNextOptionalParams - extends coreClient.OperationOptions {} +export interface ListOperationsNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listOperationsNext operation. */ export type ListOperationsNextResponse = OperationListResult; /** Optional parameters. */ -export interface ApplicationsGetOptionalParams - extends coreClient.OperationOptions {} +export interface ApplicationsGetOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ export type ApplicationsGetResponse = Application; /** Optional parameters. */ -export interface ApplicationsDeleteOptionalParams - extends coreClient.OperationOptions { +export interface ApplicationsDeleteOptionalParams 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. */ @@ -1085,8 +317,7 @@ export interface ApplicationsDeleteOptionalParams } /** Optional parameters. */ -export interface ApplicationsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions { +export interface ApplicationsCreateOrUpdateOptionalParams 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. */ @@ -1097,18 +328,13 @@ export interface ApplicationsCreateOrUpdateOptionalParams export type ApplicationsCreateOrUpdateResponse = Application; /** Optional parameters. */ -export interface ApplicationsUpdateOptionalParams - extends coreClient.OperationOptions { +export interface ApplicationsUpdateOptionalParams extends coreClient.OperationOptions { /** Parameters supplied to update an existing managed application. */ parameters?: ApplicationPatchable; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; } /** Contains response data for the update operation. */ -export type ApplicationsUpdateResponse = ApplicationPatchable; +export type ApplicationsUpdateResponse = Application; /** Optional parameters. */ export interface ApplicationsListByResourceGroupOptionalParams @@ -1118,22 +344,19 @@ export interface ApplicationsListByResourceGroupOptionalParams export type ApplicationsListByResourceGroupResponse = ApplicationListResult; /** Optional parameters. */ -export interface ApplicationsListBySubscriptionOptionalParams - extends coreClient.OperationOptions {} +export interface ApplicationsListBySubscriptionOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listBySubscription operation. */ export type ApplicationsListBySubscriptionResponse = ApplicationListResult; /** Optional parameters. */ -export interface ApplicationsGetByIdOptionalParams - extends coreClient.OperationOptions {} +export interface ApplicationsGetByIdOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the getById operation. */ export type ApplicationsGetByIdResponse = Application; /** Optional parameters. */ -export interface ApplicationsDeleteByIdOptionalParams - extends coreClient.OperationOptions { +export interface ApplicationsDeleteByIdOptionalParams 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. */ @@ -1141,8 +364,7 @@ export interface ApplicationsDeleteByIdOptionalParams } /** Optional parameters. */ -export interface ApplicationsCreateOrUpdateByIdOptionalParams - extends coreClient.OperationOptions { +export interface ApplicationsCreateOrUpdateByIdOptionalParams 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. */ @@ -1153,50 +375,13 @@ export interface ApplicationsCreateOrUpdateByIdOptionalParams export type ApplicationsCreateOrUpdateByIdResponse = Application; /** Optional parameters. */ -export interface ApplicationsUpdateByIdOptionalParams - extends coreClient.OperationOptions { +export interface ApplicationsUpdateByIdOptionalParams extends coreClient.OperationOptions { /** Parameters supplied to update an existing managed application. */ - parameters?: ApplicationPatchable; - /** 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; + parameters?: Application; } /** Contains response data for the updateById operation. */ -export type ApplicationsUpdateByIdResponse = ApplicationPatchable; - -/** Optional parameters. */ -export interface ApplicationsRefreshPermissionsOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface ApplicationsListAllowedUpgradePlansOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listAllowedUpgradePlans operation. */ -export type ApplicationsListAllowedUpgradePlansResponse = AllowedUpgradePlansResult; - -/** Optional parameters. */ -export interface ApplicationsUpdateAccessOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface ApplicationsListTokensOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listTokens operation. */ -export type ApplicationsListTokensResponse = ManagedIdentityTokenResult; +export type ApplicationsUpdateByIdResponse = Application; /** Optional parameters. */ export interface ApplicationsListByResourceGroupNextOptionalParams @@ -1213,30 +398,31 @@ export interface ApplicationsListBySubscriptionNextOptionalParams export type ApplicationsListBySubscriptionNextResponse = ApplicationListResult; /** Optional parameters. */ -export interface ApplicationDefinitionsGetOptionalParams - extends coreClient.OperationOptions {} +export interface ApplicationDefinitionsGetOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ export type ApplicationDefinitionsGetResponse = ApplicationDefinition; /** Optional parameters. */ -export interface ApplicationDefinitionsDeleteOptionalParams - extends coreClient.OperationOptions {} +export interface ApplicationDefinitionsDeleteOptionalParams extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} /** Optional parameters. */ export interface ApplicationDefinitionsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions {} + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} /** Contains response data for the createOrUpdate operation. */ export type ApplicationDefinitionsCreateOrUpdateResponse = ApplicationDefinition; -/** Optional parameters. */ -export interface ApplicationDefinitionsUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the update operation. */ -export type ApplicationDefinitionsUpdateResponse = ApplicationDefinition; - /** Optional parameters. */ export interface ApplicationDefinitionsListByResourceGroupOptionalParams extends coreClient.OperationOptions {} @@ -1245,60 +431,22 @@ export interface ApplicationDefinitionsListByResourceGroupOptionalParams export type ApplicationDefinitionsListByResourceGroupResponse = ApplicationDefinitionListResult; /** Optional parameters. */ -export interface ApplicationDefinitionsListBySubscriptionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscription operation. */ -export type ApplicationDefinitionsListBySubscriptionResponse = ApplicationDefinitionListResult; - -/** Optional parameters. */ -export interface ApplicationDefinitionsGetByIdOptionalParams - extends coreClient.OperationOptions {} +export interface ApplicationDefinitionsGetByIdOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the getById operation. */ export type ApplicationDefinitionsGetByIdResponse = ApplicationDefinition; /** Optional parameters. */ export interface ApplicationDefinitionsDeleteByIdOptionalParams - extends coreClient.OperationOptions {} + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} /** Optional parameters. */ export interface ApplicationDefinitionsCreateOrUpdateByIdOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the createOrUpdateById operation. */ -export type ApplicationDefinitionsCreateOrUpdateByIdResponse = ApplicationDefinition; - -/** Optional parameters. */ -export interface ApplicationDefinitionsUpdateByIdOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the updateById operation. */ -export type ApplicationDefinitionsUpdateByIdResponse = ApplicationDefinition; - -/** Optional parameters. */ -export interface ApplicationDefinitionsListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type ApplicationDefinitionsListByResourceGroupNextResponse = ApplicationDefinitionListResult; - -/** Optional parameters. */ -export interface ApplicationDefinitionsListBySubscriptionNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscriptionNext operation. */ -export type ApplicationDefinitionsListBySubscriptionNextResponse = ApplicationDefinitionListResult; - -/** Optional parameters. */ -export interface JitRequestsGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type JitRequestsGetResponse = JitRequestDefinition; - -/** Optional parameters. */ -export interface JitRequestsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; @@ -1306,37 +454,18 @@ export interface JitRequestsCreateOrUpdateOptionalParams resumeFrom?: string; } -/** Contains response data for the createOrUpdate operation. */ -export type JitRequestsCreateOrUpdateResponse = JitRequestDefinition; - -/** Optional parameters. */ -export interface JitRequestsUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the update operation. */ -export type JitRequestsUpdateResponse = JitRequestDefinition; - -/** Optional parameters. */ -export interface JitRequestsDeleteOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface JitRequestsListBySubscriptionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscription operation. */ -export type JitRequestsListBySubscriptionResponse = JitRequestDefinitionListResult; +/** Contains response data for the createOrUpdateById operation. */ +export type ApplicationDefinitionsCreateOrUpdateByIdResponse = ApplicationDefinition; /** Optional parameters. */ -export interface JitRequestsListByResourceGroupOptionalParams +export interface ApplicationDefinitionsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByResourceGroup operation. */ -export type JitRequestsListByResourceGroupResponse = JitRequestDefinitionListResult; +/** Contains response data for the listByResourceGroupNext operation. */ +export type ApplicationDefinitionsListByResourceGroupNextResponse = ApplicationDefinitionListResult; /** Optional parameters. */ -export interface ApplicationClientOptionalParams - extends coreClient.ServiceClientOptions { +export interface ApplicationClientOptionalParams extends coreClient.ServiceClientOptions { /** server parameter */ $host?: string; /** Api Version */ diff --git a/sdk/managedapplications/arm-managedapplications/src/models/mappers.ts b/sdk/managedapplications/arm-managedapplications/src/models/mappers.ts index 1e96dd7defa8..0eab0d3cac20 100644 --- a/sdk/managedapplications/arm-managedapplications/src/models/mappers.ts +++ b/sdk/managedapplications/arm-managedapplications/src/models/mappers.ts @@ -15,26 +15,24 @@ export const OperationListResult: coreClient.CompositeMapper = { modelProperties: { value: { serializedName: "value", - readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "Operation" - } - } - } + className: "Operation", + }, + }, + }, }, nextLink: { serializedName: "nextLink", - readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Operation: coreClient.CompositeMapper = { @@ -44,41 +42,19 @@ export const Operation: coreClient.CompositeMapper = { modelProperties: { name: { serializedName: "name", - readOnly: true, type: { - name: "String" - } - }, - isDataAction: { - serializedName: "isDataAction", - readOnly: true, - type: { - name: "Boolean" - } + name: "String", + }, }, display: { serializedName: "display", type: { name: "Composite", - className: "OperationDisplay" - } - }, - origin: { - serializedName: "origin", - readOnly: true, - type: { - name: "String" - } + className: "OperationDisplay", + }, }, - actionType: { - serializedName: "actionType", - readOnly: true, - type: { - name: "String" - } - } - } - } + }, + }, }; export const OperationDisplay: coreClient.CompositeMapper = { @@ -88,344 +64,24 @@ export const OperationDisplay: coreClient.CompositeMapper = { modelProperties: { provider: { serializedName: "provider", - readOnly: true, type: { - name: "String" - } + name: "String", + }, }, resource: { serializedName: "resource", - readOnly: true, type: { - name: "String" - } + name: "String", + }, }, operation: { serializedName: "operation", - readOnly: true, - type: { - name: "String" - } - }, - description: { - serializedName: "description", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const ErrorResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorResponse", - modelProperties: { - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ErrorDetail" - } - } - } - } -}; - -export const ErrorDetail: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorDetail", - modelProperties: { - code: { - serializedName: "code", - readOnly: true, - type: { - name: "String" - } - }, - message: { - serializedName: "message", - readOnly: true, - type: { - name: "String" - } - }, - target: { - serializedName: "target", - readOnly: true, - type: { - name: "String" - } - }, - details: { - serializedName: "details", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorDetail" - } - } - } - }, - additionalInfo: { - serializedName: "additionalInfo", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorAdditionalInfo" - } - } - } - } - } - } -}; - -export const ErrorAdditionalInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorAdditionalInfo", - modelProperties: { - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String" - } - }, - info: { - serializedName: "info", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } -}; - -export const ApplicationBillingDetailsDefinition: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationBillingDetailsDefinition", - modelProperties: { - resourceUsageId: { - serializedName: "resourceUsageId", - type: { - name: "String" - } - } - } - } -}; - -export const ApplicationJitAccessPolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationJitAccessPolicy", - modelProperties: { - jitAccessEnabled: { - serializedName: "jitAccessEnabled", - required: true, - type: { - name: "Boolean" - } - }, - jitApprovalMode: { - serializedName: "jitApprovalMode", - type: { - name: "String" - } - }, - jitApprovers: { - serializedName: "jitApprovers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "JitApproverDefinition" - } - } - } - }, - maximumJitAccessDuration: { - serializedName: "maximumJitAccessDuration", - type: { - name: "String" - } - } - } - } -}; - -export const JitApproverDefinition: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "JitApproverDefinition", - modelProperties: { - id: { - serializedName: "id", - required: true, - type: { - name: "String" - } - }, - type: { - serializedName: "type", - type: { - name: "String" - } - }, - displayName: { - serializedName: "displayName", - type: { - name: "String" - } - } - } - } -}; - -export const ApplicationAuthorization: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationAuthorization", - modelProperties: { - principalId: { - serializedName: "principalId", - required: true, type: { - name: "String" - } - }, - roleDefinitionId: { - serializedName: "roleDefinitionId", - required: true, - type: { - name: "String" - } - } - } - } -}; - -export const ApplicationPackageContact: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationPackageContact", - modelProperties: { - contactName: { - serializedName: "contactName", - type: { - name: "String" - } - }, - email: { - serializedName: "email", - required: true, - type: { - name: "String" - } - }, - phone: { - serializedName: "phone", - required: true, - type: { - name: "String" - } - } - } - } -}; - -export const ApplicationPackageSupportUrls: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationPackageSupportUrls", - modelProperties: { - publicAzure: { - serializedName: "publicAzure", - type: { - name: "String" - } - }, - governmentCloud: { - serializedName: "governmentCloud", - type: { - name: "String" - } - } - } - } -}; - -export const ApplicationArtifact: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationArtifact", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String" - } - }, - uri: { - serializedName: "uri", - required: true, - type: { - name: "String" - } - }, - type: { - serializedName: "type", - required: true, - type: { - name: "Enum", - allowedValues: ["NotSpecified", "Template", "Custom"] - } - } - } - } -}; - -export const ApplicationClientDetails: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationClientDetails", - modelProperties: { - oid: { - serializedName: "oid", - type: { - name: "String" - } - }, - puid: { - serializedName: "puid", - type: { - name: "String" - } + name: "String", + }, }, - applicationId: { - serializedName: "applicationId", - type: { - name: "String" - } - } - } - } + }, + }, }; export const Plan: coreClient.CompositeMapper = { @@ -437,108 +93,38 @@ export const Plan: coreClient.CompositeMapper = { serializedName: "name", required: true, type: { - name: "String" - } + name: "String", + }, }, publisher: { serializedName: "publisher", required: true, type: { - name: "String" - } + name: "String", + }, }, product: { serializedName: "product", required: true, type: { - name: "String" - } + name: "String", + }, }, promotionCode: { serializedName: "promotionCode", type: { - name: "String" - } + name: "String", + }, }, version: { serializedName: "version", required: true, type: { - name: "String" - } - } - } - } -}; - -export const Identity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Identity", - modelProperties: { - principalId: { - serializedName: "principalId", - readOnly: true, - type: { - name: "String" - } - }, - tenantId: { - serializedName: "tenantId", - readOnly: true, - type: { - name: "String" - } - }, - type: { - serializedName: "type", - type: { - name: "Enum", - allowedValues: [ - "SystemAssigned", - "UserAssigned", - "SystemAssigned, UserAssigned", - "None" - ] - } - }, - userAssignedIdentities: { - serializedName: "userAssignedIdentities", - type: { - name: "Dictionary", - value: { - type: { - name: "Composite", - className: "UserAssignedResourceIdentity" - } - } - } - } - } - } -}; - -export const UserAssignedResourceIdentity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UserAssignedResourceIdentity", - modelProperties: { - principalId: { - serializedName: "principalId", - readOnly: true, - type: { - name: "String" - } + name: "String", + }, }, - tenantId: { - serializedName: "tenantId", - readOnly: true, - type: { - name: "String" - } - } - } - } + }, + }, }; export const Sku: coreClient.CompositeMapper = { @@ -550,621 +136,238 @@ export const Sku: coreClient.CompositeMapper = { serializedName: "name", required: true, type: { - name: "String" - } + name: "String", + }, }, tier: { serializedName: "tier", type: { - name: "String" - } + name: "String", + }, }, size: { serializedName: "size", type: { - name: "String" - } + name: "String", + }, }, family: { serializedName: "family", type: { - name: "String" - } + name: "String", + }, }, model: { serializedName: "model", type: { - name: "String" - } + name: "String", + }, }, capacity: { serializedName: "capacity", type: { - name: "Number" - } - } - } - } + name: "Number", + }, + }, + }, + }, }; -export const Resource: coreClient.CompositeMapper = { +export const Identity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "Identity", modelProperties: { - id: { - serializedName: "id", + principalId: { + serializedName: "principalId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - name: { - serializedName: "name", + tenantId: { + serializedName: "tenantId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { + defaultValue: "SystemAssigned", + isConstant: true, serializedName: "type", - readOnly: true, type: { - name: "String" - } - }, - location: { - serializedName: "location", - type: { - name: "String" - } - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } + name: "String", + }, }, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData" - } - } - } - } + }, + }, }; -export const SystemData: coreClient.CompositeMapper = { +export const Resource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SystemData", + className: "Resource", 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", + id: { + serializedName: "id", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - lastModifiedAt: { - serializedName: "lastModifiedAt", - type: { - name: "DateTime" - } - } - } - } -}; - -export const PlanPatchable: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PlanPatchable", - modelProperties: { name: { serializedName: "name", + readOnly: true, type: { - name: "String" - } - }, - publisher: { - serializedName: "publisher", - type: { - name: "String" - } - }, - product: { - serializedName: "product", - type: { - name: "String" - } - }, - promotionCode: { - serializedName: "promotionCode", - type: { - name: "String" - } - }, - version: { - serializedName: "version", - type: { - name: "String" - } - } - } - } -}; - -export const ApplicationDefinitionArtifact: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationDefinitionArtifact", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String" - } - }, - uri: { - serializedName: "uri", - required: true, - type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", - required: true, - type: { - name: "Enum", - allowedValues: ["NotSpecified", "Template", "Custom"] - } - } - } - } -}; - -export const ApplicationNotificationPolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationNotificationPolicy", - modelProperties: { - notificationEndpoints: { - serializedName: "notificationEndpoints", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ApplicationNotificationEndpoint" - } - } - } - } - } - } -}; - -export const ApplicationNotificationEndpoint: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationNotificationEndpoint", - modelProperties: { - uri: { - serializedName: "uri", - required: true, - type: { - name: "String" - } - } - } - } -}; - -export const ApplicationPackageLockingPolicyDefinition: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationPackageLockingPolicyDefinition", - modelProperties: { - allowedActions: { - serializedName: "allowedActions", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - allowedDataActions: { - serializedName: "allowedDataActions", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - } - } - } -}; - -export const ApplicationDeploymentPolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationDeploymentPolicy", - modelProperties: { - deploymentMode: { - serializedName: "deploymentMode", - required: true, - type: { - name: "String" - } - } - } - } -}; - -export const ApplicationManagementPolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationManagementPolicy", - modelProperties: { - mode: { - serializedName: "mode", - type: { - name: "String" - } - } - } - } -}; - -export const ApplicationPolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationPolicy", - modelProperties: { - name: { - serializedName: "name", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - policyDefinitionId: { - serializedName: "policyDefinitionId", + location: { + serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, - parameters: { - serializedName: "parameters", - type: { - name: "String" - } - } - } - } -}; - -export const ApplicationDefinitionPatchable: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationDefinitionPatchable", - modelProperties: { tags: { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } -}; - -export const ApplicationDefinitionListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationDefinitionListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ApplicationDefinition" - } - } - } - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - } - } - } -}; - -export const ApplicationListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Application" - } - } - } - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - } - } - } -}; - -export const JitAuthorizationPolicies: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "JitAuthorizationPolicies", - modelProperties: { - principalId: { - serializedName: "principalId", - required: true, - type: { - name: "String" - } - }, - roleDefinitionId: { - serializedName: "roleDefinitionId", - required: true, - type: { - name: "String" - } - } - } - } -}; - -export const JitSchedulingPolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "JitSchedulingPolicy", - modelProperties: { - type: { - serializedName: "type", - required: true, - type: { - name: "String" - } - }, - duration: { - serializedName: "duration", - required: true, - type: { - name: "TimeSpan" - } + value: { type: { name: "String" } }, + }, }, - startTime: { - serializedName: "startTime", - required: true, - type: { - name: "DateTime" - } - } - } - } + }, + }, }; -export const JitRequestPatchable: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "JitRequestPatchable", - modelProperties: { - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } -}; - -export const JitRequestDefinitionListResult: coreClient.CompositeMapper = { +export const ErrorResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "JitRequestDefinitionListResult", + className: "ErrorResponse", modelProperties: { - value: { - serializedName: "value", + httpStatus: { + serializedName: "httpStatus", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "JitRequestDefinition" - } - } - } + name: "String", + }, }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - } - } - } -}; - -export const AllowedUpgradePlansResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AllowedUpgradePlansResult", - modelProperties: { - value: { - serializedName: "value", + errorCode: { + serializedName: "errorCode", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Plan" - } - } - } - } - } - } + name: "String", + }, + }, + errorMessage: { + serializedName: "errorMessage", + type: { + name: "String", + }, + }, + }, + }, }; -export const UpdateAccessDefinition: coreClient.CompositeMapper = { +export const PlanPatchable: coreClient.CompositeMapper = { type: { name: "Composite", - className: "UpdateAccessDefinition", + className: "PlanPatchable", modelProperties: { - approver: { - serializedName: "approver", + name: { + serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, - metadata: { - serializedName: "metadata", + publisher: { + serializedName: "publisher", type: { - name: "Composite", - className: "JitRequestMetadata" - } + name: "String", + }, }, - status: { - serializedName: "status", - required: true, + product: { + serializedName: "product", type: { - name: "String" - } + name: "String", + }, }, - subStatus: { - serializedName: "subStatus", - required: true, + promotionCode: { + serializedName: "promotionCode", + type: { + name: "String", + }, + }, + version: { + serializedName: "version", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const JitRequestMetadata: coreClient.CompositeMapper = { +export const ApplicationProviderAuthorization: coreClient.CompositeMapper = { type: { name: "Composite", - className: "JitRequestMetadata", + className: "ApplicationProviderAuthorization", modelProperties: { - originRequestId: { - serializedName: "originRequestId", - type: { - name: "String" - } - }, - requestorId: { - serializedName: "requestorId", + principalId: { + serializedName: "principalId", + required: true, type: { - name: "String" - } + name: "String", + }, }, - tenantDisplayName: { - serializedName: "tenantDisplayName", + roleDefinitionId: { + serializedName: "roleDefinitionId", + required: true, type: { - name: "String" - } + name: "String", + }, }, - subjectDisplayName: { - serializedName: "subjectDisplayName", - type: { - name: "String" - } - } - } - } + }, + }, }; -export const ListTokenRequest: coreClient.CompositeMapper = { +export const ApplicationArtifact: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ListTokenRequest", + className: "ApplicationArtifact", modelProperties: { - authorizationAudience: { - serializedName: "authorizationAudience", + name: { + serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, - userAssignedIdentities: { - serializedName: "userAssignedIdentities", + uri: { + serializedName: "uri", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - } - } - } + name: "String", + }, + }, + type: { + serializedName: "type", + type: { + name: "Enum", + allowedValues: ["Template", "Custom"], + }, + }, + }, + }, }; -export const ManagedIdentityTokenResult: coreClient.CompositeMapper = { +export const ApplicationDefinitionListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ManagedIdentityTokenResult", + className: "ApplicationDefinitionListResult", modelProperties: { value: { serializedName: "value", @@ -1173,64 +376,46 @@ export const ManagedIdentityTokenResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ManagedIdentityToken" - } - } - } - } - } - } + className: "ApplicationDefinition", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, }; -export const ManagedIdentityToken: coreClient.CompositeMapper = { +export const ApplicationListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ManagedIdentityToken", + className: "ApplicationListResult", modelProperties: { - accessToken: { - serializedName: "accessToken", - type: { - name: "String" - } - }, - expiresIn: { - serializedName: "expiresIn", - type: { - name: "String" - } - }, - expiresOn: { - serializedName: "expiresOn", - type: { - name: "String" - } - }, - notBefore: { - serializedName: "notBefore", - type: { - name: "String" - } - }, - authorizationAudience: { - serializedName: "authorizationAudience", + value: { + serializedName: "value", type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Application", + }, + }, + }, }, - resourceId: { - serializedName: "resourceId", + nextLink: { + serializedName: "nextLink", type: { - name: "String" - } + name: "String", + }, }, - tokenType: { - serializedName: "tokenType", - type: { - name: "String" - } - } - } - } + }, + }, }; export const GenericResource: coreClient.CompositeMapper = { @@ -1242,88 +427,25 @@ export const GenericResource: coreClient.CompositeMapper = { managedBy: { serializedName: "managedBy", type: { - name: "String" - } + name: "String", + }, }, sku: { serializedName: "sku", type: { name: "Composite", - className: "Sku" - } - } - } - } -}; - -export const JitRequestDefinition: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "JitRequestDefinition", - modelProperties: { - ...Resource.type.modelProperties, - applicationResourceId: { - serializedName: "properties.applicationResourceId", - type: { - name: "String" - } - }, - publisherTenantId: { - serializedName: "properties.publisherTenantId", - readOnly: true, - type: { - name: "String" - } - }, - jitAuthorizationPolicies: { - serializedName: "properties.jitAuthorizationPolicies", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "JitAuthorizationPolicies" - } - } - } - }, - jitSchedulingPolicy: { - serializedName: "properties.jitSchedulingPolicy", - type: { - name: "Composite", - className: "JitSchedulingPolicy" - } - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String" - } - }, - jitRequestState: { - serializedName: "properties.jitRequestState", - readOnly: true, - type: { - name: "String" - } + className: "Sku", + }, }, - createdBy: { - serializedName: "properties.createdBy", + identity: { + serializedName: "identity", type: { name: "Composite", - className: "ApplicationClientDetails" - } + className: "Identity", + }, }, - updatedBy: { - serializedName: "properties.updatedBy", - type: { - name: "Composite", - className: "ApplicationClientDetails" - } - } - } - } + }, + }, }; export const Application: coreClient.CompositeMapper = { @@ -1336,144 +458,56 @@ export const Application: coreClient.CompositeMapper = { serializedName: "plan", type: { name: "Composite", - className: "Plan" - } + className: "Plan", + }, }, kind: { constraints: { - Pattern: new RegExp("^[-\\w\\._,\\(\\)]+$") + Pattern: new RegExp("^[-\\w\\._,\\(\\)]+$"), }, serializedName: "kind", required: true, type: { - name: "String" - } - }, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "Identity" - } + name: "String", + }, }, managedResourceGroupId: { serializedName: "properties.managedResourceGroupId", + required: true, type: { - name: "String" - } + name: "String", + }, }, applicationDefinitionId: { serializedName: "properties.applicationDefinitionId", type: { - name: "String" - } + name: "String", + }, }, parameters: { serializedName: "properties.parameters", type: { name: "Dictionary", - value: { type: { name: "any" } } - } + value: { type: { name: "any" } }, + }, }, outputs: { serializedName: "properties.outputs", readOnly: true, type: { name: "Dictionary", - value: { type: { name: "any" } } - } + value: { type: { name: "any" } }, + }, }, provisioningState: { serializedName: "properties.provisioningState", readOnly: true, type: { - name: "String" - } - }, - billingDetails: { - serializedName: "properties.billingDetails", - type: { - name: "Composite", - className: "ApplicationBillingDetailsDefinition" - } - }, - jitAccessPolicy: { - serializedName: "properties.jitAccessPolicy", - type: { - name: "Composite", - className: "ApplicationJitAccessPolicy" - } - }, - publisherTenantId: { - serializedName: "properties.publisherTenantId", - readOnly: true, - type: { - name: "String" - } - }, - authorizations: { - serializedName: "properties.authorizations", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ApplicationAuthorization" - } - } - } - }, - managementMode: { - serializedName: "properties.managementMode", - readOnly: true, - type: { - name: "String" - } - }, - customerSupport: { - serializedName: "properties.customerSupport", - type: { - name: "Composite", - className: "ApplicationPackageContact" - } - }, - supportUrls: { - serializedName: "properties.supportUrls", - type: { - name: "Composite", - className: "ApplicationPackageSupportUrls" - } - }, - artifacts: { - serializedName: "properties.artifacts", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ApplicationArtifact" - } - } - } - }, - createdBy: { - serializedName: "properties.createdBy", - type: { - name: "Composite", - className: "ApplicationClientDetails" - } + name: "String", + }, }, - updatedBy: { - serializedName: "properties.updatedBy", - type: { - name: "Composite", - className: "ApplicationClientDetails" - } - } - } - } + }, + }, }; export const ApplicationPatchable: coreClient.CompositeMapper = { @@ -1486,143 +520,54 @@ export const ApplicationPatchable: coreClient.CompositeMapper = { serializedName: "plan", type: { name: "Composite", - className: "PlanPatchable" - } + className: "PlanPatchable", + }, }, kind: { constraints: { - Pattern: new RegExp("^[-\\w\\._,\\(\\)]+$") + Pattern: new RegExp("^[-\\w\\._,\\(\\)]+$"), }, serializedName: "kind", type: { - name: "String" - } - }, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "Identity" - } + name: "String", + }, }, managedResourceGroupId: { serializedName: "properties.managedResourceGroupId", type: { - name: "String" - } + name: "String", + }, }, applicationDefinitionId: { serializedName: "properties.applicationDefinitionId", type: { - name: "String" - } + name: "String", + }, }, parameters: { serializedName: "properties.parameters", type: { name: "Dictionary", - value: { type: { name: "any" } } - } + value: { type: { name: "any" } }, + }, }, outputs: { serializedName: "properties.outputs", readOnly: true, type: { name: "Dictionary", - value: { type: { name: "any" } } - } + value: { type: { name: "any" } }, + }, }, provisioningState: { serializedName: "properties.provisioningState", readOnly: true, type: { - name: "String" - } - }, - billingDetails: { - serializedName: "properties.billingDetails", - type: { - name: "Composite", - className: "ApplicationBillingDetailsDefinition" - } - }, - jitAccessPolicy: { - serializedName: "properties.jitAccessPolicy", - type: { - name: "Composite", - className: "ApplicationJitAccessPolicy" - } - }, - publisherTenantId: { - serializedName: "properties.publisherTenantId", - readOnly: true, - type: { - name: "String" - } - }, - authorizations: { - serializedName: "properties.authorizations", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ApplicationAuthorization" - } - } - } - }, - managementMode: { - serializedName: "properties.managementMode", - readOnly: true, - type: { - name: "String" - } - }, - customerSupport: { - serializedName: "properties.customerSupport", - type: { - name: "Composite", - className: "ApplicationPackageContact" - } - }, - supportUrls: { - serializedName: "properties.supportUrls", - type: { - name: "Composite", - className: "ApplicationPackageSupportUrls" - } - }, - artifacts: { - serializedName: "properties.artifacts", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ApplicationArtifact" - } - } - } - }, - createdBy: { - serializedName: "properties.createdBy", - type: { - name: "Composite", - className: "ApplicationClientDetails" - } + name: "String", + }, }, - updatedBy: { - serializedName: "properties.updatedBy", - type: { - name: "Composite", - className: "ApplicationClientDetails" - } - } - } - } + }, + }, }; export const ApplicationDefinition: coreClient.CompositeMapper = { @@ -1636,32 +581,33 @@ export const ApplicationDefinition: coreClient.CompositeMapper = { required: true, type: { name: "Enum", - allowedValues: ["CanNotDelete", "ReadOnly", "None"] - } + allowedValues: ["CanNotDelete", "ReadOnly", "None"], + }, }, displayName: { serializedName: "properties.displayName", type: { - name: "String" - } + name: "String", + }, }, isEnabled: { serializedName: "properties.isEnabled", type: { - name: "Boolean" - } + name: "String", + }, }, authorizations: { serializedName: "properties.authorizations", + required: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "ApplicationAuthorization" - } - } - } + className: "ApplicationProviderAuthorization", + }, + }, + }, }, artifacts: { serializedName: "properties.artifacts", @@ -1670,83 +616,37 @@ export const ApplicationDefinition: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ApplicationDefinitionArtifact" - } - } - } + className: "ApplicationArtifact", + }, + }, + }, }, description: { serializedName: "properties.description", type: { - name: "String" - } + name: "String", + }, }, packageFileUri: { serializedName: "properties.packageFileUri", type: { - name: "String" - } - }, - storageAccountId: { - serializedName: "properties.storageAccountId", - type: { - name: "String" - } + name: "String", + }, }, mainTemplate: { serializedName: "properties.mainTemplate", type: { name: "Dictionary", - value: { type: { name: "any" } } - } + value: { type: { name: "any" } }, + }, }, createUiDefinition: { serializedName: "properties.createUiDefinition", type: { name: "Dictionary", - value: { type: { name: "any" } } - } - }, - notificationPolicy: { - serializedName: "properties.notificationPolicy", - type: { - name: "Composite", - className: "ApplicationNotificationPolicy" - } - }, - lockingPolicy: { - serializedName: "properties.lockingPolicy", - type: { - name: "Composite", - className: "ApplicationPackageLockingPolicyDefinition" - } - }, - deploymentPolicy: { - serializedName: "properties.deploymentPolicy", - type: { - name: "Composite", - className: "ApplicationDeploymentPolicy" - } - }, - managementPolicy: { - serializedName: "properties.managementPolicy", - type: { - name: "Composite", - className: "ApplicationManagementPolicy" - } + value: { type: { name: "any" } }, + }, }, - policies: { - serializedName: "properties.policies", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ApplicationPolicy" - } - } - } - } - } - } + }, + }, }; diff --git a/sdk/managedapplications/arm-managedapplications/src/models/parameters.ts b/sdk/managedapplications/arm-managedapplications/src/models/parameters.ts index bc14f7829667..1c28f656fe05 100644 --- a/sdk/managedapplications/arm-managedapplications/src/models/parameters.ts +++ b/sdk/managedapplications/arm-managedapplications/src/models/parameters.ts @@ -9,17 +9,12 @@ import { OperationParameter, OperationURLParameter, - OperationQueryParameter + OperationQueryParameter, } from "@azure/core-client"; import { Application as ApplicationMapper, ApplicationPatchable as ApplicationPatchableMapper, - UpdateAccessDefinition as UpdateAccessDefinitionMapper, - ListTokenRequest as ListTokenRequestMapper, ApplicationDefinition as ApplicationDefinitionMapper, - ApplicationDefinitionPatchable as ApplicationDefinitionPatchableMapper, - JitRequestDefinition as JitRequestDefinitionMapper, - JitRequestPatchable as JitRequestPatchableMapper } from "../models/mappers.js"; export const accept: OperationParameter = { @@ -29,9 +24,9 @@ export const accept: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const $host: OperationURLParameter = { @@ -40,22 +35,22 @@ export const $host: OperationURLParameter = { serializedName: "$host", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-07-01", + defaultValue: "2018-06-01", isConstant: true, serializedName: "api-version", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const nextLink: OperationURLParameter = { @@ -64,39 +59,26 @@ export const nextLink: OperationURLParameter = { serializedName: "nextLink", required: true, type: { - name: "String" - } - }, - skipEncoding: true -}; - -export const subscriptionId: OperationURLParameter = { - parameterPath: "subscriptionId", - mapper: { - constraints: { - MinLength: 1 + name: "String", }, - serializedName: "subscriptionId", - required: true, - type: { - name: "String" - } - } + }, + skipEncoding: true, }; export const resourceGroupName: OperationURLParameter = { parameterPath: "resourceGroupName", mapper: { constraints: { + Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), MaxLength: 90, - MinLength: 1 + MinLength: 1, }, serializedName: "resourceGroupName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const applicationName: OperationURLParameter = { @@ -104,14 +86,25 @@ export const applicationName: OperationURLParameter = { mapper: { constraints: { MaxLength: 64, - MinLength: 3 + MinLength: 3, }, serializedName: "applicationName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + serializedName: "subscriptionId", + required: true, + type: { + name: "String", + }, + }, }; export const contentType: OperationParameter = { @@ -121,19 +114,19 @@ export const contentType: OperationParameter = { isConstant: true, serializedName: "Content-Type", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const parameters: OperationParameter = { parameterPath: "parameters", - mapper: ApplicationMapper + mapper: ApplicationMapper, }; export const parameters1: OperationParameter = { parameterPath: ["options", "parameters"], - mapper: ApplicationPatchableMapper + mapper: ApplicationPatchableMapper, }; export const applicationId: OperationURLParameter = { @@ -142,20 +135,15 @@ export const applicationId: OperationURLParameter = { serializedName: "applicationId", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const parameters2: OperationParameter = { - parameterPath: "parameters", - mapper: UpdateAccessDefinitionMapper -}; - -export const parameters3: OperationParameter = { - parameterPath: "parameters", - mapper: ListTokenRequestMapper + parameterPath: ["options", "parameters"], + mapper: ApplicationMapper, }; export const applicationDefinitionName: OperationURLParameter = { @@ -163,59 +151,17 @@ export const applicationDefinitionName: OperationURLParameter = { mapper: { constraints: { MaxLength: 64, - MinLength: 3 + MinLength: 3, }, serializedName: "applicationDefinitionName", required: true, type: { - name: "String" - } - } -}; - -export const parameters4: OperationParameter = { - parameterPath: "parameters", - mapper: ApplicationDefinitionMapper -}; - -export const parameters5: OperationParameter = { - parameterPath: "parameters", - mapper: ApplicationDefinitionPatchableMapper -}; - -export const resourceGroupName1: OperationURLParameter = { - parameterPath: "resourceGroupName", - mapper: { - constraints: { - Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), - MaxLength: 90, - MinLength: 1 + name: "String", }, - serializedName: "resourceGroupName", - required: true, - type: { - name: "String" - } - } -}; - -export const jitRequestName: OperationURLParameter = { - parameterPath: "jitRequestName", - mapper: { - serializedName: "jitRequestName", - required: true, - type: { - name: "String" - } - } -}; - -export const parameters6: OperationParameter = { - parameterPath: "parameters", - mapper: JitRequestDefinitionMapper + }, }; -export const parameters7: OperationParameter = { +export const parameters3: OperationParameter = { parameterPath: "parameters", - mapper: JitRequestPatchableMapper + mapper: ApplicationDefinitionMapper, }; diff --git a/sdk/managedapplications/arm-managedapplications/src/operations/applicationDefinitions.ts b/sdk/managedapplications/arm-managedapplications/src/operations/applicationDefinitions.ts index 2df611fe676c..893d256a9e82 100644 --- a/sdk/managedapplications/arm-managedapplications/src/operations/applicationDefinitions.ts +++ b/sdk/managedapplications/arm-managedapplications/src/operations/applicationDefinitions.ts @@ -13,31 +13,24 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers.js"; import * as Parameters from "../models/parameters.js"; import { ApplicationClient } from "../applicationClient.js"; +import { SimplePollerLike, OperationState, createHttpPoller } from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl.js"; import { ApplicationDefinition, ApplicationDefinitionsListByResourceGroupNextOptionalParams, ApplicationDefinitionsListByResourceGroupOptionalParams, ApplicationDefinitionsListByResourceGroupResponse, - ApplicationDefinitionsListBySubscriptionNextOptionalParams, - ApplicationDefinitionsListBySubscriptionOptionalParams, - ApplicationDefinitionsListBySubscriptionResponse, ApplicationDefinitionsGetOptionalParams, ApplicationDefinitionsGetResponse, ApplicationDefinitionsDeleteOptionalParams, ApplicationDefinitionsCreateOrUpdateOptionalParams, ApplicationDefinitionsCreateOrUpdateResponse, - ApplicationDefinitionPatchable, - ApplicationDefinitionsUpdateOptionalParams, - ApplicationDefinitionsUpdateResponse, ApplicationDefinitionsGetByIdOptionalParams, ApplicationDefinitionsGetByIdResponse, ApplicationDefinitionsDeleteByIdOptionalParams, ApplicationDefinitionsCreateOrUpdateByIdOptionalParams, ApplicationDefinitionsCreateOrUpdateByIdResponse, - ApplicationDefinitionsUpdateByIdOptionalParams, - ApplicationDefinitionsUpdateByIdResponse, ApplicationDefinitionsListByResourceGroupNextResponse, - ApplicationDefinitionsListBySubscriptionNextResponse } from "../models/index.js"; /// @@ -60,7 +53,7 @@ export class ApplicationDefinitionsImpl implements ApplicationDefinitions { */ public listByResourceGroup( resourceGroupName: string, - options?: ApplicationDefinitionsListByResourceGroupOptionalParams + options?: ApplicationDefinitionsListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); return { @@ -74,19 +67,15 @@ export class ApplicationDefinitionsImpl implements ApplicationDefinitions { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings - ); - } + return this.listByResourceGroupPagingPage(resourceGroupName, options, settings); + }, }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, options?: ApplicationDefinitionsListByResourceGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ApplicationDefinitionsListByResourceGroupResponse; let continuationToken = settings?.continuationToken; @@ -98,11 +87,7 @@ export class ApplicationDefinitionsImpl implements ApplicationDefinitions { yield page; } while (continuationToken) { - result = await this._listByResourceGroupNext( - resourceGroupName, - continuationToken, - options - ); + result = await this._listByResourceGroupNext(resourceGroupName, continuationToken, options); continuationToken = result.nextLink; let page = result.value || []; setContinuationToken(page, continuationToken); @@ -112,66 +97,9 @@ export class ApplicationDefinitionsImpl implements ApplicationDefinitions { private async *listByResourceGroupPagingAll( resourceGroupName: string, - options?: ApplicationDefinitionsListByResourceGroupOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage( - resourceGroupName, - options - )) { - yield* page; - } - } - - /** - * Lists all the application definitions within a subscription. - * @param options The options parameters. - */ - public listBySubscription( - options?: ApplicationDefinitionsListBySubscriptionOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listBySubscriptionPagingAll(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.listBySubscriptionPagingPage(options, settings); - } - }; - } - - private async *listBySubscriptionPagingPage( - options?: ApplicationDefinitionsListBySubscriptionOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: ApplicationDefinitionsListBySubscriptionResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listBySubscription(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listBySubscriptionNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listBySubscriptionPagingAll( - options?: ApplicationDefinitionsListBySubscriptionOptionalParams + options?: ApplicationDefinitionsListByResourceGroupOptionalParams, ): AsyncIterableIterator { - for await (const page of this.listBySubscriptionPagingPage(options)) { + for await (const page of this.listByResourceGroupPagingPage(resourceGroupName, options)) { yield* page; } } @@ -185,67 +113,186 @@ export class ApplicationDefinitionsImpl implements ApplicationDefinitions { get( resourceGroupName: string, applicationDefinitionName: string, - options?: ApplicationDefinitionsGetOptionalParams + options?: ApplicationDefinitionsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, applicationDefinitionName, options }, - getOperationSpec + getOperationSpec, ); } /** * Deletes the managed application definition. * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationDefinitionName The name of the managed application definition. + * @param applicationDefinitionName The name of the managed application definition to delete. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + applicationDefinitionName: string, + options?: ApplicationDefinitionsDeleteOptionalParams, + ): 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, applicationDefinitionName, options }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Deletes the managed application definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition to delete. * @param options The options parameters. */ - delete( + async beginDeleteAndWait( resourceGroupName: string, applicationDefinitionName: string, - options?: ApplicationDefinitionsDeleteOptionalParams + options?: ApplicationDefinitionsDeleteOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, applicationDefinitionName, options }, - deleteOperationSpec - ); + const poller = await this.beginDelete(resourceGroupName, applicationDefinitionName, options); + return poller.pollUntilDone(); } /** - * Creates or updates a managed application definition. + * Creates a new managed application definition. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationDefinitionName The name of the managed application definition. * @param parameters Parameters supplied to the create or update an managed application definition. * @param options The options parameters. */ - createOrUpdate( + async beginCreateOrUpdate( resourceGroupName: string, applicationDefinitionName: string, parameters: ApplicationDefinition, - options?: ApplicationDefinitionsCreateOrUpdateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, applicationDefinitionName, parameters, options }, - createOrUpdateOperationSpec - ); + options?: ApplicationDefinitionsCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ApplicationDefinitionsCreateOrUpdateResponse + > + > { + 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, + applicationDefinitionName, + parameters, + options, + }, + spec: createOrUpdateOperationSpec, + }); + const poller = await createHttpPoller< + ApplicationDefinitionsCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; } /** - * Updates the managed application definition. + * Creates a new managed application definition. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationDefinitionName The name of the managed application definition. - * @param parameters Parameters supplied to the update a managed application definition. + * @param parameters Parameters supplied to the create or update an managed application definition. * @param options The options parameters. */ - update( + async beginCreateOrUpdateAndWait( resourceGroupName: string, applicationDefinitionName: string, - parameters: ApplicationDefinitionPatchable, - options?: ApplicationDefinitionsUpdateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, applicationDefinitionName, parameters, options }, - updateOperationSpec + parameters: ApplicationDefinition, + options?: ApplicationDefinitionsCreateOrUpdateOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + applicationDefinitionName, + parameters, + options, ); + return poller.pollUntilDone(); } /** @@ -255,42 +302,90 @@ export class ApplicationDefinitionsImpl implements ApplicationDefinitions { */ private _listByResourceGroup( resourceGroupName: string, - options?: ApplicationDefinitionsListByResourceGroupOptionalParams + options?: ApplicationDefinitionsListByResourceGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, options }, - listByResourceGroupOperationSpec + listByResourceGroupOperationSpec, ); } /** - * Lists all the application definitions within a subscription. + * Gets the managed application definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. * @param options The options parameters. */ - private _listBySubscription( - options?: ApplicationDefinitionsListBySubscriptionOptionalParams - ): Promise { + getById( + resourceGroupName: string, + applicationDefinitionName: string, + options?: ApplicationDefinitionsGetByIdOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { options }, - listBySubscriptionOperationSpec + { resourceGroupName, applicationDefinitionName, options }, + getByIdOperationSpec, ); } /** - * Gets the managed application definition. + * Deletes the managed application definition. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationDefinitionName The name of the managed application definition. * @param options The options parameters. */ - getById( + async beginDeleteById( resourceGroupName: string, applicationDefinitionName: string, - options?: ApplicationDefinitionsGetByIdOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, applicationDefinitionName, options }, - getByIdOperationSpec - ); + options?: ApplicationDefinitionsDeleteByIdOptionalParams, + ): 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, applicationDefinitionName, options }, + spec: deleteByIdOperationSpec, + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; } /** @@ -299,53 +394,115 @@ export class ApplicationDefinitionsImpl implements ApplicationDefinitions { * @param applicationDefinitionName The name of the managed application definition. * @param options The options parameters. */ - deleteById( + async beginDeleteByIdAndWait( resourceGroupName: string, applicationDefinitionName: string, - options?: ApplicationDefinitionsDeleteByIdOptionalParams + options?: ApplicationDefinitionsDeleteByIdOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, applicationDefinitionName, options }, - deleteByIdOperationSpec + const poller = await this.beginDeleteById( + resourceGroupName, + applicationDefinitionName, + options, ); + return poller.pollUntilDone(); } /** - * Creates or updates a managed application definition. + * Creates a new managed application definition. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationDefinitionName The name of the managed application definition. * @param parameters Parameters supplied to the create or update a managed application definition. * @param options The options parameters. */ - createOrUpdateById( + async beginCreateOrUpdateById( resourceGroupName: string, applicationDefinitionName: string, parameters: ApplicationDefinition, - options?: ApplicationDefinitionsCreateOrUpdateByIdOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, applicationDefinitionName, parameters, options }, - createOrUpdateByIdOperationSpec - ); + options?: ApplicationDefinitionsCreateOrUpdateByIdOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ApplicationDefinitionsCreateOrUpdateByIdResponse + > + > { + 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, + applicationDefinitionName, + parameters, + options, + }, + spec: createOrUpdateByIdOperationSpec, + }); + const poller = await createHttpPoller< + ApplicationDefinitionsCreateOrUpdateByIdResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; } /** - * Updates the managed application definition. + * Creates a new managed application definition. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationDefinitionName The name of the managed application definition. - * @param parameters Parameters supplied to the update a managed application definition. + * @param parameters Parameters supplied to the create or update a managed application definition. * @param options The options parameters. */ - updateById( + async beginCreateOrUpdateByIdAndWait( resourceGroupName: string, applicationDefinitionName: string, - parameters: ApplicationDefinitionPatchable, - options?: ApplicationDefinitionsUpdateByIdOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, applicationDefinitionName, parameters, options }, - updateByIdOperationSpec + parameters: ApplicationDefinition, + options?: ApplicationDefinitionsCreateOrUpdateByIdOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdateById( + resourceGroupName, + applicationDefinitionName, + parameters, + options, ); + return poller.pollUntilDone(); } /** @@ -357,26 +514,11 @@ export class ApplicationDefinitionsImpl implements ApplicationDefinitions { private _listByResourceGroupNext( resourceGroupName: string, nextLink: string, - options?: ApplicationDefinitionsListByResourceGroupNextOptionalParams + options?: ApplicationDefinitionsListByResourceGroupNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec - ); - } - - /** - * ListBySubscriptionNext - * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. - * @param options The options parameters. - */ - private _listBySubscriptionNext( - nextLink: string, - options?: ApplicationDefinitionsListBySubscriptionNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listBySubscriptionNextOperationSpec + listByResourceGroupNextOperationSpec, ); } } @@ -384,269 +526,190 @@ export class ApplicationDefinitionsImpl implements ApplicationDefinitions { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ApplicationDefinition + bodyMapper: Mappers.ApplicationDefinition, }, 404: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.applicationDefinitionName + Parameters.subscriptionId, + Parameters.applicationDefinitionName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName}", httpMethod: "DELETE", responses: { 200: {}, + 201: {}, + 202: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.applicationDefinitionName + Parameters.subscriptionId, + Parameters.applicationDefinitionName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.ApplicationDefinition + bodyMapper: Mappers.ApplicationDefinition, }, 201: { - bodyMapper: Mappers.ApplicationDefinition + bodyMapper: Mappers.ApplicationDefinition, }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - requestBody: Parameters.parameters4, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.applicationDefinitionName - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.ApplicationDefinition + 202: { + bodyMapper: Mappers.ApplicationDefinition, + }, + 204: { + bodyMapper: Mappers.ApplicationDefinition, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.parameters5, + requestBody: Parameters.parameters3, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.applicationDefinitionName + Parameters.subscriptionId, + Parameters.applicationDefinitionName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ApplicationDefinitionListResult + bodyMapper: Mappers.ApplicationDefinitionListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Solutions/applicationDefinitions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ApplicationDefinitionListResult + bodyMapper: Mappers.ErrorResponse, }, - default: { - bodyMapper: Mappers.ErrorResponse - } }, queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId], + urlParameters: [Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const getByIdOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ApplicationDefinition + bodyMapper: Mappers.ApplicationDefinition, }, 404: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.applicationDefinitionName, - Parameters.resourceGroupName1 ], headerParameters: [Parameters.accept], - serializer + serializer, }; const deleteByIdOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName}", httpMethod: "DELETE", responses: { 200: {}, + 201: {}, + 202: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.applicationDefinitionName, - Parameters.resourceGroupName1 ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateByIdOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.ApplicationDefinition + bodyMapper: Mappers.ApplicationDefinition, }, 201: { - bodyMapper: Mappers.ApplicationDefinition + bodyMapper: Mappers.ApplicationDefinition, }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - requestBody: Parameters.parameters4, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.applicationDefinitionName, - Parameters.resourceGroupName1 - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const updateByIdOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.ApplicationDefinition + 202: { + bodyMapper: Mappers.ApplicationDefinition, + }, + 204: { + bodyMapper: Mappers.ApplicationDefinition, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.parameters5, + requestBody: Parameters.parameters3, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.applicationDefinitionName + Parameters.subscriptionId, + Parameters.applicationDefinitionName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ApplicationDefinitionListResult + bodyMapper: Mappers.ApplicationDefinitionListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ApplicationDefinitionListResult + bodyMapper: Mappers.ErrorResponse, }, - default: { - bodyMapper: Mappers.ErrorResponse - } }, urlParameters: [ Parameters.$host, Parameters.nextLink, - Parameters.subscriptionId + Parameters.resourceGroupName, + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/managedapplications/arm-managedapplications/src/operations/applications.ts b/sdk/managedapplications/arm-managedapplications/src/operations/applications.ts index a5ca785bc6da..1db408ba4d5f 100644 --- a/sdk/managedapplications/arm-managedapplications/src/operations/applications.ts +++ b/sdk/managedapplications/arm-managedapplications/src/operations/applications.ts @@ -13,11 +13,7 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers.js"; import * as Parameters from "../models/parameters.js"; import { ApplicationClient } from "../applicationClient.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller -} from "@azure/core-lro"; +import { SimplePollerLike, OperationState, createHttpPoller } from "@azure/core-lro"; import { createLroSpec } from "../lroImpl.js"; import { Application, @@ -41,16 +37,8 @@ import { ApplicationsCreateOrUpdateByIdResponse, ApplicationsUpdateByIdOptionalParams, ApplicationsUpdateByIdResponse, - ApplicationsRefreshPermissionsOptionalParams, - ApplicationsListAllowedUpgradePlansOptionalParams, - ApplicationsListAllowedUpgradePlansResponse, - UpdateAccessDefinition, - ApplicationsUpdateAccessOptionalParams, - ListTokenRequest, - ApplicationsListTokensOptionalParams, - ApplicationsListTokensResponse, ApplicationsListByResourceGroupNextResponse, - ApplicationsListBySubscriptionNextResponse + ApplicationsListBySubscriptionNextResponse, } from "../models/index.js"; /// @@ -67,13 +55,13 @@ export class ApplicationsImpl implements Applications { } /** - * Lists all the applications within a resource group. + * Gets all the applications within a resource group. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ public listByResourceGroup( resourceGroupName: string, - options?: ApplicationsListByResourceGroupOptionalParams + options?: ApplicationsListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); return { @@ -87,19 +75,15 @@ export class ApplicationsImpl implements Applications { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings - ); - } + return this.listByResourceGroupPagingPage(resourceGroupName, options, settings); + }, }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, options?: ApplicationsListByResourceGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ApplicationsListByResourceGroupResponse; let continuationToken = settings?.continuationToken; @@ -111,11 +95,7 @@ export class ApplicationsImpl implements Applications { yield page; } while (continuationToken) { - result = await this._listByResourceGroupNext( - resourceGroupName, - continuationToken, - options - ); + result = await this._listByResourceGroupNext(resourceGroupName, continuationToken, options); continuationToken = result.nextLink; let page = result.value || []; setContinuationToken(page, continuationToken); @@ -125,22 +105,19 @@ export class ApplicationsImpl implements Applications { private async *listByResourceGroupPagingAll( resourceGroupName: string, - options?: ApplicationsListByResourceGroupOptionalParams + options?: ApplicationsListByResourceGroupOptionalParams, ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage( - resourceGroupName, - options - )) { + for await (const page of this.listByResourceGroupPagingPage(resourceGroupName, options)) { yield* page; } } /** - * Lists all the applications within a subscription. + * Gets all the applications within a subscription. * @param options The options parameters. */ public listBySubscription( - options?: ApplicationsListBySubscriptionOptionalParams + options?: ApplicationsListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listBySubscriptionPagingAll(options); return { @@ -155,13 +132,13 @@ export class ApplicationsImpl implements Applications { throw new Error("maxPageSize is not supported by this operation."); } return this.listBySubscriptionPagingPage(options, settings); - } + }, }; } private async *listBySubscriptionPagingPage( options?: ApplicationsListBySubscriptionOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ApplicationsListBySubscriptionResponse; let continuationToken = settings?.continuationToken; @@ -182,7 +159,7 @@ export class ApplicationsImpl implements Applications { } private async *listBySubscriptionPagingAll( - options?: ApplicationsListBySubscriptionOptionalParams + options?: ApplicationsListBySubscriptionOptionalParams, ): AsyncIterableIterator { for await (const page of this.listBySubscriptionPagingPage(options)) { yield* page; @@ -198,11 +175,11 @@ export class ApplicationsImpl implements Applications { get( resourceGroupName: string, applicationName: string, - options?: ApplicationsGetOptionalParams + options?: ApplicationsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, applicationName, options }, - getOperationSpec + getOperationSpec, ); } @@ -215,25 +192,23 @@ export class ApplicationsImpl implements Applications { async beginDelete( resourceGroupName: string, applicationName: string, - options?: ApplicationsDeleteOptionalParams + options?: ApplicationsDeleteOptionalParams, ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -242,8 +217,8 @@ export class ApplicationsImpl implements Applications { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -251,20 +226,19 @@ export class ApplicationsImpl implements Applications { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceGroupName, applicationName, options }, - spec: deleteOperationSpec + spec: deleteOperationSpec, }); const poller = await createHttpPoller>(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -279,18 +253,14 @@ export class ApplicationsImpl implements Applications { async beginDeleteAndWait( resourceGroupName: string, applicationName: string, - options?: ApplicationsDeleteOptionalParams + options?: ApplicationsDeleteOptionalParams, ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - applicationName, - options - ); + const poller = await this.beginDelete(resourceGroupName, applicationName, options); return poller.pollUntilDone(); } /** - * Creates or updates a managed application. + * Creates a new managed application. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationName The name of the managed application. * @param parameters Parameters supplied to the create or update a managed application. @@ -300,7 +270,7 @@ export class ApplicationsImpl implements Applications { resourceGroupName: string, applicationName: string, parameters: Application, - options?: ApplicationsCreateOrUpdateOptionalParams + options?: ApplicationsCreateOrUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -309,21 +279,19 @@ export class ApplicationsImpl implements Applications { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -332,8 +300,8 @@ export class ApplicationsImpl implements Applications { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -341,15 +309,15 @@ export class ApplicationsImpl implements Applications { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { resourceGroupName, applicationName, parameters, options }, - spec: createOrUpdateOperationSpec + spec: createOrUpdateOperationSpec, }); const poller = await createHttpPoller< ApplicationsCreateOrUpdateResponse, @@ -357,14 +325,13 @@ export class ApplicationsImpl implements Applications { >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; } /** - * Creates or updates a managed application. + * Creates a new managed application. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationName The name of the managed application. * @param parameters Parameters supplied to the create or update a managed application. @@ -374,134 +341,58 @@ export class ApplicationsImpl implements Applications { resourceGroupName: string, applicationName: string, parameters: Application, - options?: ApplicationsCreateOrUpdateOptionalParams + options?: ApplicationsCreateOrUpdateOptionalParams, ): Promise { const poller = await this.beginCreateOrUpdate( resourceGroupName, applicationName, parameters, - options + options, ); return poller.pollUntilDone(); } /** - * Updates an existing managed application. + * Updates an existing managed application. The only value that can be updated via PATCH currently is + * the tags. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationName The name of the managed application. * @param options The options parameters. */ - async beginUpdate( + update( resourceGroupName: string, applicationName: string, - options?: ApplicationsUpdateOptionalParams - ): Promise< - SimplePollerLike< - OperationState, - ApplicationsUpdateResponse - > - > { - 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, applicationName, options }, - spec: updateOperationSpec - }); - const poller = await createHttpPoller< - ApplicationsUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation" - }); - await poller.poll(); - return poller; - } - - /** - * Updates an existing managed application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationName The name of the managed application. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - applicationName: string, - options?: ApplicationsUpdateOptionalParams + options?: ApplicationsUpdateOptionalParams, ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - applicationName, - options + return this.client.sendOperationRequest( + { resourceGroupName, applicationName, options }, + updateOperationSpec, ); - return poller.pollUntilDone(); } /** - * Lists all the applications within a resource group. + * Gets all the applications within a resource group. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ private _listByResourceGroup( resourceGroupName: string, - options?: ApplicationsListByResourceGroupOptionalParams + options?: ApplicationsListByResourceGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, options }, - listByResourceGroupOperationSpec + listByResourceGroupOperationSpec, ); } /** - * Lists all the applications within a subscription. + * Gets all the applications within a subscription. * @param options The options parameters. */ private _listBySubscription( - options?: ApplicationsListBySubscriptionOptionalParams + options?: ApplicationsListBySubscriptionOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { options }, - listBySubscriptionOperationSpec - ); + return this.client.sendOperationRequest({ options }, listBySubscriptionOperationSpec); } /** @@ -513,12 +404,9 @@ export class ApplicationsImpl implements Applications { */ getById( applicationId: string, - options?: ApplicationsGetByIdOptionalParams + options?: ApplicationsGetByIdOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { applicationId, options }, - getByIdOperationSpec - ); + return this.client.sendOperationRequest({ applicationId, options }, getByIdOperationSpec); } /** @@ -530,25 +418,23 @@ export class ApplicationsImpl implements Applications { */ async beginDeleteById( applicationId: string, - options?: ApplicationsDeleteByIdOptionalParams + options?: ApplicationsDeleteByIdOptionalParams, ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -557,8 +443,8 @@ export class ApplicationsImpl implements Applications { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -566,20 +452,19 @@ export class ApplicationsImpl implements Applications { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { applicationId, options }, - spec: deleteByIdOperationSpec + spec: deleteByIdOperationSpec, }); const poller = await createHttpPoller>(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -594,14 +479,14 @@ export class ApplicationsImpl implements Applications { */ async beginDeleteByIdAndWait( applicationId: string, - options?: ApplicationsDeleteByIdOptionalParams + options?: ApplicationsDeleteByIdOptionalParams, ): Promise { const poller = await this.beginDeleteById(applicationId, options); return poller.pollUntilDone(); } /** - * Creates or updates a managed application. + * Creates a new managed application. * @param applicationId The fully qualified ID of the managed application, including the managed * application name and the managed application resource type. Use the format, * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name} @@ -611,7 +496,7 @@ export class ApplicationsImpl implements Applications { async beginCreateOrUpdateById( applicationId: string, parameters: Application, - options?: ApplicationsCreateOrUpdateByIdOptionalParams + options?: ApplicationsCreateOrUpdateByIdOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -620,21 +505,19 @@ export class ApplicationsImpl implements Applications { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -643,8 +526,8 @@ export class ApplicationsImpl implements Applications { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -652,15 +535,15 @@ export class ApplicationsImpl implements Applications { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, args: { applicationId, parameters, options }, - spec: createOrUpdateByIdOperationSpec + spec: createOrUpdateByIdOperationSpec, }); const poller = await createHttpPoller< ApplicationsCreateOrUpdateByIdResponse, @@ -668,14 +551,13 @@ export class ApplicationsImpl implements Applications { >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; } /** - * Creates or updates a managed application. + * Creates a new managed application. * @param applicationId The fully qualified ID of the managed application, including the managed * application name and the managed application resource type. Use the format, * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name} @@ -685,308 +567,25 @@ export class ApplicationsImpl implements Applications { async beginCreateOrUpdateByIdAndWait( applicationId: string, parameters: Application, - options?: ApplicationsCreateOrUpdateByIdOptionalParams + options?: ApplicationsCreateOrUpdateByIdOptionalParams, ): Promise { - const poller = await this.beginCreateOrUpdateById( - applicationId, - parameters, - options - ); + const poller = await this.beginCreateOrUpdateById(applicationId, parameters, options); return poller.pollUntilDone(); } /** - * Updates an existing managed application. - * @param applicationId The fully qualified ID of the managed application, including the managed - * application name and the managed application resource type. Use the format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name} - * @param options The options parameters. - */ - async beginUpdateById( - applicationId: string, - options?: ApplicationsUpdateByIdOptionalParams - ): Promise< - SimplePollerLike< - OperationState, - ApplicationsUpdateByIdResponse - > - > { - 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: { applicationId, options }, - spec: updateByIdOperationSpec - }); - const poller = await createHttpPoller< - ApplicationsUpdateByIdResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation" - }); - await poller.poll(); - return poller; - } - - /** - * Updates an existing managed application. + * Updates an existing managed application. The only value that can be updated via PATCH currently is + * the tags. * @param applicationId The fully qualified ID of the managed application, including the managed * application name and the managed application resource type. Use the format, * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name} * @param options The options parameters. */ - async beginUpdateByIdAndWait( + updateById( applicationId: string, - options?: ApplicationsUpdateByIdOptionalParams + options?: ApplicationsUpdateByIdOptionalParams, ): Promise { - const poller = await this.beginUpdateById(applicationId, options); - return poller.pollUntilDone(); - } - - /** - * Refresh Permissions for application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationName The name of the managed application. - * @param options The options parameters. - */ - async beginRefreshPermissions( - resourceGroupName: string, - applicationName: string, - options?: ApplicationsRefreshPermissionsOptionalParams - ): 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, applicationName, options }, - spec: refreshPermissionsOperationSpec - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location" - }); - await poller.poll(); - return poller; - } - - /** - * Refresh Permissions for application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationName The name of the managed application. - * @param options The options parameters. - */ - async beginRefreshPermissionsAndWait( - resourceGroupName: string, - applicationName: string, - options?: ApplicationsRefreshPermissionsOptionalParams - ): Promise { - const poller = await this.beginRefreshPermissions( - resourceGroupName, - applicationName, - options - ); - return poller.pollUntilDone(); - } - - /** - * List allowed upgrade plans for application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationName The name of the managed application. - * @param options The options parameters. - */ - listAllowedUpgradePlans( - resourceGroupName: string, - applicationName: string, - options?: ApplicationsListAllowedUpgradePlansOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, applicationName, options }, - listAllowedUpgradePlansOperationSpec - ); - } - - /** - * Update access for application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationName The name of the managed application. - * @param parameters Request body parameters to list tokens. - * @param options The options parameters. - */ - async beginUpdateAccess( - resourceGroupName: string, - applicationName: string, - parameters: UpdateAccessDefinition, - options?: ApplicationsUpdateAccessOptionalParams - ): 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, applicationName, parameters, options }, - spec: updateAccessOperationSpec - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location" - }); - await poller.poll(); - return poller; - } - - /** - * Update access for application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationName The name of the managed application. - * @param parameters Request body parameters to list tokens. - * @param options The options parameters. - */ - async beginUpdateAccessAndWait( - resourceGroupName: string, - applicationName: string, - parameters: UpdateAccessDefinition, - options?: ApplicationsUpdateAccessOptionalParams - ): Promise { - const poller = await this.beginUpdateAccess( - resourceGroupName, - applicationName, - parameters, - options - ); - return poller.pollUntilDone(); - } - - /** - * List tokens for application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationName The name of the managed application. - * @param parameters Request body parameters to list tokens. - * @param options The options parameters. - */ - listTokens( - resourceGroupName: string, - applicationName: string, - parameters: ListTokenRequest, - options?: ApplicationsListTokensOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, applicationName, parameters, options }, - listTokensOperationSpec - ); + return this.client.sendOperationRequest({ applicationId, options }, updateByIdOperationSpec); } /** @@ -998,11 +597,11 @@ export class ApplicationsImpl implements Applications { private _listByResourceGroupNext( resourceGroupName: string, nextLink: string, - options?: ApplicationsListByResourceGroupNextOptionalParams + options?: ApplicationsListByResourceGroupNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec + listByResourceGroupNextOperationSpec, ); } @@ -1013,11 +612,11 @@ export class ApplicationsImpl implements Applications { */ private _listBySubscriptionNext( nextLink: string, - options?: ApplicationsListBySubscriptionNextOptionalParams + options?: ApplicationsListBySubscriptionNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listBySubscriptionNextOperationSpec + listBySubscriptionNextOperationSpec, ); } } @@ -1025,31 +624,29 @@ export class ApplicationsImpl implements Applications { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.Application + bodyMapper: Mappers.Application, }, 404: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.applicationName + Parameters.applicationName, + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}", httpMethod: "DELETE", responses: { 200: {}, @@ -1057,139 +654,122 @@ const deleteOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.applicationName + Parameters.applicationName, + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.Application + bodyMapper: Mappers.Application, }, 201: { - bodyMapper: Mappers.Application + bodyMapper: Mappers.Application, }, 202: { - bodyMapper: Mappers.Application + bodyMapper: Mappers.Application, }, 204: { - bodyMapper: Mappers.Application + bodyMapper: Mappers.Application, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.applicationName + Parameters.applicationName, + Parameters.subscriptionId, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.ApplicationPatchable - }, - 201: { - bodyMapper: Mappers.ApplicationPatchable - }, - 202: { - bodyMapper: Mappers.ApplicationPatchable - }, - 204: { - bodyMapper: Mappers.ApplicationPatchable + bodyMapper: Mappers.Application, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters1, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.applicationName + Parameters.applicationName, + Parameters.subscriptionId, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ApplicationListResult + bodyMapper: Mappers.ApplicationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName - ], + urlParameters: [Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Solutions/applications", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Solutions/applications", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ApplicationListResult + bodyMapper: Mappers.ApplicationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const getByIdOperationSpec: coreClient.OperationSpec = { path: "/{applicationId}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.Application + bodyMapper: Mappers.Application, }, 404: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.applicationId], headerParameters: [Parameters.accept], - serializer + serializer, }; const deleteByIdOperationSpec: coreClient.OperationSpec = { path: "/{applicationId}", @@ -1200,198 +780,91 @@ const deleteByIdOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.applicationId], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateByIdOperationSpec: coreClient.OperationSpec = { path: "/{applicationId}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.Application + bodyMapper: Mappers.Application, }, 201: { - bodyMapper: Mappers.Application + bodyMapper: Mappers.Application, }, 202: { - bodyMapper: Mappers.Application + bodyMapper: Mappers.Application, }, 204: { - bodyMapper: Mappers.Application + bodyMapper: Mappers.Application, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.applicationId], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const updateByIdOperationSpec: coreClient.OperationSpec = { path: "/{applicationId}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.ApplicationPatchable - }, - 201: { - bodyMapper: Mappers.ApplicationPatchable - }, - 202: { - bodyMapper: Mappers.ApplicationPatchable - }, - 204: { - bodyMapper: Mappers.ApplicationPatchable + bodyMapper: Mappers.Application, }, default: { - bodyMapper: Mappers.ErrorResponse - } - }, - requestBody: Parameters.parameters1, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.applicationId], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const refreshPermissionsOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}/refreshPermissions", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.applicationName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listAllowedUpgradePlansOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}/listAllowedUpgradePlans", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.AllowedUpgradePlansResult + bodyMapper: Mappers.ErrorResponse, }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.applicationName - ], - headerParameters: [Parameters.accept], - serializer -}; -const updateAccessOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}/updateAccess", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse - } }, requestBody: Parameters.parameters2, queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.applicationName - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const listTokensOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}/listTokens", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.ManagedIdentityTokenResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - requestBody: Parameters.parameters3, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.applicationName - ], + urlParameters: [Parameters.$host, Parameters.applicationId], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ApplicationListResult + bodyMapper: Mappers.ApplicationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.nextLink, + Parameters.resourceGroupName, Parameters.subscriptionId, - Parameters.resourceGroupName ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ApplicationListResult + bodyMapper: Mappers.ApplicationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId - ], + urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/managedapplications/arm-managedapplications/src/operations/index.ts b/sdk/managedapplications/arm-managedapplications/src/operations/index.ts index 33368526b96f..97e7c916476b 100644 --- a/sdk/managedapplications/arm-managedapplications/src/operations/index.ts +++ b/sdk/managedapplications/arm-managedapplications/src/operations/index.ts @@ -8,4 +8,3 @@ export * from "./applications.js"; export * from "./applicationDefinitions.js"; -export * from "./jitRequests.js"; diff --git a/sdk/managedapplications/arm-managedapplications/src/operations/jitRequests.ts b/sdk/managedapplications/arm-managedapplications/src/operations/jitRequests.ts deleted file mode 100644 index 7d7211216c66..000000000000 --- a/sdk/managedapplications/arm-managedapplications/src/operations/jitRequests.ts +++ /dev/null @@ -1,366 +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 { JitRequests } 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 { ApplicationClient } from "../applicationClient.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import { - JitRequestsGetOptionalParams, - JitRequestsGetResponse, - JitRequestDefinition, - JitRequestsCreateOrUpdateOptionalParams, - JitRequestsCreateOrUpdateResponse, - JitRequestPatchable, - JitRequestsUpdateOptionalParams, - JitRequestsUpdateResponse, - JitRequestsDeleteOptionalParams, - JitRequestsListBySubscriptionOptionalParams, - JitRequestsListBySubscriptionResponse, - JitRequestsListByResourceGroupOptionalParams, - JitRequestsListByResourceGroupResponse -} from "../models/index.js"; - -/** Class containing JitRequests operations. */ -export class JitRequestsImpl implements JitRequests { - private readonly client: ApplicationClient; - - /** - * Initialize a new instance of the class JitRequests class. - * @param client Reference to the service client - */ - constructor(client: ApplicationClient) { - this.client = client; - } - - /** - * Gets the JIT request. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jitRequestName The name of the JIT request. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - jitRequestName: string, - options?: JitRequestsGetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, jitRequestName, options }, - getOperationSpec - ); - } - - /** - * Creates or updates the JIT request. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jitRequestName The name of the JIT request. - * @param parameters Parameters supplied to the update JIT request. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - jitRequestName: string, - parameters: JitRequestDefinition, - options?: JitRequestsCreateOrUpdateOptionalParams - ): Promise< - SimplePollerLike< - OperationState, - JitRequestsCreateOrUpdateResponse - > - > { - 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, jitRequestName, parameters, options }, - spec: createOrUpdateOperationSpec - }); - const poller = await createHttpPoller< - JitRequestsCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation" - }); - await poller.poll(); - return poller; - } - - /** - * Creates or updates the JIT request. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jitRequestName The name of the JIT request. - * @param parameters Parameters supplied to the update JIT request. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - jitRequestName: string, - parameters: JitRequestDefinition, - options?: JitRequestsCreateOrUpdateOptionalParams - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - jitRequestName, - parameters, - options - ); - return poller.pollUntilDone(); - } - - /** - * Updates the JIT request. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jitRequestName The name of the JIT request. - * @param parameters Parameters supplied to the update JIT request. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - jitRequestName: string, - parameters: JitRequestPatchable, - options?: JitRequestsUpdateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, jitRequestName, parameters, options }, - updateOperationSpec - ); - } - - /** - * Deletes the JIT request. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jitRequestName The name of the JIT request. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - jitRequestName: string, - options?: JitRequestsDeleteOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, jitRequestName, options }, - deleteOperationSpec - ); - } - - /** - * Lists all JIT requests within the subscription. - * @param options The options parameters. - */ - listBySubscription( - options?: JitRequestsListBySubscriptionOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { options }, - listBySubscriptionOperationSpec - ); - } - - /** - * Lists all JIT requests within the resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: JitRequestsListByResourceGroupOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/jitRequests/{jitRequestName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.JitRequestDefinition - }, - 404: {}, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.jitRequestName - ], - headerParameters: [Parameters.accept], - serializer -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/jitRequests/{jitRequestName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.JitRequestDefinition - }, - 201: { - bodyMapper: Mappers.JitRequestDefinition - }, - 202: { - bodyMapper: Mappers.JitRequestDefinition - }, - 204: { - bodyMapper: Mappers.JitRequestDefinition - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - requestBody: Parameters.parameters6, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.jitRequestName - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/jitRequests/{jitRequestName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.JitRequestDefinition - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - requestBody: Parameters.parameters7, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.jitRequestName - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/jitRequests/{jitRequestName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.jitRequestName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Solutions/jitRequests", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.JitRequestDefinitionListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer -}; -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/jitRequests", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.JitRequestDefinitionListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/applicationDefinitions.ts b/sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/applicationDefinitions.ts index 47939c092aca..6994e4abc691 100644 --- a/sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/applicationDefinitions.ts +++ b/sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/applicationDefinitions.ts @@ -7,25 +7,20 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { ApplicationDefinition, ApplicationDefinitionsListByResourceGroupOptionalParams, - ApplicationDefinitionsListBySubscriptionOptionalParams, ApplicationDefinitionsGetOptionalParams, ApplicationDefinitionsGetResponse, ApplicationDefinitionsDeleteOptionalParams, ApplicationDefinitionsCreateOrUpdateOptionalParams, ApplicationDefinitionsCreateOrUpdateResponse, - ApplicationDefinitionPatchable, - ApplicationDefinitionsUpdateOptionalParams, - ApplicationDefinitionsUpdateResponse, ApplicationDefinitionsGetByIdOptionalParams, ApplicationDefinitionsGetByIdResponse, ApplicationDefinitionsDeleteByIdOptionalParams, ApplicationDefinitionsCreateOrUpdateByIdOptionalParams, ApplicationDefinitionsCreateOrUpdateByIdResponse, - ApplicationDefinitionsUpdateByIdOptionalParams, - ApplicationDefinitionsUpdateByIdResponse } from "../models/index.js"; /// @@ -38,14 +33,7 @@ export interface ApplicationDefinitions { */ listByResourceGroup( resourceGroupName: string, - options?: ApplicationDefinitionsListByResourceGroupOptionalParams - ): PagedAsyncIterableIterator; - /** - * Lists all the application definitions within a subscription. - * @param options The options parameters. - */ - listBySubscription( - options?: ApplicationDefinitionsListBySubscriptionOptionalParams + options?: ApplicationDefinitionsListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator; /** * Gets the managed application definition. @@ -56,45 +44,61 @@ export interface ApplicationDefinitions { get( resourceGroupName: string, applicationDefinitionName: string, - options?: ApplicationDefinitionsGetOptionalParams + options?: ApplicationDefinitionsGetOptionalParams, ): Promise; /** * Deletes the managed application definition. * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationDefinitionName The name of the managed application definition. + * @param applicationDefinitionName The name of the managed application definition to delete. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + applicationDefinitionName: string, + options?: ApplicationDefinitionsDeleteOptionalParams, + ): Promise, void>>; + /** + * Deletes the managed application definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition to delete. * @param options The options parameters. */ - delete( + beginDeleteAndWait( resourceGroupName: string, applicationDefinitionName: string, - options?: ApplicationDefinitionsDeleteOptionalParams + options?: ApplicationDefinitionsDeleteOptionalParams, ): Promise; /** - * Creates or updates a managed application definition. + * Creates a new managed application definition. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationDefinitionName The name of the managed application definition. * @param parameters Parameters supplied to the create or update an managed application definition. * @param options The options parameters. */ - createOrUpdate( + beginCreateOrUpdate( resourceGroupName: string, applicationDefinitionName: string, parameters: ApplicationDefinition, - options?: ApplicationDefinitionsCreateOrUpdateOptionalParams - ): Promise; + options?: ApplicationDefinitionsCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ApplicationDefinitionsCreateOrUpdateResponse + > + >; /** - * Updates the managed application definition. + * Creates a new managed application definition. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationDefinitionName The name of the managed application definition. - * @param parameters Parameters supplied to the update a managed application definition. + * @param parameters Parameters supplied to the create or update an managed application definition. * @param options The options parameters. */ - update( + beginCreateOrUpdateAndWait( resourceGroupName: string, applicationDefinitionName: string, - parameters: ApplicationDefinitionPatchable, - options?: ApplicationDefinitionsUpdateOptionalParams - ): Promise; + parameters: ApplicationDefinition, + options?: ApplicationDefinitionsCreateOrUpdateOptionalParams, + ): Promise; /** * Gets the managed application definition. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -104,7 +108,7 @@ export interface ApplicationDefinitions { getById( resourceGroupName: string, applicationDefinitionName: string, - options?: ApplicationDefinitionsGetByIdOptionalParams + options?: ApplicationDefinitionsGetByIdOptionalParams, ): Promise; /** * Deletes the managed application definition. @@ -112,35 +116,51 @@ export interface ApplicationDefinitions { * @param applicationDefinitionName The name of the managed application definition. * @param options The options parameters. */ - deleteById( + beginDeleteById( + resourceGroupName: string, + applicationDefinitionName: string, + options?: ApplicationDefinitionsDeleteByIdOptionalParams, + ): Promise, void>>; + /** + * Deletes the managed application definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param options The options parameters. + */ + beginDeleteByIdAndWait( resourceGroupName: string, applicationDefinitionName: string, - options?: ApplicationDefinitionsDeleteByIdOptionalParams + options?: ApplicationDefinitionsDeleteByIdOptionalParams, ): Promise; /** - * Creates or updates a managed application definition. + * Creates a new managed application definition. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationDefinitionName The name of the managed application definition. * @param parameters Parameters supplied to the create or update a managed application definition. * @param options The options parameters. */ - createOrUpdateById( + beginCreateOrUpdateById( resourceGroupName: string, applicationDefinitionName: string, parameters: ApplicationDefinition, - options?: ApplicationDefinitionsCreateOrUpdateByIdOptionalParams - ): Promise; + options?: ApplicationDefinitionsCreateOrUpdateByIdOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ApplicationDefinitionsCreateOrUpdateByIdResponse + > + >; /** - * Updates the managed application definition. + * Creates a new managed application definition. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationDefinitionName The name of the managed application definition. - * @param parameters Parameters supplied to the update a managed application definition. + * @param parameters Parameters supplied to the create or update a managed application definition. * @param options The options parameters. */ - updateById( + beginCreateOrUpdateByIdAndWait( resourceGroupName: string, applicationDefinitionName: string, - parameters: ApplicationDefinitionPatchable, - options?: ApplicationDefinitionsUpdateByIdOptionalParams - ): Promise; + parameters: ApplicationDefinition, + options?: ApplicationDefinitionsCreateOrUpdateByIdOptionalParams, + ): Promise; } diff --git a/sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/applications.ts b/sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/applications.ts index 64b1bac6ebe2..4d3468a83b15 100644 --- a/sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/applications.ts +++ b/sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/applications.ts @@ -26,34 +26,26 @@ import { ApplicationsCreateOrUpdateByIdResponse, ApplicationsUpdateByIdOptionalParams, ApplicationsUpdateByIdResponse, - ApplicationsRefreshPermissionsOptionalParams, - ApplicationsListAllowedUpgradePlansOptionalParams, - ApplicationsListAllowedUpgradePlansResponse, - UpdateAccessDefinition, - ApplicationsUpdateAccessOptionalParams, - ListTokenRequest, - ApplicationsListTokensOptionalParams, - ApplicationsListTokensResponse } from "../models/index.js"; /// /** Interface representing a Applications. */ export interface Applications { /** - * Lists all the applications within a resource group. + * Gets all the applications within a resource group. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ listByResourceGroup( resourceGroupName: string, - options?: ApplicationsListByResourceGroupOptionalParams + options?: ApplicationsListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator; /** - * Lists all the applications within a subscription. + * Gets all the applications within a subscription. * @param options The options parameters. */ listBySubscription( - options?: ApplicationsListBySubscriptionOptionalParams + options?: ApplicationsListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator; /** * Gets the managed application. @@ -64,7 +56,7 @@ export interface Applications { get( resourceGroupName: string, applicationName: string, - options?: ApplicationsGetOptionalParams + options?: ApplicationsGetOptionalParams, ): Promise; /** * Deletes the managed application. @@ -75,7 +67,7 @@ export interface Applications { beginDelete( resourceGroupName: string, applicationName: string, - options?: ApplicationsDeleteOptionalParams + options?: ApplicationsDeleteOptionalParams, ): Promise, void>>; /** * Deletes the managed application. @@ -86,10 +78,10 @@ export interface Applications { beginDeleteAndWait( resourceGroupName: string, applicationName: string, - options?: ApplicationsDeleteOptionalParams + options?: ApplicationsDeleteOptionalParams, ): Promise; /** - * Creates or updates a managed application. + * Creates a new managed application. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationName The name of the managed application. * @param parameters Parameters supplied to the create or update a managed application. @@ -99,7 +91,7 @@ export interface Applications { resourceGroupName: string, applicationName: string, parameters: Application, - options?: ApplicationsCreateOrUpdateOptionalParams + options?: ApplicationsCreateOrUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -107,7 +99,7 @@ export interface Applications { > >; /** - * Creates or updates a managed application. + * Creates a new managed application. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationName The name of the managed application. * @param parameters Parameters supplied to the create or update a managed application. @@ -117,34 +109,19 @@ export interface Applications { resourceGroupName: string, applicationName: string, parameters: Application, - options?: ApplicationsCreateOrUpdateOptionalParams + options?: ApplicationsCreateOrUpdateOptionalParams, ): Promise; /** - * Updates an existing managed application. + * Updates an existing managed application. The only value that can be updated via PATCH currently is + * the tags. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationName The name of the managed application. * @param options The options parameters. */ - beginUpdate( + update( resourceGroupName: string, applicationName: string, - options?: ApplicationsUpdateOptionalParams - ): Promise< - SimplePollerLike< - OperationState, - ApplicationsUpdateResponse - > - >; - /** - * Updates an existing managed application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationName The name of the managed application. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - applicationName: string, - options?: ApplicationsUpdateOptionalParams + options?: ApplicationsUpdateOptionalParams, ): Promise; /** * Gets the managed application. @@ -155,7 +132,7 @@ export interface Applications { */ getById( applicationId: string, - options?: ApplicationsGetByIdOptionalParams + options?: ApplicationsGetByIdOptionalParams, ): Promise; /** * Deletes the managed application. @@ -166,7 +143,7 @@ export interface Applications { */ beginDeleteById( applicationId: string, - options?: ApplicationsDeleteByIdOptionalParams + options?: ApplicationsDeleteByIdOptionalParams, ): Promise, void>>; /** * Deletes the managed application. @@ -177,10 +154,10 @@ export interface Applications { */ beginDeleteByIdAndWait( applicationId: string, - options?: ApplicationsDeleteByIdOptionalParams + options?: ApplicationsDeleteByIdOptionalParams, ): Promise; /** - * Creates or updates a managed application. + * Creates a new managed application. * @param applicationId The fully qualified ID of the managed application, including the managed * application name and the managed application resource type. Use the format, * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name} @@ -190,7 +167,7 @@ export interface Applications { beginCreateOrUpdateById( applicationId: string, parameters: Application, - options?: ApplicationsCreateOrUpdateByIdOptionalParams + options?: ApplicationsCreateOrUpdateByIdOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -198,7 +175,7 @@ export interface Applications { > >; /** - * Creates or updates a managed application. + * Creates a new managed application. * @param applicationId The fully qualified ID of the managed application, including the managed * application name and the managed application resource type. Use the format, * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name} @@ -208,105 +185,18 @@ export interface Applications { beginCreateOrUpdateByIdAndWait( applicationId: string, parameters: Application, - options?: ApplicationsCreateOrUpdateByIdOptionalParams + options?: ApplicationsCreateOrUpdateByIdOptionalParams, ): Promise; /** - * Updates an existing managed application. - * @param applicationId The fully qualified ID of the managed application, including the managed - * application name and the managed application resource type. Use the format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name} - * @param options The options parameters. - */ - beginUpdateById( - applicationId: string, - options?: ApplicationsUpdateByIdOptionalParams - ): Promise< - SimplePollerLike< - OperationState, - ApplicationsUpdateByIdResponse - > - >; - /** - * Updates an existing managed application. + * Updates an existing managed application. The only value that can be updated via PATCH currently is + * the tags. * @param applicationId The fully qualified ID of the managed application, including the managed * application name and the managed application resource type. Use the format, * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name} * @param options The options parameters. */ - beginUpdateByIdAndWait( + updateById( applicationId: string, - options?: ApplicationsUpdateByIdOptionalParams + options?: ApplicationsUpdateByIdOptionalParams, ): Promise; - /** - * Refresh Permissions for application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationName The name of the managed application. - * @param options The options parameters. - */ - beginRefreshPermissions( - resourceGroupName: string, - applicationName: string, - options?: ApplicationsRefreshPermissionsOptionalParams - ): Promise, void>>; - /** - * Refresh Permissions for application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationName The name of the managed application. - * @param options The options parameters. - */ - beginRefreshPermissionsAndWait( - resourceGroupName: string, - applicationName: string, - options?: ApplicationsRefreshPermissionsOptionalParams - ): Promise; - /** - * List allowed upgrade plans for application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationName The name of the managed application. - * @param options The options parameters. - */ - listAllowedUpgradePlans( - resourceGroupName: string, - applicationName: string, - options?: ApplicationsListAllowedUpgradePlansOptionalParams - ): Promise; - /** - * Update access for application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationName The name of the managed application. - * @param parameters Request body parameters to list tokens. - * @param options The options parameters. - */ - beginUpdateAccess( - resourceGroupName: string, - applicationName: string, - parameters: UpdateAccessDefinition, - options?: ApplicationsUpdateAccessOptionalParams - ): Promise, void>>; - /** - * Update access for application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationName The name of the managed application. - * @param parameters Request body parameters to list tokens. - * @param options The options parameters. - */ - beginUpdateAccessAndWait( - resourceGroupName: string, - applicationName: string, - parameters: UpdateAccessDefinition, - options?: ApplicationsUpdateAccessOptionalParams - ): Promise; - /** - * List tokens for application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param applicationName The name of the managed application. - * @param parameters Request body parameters to list tokens. - * @param options The options parameters. - */ - listTokens( - resourceGroupName: string, - applicationName: string, - parameters: ListTokenRequest, - options?: ApplicationsListTokensOptionalParams - ): Promise; } diff --git a/sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/index.ts b/sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/index.ts index 33368526b96f..97e7c916476b 100644 --- a/sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/index.ts +++ b/sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/index.ts @@ -8,4 +8,3 @@ export * from "./applications.js"; export * from "./applicationDefinitions.js"; -export * from "./jitRequests.js"; diff --git a/sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/jitRequests.ts b/sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/jitRequests.ts deleted file mode 100644 index b646e325a168..000000000000 --- a/sdk/managedapplications/arm-managedapplications/src/operationsInterfaces/jitRequests.ts +++ /dev/null @@ -1,110 +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 { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - JitRequestsGetOptionalParams, - JitRequestsGetResponse, - JitRequestDefinition, - JitRequestsCreateOrUpdateOptionalParams, - JitRequestsCreateOrUpdateResponse, - JitRequestPatchable, - JitRequestsUpdateOptionalParams, - JitRequestsUpdateResponse, - JitRequestsDeleteOptionalParams, - JitRequestsListBySubscriptionOptionalParams, - JitRequestsListBySubscriptionResponse, - JitRequestsListByResourceGroupOptionalParams, - JitRequestsListByResourceGroupResponse -} from "../models/index.js"; - -/** Interface representing a JitRequests. */ -export interface JitRequests { - /** - * Gets the JIT request. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jitRequestName The name of the JIT request. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - jitRequestName: string, - options?: JitRequestsGetOptionalParams - ): Promise; - /** - * Creates or updates the JIT request. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jitRequestName The name of the JIT request. - * @param parameters Parameters supplied to the update JIT request. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - jitRequestName: string, - parameters: JitRequestDefinition, - options?: JitRequestsCreateOrUpdateOptionalParams - ): Promise< - SimplePollerLike< - OperationState, - JitRequestsCreateOrUpdateResponse - > - >; - /** - * Creates or updates the JIT request. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jitRequestName The name of the JIT request. - * @param parameters Parameters supplied to the update JIT request. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - jitRequestName: string, - parameters: JitRequestDefinition, - options?: JitRequestsCreateOrUpdateOptionalParams - ): Promise; - /** - * Updates the JIT request. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jitRequestName The name of the JIT request. - * @param parameters Parameters supplied to the update JIT request. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - jitRequestName: string, - parameters: JitRequestPatchable, - options?: JitRequestsUpdateOptionalParams - ): Promise; - /** - * Deletes the JIT request. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jitRequestName The name of the JIT request. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - jitRequestName: string, - options?: JitRequestsDeleteOptionalParams - ): Promise; - /** - * Lists all JIT requests within the subscription. - * @param options The options parameters. - */ - listBySubscription( - options?: JitRequestsListBySubscriptionOptionalParams - ): Promise; - /** - * Lists all JIT requests within the resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: JitRequestsListByResourceGroupOptionalParams - ): Promise; -} diff --git a/sdk/managedapplications/arm-managedapplications/src/pagingHelper.ts b/sdk/managedapplications/arm-managedapplications/src/pagingHelper.ts index 269a2b9814b5..e362819bdfc4 100644 --- a/sdk/managedapplications/arm-managedapplications/src/pagingHelper.ts +++ b/sdk/managedapplications/arm-managedapplications/src/pagingHelper.ts @@ -26,10 +26,7 @@ export function getContinuationToken(page: unknown): string | undefined { return pageMap.get(page)?.continuationToken; } -export function setContinuationToken( - page: unknown, - continuationToken: string | undefined -): void { +export function setContinuationToken(page: unknown, continuationToken: string | undefined): void { if (typeof page !== "object" || page === null || !continuationToken) { return; } diff --git a/sdk/managedapplications/arm-managedapplications/test/sampleTest.spec.ts b/sdk/managedapplications/arm-managedapplications/test/sampleTest.spec.ts new file mode 100644 index 000000000000..90b3c8a868b4 --- /dev/null +++ b/sdk/managedapplications/arm-managedapplications/test/sampleTest.spec.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { Recorder, RecorderStartOptions } from "@azure-tools/test-recorder"; +import { afterEach, beforeEach, describe, it, assert } from "vitest"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async () => { + recorder = new Recorder(); + await recorder.start(recorderOptions); + }); + + afterEach(async () => { + await recorder.stop(); + }); + + it("sample test", async () => { + assert(true); + }); +}); diff --git a/sdk/managedapplications/arm-managedapplications/test/snippets.spec.ts b/sdk/managedapplications/arm-managedapplications/test/snippets.spec.ts index 8812a9c88293..c8edf78eabf0 100644 --- a/sdk/managedapplications/arm-managedapplications/test/snippets.spec.ts +++ b/sdk/managedapplications/arm-managedapplications/test/snippets.spec.ts @@ -1,5 +1,10 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. +/* + * 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 { ApplicationClient } from "../src/index.js"; import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; diff --git a/sdk/managedapplications/arm-managedapplications/tsconfig.json b/sdk/managedapplications/arm-managedapplications/tsconfig.json index 19ceb382b521..615c155dfe6f 100644 --- a/sdk/managedapplications/arm-managedapplications/tsconfig.json +++ b/sdk/managedapplications/arm-managedapplications/tsconfig.json @@ -4,10 +4,22 @@ "path": "./tsconfig.src.json" }, { - "path": "./tsconfig.samples.json" + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.test.json" }, { "path": "./tsconfig.test.json" } ] -} +} \ No newline at end of file diff --git a/sdk/managedapplications/arm-managedapplications/vitest.browser.config.ts b/sdk/managedapplications/arm-managedapplications/vitest.browser.config.ts index 10e70dbfa8ee..182729ab5ce9 100644 --- a/sdk/managedapplications/arm-managedapplications/vitest.browser.config.ts +++ b/sdk/managedapplications/arm-managedapplications/vitest.browser.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. @@ -8,7 +9,7 @@ export default mergeConfig( viteConfig, defineConfig({ test: { - include: ["dist-test/browser/test/**/*.spec.js"], + include: ["dist-test/browser/test/**/*.spec.js",], testTimeout: 1200000, hookTimeout: 1200000, }, diff --git a/sdk/managedapplications/arm-managedapplications/vitest.config.ts b/sdk/managedapplications/arm-managedapplications/vitest.config.ts index 86a71911ccc2..40e031385dd8 100644 --- a/sdk/managedapplications/arm-managedapplications/vitest.config.ts +++ b/sdk/managedapplications/arm-managedapplications/vitest.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. diff --git a/sdk/managedapplications/arm-managedapplications/vitest.esm.config.ts b/sdk/managedapplications/arm-managedapplications/vitest.esm.config.ts index 5e9735e9b144..a70127279fc9 100644 --- a/sdk/managedapplications/arm-managedapplications/vitest.esm.config.ts +++ b/sdk/managedapplications/arm-managedapplications/vitest.esm.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. @@ -5,4 +6,7 @@ import { mergeConfig } from "vitest/config"; import vitestConfig from "./vitest.config.ts"; import vitestEsmConfig from "../../../vitest.esm.shared.config.ts"; -export default mergeConfig(vitestConfig, vitestEsmConfig); +export default mergeConfig( + vitestConfig, + vitestEsmConfig +); diff --git a/sdk/policy/arm-policy/CHANGELOG.md b/sdk/policy/arm-policy/CHANGELOG.md index 73df4c62eee8..bc4738fb4a02 100644 --- a/sdk/policy/arm-policy/CHANGELOG.md +++ b/sdk/policy/arm-policy/CHANGELOG.md @@ -1,5 +1,40 @@ # Release History +## 7.0.0 (2025-04-28) + +### Features Added + + - Added operation group PolicyTokens + - Added Interface ErrorDetail + - Added Interface ExternalEvaluationEndpointInvocationResult + - Added Interface ExternalEvaluationEndpointSettings + - Added Interface ExternalEvaluationEnforcementSettings + - Added Interface PolicyLogInfo + - Added Interface PolicyTokenOperation + - Added Interface PolicyTokenRequest + - Added Interface PolicyTokenResponse + - Added Interface PolicyTokensAcquireOptionalParams + - Added Type Alias ExternalEndpointResult + - Added Type Alias PolicyTokenResult + - Added Type Alias PolicyTokensAcquireResponse + - Interface ErrorResponse has a new optional parameter error + - Interface PolicyAssignment has a new optional parameter instanceId + - Interface PolicyDefinition has a new optional parameter externalEvaluationEnforcementSettings + - Interface PolicyDefinitionVersion has a new optional parameter externalEvaluationEnforcementSettings + - Added Enum KnownExternalEndpointResult + - Added Enum KnownPolicyTokenResult + - Enum KnownEnforcementMode has a new value Enroll + +### Breaking Changes + + - Interface ErrorResponse no longer has parameter additionalInfo + - Interface ErrorResponse no longer has parameter code + - Interface ErrorResponse no longer has parameter details + - Interface ErrorResponse no longer has parameter message + - Interface ErrorResponse no longer has parameter target + - Interface PolicyAssignmentsGetByIdOptionalParams no longer has parameter expand + + ## 6.0.0 (2025-03-28) ### Features Added diff --git a/sdk/policy/arm-policy/README.md b/sdk/policy/arm-policy/README.md index 8e619d4eaf82..393a69319427 100644 --- a/sdk/policy/arm-policy/README.md +++ b/sdk/policy/arm-policy/README.md @@ -6,7 +6,7 @@ To manage and control access to your resources, you can define customized polici [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/policy/arm-policy) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-policy) | -[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-policy?view=azure-node-preview) | +[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-policy) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started @@ -63,11 +63,10 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur import { InteractiveBrowserCredential } from "@azure/identity"; import { PolicyClient } from "@azure/arm-policy"; -const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", - clientId: "", -}); + clientId: "" + }); const client = new PolicyClient(credential, subscriptionId); ``` diff --git a/sdk/policy/arm-policy/_meta.json b/sdk/policy/arm-policy/_meta.json index 97bc9b6c900b..c37acc89bcac 100644 --- a/sdk/policy/arm-policy/_meta.json +++ b/sdk/policy/arm-policy/_meta.json @@ -1,8 +1,8 @@ { - "commit": "f7e7494f92af4f4a0699a143ca899bb614f241e4", + "commit": "fcbc290cc06b0d69207105d83bb7dac49c21675b", "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.36 --generate-sample=true", + "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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/resources/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.21", - "use": "@autorest/typescript@6.0.36" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.26", + "use": "@autorest/typescript@^6.0.12" } diff --git a/sdk/policy/arm-policy/api-extractor.json b/sdk/policy/arm-policy/api-extractor.json index f9e8c66c6d62..dcaa48101af0 100644 --- a/sdk/policy/arm-policy/api-extractor.json +++ b/sdk/policy/arm-policy/api-extractor.json @@ -28,4 +28,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/policy/arm-policy/package.json b/sdk/policy/arm-policy/package.json index dfe5bde82bb0..2dbcc8c019df 100644 --- a/sdk/policy/arm-policy/package.json +++ b/sdk/policy/arm-policy/package.json @@ -3,15 +3,17 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for PolicyClient.", - "version": "6.0.0", + "version": "7.0.0", "engines": { "node": ">=18.0.0" }, "dependencies": { - "@azure/core-paging": "^1.6.2", - "@azure/core-client": "^1.9.2", + "@azure/abort-controller": "^2.1.2", "@azure/core-auth": "^1.9.0", - "@azure/core-rest-pipeline": "^1.19.0", + "@azure/core-client": "^1.9.3", + "@azure/core-lro": "^2.5.4", + "@azure/core-paging": "^1.6.2", + "@azure/core-rest-pipeline": "^1.19.1", "tslib": "^2.8.1" }, "keywords": [ @@ -26,20 +28,20 @@ "main": "./dist/commonjs/index.js", "module": "./dist/esm/index.js", "types": "./dist/commonjs/index.d.ts", + "type": "module", "devDependencies": { - "typescript": "~5.7.2", - "dotenv": "^16.0.0", - "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.6.0", - "@azure/logger": "^1.1.4", - "@azure/arm-managementgroups": "^2.0.1", - "@azure-tools/test-recorder": "^4.1.0", "@azure-tools/test-credential": "^2.0.0", + "@azure-tools/test-recorder": "^4.1.0", "@azure-tools/test-utils-vitest": "^1.0.0", + "@azure/dev-tool": "^1.0.0", + "@azure/identity": "^4.9.1", + "@azure/logger": "^1.1.4", "@types/node": "^18.0.0", "@vitest/browser": "^3.0.9", "@vitest/coverage-istanbul": "^3.0.9", - "playwright": "^1.50.1", + "dotenv": "^16.0.0", + "playwright": "^1.52.0", + "typescript": "~5.8.2", "vitest": "^3.0.9" }, "repository": "github:Azure/azure-sdk-for-js", @@ -50,33 +52,33 @@ "dist/", "README.md", "LICENSE", - "review/*", + "review/", "CHANGELOG.md" ], "scripts": { "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api", - "minify": "echo skipped", - "prepack": "npm run build", - "pack": "npm pack 2>&1", - "extract-api": "dev-tool run extract-api", - "lint": "echo skipped", - "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", - "build:node": "echo skipped", "build:browser": "echo skipped", - "build:test": "echo skipped", + "build:node": "echo skipped", "build:samples": "echo skipped.", + "build:test": "echo skipped", "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", + "clean": "dev-tool run vendored 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": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:browser": "echo skipped", + "integration-test:node": "dev-tool run test:vitest --esm", + "lint": "echo skipped", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "pack": "npm pack 2>&1", + "prepack": "npm run build", "test": "npm run integration-test", - "test:node": "echo skipped", "test:browser": "echo skipped", + "test:node": "echo skipped", "unit-test": "npm run unit-test:node && npm run unit-test:browser", - "unit-test:node": "dev-tool run test:vitest", "unit-test:browser": "echo skipped", - "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:node": "dev-tool run test:vitest --esm", - "integration-test:browser": "echo skipped", + "unit-test:node": "dev-tool run test:vitest", "update-snippets": "dev-tool run update-snippets" }, "sideEffects": false, @@ -89,7 +91,9 @@ ] }, "autoPublish": true, - "type": "module", + "browser": "./dist/browser/index.js", + "react-native": "./dist/react-native/index.js", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/policy/arm-policy", "tshy": { "project": "./tsconfig.src.json", "exports": { @@ -106,17 +110,6 @@ ], "selfLink": false }, - "browser": "./dist/browser/index.js", - "react-native": "./dist/react-native/index.js", - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/policy/arm-policy", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-policy?view=azure-node-preview" - }, "exports": { "./package.json": "./package.json", ".": { @@ -138,4 +131,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/policy/arm-policy/review/arm-policy.api.md b/sdk/policy/arm-policy/review/arm-policy.api.md index 5b02cdea5da1..567ad12b3885 100644 --- a/sdk/policy/arm-policy/review/arm-policy.api.md +++ b/sdk/policy/arm-policy/review/arm-policy.api.md @@ -4,18 +4,15 @@ ```ts -import type * as coreAuth from '@azure/core-auth'; +import * as coreAuth from '@azure/core-auth'; import * as coreClient from '@azure/core-client'; -import type { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { OperationState } from '@azure/core-lro'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { SimplePollerLike } from '@azure/core-lro'; // @public export type AssignmentType = string; -// @public -export interface CloudError { - error?: ErrorResponse; -} - // @public export type CreatedByType = string; @@ -29,14 +26,46 @@ export interface ErrorAdditionalInfo { } // @public -export interface ErrorResponse { +export interface ErrorDetail { readonly additionalInfo?: ErrorAdditionalInfo[]; readonly code?: string; - readonly details?: ErrorResponse[]; + readonly details?: ErrorDetail[]; readonly message?: string; readonly target?: string; } +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +export type ExternalEndpointResult = string; + +// @public +export interface ExternalEvaluationEndpointInvocationResult { + claims?: any; + expiration?: Date; + message?: string; + policyInfo?: PolicyLogInfo; + result?: ExternalEndpointResult; + retryAfter?: Date; +} + +// @public +export interface ExternalEvaluationEndpointSettings { + details?: any; + kind?: string; +} + +// @public +export interface ExternalEvaluationEnforcementSettings { + endpointSettings?: ExternalEvaluationEndpointSettings; + missingTokenAction?: string; + resultLifespan?: string; + roleDefinitionIds?: string[]; +} + // @public export function getContinuationToken(page: unknown): string | undefined; @@ -69,7 +98,14 @@ export enum KnownCreatedByType { // @public export enum KnownEnforcementMode { Default = "Default", - DoNotEnforce = "DoNotEnforce" + DoNotEnforce = "DoNotEnforce", + Enroll = "Enroll" +} + +// @public +export enum KnownExternalEndpointResult { + Failed = "Failed", + Succeeded = "Succeeded" } // @public @@ -89,6 +125,12 @@ export enum KnownParameterType { String = "String" } +// @public +export enum KnownPolicyTokenResult { + Failed = "Failed", + Succeeded = "Succeeded" +} + // @public export enum KnownPolicyType { BuiltIn = "BuiltIn", @@ -157,6 +199,7 @@ export interface PolicyAssignment { enforcementMode?: EnforcementMode; readonly id?: string; identity?: Identity; + readonly instanceId?: string; readonly latestDefinitionVersion?: string; location?: string; metadata?: any; @@ -226,7 +269,6 @@ export type PolicyAssignmentsDeleteResponse = PolicyAssignment; // @public export interface PolicyAssignmentsGetByIdOptionalParams extends coreClient.OperationOptions { - expand?: string; } // @public @@ -349,6 +391,8 @@ export class PolicyClient extends coreClient.ServiceClient { // (undocumented) policySetDefinitionVersions: PolicySetDefinitionVersions; // (undocumented) + policyTokens: PolicyTokens; + // (undocumented) subscriptionId?: string; } @@ -363,6 +407,7 @@ export interface PolicyClientOptionalParams extends coreClient.ServiceClientOpti export interface PolicyDefinition { description?: string; displayName?: string; + externalEvaluationEnforcementSettings?: ExternalEvaluationEnforcementSettings; readonly id?: string; metadata?: any; mode?: string; @@ -515,6 +560,7 @@ export type PolicyDefinitionsListResponse = PolicyDefinitionListResult; export interface PolicyDefinitionVersion { description?: string; displayName?: string; + externalEvaluationEnforcementSettings?: ExternalEvaluationEnforcementSettings; readonly id?: string; metadata?: any; mode?: string; @@ -661,6 +707,31 @@ export interface PolicyDefinitionVersionsListOptionalParams extends coreClient.O // @public export type PolicyDefinitionVersionsListResponse = PolicyDefinitionVersionListResult; +// @public +export interface PolicyLogInfo { + ancestors?: string; + complianceReasonCode?: string; + policyAssignmentDisplayName?: string; + policyAssignmentId?: string; + policyAssignmentName?: string; + policyAssignmentScope?: string; + policyAssignmentVersion?: string; + policyDefinitionDisplayName?: string; + policyDefinitionEffect?: string; + policyDefinitionGroupNames?: string[]; + policyDefinitionId?: string; + policyDefinitionName?: string; + policyDefinitionReferenceId?: string; + policyDefinitionVersion?: string; + policyExemptionIds?: string[]; + policySetDefinitionCategory?: string; + policySetDefinitionDisplayName?: string; + policySetDefinitionId?: string; + policySetDefinitionName?: string; + policySetDefinitionVersion?: string; + resourceLocation?: string; +} + // @public export interface PolicySetDefinition { description?: string; @@ -953,6 +1024,49 @@ export interface PolicySetDefinitionVersionsListOptionalParams extends coreClien // @public export type PolicySetDefinitionVersionsListResponse = PolicySetDefinitionVersionListResult; +// @public +export interface PolicyTokenOperation { + content?: any; + httpMethod?: string; + uri?: string; +} + +// @public +export interface PolicyTokenRequest { + changeReference?: string; + operation?: PolicyTokenOperation; +} + +// @public +export interface PolicyTokenResponse { + changeReference?: string; + expiration?: Date; + message?: string; + result?: PolicyTokenResult; + results?: ExternalEvaluationEndpointInvocationResult[]; + retryAfter?: Date; + token?: string; + tokenId?: string; +} + +// @public +export type PolicyTokenResult = string; + +// @public +export interface PolicyTokens { + beginAcquire(parameters: PolicyTokenRequest, options?: PolicyTokensAcquireOptionalParams): Promise, PolicyTokensAcquireResponse>>; + beginAcquireAndWait(parameters: PolicyTokenRequest, options?: PolicyTokensAcquireOptionalParams): Promise; +} + +// @public +export interface PolicyTokensAcquireOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PolicyTokensAcquireResponse = PolicyTokenResponse; + // @public export type PolicyType = string; diff --git a/sdk/policy/arm-policy/src/lroImpl.ts b/sdk/policy/arm-policy/src/lroImpl.ts new file mode 100644 index 000000000000..1b3a95e6c540 --- /dev/null +++ b/sdk/policy/arm-policy/src/lroImpl.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { 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/policy/arm-policy/src/models/index.ts b/sdk/policy/arm-policy/src/models/index.ts index 7c4e42df2a4e..95bedbf15431 100644 --- a/sdk/policy/arm-policy/src/models/index.ts +++ b/sdk/policy/arm-policy/src/models/index.ts @@ -6,76 +6,153 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import type * as coreClient from "@azure/core-client"; +import * as coreClient from "@azure/core-client"; -/** The policy definition. */ -export interface PolicyDefinition { +/** The policy assignment. */ +export interface PolicyAssignment { /** - * The ID of the policy definition. + * The ID of the policy assignment. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * The name of the policy definition. + * The type of the policy assignment. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly type?: string; /** - * The type of the resource (Microsoft.Authorization/policyDefinitions). + * The name of the policy assignment. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; + readonly name?: string; + /** The location of the policy assignment. Only required when utilizing managed identity. */ + location?: string; + /** The managed identity associated with the policy assignment. */ + identity?: Identity; /** * The system metadata relating to this resource. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly systemData?: SystemData; - /** The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static. */ - policyType?: PolicyType; - /** The policy definition mode. Some examples are All, Indexed, Microsoft.KeyVault.Data. */ - mode?: string; - /** The display name of the policy definition. */ + /** The display name of the policy assignment. */ displayName?: string; - /** The policy definition description. */ + /** The ID of the policy definition or policy set definition being assigned. */ + policyDefinitionId?: string; + /** The version of the policy definition to use. */ + definitionVersion?: string; + /** + * The latest version of the policy definition available. This is only present if requested via the $expand query parameter. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly latestDefinitionVersion?: string; + /** + * The effective version of the policy definition in use. This is only present if requested via the $expand query parameter. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly effectiveDefinitionVersion?: string; + /** + * The scope for the policy assignment. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly scope?: string; + /** The policy's excluded scopes. */ + notScopes?: string[]; + /** The parameter values for the assigned policy rule. The keys are the parameter names. */ + parameters?: { [propertyName: string]: ParameterValuesValue }; + /** This message will be part of response in case of policy violation. */ description?: string; - /** The policy rule. */ - policyRule?: any; - /** The policy definition metadata. Metadata is an open ended object and is typically a collection of key value pairs. */ + /** The policy assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs. */ metadata?: any; - /** The parameter definitions for parameters used in the policy rule. The keys are the parameter names. */ - parameters?: { [propertyName: string]: ParameterDefinitionsValue }; - /** The policy definition version in #.#.# format. */ - version?: string; - /** A list of available versions for this policy definition. */ - versions?: string[]; + /** The policy assignment enforcement mode. Possible values are Default, DoNotEnforce, and Enroll */ + enforcementMode?: EnforcementMode; + /** The messages that describe why a resource is non-compliant with the policy. */ + nonComplianceMessages?: NonComplianceMessage[]; + /** The resource selector list to filter policies by resource properties. */ + resourceSelectors?: ResourceSelector[]; + /** The policy property value override. */ + overrides?: Override[]; + /** The type of policy assignment. Possible values are NotSpecified, System, SystemHidden, and Custom. Immutable. */ + assignmentType?: AssignmentType; + /** + * The instance ID of the policy assignment. This ID only and always changes when the assignment is deleted and recreated. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly instanceId?: string; } -/** The definition of a parameter that can be provided to the policy. */ -export interface ParameterDefinitionsValue { - /** The data type of the parameter. */ - type?: ParameterType; - /** The allowed values for the parameter. */ - allowedValues?: any[]; - /** The default value for the parameter if no value is provided. */ - defaultValue?: any; - /** Provides validation of parameter inputs during assignment using a self-defined JSON schema. This property is only supported for object-type parameters and follows the Json.NET Schema 2019-09 implementation. You can learn more about using schemas at https://json-schema.org/ and test draft schemas at https://www.jsonschemavalidator.net/. */ - schema?: any; - /** General metadata for the parameter. */ - metadata?: ParameterDefinitionsValueMetadata; +/** The value of a parameter. */ +export interface ParameterValuesValue { + /** The value of the parameter. */ + value?: any; } -/** General metadata for the parameter. */ -export interface ParameterDefinitionsValueMetadata { - /** Describes unknown properties. The value of an unknown property can be of "any" type. */ - [property: string]: any; - /** The display name for the parameter. */ - displayName?: string; - /** The description of the parameter. */ - description?: string; - /** Used when assigning the policy definition through the portal. Provides a context aware list of values for the user to choose from. */ - strongType?: string; - /** Set to true to have Azure portal create role assignments on the resource ID or resource scope value of this parameter during policy assignment. This property is useful in case you wish to assign permissions outside the assignment scope. */ - assignPermissions?: boolean; +/** A message that describes why a resource is non-compliant with the policy. This is shown in 'deny' error messages and on resource's non-compliant compliance results. */ +export interface NonComplianceMessage { + /** A message that describes why a resource is non-compliant with the policy. This is shown in 'deny' error messages and on resource's non-compliant compliance results. */ + message: string; + /** The policy definition reference ID within a policy set definition the message is intended for. This is only applicable if the policy assignment assigns a policy set definition. If this is not provided the message applies to all policies assigned by this policy assignment. */ + policyDefinitionReferenceId?: string; +} + +/** The resource selector to filter policies by resource properties. */ +export interface ResourceSelector { + /** The name of the resource selector. */ + name?: string; + /** The list of the selector expressions. */ + selectors?: Selector[]; +} + +/** The selector expression. */ +export interface Selector { + /** The selector kind. */ + kind?: SelectorKind; + /** The list of values to filter in. */ + in?: string[]; + /** The list of values to filter out. */ + notIn?: string[]; +} + +/** The policy property value override. */ +export interface Override { + /** The override kind. */ + kind?: OverrideKind; + /** The value to override the policy property. */ + value?: string; + /** The list of the selector expressions. */ + selectors?: Selector[]; +} + +/** Identity for the resource. Policy assignments support a maximum of one identity. That is either a system assigned identity or a single user assigned identity. */ +export interface Identity { + /** + * The principal ID of the resource identity. This property will only be provided for a system assigned identity + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The tenant ID of the resource identity. This property will only be provided for a system assigned identity + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** The identity type. This is the only required field when adding a system or user assigned identity to a resource. */ + type?: ResourceIdentityType; + /** The user identity associated with the policy. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ + userAssignedIdentities?: { + [propertyName: string]: UserAssignedIdentitiesValue; + }; +} + +export interface UserAssignedIdentitiesValue { + /** + * The principal id of user assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The client id of user assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clientId?: string; } /** Metadata pertaining to creation and last modification of the resource. */ @@ -94,14 +171,14 @@ export interface SystemData { lastModifiedAt?: Date; } -/** An error response from a policy operation. */ -export interface CloudError { - /** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.) */ - error?: ErrorResponse; +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; } -/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.) */ -export interface ErrorResponse { +/** The error detail. */ +export interface ErrorDetail { /** * The error code. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -121,7 +198,7 @@ export interface ErrorResponse { * The error details. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly details?: ErrorResponse[]; + readonly details?: ErrorDetail[]; /** * The error additional info. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -143,36 +220,40 @@ export interface ErrorAdditionalInfo { readonly info?: any; } -/** List of policy definitions. */ -export interface PolicyDefinitionListResult { - /** An array of policy definitions. */ - value?: PolicyDefinition[]; - /** The URL to use for getting the next set of results. */ - nextLink?: string; +/** The policy assignment for Patch request. */ +export interface PolicyAssignmentUpdate { + /** The location of the policy assignment. Only required when utilizing managed identity. */ + location?: string; + /** The managed identity associated with the policy assignment. */ + identity?: Identity; + /** The resource selector list to filter policies by resource properties. */ + resourceSelectors?: ResourceSelector[]; + /** The policy property value override. */ + overrides?: Override[]; } -/** List of policy definition versions. */ -export interface PolicyDefinitionVersionListResult { - /** An array of policy definitions versions. */ - value?: PolicyDefinitionVersion[]; +/** List of policy assignments. */ +export interface PolicyAssignmentListResult { + /** An array of policy assignments. */ + value?: PolicyAssignment[]; /** The URL to use for getting the next set of results. */ nextLink?: string; } -/** The ID of the policy definition version. */ -export interface PolicyDefinitionVersion { +/** The policy definition. */ +export interface PolicyDefinition { /** - * The ID of the policy definition version. + * The ID of the policy definition. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * The name of the policy definition version. + * The name of the policy definition. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * The type of the resource (Microsoft.Authorization/policyDefinitions/versions). + * The type of the resource (Microsoft.Authorization/policyDefinitions). * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; @@ -197,48 +278,158 @@ export interface PolicyDefinitionVersion { parameters?: { [propertyName: string]: ParameterDefinitionsValue }; /** The policy definition version in #.#.# format. */ version?: string; + /** A list of available versions for this policy definition. */ + versions?: string[]; + /** The details of the source of external evaluation results required by the policy during enforcement evaluation. */ + externalEvaluationEnforcementSettings?: ExternalEvaluationEnforcementSettings; } -/** The policy set definition. */ -export interface PolicySetDefinition { - /** - * The ID of the policy set definition. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * The name of the policy set definition. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The type of the resource (Microsoft.Authorization/policySetDefinitions). - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * The system metadata relating to this resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; - /** The type of policy set definition. Possible values are NotSpecified, BuiltIn, Custom, and Static. */ - policyType?: PolicyType; - /** The display name of the policy set definition. */ - displayName?: string; - /** The policy set definition description. */ - description?: string; - /** The policy set definition metadata. Metadata is an open ended object and is typically a collection of key value pairs. */ - metadata?: any; - /** The policy set definition parameters that can be used in policy definition references. */ - parameters?: { [propertyName: string]: ParameterDefinitionsValue }; - /** An array of policy definition references. */ - policyDefinitions?: PolicyDefinitionReference[]; - /** The metadata describing groups of policy definition references within the policy set definition. */ - policyDefinitionGroups?: PolicyDefinitionGroup[]; - /** The policy set definition version in #.#.# format. */ - version?: string; - /** A list of available versions for this policy set definition. */ - versions?: string[]; +/** The definition of a parameter that can be provided to the policy. */ +export interface ParameterDefinitionsValue { + /** The data type of the parameter. */ + type?: ParameterType; + /** The allowed values for the parameter. */ + allowedValues?: any[]; + /** The default value for the parameter if no value is provided. */ + defaultValue?: any; + /** Provides validation of parameter inputs during assignment using a self-defined JSON schema. This property is only supported for object-type parameters and follows the Json.NET Schema 2019-09 implementation. You can learn more about using schemas at https://json-schema.org/ and test draft schemas at https://www.jsonschemavalidator.net/. */ + schema?: any; + /** General metadata for the parameter. */ + metadata?: ParameterDefinitionsValueMetadata; +} + +/** General metadata for the parameter. */ +export interface ParameterDefinitionsValueMetadata { + /** Describes unknown properties. The value of an unknown property can be of "any" type. */ + [property: string]: any; + /** The display name for the parameter. */ + displayName?: string; + /** The description of the parameter. */ + description?: string; + /** Used when assigning the policy definition through the portal. Provides a context aware list of values for the user to choose from. */ + strongType?: string; + /** Set to true to have Azure portal create role assignments on the resource ID or resource scope value of this parameter during policy assignment. This property is useful in case you wish to assign permissions outside the assignment scope. */ + assignPermissions?: boolean; +} + +/** The details of the source of external evaluation results required by the policy during enforcement evaluation. */ +export interface ExternalEvaluationEnforcementSettings { + /** What to do when evaluating an enforcement policy that requires an external evaluation and the token is missing. Possible values are Audit and Deny and language expressions are supported. */ + missingTokenAction?: string; + /** The lifespan of the endpoint invocation result after which it's no longer valid. Value is expected to follow the ISO 8601 duration format and language expressions are supported. */ + resultLifespan?: string; + /** The settings of an external endpoint providing evaluation results. */ + endpointSettings?: ExternalEvaluationEndpointSettings; + /** An array of the role definition Ids the assignment's MSI will need in order to invoke the endpoint. */ + roleDefinitionIds?: string[]; +} + +/** The settings of an external endpoint providing evaluation results. */ +export interface ExternalEvaluationEndpointSettings { + /** The kind of the endpoint. */ + kind?: string; + /** The details of the endpoint. */ + details?: any; +} + +/** List of policy definitions. */ +export interface PolicyDefinitionListResult { + /** An array of policy definitions. */ + value?: PolicyDefinition[]; + /** The URL to use for getting the next set of results. */ + nextLink?: string; +} + +/** List of policy definition versions. */ +export interface PolicyDefinitionVersionListResult { + /** An array of policy definitions versions. */ + value?: PolicyDefinitionVersion[]; + /** The URL to use for getting the next set of results. */ + nextLink?: string; +} + +/** The ID of the policy definition version. */ +export interface PolicyDefinitionVersion { + /** + * The ID of the policy definition version. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the policy definition version. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource (Microsoft.Authorization/policyDefinitions/versions). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The system metadata relating to this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static. */ + policyType?: PolicyType; + /** The policy definition mode. Some examples are All, Indexed, Microsoft.KeyVault.Data. */ + mode?: string; + /** The display name of the policy definition. */ + displayName?: string; + /** The policy definition description. */ + description?: string; + /** The policy rule. */ + policyRule?: any; + /** The policy definition metadata. Metadata is an open ended object and is typically a collection of key value pairs. */ + metadata?: any; + /** The parameter definitions for parameters used in the policy rule. The keys are the parameter names. */ + parameters?: { [propertyName: string]: ParameterDefinitionsValue }; + /** The policy definition version in #.#.# format. */ + version?: string; + /** The details of the source of external evaluation results required by the policy during enforcement evaluation. */ + externalEvaluationEnforcementSettings?: ExternalEvaluationEnforcementSettings; +} + +/** The policy set definition. */ +export interface PolicySetDefinition { + /** + * The ID of the policy set definition. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the policy set definition. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource (Microsoft.Authorization/policySetDefinitions). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The system metadata relating to this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** The type of policy set definition. Possible values are NotSpecified, BuiltIn, Custom, and Static. */ + policyType?: PolicyType; + /** The display name of the policy set definition. */ + displayName?: string; + /** The policy set definition description. */ + description?: string; + /** The policy set definition metadata. Metadata is an open ended object and is typically a collection of key value pairs. */ + metadata?: any; + /** The policy set definition parameters that can be used in policy definition references. */ + parameters?: { [propertyName: string]: ParameterDefinitionsValue }; + /** An array of policy definition references. */ + policyDefinitions?: PolicyDefinitionReference[]; + /** The metadata describing groups of policy definition references within the policy set definition. */ + policyDefinitionGroups?: PolicyDefinitionGroup[]; + /** The policy set definition version in #.#.# format. */ + version?: string; + /** A list of available versions for this policy set definition. */ + versions?: string[]; } /** The policy definition reference. */ @@ -265,12 +456,6 @@ export interface PolicyDefinitionReference { groupNames?: string[]; } -/** The value of a parameter. */ -export interface ParameterValuesValue { - /** The value of the parameter. */ - value?: any; -} - /** The policy definition group. */ export interface PolicyDefinitionGroup { /** The name of the group. */ @@ -341,162 +526,217 @@ export interface PolicySetDefinitionVersion { version?: string; } -/** The policy assignment. */ -export interface PolicyAssignment { - /** - * The ID of the policy assignment. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * The type of the policy assignment. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * The name of the policy assignment. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** The location of the policy assignment. Only required when utilizing managed identity. */ - location?: string; - /** The managed identity associated with the policy assignment. */ - identity?: Identity; - /** - * The system metadata relating to this resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; - /** The display name of the policy assignment. */ - displayName?: string; - /** The ID of the policy definition or policy set definition being assigned. */ - policyDefinitionId?: string; - /** The version of the policy definition to use. */ - definitionVersion?: string; - /** - * The latest version of the policy definition available. This is only present if requested via the $expand query parameter. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly latestDefinitionVersion?: string; - /** - * The effective version of the policy definition in use. This is only present if requested via the $expand query parameter. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly effectiveDefinitionVersion?: string; - /** - * The scope for the policy assignment. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly scope?: string; - /** The policy's excluded scopes. */ - notScopes?: string[]; - /** The parameter values for the assigned policy rule. The keys are the parameter names. */ - parameters?: { [propertyName: string]: ParameterValuesValue }; - /** This message will be part of response in case of policy violation. */ - description?: string; - /** The policy assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs. */ - metadata?: any; - /** The policy assignment enforcement mode. Possible values are Default and DoNotEnforce. */ - enforcementMode?: EnforcementMode; - /** The messages that describe why a resource is non-compliant with the policy. */ - nonComplianceMessages?: NonComplianceMessage[]; - /** The resource selector list to filter policies by resource properties. */ - resourceSelectors?: ResourceSelector[]; - /** The policy property value override. */ - overrides?: Override[]; - /** The type of policy assignment. Possible values are NotSpecified, System, SystemHidden, and Custom. Immutable. */ - assignmentType?: AssignmentType; +/** The policy token request properties. */ +export interface PolicyTokenRequest { + /** The resource operation to acquire a token for. */ + operation?: PolicyTokenOperation; + /** The change reference. */ + changeReference?: string; } -/** A message that describes why a resource is non-compliant with the policy. This is shown in 'deny' error messages and on resource's non-compliant compliance results. */ -export interface NonComplianceMessage { - /** A message that describes why a resource is non-compliant with the policy. This is shown in 'deny' error messages and on resource's non-compliant compliance results. */ - message: string; - /** The policy definition reference ID within a policy set definition the message is intended for. This is only applicable if the policy assignment assigns a policy set definition. If this is not provided the message applies to all policies assigned by this policy assignment. */ - policyDefinitionReferenceId?: string; +/** The resource operation to acquire a token for. */ +export interface PolicyTokenOperation { + /** The request URI of the resource operation. */ + uri?: string; + /** The http method of the resource operation. */ + httpMethod?: string; + /** The payload of the resource operation. */ + content?: any; } -/** The resource selector to filter policies by resource properties. */ -export interface ResourceSelector { - /** The name of the resource selector. */ - name?: string; - /** The list of the selector expressions. */ - selectors?: Selector[]; +/** The policy token response properties. */ +export interface PolicyTokenResponse { + /** The result of the completed token acquisition operation. Possible values are Succeeded and Failed. */ + result?: PolicyTokenResult; + /** Status message with additional details about the token acquisition operation result. */ + message?: string; + /** The date and time after which the client can try to acquire a token again in the case of retry-able failures. */ + retryAfter?: Date; + /** An array of external evaluation endpoint invocation results. */ + results?: ExternalEvaluationEndpointInvocationResult[]; + /** The change reference associated with the operation for which the token is acquired. */ + changeReference?: string; + /** The issued policy token. */ + token?: string; + /** The unique Id assigned to the policy token. */ + tokenId?: string; + /** The expiration of the policy token. */ + expiration?: Date; } -/** The selector expression. */ -export interface Selector { - /** The selector kind. */ - kind?: SelectorKind; - /** The list of values to filter in. */ - in?: string[]; - /** The list of values to filter out. */ - notIn?: string[]; +/** The external evaluation endpoint invocation results. */ +export interface ExternalEvaluationEndpointInvocationResult { + /** The details of the policy requiring the external endpoint invocation. */ + policyInfo?: PolicyLogInfo; + /** The result of the external endpoint. Possible values are Succeeded and Failed. */ + result?: ExternalEndpointResult; + /** The status message with additional details about the invocation result. */ + message?: string; + /** The date and time after which a failed endpoint invocation can be retried. */ + retryAfter?: Date; + /** The set of claims that will be attached to the policy token as an attestation for the result of the endpoint invocation. */ + claims?: any; + /** The expiration of the results. */ + expiration?: Date; } -/** The policy property value override. */ -export interface Override { - /** The override kind. */ - kind?: OverrideKind; - /** The value to override the policy property. */ - value?: string; - /** The list of the selector expressions. */ - selectors?: Selector[]; +/** The policy log info. */ +export interface PolicyLogInfo { + /** The policy definition Id. */ + policyDefinitionId?: string; + /** The policy set definition Id. */ + policySetDefinitionId?: string; + /** The policy definition instance Id inside a policy set. */ + policyDefinitionReferenceId?: string; + /** The policy set definition name. */ + policySetDefinitionName?: string; + /** The policy set definition display name. */ + policySetDefinitionDisplayName?: string; + /** The policy set definition version. */ + policySetDefinitionVersion?: string; + /** The policy set definition category. */ + policySetDefinitionCategory?: string; + /** The policy definition name. */ + policyDefinitionName?: string; + /** The policy definition display name. */ + policyDefinitionDisplayName?: string; + /** The policy definition version. */ + policyDefinitionVersion?: string; + /** The policy definition action. */ + policyDefinitionEffect?: string; + /** An array of policy definition group names. */ + policyDefinitionGroupNames?: string[]; + /** The policy assignment Id. */ + policyAssignmentId?: string; + /** The policy assignment name. */ + policyAssignmentName?: string; + /** The policy assignment display name. */ + policyAssignmentDisplayName?: string; + /** The policy assignment version. */ + policyAssignmentVersion?: string; + /** The policy assignment scope. */ + policyAssignmentScope?: string; + /** The resource location. */ + resourceLocation?: string; + /** The management group ancestors. */ + ancestors?: string; + /** The policy compliance reason code. */ + complianceReasonCode?: string; + /** An array of policy exemption Ids. */ + policyExemptionIds?: string[]; } -/** Identity for the resource. Policy assignments support a maximum of one identity. That is either a system assigned identity or a single user assigned identity. */ -export interface Identity { - /** - * The principal ID of the resource identity. This property will only be provided for a system assigned identity - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalId?: string; - /** - * The tenant ID of the resource identity. This property will only be provided for a system assigned identity - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly tenantId?: string; - /** The identity type. This is the only required field when adding a system or user assigned identity to a resource. */ - type?: ResourceIdentityType; - /** The user identity associated with the policy. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ - userAssignedIdentities?: { - [propertyName: string]: UserAssignedIdentitiesValue; - }; +/** Known values of {@link EnforcementMode} that the service accepts. */ +export enum KnownEnforcementMode { + /** The policy effect is enforced during resource creation or update. */ + Default = "Default", + /** The policy effect is not enforced during resource creation or update. */ + DoNotEnforce = "DoNotEnforce", + /** The policy effect is not enforced during resource creation or update until the resource or scope of the resource is enrolled to the assignment instance. Enrollment occurs upon deployment of the policy enrollment resource. */ + Enroll = "Enroll", } -export interface UserAssignedIdentitiesValue { - /** - * The principal id of user assigned identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalId?: string; - /** - * The client id of user assigned identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly clientId?: string; +/** + * Defines values for EnforcementMode. \ + * {@link KnownEnforcementMode} can be used interchangeably with EnforcementMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Default**: The policy effect is enforced during resource creation or update. \ + * **DoNotEnforce**: The policy effect is not enforced during resource creation or update. \ + * **Enroll**: The policy effect is not enforced during resource creation or update until the resource or scope of the resource is enrolled to the assignment instance. Enrollment occurs upon deployment of the policy enrollment resource. + */ +export type EnforcementMode = string; + +/** Known values of {@link SelectorKind} that the service accepts. */ +export enum KnownSelectorKind { + /** The selector kind to filter policies by the resource location. */ + ResourceLocation = "resourceLocation", + /** The selector kind to filter policies by the resource type. */ + ResourceType = "resourceType", + /** The selector kind to filter policies by the resource without location. */ + ResourceWithoutLocation = "resourceWithoutLocation", + /** The selector kind to filter policies by the policy definition reference ID. */ + PolicyDefinitionReferenceId = "policyDefinitionReferenceId", } -/** The policy assignment for Patch request. */ -export interface PolicyAssignmentUpdate { - /** The location of the policy assignment. Only required when utilizing managed identity. */ - location?: string; - /** The managed identity associated with the policy assignment. */ - identity?: Identity; - /** The resource selector list to filter policies by resource properties. */ - resourceSelectors?: ResourceSelector[]; - /** The policy property value override. */ - overrides?: Override[]; +/** + * Defines values for SelectorKind. \ + * {@link KnownSelectorKind} can be used interchangeably with SelectorKind, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **resourceLocation**: The selector kind to filter policies by the resource location. \ + * **resourceType**: The selector kind to filter policies by the resource type. \ + * **resourceWithoutLocation**: The selector kind to filter policies by the resource without location. \ + * **policyDefinitionReferenceId**: The selector kind to filter policies by the policy definition reference ID. + */ +export type SelectorKind = string; + +/** Known values of {@link OverrideKind} that the service accepts. */ +export enum KnownOverrideKind { + /** It will override the policy effect type. */ + PolicyEffect = "policyEffect", + /** It will override the definition version property value of the policy assignment. */ + DefinitionVersion = "definitionVersion", } -/** List of policy assignments. */ -export interface PolicyAssignmentListResult { - /** An array of policy assignments. */ - value?: PolicyAssignment[]; - /** The URL to use for getting the next set of results. */ - nextLink?: string; +/** + * Defines values for OverrideKind. \ + * {@link KnownOverrideKind} can be used interchangeably with OverrideKind, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **policyEffect**: It will override the policy effect type. \ + * **definitionVersion**: It will override the definition version property value of the policy assignment. + */ +export type OverrideKind = string; + +/** Known values of {@link AssignmentType} that the service accepts. */ +export enum KnownAssignmentType { + /** NotSpecified */ + NotSpecified = "NotSpecified", + /** System */ + System = "System", + /** SystemHidden */ + SystemHidden = "SystemHidden", + /** Custom */ + Custom = "Custom", +} + +/** + * Defines values for AssignmentType. \ + * {@link KnownAssignmentType} can be used interchangeably with AssignmentType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NotSpecified** \ + * **System** \ + * **SystemHidden** \ + * **Custom** + */ +export type AssignmentType = 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 PolicyType} that the service accepts. */ export enum KnownPolicyType { /** NotSpecified */ @@ -554,115 +794,176 @@ export enum KnownParameterType { */ export type ParameterType = 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", +/** Known values of {@link PolicyTokenResult} that the service accepts. */ +export enum KnownPolicyTokenResult { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", } /** - * Defines values for CreatedByType. \ - * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * Defines values for PolicyTokenResult. \ + * {@link KnownPolicyTokenResult} can be used interchangeably with PolicyTokenResult, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **User** \ - * **Application** \ - * **ManagedIdentity** \ - * **Key** + * **Succeeded** \ + * **Failed** */ -export type CreatedByType = string; +export type PolicyTokenResult = string; + +/** Known values of {@link ExternalEndpointResult} that the service accepts. */ +export enum KnownExternalEndpointResult { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", +} + +/** + * Defines values for ExternalEndpointResult. \ + * {@link KnownExternalEndpointResult} can be used interchangeably with ExternalEndpointResult, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** + */ +export type ExternalEndpointResult = string; +/** Defines values for ResourceIdentityType. */ +export type ResourceIdentityType = "SystemAssigned" | "UserAssigned" | "None"; + +/** Optional parameters. */ +export interface PolicyAssignmentsDeleteOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the delete operation. */ +export type PolicyAssignmentsDeleteResponse = PolicyAssignment; + +/** Optional parameters. */ +export interface PolicyAssignmentsCreateOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the create operation. */ +export type PolicyAssignmentsCreateResponse = PolicyAssignment; + +/** Optional parameters. */ +export interface PolicyAssignmentsGetOptionalParams extends coreClient.OperationOptions { + /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ + expand?: string; +} + +/** Contains response data for the get operation. */ +export type PolicyAssignmentsGetResponse = PolicyAssignment; + +/** Optional parameters. */ +export interface PolicyAssignmentsUpdateOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type PolicyAssignmentsUpdateResponse = PolicyAssignment; + +/** Optional parameters. */ +export interface PolicyAssignmentsListForResourceGroupOptionalParams + extends coreClient.OperationOptions { + /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ + expand?: string; + /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. */ + filter?: string; + /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ + top?: number; +} + +/** Contains response data for the listForResourceGroup operation. */ +export type PolicyAssignmentsListForResourceGroupResponse = PolicyAssignmentListResult; + +/** Optional parameters. */ +export interface PolicyAssignmentsListForResourceOptionalParams + extends coreClient.OperationOptions { + /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ + expand?: string; + /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. */ + filter?: string; + /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ + top?: number; +} + +/** Contains response data for the listForResource operation. */ +export type PolicyAssignmentsListForResourceResponse = PolicyAssignmentListResult; + +/** Optional parameters. */ +export interface PolicyAssignmentsListForManagementGroupOptionalParams + extends coreClient.OperationOptions { + /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ + expand?: string; + /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. */ + filter?: string; + /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ + top?: number; +} + +/** Contains response data for the listForManagementGroup operation. */ +export type PolicyAssignmentsListForManagementGroupResponse = PolicyAssignmentListResult; + +/** Optional parameters. */ +export interface PolicyAssignmentsListOptionalParams extends coreClient.OperationOptions { + /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ + expand?: string; + /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. */ + filter?: string; + /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ + top?: number; +} + +/** Contains response data for the list operation. */ +export type PolicyAssignmentsListResponse = PolicyAssignmentListResult; + +/** Optional parameters. */ +export interface PolicyAssignmentsDeleteByIdOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the deleteById operation. */ +export type PolicyAssignmentsDeleteByIdResponse = PolicyAssignment; + +/** Optional parameters. */ +export interface PolicyAssignmentsCreateByIdOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the createById operation. */ +export type PolicyAssignmentsCreateByIdResponse = PolicyAssignment; + +/** Optional parameters. */ +export interface PolicyAssignmentsGetByIdOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the getById operation. */ +export type PolicyAssignmentsGetByIdResponse = PolicyAssignment; + +/** Optional parameters. */ +export interface PolicyAssignmentsUpdateByIdOptionalParams extends coreClient.OperationOptions {} -/** Known values of {@link EnforcementMode} that the service accepts. */ -export enum KnownEnforcementMode { - /** The policy effect is enforced during resource creation or update. */ - Default = "Default", - /** The policy effect is not enforced during resource creation or update. */ - DoNotEnforce = "DoNotEnforce", -} +/** Contains response data for the updateById operation. */ +export type PolicyAssignmentsUpdateByIdResponse = PolicyAssignment; -/** - * Defines values for EnforcementMode. \ - * {@link KnownEnforcementMode} can be used interchangeably with EnforcementMode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Default**: The policy effect is enforced during resource creation or update. \ - * **DoNotEnforce**: The policy effect is not enforced during resource creation or update. - */ -export type EnforcementMode = string; +/** Optional parameters. */ +export interface PolicyAssignmentsListForResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} -/** Known values of {@link SelectorKind} that the service accepts. */ -export enum KnownSelectorKind { - /** The selector kind to filter policies by the resource location. */ - ResourceLocation = "resourceLocation", - /** The selector kind to filter policies by the resource type. */ - ResourceType = "resourceType", - /** The selector kind to filter policies by the resource without location. */ - ResourceWithoutLocation = "resourceWithoutLocation", - /** The selector kind to filter policies by the policy definition reference ID. */ - PolicyDefinitionReferenceId = "policyDefinitionReferenceId", -} +/** Contains response data for the listForResourceGroupNext operation. */ +export type PolicyAssignmentsListForResourceGroupNextResponse = PolicyAssignmentListResult; -/** - * Defines values for SelectorKind. \ - * {@link KnownSelectorKind} can be used interchangeably with SelectorKind, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **resourceLocation**: The selector kind to filter policies by the resource location. \ - * **resourceType**: The selector kind to filter policies by the resource type. \ - * **resourceWithoutLocation**: The selector kind to filter policies by the resource without location. \ - * **policyDefinitionReferenceId**: The selector kind to filter policies by the policy definition reference ID. - */ -export type SelectorKind = string; +/** Optional parameters. */ +export interface PolicyAssignmentsListForResourceNextOptionalParams + extends coreClient.OperationOptions {} -/** Known values of {@link OverrideKind} that the service accepts. */ -export enum KnownOverrideKind { - /** It will override the policy effect type. */ - PolicyEffect = "policyEffect", - /** It will override the definition version property value of the policy assignment. */ - DefinitionVersion = "definitionVersion", -} +/** Contains response data for the listForResourceNext operation. */ +export type PolicyAssignmentsListForResourceNextResponse = PolicyAssignmentListResult; -/** - * Defines values for OverrideKind. \ - * {@link KnownOverrideKind} can be used interchangeably with OverrideKind, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **policyEffect**: It will override the policy effect type. \ - * **definitionVersion**: It will override the definition version property value of the policy assignment. - */ -export type OverrideKind = string; +/** Optional parameters. */ +export interface PolicyAssignmentsListForManagementGroupNextOptionalParams + extends coreClient.OperationOptions {} -/** Known values of {@link AssignmentType} that the service accepts. */ -export enum KnownAssignmentType { - /** NotSpecified */ - NotSpecified = "NotSpecified", - /** System */ - System = "System", - /** SystemHidden */ - SystemHidden = "SystemHidden", - /** Custom */ - Custom = "Custom", -} +/** Contains response data for the listForManagementGroupNext operation. */ +export type PolicyAssignmentsListForManagementGroupNextResponse = PolicyAssignmentListResult; -/** - * Defines values for AssignmentType. \ - * {@link KnownAssignmentType} can be used interchangeably with AssignmentType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **NotSpecified** \ - * **System** \ - * **SystemHidden** \ - * **Custom** - */ -export type AssignmentType = string; -/** Defines values for ResourceIdentityType. */ -export type ResourceIdentityType = "SystemAssigned" | "UserAssigned" | "None"; +/** Optional parameters. */ +export interface PolicyAssignmentsListNextOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type PolicyAssignmentsListNextResponse = PolicyAssignmentListResult; /** Optional parameters. */ export interface PolicyDefinitionsCreateOrUpdateOptionalParams @@ -904,12 +1205,12 @@ export type PolicySetDefinitionsGetBuiltInResponse = PolicySetDefinition; /** Optional parameters. */ export interface PolicySetDefinitionsListOptionalParams extends coreClient.OperationOptions { + /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ + expand?: string; /** The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atExactScope() is provided, the returned list only includes all policy set definitions that at the given scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy set definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy set definitions whose category match the {value}. */ filter?: string; /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ top?: number; - /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ - expand?: string; } /** Contains response data for the list operation. */ @@ -917,12 +1218,12 @@ export type PolicySetDefinitionsListResponse = PolicySetDefinitionListResult; /** Optional parameters. */ export interface PolicySetDefinitionsListBuiltInOptionalParams extends coreClient.OperationOptions { + /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ + expand?: string; /** The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atExactScope() is provided, the returned list only includes all policy set definitions that at the given scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy set definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy set definitions whose category match the {value}. */ filter?: string; /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ top?: number; - /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ - expand?: string; } /** Contains response data for the listBuiltIn operation. */ @@ -952,12 +1253,12 @@ export type PolicySetDefinitionsGetAtManagementGroupResponse = PolicySetDefiniti /** Optional parameters. */ export interface PolicySetDefinitionsListByManagementGroupOptionalParams extends coreClient.OperationOptions { + /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ + expand?: string; /** The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atExactScope() is provided, the returned list only includes all policy set definitions that at the given scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy set definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy set definitions whose category match the {value}. */ filter?: string; /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ top?: number; - /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ - expand?: string; } /** Contains response data for the listByManagementGroup operation. */ @@ -1038,10 +1339,10 @@ export type PolicySetDefinitionVersionsGetBuiltInResponse = PolicySetDefinitionV /** Optional parameters. */ export interface PolicySetDefinitionVersionsListOptionalParams extends coreClient.OperationOptions { - /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ - top?: number; /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ expand?: string; + /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ + top?: number; } /** Contains response data for the list operation. */ @@ -1050,10 +1351,10 @@ export type PolicySetDefinitionVersionsListResponse = PolicySetDefinitionVersion /** Optional parameters. */ export interface PolicySetDefinitionVersionsListBuiltInOptionalParams extends coreClient.OperationOptions { - /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ - top?: number; /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ expand?: string; + /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ + top?: number; } /** Contains response data for the listBuiltIn operation. */ @@ -1084,10 +1385,10 @@ export type PolicySetDefinitionVersionsGetAtManagementGroupResponse = PolicySetD /** Optional parameters. */ export interface PolicySetDefinitionVersionsListByManagementGroupOptionalParams extends coreClient.OperationOptions { - /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ - top?: number; /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ expand?: string; + /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ + top?: number; } /** Contains response data for the listByManagementGroup operation. */ @@ -1118,140 +1419,15 @@ export type PolicySetDefinitionVersionsListByManagementGroupNextResponse = PolicySetDefinitionVersionListResult; /** Optional parameters. */ -export interface PolicyAssignmentsDeleteOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the delete operation. */ -export type PolicyAssignmentsDeleteResponse = PolicyAssignment; - -/** Optional parameters. */ -export interface PolicyAssignmentsCreateOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the create operation. */ -export type PolicyAssignmentsCreateResponse = PolicyAssignment; - -/** Optional parameters. */ -export interface PolicyAssignmentsGetOptionalParams extends coreClient.OperationOptions { - /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ - expand?: string; -} - -/** Contains response data for the get operation. */ -export type PolicyAssignmentsGetResponse = PolicyAssignment; - -/** Optional parameters. */ -export interface PolicyAssignmentsUpdateOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the update operation. */ -export type PolicyAssignmentsUpdateResponse = PolicyAssignment; - -/** Optional parameters. */ -export interface PolicyAssignmentsListForResourceGroupOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. */ - filter?: string; - /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ - top?: number; - /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ - expand?: string; -} - -/** Contains response data for the listForResourceGroup operation. */ -export type PolicyAssignmentsListForResourceGroupResponse = PolicyAssignmentListResult; - -/** Optional parameters. */ -export interface PolicyAssignmentsListForResourceOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. */ - filter?: string; - /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ - top?: number; - /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ - expand?: string; -} - -/** Contains response data for the listForResource operation. */ -export type PolicyAssignmentsListForResourceResponse = PolicyAssignmentListResult; - -/** Optional parameters. */ -export interface PolicyAssignmentsListForManagementGroupOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. */ - filter?: string; - /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ - top?: number; - /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ - expand?: string; -} - -/** Contains response data for the listForManagementGroup operation. */ -export type PolicyAssignmentsListForManagementGroupResponse = PolicyAssignmentListResult; - -/** Optional parameters. */ -export interface PolicyAssignmentsListOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. */ - filter?: string; - /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ - top?: number; - /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ - expand?: string; -} - -/** Contains response data for the list operation. */ -export type PolicyAssignmentsListResponse = PolicyAssignmentListResult; - -/** Optional parameters. */ -export interface PolicyAssignmentsDeleteByIdOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the deleteById operation. */ -export type PolicyAssignmentsDeleteByIdResponse = PolicyAssignment; - -/** Optional parameters. */ -export interface PolicyAssignmentsCreateByIdOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the createById operation. */ -export type PolicyAssignmentsCreateByIdResponse = PolicyAssignment; - -/** Optional parameters. */ -export interface PolicyAssignmentsGetByIdOptionalParams extends coreClient.OperationOptions { - /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ - expand?: string; +export interface PolicyTokensAcquireOptionalParams 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 getById operation. */ -export type PolicyAssignmentsGetByIdResponse = PolicyAssignment; - -/** Optional parameters. */ -export interface PolicyAssignmentsUpdateByIdOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the updateById operation. */ -export type PolicyAssignmentsUpdateByIdResponse = PolicyAssignment; - -/** Optional parameters. */ -export interface PolicyAssignmentsListForResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listForResourceGroupNext operation. */ -export type PolicyAssignmentsListForResourceGroupNextResponse = PolicyAssignmentListResult; - -/** Optional parameters. */ -export interface PolicyAssignmentsListForResourceNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listForResourceNext operation. */ -export type PolicyAssignmentsListForResourceNextResponse = PolicyAssignmentListResult; - -/** Optional parameters. */ -export interface PolicyAssignmentsListForManagementGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listForManagementGroupNext operation. */ -export type PolicyAssignmentsListForManagementGroupNextResponse = PolicyAssignmentListResult; - -/** Optional parameters. */ -export interface PolicyAssignmentsListNextOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type PolicyAssignmentsListNextResponse = PolicyAssignmentListResult; +/** Contains response data for the acquire operation. */ +export type PolicyTokensAcquireResponse = PolicyTokenResponse; /** Optional parameters. */ export interface PolicyClientOptionalParams extends coreClient.ServiceClientOptions { diff --git a/sdk/policy/arm-policy/src/models/mappers.ts b/sdk/policy/arm-policy/src/models/mappers.ts index 53248dd6981d..769a435a3e92 100644 --- a/sdk/policy/arm-policy/src/models/mappers.ts +++ b/sdk/policy/arm-policy/src/models/mappers.ts @@ -6,12 +6,12 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import type * as coreClient from "@azure/core-client"; +import * as coreClient from "@azure/core-client"; -export const PolicyDefinition: coreClient.CompositeMapper = { +export const PolicyAssignment: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyDefinition", + className: "PolicyAssignment", modelProperties: { id: { serializedName: "id", @@ -20,6 +20,13 @@ export const PolicyDefinition: coreClient.CompositeMapper = { name: "String", }, }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String", + }, + }, name: { serializedName: "name", readOnly: true, @@ -27,13 +34,19 @@ export const PolicyDefinition: coreClient.CompositeMapper = { name: "String", }, }, - type: { - serializedName: "type", - readOnly: true, + location: { + serializedName: "location", type: { name: "String", }, }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity", + }, + }, systemData: { serializedName: "systemData", type: { @@ -41,41 +54,54 @@ export const PolicyDefinition: coreClient.CompositeMapper = { className: "SystemData", }, }, - policyType: { - serializedName: "properties.policyType", + displayName: { + serializedName: "properties.displayName", type: { name: "String", }, }, - mode: { - defaultValue: "Indexed", - serializedName: "properties.mode", + policyDefinitionId: { + serializedName: "properties.policyDefinitionId", type: { name: "String", }, }, - displayName: { - serializedName: "properties.displayName", + definitionVersion: { + serializedName: "properties.definitionVersion", type: { name: "String", }, }, - description: { - serializedName: "properties.description", + latestDefinitionVersion: { + serializedName: "properties.latestDefinitionVersion", + readOnly: true, type: { name: "String", }, }, - policyRule: { - serializedName: "properties.policyRule", + effectiveDefinitionVersion: { + serializedName: "properties.effectiveDefinitionVersion", + readOnly: true, type: { - name: "any", + name: "String", }, }, - metadata: { - serializedName: "properties.metadata", + scope: { + serializedName: "properties.scope", + readOnly: true, type: { - name: "any", + name: "String", + }, + }, + notScopes: { + serializedName: "properties.notScopes", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, }, }, parameters: { @@ -83,175 +109,346 @@ export const PolicyDefinition: coreClient.CompositeMapper = { type: { name: "Dictionary", value: { - type: { name: "Composite", className: "ParameterDefinitionsValue" }, + type: { name: "Composite", className: "ParameterValuesValue" }, }, }, }, - version: { - serializedName: "properties.version", + description: { + serializedName: "properties.description", type: { name: "String", }, }, - versions: { - serializedName: "properties.versions", + metadata: { + serializedName: "properties.metadata", + type: { + name: "any", + }, + }, + enforcementMode: { + defaultValue: "Default", + serializedName: "properties.enforcementMode", + type: { + name: "String", + }, + }, + nonComplianceMessages: { + serializedName: "properties.nonComplianceMessages", type: { name: "Sequence", element: { type: { - name: "String", + name: "Composite", + className: "NonComplianceMessage", }, }, }, }, - }, - }, -}; - -export const ParameterDefinitionsValue: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ParameterDefinitionsValue", - modelProperties: { - type: { - serializedName: "type", + resourceSelectors: { + serializedName: "properties.resourceSelectors", type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceSelector", + }, + }, }, }, - allowedValues: { - serializedName: "allowedValues", + overrides: { + serializedName: "properties.overrides", type: { name: "Sequence", element: { type: { - name: "any", + name: "Composite", + className: "Override", }, }, }, }, - defaultValue: { - serializedName: "defaultValue", + assignmentType: { + serializedName: "properties.assignmentType", type: { - name: "any", + name: "String", }, }, - schema: { - serializedName: "schema", + instanceId: { + serializedName: "properties.instanceId", + readOnly: true, type: { - name: "any", + name: "String", }, }, - metadata: { - serializedName: "metadata", + }, + }, +}; + +export const ParameterValuesValue: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ParameterValuesValue", + modelProperties: { + value: { + serializedName: "value", type: { - name: "Composite", - className: "ParameterDefinitionsValueMetadata", + name: "any", }, }, }, }, }; -export const ParameterDefinitionsValueMetadata: coreClient.CompositeMapper = { +export const NonComplianceMessage: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ParameterDefinitionsValueMetadata", - additionalProperties: { type: { name: "Object" } }, + className: "NonComplianceMessage", modelProperties: { - displayName: { - serializedName: "displayName", + message: { + serializedName: "message", + required: true, type: { name: "String", }, }, - description: { - serializedName: "description", + policyDefinitionReferenceId: { + serializedName: "policyDefinitionReferenceId", type: { name: "String", }, }, - strongType: { - serializedName: "strongType", + }, + }, +}; + +export const ResourceSelector: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceSelector", + modelProperties: { + name: { + serializedName: "name", type: { name: "String", }, }, - assignPermissions: { - serializedName: "assignPermissions", + selectors: { + serializedName: "selectors", type: { - name: "Boolean", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Selector", + }, + }, }, }, }, }, }; -export const SystemData: coreClient.CompositeMapper = { +export const Selector: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SystemData", + className: "Selector", modelProperties: { - createdBy: { - serializedName: "createdBy", + kind: { + serializedName: "kind", type: { name: "String", }, }, - createdByType: { - serializedName: "createdByType", + in: { + serializedName: "in", type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "String", + }, + }, }, }, - createdAt: { - serializedName: "createdAt", + notIn: { + serializedName: "notIn", type: { - name: "DateTime", + name: "Sequence", + element: { + type: { + name: "String", + }, + }, }, }, - lastModifiedBy: { - serializedName: "lastModifiedBy", + }, + }, +}; + +export const Override: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Override", + modelProperties: { + kind: { + serializedName: "kind", type: { name: "String", }, }, - lastModifiedByType: { - serializedName: "lastModifiedByType", + value: { + serializedName: "value", type: { name: "String", }, }, - lastModifiedAt: { - serializedName: "lastModifiedAt", + selectors: { + serializedName: "selectors", type: { - name: "DateTime", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Selector", + }, + }, }, }, }, }, }; -export const CloudError: coreClient.CompositeMapper = { +export const Identity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CloudError", + className: "Identity", modelProperties: { - error: { - serializedName: "error", + principalId: { + serializedName: "principalId", + readOnly: true, type: { - name: "Composite", - className: "ErrorResponse", + name: "String", }, }, - }, - }, + tenantId: { + serializedName: "tenantId", + readOnly: true, + type: { + name: "String", + }, + }, + type: { + serializedName: "type", + type: { + name: "Enum", + allowedValues: ["SystemAssigned", "UserAssigned", "None"], + }, + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { + name: "Composite", + className: "UserAssignedIdentitiesValue", + }, + }, + }, + }, + }, + }, +}; + +export const UserAssignedIdentitiesValue: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserAssignedIdentitiesValue", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "String", + }, + }, + clientId: { + serializedName: "clientId", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const SystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String", + }, + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String", + }, + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime", + }, + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String", + }, + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String", + }, + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime", + }, + }, + }, + }, }; export const ErrorResponse: coreClient.CompositeMapper = { type: { name: "Composite", className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail", + }, + }, + }, + }, +}; + +export const ErrorDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetail", modelProperties: { code: { serializedName: "code", @@ -282,7 +479,7 @@ export const ErrorResponse: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorResponse", + className: "ErrorDetail", }, }, }, @@ -327,37 +524,56 @@ export const ErrorAdditionalInfo: coreClient.CompositeMapper = { }, }; -export const PolicyDefinitionListResult: coreClient.CompositeMapper = { +export const PolicyAssignmentUpdate: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyDefinitionListResult", + className: "PolicyAssignmentUpdate", modelProperties: { - value: { - serializedName: "value", + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity", + }, + }, + resourceSelectors: { + serializedName: "properties.resourceSelectors", type: { name: "Sequence", element: { type: { name: "Composite", - className: "PolicyDefinition", + className: "ResourceSelector", }, }, }, }, - nextLink: { - serializedName: "nextLink", + overrides: { + serializedName: "properties.overrides", type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Override", + }, + }, }, }, }, }, }; -export const PolicyDefinitionVersionListResult: coreClient.CompositeMapper = { +export const PolicyAssignmentListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyDefinitionVersionListResult", + className: "PolicyAssignmentListResult", modelProperties: { value: { serializedName: "value", @@ -366,7 +582,7 @@ export const PolicyDefinitionVersionListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "PolicyDefinitionVersion", + className: "PolicyAssignment", }, }, }, @@ -381,10 +597,10 @@ export const PolicyDefinitionVersionListResult: coreClient.CompositeMapper = { }, }; -export const PolicyDefinitionVersion: coreClient.CompositeMapper = { +export const PolicyDefinition: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyDefinitionVersion", + className: "PolicyDefinition", modelProperties: { id: { serializedName: "id", @@ -466,108 +682,133 @@ export const PolicyDefinitionVersion: coreClient.CompositeMapper = { name: "String", }, }, + versions: { + serializedName: "properties.versions", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + externalEvaluationEnforcementSettings: { + serializedName: "properties.externalEvaluationEnforcementSettings", + type: { + name: "Composite", + className: "ExternalEvaluationEnforcementSettings", + }, + }, }, }, }; -export const PolicySetDefinition: coreClient.CompositeMapper = { +export const ParameterDefinitionsValue: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicySetDefinition", + className: "ParameterDefinitionsValue", modelProperties: { - id: { - serializedName: "id", - readOnly: true, + type: { + serializedName: "type", type: { name: "String", }, }, - name: { - serializedName: "name", - readOnly: true, + allowedValues: { + serializedName: "allowedValues", type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "any", + }, + }, }, }, - type: { - serializedName: "type", - readOnly: true, + defaultValue: { + serializedName: "defaultValue", type: { - name: "String", + name: "any", }, }, - systemData: { - serializedName: "systemData", + schema: { + serializedName: "schema", type: { - name: "Composite", - className: "SystemData", + name: "any", }, }, - policyType: { - serializedName: "properties.policyType", + metadata: { + serializedName: "metadata", type: { - name: "String", + name: "Composite", + className: "ParameterDefinitionsValueMetadata", }, }, + }, + }, +}; + +export const ParameterDefinitionsValueMetadata: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ParameterDefinitionsValueMetadata", + additionalProperties: { type: { name: "Object" } }, + modelProperties: { displayName: { - serializedName: "properties.displayName", + serializedName: "displayName", type: { name: "String", }, }, description: { - serializedName: "properties.description", + serializedName: "description", type: { name: "String", }, }, - metadata: { - serializedName: "properties.metadata", + strongType: { + serializedName: "strongType", type: { - name: "any", + name: "String", }, }, - parameters: { - serializedName: "properties.parameters", + assignPermissions: { + serializedName: "assignPermissions", type: { - name: "Dictionary", - value: { - type: { name: "Composite", className: "ParameterDefinitionsValue" }, - }, + name: "Boolean", }, }, - policyDefinitions: { - serializedName: "properties.policyDefinitions", + }, + }, +}; + +export const ExternalEvaluationEnforcementSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExternalEvaluationEnforcementSettings", + modelProperties: { + missingTokenAction: { + serializedName: "missingTokenAction", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PolicyDefinitionReference", - }, - }, + name: "String", }, }, - policyDefinitionGroups: { - serializedName: "properties.policyDefinitionGroups", + resultLifespan: { + serializedName: "resultLifespan", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PolicyDefinitionGroup", - }, - }, + name: "String", }, }, - version: { - serializedName: "properties.version", + endpointSettings: { + serializedName: "endpointSettings", type: { - name: "String", + name: "Composite", + className: "ExternalEvaluationEndpointSettings", }, }, - versions: { - serializedName: "properties.versions", + roleDefinitionIds: { + serializedName: "roleDefinitionIds", type: { name: "Sequence", element: { @@ -581,181 +822,181 @@ export const PolicySetDefinition: coreClient.CompositeMapper = { }, }; -export const PolicyDefinitionReference: coreClient.CompositeMapper = { +export const ExternalEvaluationEndpointSettings: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyDefinitionReference", + className: "ExternalEvaluationEndpointSettings", modelProperties: { - policyDefinitionId: { - serializedName: "policyDefinitionId", - required: true, - type: { - name: "String", - }, - }, - definitionVersion: { - serializedName: "definitionVersion", - type: { - name: "String", - }, - }, - latestDefinitionVersion: { - serializedName: "latestDefinitionVersion", - readOnly: true, - type: { - name: "String", - }, - }, - effectiveDefinitionVersion: { - serializedName: "effectiveDefinitionVersion", - readOnly: true, + kind: { + serializedName: "kind", type: { name: "String", }, }, - parameters: { - serializedName: "parameters", - type: { - name: "Dictionary", - value: { - type: { name: "Composite", className: "ParameterValuesValue" }, - }, - }, - }, - policyDefinitionReferenceId: { - serializedName: "policyDefinitionReferenceId", + details: { + serializedName: "details", type: { - name: "String", + name: "any", }, }, - groupNames: { - serializedName: "groupNames", + }, + }, +}; + +export const PolicyDefinitionListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PolicyDefinitionListResult", + modelProperties: { + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { - name: "String", + name: "Composite", + className: "PolicyDefinition", }, }, }, }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, }, }, }; -export const ParameterValuesValue: coreClient.CompositeMapper = { +export const PolicyDefinitionVersionListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ParameterValuesValue", + className: "PolicyDefinitionVersionListResult", modelProperties: { value: { serializedName: "value", type: { - name: "any", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicyDefinitionVersion", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", }, }, }, }, }; -export const PolicyDefinitionGroup: coreClient.CompositeMapper = { +export const PolicyDefinitionVersion: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyDefinitionGroup", + className: "PolicyDefinitionVersion", modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String", + }, + }, name: { serializedName: "name", - required: true, + readOnly: true, type: { name: "String", }, }, - displayName: { - serializedName: "displayName", + type: { + serializedName: "type", + readOnly: true, type: { name: "String", }, }, - category: { - serializedName: "category", + systemData: { + serializedName: "systemData", type: { - name: "String", + name: "Composite", + className: "SystemData", }, }, - description: { - serializedName: "description", + policyType: { + serializedName: "properties.policyType", type: { name: "String", }, }, - additionalMetadataId: { - serializedName: "additionalMetadataId", + mode: { + defaultValue: "Indexed", + serializedName: "properties.mode", type: { name: "String", }, }, - }, - }, -}; - -export const PolicySetDefinitionListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PolicySetDefinitionListResult", - modelProperties: { - value: { - serializedName: "value", + displayName: { + serializedName: "properties.displayName", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PolicySetDefinition", - }, - }, + name: "String", }, }, - nextLink: { - serializedName: "nextLink", + description: { + serializedName: "properties.description", type: { name: "String", }, }, - }, - }, -}; - -export const PolicySetDefinitionVersionListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PolicySetDefinitionVersionListResult", - modelProperties: { - value: { - serializedName: "value", + policyRule: { + serializedName: "properties.policyRule", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PolicySetDefinitionVersion", - }, + name: "any", + }, + }, + metadata: { + serializedName: "properties.metadata", + type: { + name: "any", + }, + }, + parameters: { + serializedName: "properties.parameters", + type: { + name: "Dictionary", + value: { + type: { name: "Composite", className: "ParameterDefinitionsValue" }, }, }, }, - nextLink: { - serializedName: "nextLink", + version: { + serializedName: "properties.version", type: { name: "String", }, }, + externalEvaluationEnforcementSettings: { + serializedName: "properties.externalEvaluationEnforcementSettings", + type: { + name: "Composite", + className: "ExternalEvaluationEnforcementSettings", + }, + }, }, }, }; -export const PolicySetDefinitionVersion: coreClient.CompositeMapper = { +export const PolicySetDefinition: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicySetDefinitionVersion", + className: "PolicySetDefinition", modelProperties: { id: { serializedName: "id", @@ -848,115 +1089,222 @@ export const PolicySetDefinitionVersion: coreClient.CompositeMapper = { name: "String", }, }, + versions: { + serializedName: "properties.versions", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, }, }, }; -export const PolicyAssignment: coreClient.CompositeMapper = { +export const PolicyDefinitionReference: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyAssignment", + className: "PolicyDefinitionReference", modelProperties: { - id: { - serializedName: "id", - readOnly: true, + policyDefinitionId: { + serializedName: "policyDefinitionId", + required: true, type: { name: "String", }, }, - type: { - serializedName: "type", - readOnly: true, + definitionVersion: { + serializedName: "definitionVersion", type: { name: "String", }, }, - name: { - serializedName: "name", + latestDefinitionVersion: { + serializedName: "latestDefinitionVersion", readOnly: true, type: { name: "String", }, }, - location: { - serializedName: "location", + effectiveDefinitionVersion: { + serializedName: "effectiveDefinitionVersion", + readOnly: true, type: { name: "String", }, }, - identity: { - serializedName: "identity", + parameters: { + serializedName: "parameters", type: { - name: "Composite", - className: "Identity", + name: "Dictionary", + value: { + type: { name: "Composite", className: "ParameterValuesValue" }, + }, }, }, - systemData: { - serializedName: "systemData", + policyDefinitionReferenceId: { + serializedName: "policyDefinitionReferenceId", type: { - name: "Composite", - className: "SystemData", + name: "String", }, }, - displayName: { - serializedName: "properties.displayName", + groupNames: { + serializedName: "groupNames", type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "String", + }, + }, }, }, - policyDefinitionId: { - serializedName: "properties.policyDefinitionId", + }, + }, +}; + +export const PolicyDefinitionGroup: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PolicyDefinitionGroup", + modelProperties: { + name: { + serializedName: "name", + required: true, type: { name: "String", }, }, - definitionVersion: { - serializedName: "properties.definitionVersion", + displayName: { + serializedName: "displayName", type: { name: "String", }, }, - latestDefinitionVersion: { - serializedName: "properties.latestDefinitionVersion", - readOnly: true, + category: { + serializedName: "category", type: { name: "String", }, }, - effectiveDefinitionVersion: { - serializedName: "properties.effectiveDefinitionVersion", - readOnly: true, + description: { + serializedName: "description", type: { name: "String", }, }, - scope: { - serializedName: "properties.scope", - readOnly: true, + additionalMetadataId: { + serializedName: "additionalMetadataId", type: { name: "String", }, }, - notScopes: { - serializedName: "properties.notScopes", + }, + }, +}; + +export const PolicySetDefinitionListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PolicySetDefinitionListResult", + modelProperties: { + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { - name: "String", + name: "Composite", + className: "PolicySetDefinition", }, }, }, }, - parameters: { - serializedName: "properties.parameters", + nextLink: { + serializedName: "nextLink", type: { - name: "Dictionary", - value: { - type: { name: "Composite", className: "ParameterValuesValue" }, + name: "String", + }, + }, + }, + }, +}; + +export const PolicySetDefinitionVersionListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PolicySetDefinitionVersionListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicySetDefinitionVersion", + }, }, }, }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const PolicySetDefinitionVersion: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PolicySetDefinitionVersion", + 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", + }, + }, + policyType: { + serializedName: "properties.policyType", + type: { + name: "String", + }, + }, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String", + }, + }, description: { serializedName: "properties.description", type: { @@ -969,51 +1317,41 @@ export const PolicyAssignment: coreClient.CompositeMapper = { name: "any", }, }, - enforcementMode: { - defaultValue: "Default", - serializedName: "properties.enforcementMode", - type: { - name: "String", - }, - }, - nonComplianceMessages: { - serializedName: "properties.nonComplianceMessages", + parameters: { + serializedName: "properties.parameters", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "NonComplianceMessage", - }, + name: "Dictionary", + value: { + type: { name: "Composite", className: "ParameterDefinitionsValue" }, }, }, }, - resourceSelectors: { - serializedName: "properties.resourceSelectors", + policyDefinitions: { + serializedName: "properties.policyDefinitions", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ResourceSelector", + className: "PolicyDefinitionReference", }, }, }, }, - overrides: { - serializedName: "properties.overrides", + policyDefinitionGroups: { + serializedName: "properties.policyDefinitionGroups", type: { name: "Sequence", element: { type: { name: "Composite", - className: "Override", + className: "PolicyDefinitionGroup", }, }, }, }, - assignmentType: { - serializedName: "properties.assignmentType", + version: { + serializedName: "properties.version", type: { name: "String", }, @@ -1022,20 +1360,20 @@ export const PolicyAssignment: coreClient.CompositeMapper = { }, }; -export const NonComplianceMessage: coreClient.CompositeMapper = { +export const PolicyTokenRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NonComplianceMessage", + className: "PolicyTokenRequest", modelProperties: { - message: { - serializedName: "message", - required: true, + operation: { + serializedName: "operation", type: { - name: "String", + name: "Composite", + className: "PolicyTokenOperation", }, }, - policyDefinitionReferenceId: { - serializedName: "policyDefinitionReferenceId", + changeReference: { + serializedName: "changeReference", type: { name: "String", }, @@ -1044,237 +1382,283 @@ export const NonComplianceMessage: coreClient.CompositeMapper = { }, }; -export const ResourceSelector: coreClient.CompositeMapper = { +export const PolicyTokenOperation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceSelector", + className: "PolicyTokenOperation", modelProperties: { - name: { - serializedName: "name", + uri: { + serializedName: "uri", type: { name: "String", }, }, - selectors: { - serializedName: "selectors", + httpMethod: { + serializedName: "httpMethod", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Selector", - }, - }, + name: "String", + }, + }, + content: { + serializedName: "content", + type: { + name: "any", }, }, }, }, }; -export const Selector: coreClient.CompositeMapper = { +export const PolicyTokenResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Selector", + className: "PolicyTokenResponse", modelProperties: { - kind: { - serializedName: "kind", + result: { + serializedName: "result", type: { name: "String", }, }, - in: { - serializedName: "in", + message: { + serializedName: "message", type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, + name: "String", }, }, - notIn: { - serializedName: "notIn", + retryAfter: { + serializedName: "retryAfter", + type: { + name: "DateTime", + }, + }, + results: { + serializedName: "results", type: { name: "Sequence", element: { type: { - name: "String", + name: "Composite", + className: "ExternalEvaluationEndpointInvocationResult", }, }, }, }, - }, - }, -}; - -export const Override: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Override", - modelProperties: { - kind: { - serializedName: "kind", + changeReference: { + serializedName: "changeReference", type: { name: "String", }, }, - value: { - serializedName: "value", + token: { + serializedName: "token", type: { name: "String", }, }, - selectors: { - serializedName: "selectors", + tokenId: { + serializedName: "tokenId", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Selector", - }, - }, + name: "String", + }, + }, + expiration: { + serializedName: "expiration", + type: { + name: "DateTime", }, }, }, }, }; -export const Identity: coreClient.CompositeMapper = { +export const ExternalEvaluationEndpointInvocationResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Identity", + className: "ExternalEvaluationEndpointInvocationResult", modelProperties: { - principalId: { - serializedName: "principalId", - readOnly: true, + policyInfo: { + serializedName: "policyInfo", + type: { + name: "Composite", + className: "PolicyLogInfo", + }, + }, + result: { + serializedName: "result", type: { name: "String", }, }, - tenantId: { - serializedName: "tenantId", - readOnly: true, + message: { + serializedName: "message", type: { name: "String", }, }, - type: { - serializedName: "type", + retryAfter: { + serializedName: "retryAfter", type: { - name: "Enum", - allowedValues: ["SystemAssigned", "UserAssigned", "None"], + name: "DateTime", }, }, - userAssignedIdentities: { - serializedName: "userAssignedIdentities", + claims: { + serializedName: "claims", type: { - name: "Dictionary", - value: { - type: { - name: "Composite", - className: "UserAssignedIdentitiesValue", - }, - }, + name: "any", + }, + }, + expiration: { + serializedName: "expiration", + type: { + name: "DateTime", }, }, }, }, }; -export const UserAssignedIdentitiesValue: coreClient.CompositeMapper = { +export const PolicyLogInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "UserAssignedIdentitiesValue", + className: "PolicyLogInfo", modelProperties: { - principalId: { - serializedName: "principalId", - readOnly: true, + policyDefinitionId: { + serializedName: "policyDefinitionId", type: { name: "String", }, }, - clientId: { - serializedName: "clientId", - readOnly: true, + policySetDefinitionId: { + serializedName: "policySetDefinitionId", type: { name: "String", }, }, - }, - }, -}; - -export const PolicyAssignmentUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PolicyAssignmentUpdate", - modelProperties: { - location: { - serializedName: "location", + policyDefinitionReferenceId: { + serializedName: "policyDefinitionReferenceId", type: { name: "String", }, }, - identity: { - serializedName: "identity", + policySetDefinitionName: { + serializedName: "policySetDefinitionName", type: { - name: "Composite", - className: "Identity", + name: "String", }, }, - resourceSelectors: { - serializedName: "properties.resourceSelectors", + policySetDefinitionDisplayName: { + serializedName: "policySetDefinitionDisplayName", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceSelector", - }, - }, + name: "String", }, }, - overrides: { - serializedName: "properties.overrides", + policySetDefinitionVersion: { + serializedName: "policySetDefinitionVersion", + type: { + name: "String", + }, + }, + policySetDefinitionCategory: { + serializedName: "policySetDefinitionCategory", + type: { + name: "String", + }, + }, + policyDefinitionName: { + serializedName: "policyDefinitionName", + type: { + name: "String", + }, + }, + policyDefinitionDisplayName: { + serializedName: "policyDefinitionDisplayName", + type: { + name: "String", + }, + }, + policyDefinitionVersion: { + serializedName: "policyDefinitionVersion", + type: { + name: "String", + }, + }, + policyDefinitionEffect: { + serializedName: "policyDefinitionEffect", + type: { + name: "String", + }, + }, + policyDefinitionGroupNames: { + serializedName: "policyDefinitionGroupNames", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "Override", + name: "String", }, }, }, }, - }, - }, -}; - -export const PolicyAssignmentListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PolicyAssignmentListResult", - modelProperties: { - value: { - serializedName: "value", + policyAssignmentId: { + serializedName: "policyAssignmentId", + type: { + name: "String", + }, + }, + policyAssignmentName: { + serializedName: "policyAssignmentName", + type: { + name: "String", + }, + }, + policyAssignmentDisplayName: { + serializedName: "policyAssignmentDisplayName", + type: { + name: "String", + }, + }, + policyAssignmentVersion: { + serializedName: "policyAssignmentVersion", + type: { + name: "String", + }, + }, + policyAssignmentScope: { + serializedName: "policyAssignmentScope", + type: { + name: "String", + }, + }, + resourceLocation: { + serializedName: "resourceLocation", + type: { + name: "String", + }, + }, + ancestors: { + serializedName: "ancestors", + type: { + name: "String", + }, + }, + complianceReasonCode: { + serializedName: "complianceReasonCode", + type: { + name: "String", + }, + }, + policyExemptionIds: { + serializedName: "policyExemptionIds", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "PolicyAssignment", + name: "String", }, }, }, }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, }, }, }; diff --git a/sdk/policy/arm-policy/src/models/parameters.ts b/sdk/policy/arm-policy/src/models/parameters.ts index b952660472ca..d9868f57a013 100644 --- a/sdk/policy/arm-policy/src/models/parameters.ts +++ b/sdk/policy/arm-policy/src/models/parameters.ts @@ -6,37 +6,21 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import type { +import { OperationParameter, OperationURLParameter, OperationQueryParameter, } from "@azure/core-client"; import { + PolicyAssignment as PolicyAssignmentMapper, + PolicyAssignmentUpdate as PolicyAssignmentUpdateMapper, PolicyDefinition as PolicyDefinitionMapper, PolicyDefinitionVersion as PolicyDefinitionVersionMapper, PolicySetDefinition as PolicySetDefinitionMapper, PolicySetDefinitionVersion as PolicySetDefinitionVersionMapper, - PolicyAssignment as PolicyAssignmentMapper, - PolicyAssignmentUpdate as PolicyAssignmentUpdateMapper, + PolicyTokenRequest as PolicyTokenRequestMapper, } from "../models/mappers.js"; -export const contentType: OperationParameter = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/json", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String", - }, - }, -}; - -export const parameters: OperationParameter = { - parameterPath: "parameters", - mapper: PolicyDefinitionMapper, -}; - export const accept: OperationParameter = { parameterPath: "accept", mapper: { @@ -61,24 +45,25 @@ export const $host: OperationURLParameter = { skipEncoding: true, }; -export const subscriptionId: OperationURLParameter = { - parameterPath: "subscriptionId", +export const scope: OperationURLParameter = { + parameterPath: "scope", mapper: { - serializedName: "subscriptionId", + serializedName: "scope", required: true, type: { - name: "Uuid", + name: "String", }, }, + skipEncoding: true, }; -export const policyDefinitionName: OperationURLParameter = { - parameterPath: "policyDefinitionName", +export const policyAssignmentName: OperationURLParameter = { + parameterPath: "policyAssignmentName", mapper: { constraints: { Pattern: new RegExp("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$"), }, - serializedName: "policyDefinitionName", + serializedName: "policyAssignmentName", required: true, type: { name: "String", @@ -89,7 +74,7 @@ export const policyDefinitionName: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2024-05-01", + defaultValue: "2025-03-01", isConstant: true, serializedName: "api-version", type: { @@ -98,10 +83,58 @@ export const apiVersion: OperationQueryParameter = { }, }; -export const managementGroupId: OperationURLParameter = { - parameterPath: "managementGroupId", +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], mapper: { - serializedName: "managementGroupId", + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String", + }, + }, +}; + +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: PolicyAssignmentMapper, +}; + +export const expand: OperationQueryParameter = { + parameterPath: ["options", "expand"], + mapper: { + serializedName: "$expand", + type: { + name: "String", + }, + }, +}; + +export const parameters1: OperationParameter = { + parameterPath: "parameters", + mapper: PolicyAssignmentUpdateMapper, +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + serializedName: "subscriptionId", + required: true, + type: { + name: "Uuid", + }, + }, +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + constraints: { + Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), + MaxLength: 90, + MinLength: 1, + }, + serializedName: "resourceGroupName", required: true, type: { name: "String", @@ -134,64 +167,48 @@ export const top: OperationQueryParameter = { }, }; -export const nextLink: OperationURLParameter = { - parameterPath: "nextLink", +export const resourceProviderNamespace: OperationURLParameter = { + parameterPath: "resourceProviderNamespace", mapper: { - serializedName: "nextLink", + serializedName: "resourceProviderNamespace", required: true, type: { name: "String", }, }, - skipEncoding: true, }; -export const managementGroupName: OperationURLParameter = { - parameterPath: "managementGroupName", +export const parentResourcePath: OperationURLParameter = { + parameterPath: "parentResourcePath", mapper: { - constraints: { - MaxLength: 90, - MinLength: 1, - }, - serializedName: "managementGroupName", + serializedName: "parentResourcePath", required: true, type: { name: "String", }, }, + skipEncoding: true, }; -export const parameters1: OperationParameter = { - parameterPath: "parameters", - mapper: PolicyDefinitionVersionMapper, -}; - -export const policyDefinitionVersion: OperationURLParameter = { - parameterPath: "policyDefinitionVersion", +export const resourceType: OperationURLParameter = { + parameterPath: "resourceType", mapper: { - constraints: { - Pattern: new RegExp("^\\d+\\.\\d+\\.\\d+$"), - }, - serializedName: "policyDefinitionVersion", + serializedName: "resourceType", required: true, type: { name: "String", }, }, + skipEncoding: true, }; -export const parameters2: OperationParameter = { - parameterPath: "parameters", - mapper: PolicySetDefinitionMapper, -}; - -export const policySetDefinitionName: OperationURLParameter = { - parameterPath: "policySetDefinitionName", +export const resourceName: OperationURLParameter = { + parameterPath: "resourceName", mapper: { constraints: { - Pattern: new RegExp("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$"), + Pattern: new RegExp("^.+$"), }, - serializedName: "policySetDefinitionName", + serializedName: "resourceName", required: true, type: { name: "String", @@ -199,25 +216,21 @@ export const policySetDefinitionName: OperationURLParameter = { }, }; -export const expand: OperationQueryParameter = { - parameterPath: ["options", "expand"], +export const managementGroupId: OperationURLParameter = { + parameterPath: "managementGroupId", mapper: { - serializedName: "$expand", + serializedName: "managementGroupId", + required: true, type: { name: "String", }, }, }; -export const parameters3: OperationParameter = { - parameterPath: "parameters", - mapper: PolicySetDefinitionVersionMapper, -}; - -export const scope: OperationURLParameter = { - parameterPath: "scope", +export const policyAssignmentId: OperationURLParameter = { + parameterPath: "policyAssignmentId", mapper: { - serializedName: "scope", + serializedName: "policyAssignmentId", required: true, type: { name: "String", @@ -226,39 +239,30 @@ export const scope: OperationURLParameter = { skipEncoding: true, }; -export const policyAssignmentName: OperationURLParameter = { - parameterPath: "policyAssignmentName", +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", mapper: { - constraints: { - Pattern: new RegExp("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$"), - }, - serializedName: "policyAssignmentName", + serializedName: "nextLink", required: true, type: { name: "String", }, }, + skipEncoding: true, }; -export const parameters4: OperationParameter = { - parameterPath: "parameters", - mapper: PolicyAssignmentMapper, -}; - -export const parameters5: OperationParameter = { +export const parameters2: OperationParameter = { parameterPath: "parameters", - mapper: PolicyAssignmentUpdateMapper, + mapper: PolicyDefinitionMapper, }; -export const resourceGroupName: OperationURLParameter = { - parameterPath: "resourceGroupName", +export const policyDefinitionName: OperationURLParameter = { + parameterPath: "policyDefinitionName", mapper: { constraints: { - Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), - MaxLength: 90, - MinLength: 1, + Pattern: new RegExp("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$"), }, - serializedName: "resourceGroupName", + serializedName: "policyDefinitionName", required: true, type: { name: "String", @@ -266,10 +270,14 @@ export const resourceGroupName: OperationURLParameter = { }, }; -export const resourceProviderNamespace: OperationURLParameter = { - parameterPath: "resourceProviderNamespace", +export const managementGroupName: OperationURLParameter = { + parameterPath: "managementGroupName", mapper: { - serializedName: "resourceProviderNamespace", + constraints: { + MaxLength: 90, + MinLength: 1, + }, + serializedName: "managementGroupName", required: true, type: { name: "String", @@ -277,37 +285,37 @@ export const resourceProviderNamespace: OperationURLParameter = { }, }; -export const parentResourcePath: OperationURLParameter = { - parameterPath: "parentResourcePath", - mapper: { - serializedName: "parentResourcePath", - required: true, - type: { - name: "String", - }, - }, - skipEncoding: true, +export const parameters3: OperationParameter = { + parameterPath: "parameters", + mapper: PolicyDefinitionVersionMapper, }; -export const resourceType: OperationURLParameter = { - parameterPath: "resourceType", +export const policyDefinitionVersion: OperationURLParameter = { + parameterPath: "policyDefinitionVersion", mapper: { - serializedName: "resourceType", + constraints: { + Pattern: new RegExp("^\\d+\\.\\d+\\.\\d+$"), + }, + serializedName: "policyDefinitionVersion", required: true, type: { name: "String", }, }, - skipEncoding: true, }; -export const resourceName: OperationURLParameter = { - parameterPath: "resourceName", +export const parameters4: OperationParameter = { + parameterPath: "parameters", + mapper: PolicySetDefinitionMapper, +}; + +export const policySetDefinitionName: OperationURLParameter = { + parameterPath: "policySetDefinitionName", mapper: { constraints: { - Pattern: new RegExp("^.+$"), + Pattern: new RegExp("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$"), }, - serializedName: "resourceName", + serializedName: "policySetDefinitionName", required: true, type: { name: "String", @@ -315,14 +323,12 @@ export const resourceName: OperationURLParameter = { }, }; -export const policyAssignmentId: OperationURLParameter = { - parameterPath: "policyAssignmentId", - mapper: { - serializedName: "policyAssignmentId", - required: true, - type: { - name: "String", - }, - }, - skipEncoding: true, +export const parameters5: OperationParameter = { + parameterPath: "parameters", + mapper: PolicySetDefinitionVersionMapper, +}; + +export const parameters6: OperationParameter = { + parameterPath: "parameters", + mapper: PolicyTokenRequestMapper, }; diff --git a/sdk/policy/arm-policy/src/operations/index.ts b/sdk/policy/arm-policy/src/operations/index.ts index c79764594dfa..0d30550a3a6f 100644 --- a/sdk/policy/arm-policy/src/operations/index.ts +++ b/sdk/policy/arm-policy/src/operations/index.ts @@ -6,8 +6,9 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +export * from "./policyAssignments.js"; export * from "./policyDefinitions.js"; export * from "./policyDefinitionVersions.js"; export * from "./policySetDefinitions.js"; export * from "./policySetDefinitionVersions.js"; -export * from "./policyAssignments.js"; +export * from "./policyTokens.js"; diff --git a/sdk/policy/arm-policy/src/operations/policyAssignments.ts b/sdk/policy/arm-policy/src/operations/policyAssignments.ts index ed4ffda3a577..d8068ab8bfae 100644 --- a/sdk/policy/arm-policy/src/operations/policyAssignments.ts +++ b/sdk/policy/arm-policy/src/operations/policyAssignments.ts @@ -6,14 +6,14 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { setContinuationToken } from "../pagingHelper.js"; -import type { PolicyAssignments } from "../operationsInterfaces/index.js"; +import { PolicyAssignments } 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 type { PolicyClient } from "../policyClient.js"; -import type { +import { PolicyClient } from "../policyClient.js"; +import { PolicyAssignment, PolicyAssignmentsListForResourceGroupNextOptionalParams, PolicyAssignmentsListForResourceGroupOptionalParams, @@ -798,7 +798,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { }, 204: {}, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -814,13 +814,13 @@ const createOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyAssignment, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, - requestBody: Parameters.parameters4, + requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.scope, Parameters.policyAssignmentName], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer, }; @@ -832,7 +832,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyAssignment, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion, Parameters.expand], @@ -848,13 +848,13 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyAssignment, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, - requestBody: Parameters.parameters5, + requestBody: Parameters.parameters1, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.scope, Parameters.policyAssignmentName], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer, }; @@ -866,10 +866,10 @@ const listForResourceGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyAssignmentListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, - queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top, Parameters.expand], + queryParameters: [Parameters.apiVersion, Parameters.expand, Parameters.filter, Parameters.top], urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName], headerParameters: [Parameters.accept], serializer, @@ -882,10 +882,10 @@ const listForResourceOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyAssignmentListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, - queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top, Parameters.expand], + queryParameters: [Parameters.apiVersion, Parameters.expand, Parameters.filter, Parameters.top], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -906,10 +906,10 @@ const listForManagementGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyAssignmentListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, - queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top, Parameters.expand], + queryParameters: [Parameters.apiVersion, Parameters.expand, Parameters.filter, Parameters.top], urlParameters: [Parameters.$host, Parameters.managementGroupId], headerParameters: [Parameters.accept], serializer, @@ -922,10 +922,10 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyAssignmentListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, - queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top, Parameters.expand], + queryParameters: [Parameters.apiVersion, Parameters.expand, Parameters.filter, Parameters.top], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer, @@ -939,7 +939,7 @@ const deleteByIdOperationSpec: coreClient.OperationSpec = { }, 204: {}, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -955,13 +955,13 @@ const createByIdOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyAssignment, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, - requestBody: Parameters.parameters4, + requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.policyAssignmentId], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer, }; @@ -973,10 +973,10 @@ const getByIdOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyAssignment, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, - queryParameters: [Parameters.apiVersion, Parameters.expand], + queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.policyAssignmentId], headerParameters: [Parameters.accept], serializer, @@ -989,13 +989,13 @@ const updateByIdOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyAssignment, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, - requestBody: Parameters.parameters5, + requestBody: Parameters.parameters1, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.policyAssignmentId], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer, }; @@ -1007,14 +1007,14 @@ const listForResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyAssignmentListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.nextLink, Parameters.resourceGroupName, + Parameters.nextLink, ], headerParameters: [Parameters.accept], serializer, @@ -1027,18 +1027,18 @@ const listForResourceNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyAssignmentListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.nextLink, Parameters.resourceGroupName, Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, Parameters.resourceName, + Parameters.nextLink, ], headerParameters: [Parameters.accept], serializer, @@ -1051,7 +1051,7 @@ const listForManagementGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyAssignmentListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, urlParameters: [Parameters.$host, Parameters.managementGroupId, Parameters.nextLink], @@ -1066,7 +1066,7 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyAssignmentListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.nextLink], diff --git a/sdk/policy/arm-policy/src/operations/policyDefinitionVersions.ts b/sdk/policy/arm-policy/src/operations/policyDefinitionVersions.ts index 10a05fa65a79..96f1eca6b5ba 100644 --- a/sdk/policy/arm-policy/src/operations/policyDefinitionVersions.ts +++ b/sdk/policy/arm-policy/src/operations/policyDefinitionVersions.ts @@ -6,14 +6,14 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { setContinuationToken } from "../pagingHelper.js"; -import type { PolicyDefinitionVersions } from "../operationsInterfaces/index.js"; +import { PolicyDefinitionVersions } 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 type { PolicyClient } from "../policyClient.js"; -import type { +import { PolicyClient } from "../policyClient.js"; +import { PolicyDefinitionVersion, PolicyDefinitionVersionsListNextOptionalParams, PolicyDefinitionVersionsListOptionalParams, @@ -567,7 +567,7 @@ const listAllBuiltinsOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyDefinitionVersionListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -583,7 +583,7 @@ const listAllAtManagementGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyDefinitionVersionListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -599,7 +599,7 @@ const listAllOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyDefinitionVersionListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -618,10 +618,10 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyDefinitionVersion, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, - requestBody: Parameters.parameters1, + requestBody: Parameters.parameters3, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -629,7 +629,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { Parameters.policyDefinitionName, Parameters.policyDefinitionVersion, ], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer, }; @@ -640,7 +640,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { 200: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -661,7 +661,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyDefinitionVersion, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -682,7 +682,7 @@ const getBuiltInOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyDefinitionVersion, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -705,10 +705,10 @@ const createOrUpdateAtManagementGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyDefinitionVersion, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, - requestBody: Parameters.parameters1, + requestBody: Parameters.parameters3, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -716,7 +716,7 @@ const createOrUpdateAtManagementGroupOperationSpec: coreClient.OperationSpec = { Parameters.managementGroupName, Parameters.policyDefinitionVersion, ], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer, }; @@ -727,7 +727,7 @@ const deleteAtManagementGroupOperationSpec: coreClient.OperationSpec = { 200: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -748,7 +748,7 @@ const getAtManagementGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyDefinitionVersion, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -769,7 +769,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyDefinitionVersionListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion, Parameters.top], @@ -785,7 +785,7 @@ const listBuiltInOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyDefinitionVersionListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion, Parameters.top], @@ -801,7 +801,7 @@ const listByManagementGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyDefinitionVersionListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion, Parameters.top], @@ -821,14 +821,14 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyDefinitionVersionListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.policyDefinitionName, Parameters.nextLink, + Parameters.policyDefinitionName, ], headerParameters: [Parameters.accept], serializer, @@ -841,10 +841,10 @@ const listBuiltInNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyDefinitionVersionListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, - urlParameters: [Parameters.$host, Parameters.policyDefinitionName, Parameters.nextLink], + urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.policyDefinitionName], headerParameters: [Parameters.accept], serializer, }; @@ -856,13 +856,13 @@ const listByManagementGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyDefinitionVersionListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, urlParameters: [ Parameters.$host, - Parameters.policyDefinitionName, Parameters.nextLink, + Parameters.policyDefinitionName, Parameters.managementGroupName, ], headerParameters: [Parameters.accept], diff --git a/sdk/policy/arm-policy/src/operations/policyDefinitions.ts b/sdk/policy/arm-policy/src/operations/policyDefinitions.ts index 9403dc058982..51b9382b411b 100644 --- a/sdk/policy/arm-policy/src/operations/policyDefinitions.ts +++ b/sdk/policy/arm-policy/src/operations/policyDefinitions.ts @@ -6,14 +6,14 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { setContinuationToken } from "../pagingHelper.js"; -import type { PolicyDefinitions } from "../operationsInterfaces/index.js"; +import { PolicyDefinitions } 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 type { PolicyClient } from "../policyClient.js"; -import type { +import { PolicyClient } from "../policyClient.js"; +import { PolicyDefinition, PolicyDefinitionsListNextOptionalParams, PolicyDefinitionsListOptionalParams, @@ -461,13 +461,13 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyDefinition, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, - requestBody: Parameters.parameters, + requestBody: Parameters.parameters2, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.policyDefinitionName], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer, }; @@ -478,7 +478,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { 200: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -494,7 +494,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyDefinition, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -510,7 +510,7 @@ const getBuiltInOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyDefinition, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -526,13 +526,13 @@ const createOrUpdateAtManagementGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyDefinition, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, - requestBody: Parameters.parameters, + requestBody: Parameters.parameters2, queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.policyDefinitionName, Parameters.managementGroupId], - headerParameters: [Parameters.contentType, Parameters.accept], + urlParameters: [Parameters.$host, Parameters.managementGroupId, Parameters.policyDefinitionName], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer, }; @@ -543,11 +543,11 @@ const deleteAtManagementGroupOperationSpec: coreClient.OperationSpec = { 200: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.policyDefinitionName, Parameters.managementGroupId], + urlParameters: [Parameters.$host, Parameters.managementGroupId, Parameters.policyDefinitionName], headerParameters: [Parameters.accept], serializer, }; @@ -559,11 +559,11 @@ const getAtManagementGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyDefinition, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.policyDefinitionName, Parameters.managementGroupId], + urlParameters: [Parameters.$host, Parameters.managementGroupId, Parameters.policyDefinitionName], headerParameters: [Parameters.accept], serializer, }; @@ -575,7 +575,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], @@ -591,7 +591,7 @@ const listBuiltInOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], @@ -607,7 +607,7 @@ const listByManagementGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], @@ -623,7 +623,7 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.nextLink], @@ -638,7 +638,7 @@ const listBuiltInNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, urlParameters: [Parameters.$host, Parameters.nextLink], @@ -653,7 +653,7 @@ const listByManagementGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, urlParameters: [Parameters.$host, Parameters.managementGroupId, Parameters.nextLink], diff --git a/sdk/policy/arm-policy/src/operations/policySetDefinitionVersions.ts b/sdk/policy/arm-policy/src/operations/policySetDefinitionVersions.ts index 4367dd3ff95b..138bff082a4f 100644 --- a/sdk/policy/arm-policy/src/operations/policySetDefinitionVersions.ts +++ b/sdk/policy/arm-policy/src/operations/policySetDefinitionVersions.ts @@ -6,14 +6,14 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { setContinuationToken } from "../pagingHelper.js"; -import type { PolicySetDefinitionVersions } from "../operationsInterfaces/index.js"; +import { PolicySetDefinitionVersions } 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 type { PolicyClient } from "../policyClient.js"; -import type { +import { PolicyClient } from "../policyClient.js"; +import { PolicySetDefinitionVersion, PolicySetDefinitionVersionsListNextOptionalParams, PolicySetDefinitionVersionsListOptionalParams, @@ -573,7 +573,7 @@ const listAllBuiltinsOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicySetDefinitionVersionListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -589,7 +589,7 @@ const listAllAtManagementGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicySetDefinitionVersionListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -605,7 +605,7 @@ const listAllOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicySetDefinitionVersionListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -624,10 +624,10 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicySetDefinitionVersion, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, - requestBody: Parameters.parameters3, + requestBody: Parameters.parameters5, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -635,7 +635,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { Parameters.policyDefinitionVersion, Parameters.policySetDefinitionName, ], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer, }; @@ -646,7 +646,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { 200: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -667,7 +667,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicySetDefinitionVersion, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion, Parameters.expand], @@ -688,7 +688,7 @@ const getBuiltInOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicySetDefinitionVersion, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion, Parameters.expand], @@ -708,10 +708,10 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicySetDefinitionVersionListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, - queryParameters: [Parameters.apiVersion, Parameters.top, Parameters.expand], + queryParameters: [Parameters.apiVersion, Parameters.expand, Parameters.top], urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.policySetDefinitionName], headerParameters: [Parameters.accept], serializer, @@ -724,10 +724,10 @@ const listBuiltInOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicySetDefinitionVersionListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, - queryParameters: [Parameters.apiVersion, Parameters.top, Parameters.expand], + queryParameters: [Parameters.apiVersion, Parameters.expand, Parameters.top], urlParameters: [Parameters.$host, Parameters.policySetDefinitionName], headerParameters: [Parameters.accept], serializer, @@ -743,10 +743,10 @@ const createOrUpdateAtManagementGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicySetDefinitionVersion, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, - requestBody: Parameters.parameters3, + requestBody: Parameters.parameters5, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -754,7 +754,7 @@ const createOrUpdateAtManagementGroupOperationSpec: coreClient.OperationSpec = { Parameters.policyDefinitionVersion, Parameters.policySetDefinitionName, ], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer, }; @@ -765,7 +765,7 @@ const deleteAtManagementGroupOperationSpec: coreClient.OperationSpec = { 200: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -786,7 +786,7 @@ const getAtManagementGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicySetDefinitionVersion, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion, Parameters.expand], @@ -807,10 +807,10 @@ const listByManagementGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicySetDefinitionVersionListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, - queryParameters: [Parameters.apiVersion, Parameters.top, Parameters.expand], + queryParameters: [Parameters.apiVersion, Parameters.expand, Parameters.top], urlParameters: [ Parameters.$host, Parameters.managementGroupName, @@ -827,7 +827,7 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicySetDefinitionVersionListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, urlParameters: [ @@ -847,7 +847,7 @@ const listBuiltInNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicySetDefinitionVersionListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.policySetDefinitionName], @@ -862,7 +862,7 @@ const listByManagementGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicySetDefinitionVersionListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, urlParameters: [ diff --git a/sdk/policy/arm-policy/src/operations/policySetDefinitions.ts b/sdk/policy/arm-policy/src/operations/policySetDefinitions.ts index 8fcc4484c0b7..8178197a6cd4 100644 --- a/sdk/policy/arm-policy/src/operations/policySetDefinitions.ts +++ b/sdk/policy/arm-policy/src/operations/policySetDefinitions.ts @@ -6,14 +6,14 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { setContinuationToken } from "../pagingHelper.js"; -import type { PolicySetDefinitions } from "../operationsInterfaces/index.js"; +import { PolicySetDefinitions } 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 type { PolicyClient } from "../policyClient.js"; -import type { +import { PolicyClient } from "../policyClient.js"; +import { PolicySetDefinition, PolicySetDefinitionsListNextOptionalParams, PolicySetDefinitionsListOptionalParams, @@ -465,13 +465,13 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicySetDefinition, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, - requestBody: Parameters.parameters2, + requestBody: Parameters.parameters4, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.policySetDefinitionName], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer, }; @@ -482,7 +482,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { 200: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -498,7 +498,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicySetDefinition, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion, Parameters.expand], @@ -514,7 +514,7 @@ const getBuiltInOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicySetDefinition, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion, Parameters.expand], @@ -530,10 +530,10 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicySetDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, - queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top, Parameters.expand], + queryParameters: [Parameters.apiVersion, Parameters.expand, Parameters.filter, Parameters.top], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer, @@ -546,10 +546,10 @@ const listBuiltInOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicySetDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, - queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top, Parameters.expand], + queryParameters: [Parameters.apiVersion, Parameters.expand, Parameters.filter, Parameters.top], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], serializer, @@ -565,17 +565,17 @@ const createOrUpdateAtManagementGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicySetDefinition, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, - requestBody: Parameters.parameters2, + requestBody: Parameters.parameters4, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.managementGroupId, Parameters.policySetDefinitionName, ], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer, }; @@ -586,7 +586,7 @@ const deleteAtManagementGroupOperationSpec: coreClient.OperationSpec = { 200: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -606,7 +606,7 @@ const getAtManagementGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicySetDefinition, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion, Parameters.expand], @@ -626,10 +626,10 @@ const listByManagementGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicySetDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, - queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top, Parameters.expand], + queryParameters: [Parameters.apiVersion, Parameters.expand, Parameters.filter, Parameters.top], urlParameters: [Parameters.$host, Parameters.managementGroupId], headerParameters: [Parameters.accept], serializer, @@ -642,7 +642,7 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicySetDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.nextLink], @@ -657,7 +657,7 @@ const listBuiltInNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicySetDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, urlParameters: [Parameters.$host, Parameters.nextLink], @@ -672,7 +672,7 @@ const listByManagementGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicySetDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorResponse, }, }, urlParameters: [Parameters.$host, Parameters.managementGroupId, Parameters.nextLink], diff --git a/sdk/policy/arm-policy/src/operations/policyTokens.ts b/sdk/policy/arm-policy/src/operations/policyTokens.ts new file mode 100644 index 000000000000..90696ce2dde7 --- /dev/null +++ b/sdk/policy/arm-policy/src/operations/policyTokens.ts @@ -0,0 +1,141 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PolicyTokens } 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 { PolicyClient } from "../policyClient.js"; +import { SimplePollerLike, OperationState, createHttpPoller } from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl.js"; +import { + PolicyTokenRequest, + PolicyTokensAcquireOptionalParams, + PolicyTokensAcquireResponse, +} from "../models/index.js"; + +/** Class containing PolicyTokens operations. */ +export class PolicyTokensImpl implements PolicyTokens { + private readonly client: PolicyClient; + + /** + * Initialize a new instance of the class PolicyTokens class. + * @param client Reference to the service client + */ + constructor(client: PolicyClient) { + this.client = client; + } + + /** + * This operation acquires a policy token in the given subscription for the given request body. + * @param parameters The policy token properties. + * @param options The options parameters. + */ + async beginAcquire( + parameters: PolicyTokenRequest, + options?: PolicyTokensAcquireOptionalParams, + ): Promise< + SimplePollerLike, PolicyTokensAcquireResponse> + > { + 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: { parameters, options }, + spec: acquireOperationSpec, + }); + const poller = await createHttpPoller< + PolicyTokensAcquireResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", + }); + await poller.poll(); + return poller; + } + + /** + * This operation acquires a policy token in the given subscription for the given request body. + * @param parameters The policy token properties. + * @param options The options parameters. + */ + async beginAcquireAndWait( + parameters: PolicyTokenRequest, + options?: PolicyTokensAcquireOptionalParams, + ): Promise { + const poller = await this.beginAcquire(parameters, options); + return poller.pollUntilDone(); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const acquireOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/acquirePolicyToken", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PolicyTokenResponse, + }, + 201: { + bodyMapper: Mappers.PolicyTokenResponse, + }, + 202: { + bodyMapper: Mappers.PolicyTokenResponse, + }, + 204: { + bodyMapper: Mappers.PolicyTokenResponse, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters6, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; diff --git a/sdk/policy/arm-policy/src/operationsInterfaces/index.ts b/sdk/policy/arm-policy/src/operationsInterfaces/index.ts index c79764594dfa..0d30550a3a6f 100644 --- a/sdk/policy/arm-policy/src/operationsInterfaces/index.ts +++ b/sdk/policy/arm-policy/src/operationsInterfaces/index.ts @@ -6,8 +6,9 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +export * from "./policyAssignments.js"; export * from "./policyDefinitions.js"; export * from "./policyDefinitionVersions.js"; export * from "./policySetDefinitions.js"; export * from "./policySetDefinitionVersions.js"; -export * from "./policyAssignments.js"; +export * from "./policyTokens.js"; diff --git a/sdk/policy/arm-policy/src/operationsInterfaces/policyAssignments.ts b/sdk/policy/arm-policy/src/operationsInterfaces/policyAssignments.ts index ffd0633fdcc0..5b823db72eda 100644 --- a/sdk/policy/arm-policy/src/operationsInterfaces/policyAssignments.ts +++ b/sdk/policy/arm-policy/src/operationsInterfaces/policyAssignments.ts @@ -6,8 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PolicyAssignment, PolicyAssignmentsListForResourceGroupOptionalParams, PolicyAssignmentsListForResourceOptionalParams, diff --git a/sdk/policy/arm-policy/src/operationsInterfaces/policyDefinitionVersions.ts b/sdk/policy/arm-policy/src/operationsInterfaces/policyDefinitionVersions.ts index 6770b03ecca2..3ae3c95736e7 100644 --- a/sdk/policy/arm-policy/src/operationsInterfaces/policyDefinitionVersions.ts +++ b/sdk/policy/arm-policy/src/operationsInterfaces/policyDefinitionVersions.ts @@ -6,8 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PolicyDefinitionVersion, PolicyDefinitionVersionsListOptionalParams, PolicyDefinitionVersionsListBuiltInOptionalParams, diff --git a/sdk/policy/arm-policy/src/operationsInterfaces/policyDefinitions.ts b/sdk/policy/arm-policy/src/operationsInterfaces/policyDefinitions.ts index 10ff89f75714..2defca7d9951 100644 --- a/sdk/policy/arm-policy/src/operationsInterfaces/policyDefinitions.ts +++ b/sdk/policy/arm-policy/src/operationsInterfaces/policyDefinitions.ts @@ -6,8 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PolicyDefinition, PolicyDefinitionsListOptionalParams, PolicyDefinitionsListBuiltInOptionalParams, diff --git a/sdk/policy/arm-policy/src/operationsInterfaces/policySetDefinitionVersions.ts b/sdk/policy/arm-policy/src/operationsInterfaces/policySetDefinitionVersions.ts index 2edd06e19857..d5af57990542 100644 --- a/sdk/policy/arm-policy/src/operationsInterfaces/policySetDefinitionVersions.ts +++ b/sdk/policy/arm-policy/src/operationsInterfaces/policySetDefinitionVersions.ts @@ -6,8 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PolicySetDefinitionVersion, PolicySetDefinitionVersionsListOptionalParams, PolicySetDefinitionVersionsListBuiltInOptionalParams, diff --git a/sdk/policy/arm-policy/src/operationsInterfaces/policySetDefinitions.ts b/sdk/policy/arm-policy/src/operationsInterfaces/policySetDefinitions.ts index 81b4e5b76240..cca4213109a4 100644 --- a/sdk/policy/arm-policy/src/operationsInterfaces/policySetDefinitions.ts +++ b/sdk/policy/arm-policy/src/operationsInterfaces/policySetDefinitions.ts @@ -6,8 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PolicySetDefinition, PolicySetDefinitionsListOptionalParams, PolicySetDefinitionsListBuiltInOptionalParams, diff --git a/sdk/policy/arm-policy/src/operationsInterfaces/policyTokens.ts b/sdk/policy/arm-policy/src/operationsInterfaces/policyTokens.ts new file mode 100644 index 000000000000..53c36ae7c241 --- /dev/null +++ b/sdk/policy/arm-policy/src/operationsInterfaces/policyTokens.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + PolicyTokenRequest, + PolicyTokensAcquireOptionalParams, + PolicyTokensAcquireResponse, +} from "../models/index.js"; + +/** Interface representing a PolicyTokens. */ +export interface PolicyTokens { + /** + * This operation acquires a policy token in the given subscription for the given request body. + * @param parameters The policy token properties. + * @param options The options parameters. + */ + beginAcquire( + parameters: PolicyTokenRequest, + options?: PolicyTokensAcquireOptionalParams, + ): Promise< + SimplePollerLike, PolicyTokensAcquireResponse> + >; + /** + * This operation acquires a policy token in the given subscription for the given request body. + * @param parameters The policy token properties. + * @param options The options parameters. + */ + beginAcquireAndWait( + parameters: PolicyTokenRequest, + options?: PolicyTokensAcquireOptionalParams, + ): Promise; +} diff --git a/sdk/policy/arm-policy/src/policyClient.ts b/sdk/policy/arm-policy/src/policyClient.ts index 7d8f3438a8fe..f53fedf92d2a 100644 --- a/sdk/policy/arm-policy/src/policyClient.ts +++ b/sdk/policy/arm-policy/src/policyClient.ts @@ -8,28 +8,30 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; -import type { PipelineRequest, PipelineResponse, SendRequest } from "@azure/core-rest-pipeline"; -import type * as coreAuth from "@azure/core-auth"; +import { PipelineRequest, PipelineResponse, SendRequest } from "@azure/core-rest-pipeline"; +import * as coreAuth from "@azure/core-auth"; import { + PolicyAssignmentsImpl, PolicyDefinitionsImpl, PolicyDefinitionVersionsImpl, PolicySetDefinitionsImpl, PolicySetDefinitionVersionsImpl, - PolicyAssignmentsImpl, + PolicyTokensImpl, } from "./operations/index.js"; -import type { +import { + PolicyAssignments, PolicyDefinitions, PolicyDefinitionVersions, PolicySetDefinitions, PolicySetDefinitionVersions, - PolicyAssignments, + PolicyTokens, } from "./operationsInterfaces/index.js"; -import type { PolicyClientOptionalParams } from "./models/index.js"; +import { PolicyClientOptionalParams } from "./models/index.js"; export class PolicyClient extends coreClient.ServiceClient { $host: string; - subscriptionId?: string; apiVersion: string; + subscriptionId?: string; /** * Initializes a new instance of the PolicyClient class. @@ -69,7 +71,7 @@ export class PolicyClient extends coreClient.ServiceClient { credential: credentials, }; - const packageDetails = `azsdk-js-arm-policy/6.0.0`; + const packageDetails = `azsdk-js-arm-policy/7.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -119,12 +121,13 @@ export class PolicyClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2024-05-01"; + this.apiVersion = options.apiVersion || "2025-03-01"; + this.policyAssignments = new PolicyAssignmentsImpl(this); this.policyDefinitions = new PolicyDefinitionsImpl(this); this.policyDefinitionVersions = new PolicyDefinitionVersionsImpl(this); this.policySetDefinitions = new PolicySetDefinitionsImpl(this); this.policySetDefinitionVersions = new PolicySetDefinitionVersionsImpl(this); - this.policyAssignments = new PolicyAssignmentsImpl(this); + this.policyTokens = new PolicyTokensImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -153,9 +156,10 @@ export class PolicyClient extends coreClient.ServiceClient { this.pipeline.addPolicy(apiVersionPolicy); } + policyAssignments: PolicyAssignments; policyDefinitions: PolicyDefinitions; policyDefinitionVersions: PolicyDefinitionVersions; policySetDefinitions: PolicySetDefinitions; policySetDefinitionVersions: PolicySetDefinitionVersions; - policyAssignments: PolicyAssignments; + policyTokens: PolicyTokens; } diff --git a/sdk/policy/arm-policy/test/sampleTest.spec.ts b/sdk/policy/arm-policy/test/sampleTest.spec.ts new file mode 100644 index 000000000000..90b3c8a868b4 --- /dev/null +++ b/sdk/policy/arm-policy/test/sampleTest.spec.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { Recorder, RecorderStartOptions } from "@azure-tools/test-recorder"; +import { afterEach, beforeEach, describe, it, assert } from "vitest"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async () => { + recorder = new Recorder(); + await recorder.start(recorderOptions); + }); + + afterEach(async () => { + await recorder.stop(); + }); + + it("sample test", async () => { + assert(true); + }); +}); diff --git a/sdk/policy/arm-policy/tsconfig.browser.config.json b/sdk/policy/arm-policy/tsconfig.browser.config.json index ab11136ce1d5..75871518e3a0 100644 --- a/sdk/policy/arm-policy/tsconfig.browser.config.json +++ b/sdk/policy/arm-policy/tsconfig.browser.config.json @@ -1 +1,3 @@ -{ "extends": ["./tsconfig.test.json", "../../../tsconfig.browser.base.json"] } +{ + "extends": ["./tsconfig.test.json", "../../../tsconfig.browser.base.json"] +} diff --git a/sdk/policy/arm-policy/tsconfig.json b/sdk/policy/arm-policy/tsconfig.json index 19ceb382b521..610a0d62d45d 100644 --- a/sdk/policy/arm-policy/tsconfig.json +++ b/sdk/policy/arm-policy/tsconfig.json @@ -4,10 +4,16 @@ "path": "./tsconfig.src.json" }, { - "path": "./tsconfig.samples.json" + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.test.json" }, { "path": "./tsconfig.test.json" } ] -} +} \ No newline at end of file diff --git a/sdk/policy/arm-policy/vitest.browser.config.ts b/sdk/policy/arm-policy/vitest.browser.config.ts index d4cf432eb610..182729ab5ce9 100644 --- a/sdk/policy/arm-policy/vitest.browser.config.ts +++ b/sdk/policy/arm-policy/vitest.browser.config.ts @@ -1,10 +1,6 @@ -/* - * 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 { defineConfig, mergeConfig } from "vitest/config"; import viteConfig from "../../../vitest.browser.shared.config.ts"; @@ -13,7 +9,7 @@ export default mergeConfig( viteConfig, defineConfig({ test: { - include: ["dist-test/browser/test/**/*.spec.js"], + include: ["dist-test/browser/test/**/*.spec.js",], testTimeout: 1200000, hookTimeout: 1200000, }, diff --git a/sdk/policy/arm-policy/vitest.config.ts b/sdk/policy/arm-policy/vitest.config.ts index 42f4f102130b..40e031385dd8 100644 --- a/sdk/policy/arm-policy/vitest.config.ts +++ b/sdk/policy/arm-policy/vitest.config.ts @@ -1,10 +1,6 @@ -/* - * 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 { defineConfig, mergeConfig } from "vitest/config"; import viteConfig from "../../../vitest.shared.config.ts"; diff --git a/sdk/policy/arm-policy/vitest.esm.config.ts b/sdk/policy/arm-policy/vitest.esm.config.ts index b630f7e53183..a70127279fc9 100644 --- a/sdk/policy/arm-policy/vitest.esm.config.ts +++ b/sdk/policy/arm-policy/vitest.esm.config.ts @@ -1,13 +1,12 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ + +// 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); +export default mergeConfig( + vitestConfig, + vitestEsmConfig +); diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/LICENSE b/sdk/resources-subscriptions/arm-resources-subscriptions/LICENSE index b2f52a2bad4e..63447fd8bbbf 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/LICENSE +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/LICENSE @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/README.md b/sdk/resources-subscriptions/arm-resources-subscriptions/README.md index 8d5c089d6a76..b9e1d13874f3 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/README.md +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/README.md @@ -6,7 +6,7 @@ All resource groups and resources exist within subscriptions. These operation en [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources-subscriptions/arm-resources-subscriptions) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-resources-subscriptions) | -[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-resources-subscriptions) | +[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-resources-subscriptions?view=azure-node-preview) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started @@ -44,7 +44,6 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure Subscription** 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 +63,14 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur import { InteractiveBrowserCredential } from "@azure/identity"; import { SubscriptionClient } from "@azure/arm-resources-subscriptions"; -const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", - clientId: "", -}); + clientId: "" + }); const client = new SubscriptionClient(credential, subscriptionId); ``` ### JavaScript Bundle - To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). ## Key concepts @@ -109,7 +106,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/ diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/_meta.json b/sdk/resources-subscriptions/arm-resources-subscriptions/_meta.json index 0c611e34e91d..c37acc89bcac 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/_meta.json +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/_meta.json @@ -1,8 +1,8 @@ { - "commit": "2b5927fd07bfb51809a06ca35b6142f63ba77bab", + "commit": "fcbc290cc06b0d69207105d83bb7dac49c21675b", "readme": "specification/resources/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.3 --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.2 --generate-sample=true", + "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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/resources/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.6.2", - "use": "@autorest/typescript@6.0.2" -} \ No newline at end of file + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.26", + "use": "@autorest/typescript@^6.0.12" +} diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/api-extractor.json b/sdk/resources-subscriptions/arm-resources-subscriptions/api-extractor.json index 93b4d73575fc..3d88caaa4eed 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/api-extractor.json +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/api-extractor.json @@ -28,4 +28,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/package.json b/sdk/resources-subscriptions/arm-resources-subscriptions/package.json index 4180b793a2dc..efc1c73df649 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/package.json +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/package.json @@ -3,15 +3,15 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for SubscriptionClient.", - "version": "2.1.1", + "version": "1.0.0-beta.2", "engines": { "node": ">=18.0.0" }, "dependencies": { "@azure/core-auth": "^1.9.0", - "@azure/core-client": "^1.9.2", + "@azure/core-client": "^1.9.3", "@azure/core-paging": "^1.6.2", - "@azure/core-rest-pipeline": "^1.19.0", + "@azure/core-rest-pipeline": "^1.19.1", "tslib": "^2.8.1" }, "keywords": [ @@ -19,31 +19,30 @@ "azure", "typescript", "browser", - "isomorphic" + "isomorphic", + "cloud" ], "license": "MIT", "main": "./dist/commonjs/index.js", "module": "./dist/esm/index.js", "types": "./dist/commonjs/index.d.ts", + "type": "module", "devDependencies": { "@azure-tools/test-credential": "^2.0.0", "@azure-tools/test-recorder": "^4.1.0", "@azure-tools/test-utils-vitest": "^1.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.6.0", + "@azure/identity": "^4.9.1", "@azure/logger": "^1.1.4", "@types/node": "^18.0.0", "@vitest/browser": "^3.0.9", "@vitest/coverage-istanbul": "^3.0.9", "dotenv": "^16.0.0", - "playwright": "^1.50.1", + "playwright": "^1.52.0", "typescript": "~5.8.2", "vitest": "^3.0.9" }, - "repository": { - "type": "git", - "url": "https://github.com/Azure/azure-sdk-for-js.git" - }, + "repository": "github:Azure/azure-sdk-for-js", "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, @@ -60,16 +59,16 @@ "build:node": "echo skipped", "build:samples": "echo skipped.", "build:test": "echo skipped", - "check-format": "echo skipped", + "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", "clean": "dev-tool run vendored 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", + "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "integration-test:browser": "echo skipped", "integration-test:node": "dev-tool run test:vitest --esm", "lint": "echo skipped", - "minify": "echo skipped", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", "pack": "npm pack 2>&1", "prepack": "npm run build", "test": "npm run integration-test", @@ -90,16 +89,9 @@ ] }, "autoPublish": true, + "browser": "./dist/browser/index.js", + "react-native": "./dist/react-native/index.js", "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources-subscriptions/arm-resources-subscriptions", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-resources-subscriptions?view=azure-node-preview" - }, - "type": "module", "tshy": { "project": "./tsconfig.src.json", "exports": { @@ -116,8 +108,6 @@ ], "selfLink": false }, - "browser": "./dist/browser/index.js", - "react-native": "./dist/react-native/index.js", "exports": { "./package.json": "./package.json", ".": { @@ -139,4 +129,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/sample.env b/sdk/resources-subscriptions/arm-resources-subscriptions/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/sample.env +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/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/resources-subscriptions/arm-resources-subscriptions/src/models/index.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/index.ts index 6db2ed8937c1..e8f6c220f391 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/index.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/index.ts @@ -528,7 +528,7 @@ export enum KnownOrigin { /** System */ System = "system", /** UserSystem */ - UserSystem = "user,system" + UserSystem = "user,system", } /** @@ -545,7 +545,7 @@ export type Origin = string; /** Known values of {@link ActionType} that the service accepts. */ export enum KnownActionType { /** Internal */ - Internal = "Internal" + Internal = "Internal", } /** @@ -562,7 +562,7 @@ export enum KnownRegionType { /** Physical */ Physical = "Physical", /** Logical */ - Logical = "Logical" + Logical = "Logical", } /** @@ -582,7 +582,7 @@ export enum KnownRegionCategory { /** Extended */ Extended = "Extended", /** Other */ - Other = "Other" + Other = "Other", } /** @@ -601,7 +601,7 @@ export enum KnownResourceNameStatus { /** Allowed */ Allowed = "Allowed", /** Reserved */ - Reserved = "Reserved" + Reserved = "Reserved", } /** @@ -616,34 +616,26 @@ export type ResourceNameStatus = string; /** Defines values for LocationType. */ export type LocationType = "Region" | "EdgeZone"; /** Defines values for SubscriptionState. */ -export type SubscriptionState = - | "Enabled" - | "Warned" - | "PastDue" - | "Disabled" - | "Deleted"; +export type SubscriptionState = "Enabled" | "Warned" | "PastDue" | "Disabled" | "Deleted"; /** Defines values for SpendingLimit. */ export type SpendingLimit = "On" | "Off" | "CurrentPeriodOff"; /** Defines values for TenantCategory. */ export type TenantCategory = "Home" | "ProjectedBy" | "ManagedBy"; /** Optional parameters. */ -export interface OperationsListOptionalParams - extends coreClient.OperationOptions {} +export interface OperationsListOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the list operation. */ export type OperationsListResponse = OperationListResult; /** Optional parameters. */ -export interface OperationsListNextOptionalParams - extends coreClient.OperationOptions {} +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type OperationsListNextResponse = OperationListResult; /** Optional parameters. */ -export interface SubscriptionsListLocationsOptionalParams - extends coreClient.OperationOptions { +export interface SubscriptionsListLocationsOptionalParams extends coreClient.OperationOptions { /** Whether to include extended locations. */ includeExtendedLocations?: boolean; } @@ -652,50 +644,43 @@ export interface SubscriptionsListLocationsOptionalParams export type SubscriptionsListLocationsResponse = LocationListResult; /** Optional parameters. */ -export interface SubscriptionsGetOptionalParams - extends coreClient.OperationOptions {} +export interface SubscriptionsGetOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ export type SubscriptionsGetResponse = Subscription; /** Optional parameters. */ -export interface SubscriptionsListOptionalParams - extends coreClient.OperationOptions {} +export interface SubscriptionsListOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the list operation. */ export type SubscriptionsListResponse = SubscriptionListResult; /** Optional parameters. */ -export interface SubscriptionsCheckZonePeersOptionalParams - extends coreClient.OperationOptions {} +export interface SubscriptionsCheckZonePeersOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the checkZonePeers operation. */ export type SubscriptionsCheckZonePeersResponse = CheckZonePeersResult; /** Optional parameters. */ -export interface SubscriptionsListNextOptionalParams - extends coreClient.OperationOptions {} +export interface SubscriptionsListNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type SubscriptionsListNextResponse = SubscriptionListResult; /** Optional parameters. */ -export interface TenantsListOptionalParams - extends coreClient.OperationOptions {} +export interface TenantsListOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the list operation. */ export type TenantsListResponse = TenantListResult; /** Optional parameters. */ -export interface TenantsListNextOptionalParams - extends coreClient.OperationOptions {} +export interface TenantsListNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type TenantsListNextResponse = TenantListResult; /** Optional parameters. */ -export interface CheckResourceNameOptionalParams - extends coreClient.OperationOptions { +export interface CheckResourceNameOptionalParams extends coreClient.OperationOptions { /** Resource object with values for resource name and resource type */ resourceNameDefinition?: ResourceName; } @@ -704,8 +689,7 @@ export interface CheckResourceNameOptionalParams export type CheckResourceNameResponse = CheckResourceNameResult; /** Optional parameters. */ -export interface SubscriptionClientOptionalParams - extends coreClient.ServiceClientOptions { +export interface SubscriptionClientOptionalParams extends coreClient.ServiceClientOptions { /** server parameter */ $host?: string; /** Api Version */ diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/mappers.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/mappers.ts index 5f6ca4b369ab..7b3f81dc0a3f 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/mappers.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/mappers.ts @@ -21,20 +21,20 @@ export const OperationListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Operation" - } - } - } + className: "Operation", + }, + }, + }, }, nextLink: { serializedName: "nextLink", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Operation: coreClient.CompositeMapper = { @@ -46,39 +46,39 @@ export const Operation: coreClient.CompositeMapper = { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, isDataAction: { serializedName: "isDataAction", readOnly: true, type: { - name: "Boolean" - } + name: "Boolean", + }, }, display: { serializedName: "display", type: { name: "Composite", - className: "OperationDisplay" - } + className: "OperationDisplay", + }, }, origin: { serializedName: "origin", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, actionType: { serializedName: "actionType", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const OperationDisplay: coreClient.CompositeMapper = { @@ -90,32 +90,32 @@ export const OperationDisplay: coreClient.CompositeMapper = { serializedName: "provider", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, resource: { serializedName: "resource", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, operation: { serializedName: "operation", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, description: { serializedName: "description", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const CloudError: coreClient.CompositeMapper = { @@ -127,11 +127,11 @@ export const CloudError: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorResponse" - } - } - } - } + className: "ErrorResponse", + }, + }, + }, + }, }; export const ErrorResponse: coreClient.CompositeMapper = { @@ -143,22 +143,22 @@ export const ErrorResponse: coreClient.CompositeMapper = { serializedName: "code", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, message: { serializedName: "message", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, target: { serializedName: "target", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, details: { serializedName: "details", @@ -168,10 +168,10 @@ export const ErrorResponse: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorResponse" - } - } - } + className: "ErrorResponse", + }, + }, + }, }, additionalInfo: { serializedName: "additionalInfo", @@ -181,13 +181,13 @@ export const ErrorResponse: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorAdditionalInfo" - } - } - } - } - } - } + className: "ErrorAdditionalInfo", + }, + }, + }, + }, + }, + }, }; export const ErrorAdditionalInfo: coreClient.CompositeMapper = { @@ -199,19 +199,19 @@ export const ErrorAdditionalInfo: coreClient.CompositeMapper = { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, info: { serializedName: "info", readOnly: true, type: { name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } + value: { type: { name: "any" } }, + }, + }, + }, + }, }; export const LocationListResult: coreClient.CompositeMapper = { @@ -226,13 +226,13 @@ export const LocationListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Location" - } - } - } - } - } - } + className: "Location", + }, + }, + }, + }, + }, + }, }; export const Location: coreClient.CompositeMapper = { @@ -244,51 +244,51 @@ export const Location: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, subscriptionId: { serializedName: "subscriptionId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", readOnly: true, type: { name: "Enum", - allowedValues: ["Region", "EdgeZone"] - } + allowedValues: ["Region", "EdgeZone"], + }, }, displayName: { serializedName: "displayName", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, regionalDisplayName: { serializedName: "regionalDisplayName", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, metadata: { serializedName: "metadata", type: { name: "Composite", - className: "LocationMetadata" - } + className: "LocationMetadata", + }, }, availabilityZoneMappings: { serializedName: "availabilityZoneMappings", @@ -297,13 +297,13 @@ export const Location: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "AvailabilityZoneMappings" - } - } - } - } - } - } + className: "AvailabilityZoneMappings", + }, + }, + }, + }, + }, + }, }; export const LocationMetadata: coreClient.CompositeMapper = { @@ -315,50 +315,50 @@ export const LocationMetadata: coreClient.CompositeMapper = { serializedName: "regionType", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, regionCategory: { serializedName: "regionCategory", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, geography: { serializedName: "geography", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, geographyGroup: { serializedName: "geographyGroup", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, longitude: { serializedName: "longitude", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, latitude: { serializedName: "latitude", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, physicalLocation: { serializedName: "physicalLocation", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, pairedRegion: { serializedName: "pairedRegion", @@ -367,20 +367,20 @@ export const LocationMetadata: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "PairedRegion" - } - } - } + className: "PairedRegion", + }, + }, + }, }, homeLocation: { serializedName: "homeLocation", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const PairedRegion: coreClient.CompositeMapper = { @@ -392,25 +392,25 @@ export const PairedRegion: coreClient.CompositeMapper = { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, id: { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, subscriptionId: { serializedName: "subscriptionId", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const AvailabilityZoneMappings: coreClient.CompositeMapper = { @@ -422,18 +422,18 @@ export const AvailabilityZoneMappings: coreClient.CompositeMapper = { serializedName: "logicalZone", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, physicalZone: { serializedName: "physicalZone", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Subscription: coreClient.CompositeMapper = { @@ -445,50 +445,50 @@ export const Subscription: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, subscriptionId: { serializedName: "subscriptionId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, displayName: { serializedName: "displayName", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, tenantId: { serializedName: "tenantId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, state: { serializedName: "state", readOnly: true, type: { name: "Enum", - allowedValues: ["Enabled", "Warned", "PastDue", "Disabled", "Deleted"] - } + allowedValues: ["Enabled", "Warned", "PastDue", "Disabled", "Deleted"], + }, }, subscriptionPolicies: { serializedName: "subscriptionPolicies", type: { name: "Composite", - className: "SubscriptionPolicies" - } + className: "SubscriptionPolicies", + }, }, authorizationSource: { serializedName: "authorizationSource", type: { - name: "String" - } + name: "String", + }, }, managedByTenants: { serializedName: "managedByTenants", @@ -497,20 +497,20 @@ export const Subscription: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ManagedByTenant" - } - } - } + className: "ManagedByTenant", + }, + }, + }, }, tags: { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } + value: { type: { name: "String" } }, + }, + }, + }, + }, }; export const SubscriptionPolicies: coreClient.CompositeMapper = { @@ -522,26 +522,26 @@ export const SubscriptionPolicies: coreClient.CompositeMapper = { serializedName: "locationPlacementId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, quotaId: { serializedName: "quotaId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, spendingLimit: { serializedName: "spendingLimit", readOnly: true, type: { name: "Enum", - allowedValues: ["On", "Off", "CurrentPeriodOff"] - } - } - } - } + allowedValues: ["On", "Off", "CurrentPeriodOff"], + }, + }, + }, + }, }; export const ManagedByTenant: coreClient.CompositeMapper = { @@ -553,11 +553,11 @@ export const ManagedByTenant: coreClient.CompositeMapper = { serializedName: "tenantId", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const SubscriptionListResult: coreClient.CompositeMapper = { @@ -572,20 +572,20 @@ export const SubscriptionListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Subscription" - } - } - } + className: "Subscription", + }, + }, + }, }, nextLink: { serializedName: "nextLink", required: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const TenantListResult: coreClient.CompositeMapper = { @@ -600,20 +600,20 @@ export const TenantListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "TenantIdDescription" - } - } - } + className: "TenantIdDescription", + }, + }, + }, }, nextLink: { serializedName: "nextLink", required: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const TenantIdDescription: coreClient.CompositeMapper = { @@ -625,44 +625,44 @@ export const TenantIdDescription: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, tenantId: { serializedName: "tenantId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, tenantCategory: { serializedName: "tenantCategory", readOnly: true, type: { name: "Enum", - allowedValues: ["Home", "ProjectedBy", "ManagedBy"] - } + allowedValues: ["Home", "ProjectedBy", "ManagedBy"], + }, }, country: { serializedName: "country", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, countryCode: { serializedName: "countryCode", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, displayName: { serializedName: "displayName", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, domains: { serializedName: "domains", @@ -671,34 +671,34 @@ export const TenantIdDescription: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "String", + }, + }, + }, }, defaultDomain: { serializedName: "defaultDomain", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, tenantType: { serializedName: "tenantType", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, tenantBrandingLogoUrl: { serializedName: "tenantBrandingLogoUrl", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const CheckZonePeersRequest: coreClient.CompositeMapper = { @@ -709,8 +709,8 @@ export const CheckZonePeersRequest: coreClient.CompositeMapper = { location: { serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, subscriptionIds: { serializedName: "subscriptionIds", @@ -718,13 +718,13 @@ export const CheckZonePeersRequest: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } - } - } - } + name: "String", + }, + }, + }, + }, + }, + }, }; export const CheckZonePeersResult: coreClient.CompositeMapper = { @@ -736,14 +736,14 @@ export const CheckZonePeersResult: coreClient.CompositeMapper = { serializedName: "subscriptionId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, location: { serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, availabilityZonePeers: { serializedName: "availabilityZonePeers", @@ -752,13 +752,13 @@ export const CheckZonePeersResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "AvailabilityZonePeers" - } - } - } - } - } - } + className: "AvailabilityZonePeers", + }, + }, + }, + }, + }, + }, }; export const AvailabilityZonePeers: coreClient.CompositeMapper = { @@ -770,8 +770,8 @@ export const AvailabilityZonePeers: coreClient.CompositeMapper = { serializedName: "availabilityZone", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, peers: { serializedName: "peers", @@ -780,13 +780,13 @@ export const AvailabilityZonePeers: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Peers" - } - } - } - } - } - } + className: "Peers", + }, + }, + }, + }, + }, + }, }; export const Peers: coreClient.CompositeMapper = { @@ -798,18 +798,18 @@ export const Peers: coreClient.CompositeMapper = { serializedName: "subscriptionId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, availabilityZone: { serializedName: "availabilityZone", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ErrorResponseAutoGenerated: coreClient.CompositeMapper = { @@ -821,11 +821,11 @@ export const ErrorResponseAutoGenerated: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorDetail" - } - } - } - } + className: "ErrorDetail", + }, + }, + }, + }, }; export const ErrorDetail: coreClient.CompositeMapper = { @@ -837,22 +837,22 @@ export const ErrorDetail: coreClient.CompositeMapper = { serializedName: "code", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, message: { serializedName: "message", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, target: { serializedName: "target", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, details: { serializedName: "details", @@ -862,10 +862,10 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorDetail" - } - } - } + className: "ErrorDetail", + }, + }, + }, }, additionalInfo: { serializedName: "additionalInfo", @@ -875,13 +875,13 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorAdditionalInfo" - } - } - } - } - } - } + className: "ErrorAdditionalInfo", + }, + }, + }, + }, + }, + }, }; export const ResourceName: coreClient.CompositeMapper = { @@ -893,18 +893,18 @@ export const ResourceName: coreClient.CompositeMapper = { serializedName: "name", required: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", required: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const CheckResourceNameResult: coreClient.CompositeMapper = { @@ -915,23 +915,23 @@ export const CheckResourceNameResult: coreClient.CompositeMapper = { name: { serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", type: { - name: "String" - } + name: "String", + }, }, status: { serializedName: "status", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const OperationAutoGenerated: coreClient.CompositeMapper = { @@ -942,39 +942,39 @@ export const OperationAutoGenerated: coreClient.CompositeMapper = { name: { serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, isDataAction: { serializedName: "isDataAction", readOnly: true, type: { - name: "Boolean" - } + name: "Boolean", + }, }, display: { serializedName: "display", type: { name: "Composite", - className: "OperationDisplayAutoGenerated" - } + className: "OperationDisplayAutoGenerated", + }, }, origin: { serializedName: "origin", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, actionType: { serializedName: "actionType", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const OperationDisplayAutoGenerated: coreClient.CompositeMapper = { @@ -985,29 +985,29 @@ export const OperationDisplayAutoGenerated: coreClient.CompositeMapper = { provider: { serializedName: "provider", type: { - name: "String" - } + name: "String", + }, }, resource: { serializedName: "resource", type: { - name: "String" - } + name: "String", + }, }, operation: { serializedName: "operation", type: { - name: "String" - } + name: "String", + }, }, description: { serializedName: "description", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const OperationListResultAutoGenerated: coreClient.CompositeMapper = { @@ -1022,17 +1022,17 @@ export const OperationListResultAutoGenerated: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "OperationAutoGenerated" - } - } - } + className: "OperationAutoGenerated", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/parameters.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/parameters.ts index 4e06f9ddb5b9..1c6e3ff85fac 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/parameters.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/models/parameters.ts @@ -9,11 +9,11 @@ import { OperationParameter, OperationURLParameter, - OperationQueryParameter + OperationQueryParameter, } from "@azure/core-client"; import { CheckZonePeersRequest as CheckZonePeersRequestMapper, - ResourceName as ResourceNameMapper + ResourceName as ResourceNameMapper, } from "../models/mappers.js"; export const accept: OperationParameter = { @@ -23,9 +23,9 @@ export const accept: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const $host: OperationURLParameter = { @@ -34,10 +34,10 @@ export const $host: OperationURLParameter = { serializedName: "$host", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const apiVersion: OperationQueryParameter = { @@ -47,9 +47,9 @@ export const apiVersion: OperationQueryParameter = { isConstant: true, serializedName: "api-version", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const nextLink: OperationURLParameter = { @@ -58,10 +58,10 @@ export const nextLink: OperationURLParameter = { serializedName: "nextLink", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const subscriptionId: OperationURLParameter = { @@ -70,9 +70,9 @@ export const subscriptionId: OperationURLParameter = { serializedName: "subscriptionId", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const includeExtendedLocations: OperationQueryParameter = { @@ -80,9 +80,9 @@ export const includeExtendedLocations: OperationQueryParameter = { mapper: { serializedName: "includeExtendedLocations", type: { - name: "Boolean" - } - } + name: "Boolean", + }, + }, }; export const contentType: OperationParameter = { @@ -92,17 +92,17 @@ export const contentType: OperationParameter = { isConstant: true, serializedName: "Content-Type", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const parameters: OperationParameter = { parameterPath: "parameters", - mapper: CheckZonePeersRequestMapper + mapper: CheckZonePeersRequestMapper, }; export const resourceNameDefinition: OperationParameter = { parameterPath: ["options", "resourceNameDefinition"], - mapper: ResourceNameMapper + mapper: ResourceNameMapper, }; diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/operations.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/operations.ts index 38a0d338dc3d..19df90fb9191 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/operations.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/operations.ts @@ -18,7 +18,7 @@ import { OperationsListNextOptionalParams, OperationsListOptionalParams, OperationsListResponse, - OperationsListNextResponse + OperationsListNextResponse, } from "../models/index.js"; /// @@ -38,9 +38,7 @@ export class OperationsImpl implements Operations { * Lists all of the available Microsoft.Resources REST API operations. * @param options The options parameters. */ - public list( - options?: OperationsListOptionalParams - ): PagedAsyncIterableIterator { + public list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { next() { @@ -54,13 +52,13 @@ export class OperationsImpl implements Operations { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: OperationsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: OperationsListResponse; let continuationToken = settings?.continuationToken; @@ -81,7 +79,7 @@ export class OperationsImpl implements Operations { } private async *listPagingAll( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -92,9 +90,7 @@ export class OperationsImpl implements Operations { * Lists all of the available Microsoft.Resources REST API operations. * @param options The options parameters. */ - private _list( - options?: OperationsListOptionalParams - ): Promise { + private _list(options?: OperationsListOptionalParams): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -105,12 +101,9 @@ export class OperationsImpl implements Operations { */ private _listNext( nextLink: string, - options?: OperationsListNextOptionalParams + options?: OperationsListNextOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec - ); + return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); } } // Operation Specifications @@ -121,29 +114,29 @@ const listOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/subscriptions.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/subscriptions.ts index a3b473fbce23..6c1b4bc38d9a 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/subscriptions.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/subscriptions.ts @@ -26,7 +26,7 @@ import { CheckZonePeersRequest, SubscriptionsCheckZonePeersOptionalParams, SubscriptionsCheckZonePeersResponse, - SubscriptionsListNextResponse + SubscriptionsListNextResponse, } from "../models/index.js"; /// @@ -50,7 +50,7 @@ export class SubscriptionsImpl implements Subscriptions { */ public listLocations( subscriptionId: string, - options?: SubscriptionsListLocationsOptionalParams + options?: SubscriptionsListLocationsOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listLocationsPagingAll(subscriptionId, options); return { @@ -65,14 +65,14 @@ export class SubscriptionsImpl implements Subscriptions { throw new Error("maxPageSize is not supported by this operation."); } return this.listLocationsPagingPage(subscriptionId, options, settings); - } + }, }; } private async *listLocationsPagingPage( subscriptionId: string, options?: SubscriptionsListLocationsOptionalParams, - _settings?: PageSettings + _settings?: PageSettings, ): AsyncIterableIterator { let result: SubscriptionsListLocationsResponse; result = await this._listLocations(subscriptionId, options); @@ -81,12 +81,9 @@ export class SubscriptionsImpl implements Subscriptions { private async *listLocationsPagingAll( subscriptionId: string, - options?: SubscriptionsListLocationsOptionalParams + options?: SubscriptionsListLocationsOptionalParams, ): AsyncIterableIterator { - for await (const page of this.listLocationsPagingPage( - subscriptionId, - options - )) { + for await (const page of this.listLocationsPagingPage(subscriptionId, options)) { yield* page; } } @@ -95,9 +92,7 @@ export class SubscriptionsImpl implements Subscriptions { * Gets all subscriptions for a tenant. * @param options The options parameters. */ - public list( - options?: SubscriptionsListOptionalParams - ): PagedAsyncIterableIterator { + public list(options?: SubscriptionsListOptionalParams): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { next() { @@ -111,13 +106,13 @@ export class SubscriptionsImpl implements Subscriptions { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: SubscriptionsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: SubscriptionsListResponse; let continuationToken = settings?.continuationToken; @@ -138,7 +133,7 @@ export class SubscriptionsImpl implements Subscriptions { } private async *listPagingAll( - options?: SubscriptionsListOptionalParams + options?: SubscriptionsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -153,11 +148,11 @@ export class SubscriptionsImpl implements Subscriptions { */ private _listLocations( subscriptionId: string, - options?: SubscriptionsListLocationsOptionalParams + options?: SubscriptionsListLocationsOptionalParams, ): Promise { return this.client.sendOperationRequest( { subscriptionId, options }, - listLocationsOperationSpec + listLocationsOperationSpec, ); } @@ -168,21 +163,16 @@ export class SubscriptionsImpl implements Subscriptions { */ get( subscriptionId: string, - options?: SubscriptionsGetOptionalParams + options?: SubscriptionsGetOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { subscriptionId, options }, - getOperationSpec - ); + return this.client.sendOperationRequest({ subscriptionId, options }, getOperationSpec); } /** * Gets all subscriptions for a tenant. * @param options The options parameters. */ - private _list( - options?: SubscriptionsListOptionalParams - ): Promise { + private _list(options?: SubscriptionsListOptionalParams): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -195,11 +185,11 @@ export class SubscriptionsImpl implements Subscriptions { checkZonePeers( subscriptionId: string, parameters: CheckZonePeersRequest, - options?: SubscriptionsCheckZonePeersOptionalParams + options?: SubscriptionsCheckZonePeersOptionalParams, ): Promise { return this.client.sendOperationRequest( { subscriptionId, parameters, options }, - checkZonePeersOperationSpec + checkZonePeersOperationSpec, ); } @@ -210,12 +200,9 @@ export class SubscriptionsImpl implements Subscriptions { */ private _listNext( nextLink: string, - options?: SubscriptionsListNextOptionalParams + options?: SubscriptionsListNextOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec - ); + return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); } } // Operation Specifications @@ -226,80 +213,79 @@ const listLocationsOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.LocationListResult + bodyMapper: Mappers.LocationListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion, Parameters.includeExtendedLocations], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.Subscription + bodyMapper: Mappers.Subscription, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listOperationSpec: coreClient.OperationSpec = { path: "/subscriptions", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SubscriptionListResult + bodyMapper: Mappers.SubscriptionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; const checkZonePeersOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/checkZonePeers/", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/checkZonePeers/", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.CheckZonePeersResult + bodyMapper: Mappers.CheckZonePeersResult, }, default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated - } + bodyMapper: Mappers.ErrorResponseAutoGenerated, + }, }, requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SubscriptionListResult + bodyMapper: Mappers.SubscriptionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/tenants.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/tenants.ts index c59fd5fead02..b90372023fb2 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/tenants.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operations/tenants.ts @@ -18,7 +18,7 @@ import { TenantsListNextOptionalParams, TenantsListOptionalParams, TenantsListResponse, - TenantsListNextResponse + TenantsListNextResponse, } from "../models/index.js"; /// @@ -39,7 +39,7 @@ export class TenantsImpl implements Tenants { * @param options The options parameters. */ public list( - options?: TenantsListOptionalParams + options?: TenantsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -54,13 +54,13 @@ export class TenantsImpl implements Tenants { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: TenantsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: TenantsListResponse; let continuationToken = settings?.continuationToken; @@ -81,7 +81,7 @@ export class TenantsImpl implements Tenants { } private async *listPagingAll( - options?: TenantsListOptionalParams + options?: TenantsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -92,9 +92,7 @@ export class TenantsImpl implements Tenants { * Gets the tenants for your account. * @param options The options parameters. */ - private _list( - options?: TenantsListOptionalParams - ): Promise { + private _list(options?: TenantsListOptionalParams): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -105,12 +103,9 @@ export class TenantsImpl implements Tenants { */ private _listNext( nextLink: string, - options?: TenantsListNextOptionalParams + options?: TenantsListNextOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec - ); + return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); } } // Operation Specifications @@ -121,29 +116,29 @@ const listOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.TenantListResult + bodyMapper: Mappers.TenantListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.TenantListResult + bodyMapper: Mappers.TenantListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/operations.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/operations.ts index b2b6a973dc8e..e09c02a0606b 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/operations.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/operations.ts @@ -16,7 +16,5 @@ export interface Operations { * Lists all of the available Microsoft.Resources REST API operations. * @param options The options parameters. */ - list( - options?: OperationsListOptionalParams - ): PagedAsyncIterableIterator; + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; } diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/subscriptions.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/subscriptions.ts index d8f4303c29f0..a8f929c3b390 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/subscriptions.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/subscriptions.ts @@ -16,7 +16,7 @@ import { SubscriptionsGetResponse, CheckZonePeersRequest, SubscriptionsCheckZonePeersOptionalParams, - SubscriptionsCheckZonePeersResponse + SubscriptionsCheckZonePeersResponse, } from "../models/index.js"; /// @@ -30,15 +30,13 @@ export interface Subscriptions { */ listLocations( subscriptionId: string, - options?: SubscriptionsListLocationsOptionalParams + options?: SubscriptionsListLocationsOptionalParams, ): PagedAsyncIterableIterator; /** * Gets all subscriptions for a tenant. * @param options The options parameters. */ - list( - options?: SubscriptionsListOptionalParams - ): PagedAsyncIterableIterator; + list(options?: SubscriptionsListOptionalParams): PagedAsyncIterableIterator; /** * Gets details about a specified subscription. * @param subscriptionId The ID of the target subscription. @@ -46,7 +44,7 @@ export interface Subscriptions { */ get( subscriptionId: string, - options?: SubscriptionsGetOptionalParams + options?: SubscriptionsGetOptionalParams, ): Promise; /** * Compares a subscriptions logical zone mapping @@ -57,6 +55,6 @@ export interface Subscriptions { checkZonePeers( subscriptionId: string, parameters: CheckZonePeersRequest, - options?: SubscriptionsCheckZonePeersOptionalParams + options?: SubscriptionsCheckZonePeersOptionalParams, ): Promise; } diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/tenants.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/tenants.ts index cc28180cfb72..7bfc72c5e21a 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/tenants.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/tenants.ts @@ -16,7 +16,5 @@ export interface Tenants { * Gets the tenants for your account. * @param options The options parameters. */ - list( - options?: TenantsListOptionalParams - ): PagedAsyncIterableIterator; + list(options?: TenantsListOptionalParams): PagedAsyncIterableIterator; } diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/pagingHelper.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/pagingHelper.ts index 269a2b9814b5..e362819bdfc4 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/pagingHelper.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/pagingHelper.ts @@ -26,10 +26,7 @@ export function getContinuationToken(page: unknown): string | undefined { return pageMap.get(page)?.continuationToken; } -export function setContinuationToken( - page: unknown, - continuationToken: string | undefined -): void { +export function setContinuationToken(page: unknown, continuationToken: string | undefined): void { if (typeof page !== "object" || page === null || !continuationToken) { return; } diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/src/subscriptionClient.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/src/subscriptionClient.ts index 016d35a193fa..225841cf5822 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/subscriptionClient.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/subscriptionClient.ts @@ -8,11 +8,7 @@ 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 { PipelineRequest, PipelineResponse, SendRequest } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { OperationsImpl, SubscriptionsImpl, TenantsImpl } from "./operations/index.js"; import { Operations, Subscriptions, Tenants } from "./operationsInterfaces/index.js"; @@ -21,7 +17,7 @@ import * as Mappers from "./models/mappers.js"; import { SubscriptionClientOptionalParams, CheckResourceNameOptionalParams, - CheckResourceNameResponse + CheckResourceNameResponse, } from "./models/index.js"; export class SubscriptionClient extends coreClient.ServiceClient { @@ -33,10 +29,7 @@ export class SubscriptionClient extends coreClient.ServiceClient { * @param credentials Subscription credentials which uniquely identify client subscription. * @param options The parameter options */ - constructor( - credentials: coreAuth.TokenCredential, - options?: SubscriptionClientOptionalParams - ) { + constructor(credentials: coreAuth.TokenCredential, options?: SubscriptionClientOptionalParams) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); } @@ -47,10 +40,10 @@ export class SubscriptionClient extends coreClient.ServiceClient { } const defaults: SubscriptionClientOptionalParams = { requestContentType: "application/json; charset=utf-8", - credential: credentials + credential: credentials, }; - const packageDetails = `azsdk-js-arm-resources-subscriptions/2.1.1`; + const packageDetails = `azsdk-js-arm-resources-subscriptions/1.0.0-beta.2`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -60,20 +53,19 @@ export class SubscriptionClient extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, - endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + 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(); + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => - pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName + pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -83,19 +75,17 @@ export class SubscriptionClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ credential: credentials, scopes: - optionsWithDefaults.credentialScopes ?? - `${optionsWithDefaults.endpoint}/.default`, + optionsWithDefaults.credentialScopes ?? `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } @@ -115,10 +105,7 @@ export class SubscriptionClient extends coreClient.ServiceClient { } const apiVersionPolicy = { name: "CustomApiVersionPolicy", - async sendRequest( - request: PipelineRequest, - next: SendRequest - ): Promise { + async sendRequest(request: PipelineRequest, next: SendRequest): Promise { const param = request.url.split("?"); if (param.length > 1) { const newParams = param[1].split("&").map((item) => { @@ -131,7 +118,7 @@ export class SubscriptionClient extends coreClient.ServiceClient { request.url = param[0] + "?" + newParams.join("&"); } return next(request); - } + }, }; this.pipeline.addPolicy(apiVersionPolicy); } @@ -141,13 +128,8 @@ export class SubscriptionClient extends coreClient.ServiceClient { * not start with a reserved word * @param options The options parameters. */ - checkResourceName( - options?: CheckResourceNameOptionalParams - ): Promise { - return this.sendOperationRequest( - { options }, - checkResourceNameOperationSpec - ); + checkResourceName(options?: CheckResourceNameOptionalParams): Promise { + return this.sendOperationRequest({ options }, checkResourceNameOperationSpec); } operations: Operations; @@ -162,16 +144,16 @@ const checkResourceNameOperationSpec: coreClient.OperationSpec = { httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.CheckResourceNameResult + bodyMapper: Mappers.CheckResourceNameResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.CloudError, + }, }, requestBody: Parameters.resourceNameDefinition, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/test/sampleTest.spec.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/test/sampleTest.spec.ts new file mode 100644 index 000000000000..90b3c8a868b4 --- /dev/null +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/test/sampleTest.spec.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { Recorder, RecorderStartOptions } from "@azure-tools/test-recorder"; +import { afterEach, beforeEach, describe, it, assert } from "vitest"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async () => { + recorder = new Recorder(); + await recorder.start(recorderOptions); + }); + + afterEach(async () => { + await recorder.stop(); + }); + + it("sample test", async () => { + assert(true); + }); +}); diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/test/snippets.spec.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/test/snippets.spec.ts index b85125439ff3..4888f4dd6061 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/test/snippets.spec.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/test/snippets.spec.ts @@ -1,5 +1,10 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. +/* + * 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 { SubscriptionClient } from "../src/index.js"; import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.browser.config.json b/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.browser.config.json index 0c8bafa97126..75871518e3a0 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.browser.config.json +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.browser.config.json @@ -1,6 +1,3 @@ { - "extends": [ - "./tsconfig.test.json", - "../../../tsconfig.browser.base.json" - ] + "extends": ["./tsconfig.test.json", "../../../tsconfig.browser.base.json"] } diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.json b/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.json index 19ceb382b521..ecade2a57ef4 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.json +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.json @@ -4,10 +4,25 @@ "path": "./tsconfig.src.json" }, { - "path": "./tsconfig.samples.json" + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.test.json" }, { "path": "./tsconfig.test.json" } ] -} +} \ No newline at end of file diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.samples.json b/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.samples.json index f49a2ca4b033..e73e2fb2e910 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.samples.json +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.samples.json @@ -2,9 +2,7 @@ "extends": "../../../tsconfig.samples.base.json", "compilerOptions": { "paths": { - "@azure/arm-resources-subscriptions": [ - "./dist/esm" - ] + "@azure/arm-resources-subscriptions": ["./dist/esm"] } } } diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.test.json b/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.test.json index 3c2b783a8c1b..290ca214aebc 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.test.json +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.test.json @@ -1,6 +1,3 @@ { - "extends": [ - "./tsconfig.src.json", - "../../../tsconfig.test.base.json" - ] + "extends": ["./tsconfig.src.json", "../../../tsconfig.test.base.json"] } diff --git a/sdk/resources/arm-resources/CHANGELOG.md b/sdk/resources/arm-resources/CHANGELOG.md index 0ad334459fd1..e1d67a2b67da 100644 --- a/sdk/resources/arm-resources/CHANGELOG.md +++ b/sdk/resources/arm-resources/CHANGELOG.md @@ -1,15 +1,19 @@ # Release History - -## 6.0.1 (Unreleased) - -### Features Added - + +## 7.0.0 (2025-04-28) + ### Breaking Changes -### Bugs Fixed - -### Other Changes - + - Removed operation group DeploymentOperations + - Removed operation group Deployments + - Class ResourceManagementClient no longer has parameter deploymentOperations + - Class ResourceManagementClient no longer has parameter deployments + - Removed Enum KnownExpressionEvaluationOptionsScopeType + - Removed Enum KnownLevel + - Removed Enum KnownProvisioningState + - Removed Enum KnownValidationLevel + + ## 6.0.0 (2025-02-19) ### Features Added diff --git a/sdk/resources/arm-resources/LICENSE b/sdk/resources/arm-resources/LICENSE index b2f52a2bad4e..63447fd8bbbf 100644 --- a/sdk/resources/arm-resources/LICENSE +++ b/sdk/resources/arm-resources/LICENSE @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/sdk/resources/arm-resources/README.md b/sdk/resources/arm-resources/README.md index a53aad7125d5..2ed1e6b99079 100644 --- a/sdk/resources/arm-resources/README.md +++ b/sdk/resources/arm-resources/README.md @@ -63,16 +63,14 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur import { InteractiveBrowserCredential } from "@azure/identity"; import { ResourceManagementClient } from "@azure/arm-resources"; -const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", - clientId: "", -}); + clientId: "" + }); const client = new ResourceManagementClient(credential, subscriptionId); ``` ### JavaScript Bundle - To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). ## Key concepts diff --git a/sdk/resources/arm-resources/_meta.json b/sdk/resources/arm-resources/_meta.json index f127ba6214d8..c37acc89bcac 100644 --- a/sdk/resources/arm-resources/_meta.json +++ b/sdk/resources/arm-resources/_meta.json @@ -1,8 +1,8 @@ { - "commit": "35ace1532807c025b39eb837a5198115e3488f61", + "commit": "fcbc290cc06b0d69207105d83bb7dac49c21675b", "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.34 --generate-sample=true", + "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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/resources/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.19", - "use": "@autorest/typescript@6.0.34" -} \ No newline at end of file + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.26", + "use": "@autorest/typescript@^6.0.12" +} diff --git a/sdk/resources/arm-resources/api-extractor.json b/sdk/resources/arm-resources/api-extractor.json index 18c93cc719dc..7b3435425502 100644 --- a/sdk/resources/arm-resources/api-extractor.json +++ b/sdk/resources/arm-resources/api-extractor.json @@ -28,4 +28,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/resources/arm-resources/package.json b/sdk/resources/arm-resources/package.json index 5cf8d7f54963..1dc008895add 100644 --- a/sdk/resources/arm-resources/package.json +++ b/sdk/resources/arm-resources/package.json @@ -3,17 +3,17 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ResourceManagementClient.", - "version": "6.0.1", + "version": "7.0.0", "engines": { "node": ">=18.0.0" }, "dependencies": { "@azure/abort-controller": "^2.1.2", "@azure/core-auth": "^1.9.0", - "@azure/core-client": "^1.9.2", + "@azure/core-client": "^1.9.3", "@azure/core-lro": "^2.5.4", "@azure/core-paging": "^1.6.2", - "@azure/core-rest-pipeline": "^1.19.0", + "@azure/core-rest-pipeline": "^1.19.1", "tslib": "^2.8.1" }, "keywords": [ @@ -21,31 +21,30 @@ "azure", "typescript", "browser", - "isomorphic" + "isomorphic", + "cloud" ], "license": "MIT", "main": "./dist/commonjs/index.js", "module": "./dist/esm/index.js", "types": "./dist/commonjs/index.d.ts", + "type": "module", "devDependencies": { "@azure-tools/test-credential": "^2.0.0", "@azure-tools/test-recorder": "^4.1.0", "@azure-tools/test-utils-vitest": "^1.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.7.0", + "@azure/identity": "^4.9.1", "@azure/logger": "^1.1.4", "@types/node": "^18.0.0", "@vitest/browser": "^3.0.9", "@vitest/coverage-istanbul": "^3.0.9", "dotenv": "^16.0.0", - "playwright": "^1.50.1", + "playwright": "^1.52.0", "typescript": "~5.8.2", "vitest": "^3.0.9" }, - "repository": { - "type": "git", - "url": "https://github.com/Azure/azure-sdk-for-js.git" - }, + "repository": "github:Azure/azure-sdk-for-js", "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, @@ -62,16 +61,16 @@ "build:node": "echo skipped", "build:samples": "echo skipped.", "build:test": "echo skipped", - "check-format": "echo skipped", + "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", "clean": "dev-tool run vendored 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", + "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "integration-test:browser": "echo skipped", "integration-test:node": "dev-tool run test:vitest --esm", "lint": "echo skipped", - "minify": "echo skipped", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", "pack": "npm pack 2>&1", "prepack": "npm run build", "test": "npm run integration-test", @@ -92,16 +91,9 @@ ] }, "autoPublish": true, + "browser": "./dist/browser/index.js", + "react-native": "./dist/react-native/index.js", "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources/arm-resources", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-resources?view=azure-node-preview" - }, - "type": "module", "tshy": { "project": "./tsconfig.src.json", "exports": { @@ -118,8 +110,6 @@ ], "selfLink": false }, - "browser": "./dist/browser/index.js", - "react-native": "./dist/react-native/index.js", "exports": { "./package.json": "./package.json", ".": { @@ -141,4 +131,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/resources/arm-resources/review/arm-resources.api.md b/sdk/resources/arm-resources/review/arm-resources.api.md index 69b030a6d8ab..5f85a04a0388 100644 --- a/sdk/resources/arm-resources/review/arm-resources.api.md +++ b/sdk/resources/arm-resources/review/arm-resources.api.md @@ -60,770 +60,8 @@ export interface ApiProfile { } // @public -export interface BasicDependency { - id?: string; - resourceName?: string; - resourceType?: string; -} - -// @public -export type ChangeType = "Create" | "Delete" | "Ignore" | "Deploy" | "NoChange" | "Modify" | "Unsupported"; - -// @public -export interface CloudError { - error?: ErrorResponse; -} - -// @public -export interface DebugSetting { - detailLevel?: string; -} - -// @public -export interface Dependency { - dependsOn?: BasicDependency[]; - id?: string; - resourceName?: string; - resourceType?: string; -} - -// @public -export interface Deployment { - location?: string; - properties: DeploymentProperties; - tags?: { - [propertyName: string]: string; - }; -} - -// @public (undocumented) -export interface DeploymentDiagnosticsDefinition { - readonly additionalInfo?: ErrorAdditionalInfo[]; - readonly code: string; - readonly level: Level; - readonly message: string; - readonly target?: string; -} - -// @public -export interface DeploymentExportResult { - template?: Record; -} - -// @public -export interface DeploymentExtended { - readonly id?: string; - location?: string; - readonly name?: string; - properties?: DeploymentPropertiesExtended; - tags?: { - [propertyName: string]: string; - }; - readonly type?: string; -} - -// @public -export interface DeploymentExtendedFilter { - provisioningState?: string; -} - -// @public -export interface DeploymentListResult { - readonly nextLink?: string; - value?: DeploymentExtended[]; -} - -// @public -export type DeploymentMode = "Incremental" | "Complete"; - -// @public -export interface DeploymentOperation { - readonly id?: string; - readonly operationId?: string; - properties?: DeploymentOperationProperties; -} - -// @public -export interface DeploymentOperationProperties { - readonly duration?: string; - readonly provisioningOperation?: ProvisioningOperation; - readonly provisioningState?: string; - readonly request?: HttpMessage; - readonly response?: HttpMessage; - readonly serviceRequestId?: string; - readonly statusCode?: string; - readonly statusMessage?: StatusMessage; - readonly targetResource?: TargetResource; - readonly timestamp?: Date; -} - -// @public -export interface DeploymentOperations { - get(resourceGroupName: string, deploymentName: string, operationId: string, options?: DeploymentOperationsGetOptionalParams): Promise; - getAtManagementGroupScope(groupId: string, deploymentName: string, operationId: string, options?: DeploymentOperationsGetAtManagementGroupScopeOptionalParams): Promise; - getAtScope(scope: string, deploymentName: string, operationId: string, options?: DeploymentOperationsGetAtScopeOptionalParams): Promise; - getAtSubscriptionScope(deploymentName: string, operationId: string, options?: DeploymentOperationsGetAtSubscriptionScopeOptionalParams): Promise; - getAtTenantScope(deploymentName: string, operationId: string, options?: DeploymentOperationsGetAtTenantScopeOptionalParams): Promise; - list(resourceGroupName: string, deploymentName: string, options?: DeploymentOperationsListOptionalParams): PagedAsyncIterableIterator; - listAtManagementGroupScope(groupId: string, deploymentName: string, options?: DeploymentOperationsListAtManagementGroupScopeOptionalParams): PagedAsyncIterableIterator; - listAtScope(scope: string, deploymentName: string, options?: DeploymentOperationsListAtScopeOptionalParams): PagedAsyncIterableIterator; - listAtSubscriptionScope(deploymentName: string, options?: DeploymentOperationsListAtSubscriptionScopeOptionalParams): PagedAsyncIterableIterator; - listAtTenantScope(deploymentName: string, options?: DeploymentOperationsListAtTenantScopeOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface DeploymentOperationsGetAtManagementGroupScopeOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentOperationsGetAtManagementGroupScopeResponse = DeploymentOperation; - -// @public -export interface DeploymentOperationsGetAtScopeOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentOperationsGetAtScopeResponse = DeploymentOperation; - -// @public -export interface DeploymentOperationsGetAtSubscriptionScopeOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentOperationsGetAtSubscriptionScopeResponse = DeploymentOperation; - -// @public -export interface DeploymentOperationsGetAtTenantScopeOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentOperationsGetAtTenantScopeResponse = DeploymentOperation; - -// @public -export interface DeploymentOperationsGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentOperationsGetResponse = DeploymentOperation; - -// @public -export interface DeploymentOperationsListAtManagementGroupScopeNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentOperationsListAtManagementGroupScopeNextResponse = DeploymentOperationsListResult; - -// @public -export interface DeploymentOperationsListAtManagementGroupScopeOptionalParams extends coreClient.OperationOptions { - top?: number; -} - -// @public -export type DeploymentOperationsListAtManagementGroupScopeResponse = DeploymentOperationsListResult; - -// @public -export interface DeploymentOperationsListAtScopeNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentOperationsListAtScopeNextResponse = DeploymentOperationsListResult; - -// @public -export interface DeploymentOperationsListAtScopeOptionalParams extends coreClient.OperationOptions { - top?: number; -} - -// @public -export type DeploymentOperationsListAtScopeResponse = DeploymentOperationsListResult; - -// @public -export interface DeploymentOperationsListAtSubscriptionScopeNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentOperationsListAtSubscriptionScopeNextResponse = DeploymentOperationsListResult; - -// @public -export interface DeploymentOperationsListAtSubscriptionScopeOptionalParams extends coreClient.OperationOptions { - top?: number; -} - -// @public -export type DeploymentOperationsListAtSubscriptionScopeResponse = DeploymentOperationsListResult; - -// @public -export interface DeploymentOperationsListAtTenantScopeNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentOperationsListAtTenantScopeNextResponse = DeploymentOperationsListResult; - -// @public -export interface DeploymentOperationsListAtTenantScopeOptionalParams extends coreClient.OperationOptions { - top?: number; -} - -// @public -export type DeploymentOperationsListAtTenantScopeResponse = DeploymentOperationsListResult; - -// @public -export interface DeploymentOperationsListNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentOperationsListNextResponse = DeploymentOperationsListResult; - -// @public -export interface DeploymentOperationsListOptionalParams extends coreClient.OperationOptions { - top?: number; -} - -// @public -export type DeploymentOperationsListResponse = DeploymentOperationsListResult; - -// @public -export interface DeploymentOperationsListResult { - readonly nextLink?: string; - value?: DeploymentOperation[]; -} - -// @public -export interface DeploymentParameter { - reference?: KeyVaultParameterReference; - value?: any; -} - -// @public -export interface DeploymentProperties { - debugSetting?: DebugSetting; - expressionEvaluationOptions?: ExpressionEvaluationOptions; - mode: DeploymentMode; - onErrorDeployment?: OnErrorDeployment; - parameters?: { - [propertyName: string]: DeploymentParameter; - }; - parametersLink?: ParametersLink; - template?: Record; - templateLink?: TemplateLink; - validationLevel?: ValidationLevel; -} - -// @public -export interface DeploymentPropertiesExtended { - readonly correlationId?: string; - readonly debugSetting?: DebugSetting; - readonly dependencies?: Dependency[]; - readonly diagnostics?: DeploymentDiagnosticsDefinition[]; - readonly duration?: string; - readonly error?: ErrorResponse; - readonly mode?: DeploymentMode; - readonly onErrorDeployment?: OnErrorDeploymentExtended; - readonly outputResources?: ResourceReference[]; - readonly outputs?: Record; - readonly parameters?: Record; - readonly parametersLink?: ParametersLink; - readonly providers?: Provider[]; - readonly provisioningState?: ProvisioningState; - readonly templateHash?: string; - readonly templateLink?: TemplateLink; - readonly timestamp?: Date; - readonly validatedResources?: ResourceReference[]; - validationLevel?: ValidationLevel; -} - -// @public -export interface Deployments { - beginCreateOrUpdate(resourceGroupName: string, deploymentName: string, parameters: Deployment, options?: DeploymentsCreateOrUpdateOptionalParams): Promise, DeploymentsCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, deploymentName: string, parameters: Deployment, options?: DeploymentsCreateOrUpdateOptionalParams): Promise; - beginCreateOrUpdateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: ScopedDeployment, options?: DeploymentsCreateOrUpdateAtManagementGroupScopeOptionalParams): Promise, DeploymentsCreateOrUpdateAtManagementGroupScopeResponse>>; - beginCreateOrUpdateAtManagementGroupScopeAndWait(groupId: string, deploymentName: string, parameters: ScopedDeployment, options?: DeploymentsCreateOrUpdateAtManagementGroupScopeOptionalParams): Promise; - beginCreateOrUpdateAtScope(scope: string, deploymentName: string, parameters: Deployment, options?: DeploymentsCreateOrUpdateAtScopeOptionalParams): Promise, DeploymentsCreateOrUpdateAtScopeResponse>>; - beginCreateOrUpdateAtScopeAndWait(scope: string, deploymentName: string, parameters: Deployment, options?: DeploymentsCreateOrUpdateAtScopeOptionalParams): Promise; - beginCreateOrUpdateAtSubscriptionScope(deploymentName: string, parameters: Deployment, options?: DeploymentsCreateOrUpdateAtSubscriptionScopeOptionalParams): Promise, DeploymentsCreateOrUpdateAtSubscriptionScopeResponse>>; - beginCreateOrUpdateAtSubscriptionScopeAndWait(deploymentName: string, parameters: Deployment, options?: DeploymentsCreateOrUpdateAtSubscriptionScopeOptionalParams): Promise; - beginCreateOrUpdateAtTenantScope(deploymentName: string, parameters: ScopedDeployment, options?: DeploymentsCreateOrUpdateAtTenantScopeOptionalParams): Promise, DeploymentsCreateOrUpdateAtTenantScopeResponse>>; - beginCreateOrUpdateAtTenantScopeAndWait(deploymentName: string, parameters: ScopedDeployment, options?: DeploymentsCreateOrUpdateAtTenantScopeOptionalParams): Promise; - beginDelete(resourceGroupName: string, deploymentName: string, options?: DeploymentsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, deploymentName: string, options?: DeploymentsDeleteOptionalParams): Promise; - beginDeleteAtManagementGroupScope(groupId: string, deploymentName: string, options?: DeploymentsDeleteAtManagementGroupScopeOptionalParams): Promise, void>>; - beginDeleteAtManagementGroupScopeAndWait(groupId: string, deploymentName: string, options?: DeploymentsDeleteAtManagementGroupScopeOptionalParams): Promise; - beginDeleteAtScope(scope: string, deploymentName: string, options?: DeploymentsDeleteAtScopeOptionalParams): Promise, void>>; - beginDeleteAtScopeAndWait(scope: string, deploymentName: string, options?: DeploymentsDeleteAtScopeOptionalParams): Promise; - beginDeleteAtSubscriptionScope(deploymentName: string, options?: DeploymentsDeleteAtSubscriptionScopeOptionalParams): Promise, void>>; - beginDeleteAtSubscriptionScopeAndWait(deploymentName: string, options?: DeploymentsDeleteAtSubscriptionScopeOptionalParams): Promise; - beginDeleteAtTenantScope(deploymentName: string, options?: DeploymentsDeleteAtTenantScopeOptionalParams): Promise, void>>; - beginDeleteAtTenantScopeAndWait(deploymentName: string, options?: DeploymentsDeleteAtTenantScopeOptionalParams): Promise; - beginValidate(resourceGroupName: string, deploymentName: string, parameters: Deployment, options?: DeploymentsValidateOptionalParams): Promise, DeploymentsValidateResponse>>; - beginValidateAndWait(resourceGroupName: string, deploymentName: string, parameters: Deployment, options?: DeploymentsValidateOptionalParams): Promise; - beginValidateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: ScopedDeployment, options?: DeploymentsValidateAtManagementGroupScopeOptionalParams): Promise, DeploymentsValidateAtManagementGroupScopeResponse>>; - beginValidateAtManagementGroupScopeAndWait(groupId: string, deploymentName: string, parameters: ScopedDeployment, options?: DeploymentsValidateAtManagementGroupScopeOptionalParams): Promise; - beginValidateAtScope(scope: string, deploymentName: string, parameters: Deployment, options?: DeploymentsValidateAtScopeOptionalParams): Promise, DeploymentsValidateAtScopeResponse>>; - beginValidateAtScopeAndWait(scope: string, deploymentName: string, parameters: Deployment, options?: DeploymentsValidateAtScopeOptionalParams): Promise; - beginValidateAtSubscriptionScope(deploymentName: string, parameters: Deployment, options?: DeploymentsValidateAtSubscriptionScopeOptionalParams): Promise, DeploymentsValidateAtSubscriptionScopeResponse>>; - beginValidateAtSubscriptionScopeAndWait(deploymentName: string, parameters: Deployment, options?: DeploymentsValidateAtSubscriptionScopeOptionalParams): Promise; - beginValidateAtTenantScope(deploymentName: string, parameters: ScopedDeployment, options?: DeploymentsValidateAtTenantScopeOptionalParams): Promise, DeploymentsValidateAtTenantScopeResponse>>; - beginValidateAtTenantScopeAndWait(deploymentName: string, parameters: ScopedDeployment, options?: DeploymentsValidateAtTenantScopeOptionalParams): Promise; - beginWhatIf(resourceGroupName: string, deploymentName: string, parameters: DeploymentWhatIf, options?: DeploymentsWhatIfOptionalParams): Promise, DeploymentsWhatIfResponse>>; - beginWhatIfAndWait(resourceGroupName: string, deploymentName: string, parameters: DeploymentWhatIf, options?: DeploymentsWhatIfOptionalParams): Promise; - beginWhatIfAtManagementGroupScope(groupId: string, deploymentName: string, parameters: ScopedDeploymentWhatIf, options?: DeploymentsWhatIfAtManagementGroupScopeOptionalParams): Promise, DeploymentsWhatIfAtManagementGroupScopeResponse>>; - beginWhatIfAtManagementGroupScopeAndWait(groupId: string, deploymentName: string, parameters: ScopedDeploymentWhatIf, options?: DeploymentsWhatIfAtManagementGroupScopeOptionalParams): Promise; - beginWhatIfAtSubscriptionScope(deploymentName: string, parameters: DeploymentWhatIf, options?: DeploymentsWhatIfAtSubscriptionScopeOptionalParams): Promise, DeploymentsWhatIfAtSubscriptionScopeResponse>>; - beginWhatIfAtSubscriptionScopeAndWait(deploymentName: string, parameters: DeploymentWhatIf, options?: DeploymentsWhatIfAtSubscriptionScopeOptionalParams): Promise; - beginWhatIfAtTenantScope(deploymentName: string, parameters: ScopedDeploymentWhatIf, options?: DeploymentsWhatIfAtTenantScopeOptionalParams): Promise, DeploymentsWhatIfAtTenantScopeResponse>>; - beginWhatIfAtTenantScopeAndWait(deploymentName: string, parameters: ScopedDeploymentWhatIf, options?: DeploymentsWhatIfAtTenantScopeOptionalParams): Promise; - calculateTemplateHash(template: Record, options?: DeploymentsCalculateTemplateHashOptionalParams): Promise; - cancel(resourceGroupName: string, deploymentName: string, options?: DeploymentsCancelOptionalParams): Promise; - cancelAtManagementGroupScope(groupId: string, deploymentName: string, options?: DeploymentsCancelAtManagementGroupScopeOptionalParams): Promise; - cancelAtScope(scope: string, deploymentName: string, options?: DeploymentsCancelAtScopeOptionalParams): Promise; - cancelAtSubscriptionScope(deploymentName: string, options?: DeploymentsCancelAtSubscriptionScopeOptionalParams): Promise; - cancelAtTenantScope(deploymentName: string, options?: DeploymentsCancelAtTenantScopeOptionalParams): Promise; - checkExistence(resourceGroupName: string, deploymentName: string, options?: DeploymentsCheckExistenceOptionalParams): Promise; - checkExistenceAtManagementGroupScope(groupId: string, deploymentName: string, options?: DeploymentsCheckExistenceAtManagementGroupScopeOptionalParams): Promise; - checkExistenceAtScope(scope: string, deploymentName: string, options?: DeploymentsCheckExistenceAtScopeOptionalParams): Promise; - checkExistenceAtSubscriptionScope(deploymentName: string, options?: DeploymentsCheckExistenceAtSubscriptionScopeOptionalParams): Promise; - checkExistenceAtTenantScope(deploymentName: string, options?: DeploymentsCheckExistenceAtTenantScopeOptionalParams): Promise; - exportTemplate(resourceGroupName: string, deploymentName: string, options?: DeploymentsExportTemplateOptionalParams): Promise; - exportTemplateAtManagementGroupScope(groupId: string, deploymentName: string, options?: DeploymentsExportTemplateAtManagementGroupScopeOptionalParams): Promise; - exportTemplateAtScope(scope: string, deploymentName: string, options?: DeploymentsExportTemplateAtScopeOptionalParams): Promise; - exportTemplateAtSubscriptionScope(deploymentName: string, options?: DeploymentsExportTemplateAtSubscriptionScopeOptionalParams): Promise; - exportTemplateAtTenantScope(deploymentName: string, options?: DeploymentsExportTemplateAtTenantScopeOptionalParams): Promise; - get(resourceGroupName: string, deploymentName: string, options?: DeploymentsGetOptionalParams): Promise; - getAtManagementGroupScope(groupId: string, deploymentName: string, options?: DeploymentsGetAtManagementGroupScopeOptionalParams): Promise; - getAtScope(scope: string, deploymentName: string, options?: DeploymentsGetAtScopeOptionalParams): Promise; - getAtSubscriptionScope(deploymentName: string, options?: DeploymentsGetAtSubscriptionScopeOptionalParams): Promise; - getAtTenantScope(deploymentName: string, options?: DeploymentsGetAtTenantScopeOptionalParams): Promise; - listAtManagementGroupScope(groupId: string, options?: DeploymentsListAtManagementGroupScopeOptionalParams): PagedAsyncIterableIterator; - listAtScope(scope: string, options?: DeploymentsListAtScopeOptionalParams): PagedAsyncIterableIterator; - listAtSubscriptionScope(options?: DeploymentsListAtSubscriptionScopeOptionalParams): PagedAsyncIterableIterator; - listAtTenantScope(options?: DeploymentsListAtTenantScopeOptionalParams): PagedAsyncIterableIterator; - listByResourceGroup(resourceGroupName: string, options?: DeploymentsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface DeploymentsCalculateTemplateHashOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentsCalculateTemplateHashResponse = TemplateHashResult; - -// @public -export interface DeploymentsCancelAtManagementGroupScopeOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface DeploymentsCancelAtScopeOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface DeploymentsCancelAtSubscriptionScopeOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface DeploymentsCancelAtTenantScopeOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface DeploymentsCancelOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface DeploymentsCheckExistenceAtManagementGroupScopeOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentsCheckExistenceAtManagementGroupScopeResponse = { - body: boolean; -}; - -// @public -export interface DeploymentsCheckExistenceAtScopeOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentsCheckExistenceAtScopeResponse = { - body: boolean; -}; - -// @public -export interface DeploymentsCheckExistenceAtSubscriptionScopeOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentsCheckExistenceAtSubscriptionScopeResponse = { - body: boolean; -}; - -// @public -export interface DeploymentsCheckExistenceAtTenantScopeOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentsCheckExistenceAtTenantScopeResponse = { - body: boolean; -}; - -// @public -export interface DeploymentsCheckExistenceOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentsCheckExistenceResponse = { - body: boolean; -}; - -// @public -export interface DeploymentsCreateOrUpdateAtManagementGroupScopeOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type DeploymentsCreateOrUpdateAtManagementGroupScopeResponse = DeploymentExtended; - -// @public -export interface DeploymentsCreateOrUpdateAtScopeOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type DeploymentsCreateOrUpdateAtScopeResponse = DeploymentExtended; - -// @public -export interface DeploymentsCreateOrUpdateAtSubscriptionScopeOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type DeploymentsCreateOrUpdateAtSubscriptionScopeResponse = DeploymentExtended; - -// @public -export interface DeploymentsCreateOrUpdateAtTenantScopeOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type DeploymentsCreateOrUpdateAtTenantScopeResponse = DeploymentExtended; - -// @public -export interface DeploymentsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type DeploymentsCreateOrUpdateResponse = DeploymentExtended; - -// @public -export interface DeploymentsDeleteAtManagementGroupScopeOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export interface DeploymentsDeleteAtScopeOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export interface DeploymentsDeleteAtSubscriptionScopeOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export interface DeploymentsDeleteAtTenantScopeOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export interface DeploymentsDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export interface DeploymentsExportTemplateAtManagementGroupScopeOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentsExportTemplateAtManagementGroupScopeResponse = DeploymentExportResult; - -// @public -export interface DeploymentsExportTemplateAtScopeOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentsExportTemplateAtScopeResponse = DeploymentExportResult; - -// @public -export interface DeploymentsExportTemplateAtSubscriptionScopeOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentsExportTemplateAtSubscriptionScopeResponse = DeploymentExportResult; - -// @public -export interface DeploymentsExportTemplateAtTenantScopeOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentsExportTemplateAtTenantScopeResponse = DeploymentExportResult; - -// @public -export interface DeploymentsExportTemplateOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentsExportTemplateResponse = DeploymentExportResult; - -// @public -export interface DeploymentsGetAtManagementGroupScopeOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentsGetAtManagementGroupScopeResponse = DeploymentExtended; - -// @public -export interface DeploymentsGetAtScopeOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentsGetAtScopeResponse = DeploymentExtended; - -// @public -export interface DeploymentsGetAtSubscriptionScopeOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentsGetAtSubscriptionScopeResponse = DeploymentExtended; - -// @public -export interface DeploymentsGetAtTenantScopeOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentsGetAtTenantScopeResponse = DeploymentExtended; - -// @public -export interface DeploymentsGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentsGetResponse = DeploymentExtended; - -// @public -export interface DeploymentsListAtManagementGroupScopeNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentsListAtManagementGroupScopeNextResponse = DeploymentListResult; - -// @public -export interface DeploymentsListAtManagementGroupScopeOptionalParams extends coreClient.OperationOptions { - filter?: string; - top?: number; -} - -// @public -export type DeploymentsListAtManagementGroupScopeResponse = DeploymentListResult; - -// @public -export interface DeploymentsListAtScopeNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentsListAtScopeNextResponse = DeploymentListResult; - -// @public -export interface DeploymentsListAtScopeOptionalParams extends coreClient.OperationOptions { - filter?: string; - top?: number; -} - -// @public -export type DeploymentsListAtScopeResponse = DeploymentListResult; - -// @public -export interface DeploymentsListAtSubscriptionScopeNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentsListAtSubscriptionScopeNextResponse = DeploymentListResult; - -// @public -export interface DeploymentsListAtSubscriptionScopeOptionalParams extends coreClient.OperationOptions { - filter?: string; - top?: number; -} - -// @public -export type DeploymentsListAtSubscriptionScopeResponse = DeploymentListResult; - -// @public -export interface DeploymentsListAtTenantScopeNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentsListAtTenantScopeNextResponse = DeploymentListResult; - -// @public -export interface DeploymentsListAtTenantScopeOptionalParams extends coreClient.OperationOptions { - filter?: string; - top?: number; -} - -// @public -export type DeploymentsListAtTenantScopeResponse = DeploymentListResult; - -// @public -export interface DeploymentsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DeploymentsListByResourceGroupNextResponse = DeploymentListResult; - -// @public -export interface DeploymentsListByResourceGroupOptionalParams extends coreClient.OperationOptions { - filter?: string; - top?: number; -} - -// @public -export type DeploymentsListByResourceGroupResponse = DeploymentListResult; - -// @public -export interface DeploymentsValidateAtManagementGroupScopeOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type DeploymentsValidateAtManagementGroupScopeResponse = DeploymentValidateResult; - -// @public -export interface DeploymentsValidateAtScopeOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type DeploymentsValidateAtScopeResponse = DeploymentValidateResult; - -// @public -export interface DeploymentsValidateAtSubscriptionScopeOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type DeploymentsValidateAtSubscriptionScopeResponse = DeploymentValidateResult; - -// @public -export interface DeploymentsValidateAtTenantScopeOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type DeploymentsValidateAtTenantScopeResponse = DeploymentValidateResult; - -// @public -export interface DeploymentsValidateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type DeploymentsValidateResponse = DeploymentValidateResult; - -// @public -export interface DeploymentsWhatIfAtManagementGroupScopeHeaders { - location?: string; - retryAfter?: string; -} - -// @public -export interface DeploymentsWhatIfAtManagementGroupScopeOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type DeploymentsWhatIfAtManagementGroupScopeResponse = WhatIfOperationResult; - -// @public -export interface DeploymentsWhatIfAtSubscriptionScopeHeaders { - location?: string; - retryAfter?: string; -} - -// @public -export interface DeploymentsWhatIfAtSubscriptionScopeOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type DeploymentsWhatIfAtSubscriptionScopeResponse = WhatIfOperationResult; - -// @public -export interface DeploymentsWhatIfAtTenantScopeHeaders { - location?: string; - retryAfter?: string; -} - -// @public -export interface DeploymentsWhatIfAtTenantScopeOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type DeploymentsWhatIfAtTenantScopeResponse = WhatIfOperationResult; - -// @public -export interface DeploymentsWhatIfHeaders { - location?: string; - retryAfter?: string; -} - -// @public -export interface DeploymentsWhatIfOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type DeploymentsWhatIfResponse = WhatIfOperationResult; - -// @public -export interface DeploymentValidateResult { - readonly error?: ErrorResponse; - readonly id?: string; - readonly name?: string; - properties?: DeploymentPropertiesExtended; - readonly type?: string; -} - -// @public -export interface DeploymentWhatIf { - location?: string; - properties: DeploymentWhatIfProperties; -} - -// @public -export interface DeploymentWhatIfProperties extends DeploymentProperties { - whatIfSettings?: DeploymentWhatIfSettings; -} - -// @public -export interface DeploymentWhatIfSettings { - resultFormat?: WhatIfResultFormat; +export interface CloudError { + error?: ErrorResponse; } // @public @@ -851,14 +89,6 @@ export interface ExportTemplateRequest { resources?: string[]; } -// @public -export interface ExpressionEvaluationOptions { - scope?: ExpressionEvaluationOptionsScopeType; -} - -// @public -export type ExpressionEvaluationOptionsScopeType = string; - // @public export interface ExtendedLocation { name?: string; @@ -895,11 +125,6 @@ export interface GenericResourceFilter { // @public export function getContinuationToken(page: unknown): string | undefined; -// @public -export interface HttpMessage { - content?: Record; -} - // @public export interface Identity { readonly principalId?: string; @@ -916,18 +141,6 @@ export interface IdentityUserAssignedIdentitiesValue { readonly principalId?: string; } -// @public -export interface KeyVaultParameterReference { - keyVault: KeyVaultReference; - secretName: string; - secretVersion?: string; -} - -// @public -export interface KeyVaultReference { - id: string; -} - // @public export enum KnownAliasPathAttributes { Modifiable = "Modifiable", @@ -952,25 +165,11 @@ export enum KnownExportTemplateOutputFormat { Json = "Json" } -// @public -export enum KnownExpressionEvaluationOptionsScopeType { - Inner = "Inner", - NotSpecified = "NotSpecified", - Outer = "Outer" -} - // @public export enum KnownExtendedLocationType { EdgeZone = "EdgeZone" } -// @public -export enum KnownLevel { - Error = "Error", - Info = "Info", - Warning = "Warning" -} - // @public export enum KnownProviderAuthorizationConsentState { Consented = "Consented", @@ -979,22 +178,6 @@ export enum KnownProviderAuthorizationConsentState { Required = "Required" } -// @public -export enum KnownProvisioningState { - Accepted = "Accepted", - Canceled = "Canceled", - Created = "Created", - Creating = "Creating", - Deleted = "Deleted", - Deleting = "Deleting", - Failed = "Failed", - NotSpecified = "NotSpecified", - Ready = "Ready", - Running = "Running", - Succeeded = "Succeeded", - Updating = "Updating" -} - // @public export enum KnownTagsPatchOperation { Delete = "Delete", @@ -1002,32 +185,6 @@ export enum KnownTagsPatchOperation { Replace = "Replace" } -// @public -export enum KnownValidationLevel { - Provider = "Provider", - ProviderNoRbac = "ProviderNoRbac", - Template = "Template" -} - -// @public -export type Level = string; - -// @public -export interface OnErrorDeployment { - deploymentName?: string; - type?: OnErrorDeploymentType; -} - -// @public -export interface OnErrorDeploymentExtended { - deploymentName?: string; - readonly provisioningState?: string; - type?: OnErrorDeploymentType; -} - -// @public -export type OnErrorDeploymentType = "LastSuccessful" | "SpecificDeployment"; - // @public export interface Operation { display?: OperationDisplay; @@ -1067,12 +224,6 @@ export interface OperationsListOptionalParams extends coreClient.OperationOption // @public export type OperationsListResponse = OperationListResult; -// @public -export interface ParametersLink { - contentVersion?: string; - uri: string; -} - // @public export interface Permission { actions?: string[]; @@ -1090,9 +241,6 @@ export interface Plan { version?: string; } -// @public -export type PropertyChangeType = "Create" | "Delete" | "Modify" | "Array" | "NoEffect"; - // @public export interface Provider { readonly id?: string; @@ -1263,12 +411,6 @@ export interface ProvidersUnregisterOptionalParams extends coreClient.OperationO // @public export type ProvidersUnregisterResponse = Provider; -// @public -export type ProvisioningOperation = "NotSpecified" | "Create" | "Delete" | "Waiting" | "AzureAsyncOperationWaiting" | "ResourceCacheWaiting" | "Action" | "Read" | "EvaluateDeploymentOutput" | "DeploymentCleanup"; - -// @public -export type ProvisioningState = string; - // @public export interface Resource { extendedLocation?: ExtendedLocation; @@ -1426,10 +568,6 @@ export class ResourceManagementClient extends coreClient.ServiceClient { // (undocumented) apiVersion: string; // (undocumented) - deploymentOperations: DeploymentOperations; - // (undocumented) - deployments: Deployments; - // (undocumented) operations: Operations; // (undocumented) providerResourceTypes: ProviderResourceTypes; @@ -1461,11 +599,6 @@ export interface ResourceProviderOperationDisplayProperties { resource?: string; } -// @public -export interface ResourceReference { - readonly id?: string; -} - // @public export interface Resources { beginCreateOrUpdate(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, parameters: GenericResource, options?: ResourcesCreateOrUpdateOptionalParams): Promise, ResourcesCreateOrUpdateResponse>>; @@ -1633,21 +766,6 @@ export interface RoleDefinition { scopes?: string[]; } -// @public -export interface ScopedDeployment { - location: string; - properties: DeploymentProperties; - tags?: { - [propertyName: string]: string; - }; -} - -// @public -export interface ScopedDeploymentWhatIf { - location: string; - properties: DeploymentWhatIfProperties; -} - // @public export interface Sku { capacity?: number; @@ -1658,12 +776,6 @@ export interface Sku { tier?: string; } -// @public -export interface StatusMessage { - error?: ErrorResponse; - status?: string; -} - // @public export interface SubResource { id?: string; @@ -1818,65 +930,6 @@ export interface TagValue { tagValue?: string; } -// @public -export interface TargetResource { - id?: string; - resourceName?: string; - resourceType?: string; -} - -// @public -export interface TemplateHashResult { - minifiedTemplate?: string; - templateHash?: string; -} - -// @public -export interface TemplateLink { - contentVersion?: string; - id?: string; - queryString?: string; - relativePath?: string; - uri?: string; -} - -// @public -export type ValidationLevel = string; - -// @public -export interface WhatIfChange { - after?: Record; - before?: Record; - changeType: ChangeType; - delta?: WhatIfPropertyChange[]; - deploymentId?: string; - identifiers?: Record; - resourceId?: string; - symbolicName?: string; - unsupportedReason?: string; -} - -// @public -export interface WhatIfOperationResult { - changes?: WhatIfChange[]; - readonly diagnostics?: DeploymentDiagnosticsDefinition[]; - error?: ErrorResponse; - potentialChanges?: WhatIfChange[]; - status?: string; -} - -// @public -export interface WhatIfPropertyChange { - after?: Record; - before?: Record; - children?: WhatIfPropertyChange[]; - path: string; - propertyChangeType: PropertyChangeType; -} - -// @public -export type WhatIfResultFormat = "ResourceIdOnly" | "FullResourcePayloads"; - // @public (undocumented) export interface ZoneMapping { location?: string; diff --git a/sdk/resources/arm-resources/src/lroImpl.ts b/sdk/resources/arm-resources/src/lroImpl.ts index 5f88efab981b..1b3a95e6c540 100644 --- a/sdk/resources/arm-resources/src/lroImpl.ts +++ b/sdk/resources/arm-resources/src/lroImpl.ts @@ -6,9 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - import { AbortSignalLike } from "@azure/abort-controller"; import { LongRunningOperation, LroResponse } from "@azure/core-lro"; @@ -26,10 +23,7 @@ export function createLroSpec(inputs: { requestMethod: spec.httpMethod, requestPath: spec.path!, sendInitialRequest: () => sendOperationFn(args, spec), - sendPollRequest: ( - path: string, - options?: { abortSignal?: AbortSignalLike }, - ) => { + sendPollRequest: (path: string, options?: { abortSignal?: AbortSignalLike }) => { const { requestBody, ...restSpec } = spec; return sendOperationFn(args, { ...restSpec, diff --git a/sdk/resources/arm-resources/src/models/index.ts b/sdk/resources/arm-resources/src/models/index.ts index 251f14eabc5e..9097231cf1b9 100644 --- a/sdk/resources/arm-resources/src/models/index.ts +++ b/sdk/resources/arm-resources/src/models/index.ts @@ -85,225 +85,6 @@ export interface ErrorAdditionalInfo { readonly info?: Record; } -/** Deployment operation parameters. */ -export interface Deployment { - /** The location to store the deployment data. */ - location?: string; - /** The deployment properties. */ - properties: DeploymentProperties; - /** Deployment tags */ - tags?: { [propertyName: string]: string }; -} - -/** Deployment properties. */ -export interface DeploymentProperties { - /** The template content. You use this element when you want to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the template property, but not both. */ - template?: Record; - /** The URI of the template. Use either the templateLink property or the template property, but not both. */ - templateLink?: TemplateLink; - /** Name and value pairs that define the deployment parameters for the template. You use this element when you want to provide the parameter values directly in the request rather than link to an existing parameter file. Use either the parametersLink property or the parameters property, but not both. It can be a JObject or a well formed JSON string. */ - parameters?: { [propertyName: string]: DeploymentParameter }; - /** The URI of parameters file. You use this element to link to an existing parameters file. Use either the parametersLink property or the parameters property, but not both. */ - parametersLink?: ParametersLink; - /** The mode that is used to deploy resources. This value can be either Incremental or Complete. In Incremental mode, resources are deployed without deleting existing resources that are not included in the template. In Complete mode, resources are deployed and existing resources in the resource group that are not included in the template are deleted. Be careful when using Complete mode as you may unintentionally delete resources. */ - mode: DeploymentMode; - /** The debug setting of the deployment. */ - debugSetting?: DebugSetting; - /** The deployment on error behavior. */ - onErrorDeployment?: OnErrorDeployment; - /** Specifies whether template expressions are evaluated within the scope of the parent template or nested template. Only applicable to nested templates. If not specified, default value is outer. */ - expressionEvaluationOptions?: ExpressionEvaluationOptions; - /** The validation level of the deployment */ - validationLevel?: ValidationLevel; -} - -/** Entity representing the reference to the template. */ -export interface TemplateLink { - /** The URI of the template to deploy. Use either the uri or id property, but not both. */ - uri?: string; - /** The resource id of a Template Spec. Use either the id or uri property, but not both. */ - id?: string; - /** The relativePath property can be used to deploy a linked template at a location relative to the parent. If the parent template was linked with a TemplateSpec, this will reference an artifact in the TemplateSpec. If the parent was linked with a URI, the child deployment will be a combination of the parent and relativePath URIs */ - relativePath?: string; - /** If included, must match the ContentVersion in the template. */ - contentVersion?: string; - /** The query string (for example, a SAS token) to be used with the templateLink URI. */ - queryString?: string; -} - -/** Deployment parameter for the template. */ -export interface DeploymentParameter { - /** Input value to the parameter . */ - value?: any; - /** 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 resource id. */ - id: string; -} - -/** Entity representing the reference to the deployment parameters. */ -export interface ParametersLink { - /** The URI of the parameters file. */ - uri: string; - /** If included, must match the ContentVersion in the template. */ - contentVersion?: string; -} - -/** The debug setting. */ -export interface DebugSetting { - /** Specifies the type of information to log for debugging. The permitted values are none, requestContent, responseContent, or both requestContent and responseContent separated by a comma. The default is none. When setting this value, carefully consider the type of information you are passing in during deployment. By logging information about the request or response, you could potentially expose sensitive data that is retrieved through the deployment operations. */ - detailLevel?: string; -} - -/** Deployment on error behavior. */ -export interface OnErrorDeployment { - /** The deployment on error behavior type. Possible values are LastSuccessful and SpecificDeployment. */ - type?: OnErrorDeploymentType; - /** The deployment to be used on error case. */ - deploymentName?: string; -} - -/** Specifies whether template expressions are evaluated within the scope of the parent template or nested template. */ -export interface ExpressionEvaluationOptions { - /** The scope to be used for evaluation of parameters, variables and functions in a nested template. */ - scope?: ExpressionEvaluationOptionsScopeType; -} - -/** Deployment information. */ -export interface DeploymentExtended { - /** - * The ID of the deployment. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * The name of the deployment. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The type of the deployment. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** the location of the deployment. */ - location?: string; - /** Deployment properties. */ - properties?: DeploymentPropertiesExtended; - /** Deployment tags */ - tags?: { [propertyName: string]: string }; -} - -/** Deployment properties with additional details. */ -export interface DeploymentPropertiesExtended { - /** - * Denotes the state of provisioning. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningState; - /** - * The correlation ID of the deployment. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly correlationId?: string; - /** - * The timestamp of the template deployment. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly timestamp?: Date; - /** - * The duration of the template deployment. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly duration?: string; - /** - * Key/value pairs that represent deployment output. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly outputs?: Record; - /** - * The list of resource providers needed for the deployment. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly providers?: Provider[]; - /** - * The list of deployment dependencies. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly dependencies?: Dependency[]; - /** - * The URI referencing the template. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly templateLink?: TemplateLink; - /** - * Deployment parameters. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly parameters?: Record; - /** - * The URI referencing the parameters. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly parametersLink?: ParametersLink; - /** - * The deployment mode. Possible values are Incremental and Complete. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly mode?: DeploymentMode; - /** - * The debug setting of the deployment. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly debugSetting?: DebugSetting; - /** - * The deployment on error behavior. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly onErrorDeployment?: OnErrorDeploymentExtended; - /** - * The hash produced for the template. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly templateHash?: string; - /** - * Array of provisioned resources. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly outputResources?: ResourceReference[]; - /** - * Array of validated resources. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly validatedResources?: ResourceReference[]; - /** - * The deployment error. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly error?: ErrorResponse; - /** - * Contains diagnostic information collected during validation process. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly diagnostics?: DeploymentDiagnosticsDefinition[]; - /** The validation level of the deployment */ - validationLevel?: ValidationLevel; -} - /** Resource provider information. */ export interface Provider { /** @@ -447,206 +228,6 @@ export interface ApiProfile { readonly apiVersion?: string; } -/** Deployment dependency information. */ -export interface Dependency { - /** The list of dependencies. */ - dependsOn?: BasicDependency[]; - /** The ID of the dependency. */ - id?: string; - /** The dependency resource type. */ - resourceType?: string; - /** The dependency resource name. */ - resourceName?: string; -} - -/** Deployment dependency information. */ -export interface BasicDependency { - /** The ID of the dependency. */ - id?: string; - /** The dependency resource type. */ - resourceType?: string; - /** The dependency resource name. */ - resourceName?: string; -} - -/** Deployment on error behavior with additional details. */ -export interface OnErrorDeploymentExtended { - /** - * The state of the provisioning for the on error deployment. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** The deployment on error behavior type. Possible values are LastSuccessful and SpecificDeployment. */ - type?: OnErrorDeploymentType; - /** The deployment to be used on error case. */ - deploymentName?: string; -} - -/** The resource Id model. */ -export interface ResourceReference { - /** - * The fully qualified resource Id. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; -} - -export interface DeploymentDiagnosticsDefinition { - /** - * Denotes the additional response level. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly level: Level; - /** - * 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 additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly additionalInfo?: ErrorAdditionalInfo[]; -} - -/** Information from validate template deployment response. */ -export interface DeploymentValidateResult { - /** - * The deployment validation error. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly error?: ErrorResponse; - /** - * The ID of the deployment. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * The name of the deployment. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The type of the deployment. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** The template deployment properties. */ - properties?: DeploymentPropertiesExtended; -} - -/** The deployment export result. */ -export interface DeploymentExportResult { - /** The template content. */ - template?: Record; -} - -/** List of deployments. */ -export interface DeploymentListResult { - /** An array of deployments. */ - value?: DeploymentExtended[]; - /** - * The 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; -} - -/** Deployment operation parameters. */ -export interface ScopedDeployment { - /** The location to store the deployment data. */ - location: string; - /** The deployment properties. */ - properties: DeploymentProperties; - /** Deployment tags */ - tags?: { [propertyName: string]: string }; -} - -/** Deployment What-if operation parameters. */ -export interface ScopedDeploymentWhatIf { - /** The location to store the deployment data. */ - location: string; - /** The deployment properties. */ - properties: DeploymentWhatIfProperties; -} - -/** Deployment What-If operation settings. */ -export interface DeploymentWhatIfSettings { - /** The format of the What-If results */ - resultFormat?: WhatIfResultFormat; -} - -/** Result of the What-If operation. Contains a list of predicted changes and a URL link to get to the next set of results. */ -export interface WhatIfOperationResult { - /** Status of the What-If operation. */ - status?: string; - /** Error when What-If operation fails. */ - error?: ErrorResponse; - /** List of resource changes predicted by What-If operation. */ - changes?: WhatIfChange[]; - /** List of resource changes predicted by What-If operation. */ - potentialChanges?: WhatIfChange[]; - /** - * List of resource diagnostics detected by What-If operation. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly diagnostics?: DeploymentDiagnosticsDefinition[]; -} - -/** Information about a single resource change predicted by What-If operation. */ -export interface WhatIfChange { - /** Resource ID */ - resourceId?: string; - /** The resource id of the Deployment responsible for this change. */ - deploymentId?: string; - /** The symbolic name of the resource responsible for this change. */ - symbolicName?: string; - /** A subset of properties that uniquely identify a Bicep extensible resource because it lacks a resource id like an Azure resource has. */ - identifiers?: Record; - /** Type of change that will be made to the resource when the deployment is executed. */ - changeType: ChangeType; - /** The explanation about why the resource is unsupported by What-If. */ - unsupportedReason?: string; - /** The snapshot of the resource before the deployment is executed. */ - before?: Record; - /** The predicted snapshot of the resource after the deployment is executed. */ - after?: Record; - /** The predicted changes to resource properties. */ - delta?: WhatIfPropertyChange[]; -} - -/** The predicted change to the resource property. */ -export interface WhatIfPropertyChange { - /** The path of the property. */ - path: string; - /** The type of property change. */ - propertyChangeType: PropertyChangeType; - /** The value of the property before the deployment is executed. */ - before?: Record; - /** The value of the property after the deployment is executed. */ - after?: Record; - /** Nested property changes. */ - children?: WhatIfPropertyChange[]; -} - -/** Deployment What-if operation parameters. */ -export interface DeploymentWhatIf { - /** The location to store the deployment data. */ - location?: string; - /** The deployment properties. */ - properties: DeploymentWhatIfProperties; -} - /** List of provider permissions. */ export interface ProviderPermissionListResult { /** An array of provider permissions. */ @@ -971,119 +552,6 @@ export interface TagsListResult { readonly nextLink?: string; } -/** Deployment operation information. */ -export interface DeploymentOperation { - /** - * Full deployment operation ID. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * Deployment operation ID. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly operationId?: string; - /** Deployment properties. */ - properties?: DeploymentOperationProperties; -} - -/** Deployment operation properties. */ -export interface DeploymentOperationProperties { - /** - * The name of the current provisioning operation. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningOperation?: ProvisioningOperation; - /** - * The state of the provisioning. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** - * The date and time of the operation. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly timestamp?: Date; - /** - * The duration of the operation. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly duration?: string; - /** - * Deployment operation service request id. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly serviceRequestId?: string; - /** - * Operation status code from the resource provider. This property may not be set if a response has not yet been received. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly statusCode?: string; - /** - * Operation status message from the resource provider. This property is optional. It will only be provided if an error was received from the resource provider. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly statusMessage?: StatusMessage; - /** - * The target resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly targetResource?: TargetResource; - /** - * The HTTP request message. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly request?: HttpMessage; - /** - * The HTTP response message. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly response?: HttpMessage; -} - -/** Operation status message object. */ -export interface StatusMessage { - /** Status of the deployment operation. */ - status?: string; - /** The error reported by the operation. */ - error?: ErrorResponse; -} - -/** Target resource. */ -export interface TargetResource { - /** The ID of the resource. */ - id?: string; - /** The name of the resource. */ - resourceName?: string; - /** The type of the resource. */ - resourceType?: string; -} - -/** HTTP message. */ -export interface HttpMessage { - /** HTTP message content. */ - content?: Record; -} - -/** List of deployment operations. */ -export interface DeploymentOperationsListResult { - /** An array of deployment operations. */ - value?: DeploymentOperation[]; - /** - * The 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; -} - -/** Result of the request to calculate template hash. It contains a string of minified template and its hash. */ -export interface TemplateHashResult { - /** The minified template string. */ - minifiedTemplate?: string; - /** The template hash. */ - templateHash?: string; -} - /** Wrapper resource for tags API requests and responses. */ export interface TagsResource { /** @@ -1119,12 +587,6 @@ export interface TagsPatchResource { properties?: Tags; } -/** Deployment filter. */ -export interface DeploymentExtendedFilter { - /** The provisioning state. */ - provisioningState?: string; -} - /** Resource filter. */ export interface GenericResourceFilter { /** The resource type. */ @@ -1163,12 +625,6 @@ export interface SubResource { id?: string; } -/** Deployment What-if properties. */ -export interface DeploymentWhatIfProperties extends DeploymentProperties { - /** Optional What-If operation settings. */ - whatIfSettings?: DeploymentWhatIfSettings; -} - /** Resource information. */ export interface GenericResource extends Resource { /** The plan of the resource. */ @@ -1204,152 +660,30 @@ export interface GenericResourceExpanded extends GenericResource { readonly provisioningState?: string; } -/** Defines headers for Deployments_whatIfAtTenantScope operation. */ -export interface DeploymentsWhatIfAtTenantScopeHeaders { +/** Defines headers for ResourceGroups_delete operation. */ +export interface ResourceGroupsDeleteHeaders { /** URL to get status of this long-running operation. */ location?: string; - /** Number of seconds to wait before polling for status. */ - retryAfter?: string; } -/** Defines headers for Deployments_whatIfAtManagementGroupScope operation. */ -export interface DeploymentsWhatIfAtManagementGroupScopeHeaders { +/** Defines headers for Tags_createOrUpdateAtScope operation. */ +export interface TagsCreateOrUpdateAtScopeHeaders { /** URL to get status of this long-running operation. */ location?: string; - /** Number of seconds to wait before polling for status. */ - retryAfter?: string; } -/** Defines headers for Deployments_whatIfAtSubscriptionScope operation. */ -export interface DeploymentsWhatIfAtSubscriptionScopeHeaders { +/** Defines headers for Tags_updateAtScope operation. */ +export interface TagsUpdateAtScopeHeaders { /** URL to get status of this long-running operation. */ location?: string; - /** Number of seconds to wait before polling for status. */ - retryAfter?: string; } -/** Defines headers for Deployments_whatIf operation. */ -export interface DeploymentsWhatIfHeaders { +/** Defines headers for Tags_deleteAtScope operation. */ +export interface TagsDeleteAtScopeHeaders { /** URL to get status of this long-running operation. */ location?: string; - /** Number of seconds to wait before polling for status. */ - retryAfter?: string; } -/** Defines headers for ResourceGroups_delete operation. */ -export interface ResourceGroupsDeleteHeaders { - /** URL to get status of this long-running operation. */ - location?: string; -} - -/** Defines headers for Tags_createOrUpdateAtScope operation. */ -export interface TagsCreateOrUpdateAtScopeHeaders { - /** URL to get status of this long-running operation. */ - location?: string; -} - -/** Defines headers for Tags_updateAtScope operation. */ -export interface TagsUpdateAtScopeHeaders { - /** URL to get status of this long-running operation. */ - location?: string; -} - -/** Defines headers for Tags_deleteAtScope operation. */ -export interface TagsDeleteAtScopeHeaders { - /** URL to get status of this long-running operation. */ - location?: string; -} - -/** Known values of {@link ExpressionEvaluationOptionsScopeType} that the service accepts. */ -export enum KnownExpressionEvaluationOptionsScopeType { - /** NotSpecified */ - NotSpecified = "NotSpecified", - /** Outer */ - Outer = "Outer", - /** Inner */ - Inner = "Inner", -} - -/** - * Defines values for ExpressionEvaluationOptionsScopeType. \ - * {@link KnownExpressionEvaluationOptionsScopeType} can be used interchangeably with ExpressionEvaluationOptionsScopeType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **NotSpecified** \ - * **Outer** \ - * **Inner** - */ -export type ExpressionEvaluationOptionsScopeType = string; - -/** Known values of {@link ValidationLevel} that the service accepts. */ -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", -} - -/** - * Defines values for ValidationLevel. \ - * {@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; - -/** Known values of {@link ProvisioningState} that the service accepts. */ -export enum KnownProvisioningState { - /** NotSpecified */ - NotSpecified = "NotSpecified", - /** Accepted */ - Accepted = "Accepted", - /** Running */ - Running = "Running", - /** Ready */ - Ready = "Ready", - /** Creating */ - Creating = "Creating", - /** Created */ - Created = "Created", - /** Deleting */ - Deleting = "Deleting", - /** Deleted */ - Deleted = "Deleted", - /** Canceled */ - Canceled = "Canceled", - /** Failed */ - Failed = "Failed", - /** Succeeded */ - Succeeded = "Succeeded", - /** Updating */ - Updating = "Updating", -} - -/** - * Defines values for ProvisioningState. \ - * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **NotSpecified** \ - * **Accepted** \ - * **Running** \ - * **Ready** \ - * **Creating** \ - * **Created** \ - * **Deleting** \ - * **Deleted** \ - * **Canceled** \ - * **Failed** \ - * **Succeeded** \ - * **Updating** - */ -export type ProvisioningState = string; - /** Known values of {@link AliasPathTokenType} that the service accepts. */ export enum KnownAliasPathTokenType { /** The token type is not specified. */ @@ -1428,27 +762,6 @@ export enum KnownProviderAuthorizationConsentState { */ export type ProviderAuthorizationConsentState = string; -/** Known values of {@link Level} that the service accepts. */ -export enum KnownLevel { - /** Warning */ - Warning = "Warning", - /** Info */ - Info = "Info", - /** Error */ - Error = "Error", -} - -/** - * Defines values for Level. \ - * {@link KnownLevel} can be used interchangeably with Level, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Warning** \ - * **Info** \ - * **Error** - */ -export type Level = string; - /** Known values of {@link ExtendedLocationType} that the service accepts. */ export enum KnownExtendedLocationType { /** EdgeZone */ @@ -1502,530 +815,31 @@ export enum KnownTagsPatchOperation { * **Delete**: The 'delete' option allows selectively deleting tags based on given names or name\/value pairs. */ export type TagsPatchOperation = string; -/** Defines values for DeploymentMode. */ -export type DeploymentMode = "Incremental" | "Complete"; -/** Defines values for OnErrorDeploymentType. */ -export type OnErrorDeploymentType = "LastSuccessful" | "SpecificDeployment"; /** Defines values for AliasPatternType. */ export type AliasPatternType = "NotSpecified" | "Extract"; /** Defines values for AliasType. */ export type AliasType = "NotSpecified" | "PlainText" | "Mask"; -/** Defines values for WhatIfResultFormat. */ -export type WhatIfResultFormat = "ResourceIdOnly" | "FullResourcePayloads"; -/** Defines values for ChangeType. */ -export type ChangeType = - | "Create" - | "Delete" - | "Ignore" - | "Deploy" - | "NoChange" - | "Modify" - | "Unsupported"; -/** Defines values for PropertyChangeType. */ -export type PropertyChangeType = - | "Create" - | "Delete" - | "Modify" - | "Array" - | "NoEffect"; /** Defines values for ResourceIdentityType. */ export type ResourceIdentityType = | "SystemAssigned" | "UserAssigned" | "SystemAssigned, UserAssigned" | "None"; -/** Defines values for ProvisioningOperation. */ -export type ProvisioningOperation = - | "NotSpecified" - | "Create" - | "Delete" - | "Waiting" - | "AzureAsyncOperationWaiting" - | "ResourceCacheWaiting" - | "Action" - | "Read" - | "EvaluateDeploymentOutput" - | "DeploymentCleanup"; /** Optional parameters. */ -export interface OperationsListOptionalParams - extends coreClient.OperationOptions {} +export interface OperationsListOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the list operation. */ export type OperationsListResponse = OperationListResult; /** Optional parameters. */ -export interface OperationsListNextOptionalParams - extends coreClient.OperationOptions {} +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type OperationsListNextResponse = OperationListResult; /** Optional parameters. */ -export interface DeploymentsDeleteAtScopeOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface DeploymentsCheckExistenceAtScopeOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the checkExistenceAtScope operation. */ -export type DeploymentsCheckExistenceAtScopeResponse = { - body: boolean; -}; - -/** Optional parameters. */ -export interface DeploymentsCreateOrUpdateAtScopeOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdateAtScope operation. */ -export type DeploymentsCreateOrUpdateAtScopeResponse = DeploymentExtended; - -/** Optional parameters. */ -export interface DeploymentsGetAtScopeOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getAtScope operation. */ -export type DeploymentsGetAtScopeResponse = DeploymentExtended; - -/** Optional parameters. */ -export interface DeploymentsCancelAtScopeOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface DeploymentsValidateAtScopeOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the validateAtScope operation. */ -export type DeploymentsValidateAtScopeResponse = DeploymentValidateResult; - -/** Optional parameters. */ -export interface DeploymentsExportTemplateAtScopeOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the exportTemplateAtScope operation. */ -export type DeploymentsExportTemplateAtScopeResponse = DeploymentExportResult; - -/** Optional parameters. */ -export interface DeploymentsListAtScopeOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'. */ - filter?: string; - /** The number of results to get. If null is passed, returns all deployments. */ - top?: number; -} - -/** Contains response data for the listAtScope operation. */ -export type DeploymentsListAtScopeResponse = DeploymentListResult; - -/** Optional parameters. */ -export interface DeploymentsDeleteAtTenantScopeOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface DeploymentsCheckExistenceAtTenantScopeOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the checkExistenceAtTenantScope operation. */ -export type DeploymentsCheckExistenceAtTenantScopeResponse = { - body: boolean; -}; - -/** Optional parameters. */ -export interface DeploymentsCreateOrUpdateAtTenantScopeOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdateAtTenantScope operation. */ -export type DeploymentsCreateOrUpdateAtTenantScopeResponse = DeploymentExtended; - -/** Optional parameters. */ -export interface DeploymentsGetAtTenantScopeOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getAtTenantScope operation. */ -export type DeploymentsGetAtTenantScopeResponse = DeploymentExtended; - -/** Optional parameters. */ -export interface DeploymentsCancelAtTenantScopeOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface DeploymentsValidateAtTenantScopeOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the validateAtTenantScope operation. */ -export type DeploymentsValidateAtTenantScopeResponse = DeploymentValidateResult; - -/** Optional parameters. */ -export interface DeploymentsWhatIfAtTenantScopeOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the whatIfAtTenantScope operation. */ -export type DeploymentsWhatIfAtTenantScopeResponse = WhatIfOperationResult; - -/** Optional parameters. */ -export interface DeploymentsExportTemplateAtTenantScopeOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the exportTemplateAtTenantScope operation. */ -export type DeploymentsExportTemplateAtTenantScopeResponse = - DeploymentExportResult; - -/** Optional parameters. */ -export interface DeploymentsListAtTenantScopeOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'. */ - filter?: string; - /** The number of results to get. If null is passed, returns all deployments. */ - top?: number; -} - -/** Contains response data for the listAtTenantScope operation. */ -export type DeploymentsListAtTenantScopeResponse = DeploymentListResult; - -/** Optional parameters. */ -export interface DeploymentsDeleteAtManagementGroupScopeOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface DeploymentsCheckExistenceAtManagementGroupScopeOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the checkExistenceAtManagementGroupScope operation. */ -export type DeploymentsCheckExistenceAtManagementGroupScopeResponse = { - body: boolean; -}; - -/** Optional parameters. */ -export interface DeploymentsCreateOrUpdateAtManagementGroupScopeOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdateAtManagementGroupScope operation. */ -export type DeploymentsCreateOrUpdateAtManagementGroupScopeResponse = - DeploymentExtended; - -/** Optional parameters. */ -export interface DeploymentsGetAtManagementGroupScopeOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getAtManagementGroupScope operation. */ -export type DeploymentsGetAtManagementGroupScopeResponse = DeploymentExtended; - -/** Optional parameters. */ -export interface DeploymentsCancelAtManagementGroupScopeOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface DeploymentsValidateAtManagementGroupScopeOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the validateAtManagementGroupScope operation. */ -export type DeploymentsValidateAtManagementGroupScopeResponse = - DeploymentValidateResult; - -/** Optional parameters. */ -export interface DeploymentsWhatIfAtManagementGroupScopeOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the whatIfAtManagementGroupScope operation. */ -export type DeploymentsWhatIfAtManagementGroupScopeResponse = - WhatIfOperationResult; - -/** Optional parameters. */ -export interface DeploymentsExportTemplateAtManagementGroupScopeOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the exportTemplateAtManagementGroupScope operation. */ -export type DeploymentsExportTemplateAtManagementGroupScopeResponse = - DeploymentExportResult; - -/** Optional parameters. */ -export interface DeploymentsListAtManagementGroupScopeOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'. */ - filter?: string; - /** The number of results to get. If null is passed, returns all deployments. */ - top?: number; -} - -/** Contains response data for the listAtManagementGroupScope operation. */ -export type DeploymentsListAtManagementGroupScopeResponse = - DeploymentListResult; - -/** Optional parameters. */ -export interface DeploymentsDeleteAtSubscriptionScopeOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface DeploymentsCheckExistenceAtSubscriptionScopeOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the checkExistenceAtSubscriptionScope operation. */ -export type DeploymentsCheckExistenceAtSubscriptionScopeResponse = { - body: boolean; -}; - -/** Optional parameters. */ -export interface DeploymentsCreateOrUpdateAtSubscriptionScopeOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdateAtSubscriptionScope operation. */ -export type DeploymentsCreateOrUpdateAtSubscriptionScopeResponse = - DeploymentExtended; - -/** Optional parameters. */ -export interface DeploymentsGetAtSubscriptionScopeOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getAtSubscriptionScope operation. */ -export type DeploymentsGetAtSubscriptionScopeResponse = DeploymentExtended; - -/** Optional parameters. */ -export interface DeploymentsCancelAtSubscriptionScopeOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface DeploymentsValidateAtSubscriptionScopeOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the validateAtSubscriptionScope operation. */ -export type DeploymentsValidateAtSubscriptionScopeResponse = - DeploymentValidateResult; - -/** Optional parameters. */ -export interface DeploymentsWhatIfAtSubscriptionScopeOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the whatIfAtSubscriptionScope operation. */ -export type DeploymentsWhatIfAtSubscriptionScopeResponse = - WhatIfOperationResult; - -/** Optional parameters. */ -export interface DeploymentsExportTemplateAtSubscriptionScopeOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the exportTemplateAtSubscriptionScope operation. */ -export type DeploymentsExportTemplateAtSubscriptionScopeResponse = - DeploymentExportResult; - -/** Optional parameters. */ -export interface DeploymentsListAtSubscriptionScopeOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'. */ - filter?: string; - /** The number of results to get. If null is passed, returns all deployments. */ - top?: number; -} - -/** Contains response data for the listAtSubscriptionScope operation. */ -export type DeploymentsListAtSubscriptionScopeResponse = DeploymentListResult; - -/** Optional parameters. */ -export interface DeploymentsDeleteOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface DeploymentsCheckExistenceOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the checkExistence operation. */ -export type DeploymentsCheckExistenceResponse = { - body: boolean; -}; - -/** Optional parameters. */ -export interface DeploymentsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdate operation. */ -export type DeploymentsCreateOrUpdateResponse = DeploymentExtended; - -/** Optional parameters. */ -export interface DeploymentsGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type DeploymentsGetResponse = DeploymentExtended; - -/** Optional parameters. */ -export interface DeploymentsCancelOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface DeploymentsValidateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the validate operation. */ -export type DeploymentsValidateResponse = DeploymentValidateResult; - -/** Optional parameters. */ -export interface DeploymentsWhatIfOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the whatIf operation. */ -export type DeploymentsWhatIfResponse = WhatIfOperationResult; - -/** Optional parameters. */ -export interface DeploymentsExportTemplateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the exportTemplate operation. */ -export type DeploymentsExportTemplateResponse = DeploymentExportResult; - -/** Optional parameters. */ -export interface DeploymentsListByResourceGroupOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'. */ - filter?: string; - /** The number of results to get. If null is passed, returns all deployments. */ - top?: number; -} - -/** Contains response data for the listByResourceGroup operation. */ -export type DeploymentsListByResourceGroupResponse = DeploymentListResult; - -/** Optional parameters. */ -export interface DeploymentsCalculateTemplateHashOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the calculateTemplateHash operation. */ -export type DeploymentsCalculateTemplateHashResponse = TemplateHashResult; - -/** Optional parameters. */ -export interface DeploymentsListAtScopeNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listAtScopeNext operation. */ -export type DeploymentsListAtScopeNextResponse = DeploymentListResult; - -/** Optional parameters. */ -export interface DeploymentsListAtTenantScopeNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listAtTenantScopeNext operation. */ -export type DeploymentsListAtTenantScopeNextResponse = DeploymentListResult; - -/** Optional parameters. */ -export interface DeploymentsListAtManagementGroupScopeNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listAtManagementGroupScopeNext operation. */ -export type DeploymentsListAtManagementGroupScopeNextResponse = - DeploymentListResult; - -/** Optional parameters. */ -export interface DeploymentsListAtSubscriptionScopeNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listAtSubscriptionScopeNext operation. */ -export type DeploymentsListAtSubscriptionScopeNextResponse = - DeploymentListResult; - -/** Optional parameters. */ -export interface DeploymentsListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type DeploymentsListByResourceGroupNextResponse = DeploymentListResult; - -/** Optional parameters. */ -export interface ProvidersUnregisterOptionalParams - extends coreClient.OperationOptions {} +export interface ProvidersUnregisterOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the unregister operation. */ export type ProvidersUnregisterResponse = Provider; @@ -2035,15 +849,13 @@ export interface ProvidersRegisterAtManagementGroupScopeOptionalParams extends coreClient.OperationOptions {} /** Optional parameters. */ -export interface ProvidersProviderPermissionsOptionalParams - extends coreClient.OperationOptions {} +export interface ProvidersProviderPermissionsOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the providerPermissions operation. */ export type ProvidersProviderPermissionsResponse = ProviderPermissionListResult; /** Optional parameters. */ -export interface ProvidersRegisterOptionalParams - extends coreClient.OperationOptions { +export interface ProvidersRegisterOptionalParams extends coreClient.OperationOptions { /** The third party consent for S2S. */ properties?: ProviderRegistrationRequest; } @@ -2052,8 +864,7 @@ export interface ProvidersRegisterOptionalParams export type ProvidersRegisterResponse = Provider; /** Optional parameters. */ -export interface ProvidersListOptionalParams - extends coreClient.OperationOptions { +export interface ProvidersListOptionalParams extends coreClient.OperationOptions { /** The properties to include in the results. For example, use &$expand=metadata in the query string to retrieve resource provider metadata. To include property aliases in response, use $expand=resourceTypes/aliases. */ expand?: string; } @@ -2062,8 +873,7 @@ export interface ProvidersListOptionalParams export type ProvidersListResponse = ProviderListResult; /** Optional parameters. */ -export interface ProvidersListAtTenantScopeOptionalParams - extends coreClient.OperationOptions { +export interface ProvidersListAtTenantScopeOptionalParams extends coreClient.OperationOptions { /** The properties to include in the results. For example, use &$expand=metadata in the query string to retrieve resource provider metadata. To include property aliases in response, use $expand=resourceTypes/aliases. */ expand?: string; } @@ -2072,8 +882,7 @@ export interface ProvidersListAtTenantScopeOptionalParams export type ProvidersListAtTenantScopeResponse = ProviderListResult; /** Optional parameters. */ -export interface ProvidersGetOptionalParams - extends coreClient.OperationOptions { +export interface ProvidersGetOptionalParams extends coreClient.OperationOptions { /** The $expand query parameter. For example, to include property aliases in response, use $expand=resourceTypes/aliases. */ expand?: string; } @@ -2082,8 +891,7 @@ export interface ProvidersGetOptionalParams export type ProvidersGetResponse = Provider; /** Optional parameters. */ -export interface ProvidersGetAtTenantScopeOptionalParams - extends coreClient.OperationOptions { +export interface ProvidersGetAtTenantScopeOptionalParams extends coreClient.OperationOptions { /** The $expand query parameter. For example, to include property aliases in response, use $expand=resourceTypes/aliases. */ expand?: string; } @@ -2092,22 +900,19 @@ export interface ProvidersGetAtTenantScopeOptionalParams export type ProvidersGetAtTenantScopeResponse = Provider; /** Optional parameters. */ -export interface ProvidersListNextOptionalParams - extends coreClient.OperationOptions {} +export interface ProvidersListNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type ProvidersListNextResponse = ProviderListResult; /** Optional parameters. */ -export interface ProvidersListAtTenantScopeNextOptionalParams - extends coreClient.OperationOptions {} +export interface ProvidersListAtTenantScopeNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listAtTenantScopeNext operation. */ export type ProvidersListAtTenantScopeNextResponse = ProviderListResult; /** Optional parameters. */ -export interface ProviderResourceTypesListOptionalParams - extends coreClient.OperationOptions { +export interface ProviderResourceTypesListOptionalParams extends coreClient.OperationOptions { /** The $expand query parameter. For example, to include property aliases in response, use $expand=resourceTypes/aliases. */ expand?: string; } @@ -2116,22 +921,20 @@ export interface ProviderResourceTypesListOptionalParams export type ProviderResourceTypesListResponse = ProviderResourceTypeListResult; /** Optional parameters. */ -export interface ResourcesListByResourceGroupOptionalParams - extends coreClient.OperationOptions { +export interface ResourcesListByResourceGroupOptionalParams extends coreClient.OperationOptions { + /** Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. */ + expand?: string; /** The filter to apply on the operation.

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

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

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

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

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

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

You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. */ filter?: string; /** The number of results to return. If null is passed, returns all resources. */ top?: number; - /** Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. */ - expand?: string; } /** Contains response data for the listByResourceGroup operation. */ export type ResourcesListByResourceGroupResponse = ResourceListResult; /** Optional parameters. */ -export interface ResourcesMoveResourcesOptionalParams - extends coreClient.OperationOptions { +export interface ResourcesMoveResourcesOptionalParams extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ @@ -2139,8 +942,7 @@ export interface ResourcesMoveResourcesOptionalParams } /** Optional parameters. */ -export interface ResourcesValidateMoveResourcesOptionalParams - extends coreClient.OperationOptions { +export interface ResourcesValidateMoveResourcesOptionalParams extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ @@ -2148,22 +950,20 @@ export interface ResourcesValidateMoveResourcesOptionalParams } /** Optional parameters. */ -export interface ResourcesListOptionalParams - extends coreClient.OperationOptions { +export interface ResourcesListOptionalParams extends coreClient.OperationOptions { + /** Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. */ + expand?: string; /** The filter to apply on the operation.

Filter comparison operators include `eq` (equals) and `ne` (not equals) and may be used with the following properties: `location`, `resourceType`, `name`, `resourceGroup`, `identity`, `identity/principalId`, `plan`, `plan/publisher`, `plan/product`, `plan/name`, `plan/version`, and `plan/promotionCode`.

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


`substringof(value, property)` can be used to filter for substrings of the following currently-supported properties: `name` and `resourceGroup`

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

Multiple substring operations can also be combined using `and`/`or` operators.

Note that any truncated number of results queried via `$top` may also not be compatible when using a filter.


Resources can be filtered by tag names and values. For example, to filter for a tag name and value, use `$filter=tagName eq 'tag1' and tagValue eq 'Value1'`. Note that when resources are filtered by tag name and value, the original tags for each resource will not be returned in the results. Any list of additional properties queried via `$expand` may also not be compatible when filtering by tag names/values.

For tag names only, resources can be filtered by prefix using the following syntax: `$filter=startswith(tagName, 'depart')`. This query will return all resources with a tag name prefixed by the phrase `depart` (i.e.`department`, `departureDate`, `departureTime`, etc.)


Note that some properties can be combined when filtering resources, which include the following: `substringof() and/or resourceType`, `plan and plan/publisher and plan/name`, and `identity and identity/principalId`. */ filter?: string; /** The number of recommendations per page if a paged version of this API is being used. */ top?: number; - /** Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. */ - expand?: string; } /** Contains response data for the list operation. */ export type ResourcesListResponse = ResourceListResult; /** Optional parameters. */ -export interface ResourcesCheckExistenceOptionalParams - extends coreClient.OperationOptions {} +export interface ResourcesCheckExistenceOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the checkExistence operation. */ export type ResourcesCheckExistenceResponse = { @@ -2171,8 +971,7 @@ export type ResourcesCheckExistenceResponse = { }; /** Optional parameters. */ -export interface ResourcesDeleteOptionalParams - extends coreClient.OperationOptions { +export interface ResourcesDeleteOptionalParams extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ @@ -2180,8 +979,7 @@ export interface ResourcesDeleteOptionalParams } /** Optional parameters. */ -export interface ResourcesCreateOrUpdateOptionalParams - extends coreClient.OperationOptions { +export interface ResourcesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ @@ -2192,8 +990,7 @@ export interface ResourcesCreateOrUpdateOptionalParams export type ResourcesCreateOrUpdateResponse = GenericResource; /** Optional parameters. */ -export interface ResourcesUpdateOptionalParams - extends coreClient.OperationOptions { +export interface ResourcesUpdateOptionalParams extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ @@ -2204,15 +1001,13 @@ export interface ResourcesUpdateOptionalParams export type ResourcesUpdateResponse = GenericResource; /** Optional parameters. */ -export interface ResourcesGetOptionalParams - extends coreClient.OperationOptions {} +export interface ResourcesGetOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ export type ResourcesGetResponse = GenericResource; /** Optional parameters. */ -export interface ResourcesCheckExistenceByIdOptionalParams - extends coreClient.OperationOptions {} +export interface ResourcesCheckExistenceByIdOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the checkExistenceById operation. */ export type ResourcesCheckExistenceByIdResponse = { @@ -2220,8 +1015,7 @@ export type ResourcesCheckExistenceByIdResponse = { }; /** Optional parameters. */ -export interface ResourcesDeleteByIdOptionalParams - extends coreClient.OperationOptions { +export interface ResourcesDeleteByIdOptionalParams extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ @@ -2229,8 +1023,7 @@ export interface ResourcesDeleteByIdOptionalParams } /** Optional parameters. */ -export interface ResourcesCreateOrUpdateByIdOptionalParams - extends coreClient.OperationOptions { +export interface ResourcesCreateOrUpdateByIdOptionalParams extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ @@ -2241,8 +1034,7 @@ export interface ResourcesCreateOrUpdateByIdOptionalParams export type ResourcesCreateOrUpdateByIdResponse = GenericResource; /** Optional parameters. */ -export interface ResourcesUpdateByIdOptionalParams - extends coreClient.OperationOptions { +export interface ResourcesUpdateByIdOptionalParams extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ @@ -2253,8 +1045,7 @@ export interface ResourcesUpdateByIdOptionalParams export type ResourcesUpdateByIdResponse = GenericResource; /** Optional parameters. */ -export interface ResourcesGetByIdOptionalParams - extends coreClient.OperationOptions {} +export interface ResourcesGetByIdOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the getById operation. */ export type ResourcesGetByIdResponse = GenericResource; @@ -2267,15 +1058,13 @@ export interface ResourcesListByResourceGroupNextOptionalParams export type ResourcesListByResourceGroupNextResponse = ResourceListResult; /** Optional parameters. */ -export interface ResourcesListNextOptionalParams - extends coreClient.OperationOptions {} +export interface ResourcesListNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type ResourcesListNextResponse = ResourceListResult; /** Optional parameters. */ -export interface ResourceGroupsCheckExistenceOptionalParams - extends coreClient.OperationOptions {} +export interface ResourceGroupsCheckExistenceOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the checkExistence operation. */ export type ResourceGroupsCheckExistenceResponse = { @@ -2283,15 +1072,13 @@ export type ResourceGroupsCheckExistenceResponse = { }; /** Optional parameters. */ -export interface ResourceGroupsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions {} +export interface ResourceGroupsCreateOrUpdateOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the createOrUpdate operation. */ export type ResourceGroupsCreateOrUpdateResponse = ResourceGroup; /** Optional parameters. */ -export interface ResourceGroupsDeleteOptionalParams - extends coreClient.OperationOptions { +export interface ResourceGroupsDeleteOptionalParams extends coreClient.OperationOptions { /** The resource types you want to force delete. Currently, only the following is supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets */ forceDeletionTypes?: string; /** Delay to wait until next poll, in milliseconds. */ @@ -2301,22 +1088,19 @@ export interface ResourceGroupsDeleteOptionalParams } /** Optional parameters. */ -export interface ResourceGroupsGetOptionalParams - extends coreClient.OperationOptions {} +export interface ResourceGroupsGetOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ export type ResourceGroupsGetResponse = ResourceGroup; /** Optional parameters. */ -export interface ResourceGroupsUpdateOptionalParams - extends coreClient.OperationOptions {} +export interface ResourceGroupsUpdateOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the update operation. */ export type ResourceGroupsUpdateResponse = ResourceGroup; /** Optional parameters. */ -export interface ResourceGroupsExportTemplateOptionalParams - extends coreClient.OperationOptions { +export interface ResourceGroupsExportTemplateOptionalParams extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ @@ -2327,8 +1111,7 @@ export interface ResourceGroupsExportTemplateOptionalParams export type ResourceGroupsExportTemplateResponse = ResourceGroupExportResult; /** Optional parameters. */ -export interface ResourceGroupsListOptionalParams - extends coreClient.OperationOptions { +export interface ResourceGroupsListOptionalParams extends coreClient.OperationOptions { /** The filter to apply on the operation.

You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1' */ filter?: string; /** The number of results to return. If null is passed, returns all resource groups. */ @@ -2339,26 +1122,22 @@ export interface ResourceGroupsListOptionalParams export type ResourceGroupsListResponse = ResourceGroupListResult; /** Optional parameters. */ -export interface ResourceGroupsListNextOptionalParams - extends coreClient.OperationOptions {} +export interface ResourceGroupsListNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type ResourceGroupsListNextResponse = ResourceGroupListResult; /** Optional parameters. */ -export interface TagsDeleteValueOptionalParams - extends coreClient.OperationOptions {} +export interface TagsDeleteValueOptionalParams extends coreClient.OperationOptions {} /** Optional parameters. */ -export interface TagsCreateOrUpdateValueOptionalParams - extends coreClient.OperationOptions {} +export interface TagsCreateOrUpdateValueOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the createOrUpdateValue operation. */ export type TagsCreateOrUpdateValueResponse = TagValue; /** Optional parameters. */ -export interface TagsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions {} +export interface TagsCreateOrUpdateOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the createOrUpdate operation. */ export type TagsCreateOrUpdateResponse = TagDetails; @@ -2373,8 +1152,7 @@ export interface TagsListOptionalParams extends coreClient.OperationOptions {} export type TagsListResponse = TagsListResult; /** Optional parameters. */ -export interface TagsCreateOrUpdateAtScopeOptionalParams - extends coreClient.OperationOptions { +export interface TagsCreateOrUpdateAtScopeOptionalParams 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. */ @@ -2385,8 +1163,7 @@ export interface TagsCreateOrUpdateAtScopeOptionalParams export type TagsCreateOrUpdateAtScopeResponse = TagsResource; /** Optional parameters. */ -export interface TagsUpdateAtScopeOptionalParams - extends coreClient.OperationOptions { +export interface TagsUpdateAtScopeOptionalParams 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. */ @@ -2397,15 +1174,13 @@ export interface TagsUpdateAtScopeOptionalParams export type TagsUpdateAtScopeResponse = TagsResource; /** Optional parameters. */ -export interface TagsGetAtScopeOptionalParams - extends coreClient.OperationOptions {} +export interface TagsGetAtScopeOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the getAtScope operation. */ export type TagsGetAtScopeResponse = TagsResource; /** Optional parameters. */ -export interface TagsDeleteAtScopeOptionalParams - extends coreClient.OperationOptions { +export interface TagsDeleteAtScopeOptionalParams 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. */ @@ -2413,146 +1188,13 @@ export interface TagsDeleteAtScopeOptionalParams } /** Optional parameters. */ -export interface TagsListNextOptionalParams - extends coreClient.OperationOptions {} +export interface TagsListNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type TagsListNextResponse = TagsListResult; /** Optional parameters. */ -export interface DeploymentOperationsGetAtScopeOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getAtScope operation. */ -export type DeploymentOperationsGetAtScopeResponse = DeploymentOperation; - -/** Optional parameters. */ -export interface DeploymentOperationsListAtScopeOptionalParams - extends coreClient.OperationOptions { - /** The number of results to return. */ - top?: number; -} - -/** Contains response data for the listAtScope operation. */ -export type DeploymentOperationsListAtScopeResponse = - DeploymentOperationsListResult; - -/** Optional parameters. */ -export interface DeploymentOperationsGetAtTenantScopeOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getAtTenantScope operation. */ -export type DeploymentOperationsGetAtTenantScopeResponse = DeploymentOperation; - -/** Optional parameters. */ -export interface DeploymentOperationsListAtTenantScopeOptionalParams - extends coreClient.OperationOptions { - /** The number of results to return. */ - top?: number; -} - -/** Contains response data for the listAtTenantScope operation. */ -export type DeploymentOperationsListAtTenantScopeResponse = - DeploymentOperationsListResult; - -/** Optional parameters. */ -export interface DeploymentOperationsGetAtManagementGroupScopeOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getAtManagementGroupScope operation. */ -export type DeploymentOperationsGetAtManagementGroupScopeResponse = - DeploymentOperation; - -/** Optional parameters. */ -export interface DeploymentOperationsListAtManagementGroupScopeOptionalParams - extends coreClient.OperationOptions { - /** The number of results to return. */ - top?: number; -} - -/** Contains response data for the listAtManagementGroupScope operation. */ -export type DeploymentOperationsListAtManagementGroupScopeResponse = - DeploymentOperationsListResult; - -/** Optional parameters. */ -export interface DeploymentOperationsGetAtSubscriptionScopeOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getAtSubscriptionScope operation. */ -export type DeploymentOperationsGetAtSubscriptionScopeResponse = - DeploymentOperation; - -/** Optional parameters. */ -export interface DeploymentOperationsListAtSubscriptionScopeOptionalParams - extends coreClient.OperationOptions { - /** The number of results to return. */ - top?: number; -} - -/** Contains response data for the listAtSubscriptionScope operation. */ -export type DeploymentOperationsListAtSubscriptionScopeResponse = - DeploymentOperationsListResult; - -/** Optional parameters. */ -export interface DeploymentOperationsGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type DeploymentOperationsGetResponse = DeploymentOperation; - -/** Optional parameters. */ -export interface DeploymentOperationsListOptionalParams - extends coreClient.OperationOptions { - /** The number of results to return. */ - top?: number; -} - -/** Contains response data for the list operation. */ -export type DeploymentOperationsListResponse = DeploymentOperationsListResult; - -/** Optional parameters. */ -export interface DeploymentOperationsListAtScopeNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listAtScopeNext operation. */ -export type DeploymentOperationsListAtScopeNextResponse = - DeploymentOperationsListResult; - -/** Optional parameters. */ -export interface DeploymentOperationsListAtTenantScopeNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listAtTenantScopeNext operation. */ -export type DeploymentOperationsListAtTenantScopeNextResponse = - DeploymentOperationsListResult; - -/** Optional parameters. */ -export interface DeploymentOperationsListAtManagementGroupScopeNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listAtManagementGroupScopeNext operation. */ -export type DeploymentOperationsListAtManagementGroupScopeNextResponse = - DeploymentOperationsListResult; - -/** Optional parameters. */ -export interface DeploymentOperationsListAtSubscriptionScopeNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listAtSubscriptionScopeNext operation. */ -export type DeploymentOperationsListAtSubscriptionScopeNextResponse = - DeploymentOperationsListResult; - -/** Optional parameters. */ -export interface DeploymentOperationsListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type DeploymentOperationsListNextResponse = - DeploymentOperationsListResult; - -/** Optional parameters. */ -export interface ResourceManagementClientOptionalParams - extends coreClient.ServiceClientOptions { +export interface ResourceManagementClientOptionalParams extends coreClient.ServiceClientOptions { /** server parameter */ $host?: string; /** Api Version */ diff --git a/sdk/resources/arm-resources/src/models/mappers.ts b/sdk/resources/arm-resources/src/models/mappers.ts index f53887bbb29a..0c8c87f9c703 100644 --- a/sdk/resources/arm-resources/src/models/mappers.ts +++ b/sdk/resources/arm-resources/src/models/mappers.ts @@ -186,1003 +186,53 @@ export const ErrorAdditionalInfo: coreClient.CompositeMapper = { }, }; -export const Deployment: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Deployment", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "DeploymentProperties", - }, - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const DeploymentProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DeploymentProperties", - modelProperties: { - template: { - serializedName: "template", - type: { - name: "Dictionary", - value: { type: { name: "any" } }, - }, - }, - templateLink: { - serializedName: "templateLink", - type: { - name: "Composite", - className: "TemplateLink", - }, - }, - parameters: { - serializedName: "parameters", - type: { - name: "Dictionary", - value: { - type: { name: "Composite", className: "DeploymentParameter" }, - }, - }, - }, - parametersLink: { - serializedName: "parametersLink", - type: { - name: "Composite", - className: "ParametersLink", - }, - }, - mode: { - serializedName: "mode", - required: true, - type: { - name: "Enum", - allowedValues: ["Incremental", "Complete"], - }, - }, - debugSetting: { - serializedName: "debugSetting", - type: { - name: "Composite", - className: "DebugSetting", - }, - }, - onErrorDeployment: { - serializedName: "onErrorDeployment", - type: { - name: "Composite", - className: "OnErrorDeployment", - }, - }, - expressionEvaluationOptions: { - serializedName: "expressionEvaluationOptions", - type: { - name: "Composite", - className: "ExpressionEvaluationOptions", - }, - }, - validationLevel: { - serializedName: "validationLevel", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const TemplateLink: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "TemplateLink", - modelProperties: { - uri: { - serializedName: "uri", - type: { - name: "String", - }, - }, - id: { - serializedName: "id", - type: { - name: "String", - }, - }, - relativePath: { - serializedName: "relativePath", - type: { - name: "String", - }, - }, - contentVersion: { - serializedName: "contentVersion", - type: { - name: "String", - }, - }, - queryString: { - serializedName: "queryString", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DeploymentParameter: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DeploymentParameter", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "any", - }, - }, - 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 ParametersLink: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ParametersLink", - modelProperties: { - uri: { - serializedName: "uri", - required: true, - type: { - name: "String", - }, - }, - contentVersion: { - serializedName: "contentVersion", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DebugSetting: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DebugSetting", - modelProperties: { - detailLevel: { - serializedName: "detailLevel", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const OnErrorDeployment: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OnErrorDeployment", - modelProperties: { - type: { - serializedName: "type", - type: { - name: "Enum", - allowedValues: ["LastSuccessful", "SpecificDeployment"], - }, - }, - deploymentName: { - serializedName: "deploymentName", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ExpressionEvaluationOptions: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ExpressionEvaluationOptions", - modelProperties: { - scope: { - serializedName: "scope", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DeploymentExtended: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DeploymentExtended", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "DeploymentPropertiesExtended", - }, - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const DeploymentPropertiesExtended: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DeploymentPropertiesExtended", - modelProperties: { - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - correlationId: { - serializedName: "correlationId", - readOnly: true, - type: { - name: "String", - }, - }, - timestamp: { - serializedName: "timestamp", - readOnly: true, - type: { - name: "DateTime", - }, - }, - duration: { - serializedName: "duration", - readOnly: true, - type: { - name: "String", - }, - }, - outputs: { - serializedName: "outputs", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "any" } }, - }, - }, - providers: { - serializedName: "providers", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Provider", - }, - }, - }, - }, - dependencies: { - serializedName: "dependencies", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Dependency", - }, - }, - }, - }, - templateLink: { - serializedName: "templateLink", - type: { - name: "Composite", - className: "TemplateLink", - }, - }, - parameters: { - serializedName: "parameters", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "any" } }, - }, - }, - parametersLink: { - serializedName: "parametersLink", - type: { - name: "Composite", - className: "ParametersLink", - }, - }, - mode: { - serializedName: "mode", - readOnly: true, - type: { - name: "Enum", - allowedValues: ["Incremental", "Complete"], - }, - }, - debugSetting: { - serializedName: "debugSetting", - type: { - name: "Composite", - className: "DebugSetting", - }, - }, - onErrorDeployment: { - serializedName: "onErrorDeployment", - type: { - name: "Composite", - className: "OnErrorDeploymentExtended", - }, - }, - templateHash: { - serializedName: "templateHash", - readOnly: true, - type: { - name: "String", - }, - }, - outputResources: { - serializedName: "outputResources", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceReference", - }, - }, - }, - }, - validatedResources: { - serializedName: "validatedResources", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceReference", - }, - }, - }, - }, - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ErrorResponse", - }, - }, - diagnostics: { - serializedName: "diagnostics", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DeploymentDiagnosticsDefinition", - }, - }, - }, - }, - validationLevel: { - serializedName: "validationLevel", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const Provider: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Provider", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - namespace: { - serializedName: "namespace", - type: { - name: "String", - }, - }, - registrationState: { - serializedName: "registrationState", - readOnly: true, - type: { - name: "String", - }, - }, - registrationPolicy: { - serializedName: "registrationPolicy", - readOnly: true, - type: { - name: "String", - }, - }, - resourceTypes: { - serializedName: "resourceTypes", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ProviderResourceType", - }, - }, - }, - }, - providerAuthorizationConsentState: { - serializedName: "providerAuthorizationConsentState", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ProviderResourceType: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ProviderResourceType", - modelProperties: { - resourceType: { - serializedName: "resourceType", - type: { - name: "String", - }, - }, - locations: { - serializedName: "locations", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - locationMappings: { - serializedName: "locationMappings", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ProviderExtendedLocation", - }, - }, - }, - }, - aliases: { - serializedName: "aliases", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Alias", - }, - }, - }, - }, - apiVersions: { - serializedName: "apiVersions", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - defaultApiVersion: { - serializedName: "defaultApiVersion", - readOnly: true, - type: { - name: "String", - }, - }, - zoneMappings: { - serializedName: "zoneMappings", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ZoneMapping", - }, - }, - }, - }, - apiProfiles: { - serializedName: "apiProfiles", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ApiProfile", - }, - }, - }, - }, - capabilities: { - serializedName: "capabilities", - type: { - name: "String", - }, - }, - properties: { - serializedName: "properties", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const ProviderExtendedLocation: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ProviderExtendedLocation", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - type: { - name: "String", - }, - }, - extendedLocations: { - serializedName: "extendedLocations", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const Alias: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Alias", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - paths: { - serializedName: "paths", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AliasPath", - }, - }, - }, - }, - type: { - serializedName: "type", - type: { - name: "Enum", - allowedValues: ["NotSpecified", "PlainText", "Mask"], - }, - }, - defaultPath: { - serializedName: "defaultPath", - type: { - name: "String", - }, - }, - defaultPattern: { - serializedName: "defaultPattern", - type: { - name: "Composite", - className: "AliasPattern", - }, - }, - defaultMetadata: { - serializedName: "defaultMetadata", - type: { - name: "Composite", - className: "AliasPathMetadata", - }, - }, - }, - }, -}; - -export const AliasPath: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AliasPath", - modelProperties: { - path: { - serializedName: "path", - type: { - name: "String", - }, - }, - apiVersions: { - serializedName: "apiVersions", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - pattern: { - serializedName: "pattern", - type: { - name: "Composite", - className: "AliasPattern", - }, - }, - metadata: { - serializedName: "metadata", - type: { - name: "Composite", - className: "AliasPathMetadata", - }, - }, - }, - }, -}; - -export const AliasPattern: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AliasPattern", - modelProperties: { - phrase: { - serializedName: "phrase", - type: { - name: "String", - }, - }, - variable: { - serializedName: "variable", - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - type: { - name: "Enum", - allowedValues: ["NotSpecified", "Extract"], - }, - }, - }, - }, -}; - -export const AliasPathMetadata: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AliasPathMetadata", - modelProperties: { - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - attributes: { - serializedName: "attributes", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ZoneMapping: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ZoneMapping", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - zones: { - serializedName: "zones", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const ApiProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApiProfile", - modelProperties: { - profileVersion: { - serializedName: "profileVersion", - readOnly: true, - type: { - name: "String", - }, - }, - apiVersion: { - serializedName: "apiVersion", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const Dependency: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Dependency", - modelProperties: { - dependsOn: { - serializedName: "dependsOn", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BasicDependency", - }, - }, - }, - }, - id: { - serializedName: "id", - type: { - name: "String", - }, - }, - resourceType: { - serializedName: "resourceType", - type: { - name: "String", - }, - }, - resourceName: { - serializedName: "resourceName", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const BasicDependency: coreClient.CompositeMapper = { +export const Provider: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BasicDependency", + className: "Provider", modelProperties: { id: { serializedName: "id", + readOnly: true, type: { name: "String", }, }, - resourceType: { - serializedName: "resourceType", + namespace: { + serializedName: "namespace", type: { name: "String", }, }, - resourceName: { - serializedName: "resourceName", + registrationState: { + serializedName: "registrationState", + readOnly: true, type: { name: "String", }, }, - }, - }, -}; - -export const OnErrorDeploymentExtended: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OnErrorDeploymentExtended", - modelProperties: { - provisioningState: { - serializedName: "provisioningState", + registrationPolicy: { + serializedName: "registrationPolicy", readOnly: true, type: { name: "String", }, }, - type: { - serializedName: "type", - type: { - name: "Enum", - allowedValues: ["LastSuccessful", "SpecificDeployment"], - }, - }, - deploymentName: { - serializedName: "deploymentName", + resourceTypes: { + serializedName: "resourceTypes", + readOnly: true, type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ProviderResourceType", + }, + }, }, }, - }, - }, -}; - -export const ResourceReference: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceReference", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, + providerAuthorizationConsentState: { + serializedName: "providerAuthorizationConsentState", type: { name: "String", }, @@ -1191,88 +241,97 @@ export const ResourceReference: coreClient.CompositeMapper = { }, }; -export const DeploymentDiagnosticsDefinition: coreClient.CompositeMapper = { +export const ProviderResourceType: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DeploymentDiagnosticsDefinition", + className: "ProviderResourceType", modelProperties: { - level: { - serializedName: "level", - required: true, - readOnly: true, - type: { - name: "String", - }, - }, - code: { - serializedName: "code", - required: true, - readOnly: true, + resourceType: { + serializedName: "resourceType", type: { name: "String", }, }, - message: { - serializedName: "message", - required: true, - readOnly: true, + locations: { + serializedName: "locations", type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "String", + }, + }, }, }, - target: { - serializedName: "target", - readOnly: true, + locationMappings: { + serializedName: "locationMappings", type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ProviderExtendedLocation", + }, + }, }, }, - additionalInfo: { - serializedName: "additionalInfo", - readOnly: true, + aliases: { + serializedName: "aliases", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ErrorAdditionalInfo", + className: "Alias", }, }, }, }, - }, - }, -}; - -export const DeploymentValidateResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DeploymentValidateResult", - modelProperties: { - error: { - serializedName: "error", + apiVersions: { + serializedName: "apiVersions", type: { - name: "Composite", - className: "ErrorResponse", + name: "Sequence", + element: { + type: { + name: "String", + }, + }, }, }, - id: { - serializedName: "id", + defaultApiVersion: { + serializedName: "defaultApiVersion", readOnly: true, type: { name: "String", }, }, - name: { - serializedName: "name", - readOnly: true, + zoneMappings: { + serializedName: "zoneMappings", type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ZoneMapping", + }, + }, }, }, - type: { - serializedName: "type", + apiProfiles: { + serializedName: "apiProfiles", readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ApiProfile", + }, + }, + }, + }, + capabilities: { + serializedName: "capabilities", type: { name: "String", }, @@ -1280,310 +339,209 @@ export const DeploymentValidateResult: coreClient.CompositeMapper = { properties: { serializedName: "properties", type: { - name: "Composite", - className: "DeploymentPropertiesExtended", + name: "Dictionary", + value: { type: { name: "String" } }, }, }, }, }, }; -export const DeploymentExportResult: coreClient.CompositeMapper = { +export const ProviderExtendedLocation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DeploymentExportResult", + className: "ProviderExtendedLocation", modelProperties: { - template: { - serializedName: "template", + location: { + serializedName: "location", type: { - name: "Dictionary", - value: { type: { name: "any" } }, + name: "String", }, }, - }, - }, -}; - -export const DeploymentListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DeploymentListResult", - modelProperties: { - value: { - serializedName: "value", + type: { + serializedName: "type", + type: { + name: "String", + }, + }, + extendedLocations: { + serializedName: "extendedLocations", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "DeploymentExtended", + name: "String", }, }, }, }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, }, }, }; -export const ScopedDeployment: coreClient.CompositeMapper = { +export const Alias: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ScopedDeployment", + className: "Alias", modelProperties: { - location: { - serializedName: "location", - required: true, + name: { + serializedName: "name", type: { name: "String", }, }, - properties: { - serializedName: "properties", + paths: { + serializedName: "paths", type: { - name: "Composite", - className: "DeploymentProperties", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AliasPath", + }, + }, }, }, - tags: { - serializedName: "tags", + type: { + serializedName: "type", type: { - name: "Dictionary", - value: { type: { name: "String" } }, + name: "Enum", + allowedValues: ["NotSpecified", "PlainText", "Mask"], }, }, - }, - }, -}; - -export const ScopedDeploymentWhatIf: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ScopedDeploymentWhatIf", - modelProperties: { - location: { - serializedName: "location", - required: true, + defaultPath: { + serializedName: "defaultPath", type: { name: "String", }, }, - properties: { - serializedName: "properties", + defaultPattern: { + serializedName: "defaultPattern", type: { name: "Composite", - className: "DeploymentWhatIfProperties", + className: "AliasPattern", }, }, - }, - }, -}; - -export const DeploymentWhatIfSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DeploymentWhatIfSettings", - modelProperties: { - resultFormat: { - serializedName: "resultFormat", + defaultMetadata: { + serializedName: "defaultMetadata", type: { - name: "Enum", - allowedValues: ["ResourceIdOnly", "FullResourcePayloads"], + name: "Composite", + className: "AliasPathMetadata", }, }, }, }, }; -export const WhatIfOperationResult: coreClient.CompositeMapper = { +export const AliasPath: coreClient.CompositeMapper = { type: { name: "Composite", - className: "WhatIfOperationResult", + className: "AliasPath", modelProperties: { - status: { - serializedName: "status", - type: { - name: "String", - }, - }, - error: { - serializedName: "error", + path: { + serializedName: "path", type: { - name: "Composite", - className: "ErrorResponse", + name: "String", }, }, - changes: { - serializedName: "properties.changes", + apiVersions: { + serializedName: "apiVersions", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "WhatIfChange", + name: "String", }, }, }, }, - potentialChanges: { - serializedName: "properties.potentialChanges", + pattern: { + serializedName: "pattern", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "WhatIfChange", - }, - }, + name: "Composite", + className: "AliasPattern", }, }, - diagnostics: { - serializedName: "properties.diagnostics", - readOnly: true, + metadata: { + serializedName: "metadata", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DeploymentDiagnosticsDefinition", - }, - }, + name: "Composite", + className: "AliasPathMetadata", }, }, }, }, }; -export const WhatIfChange: coreClient.CompositeMapper = { +export const AliasPattern: coreClient.CompositeMapper = { type: { name: "Composite", - className: "WhatIfChange", + className: "AliasPattern", modelProperties: { - resourceId: { - serializedName: "resourceId", - type: { - name: "String", - }, - }, - deploymentId: { - serializedName: "deploymentId", + phrase: { + serializedName: "phrase", type: { name: "String", }, }, - symbolicName: { - serializedName: "symbolicName", + variable: { + serializedName: "variable", type: { name: "String", }, }, - identifiers: { - serializedName: "identifiers", - type: { - name: "Dictionary", - value: { type: { name: "any" } }, - }, - }, - changeType: { - serializedName: "changeType", - required: true, + type: { + serializedName: "type", type: { name: "Enum", - allowedValues: [ - "Create", - "Delete", - "Ignore", - "Deploy", - "NoChange", - "Modify", - "Unsupported", - ], + allowedValues: ["NotSpecified", "Extract"], }, }, - unsupportedReason: { - serializedName: "unsupportedReason", + }, + }, +}; + +export const AliasPathMetadata: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AliasPathMetadata", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, type: { name: "String", }, }, - before: { - serializedName: "before", - type: { - name: "Dictionary", - value: { type: { name: "any" } }, - }, - }, - after: { - serializedName: "after", - type: { - name: "Dictionary", - value: { type: { name: "any" } }, - }, - }, - delta: { - serializedName: "delta", + attributes: { + serializedName: "attributes", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "WhatIfPropertyChange", - }, - }, + name: "String", }, }, }, }, }; -export const WhatIfPropertyChange: coreClient.CompositeMapper = { +export const ZoneMapping: coreClient.CompositeMapper = { type: { name: "Composite", - className: "WhatIfPropertyChange", + className: "ZoneMapping", modelProperties: { - path: { - serializedName: "path", - required: true, + location: { + serializedName: "location", type: { name: "String", }, }, - propertyChangeType: { - serializedName: "propertyChangeType", - required: true, - type: { - name: "Enum", - allowedValues: ["Create", "Delete", "Modify", "Array", "NoEffect"], - }, - }, - before: { - serializedName: "before", - type: { - name: "Dictionary", - value: { type: { name: "any" } }, - }, - }, - after: { - serializedName: "after", - type: { - name: "Dictionary", - value: { type: { name: "any" } }, - }, - }, - children: { - serializedName: "children", + zones: { + serializedName: "zones", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "WhatIfPropertyChange", + name: "String", }, }, }, @@ -1592,22 +550,23 @@ export const WhatIfPropertyChange: coreClient.CompositeMapper = { }, }; -export const DeploymentWhatIf: coreClient.CompositeMapper = { +export const ApiProfile: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DeploymentWhatIf", + className: "ApiProfile", modelProperties: { - location: { - serializedName: "location", + profileVersion: { + serializedName: "profileVersion", + readOnly: true, type: { name: "String", }, }, - properties: { - serializedName: "properties", + apiVersion: { + serializedName: "apiVersion", + readOnly: true, type: { - name: "Composite", - className: "DeploymentWhatIfProperties", + name: "String", }, }, }, @@ -2002,12 +961,7 @@ export const Identity: coreClient.CompositeMapper = { serializedName: "type", type: { name: "Enum", - allowedValues: [ - "SystemAssigned", - "UserAssigned", - "SystemAssigned, UserAssigned", - "None", - ], + allowedValues: ["SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", "None"], }, }, userAssignedIdentities: { @@ -2264,180 +1218,35 @@ export const ResourceGroupExportResult: coreClient.CompositeMapper = { type: { name: "Composite", className: "ResourceGroupExportResult", - modelProperties: { - template: { - serializedName: "template", - type: { - name: "Dictionary", - value: { type: { name: "any" } }, - }, - }, - output: { - serializedName: "output", - type: { - name: "String", - }, - }, - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ErrorResponse", - }, - }, - }, - }, -}; - -export const ResourceGroupListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceGroupListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceGroup", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ResourcesMoveInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourcesMoveInfo", - modelProperties: { - resources: { - serializedName: "resources", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - targetResourceGroup: { - serializedName: "targetResourceGroup", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const TagValue: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "TagValue", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - tagValue: { - serializedName: "tagValue", - type: { - name: "String", - }, - }, - count: { - serializedName: "count", - type: { - name: "Composite", - className: "TagCount", - }, - }, - }, - }, -}; - -export const TagCount: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "TagCount", - modelProperties: { - type: { - serializedName: "type", - type: { - name: "String", - }, - }, - value: { - serializedName: "value", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const TagDetails: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "TagDetails", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, + modelProperties: { + template: { + serializedName: "template", type: { - name: "String", + name: "Dictionary", + value: { type: { name: "any" } }, }, }, - tagName: { - serializedName: "tagName", + output: { + serializedName: "output", type: { name: "String", }, }, - count: { - serializedName: "count", + error: { + serializedName: "error", type: { name: "Composite", - className: "TagCount", - }, - }, - values: { - serializedName: "values", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "TagValue", - }, - }, + className: "ErrorResponse", }, }, }, }, }; -export const TagsListResult: coreClient.CompositeMapper = { +export const ResourceGroupListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TagsListResult", + className: "ResourceGroupListResult", modelProperties: { value: { serializedName: "value", @@ -2446,7 +1255,7 @@ export const TagsListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "TagDetails", + className: "ResourceGroup", }, }, }, @@ -2462,196 +1271,127 @@ export const TagsListResult: coreClient.CompositeMapper = { }, }; -export const DeploymentOperation: coreClient.CompositeMapper = { +export const ResourcesMoveInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DeploymentOperation", + className: "ResourcesMoveInfo", modelProperties: { - id: { - serializedName: "id", - readOnly: true, + resources: { + serializedName: "resources", type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "String", + }, + }, }, }, - operationId: { - serializedName: "operationId", - readOnly: true, + targetResourceGroup: { + serializedName: "targetResourceGroup", type: { name: "String", }, }, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "DeploymentOperationProperties", - }, - }, }, }, }; -export const DeploymentOperationProperties: coreClient.CompositeMapper = { +export const TagValue: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DeploymentOperationProperties", + className: "TagValue", modelProperties: { - provisioningOperation: { - serializedName: "provisioningOperation", - readOnly: true, - type: { - name: "Enum", - allowedValues: [ - "NotSpecified", - "Create", - "Delete", - "Waiting", - "AzureAsyncOperationWaiting", - "ResourceCacheWaiting", - "Action", - "Read", - "EvaluateDeploymentOutput", - "DeploymentCleanup", - ], - }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - timestamp: { - serializedName: "timestamp", - readOnly: true, - type: { - name: "DateTime", - }, - }, - duration: { - serializedName: "duration", - readOnly: true, - type: { - name: "String", - }, - }, - serviceRequestId: { - serializedName: "serviceRequestId", + id: { + serializedName: "id", readOnly: true, type: { name: "String", }, }, - statusCode: { - serializedName: "statusCode", - readOnly: true, + tagValue: { + serializedName: "tagValue", type: { name: "String", }, }, - statusMessage: { - serializedName: "statusMessage", - type: { - name: "Composite", - className: "StatusMessage", - }, - }, - targetResource: { - serializedName: "targetResource", - type: { - name: "Composite", - className: "TargetResource", - }, - }, - request: { - serializedName: "request", - type: { - name: "Composite", - className: "HttpMessage", - }, - }, - response: { - serializedName: "response", + count: { + serializedName: "count", type: { name: "Composite", - className: "HttpMessage", + className: "TagCount", }, }, }, }, }; -export const StatusMessage: coreClient.CompositeMapper = { +export const TagCount: coreClient.CompositeMapper = { type: { name: "Composite", - className: "StatusMessage", + className: "TagCount", modelProperties: { - status: { - serializedName: "status", + type: { + serializedName: "type", type: { name: "String", }, }, - error: { - serializedName: "error", + value: { + serializedName: "value", type: { - name: "Composite", - className: "ErrorResponse", + name: "Number", }, }, }, }, }; -export const TargetResource: coreClient.CompositeMapper = { +export const TagDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TargetResource", + className: "TagDetails", modelProperties: { id: { serializedName: "id", + readOnly: true, type: { name: "String", }, }, - resourceName: { - serializedName: "resourceName", + tagName: { + serializedName: "tagName", type: { name: "String", }, }, - resourceType: { - serializedName: "resourceType", + count: { + serializedName: "count", type: { - name: "String", + name: "Composite", + className: "TagCount", }, }, - }, - }, -}; - -export const HttpMessage: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "HttpMessage", - modelProperties: { - content: { - serializedName: "content", + values: { + serializedName: "values", type: { - name: "Dictionary", - value: { type: { name: "any" } }, + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TagValue", + }, + }, }, }, }, }, }; -export const DeploymentOperationsListResult: coreClient.CompositeMapper = { +export const TagsListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DeploymentOperationsListResult", + className: "TagsListResult", modelProperties: { value: { serializedName: "value", @@ -2660,7 +1400,7 @@ export const DeploymentOperationsListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "DeploymentOperation", + className: "TagDetails", }, }, }, @@ -2676,27 +1416,6 @@ export const DeploymentOperationsListResult: coreClient.CompositeMapper = { }, }; -export const TemplateHashResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "TemplateHashResult", - modelProperties: { - minifiedTemplate: { - serializedName: "minifiedTemplate", - type: { - name: "String", - }, - }, - templateHash: { - serializedName: "templateHash", - type: { - name: "String", - }, - }, - }, - }, -}; - export const TagsResource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2772,21 +1491,6 @@ export const TagsPatchResource: coreClient.CompositeMapper = { }, }; -export const DeploymentExtendedFilter: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DeploymentExtendedFilter", - modelProperties: { - provisioningState: { - serializedName: "provisioningState", - type: { - name: "String", - }, - }, - }, - }, -}; - export const GenericResourceFilter: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2835,53 +1539,37 @@ export const ResourceGroupFilter: coreClient.CompositeMapper = { }, }; -export const ResourceProviderOperationDisplayProperties: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "ResourceProviderOperationDisplayProperties", - modelProperties: { - publisher: { - serializedName: "publisher", - type: { - name: "String", - }, - }, - provider: { - serializedName: "provider", - type: { - name: "String", - }, +export const ResourceProviderOperationDisplayProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceProviderOperationDisplayProperties", + modelProperties: { + publisher: { + serializedName: "publisher", + type: { + name: "String", }, - resource: { - serializedName: "resource", - type: { - name: "String", - }, + }, + provider: { + serializedName: "provider", + type: { + name: "String", }, - operation: { - serializedName: "operation", - type: { - name: "String", - }, + }, + resource: { + serializedName: "resource", + type: { + name: "String", }, - description: { - serializedName: "description", - type: { - name: "String", - }, + }, + operation: { + serializedName: "operation", + type: { + name: "String", }, }, - }, - }; - -export const SubResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SubResource", - modelProperties: { - id: { - serializedName: "id", + description: { + serializedName: "description", type: { name: "String", }, @@ -2890,17 +1578,15 @@ export const SubResource: coreClient.CompositeMapper = { }, }; -export const DeploymentWhatIfProperties: coreClient.CompositeMapper = { +export const SubResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DeploymentWhatIfProperties", + className: "SubResource", modelProperties: { - ...DeploymentProperties.type.modelProperties, - whatIfSettings: { - serializedName: "whatIfSettings", + id: { + serializedName: "id", type: { - name: "Composite", - className: "DeploymentWhatIfSettings", + name: "String", }, }, }, @@ -2991,93 +1677,6 @@ export const GenericResourceExpanded: coreClient.CompositeMapper = { }, }; -export const DeploymentsWhatIfAtTenantScopeHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "DeploymentsWhatIfAtTenantScopeHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "String", - }, - }, - }, - }, - }; - -export const DeploymentsWhatIfAtManagementGroupScopeHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "DeploymentsWhatIfAtManagementGroupScopeHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "String", - }, - }, - }, - }, - }; - -export const DeploymentsWhatIfAtSubscriptionScopeHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "DeploymentsWhatIfAtSubscriptionScopeHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "String", - }, - }, - }, - }, - }; - -export const DeploymentsWhatIfHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DeploymentsWhatIfHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "String", - }, - }, - }, - }, -}; - export const ResourceGroupsDeleteHeaders: coreClient.CompositeMapper = { type: { name: "Composite", diff --git a/sdk/resources/arm-resources/src/models/parameters.ts b/sdk/resources/arm-resources/src/models/parameters.ts index fa747f0a1510..81afb4cb9c8e 100644 --- a/sdk/resources/arm-resources/src/models/parameters.ts +++ b/sdk/resources/arm-resources/src/models/parameters.ts @@ -12,10 +12,6 @@ import { OperationQueryParameter, } from "@azure/core-client"; import { - Deployment as DeploymentMapper, - ScopedDeployment as ScopedDeploymentMapper, - ScopedDeploymentWhatIf as ScopedDeploymentWhatIfMapper, - DeploymentWhatIf as DeploymentWhatIfMapper, ProviderRegistrationRequest as ProviderRegistrationRequestMapper, ResourcesMoveInfo as ResourcesMoveInfoMapper, GenericResource as GenericResourceMapper, @@ -53,7 +49,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2024-11-01", + defaultValue: "2025-04-01", isConstant: true, serializedName: "api-version", type: { @@ -74,27 +70,21 @@ export const nextLink: OperationURLParameter = { skipEncoding: true, }; -export const scope: OperationURLParameter = { - parameterPath: "scope", +export const resourceProviderNamespace: OperationURLParameter = { + parameterPath: "resourceProviderNamespace", mapper: { - serializedName: "scope", + serializedName: "resourceProviderNamespace", required: true, type: { name: "String", }, }, - skipEncoding: true, }; -export const deploymentName: OperationURLParameter = { - parameterPath: "deploymentName", +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { - constraints: { - Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), - MaxLength: 64, - MinLength: 1, - }, - serializedName: "deploymentName", + serializedName: "subscriptionId", required: true, type: { name: "String", @@ -102,53 +92,6 @@ export const deploymentName: OperationURLParameter = { }, }; -export const contentType: OperationParameter = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/json", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String", - }, - }, -}; - -export const parameters: OperationParameter = { - parameterPath: "parameters", - mapper: DeploymentMapper, -}; - -export const filter: OperationQueryParameter = { - parameterPath: ["options", "filter"], - mapper: { - serializedName: "$filter", - type: { - name: "String", - }, - }, -}; - -export const top: OperationQueryParameter = { - parameterPath: ["options", "top"], - mapper: { - serializedName: "$top", - type: { - name: "Number", - }, - }, -}; - -export const parameters1: OperationParameter = { - parameterPath: "parameters", - mapper: ScopedDeploymentMapper, -}; - -export const parameters2: OperationParameter = { - parameterPath: "parameters", - mapper: ScopedDeploymentWhatIfMapper, -}; - export const groupId: OperationURLParameter = { parameterPath: "groupId", mapper: { @@ -164,20 +107,31 @@ export const groupId: OperationURLParameter = { }, }; -export const subscriptionId: OperationURLParameter = { - parameterPath: "subscriptionId", +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], mapper: { - serializedName: "subscriptionId", - required: true, + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", type: { name: "String", }, }, }; -export const parameters3: OperationParameter = { - parameterPath: "parameters", - mapper: DeploymentWhatIfMapper, +export const properties: OperationParameter = { + parameterPath: ["options", "properties"], + mapper: ProviderRegistrationRequestMapper, +}; + +export const expand: OperationQueryParameter = { + parameterPath: ["options", "expand"], + mapper: { + serializedName: "$expand", + type: { + name: "String", + }, + }, }; export const resourceGroupName: OperationURLParameter = { @@ -196,45 +150,27 @@ export const resourceGroupName: OperationURLParameter = { }, }; -export const template: OperationParameter = { - parameterPath: "template", - mapper: { - serializedName: "template", - required: true, - type: { - name: "Dictionary", - value: { type: { name: "any" } }, - }, - }, -}; - -export const resourceProviderNamespace: OperationURLParameter = { - parameterPath: "resourceProviderNamespace", +export const filter: OperationQueryParameter = { + parameterPath: ["options", "filter"], mapper: { - serializedName: "resourceProviderNamespace", - required: true, + serializedName: "$filter", type: { name: "String", }, }, }; -export const properties: OperationParameter = { - parameterPath: ["options", "properties"], - mapper: ProviderRegistrationRequestMapper, -}; - -export const expand: OperationQueryParameter = { - parameterPath: ["options", "expand"], +export const top: OperationQueryParameter = { + parameterPath: ["options", "top"], mapper: { - serializedName: "$expand", + serializedName: "$top", type: { - name: "String", + name: "Number", }, }, }; -export const parameters4: OperationParameter = { +export const parameters: OperationParameter = { parameterPath: "parameters", mapper: ResourcesMoveInfoMapper, }; @@ -301,7 +237,7 @@ export const apiVersion1: OperationQueryParameter = { }, }; -export const parameters5: OperationParameter = { +export const parameters1: OperationParameter = { parameterPath: "parameters", mapper: GenericResourceMapper, }; @@ -318,7 +254,7 @@ export const resourceId: OperationURLParameter = { skipEncoding: true, }; -export const parameters6: OperationParameter = { +export const parameters2: OperationParameter = { parameterPath: "parameters", mapper: ResourceGroupMapper, }; @@ -333,12 +269,12 @@ export const forceDeletionTypes: OperationQueryParameter = { }, }; -export const parameters7: OperationParameter = { +export const parameters3: OperationParameter = { parameterPath: "parameters", mapper: ResourceGroupPatchableMapper, }; -export const parameters8: OperationParameter = { +export const parameters4: OperationParameter = { parameterPath: "parameters", mapper: ExportTemplateRequestMapper, }; @@ -380,23 +316,24 @@ export const tagValue: OperationURLParameter = { }, }; -export const parameters9: OperationParameter = { +export const parameters5: OperationParameter = { parameterPath: "parameters", mapper: TagsResourceMapper, }; -export const parameters10: OperationParameter = { - parameterPath: "parameters", - mapper: TagsPatchResourceMapper, -}; - -export const operationId: OperationURLParameter = { - parameterPath: "operationId", +export const scope: OperationURLParameter = { + parameterPath: "scope", mapper: { - serializedName: "operationId", + serializedName: "scope", required: true, type: { name: "String", }, }, + skipEncoding: true, +}; + +export const parameters6: OperationParameter = { + parameterPath: "parameters", + mapper: TagsPatchResourceMapper, }; diff --git a/sdk/resources/arm-resources/src/operations/deploymentOperations.ts b/sdk/resources/arm-resources/src/operations/deploymentOperations.ts deleted file mode 100644 index f21b954bb697..000000000000 --- a/sdk/resources/arm-resources/src/operations/deploymentOperations.ts +++ /dev/null @@ -1,1006 +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 { DeploymentOperations } 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 { ResourceManagementClient } from "../resourceManagementClient.js"; -import { - DeploymentOperation, - DeploymentOperationsListAtScopeNextOptionalParams, - DeploymentOperationsListAtScopeOptionalParams, - DeploymentOperationsListAtScopeResponse, - DeploymentOperationsListAtTenantScopeNextOptionalParams, - DeploymentOperationsListAtTenantScopeOptionalParams, - DeploymentOperationsListAtTenantScopeResponse, - DeploymentOperationsListAtManagementGroupScopeNextOptionalParams, - DeploymentOperationsListAtManagementGroupScopeOptionalParams, - DeploymentOperationsListAtManagementGroupScopeResponse, - DeploymentOperationsListAtSubscriptionScopeNextOptionalParams, - DeploymentOperationsListAtSubscriptionScopeOptionalParams, - DeploymentOperationsListAtSubscriptionScopeResponse, - DeploymentOperationsListNextOptionalParams, - DeploymentOperationsListOptionalParams, - DeploymentOperationsListResponse, - DeploymentOperationsGetAtScopeOptionalParams, - DeploymentOperationsGetAtScopeResponse, - DeploymentOperationsGetAtTenantScopeOptionalParams, - DeploymentOperationsGetAtTenantScopeResponse, - DeploymentOperationsGetAtManagementGroupScopeOptionalParams, - DeploymentOperationsGetAtManagementGroupScopeResponse, - DeploymentOperationsGetAtSubscriptionScopeOptionalParams, - DeploymentOperationsGetAtSubscriptionScopeResponse, - DeploymentOperationsGetOptionalParams, - DeploymentOperationsGetResponse, - DeploymentOperationsListAtScopeNextResponse, - DeploymentOperationsListAtTenantScopeNextResponse, - DeploymentOperationsListAtManagementGroupScopeNextResponse, - DeploymentOperationsListAtSubscriptionScopeNextResponse, - DeploymentOperationsListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing DeploymentOperations operations. */ -export class DeploymentOperationsImpl implements DeploymentOperations { - private readonly client: ResourceManagementClient; - - /** - * Initialize a new instance of the class DeploymentOperations class. - * @param client Reference to the service client - */ - constructor(client: ResourceManagementClient) { - this.client = client; - } - - /** - * Gets all deployments operations for a deployment. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - public listAtScope( - scope: string, - deploymentName: string, - options?: DeploymentOperationsListAtScopeOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listAtScopePagingAll(scope, deploymentName, 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.listAtScopePagingPage( - scope, - deploymentName, - options, - settings, - ); - }, - }; - } - - private async *listAtScopePagingPage( - scope: string, - deploymentName: string, - options?: DeploymentOperationsListAtScopeOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DeploymentOperationsListAtScopeResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listAtScope(scope, deploymentName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listAtScopeNext( - scope, - deploymentName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listAtScopePagingAll( - scope: string, - deploymentName: string, - options?: DeploymentOperationsListAtScopeOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listAtScopePagingPage( - scope, - deploymentName, - options, - )) { - yield* page; - } - } - - /** - * Gets all deployments operations for a deployment. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - public listAtTenantScope( - deploymentName: string, - options?: DeploymentOperationsListAtTenantScopeOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listAtTenantScopePagingAll(deploymentName, 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.listAtTenantScopePagingPage( - deploymentName, - options, - settings, - ); - }, - }; - } - - private async *listAtTenantScopePagingPage( - deploymentName: string, - options?: DeploymentOperationsListAtTenantScopeOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DeploymentOperationsListAtTenantScopeResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listAtTenantScope(deploymentName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listAtTenantScopeNext( - deploymentName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listAtTenantScopePagingAll( - deploymentName: string, - options?: DeploymentOperationsListAtTenantScopeOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listAtTenantScopePagingPage( - deploymentName, - options, - )) { - yield* page; - } - } - - /** - * Gets all deployments operations for a deployment. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - public listAtManagementGroupScope( - groupId: string, - deploymentName: string, - options?: DeploymentOperationsListAtManagementGroupScopeOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listAtManagementGroupScopePagingAll( - groupId, - deploymentName, - 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.listAtManagementGroupScopePagingPage( - groupId, - deploymentName, - options, - settings, - ); - }, - }; - } - - private async *listAtManagementGroupScopePagingPage( - groupId: string, - deploymentName: string, - options?: DeploymentOperationsListAtManagementGroupScopeOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DeploymentOperationsListAtManagementGroupScopeResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listAtManagementGroupScope( - groupId, - deploymentName, - options, - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listAtManagementGroupScopeNext( - groupId, - deploymentName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listAtManagementGroupScopePagingAll( - groupId: string, - deploymentName: string, - options?: DeploymentOperationsListAtManagementGroupScopeOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listAtManagementGroupScopePagingPage( - groupId, - deploymentName, - options, - )) { - yield* page; - } - } - - /** - * Gets all deployments operations for a deployment. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - public listAtSubscriptionScope( - deploymentName: string, - options?: DeploymentOperationsListAtSubscriptionScopeOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listAtSubscriptionScopePagingAll(deploymentName, 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.listAtSubscriptionScopePagingPage( - deploymentName, - options, - settings, - ); - }, - }; - } - - private async *listAtSubscriptionScopePagingPage( - deploymentName: string, - options?: DeploymentOperationsListAtSubscriptionScopeOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DeploymentOperationsListAtSubscriptionScopeResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listAtSubscriptionScope(deploymentName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listAtSubscriptionScopeNext( - deploymentName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listAtSubscriptionScopePagingAll( - deploymentName: string, - options?: DeploymentOperationsListAtSubscriptionScopeOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listAtSubscriptionScopePagingPage( - deploymentName, - options, - )) { - yield* page; - } - } - - /** - * Gets all deployments operations for a deployment. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - public list( - resourceGroupName: string, - deploymentName: string, - options?: DeploymentOperationsListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceGroupName, deploymentName, 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.listPagingPage( - resourceGroupName, - deploymentName, - options, - settings, - ); - }, - }; - } - - private async *listPagingPage( - resourceGroupName: string, - deploymentName: string, - options?: DeploymentOperationsListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DeploymentOperationsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(resourceGroupName, deploymentName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext( - resourceGroupName, - deploymentName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - resourceGroupName: string, - deploymentName: string, - options?: DeploymentOperationsListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage( - resourceGroupName, - deploymentName, - options, - )) { - yield* page; - } - } - - /** - * Gets a deployments operation. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param options The options parameters. - */ - getAtScope( - scope: string, - deploymentName: string, - operationId: string, - options?: DeploymentOperationsGetAtScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { scope, deploymentName, operationId, options }, - getAtScopeOperationSpec, - ); - } - - /** - * Gets all deployments operations for a deployment. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - private _listAtScope( - scope: string, - deploymentName: string, - options?: DeploymentOperationsListAtScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { scope, deploymentName, options }, - listAtScopeOperationSpec, - ); - } - - /** - * Gets a deployments operation. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param options The options parameters. - */ - getAtTenantScope( - deploymentName: string, - operationId: string, - options?: DeploymentOperationsGetAtTenantScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { deploymentName, operationId, options }, - getAtTenantScopeOperationSpec, - ); - } - - /** - * Gets all deployments operations for a deployment. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - private _listAtTenantScope( - deploymentName: string, - options?: DeploymentOperationsListAtTenantScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { deploymentName, options }, - listAtTenantScopeOperationSpec, - ); - } - - /** - * Gets a deployments operation. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param options The options parameters. - */ - getAtManagementGroupScope( - groupId: string, - deploymentName: string, - operationId: string, - options?: DeploymentOperationsGetAtManagementGroupScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { groupId, deploymentName, operationId, options }, - getAtManagementGroupScopeOperationSpec, - ); - } - - /** - * Gets all deployments operations for a deployment. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - private _listAtManagementGroupScope( - groupId: string, - deploymentName: string, - options?: DeploymentOperationsListAtManagementGroupScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { groupId, deploymentName, options }, - listAtManagementGroupScopeOperationSpec, - ); - } - - /** - * Gets a deployments operation. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param options The options parameters. - */ - getAtSubscriptionScope( - deploymentName: string, - operationId: string, - options?: DeploymentOperationsGetAtSubscriptionScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { deploymentName, operationId, options }, - getAtSubscriptionScopeOperationSpec, - ); - } - - /** - * Gets all deployments operations for a deployment. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - private _listAtSubscriptionScope( - deploymentName: string, - options?: DeploymentOperationsListAtSubscriptionScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { deploymentName, options }, - listAtSubscriptionScopeOperationSpec, - ); - } - - /** - * Gets a deployments operation. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - deploymentName: string, - operationId: string, - options?: DeploymentOperationsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, deploymentName, operationId, options }, - getOperationSpec, - ); - } - - /** - * Gets all deployments operations for a deployment. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - private _list( - resourceGroupName: string, - deploymentName: string, - options?: DeploymentOperationsListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, deploymentName, options }, - listOperationSpec, - ); - } - - /** - * ListAtScopeNext - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param nextLink The nextLink from the previous successful call to the ListAtScope method. - * @param options The options parameters. - */ - private _listAtScopeNext( - scope: string, - deploymentName: string, - nextLink: string, - options?: DeploymentOperationsListAtScopeNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { scope, deploymentName, nextLink, options }, - listAtScopeNextOperationSpec, - ); - } - - /** - * ListAtTenantScopeNext - * @param deploymentName The name of the deployment. - * @param nextLink The nextLink from the previous successful call to the ListAtTenantScope method. - * @param options The options parameters. - */ - private _listAtTenantScopeNext( - deploymentName: string, - nextLink: string, - options?: DeploymentOperationsListAtTenantScopeNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { deploymentName, nextLink, options }, - listAtTenantScopeNextOperationSpec, - ); - } - - /** - * ListAtManagementGroupScopeNext - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param nextLink The nextLink from the previous successful call to the ListAtManagementGroupScope - * method. - * @param options The options parameters. - */ - private _listAtManagementGroupScopeNext( - groupId: string, - deploymentName: string, - nextLink: string, - options?: DeploymentOperationsListAtManagementGroupScopeNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { groupId, deploymentName, nextLink, options }, - listAtManagementGroupScopeNextOperationSpec, - ); - } - - /** - * ListAtSubscriptionScopeNext - * @param deploymentName The name of the deployment. - * @param nextLink The nextLink from the previous successful call to the ListAtSubscriptionScope - * method. - * @param options The options parameters. - */ - private _listAtSubscriptionScopeNext( - deploymentName: string, - nextLink: string, - options?: DeploymentOperationsListAtSubscriptionScopeNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { deploymentName, nextLink, options }, - listAtSubscriptionScopeNextOperationSpec, - ); - } - - /** - * ListNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - resourceGroupName: string, - deploymentName: string, - nextLink: string, - options?: DeploymentOperationsListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, deploymentName, nextLink, options }, - listNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getAtScopeOperationSpec: coreClient.OperationSpec = { - path: "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentOperation, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.deploymentName, - Parameters.operationId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listAtScopeOperationSpec: coreClient.OperationSpec = { - path: "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentOperationsListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.top], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.deploymentName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getAtTenantScopeOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentOperation, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.operationId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listAtTenantScopeOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Resources/deployments/{deploymentName}/operations", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentOperationsListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.top], - urlParameters: [Parameters.$host, Parameters.deploymentName], - headerParameters: [Parameters.accept], - serializer, -}; -const getAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentOperation, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.groupId, - Parameters.operationId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentOperationsListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.top], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.groupId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentOperation, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.subscriptionId, - Parameters.operationId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentOperationsListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.top], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.subscriptionId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations/{operationId}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentOperation, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.operationId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentOperationsListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.top], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listAtScopeNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentOperationsListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.scope, - Parameters.deploymentName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listAtTenantScopeNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentOperationsListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.deploymentName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listAtManagementGroupScopeNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentOperationsListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.deploymentName, - Parameters.groupId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listAtSubscriptionScopeNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentOperationsListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.deploymentName, - Parameters.subscriptionId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentOperationsListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.deploymentName, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/resources/arm-resources/src/operations/deployments.ts b/sdk/resources/arm-resources/src/operations/deployments.ts deleted file mode 100644 index 168fac57f88c..000000000000 --- a/sdk/resources/arm-resources/src/operations/deployments.ts +++ /dev/null @@ -1,3805 +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 { Deployments } 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 { ResourceManagementClient } from "../resourceManagementClient.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import { - DeploymentExtended, - DeploymentsListAtScopeNextOptionalParams, - DeploymentsListAtScopeOptionalParams, - DeploymentsListAtScopeResponse, - DeploymentsListAtTenantScopeNextOptionalParams, - DeploymentsListAtTenantScopeOptionalParams, - DeploymentsListAtTenantScopeResponse, - DeploymentsListAtManagementGroupScopeNextOptionalParams, - DeploymentsListAtManagementGroupScopeOptionalParams, - DeploymentsListAtManagementGroupScopeResponse, - DeploymentsListAtSubscriptionScopeNextOptionalParams, - DeploymentsListAtSubscriptionScopeOptionalParams, - DeploymentsListAtSubscriptionScopeResponse, - DeploymentsListByResourceGroupNextOptionalParams, - DeploymentsListByResourceGroupOptionalParams, - DeploymentsListByResourceGroupResponse, - DeploymentsDeleteAtScopeOptionalParams, - DeploymentsCheckExistenceAtScopeOptionalParams, - DeploymentsCheckExistenceAtScopeResponse, - Deployment, - DeploymentsCreateOrUpdateAtScopeOptionalParams, - DeploymentsCreateOrUpdateAtScopeResponse, - DeploymentsGetAtScopeOptionalParams, - DeploymentsGetAtScopeResponse, - DeploymentsCancelAtScopeOptionalParams, - DeploymentsValidateAtScopeOptionalParams, - DeploymentsValidateAtScopeResponse, - DeploymentsExportTemplateAtScopeOptionalParams, - DeploymentsExportTemplateAtScopeResponse, - DeploymentsDeleteAtTenantScopeOptionalParams, - DeploymentsCheckExistenceAtTenantScopeOptionalParams, - DeploymentsCheckExistenceAtTenantScopeResponse, - ScopedDeployment, - DeploymentsCreateOrUpdateAtTenantScopeOptionalParams, - DeploymentsCreateOrUpdateAtTenantScopeResponse, - DeploymentsGetAtTenantScopeOptionalParams, - DeploymentsGetAtTenantScopeResponse, - DeploymentsCancelAtTenantScopeOptionalParams, - DeploymentsValidateAtTenantScopeOptionalParams, - DeploymentsValidateAtTenantScopeResponse, - ScopedDeploymentWhatIf, - DeploymentsWhatIfAtTenantScopeOptionalParams, - DeploymentsWhatIfAtTenantScopeResponse, - DeploymentsExportTemplateAtTenantScopeOptionalParams, - DeploymentsExportTemplateAtTenantScopeResponse, - DeploymentsDeleteAtManagementGroupScopeOptionalParams, - DeploymentsCheckExistenceAtManagementGroupScopeOptionalParams, - DeploymentsCheckExistenceAtManagementGroupScopeResponse, - DeploymentsCreateOrUpdateAtManagementGroupScopeOptionalParams, - DeploymentsCreateOrUpdateAtManagementGroupScopeResponse, - DeploymentsGetAtManagementGroupScopeOptionalParams, - DeploymentsGetAtManagementGroupScopeResponse, - DeploymentsCancelAtManagementGroupScopeOptionalParams, - DeploymentsValidateAtManagementGroupScopeOptionalParams, - DeploymentsValidateAtManagementGroupScopeResponse, - DeploymentsWhatIfAtManagementGroupScopeOptionalParams, - DeploymentsWhatIfAtManagementGroupScopeResponse, - DeploymentsExportTemplateAtManagementGroupScopeOptionalParams, - DeploymentsExportTemplateAtManagementGroupScopeResponse, - DeploymentsDeleteAtSubscriptionScopeOptionalParams, - DeploymentsCheckExistenceAtSubscriptionScopeOptionalParams, - DeploymentsCheckExistenceAtSubscriptionScopeResponse, - DeploymentsCreateOrUpdateAtSubscriptionScopeOptionalParams, - DeploymentsCreateOrUpdateAtSubscriptionScopeResponse, - DeploymentsGetAtSubscriptionScopeOptionalParams, - DeploymentsGetAtSubscriptionScopeResponse, - DeploymentsCancelAtSubscriptionScopeOptionalParams, - DeploymentsValidateAtSubscriptionScopeOptionalParams, - DeploymentsValidateAtSubscriptionScopeResponse, - DeploymentWhatIf, - DeploymentsWhatIfAtSubscriptionScopeOptionalParams, - DeploymentsWhatIfAtSubscriptionScopeResponse, - DeploymentsExportTemplateAtSubscriptionScopeOptionalParams, - DeploymentsExportTemplateAtSubscriptionScopeResponse, - DeploymentsDeleteOptionalParams, - DeploymentsCheckExistenceOptionalParams, - DeploymentsCheckExistenceResponse, - DeploymentsCreateOrUpdateOptionalParams, - DeploymentsCreateOrUpdateResponse, - DeploymentsGetOptionalParams, - DeploymentsGetResponse, - DeploymentsCancelOptionalParams, - DeploymentsValidateOptionalParams, - DeploymentsValidateResponse, - DeploymentsWhatIfOptionalParams, - DeploymentsWhatIfResponse, - DeploymentsExportTemplateOptionalParams, - DeploymentsExportTemplateResponse, - DeploymentsCalculateTemplateHashOptionalParams, - DeploymentsCalculateTemplateHashResponse, - DeploymentsListAtScopeNextResponse, - DeploymentsListAtTenantScopeNextResponse, - DeploymentsListAtManagementGroupScopeNextResponse, - DeploymentsListAtSubscriptionScopeNextResponse, - DeploymentsListByResourceGroupNextResponse, -} from "../models/index.js"; - -/// -/** Class containing Deployments operations. */ -export class DeploymentsImpl implements Deployments { - private readonly client: ResourceManagementClient; - - /** - * Initialize a new instance of the class Deployments class. - * @param client Reference to the service client - */ - constructor(client: ResourceManagementClient) { - this.client = client; - } - - /** - * Get all the deployments at the given scope. - * @param scope The resource scope. - * @param options The options parameters. - */ - public listAtScope( - scope: string, - options?: DeploymentsListAtScopeOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listAtScopePagingAll(scope, 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.listAtScopePagingPage(scope, options, settings); - }, - }; - } - - private async *listAtScopePagingPage( - scope: string, - options?: DeploymentsListAtScopeOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DeploymentsListAtScopeResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listAtScope(scope, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listAtScopeNext(scope, continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listAtScopePagingAll( - scope: string, - options?: DeploymentsListAtScopeOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listAtScopePagingPage(scope, options)) { - yield* page; - } - } - - /** - * Get all the deployments at the tenant scope. - * @param options The options parameters. - */ - public listAtTenantScope( - options?: DeploymentsListAtTenantScopeOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listAtTenantScopePagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listAtTenantScopePagingPage(options, settings); - }, - }; - } - - private async *listAtTenantScopePagingPage( - options?: DeploymentsListAtTenantScopeOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DeploymentsListAtTenantScopeResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listAtTenantScope(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listAtTenantScopeNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listAtTenantScopePagingAll( - options?: DeploymentsListAtTenantScopeOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listAtTenantScopePagingPage(options)) { - yield* page; - } - } - - /** - * Get all the deployments for a management group. - * @param groupId The management group ID. - * @param options The options parameters. - */ - public listAtManagementGroupScope( - groupId: string, - options?: DeploymentsListAtManagementGroupScopeOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listAtManagementGroupScopePagingAll(groupId, 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.listAtManagementGroupScopePagingPage( - groupId, - options, - settings, - ); - }, - }; - } - - private async *listAtManagementGroupScopePagingPage( - groupId: string, - options?: DeploymentsListAtManagementGroupScopeOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DeploymentsListAtManagementGroupScopeResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listAtManagementGroupScope(groupId, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listAtManagementGroupScopeNext( - groupId, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listAtManagementGroupScopePagingAll( - groupId: string, - options?: DeploymentsListAtManagementGroupScopeOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listAtManagementGroupScopePagingPage( - groupId, - options, - )) { - yield* page; - } - } - - /** - * Get all the deployments for a subscription. - * @param options The options parameters. - */ - public listAtSubscriptionScope( - options?: DeploymentsListAtSubscriptionScopeOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listAtSubscriptionScopePagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listAtSubscriptionScopePagingPage(options, settings); - }, - }; - } - - private async *listAtSubscriptionScopePagingPage( - options?: DeploymentsListAtSubscriptionScopeOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DeploymentsListAtSubscriptionScopeResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listAtSubscriptionScope(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listAtSubscriptionScopeNext( - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listAtSubscriptionScopePagingAll( - options?: DeploymentsListAtSubscriptionScopeOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listAtSubscriptionScopePagingPage(options)) { - yield* page; - } - } - - /** - * Get all the deployments for a resource group. - * @param resourceGroupName The name of the resource group with the deployments to get. The name is - * case insensitive. - * @param options The options parameters. - */ - public listByResourceGroup( - resourceGroupName: string, - options?: DeploymentsListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(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.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings, - ); - }, - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: DeploymentsListByResourceGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DeploymentsListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceGroupNext( - resourceGroupName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: DeploymentsListByResourceGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage( - resourceGroupName, - options, - )) { - yield* page; - } - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment - * removes the associated deployment operations. This is an asynchronous operation that returns a - * status of 202 until the template deployment is successfully deleted. The Location response header - * contains the URI that is used to obtain the status of the process. While the process is running, a - * call to the URI in the Location header returns a status of 202. When the process finishes, the URI - * in the Location header returns a status of 204 on success. If the asynchronous request failed, the - * URI in the Location header returns an error-level status code. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - async beginDeleteAtScope( - scope: string, - deploymentName: string, - options?: DeploymentsDeleteAtScopeOptionalParams, - ): 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: { scope, deploymentName, options }, - spec: deleteAtScopeOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment - * removes the associated deployment operations. This is an asynchronous operation that returns a - * status of 202 until the template deployment is successfully deleted. The Location response header - * contains the URI that is used to obtain the status of the process. While the process is running, a - * call to the URI in the Location header returns a status of 202. When the process finishes, the URI - * in the Location header returns a status of 204 on success. If the asynchronous request failed, the - * URI in the Location header returns an error-level status code. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - async beginDeleteAtScopeAndWait( - scope: string, - deploymentName: string, - options?: DeploymentsDeleteAtScopeOptionalParams, - ): Promise { - const poller = await this.beginDeleteAtScope( - scope, - deploymentName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Checks whether the deployment exists. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - checkExistenceAtScope( - scope: string, - deploymentName: string, - options?: DeploymentsCheckExistenceAtScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { scope, deploymentName, options }, - checkExistenceAtScopeOperationSpec, - ); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAtScope( - scope: string, - deploymentName: string, - parameters: Deployment, - options?: DeploymentsCreateOrUpdateAtScopeOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentsCreateOrUpdateAtScopeResponse - > - > { - 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: { scope, deploymentName, parameters, options }, - spec: createOrUpdateAtScopeOperationSpec, - }); - const poller = await createHttpPoller< - DeploymentsCreateOrUpdateAtScopeResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAtScopeAndWait( - scope: string, - deploymentName: string, - parameters: Deployment, - options?: DeploymentsCreateOrUpdateAtScopeOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdateAtScope( - scope, - deploymentName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Gets a deployment. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - getAtScope( - scope: string, - deploymentName: string, - options?: DeploymentsGetAtScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { scope, deploymentName, options }, - getAtScopeOperationSpec, - ); - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the - * deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment - * stops the currently running template deployment and leaves the resources partially deployed. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - cancelAtScope( - scope: string, - deploymentName: string, - options?: DeploymentsCancelAtScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { scope, deploymentName, options }, - cancelAtScopeOperationSpec, - ); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure - * Resource Manager.. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - async beginValidateAtScope( - scope: string, - deploymentName: string, - parameters: Deployment, - options?: DeploymentsValidateAtScopeOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentsValidateAtScopeResponse - > - > { - 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: { scope, deploymentName, parameters, options }, - spec: validateAtScopeOperationSpec, - }); - const poller = await createHttpPoller< - DeploymentsValidateAtScopeResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure - * Resource Manager.. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - async beginValidateAtScopeAndWait( - scope: string, - deploymentName: string, - parameters: Deployment, - options?: DeploymentsValidateAtScopeOptionalParams, - ): Promise { - const poller = await this.beginValidateAtScope( - scope, - deploymentName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Exports the template used for specified deployment. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - exportTemplateAtScope( - scope: string, - deploymentName: string, - options?: DeploymentsExportTemplateAtScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { scope, deploymentName, options }, - exportTemplateAtScopeOperationSpec, - ); - } - - /** - * Get all the deployments at the given scope. - * @param scope The resource scope. - * @param options The options parameters. - */ - private _listAtScope( - scope: string, - options?: DeploymentsListAtScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { scope, options }, - listAtScopeOperationSpec, - ); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment - * removes the associated deployment operations. This is an asynchronous operation that returns a - * status of 202 until the template deployment is successfully deleted. The Location response header - * contains the URI that is used to obtain the status of the process. While the process is running, a - * call to the URI in the Location header returns a status of 202. When the process finishes, the URI - * in the Location header returns a status of 204 on success. If the asynchronous request failed, the - * URI in the Location header returns an error-level status code. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - async beginDeleteAtTenantScope( - deploymentName: string, - options?: DeploymentsDeleteAtTenantScopeOptionalParams, - ): 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: { deploymentName, options }, - spec: deleteAtTenantScopeOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment - * removes the associated deployment operations. This is an asynchronous operation that returns a - * status of 202 until the template deployment is successfully deleted. The Location response header - * contains the URI that is used to obtain the status of the process. While the process is running, a - * call to the URI in the Location header returns a status of 202. When the process finishes, the URI - * in the Location header returns a status of 204 on success. If the asynchronous request failed, the - * URI in the Location header returns an error-level status code. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - async beginDeleteAtTenantScopeAndWait( - deploymentName: string, - options?: DeploymentsDeleteAtTenantScopeOptionalParams, - ): Promise { - const poller = await this.beginDeleteAtTenantScope(deploymentName, options); - return poller.pollUntilDone(); - } - - /** - * Checks whether the deployment exists. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - checkExistenceAtTenantScope( - deploymentName: string, - options?: DeploymentsCheckExistenceAtTenantScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { deploymentName, options }, - checkExistenceAtTenantScopeOperationSpec, - ); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAtTenantScope( - deploymentName: string, - parameters: ScopedDeployment, - options?: DeploymentsCreateOrUpdateAtTenantScopeOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentsCreateOrUpdateAtTenantScopeResponse - > - > { - 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: { deploymentName, parameters, options }, - spec: createOrUpdateAtTenantScopeOperationSpec, - }); - const poller = await createHttpPoller< - DeploymentsCreateOrUpdateAtTenantScopeResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAtTenantScopeAndWait( - deploymentName: string, - parameters: ScopedDeployment, - options?: DeploymentsCreateOrUpdateAtTenantScopeOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdateAtTenantScope( - deploymentName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Gets a deployment. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - getAtTenantScope( - deploymentName: string, - options?: DeploymentsGetAtTenantScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { deploymentName, options }, - getAtTenantScopeOperationSpec, - ); - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the - * deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment - * stops the currently running template deployment and leaves the resources partially deployed. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - cancelAtTenantScope( - deploymentName: string, - options?: DeploymentsCancelAtTenantScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { deploymentName, options }, - cancelAtTenantScopeOperationSpec, - ); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure - * Resource Manager.. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - async beginValidateAtTenantScope( - deploymentName: string, - parameters: ScopedDeployment, - options?: DeploymentsValidateAtTenantScopeOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentsValidateAtTenantScopeResponse - > - > { - 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: { deploymentName, parameters, options }, - spec: validateAtTenantScopeOperationSpec, - }); - const poller = await createHttpPoller< - DeploymentsValidateAtTenantScopeResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure - * Resource Manager.. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - async beginValidateAtTenantScopeAndWait( - deploymentName: string, - parameters: ScopedDeployment, - options?: DeploymentsValidateAtTenantScopeOptionalParams, - ): Promise { - const poller = await this.beginValidateAtTenantScope( - deploymentName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the tenant group. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - async beginWhatIfAtTenantScope( - deploymentName: string, - parameters: ScopedDeploymentWhatIf, - options?: DeploymentsWhatIfAtTenantScopeOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentsWhatIfAtTenantScopeResponse - > - > { - 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: { deploymentName, parameters, options }, - spec: whatIfAtTenantScopeOperationSpec, - }); - const poller = await createHttpPoller< - DeploymentsWhatIfAtTenantScopeResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the tenant group. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - async beginWhatIfAtTenantScopeAndWait( - deploymentName: string, - parameters: ScopedDeploymentWhatIf, - options?: DeploymentsWhatIfAtTenantScopeOptionalParams, - ): Promise { - const poller = await this.beginWhatIfAtTenantScope( - deploymentName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Exports the template used for specified deployment. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - exportTemplateAtTenantScope( - deploymentName: string, - options?: DeploymentsExportTemplateAtTenantScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { deploymentName, options }, - exportTemplateAtTenantScopeOperationSpec, - ); - } - - /** - * Get all the deployments at the tenant scope. - * @param options The options parameters. - */ - private _listAtTenantScope( - options?: DeploymentsListAtTenantScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { options }, - listAtTenantScopeOperationSpec, - ); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment - * removes the associated deployment operations. This is an asynchronous operation that returns a - * status of 202 until the template deployment is successfully deleted. The Location response header - * contains the URI that is used to obtain the status of the process. While the process is running, a - * call to the URI in the Location header returns a status of 202. When the process finishes, the URI - * in the Location header returns a status of 204 on success. If the asynchronous request failed, the - * URI in the Location header returns an error-level status code. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - async beginDeleteAtManagementGroupScope( - groupId: string, - deploymentName: string, - options?: DeploymentsDeleteAtManagementGroupScopeOptionalParams, - ): 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: { groupId, deploymentName, options }, - spec: deleteAtManagementGroupScopeOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment - * removes the associated deployment operations. This is an asynchronous operation that returns a - * status of 202 until the template deployment is successfully deleted. The Location response header - * contains the URI that is used to obtain the status of the process. While the process is running, a - * call to the URI in the Location header returns a status of 202. When the process finishes, the URI - * in the Location header returns a status of 204 on success. If the asynchronous request failed, the - * URI in the Location header returns an error-level status code. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - async beginDeleteAtManagementGroupScopeAndWait( - groupId: string, - deploymentName: string, - options?: DeploymentsDeleteAtManagementGroupScopeOptionalParams, - ): Promise { - const poller = await this.beginDeleteAtManagementGroupScope( - groupId, - deploymentName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Checks whether the deployment exists. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - checkExistenceAtManagementGroupScope( - groupId: string, - deploymentName: string, - options?: DeploymentsCheckExistenceAtManagementGroupScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { groupId, deploymentName, options }, - checkExistenceAtManagementGroupScopeOperationSpec, - ); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAtManagementGroupScope( - groupId: string, - deploymentName: string, - parameters: ScopedDeployment, - options?: DeploymentsCreateOrUpdateAtManagementGroupScopeOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentsCreateOrUpdateAtManagementGroupScopeResponse - > - > { - 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: { groupId, deploymentName, parameters, options }, - spec: createOrUpdateAtManagementGroupScopeOperationSpec, - }); - const poller = await createHttpPoller< - DeploymentsCreateOrUpdateAtManagementGroupScopeResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAtManagementGroupScopeAndWait( - groupId: string, - deploymentName: string, - parameters: ScopedDeployment, - options?: DeploymentsCreateOrUpdateAtManagementGroupScopeOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdateAtManagementGroupScope( - groupId, - deploymentName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Gets a deployment. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - getAtManagementGroupScope( - groupId: string, - deploymentName: string, - options?: DeploymentsGetAtManagementGroupScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { groupId, deploymentName, options }, - getAtManagementGroupScopeOperationSpec, - ); - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the - * deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment - * stops the currently running template deployment and leaves the resources partially deployed. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - cancelAtManagementGroupScope( - groupId: string, - deploymentName: string, - options?: DeploymentsCancelAtManagementGroupScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { groupId, deploymentName, options }, - cancelAtManagementGroupScopeOperationSpec, - ); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure - * Resource Manager.. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - async beginValidateAtManagementGroupScope( - groupId: string, - deploymentName: string, - parameters: ScopedDeployment, - options?: DeploymentsValidateAtManagementGroupScopeOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentsValidateAtManagementGroupScopeResponse - > - > { - 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: { groupId, deploymentName, parameters, options }, - spec: validateAtManagementGroupScopeOperationSpec, - }); - const poller = await createHttpPoller< - DeploymentsValidateAtManagementGroupScopeResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure - * Resource Manager.. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - async beginValidateAtManagementGroupScopeAndWait( - groupId: string, - deploymentName: string, - parameters: ScopedDeployment, - options?: DeploymentsValidateAtManagementGroupScopeOptionalParams, - ): Promise { - const poller = await this.beginValidateAtManagementGroupScope( - groupId, - deploymentName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the management - * group. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - async beginWhatIfAtManagementGroupScope( - groupId: string, - deploymentName: string, - parameters: ScopedDeploymentWhatIf, - options?: DeploymentsWhatIfAtManagementGroupScopeOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentsWhatIfAtManagementGroupScopeResponse - > - > { - 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: { groupId, deploymentName, parameters, options }, - spec: whatIfAtManagementGroupScopeOperationSpec, - }); - const poller = await createHttpPoller< - DeploymentsWhatIfAtManagementGroupScopeResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the management - * group. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - async beginWhatIfAtManagementGroupScopeAndWait( - groupId: string, - deploymentName: string, - parameters: ScopedDeploymentWhatIf, - options?: DeploymentsWhatIfAtManagementGroupScopeOptionalParams, - ): Promise { - const poller = await this.beginWhatIfAtManagementGroupScope( - groupId, - deploymentName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Exports the template used for specified deployment. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - exportTemplateAtManagementGroupScope( - groupId: string, - deploymentName: string, - options?: DeploymentsExportTemplateAtManagementGroupScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { groupId, deploymentName, options }, - exportTemplateAtManagementGroupScopeOperationSpec, - ); - } - - /** - * Get all the deployments for a management group. - * @param groupId The management group ID. - * @param options The options parameters. - */ - private _listAtManagementGroupScope( - groupId: string, - options?: DeploymentsListAtManagementGroupScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { groupId, options }, - listAtManagementGroupScopeOperationSpec, - ); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment - * removes the associated deployment operations. This is an asynchronous operation that returns a - * status of 202 until the template deployment is successfully deleted. The Location response header - * contains the URI that is used to obtain the status of the process. While the process is running, a - * call to the URI in the Location header returns a status of 202. When the process finishes, the URI - * in the Location header returns a status of 204 on success. If the asynchronous request failed, the - * URI in the Location header returns an error-level status code. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - async beginDeleteAtSubscriptionScope( - deploymentName: string, - options?: DeploymentsDeleteAtSubscriptionScopeOptionalParams, - ): 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: { deploymentName, options }, - spec: deleteAtSubscriptionScopeOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment - * removes the associated deployment operations. This is an asynchronous operation that returns a - * status of 202 until the template deployment is successfully deleted. The Location response header - * contains the URI that is used to obtain the status of the process. While the process is running, a - * call to the URI in the Location header returns a status of 202. When the process finishes, the URI - * in the Location header returns a status of 204 on success. If the asynchronous request failed, the - * URI in the Location header returns an error-level status code. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - async beginDeleteAtSubscriptionScopeAndWait( - deploymentName: string, - options?: DeploymentsDeleteAtSubscriptionScopeOptionalParams, - ): Promise { - const poller = await this.beginDeleteAtSubscriptionScope( - deploymentName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Checks whether the deployment exists. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - checkExistenceAtSubscriptionScope( - deploymentName: string, - options?: DeploymentsCheckExistenceAtSubscriptionScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { deploymentName, options }, - checkExistenceAtSubscriptionScopeOperationSpec, - ); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAtSubscriptionScope( - deploymentName: string, - parameters: Deployment, - options?: DeploymentsCreateOrUpdateAtSubscriptionScopeOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentsCreateOrUpdateAtSubscriptionScopeResponse - > - > { - 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: { deploymentName, parameters, options }, - spec: createOrUpdateAtSubscriptionScopeOperationSpec, - }); - const poller = await createHttpPoller< - DeploymentsCreateOrUpdateAtSubscriptionScopeResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAtSubscriptionScopeAndWait( - deploymentName: string, - parameters: Deployment, - options?: DeploymentsCreateOrUpdateAtSubscriptionScopeOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdateAtSubscriptionScope( - deploymentName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Gets a deployment. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - getAtSubscriptionScope( - deploymentName: string, - options?: DeploymentsGetAtSubscriptionScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { deploymentName, options }, - getAtSubscriptionScopeOperationSpec, - ); - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the - * deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment - * stops the currently running template deployment and leaves the resources partially deployed. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - cancelAtSubscriptionScope( - deploymentName: string, - options?: DeploymentsCancelAtSubscriptionScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { deploymentName, options }, - cancelAtSubscriptionScopeOperationSpec, - ); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure - * Resource Manager.. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - async beginValidateAtSubscriptionScope( - deploymentName: string, - parameters: Deployment, - options?: DeploymentsValidateAtSubscriptionScopeOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentsValidateAtSubscriptionScopeResponse - > - > { - 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: { deploymentName, parameters, options }, - spec: validateAtSubscriptionScopeOperationSpec, - }); - const poller = await createHttpPoller< - DeploymentsValidateAtSubscriptionScopeResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure - * Resource Manager.. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - async beginValidateAtSubscriptionScopeAndWait( - deploymentName: string, - parameters: Deployment, - options?: DeploymentsValidateAtSubscriptionScopeOptionalParams, - ): Promise { - const poller = await this.beginValidateAtSubscriptionScope( - deploymentName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the subscription. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to What If. - * @param options The options parameters. - */ - async beginWhatIfAtSubscriptionScope( - deploymentName: string, - parameters: DeploymentWhatIf, - options?: DeploymentsWhatIfAtSubscriptionScopeOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentsWhatIfAtSubscriptionScopeResponse - > - > { - 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: { deploymentName, parameters, options }, - spec: whatIfAtSubscriptionScopeOperationSpec, - }); - const poller = await createHttpPoller< - DeploymentsWhatIfAtSubscriptionScopeResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the subscription. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to What If. - * @param options The options parameters. - */ - async beginWhatIfAtSubscriptionScopeAndWait( - deploymentName: string, - parameters: DeploymentWhatIf, - options?: DeploymentsWhatIfAtSubscriptionScopeOptionalParams, - ): Promise { - const poller = await this.beginWhatIfAtSubscriptionScope( - deploymentName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Exports the template used for specified deployment. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - exportTemplateAtSubscriptionScope( - deploymentName: string, - options?: DeploymentsExportTemplateAtSubscriptionScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { deploymentName, options }, - exportTemplateAtSubscriptionScopeOperationSpec, - ); - } - - /** - * Get all the deployments for a subscription. - * @param options The options parameters. - */ - private _listAtSubscriptionScope( - options?: DeploymentsListAtSubscriptionScopeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { options }, - listAtSubscriptionScopeOperationSpec, - ); - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment - * removes the associated deployment operations. Deleting a template deployment does not affect the - * state of the resource group. This is an asynchronous operation that returns a status of 202 until - * the template deployment is successfully deleted. The Location response header contains the URI that - * is used to obtain the status of the process. While the process is running, a call to the URI in the - * Location header returns a status of 202. When the process finishes, the URI in the Location header - * returns a status of 204 on success. If the asynchronous request failed, the URI in the Location - * header returns an error-level status code. - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is - * case insensitive. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - deploymentName: string, - options?: DeploymentsDeleteOptionalParams, - ): 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, deploymentName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment - * removes the associated deployment operations. Deleting a template deployment does not affect the - * state of the resource group. This is an asynchronous operation that returns a status of 202 until - * the template deployment is successfully deleted. The Location response header contains the URI that - * is used to obtain the status of the process. While the process is running, a call to the URI in the - * Location header returns a status of 202. When the process finishes, the URI in the Location header - * returns a status of 204 on success. If the asynchronous request failed, the URI in the Location - * header returns an error-level status code. - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is - * case insensitive. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - deploymentName: string, - options?: DeploymentsDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - deploymentName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Checks whether the deployment exists. - * @param resourceGroupName The name of the resource group with the deployment to check. The name is - * case insensitive. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - checkExistence( - resourceGroupName: string, - deploymentName: string, - options?: DeploymentsCheckExistenceOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, deploymentName, options }, - checkExistenceOperationSpec, - ); - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case - * insensitive. The resource group must already exist. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - deploymentName: string, - parameters: Deployment, - options?: DeploymentsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentsCreateOrUpdateResponse - > - > { - 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, deploymentName, parameters, options }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - DeploymentsCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case - * insensitive. The resource group must already exist. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - deploymentName: string, - parameters: Deployment, - options?: DeploymentsCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - deploymentName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Gets a deployment. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - deploymentName: string, - options?: DeploymentsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, deploymentName, options }, - getOperationSpec, - ); - } - - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the - * deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment - * stops the currently running template deployment and leaves the resource group partially deployed. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - cancel( - resourceGroupName: string, - deploymentName: string, - options?: DeploymentsCancelOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, deploymentName, options }, - cancelOperationSpec, - ); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure - * Resource Manager.. - * @param resourceGroupName The name of the resource group the template will be deployed to. The name - * is case insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - async beginValidate( - resourceGroupName: string, - deploymentName: string, - parameters: Deployment, - options?: DeploymentsValidateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentsValidateResponse - > - > { - 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, deploymentName, parameters, options }, - spec: validateOperationSpec, - }); - const poller = await createHttpPoller< - DeploymentsValidateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure - * Resource Manager.. - * @param resourceGroupName The name of the resource group the template will be deployed to. The name - * is case insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - async beginValidateAndWait( - resourceGroupName: string, - deploymentName: string, - parameters: Deployment, - options?: DeploymentsValidateOptionalParams, - ): Promise { - const poller = await this.beginValidate( - resourceGroupName, - deploymentName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the resource group. - * @param resourceGroupName The name of the resource group the template will be deployed to. The name - * is case insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - async beginWhatIf( - resourceGroupName: string, - deploymentName: string, - parameters: DeploymentWhatIf, - options?: DeploymentsWhatIfOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentsWhatIfResponse - > - > { - 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, deploymentName, parameters, options }, - spec: whatIfOperationSpec, - }); - const poller = await createHttpPoller< - DeploymentsWhatIfResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Returns changes that will be made by the deployment if executed at the scope of the resource group. - * @param resourceGroupName The name of the resource group the template will be deployed to. The name - * is case insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - async beginWhatIfAndWait( - resourceGroupName: string, - deploymentName: string, - parameters: DeploymentWhatIf, - options?: DeploymentsWhatIfOptionalParams, - ): Promise { - const poller = await this.beginWhatIf( - resourceGroupName, - deploymentName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Exports the template used for specified deployment. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - exportTemplate( - resourceGroupName: string, - deploymentName: string, - options?: DeploymentsExportTemplateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, deploymentName, options }, - exportTemplateOperationSpec, - ); - } - - /** - * Get all the deployments for a resource group. - * @param resourceGroupName The name of the resource group with the deployments to get. The name is - * case insensitive. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: DeploymentsListByResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec, - ); - } - - /** - * Calculate the hash of the given template. - * @param template The template provided to calculate hash. - * @param options The options parameters. - */ - calculateTemplateHash( - template: Record, - options?: DeploymentsCalculateTemplateHashOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { template, options }, - calculateTemplateHashOperationSpec, - ); - } - - /** - * ListAtScopeNext - * @param scope The resource scope. - * @param nextLink The nextLink from the previous successful call to the ListAtScope method. - * @param options The options parameters. - */ - private _listAtScopeNext( - scope: string, - nextLink: string, - options?: DeploymentsListAtScopeNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { scope, nextLink, options }, - listAtScopeNextOperationSpec, - ); - } - - /** - * ListAtTenantScopeNext - * @param nextLink The nextLink from the previous successful call to the ListAtTenantScope method. - * @param options The options parameters. - */ - private _listAtTenantScopeNext( - nextLink: string, - options?: DeploymentsListAtTenantScopeNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listAtTenantScopeNextOperationSpec, - ); - } - - /** - * ListAtManagementGroupScopeNext - * @param groupId The management group ID. - * @param nextLink The nextLink from the previous successful call to the ListAtManagementGroupScope - * method. - * @param options The options parameters. - */ - private _listAtManagementGroupScopeNext( - groupId: string, - nextLink: string, - options?: DeploymentsListAtManagementGroupScopeNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { groupId, nextLink, options }, - listAtManagementGroupScopeNextOperationSpec, - ); - } - - /** - * ListAtSubscriptionScopeNext - * @param nextLink The nextLink from the previous successful call to the ListAtSubscriptionScope - * method. - * @param options The options parameters. - */ - private _listAtSubscriptionScopeNext( - nextLink: string, - options?: DeploymentsListAtSubscriptionScopeNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listAtSubscriptionScopeNextOperationSpec, - ); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group with the deployments to get. The name is - * case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. - * @param options The options parameters. - */ - private _listByResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: DeploymentsListByResourceGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const deleteAtScopeOperationSpec: coreClient.OperationSpec = { - path: "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.deploymentName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const checkExistenceAtScopeOperationSpec: coreClient.OperationSpec = { - path: "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}", - httpMethod: "HEAD", - responses: { - 204: {}, - 404: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.deploymentName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateAtScopeOperationSpec: coreClient.OperationSpec = { - path: "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.DeploymentExtended, - }, - 201: { - bodyMapper: Mappers.DeploymentExtended, - }, - 202: { - bodyMapper: Mappers.DeploymentExtended, - }, - 204: { - bodyMapper: Mappers.DeploymentExtended, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.deploymentName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const getAtScopeOperationSpec: coreClient.OperationSpec = { - path: "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentExtended, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.deploymentName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const cancelAtScopeOperationSpec: coreClient.OperationSpec = { - path: "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", - httpMethod: "POST", - responses: { - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.deploymentName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const validateAtScopeOperationSpec: coreClient.OperationSpec = { - path: "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.DeploymentValidateResult, - }, - 201: { - bodyMapper: Mappers.DeploymentValidateResult, - }, - 202: { - bodyMapper: Mappers.DeploymentValidateResult, - }, - 204: { - bodyMapper: Mappers.DeploymentValidateResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.deploymentName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const exportTemplateAtScopeOperationSpec: coreClient.OperationSpec = { - path: "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.DeploymentExportResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.deploymentName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listAtScopeOperationSpec: coreClient.OperationSpec = { - path: "/{scope}/providers/Microsoft.Resources/deployments/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], - urlParameters: [Parameters.$host, Parameters.scope], - headerParameters: [Parameters.accept], - serializer, -}; -const deleteAtTenantScopeOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Resources/deployments/{deploymentName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.deploymentName], - headerParameters: [Parameters.accept], - serializer, -}; -const checkExistenceAtTenantScopeOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Resources/deployments/{deploymentName}", - httpMethod: "HEAD", - responses: { - 204: {}, - 404: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.deploymentName], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateAtTenantScopeOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Resources/deployments/{deploymentName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.DeploymentExtended, - }, - 201: { - bodyMapper: Mappers.DeploymentExtended, - }, - 202: { - bodyMapper: Mappers.DeploymentExtended, - }, - 204: { - bodyMapper: Mappers.DeploymentExtended, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters1, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.deploymentName], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const getAtTenantScopeOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Resources/deployments/{deploymentName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentExtended, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.deploymentName], - headerParameters: [Parameters.accept], - serializer, -}; -const cancelAtTenantScopeOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", - httpMethod: "POST", - responses: { - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.deploymentName], - headerParameters: [Parameters.accept], - serializer, -}; -const validateAtTenantScopeOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Resources/deployments/{deploymentName}/validate", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.DeploymentValidateResult, - }, - 201: { - bodyMapper: Mappers.DeploymentValidateResult, - }, - 202: { - bodyMapper: Mappers.DeploymentValidateResult, - }, - 204: { - bodyMapper: Mappers.DeploymentValidateResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters1, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.deploymentName], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const whatIfAtTenantScopeOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.WhatIfOperationResult, - }, - 201: { - bodyMapper: Mappers.WhatIfOperationResult, - }, - 202: { - bodyMapper: Mappers.WhatIfOperationResult, - }, - 204: { - bodyMapper: Mappers.WhatIfOperationResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters2, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.deploymentName], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const exportTemplateAtTenantScopeOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.DeploymentExportResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.deploymentName], - headerParameters: [Parameters.accept], - serializer, -}; -const listAtTenantScopeOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Resources/deployments/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], - urlParameters: [Parameters.$host], - headerParameters: [Parameters.accept], - serializer, -}; -const deleteAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.groupId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const checkExistenceAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = - { - path: "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}", - httpMethod: "HEAD", - responses: { - 204: {}, - 404: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.groupId, - ], - headerParameters: [Parameters.accept], - serializer, - }; -const createOrUpdateAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = - { - path: "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.DeploymentExtended, - }, - 201: { - bodyMapper: Mappers.DeploymentExtended, - }, - 202: { - bodyMapper: Mappers.DeploymentExtended, - }, - 204: { - bodyMapper: Mappers.DeploymentExtended, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters1, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.groupId, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, - }; -const getAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentExtended, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.groupId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const cancelAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", - httpMethod: "POST", - responses: { - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.groupId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const validateAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.DeploymentValidateResult, - }, - 201: { - bodyMapper: Mappers.DeploymentValidateResult, - }, - 202: { - bodyMapper: Mappers.DeploymentValidateResult, - }, - 204: { - bodyMapper: Mappers.DeploymentValidateResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters1, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.groupId, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const whatIfAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.WhatIfOperationResult, - }, - 201: { - bodyMapper: Mappers.WhatIfOperationResult, - }, - 202: { - bodyMapper: Mappers.WhatIfOperationResult, - }, - 204: { - bodyMapper: Mappers.WhatIfOperationResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters2, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.groupId, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const exportTemplateAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = - { - path: "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.DeploymentExportResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.groupId, - ], - headerParameters: [Parameters.accept], - serializer, - }; -const listAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], - urlParameters: [Parameters.$host, Parameters.groupId], - headerParameters: [Parameters.accept], - serializer, -}; -const deleteAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.subscriptionId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const checkExistenceAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = - { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", - httpMethod: "HEAD", - responses: { - 204: {}, - 404: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.subscriptionId, - ], - headerParameters: [Parameters.accept], - serializer, - }; -const createOrUpdateAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = - { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.DeploymentExtended, - }, - 201: { - bodyMapper: Mappers.DeploymentExtended, - }, - 202: { - bodyMapper: Mappers.DeploymentExtended, - }, - 204: { - bodyMapper: Mappers.DeploymentExtended, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.subscriptionId, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, - }; -const getAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentExtended, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.subscriptionId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const cancelAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", - httpMethod: "POST", - responses: { - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.subscriptionId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const validateAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.DeploymentValidateResult, - }, - 201: { - bodyMapper: Mappers.DeploymentValidateResult, - }, - 202: { - bodyMapper: Mappers.DeploymentValidateResult, - }, - 204: { - bodyMapper: Mappers.DeploymentValidateResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.subscriptionId, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const whatIfAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.WhatIfOperationResult, - }, - 201: { - bodyMapper: Mappers.WhatIfOperationResult, - }, - 202: { - bodyMapper: Mappers.WhatIfOperationResult, - }, - 204: { - bodyMapper: Mappers.WhatIfOperationResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters3, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.subscriptionId, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const exportTemplateAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = - { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.DeploymentExportResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.subscriptionId, - ], - headerParameters: [Parameters.accept], - serializer, - }; -const listAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const checkExistenceOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", - httpMethod: "HEAD", - responses: { - 204: {}, - 404: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.DeploymentExtended, - }, - 201: { - bodyMapper: Mappers.DeploymentExtended, - }, - 202: { - bodyMapper: Mappers.DeploymentExtended, - }, - 204: { - bodyMapper: Mappers.DeploymentExtended, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentExtended, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const cancelOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", - httpMethod: "POST", - responses: { - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const validateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.DeploymentValidateResult, - }, - 201: { - bodyMapper: Mappers.DeploymentValidateResult, - }, - 202: { - bodyMapper: Mappers.DeploymentValidateResult, - }, - 204: { - bodyMapper: Mappers.DeploymentValidateResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const whatIfOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.WhatIfOperationResult, - }, - 201: { - bodyMapper: Mappers.WhatIfOperationResult, - }, - 202: { - bodyMapper: Mappers.WhatIfOperationResult, - }, - 204: { - bodyMapper: Mappers.WhatIfOperationResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters3, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const exportTemplateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.DeploymentExportResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.deploymentName, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const calculateTemplateHashOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Resources/calculateTemplateHash", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.TemplateHashResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.template, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const listAtScopeNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.scope], - headerParameters: [Parameters.accept], - serializer, -}; -const listAtTenantScopeNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [Parameters.$host, Parameters.nextLink], - headerParameters: [Parameters.accept], - serializer, -}; -const listAtManagementGroupScopeNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.groupId], - headerParameters: [Parameters.accept], - serializer, -}; -const listAtSubscriptionScopeNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DeploymentListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/resources/arm-resources/src/operations/index.ts b/sdk/resources/arm-resources/src/operations/index.ts index 2e1c58936bc0..782fec55abbc 100644 --- a/sdk/resources/arm-resources/src/operations/index.ts +++ b/sdk/resources/arm-resources/src/operations/index.ts @@ -7,10 +7,8 @@ */ export * from "./operations.js"; -export * from "./deployments.js"; export * from "./providers.js"; export * from "./providerResourceTypes.js"; export * from "./resources.js"; export * from "./resourceGroups.js"; export * from "./tagsOperations.js"; -export * from "./deploymentOperations.js"; diff --git a/sdk/resources/arm-resources/src/operations/operations.ts b/sdk/resources/arm-resources/src/operations/operations.ts index 42fd9146f8a1..6c1db095c2ee 100644 --- a/sdk/resources/arm-resources/src/operations/operations.ts +++ b/sdk/resources/arm-resources/src/operations/operations.ts @@ -38,9 +38,7 @@ export class OperationsImpl implements Operations { * Lists all of the available Microsoft.Resources REST API operations. * @param options The options parameters. */ - public list( - options?: OperationsListOptionalParams, - ): PagedAsyncIterableIterator { + public list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { next() { @@ -92,9 +90,7 @@ export class OperationsImpl implements Operations { * Lists all of the available Microsoft.Resources REST API operations. * @param options The options parameters. */ - private _list( - options?: OperationsListOptionalParams, - ): Promise { + private _list(options?: OperationsListOptionalParams): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -107,10 +103,7 @@ export class OperationsImpl implements Operations { nextLink: string, options?: OperationsListNextOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec, - ); + return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); } } // Operation Specifications diff --git a/sdk/resources/arm-resources/src/operations/providerResourceTypes.ts b/sdk/resources/arm-resources/src/operations/providerResourceTypes.ts index c590d8259175..60df61e1f140 100644 --- a/sdk/resources/arm-resources/src/operations/providerResourceTypes.ts +++ b/sdk/resources/arm-resources/src/operations/providerResourceTypes.ts @@ -60,8 +60,8 @@ const listOperationSpec: coreClient.OperationSpec = { queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceProviderNamespace, + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], serializer, diff --git a/sdk/resources/arm-resources/src/operations/providers.ts b/sdk/resources/arm-resources/src/operations/providers.ts index 8a6742d1bd60..3802c7f04cea 100644 --- a/sdk/resources/arm-resources/src/operations/providers.ts +++ b/sdk/resources/arm-resources/src/operations/providers.ts @@ -53,9 +53,7 @@ export class ProvidersImpl implements Providers { * Gets all resource providers for a subscription. * @param options The options parameters. */ - public list( - options?: ProvidersListOptionalParams, - ): PagedAsyncIterableIterator { + public list(options?: ProvidersListOptionalParams): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { next() { @@ -226,9 +224,7 @@ export class ProvidersImpl implements Providers { * Gets all resource providers for a subscription. * @param options The options parameters. */ - private _list( - options?: ProvidersListOptionalParams, - ): Promise { + private _list(options?: ProvidersListOptionalParams): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -239,10 +235,7 @@ export class ProvidersImpl implements Providers { private _listAtTenantScope( options?: ProvidersListAtTenantScopeOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { options }, - listAtTenantScopeOperationSpec, - ); + return this.client.sendOperationRequest({ options }, listAtTenantScopeOperationSpec); } /** @@ -284,10 +277,7 @@ export class ProvidersImpl implements Providers { nextLink: string, options?: ProvidersListNextOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec, - ); + return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); } /** @@ -322,8 +312,8 @@ const unregisterOperationSpec: coreClient.OperationSpec = { queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceProviderNamespace, + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], serializer, @@ -338,11 +328,7 @@ const registerAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { }, }, queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.groupId, - Parameters.resourceProviderNamespace, - ], + urlParameters: [Parameters.$host, Parameters.resourceProviderNamespace, Parameters.groupId], headerParameters: [Parameters.accept], serializer, }; @@ -360,8 +346,8 @@ const providerPermissionsOperationSpec: coreClient.OperationSpec = { queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceProviderNamespace, + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], serializer, @@ -381,8 +367,8 @@ const registerOperationSpec: coreClient.OperationSpec = { queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceProviderNamespace, + Parameters.subscriptionId, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", @@ -434,8 +420,8 @@ const getOperationSpec: coreClient.OperationSpec = { queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, Parameters.resourceProviderNamespace, + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], serializer, @@ -467,11 +453,7 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError, }, }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - ], + urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer, }; diff --git a/sdk/resources/arm-resources/src/operations/resourceGroups.ts b/sdk/resources/arm-resources/src/operations/resourceGroups.ts index 7ab3c3601ac8..3210881c7201 100644 --- a/sdk/resources/arm-resources/src/operations/resourceGroups.ts +++ b/sdk/resources/arm-resources/src/operations/resourceGroups.ts @@ -13,11 +13,7 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers.js"; import * as Parameters from "../models/parameters.js"; import { ResourceManagementClient } from "../resourceManagementClient.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; +import { SimplePollerLike, OperationState, createHttpPoller } from "@azure/core-lro"; import { createLroSpec } from "../lroImpl.js"; import { ResourceGroup, @@ -161,8 +157,7 @@ export class ResourceGroupsImpl implements ResourceGroups { args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, @@ -225,10 +220,7 @@ export class ResourceGroupsImpl implements ResourceGroups { resourceGroupName: string, options?: ResourceGroupsGetOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - getOperationSpec, - ); + return this.client.sendOperationRequest({ resourceGroupName, options }, getOperationSpec); } /** @@ -276,8 +268,7 @@ export class ResourceGroupsImpl implements ResourceGroups { args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, @@ -332,11 +323,7 @@ export class ResourceGroupsImpl implements ResourceGroups { parameters: ExportTemplateRequest, options?: ResourceGroupsExportTemplateOptionalParams, ): Promise { - const poller = await this.beginExportTemplate( - resourceGroupName, - parameters, - options, - ); + const poller = await this.beginExportTemplate(resourceGroupName, parameters, options); return poller.pollUntilDone(); } @@ -344,9 +331,7 @@ export class ResourceGroupsImpl implements ResourceGroups { * Gets all the resource groups for a subscription. * @param options The options parameters. */ - private _list( - options?: ResourceGroupsListOptionalParams, - ): Promise { + private _list(options?: ResourceGroupsListOptionalParams): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -359,10 +344,7 @@ export class ResourceGroupsImpl implements ResourceGroups { nextLink: string, options?: ResourceGroupsListNextOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec, - ); + return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); } } // Operation Specifications @@ -379,11 +361,7 @@ const checkExistenceOperationSpec: coreClient.OperationSpec = { }, }, queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], + urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName], headerParameters: [Parameters.accept], serializer, }; @@ -401,13 +379,9 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError, }, }, - requestBody: Parameters.parameters6, + requestBody: Parameters.parameters2, queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], + urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer, @@ -425,11 +399,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { }, }, queryParameters: [Parameters.apiVersion, Parameters.forceDeletionTypes], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], + urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName], headerParameters: [Parameters.accept], serializer, }; @@ -445,11 +415,7 @@ const getOperationSpec: coreClient.OperationSpec = { }, }, queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], + urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName], headerParameters: [Parameters.accept], serializer, }; @@ -464,13 +430,9 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError, }, }, - requestBody: Parameters.parameters7, + requestBody: Parameters.parameters3, queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], + urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer, @@ -495,13 +457,9 @@ const exportTemplateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError, }, }, - requestBody: Parameters.parameters8, + requestBody: Parameters.parameters4, queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName1, - ], + urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName1], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer, @@ -533,11 +491,7 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError, }, }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - ], + urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer, }; diff --git a/sdk/resources/arm-resources/src/operations/resources.ts b/sdk/resources/arm-resources/src/operations/resources.ts index c6a6b94e63aa..6f3bddcb9f77 100644 --- a/sdk/resources/arm-resources/src/operations/resources.ts +++ b/sdk/resources/arm-resources/src/operations/resources.ts @@ -13,11 +13,7 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers.js"; import * as Parameters from "../models/parameters.js"; import { ResourceManagementClient } from "../resourceManagementClient.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; +import { SimplePollerLike, OperationState, createHttpPoller } from "@azure/core-lro"; import { createLroSpec } from "../lroImpl.js"; import { GenericResourceExpanded, @@ -87,11 +83,7 @@ export class ResourcesImpl implements Resources { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings, - ); + return this.listByResourceGroupPagingPage(resourceGroupName, options, settings); }, }; } @@ -111,11 +103,7 @@ export class ResourcesImpl implements Resources { yield page; } while (continuationToken) { - result = await this._listByResourceGroupNext( - resourceGroupName, - continuationToken, - options, - ); + result = await this._listByResourceGroupNext(resourceGroupName, continuationToken, options); continuationToken = result.nextLink; let page = result.value || []; setContinuationToken(page, continuationToken); @@ -127,10 +115,7 @@ export class ResourcesImpl implements Resources { resourceGroupName: string, options?: ResourcesListByResourceGroupOptionalParams, ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage( - resourceGroupName, - options, - )) { + for await (const page of this.listByResourceGroupPagingPage(resourceGroupName, options)) { yield* page; } } @@ -229,8 +214,7 @@ export class ResourcesImpl implements Resources { args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, @@ -285,11 +269,7 @@ export class ResourcesImpl implements Resources { parameters: ResourcesMoveInfo, options?: ResourcesMoveResourcesOptionalParams, ): Promise { - const poller = await this.beginMoveResources( - sourceResourceGroupName, - parameters, - options, - ); + const poller = await this.beginMoveResources(sourceResourceGroupName, parameters, options); return poller.pollUntilDone(); } @@ -320,8 +300,7 @@ export class ResourcesImpl implements Resources { args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, @@ -390,9 +369,7 @@ export class ResourcesImpl implements Resources { * Get all the resources in a subscription. * @param options The options parameters. */ - private _list( - options?: ResourcesListOptionalParams, - ): Promise { + private _list(options?: ResourcesListOptionalParams): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -460,8 +437,7 @@ export class ResourcesImpl implements Resources { args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, @@ -578,8 +554,7 @@ export class ResourcesImpl implements Resources { args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, @@ -687,12 +662,7 @@ export class ResourcesImpl implements Resources { apiVersion: string, parameters: GenericResource, options?: ResourcesUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - ResourcesUpdateResponse - > - > { + ): Promise, ResourcesUpdateResponse>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec, @@ -703,8 +673,7 @@ export class ResourcesImpl implements Resources { args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, @@ -869,8 +838,7 @@ export class ResourcesImpl implements Resources { args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, @@ -957,8 +925,7 @@ export class ResourcesImpl implements Resources { args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, @@ -1016,12 +983,7 @@ export class ResourcesImpl implements Resources { parameters: GenericResource, options?: ResourcesCreateOrUpdateByIdOptionalParams, ): Promise { - const poller = await this.beginCreateOrUpdateById( - resourceId, - apiVersion, - parameters, - options, - ); + const poller = await this.beginCreateOrUpdateById(resourceId, apiVersion, parameters, options); return poller.pollUntilDone(); } @@ -1040,10 +1002,7 @@ export class ResourcesImpl implements Resources { parameters: GenericResource, options?: ResourcesUpdateByIdOptionalParams, ): Promise< - SimplePollerLike< - OperationState, - ResourcesUpdateByIdResponse - > + SimplePollerLike, ResourcesUpdateByIdResponse> > { const directSendOperation = async ( args: coreClient.OperationArguments, @@ -1055,8 +1014,7 @@ export class ResourcesImpl implements Resources { args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, @@ -1114,12 +1072,7 @@ export class ResourcesImpl implements Resources { parameters: GenericResource, options?: ResourcesUpdateByIdOptionalParams, ): Promise { - const poller = await this.beginUpdateById( - resourceId, - apiVersion, - parameters, - options, - ); + const poller = await this.beginUpdateById(resourceId, apiVersion, parameters, options); return poller.pollUntilDone(); } @@ -1168,10 +1121,7 @@ export class ResourcesImpl implements Resources { nextLink: string, options?: ResourcesListNextOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec, - ); + return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); } } // Operation Specifications @@ -1188,17 +1138,8 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError, }, }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.top, - Parameters.expand, - ], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], + queryParameters: [Parameters.apiVersion, Parameters.expand, Parameters.filter, Parameters.top], + urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName], headerParameters: [Parameters.accept], serializer, }; @@ -1214,13 +1155,9 @@ const moveResourcesOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError, }, }, - requestBody: Parameters.parameters4, + requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.sourceResourceGroupName, - ], + urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.sourceResourceGroupName], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer, @@ -1237,13 +1174,9 @@ const validateMoveResourcesOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError, }, }, - requestBody: Parameters.parameters4, + requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.sourceResourceGroupName, - ], + urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.sourceResourceGroupName], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer, @@ -1259,12 +1192,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError, }, }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.top, - Parameters.expand, - ], + queryParameters: [Parameters.apiVersion, Parameters.expand, Parameters.filter, Parameters.top], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer, @@ -1282,9 +1210,9 @@ const checkExistenceOperationSpec: coreClient.OperationSpec = { queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, + Parameters.resourceProviderNamespace, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, Parameters.resourceName, @@ -1307,9 +1235,9 @@ const deleteOperationSpec: coreClient.OperationSpec = { queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, + Parameters.resourceProviderNamespace, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, Parameters.resourceName, @@ -1337,13 +1265,13 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError, }, }, - requestBody: Parameters.parameters5, + requestBody: Parameters.parameters1, queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, + Parameters.resourceProviderNamespace, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, Parameters.resourceName, @@ -1372,13 +1300,13 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError, }, }, - requestBody: Parameters.parameters5, + requestBody: Parameters.parameters1, queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, + Parameters.resourceProviderNamespace, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, Parameters.resourceName, @@ -1401,9 +1329,9 @@ const getOperationSpec: coreClient.OperationSpec = { queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, + Parameters.resourceProviderNamespace, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, Parameters.resourceName, @@ -1463,7 +1391,7 @@ const createOrUpdateByIdOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError, }, }, - requestBody: Parameters.parameters5, + requestBody: Parameters.parameters1, queryParameters: [Parameters.apiVersion1], urlParameters: [Parameters.$host, Parameters.resourceId], headerParameters: [Parameters.accept, Parameters.contentType], @@ -1490,7 +1418,7 @@ const updateByIdOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError, }, }, - requestBody: Parameters.parameters5, + requestBody: Parameters.parameters1, queryParameters: [Parameters.apiVersion1], urlParameters: [Parameters.$host, Parameters.resourceId], headerParameters: [Parameters.accept, Parameters.contentType], @@ -1544,11 +1472,7 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError, }, }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - ], + urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer, }; diff --git a/sdk/resources/arm-resources/src/operations/tagsOperations.ts b/sdk/resources/arm-resources/src/operations/tagsOperations.ts index d4d46432b62e..fc8ac6c73250 100644 --- a/sdk/resources/arm-resources/src/operations/tagsOperations.ts +++ b/sdk/resources/arm-resources/src/operations/tagsOperations.ts @@ -13,11 +13,7 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers.js"; import * as Parameters from "../models/parameters.js"; import { ResourceManagementClient } from "../resourceManagementClient.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; +import { SimplePollerLike, OperationState, createHttpPoller } from "@azure/core-lro"; import { createLroSpec } from "../lroImpl.js"; import { TagDetails, @@ -62,9 +58,7 @@ export class TagsOperationsImpl implements TagsOperations { * result. * @param options The options parameters. */ - public list( - options?: TagsListOptionalParams, - ): PagedAsyncIterableIterator { + public list(options?: TagsListOptionalParams): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { next() { @@ -160,10 +154,7 @@ export class TagsOperationsImpl implements TagsOperations { tagName: string, options?: TagsCreateOrUpdateOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { tagName, options }, - createOrUpdateOperationSpec, - ); + return this.client.sendOperationRequest({ tagName, options }, createOrUpdateOperationSpec); } /** @@ -174,10 +165,7 @@ export class TagsOperationsImpl implements TagsOperations { * @param options The options parameters. */ delete(tagName: string, options?: TagsDeleteOptionalParams): Promise { - return this.client.sendOperationRequest( - { tagName, options }, - deleteOperationSpec, - ); + return this.client.sendOperationRequest({ tagName, options }, deleteOperationSpec); } /** @@ -218,8 +206,7 @@ export class TagsOperationsImpl implements TagsOperations { args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, @@ -274,11 +261,7 @@ export class TagsOperationsImpl implements TagsOperations { parameters: TagsResource, options?: TagsCreateOrUpdateAtScopeOptionalParams, ): Promise { - const poller = await this.beginCreateOrUpdateAtScope( - scope, - parameters, - options, - ); + const poller = await this.beginCreateOrUpdateAtScope(scope, parameters, options); return poller.pollUntilDone(); } @@ -297,10 +280,7 @@ export class TagsOperationsImpl implements TagsOperations { parameters: TagsPatchResource, options?: TagsUpdateAtScopeOptionalParams, ): Promise< - SimplePollerLike< - OperationState, - TagsUpdateAtScopeResponse - > + SimplePollerLike, TagsUpdateAtScopeResponse> > { const directSendOperation = async ( args: coreClient.OperationArguments, @@ -312,8 +292,7 @@ export class TagsOperationsImpl implements TagsOperations { args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, @@ -384,10 +363,7 @@ export class TagsOperationsImpl implements TagsOperations { scope: string, options?: TagsGetAtScopeOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { scope, options }, - getAtScopeOperationSpec, - ); + return this.client.sendOperationRequest({ scope, options }, getAtScopeOperationSpec); } /** @@ -409,8 +385,7 @@ export class TagsOperationsImpl implements TagsOperations { args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, @@ -472,10 +447,7 @@ export class TagsOperationsImpl implements TagsOperations { nextLink: string, options?: TagsListNextOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec, - ); + return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); } } // Operation Specifications @@ -540,11 +512,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { }, }, queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.tagName, - ], + urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.tagName], headerParameters: [Parameters.accept], serializer, }; @@ -559,11 +527,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { }, }, queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.tagName, - ], + urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.tagName], headerParameters: [Parameters.accept], serializer, }; @@ -603,7 +567,7 @@ const createOrUpdateAtScopeOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError, }, }, - requestBody: Parameters.parameters9, + requestBody: Parameters.parameters5, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.scope], headerParameters: [Parameters.accept, Parameters.contentType], @@ -630,7 +594,7 @@ const updateAtScopeOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError, }, }, - requestBody: Parameters.parameters10, + requestBody: Parameters.parameters6, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.scope], headerParameters: [Parameters.accept, Parameters.contentType], @@ -681,11 +645,7 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError, }, }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - ], + urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer, }; diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/deploymentOperations.ts b/sdk/resources/arm-resources/src/operationsInterfaces/deploymentOperations.ts deleted file mode 100644 index e8a4a3e552ed..000000000000 --- a/sdk/resources/arm-resources/src/operationsInterfaces/deploymentOperations.ts +++ /dev/null @@ -1,144 +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 { - DeploymentOperation, - DeploymentOperationsListAtScopeOptionalParams, - DeploymentOperationsListAtTenantScopeOptionalParams, - DeploymentOperationsListAtManagementGroupScopeOptionalParams, - DeploymentOperationsListAtSubscriptionScopeOptionalParams, - DeploymentOperationsListOptionalParams, - DeploymentOperationsGetAtScopeOptionalParams, - DeploymentOperationsGetAtScopeResponse, - DeploymentOperationsGetAtTenantScopeOptionalParams, - DeploymentOperationsGetAtTenantScopeResponse, - DeploymentOperationsGetAtManagementGroupScopeOptionalParams, - DeploymentOperationsGetAtManagementGroupScopeResponse, - DeploymentOperationsGetAtSubscriptionScopeOptionalParams, - DeploymentOperationsGetAtSubscriptionScopeResponse, - DeploymentOperationsGetOptionalParams, - DeploymentOperationsGetResponse, -} from "../models/index.js"; - -/// -/** Interface representing a DeploymentOperations. */ -export interface DeploymentOperations { - /** - * Gets all deployments operations for a deployment. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - listAtScope( - scope: string, - deploymentName: string, - options?: DeploymentOperationsListAtScopeOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets all deployments operations for a deployment. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - listAtTenantScope( - deploymentName: string, - options?: DeploymentOperationsListAtTenantScopeOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets all deployments operations for a deployment. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - listAtManagementGroupScope( - groupId: string, - deploymentName: string, - options?: DeploymentOperationsListAtManagementGroupScopeOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets all deployments operations for a deployment. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - listAtSubscriptionScope( - deploymentName: string, - options?: DeploymentOperationsListAtSubscriptionScopeOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets all deployments operations for a deployment. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - list( - resourceGroupName: string, - deploymentName: string, - options?: DeploymentOperationsListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets a deployments operation. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param options The options parameters. - */ - getAtScope( - scope: string, - deploymentName: string, - operationId: string, - options?: DeploymentOperationsGetAtScopeOptionalParams, - ): Promise; - /** - * Gets a deployments operation. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param options The options parameters. - */ - getAtTenantScope( - deploymentName: string, - operationId: string, - options?: DeploymentOperationsGetAtTenantScopeOptionalParams, - ): Promise; - /** - * Gets a deployments operation. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param options The options parameters. - */ - getAtManagementGroupScope( - groupId: string, - deploymentName: string, - operationId: string, - options?: DeploymentOperationsGetAtManagementGroupScopeOptionalParams, - ): Promise; - /** - * Gets a deployments operation. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param options The options parameters. - */ - getAtSubscriptionScope( - deploymentName: string, - operationId: string, - options?: DeploymentOperationsGetAtSubscriptionScopeOptionalParams, - ): Promise; - /** - * Gets a deployments operation. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param operationId The ID of the operation to get. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - deploymentName: string, - operationId: string, - options?: DeploymentOperationsGetOptionalParams, - ): Promise; -} diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/deployments.ts b/sdk/resources/arm-resources/src/operationsInterfaces/deployments.ts deleted file mode 100644 index d4aaf47d017a..000000000000 --- a/sdk/resources/arm-resources/src/operationsInterfaces/deployments.ts +++ /dev/null @@ -1,957 +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 { - DeploymentExtended, - DeploymentsListAtScopeOptionalParams, - DeploymentsListAtTenantScopeOptionalParams, - DeploymentsListAtManagementGroupScopeOptionalParams, - DeploymentsListAtSubscriptionScopeOptionalParams, - DeploymentsListByResourceGroupOptionalParams, - DeploymentsDeleteAtScopeOptionalParams, - DeploymentsCheckExistenceAtScopeOptionalParams, - DeploymentsCheckExistenceAtScopeResponse, - Deployment, - DeploymentsCreateOrUpdateAtScopeOptionalParams, - DeploymentsCreateOrUpdateAtScopeResponse, - DeploymentsGetAtScopeOptionalParams, - DeploymentsGetAtScopeResponse, - DeploymentsCancelAtScopeOptionalParams, - DeploymentsValidateAtScopeOptionalParams, - DeploymentsValidateAtScopeResponse, - DeploymentsExportTemplateAtScopeOptionalParams, - DeploymentsExportTemplateAtScopeResponse, - DeploymentsDeleteAtTenantScopeOptionalParams, - DeploymentsCheckExistenceAtTenantScopeOptionalParams, - DeploymentsCheckExistenceAtTenantScopeResponse, - ScopedDeployment, - DeploymentsCreateOrUpdateAtTenantScopeOptionalParams, - DeploymentsCreateOrUpdateAtTenantScopeResponse, - DeploymentsGetAtTenantScopeOptionalParams, - DeploymentsGetAtTenantScopeResponse, - DeploymentsCancelAtTenantScopeOptionalParams, - DeploymentsValidateAtTenantScopeOptionalParams, - DeploymentsValidateAtTenantScopeResponse, - ScopedDeploymentWhatIf, - DeploymentsWhatIfAtTenantScopeOptionalParams, - DeploymentsWhatIfAtTenantScopeResponse, - DeploymentsExportTemplateAtTenantScopeOptionalParams, - DeploymentsExportTemplateAtTenantScopeResponse, - DeploymentsDeleteAtManagementGroupScopeOptionalParams, - DeploymentsCheckExistenceAtManagementGroupScopeOptionalParams, - DeploymentsCheckExistenceAtManagementGroupScopeResponse, - DeploymentsCreateOrUpdateAtManagementGroupScopeOptionalParams, - DeploymentsCreateOrUpdateAtManagementGroupScopeResponse, - DeploymentsGetAtManagementGroupScopeOptionalParams, - DeploymentsGetAtManagementGroupScopeResponse, - DeploymentsCancelAtManagementGroupScopeOptionalParams, - DeploymentsValidateAtManagementGroupScopeOptionalParams, - DeploymentsValidateAtManagementGroupScopeResponse, - DeploymentsWhatIfAtManagementGroupScopeOptionalParams, - DeploymentsWhatIfAtManagementGroupScopeResponse, - DeploymentsExportTemplateAtManagementGroupScopeOptionalParams, - DeploymentsExportTemplateAtManagementGroupScopeResponse, - DeploymentsDeleteAtSubscriptionScopeOptionalParams, - DeploymentsCheckExistenceAtSubscriptionScopeOptionalParams, - DeploymentsCheckExistenceAtSubscriptionScopeResponse, - DeploymentsCreateOrUpdateAtSubscriptionScopeOptionalParams, - DeploymentsCreateOrUpdateAtSubscriptionScopeResponse, - DeploymentsGetAtSubscriptionScopeOptionalParams, - DeploymentsGetAtSubscriptionScopeResponse, - DeploymentsCancelAtSubscriptionScopeOptionalParams, - DeploymentsValidateAtSubscriptionScopeOptionalParams, - DeploymentsValidateAtSubscriptionScopeResponse, - DeploymentWhatIf, - DeploymentsWhatIfAtSubscriptionScopeOptionalParams, - DeploymentsWhatIfAtSubscriptionScopeResponse, - DeploymentsExportTemplateAtSubscriptionScopeOptionalParams, - DeploymentsExportTemplateAtSubscriptionScopeResponse, - DeploymentsDeleteOptionalParams, - DeploymentsCheckExistenceOptionalParams, - DeploymentsCheckExistenceResponse, - DeploymentsCreateOrUpdateOptionalParams, - DeploymentsCreateOrUpdateResponse, - DeploymentsGetOptionalParams, - DeploymentsGetResponse, - DeploymentsCancelOptionalParams, - DeploymentsValidateOptionalParams, - DeploymentsValidateResponse, - DeploymentsWhatIfOptionalParams, - DeploymentsWhatIfResponse, - DeploymentsExportTemplateOptionalParams, - DeploymentsExportTemplateResponse, - DeploymentsCalculateTemplateHashOptionalParams, - DeploymentsCalculateTemplateHashResponse, -} from "../models/index.js"; - -/// -/** Interface representing a Deployments. */ -export interface Deployments { - /** - * Get all the deployments at the given scope. - * @param scope The resource scope. - * @param options The options parameters. - */ - listAtScope( - scope: string, - options?: DeploymentsListAtScopeOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Get all the deployments at the tenant scope. - * @param options The options parameters. - */ - listAtTenantScope( - options?: DeploymentsListAtTenantScopeOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Get all the deployments for a management group. - * @param groupId The management group ID. - * @param options The options parameters. - */ - listAtManagementGroupScope( - groupId: string, - options?: DeploymentsListAtManagementGroupScopeOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Get all the deployments for a subscription. - * @param options The options parameters. - */ - listAtSubscriptionScope( - options?: DeploymentsListAtSubscriptionScopeOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Get all the deployments for a resource group. - * @param resourceGroupName The name of the resource group with the deployments to get. The name is - * case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: DeploymentsListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment - * removes the associated deployment operations. This is an asynchronous operation that returns a - * status of 202 until the template deployment is successfully deleted. The Location response header - * contains the URI that is used to obtain the status of the process. While the process is running, a - * call to the URI in the Location header returns a status of 202. When the process finishes, the URI - * in the Location header returns a status of 204 on success. If the asynchronous request failed, the - * URI in the Location header returns an error-level status code. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - beginDeleteAtScope( - scope: string, - deploymentName: string, - options?: DeploymentsDeleteAtScopeOptionalParams, - ): Promise, void>>; - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment - * removes the associated deployment operations. This is an asynchronous operation that returns a - * status of 202 until the template deployment is successfully deleted. The Location response header - * contains the URI that is used to obtain the status of the process. While the process is running, a - * call to the URI in the Location header returns a status of 202. When the process finishes, the URI - * in the Location header returns a status of 204 on success. If the asynchronous request failed, the - * URI in the Location header returns an error-level status code. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - beginDeleteAtScopeAndWait( - scope: string, - deploymentName: string, - options?: DeploymentsDeleteAtScopeOptionalParams, - ): Promise; - /** - * Checks whether the deployment exists. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - checkExistenceAtScope( - scope: string, - deploymentName: string, - options?: DeploymentsCheckExistenceAtScopeOptionalParams, - ): Promise; - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAtScope( - scope: string, - deploymentName: string, - parameters: Deployment, - options?: DeploymentsCreateOrUpdateAtScopeOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentsCreateOrUpdateAtScopeResponse - > - >; - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAtScopeAndWait( - scope: string, - deploymentName: string, - parameters: Deployment, - options?: DeploymentsCreateOrUpdateAtScopeOptionalParams, - ): Promise; - /** - * Gets a deployment. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - getAtScope( - scope: string, - deploymentName: string, - options?: DeploymentsGetAtScopeOptionalParams, - ): Promise; - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the - * deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment - * stops the currently running template deployment and leaves the resources partially deployed. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - cancelAtScope( - scope: string, - deploymentName: string, - options?: DeploymentsCancelAtScopeOptionalParams, - ): Promise; - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure - * Resource Manager.. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - beginValidateAtScope( - scope: string, - deploymentName: string, - parameters: Deployment, - options?: DeploymentsValidateAtScopeOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentsValidateAtScopeResponse - > - >; - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure - * Resource Manager.. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - beginValidateAtScopeAndWait( - scope: string, - deploymentName: string, - parameters: Deployment, - options?: DeploymentsValidateAtScopeOptionalParams, - ): Promise; - /** - * Exports the template used for specified deployment. - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - exportTemplateAtScope( - scope: string, - deploymentName: string, - options?: DeploymentsExportTemplateAtScopeOptionalParams, - ): Promise; - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment - * removes the associated deployment operations. This is an asynchronous operation that returns a - * status of 202 until the template deployment is successfully deleted. The Location response header - * contains the URI that is used to obtain the status of the process. While the process is running, a - * call to the URI in the Location header returns a status of 202. When the process finishes, the URI - * in the Location header returns a status of 204 on success. If the asynchronous request failed, the - * URI in the Location header returns an error-level status code. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - beginDeleteAtTenantScope( - deploymentName: string, - options?: DeploymentsDeleteAtTenantScopeOptionalParams, - ): Promise, void>>; - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment - * removes the associated deployment operations. This is an asynchronous operation that returns a - * status of 202 until the template deployment is successfully deleted. The Location response header - * contains the URI that is used to obtain the status of the process. While the process is running, a - * call to the URI in the Location header returns a status of 202. When the process finishes, the URI - * in the Location header returns a status of 204 on success. If the asynchronous request failed, the - * URI in the Location header returns an error-level status code. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - beginDeleteAtTenantScopeAndWait( - deploymentName: string, - options?: DeploymentsDeleteAtTenantScopeOptionalParams, - ): Promise; - /** - * Checks whether the deployment exists. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - checkExistenceAtTenantScope( - deploymentName: string, - options?: DeploymentsCheckExistenceAtTenantScopeOptionalParams, - ): Promise; - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAtTenantScope( - deploymentName: string, - parameters: ScopedDeployment, - options?: DeploymentsCreateOrUpdateAtTenantScopeOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentsCreateOrUpdateAtTenantScopeResponse - > - >; - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAtTenantScopeAndWait( - deploymentName: string, - parameters: ScopedDeployment, - options?: DeploymentsCreateOrUpdateAtTenantScopeOptionalParams, - ): Promise; - /** - * Gets a deployment. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - getAtTenantScope( - deploymentName: string, - options?: DeploymentsGetAtTenantScopeOptionalParams, - ): Promise; - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the - * deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment - * stops the currently running template deployment and leaves the resources partially deployed. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - cancelAtTenantScope( - deploymentName: string, - options?: DeploymentsCancelAtTenantScopeOptionalParams, - ): Promise; - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure - * Resource Manager.. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - beginValidateAtTenantScope( - deploymentName: string, - parameters: ScopedDeployment, - options?: DeploymentsValidateAtTenantScopeOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentsValidateAtTenantScopeResponse - > - >; - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure - * Resource Manager.. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - beginValidateAtTenantScopeAndWait( - deploymentName: string, - parameters: ScopedDeployment, - options?: DeploymentsValidateAtTenantScopeOptionalParams, - ): Promise; - /** - * Returns changes that will be made by the deployment if executed at the scope of the tenant group. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - beginWhatIfAtTenantScope( - deploymentName: string, - parameters: ScopedDeploymentWhatIf, - options?: DeploymentsWhatIfAtTenantScopeOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentsWhatIfAtTenantScopeResponse - > - >; - /** - * Returns changes that will be made by the deployment if executed at the scope of the tenant group. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - beginWhatIfAtTenantScopeAndWait( - deploymentName: string, - parameters: ScopedDeploymentWhatIf, - options?: DeploymentsWhatIfAtTenantScopeOptionalParams, - ): Promise; - /** - * Exports the template used for specified deployment. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - exportTemplateAtTenantScope( - deploymentName: string, - options?: DeploymentsExportTemplateAtTenantScopeOptionalParams, - ): Promise; - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment - * removes the associated deployment operations. This is an asynchronous operation that returns a - * status of 202 until the template deployment is successfully deleted. The Location response header - * contains the URI that is used to obtain the status of the process. While the process is running, a - * call to the URI in the Location header returns a status of 202. When the process finishes, the URI - * in the Location header returns a status of 204 on success. If the asynchronous request failed, the - * URI in the Location header returns an error-level status code. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - beginDeleteAtManagementGroupScope( - groupId: string, - deploymentName: string, - options?: DeploymentsDeleteAtManagementGroupScopeOptionalParams, - ): Promise, void>>; - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment - * removes the associated deployment operations. This is an asynchronous operation that returns a - * status of 202 until the template deployment is successfully deleted. The Location response header - * contains the URI that is used to obtain the status of the process. While the process is running, a - * call to the URI in the Location header returns a status of 202. When the process finishes, the URI - * in the Location header returns a status of 204 on success. If the asynchronous request failed, the - * URI in the Location header returns an error-level status code. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - beginDeleteAtManagementGroupScopeAndWait( - groupId: string, - deploymentName: string, - options?: DeploymentsDeleteAtManagementGroupScopeOptionalParams, - ): Promise; - /** - * Checks whether the deployment exists. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - checkExistenceAtManagementGroupScope( - groupId: string, - deploymentName: string, - options?: DeploymentsCheckExistenceAtManagementGroupScopeOptionalParams, - ): Promise; - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAtManagementGroupScope( - groupId: string, - deploymentName: string, - parameters: ScopedDeployment, - options?: DeploymentsCreateOrUpdateAtManagementGroupScopeOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentsCreateOrUpdateAtManagementGroupScopeResponse - > - >; - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAtManagementGroupScopeAndWait( - groupId: string, - deploymentName: string, - parameters: ScopedDeployment, - options?: DeploymentsCreateOrUpdateAtManagementGroupScopeOptionalParams, - ): Promise; - /** - * Gets a deployment. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - getAtManagementGroupScope( - groupId: string, - deploymentName: string, - options?: DeploymentsGetAtManagementGroupScopeOptionalParams, - ): Promise; - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the - * deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment - * stops the currently running template deployment and leaves the resources partially deployed. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - cancelAtManagementGroupScope( - groupId: string, - deploymentName: string, - options?: DeploymentsCancelAtManagementGroupScopeOptionalParams, - ): Promise; - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure - * Resource Manager.. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - beginValidateAtManagementGroupScope( - groupId: string, - deploymentName: string, - parameters: ScopedDeployment, - options?: DeploymentsValidateAtManagementGroupScopeOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentsValidateAtManagementGroupScopeResponse - > - >; - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure - * Resource Manager.. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - beginValidateAtManagementGroupScopeAndWait( - groupId: string, - deploymentName: string, - parameters: ScopedDeployment, - options?: DeploymentsValidateAtManagementGroupScopeOptionalParams, - ): Promise; - /** - * Returns changes that will be made by the deployment if executed at the scope of the management - * group. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - beginWhatIfAtManagementGroupScope( - groupId: string, - deploymentName: string, - parameters: ScopedDeploymentWhatIf, - options?: DeploymentsWhatIfAtManagementGroupScopeOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentsWhatIfAtManagementGroupScopeResponse - > - >; - /** - * Returns changes that will be made by the deployment if executed at the scope of the management - * group. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - beginWhatIfAtManagementGroupScopeAndWait( - groupId: string, - deploymentName: string, - parameters: ScopedDeploymentWhatIf, - options?: DeploymentsWhatIfAtManagementGroupScopeOptionalParams, - ): Promise; - /** - * Exports the template used for specified deployment. - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - exportTemplateAtManagementGroupScope( - groupId: string, - deploymentName: string, - options?: DeploymentsExportTemplateAtManagementGroupScopeOptionalParams, - ): Promise; - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment - * removes the associated deployment operations. This is an asynchronous operation that returns a - * status of 202 until the template deployment is successfully deleted. The Location response header - * contains the URI that is used to obtain the status of the process. While the process is running, a - * call to the URI in the Location header returns a status of 202. When the process finishes, the URI - * in the Location header returns a status of 204 on success. If the asynchronous request failed, the - * URI in the Location header returns an error-level status code. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - beginDeleteAtSubscriptionScope( - deploymentName: string, - options?: DeploymentsDeleteAtSubscriptionScopeOptionalParams, - ): Promise, void>>; - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment - * removes the associated deployment operations. This is an asynchronous operation that returns a - * status of 202 until the template deployment is successfully deleted. The Location response header - * contains the URI that is used to obtain the status of the process. While the process is running, a - * call to the URI in the Location header returns a status of 202. When the process finishes, the URI - * in the Location header returns a status of 204 on success. If the asynchronous request failed, the - * URI in the Location header returns an error-level status code. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - beginDeleteAtSubscriptionScopeAndWait( - deploymentName: string, - options?: DeploymentsDeleteAtSubscriptionScopeOptionalParams, - ): Promise; - /** - * Checks whether the deployment exists. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - checkExistenceAtSubscriptionScope( - deploymentName: string, - options?: DeploymentsCheckExistenceAtSubscriptionScopeOptionalParams, - ): Promise; - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAtSubscriptionScope( - deploymentName: string, - parameters: Deployment, - options?: DeploymentsCreateOrUpdateAtSubscriptionScopeOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentsCreateOrUpdateAtSubscriptionScopeResponse - > - >; - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAtSubscriptionScopeAndWait( - deploymentName: string, - parameters: Deployment, - options?: DeploymentsCreateOrUpdateAtSubscriptionScopeOptionalParams, - ): Promise; - /** - * Gets a deployment. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - getAtSubscriptionScope( - deploymentName: string, - options?: DeploymentsGetAtSubscriptionScopeOptionalParams, - ): Promise; - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the - * deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment - * stops the currently running template deployment and leaves the resources partially deployed. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - cancelAtSubscriptionScope( - deploymentName: string, - options?: DeploymentsCancelAtSubscriptionScopeOptionalParams, - ): Promise; - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure - * Resource Manager.. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - beginValidateAtSubscriptionScope( - deploymentName: string, - parameters: Deployment, - options?: DeploymentsValidateAtSubscriptionScopeOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentsValidateAtSubscriptionScopeResponse - > - >; - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure - * Resource Manager.. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - beginValidateAtSubscriptionScopeAndWait( - deploymentName: string, - parameters: Deployment, - options?: DeploymentsValidateAtSubscriptionScopeOptionalParams, - ): Promise; - /** - * Returns changes that will be made by the deployment if executed at the scope of the subscription. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to What If. - * @param options The options parameters. - */ - beginWhatIfAtSubscriptionScope( - deploymentName: string, - parameters: DeploymentWhatIf, - options?: DeploymentsWhatIfAtSubscriptionScopeOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentsWhatIfAtSubscriptionScopeResponse - > - >; - /** - * Returns changes that will be made by the deployment if executed at the scope of the subscription. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to What If. - * @param options The options parameters. - */ - beginWhatIfAtSubscriptionScopeAndWait( - deploymentName: string, - parameters: DeploymentWhatIf, - options?: DeploymentsWhatIfAtSubscriptionScopeOptionalParams, - ): Promise; - /** - * Exports the template used for specified deployment. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - exportTemplateAtSubscriptionScope( - deploymentName: string, - options?: DeploymentsExportTemplateAtSubscriptionScopeOptionalParams, - ): Promise; - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment - * removes the associated deployment operations. Deleting a template deployment does not affect the - * state of the resource group. This is an asynchronous operation that returns a status of 202 until - * the template deployment is successfully deleted. The Location response header contains the URI that - * is used to obtain the status of the process. While the process is running, a call to the URI in the - * Location header returns a status of 202. When the process finishes, the URI in the Location header - * returns a status of 204 on success. If the asynchronous request failed, the URI in the Location - * header returns an error-level status code. - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is - * case insensitive. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - deploymentName: string, - options?: DeploymentsDeleteOptionalParams, - ): Promise, void>>; - /** - * A template deployment that is currently running cannot be deleted. Deleting a template deployment - * removes the associated deployment operations. Deleting a template deployment does not affect the - * state of the resource group. This is an asynchronous operation that returns a status of 202 until - * the template deployment is successfully deleted. The Location response header contains the URI that - * is used to obtain the status of the process. While the process is running, a call to the URI in the - * Location header returns a status of 202. When the process finishes, the URI in the Location header - * returns a status of 204 on success. If the asynchronous request failed, the URI in the Location - * header returns an error-level status code. - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is - * case insensitive. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - deploymentName: string, - options?: DeploymentsDeleteOptionalParams, - ): Promise; - /** - * Checks whether the deployment exists. - * @param resourceGroupName The name of the resource group with the deployment to check. The name is - * case insensitive. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - checkExistence( - resourceGroupName: string, - deploymentName: string, - options?: DeploymentsCheckExistenceOptionalParams, - ): Promise; - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case - * insensitive. The resource group must already exist. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - deploymentName: string, - parameters: Deployment, - options?: DeploymentsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentsCreateOrUpdateResponse - > - >; - /** - * You can provide the template and parameters directly in the request or link to JSON files. - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case - * insensitive. The resource group must already exist. - * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - deploymentName: string, - parameters: Deployment, - options?: DeploymentsCreateOrUpdateOptionalParams, - ): Promise; - /** - * Gets a deployment. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - deploymentName: string, - options?: DeploymentsGetOptionalParams, - ): Promise; - /** - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the - * deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment - * stops the currently running template deployment and leaves the resource group partially deployed. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - cancel( - resourceGroupName: string, - deploymentName: string, - options?: DeploymentsCancelOptionalParams, - ): Promise; - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure - * Resource Manager.. - * @param resourceGroupName The name of the resource group the template will be deployed to. The name - * is case insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - beginValidate( - resourceGroupName: string, - deploymentName: string, - parameters: Deployment, - options?: DeploymentsValidateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentsValidateResponse - > - >; - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure - * Resource Manager.. - * @param resourceGroupName The name of the resource group the template will be deployed to. The name - * is case insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - beginValidateAndWait( - resourceGroupName: string, - deploymentName: string, - parameters: Deployment, - options?: DeploymentsValidateOptionalParams, - ): Promise; - /** - * Returns changes that will be made by the deployment if executed at the scope of the resource group. - * @param resourceGroupName The name of the resource group the template will be deployed to. The name - * is case insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - beginWhatIf( - resourceGroupName: string, - deploymentName: string, - parameters: DeploymentWhatIf, - options?: DeploymentsWhatIfOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DeploymentsWhatIfResponse - > - >; - /** - * Returns changes that will be made by the deployment if executed at the scope of the resource group. - * @param resourceGroupName The name of the resource group the template will be deployed to. The name - * is case insensitive. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param options The options parameters. - */ - beginWhatIfAndWait( - resourceGroupName: string, - deploymentName: string, - parameters: DeploymentWhatIf, - options?: DeploymentsWhatIfOptionalParams, - ): Promise; - /** - * Exports the template used for specified deployment. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param options The options parameters. - */ - exportTemplate( - resourceGroupName: string, - deploymentName: string, - options?: DeploymentsExportTemplateOptionalParams, - ): Promise; - /** - * Calculate the hash of the given template. - * @param template The template provided to calculate hash. - * @param options The options parameters. - */ - calculateTemplateHash( - template: Record, - options?: DeploymentsCalculateTemplateHashOptionalParams, - ): Promise; -} diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/index.ts b/sdk/resources/arm-resources/src/operationsInterfaces/index.ts index 2e1c58936bc0..782fec55abbc 100644 --- a/sdk/resources/arm-resources/src/operationsInterfaces/index.ts +++ b/sdk/resources/arm-resources/src/operationsInterfaces/index.ts @@ -7,10 +7,8 @@ */ export * from "./operations.js"; -export * from "./deployments.js"; export * from "./providers.js"; export * from "./providerResourceTypes.js"; export * from "./resources.js"; export * from "./resourceGroups.js"; export * from "./tagsOperations.js"; -export * from "./deploymentOperations.js"; diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/operations.ts b/sdk/resources/arm-resources/src/operationsInterfaces/operations.ts index 16fcc4862385..e09c02a0606b 100644 --- a/sdk/resources/arm-resources/src/operationsInterfaces/operations.ts +++ b/sdk/resources/arm-resources/src/operationsInterfaces/operations.ts @@ -16,7 +16,5 @@ export interface Operations { * Lists all of the available Microsoft.Resources REST API operations. * @param options The options parameters. */ - list( - options?: OperationsListOptionalParams, - ): PagedAsyncIterableIterator; + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; } diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/providers.ts b/sdk/resources/arm-resources/src/operationsInterfaces/providers.ts index 66217f1d1a61..8526b7d17b73 100644 --- a/sdk/resources/arm-resources/src/operationsInterfaces/providers.ts +++ b/sdk/resources/arm-resources/src/operationsInterfaces/providers.ts @@ -31,9 +31,7 @@ export interface Providers { * Gets all resource providers for a subscription. * @param options The options parameters. */ - list( - options?: ProvidersListOptionalParams, - ): PagedAsyncIterableIterator; + list(options?: ProvidersListOptionalParams): PagedAsyncIterableIterator; /** * Gets all resource providers for the tenant. * @param options The options parameters. diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/resourceGroups.ts b/sdk/resources/arm-resources/src/operationsInterfaces/resourceGroups.ts index 5cb21e630323..9343c0cc164f 100644 --- a/sdk/resources/arm-resources/src/operationsInterfaces/resourceGroups.ts +++ b/sdk/resources/arm-resources/src/operationsInterfaces/resourceGroups.ts @@ -33,9 +33,7 @@ export interface ResourceGroups { * Gets all the resource groups for a subscription. * @param options The options parameters. */ - list( - options?: ResourceGroupsListOptionalParams, - ): PagedAsyncIterableIterator; + list(options?: ResourceGroupsListOptionalParams): PagedAsyncIterableIterator; /** * Checks whether a resource group exists. * @param resourceGroupName The name of the resource group to check. The name is case insensitive. diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/resources.ts b/sdk/resources/arm-resources/src/operationsInterfaces/resources.ts index 7be8f29598aa..0bfa7db81920 100644 --- a/sdk/resources/arm-resources/src/operationsInterfaces/resources.ts +++ b/sdk/resources/arm-resources/src/operationsInterfaces/resources.ts @@ -52,9 +52,7 @@ export interface Resources { * Get all the resources in a subscription. * @param options The options parameters. */ - list( - options?: ResourcesListOptionalParams, - ): PagedAsyncIterableIterator; + list(options?: ResourcesListOptionalParams): PagedAsyncIterableIterator; /** * The resources to be moved must be in the same source resource group in the source subscription being * used. The target resource group may be in a different subscription. When moving resources, both the @@ -249,12 +247,7 @@ export interface Resources { apiVersion: string, parameters: GenericResource, options?: ResourcesUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - ResourcesUpdateResponse - > - >; + ): Promise, ResourcesUpdateResponse>>; /** * Updates a resource. * @param resourceGroupName The name of the resource group for the resource. The name is case @@ -388,10 +381,7 @@ export interface Resources { parameters: GenericResource, options?: ResourcesUpdateByIdOptionalParams, ): Promise< - SimplePollerLike< - OperationState, - ResourcesUpdateByIdResponse - > + SimplePollerLike, ResourcesUpdateByIdResponse> >; /** * Updates a resource by ID. diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/tagsOperations.ts b/sdk/resources/arm-resources/src/operationsInterfaces/tagsOperations.ts index 8ce16a440527..224047b066c8 100644 --- a/sdk/resources/arm-resources/src/operationsInterfaces/tagsOperations.ts +++ b/sdk/resources/arm-resources/src/operationsInterfaces/tagsOperations.ts @@ -38,9 +38,7 @@ export interface TagsOperations { * result. * @param options The options parameters. */ - list( - options?: TagsListOptionalParams, - ): PagedAsyncIterableIterator; + list(options?: TagsListOptionalParams): PagedAsyncIterableIterator; /** * This operation allows deleting a value from the list of predefined values for an existing predefined * tag name. The value being deleted must not be in use as a tag value for the given tag name for any @@ -129,10 +127,7 @@ export interface TagsOperations { parameters: TagsPatchResource, options?: TagsUpdateAtScopeOptionalParams, ): Promise< - SimplePollerLike< - OperationState, - TagsUpdateAtScopeResponse - > + SimplePollerLike, TagsUpdateAtScopeResponse> >; /** * This operation allows replacing, merging or selectively deleting tags on the specified resource or diff --git a/sdk/resources/arm-resources/src/pagingHelper.ts b/sdk/resources/arm-resources/src/pagingHelper.ts index 205cccc26592..e362819bdfc4 100644 --- a/sdk/resources/arm-resources/src/pagingHelper.ts +++ b/sdk/resources/arm-resources/src/pagingHelper.ts @@ -26,10 +26,7 @@ export function getContinuationToken(page: unknown): string | undefined { return pageMap.get(page)?.continuationToken; } -export function setContinuationToken( - page: unknown, - continuationToken: string | undefined, -): void { +export function setContinuationToken(page: unknown, continuationToken: string | undefined): void { if (typeof page !== "object" || page === null || !continuationToken) { return; } diff --git a/sdk/resources/arm-resources/src/resourceManagementClient.ts b/sdk/resources/arm-resources/src/resourceManagementClient.ts index 8a877914d5b2..2dc407ee8e9f 100644 --- a/sdk/resources/arm-resources/src/resourceManagementClient.ts +++ b/sdk/resources/arm-resources/src/resourceManagementClient.ts @@ -8,31 +8,23 @@ 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 { PipelineRequest, PipelineResponse, SendRequest } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { OperationsImpl, - DeploymentsImpl, ProvidersImpl, ProviderResourceTypesImpl, ResourcesImpl, ResourceGroupsImpl, TagsOperationsImpl, - DeploymentOperationsImpl, } from "./operations/index.js"; import { Operations, - Deployments, Providers, ProviderResourceTypes, Resources, ResourceGroups, TagsOperations, - DeploymentOperations, } from "./operationsInterfaces/index.js"; import { ResourceManagementClientOptionalParams } from "./models/index.js"; @@ -82,7 +74,7 @@ export class ResourceManagementClient extends coreClient.ServiceClient { credential: credentials, }; - const packageDetails = `azsdk-js-arm-resources/6.0.1`; + const packageDetails = `azsdk-js-arm-resources/7.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -94,8 +86,7 @@ export class ResourceManagementClient extends coreClient.ServiceClient { userAgentOptions: { userAgentPrefix, }, - endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com", + endpoint: options.endpoint ?? options.baseUri ?? "https://management.azure.com", }; super(optionsWithDefaults); @@ -105,8 +96,7 @@ export class ResourceManagementClient extends coreClient.ServiceClient { options.pipeline.getOrderedPolicies(); bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => - pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName, + pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -122,11 +112,9 @@ export class ResourceManagementClient extends coreClient.ServiceClient { coreRestPipeline.bearerTokenAuthenticationPolicy({ credential: credentials, scopes: - optionsWithDefaults.credentialScopes ?? - `${optionsWithDefaults.endpoint}/.default`, + optionsWithDefaults.credentialScopes ?? `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge, + authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge, }, }), ); @@ -136,15 +124,13 @@ export class ResourceManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2024-11-01"; + this.apiVersion = options.apiVersion || "2025-04-01"; this.operations = new OperationsImpl(this); - this.deployments = new DeploymentsImpl(this); this.providers = new ProvidersImpl(this); this.providerResourceTypes = new ProviderResourceTypesImpl(this); this.resources = new ResourcesImpl(this); this.resourceGroups = new ResourceGroupsImpl(this); this.tagsOperations = new TagsOperationsImpl(this); - this.deploymentOperations = new DeploymentOperationsImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -155,10 +141,7 @@ export class ResourceManagementClient extends coreClient.ServiceClient { } const apiVersionPolicy = { name: "CustomApiVersionPolicy", - async sendRequest( - request: PipelineRequest, - next: SendRequest, - ): Promise { + async sendRequest(request: PipelineRequest, next: SendRequest): Promise { const param = request.url.split("?"); if (param.length > 1) { const newParams = param[1].split("&").map((item) => { @@ -177,11 +160,9 @@ export class ResourceManagementClient extends coreClient.ServiceClient { } operations: Operations; - deployments: Deployments; providers: Providers; providerResourceTypes: ProviderResourceTypes; resources: Resources; resourceGroups: ResourceGroups; tagsOperations: TagsOperations; - deploymentOperations: DeploymentOperations; } diff --git a/sdk/resources/arm-resources/test/resources_examples.spec.ts b/sdk/resources/arm-resources/test/resources_examples.spec.ts index bc4f3b2f4a7a..f738fdef8b56 100644 --- a/sdk/resources/arm-resources/test/resources_examples.spec.ts +++ b/sdk/resources/arm-resources/test/resources_examples.spec.ts @@ -110,7 +110,6 @@ describe("Resources test", () => { assert.notEqual(resArray.length, 0); }); - it("tagsOperations update test", async () => { const res = await client.tagsOperations.beginUpdateAtScopeAndWait(scope, { operation: "Delete", diff --git a/sdk/resources/arm-resources/test/sampleTest.spec.ts b/sdk/resources/arm-resources/test/sampleTest.spec.ts new file mode 100644 index 000000000000..90b3c8a868b4 --- /dev/null +++ b/sdk/resources/arm-resources/test/sampleTest.spec.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { Recorder, RecorderStartOptions } from "@azure-tools/test-recorder"; +import { afterEach, beforeEach, describe, it, assert } from "vitest"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async () => { + recorder = new Recorder(); + await recorder.start(recorderOptions); + }); + + afterEach(async () => { + await recorder.stop(); + }); + + it("sample test", async () => { + assert(true); + }); +}); diff --git a/sdk/resources/arm-resources/test/snippets.spec.ts b/sdk/resources/arm-resources/test/snippets.spec.ts index e0f7036e0f07..2bdbbdfd0cae 100644 --- a/sdk/resources/arm-resources/test/snippets.spec.ts +++ b/sdk/resources/arm-resources/test/snippets.spec.ts @@ -1,5 +1,10 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. +/* + * 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 { ResourceManagementClient } from "../src/index.js"; import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; diff --git a/sdk/resources/arm-resources/tsconfig.browser.config.json b/sdk/resources/arm-resources/tsconfig.browser.config.json index 0c8bafa97126..75871518e3a0 100644 --- a/sdk/resources/arm-resources/tsconfig.browser.config.json +++ b/sdk/resources/arm-resources/tsconfig.browser.config.json @@ -1,6 +1,3 @@ { - "extends": [ - "./tsconfig.test.json", - "../../../tsconfig.browser.base.json" - ] + "extends": ["./tsconfig.test.json", "../../../tsconfig.browser.base.json"] } diff --git a/sdk/resources/arm-resources/tsconfig.json b/sdk/resources/arm-resources/tsconfig.json index 19ceb382b521..59ea83c046bf 100644 --- a/sdk/resources/arm-resources/tsconfig.json +++ b/sdk/resources/arm-resources/tsconfig.json @@ -3,11 +3,8 @@ { "path": "./tsconfig.src.json" }, - { - "path": "./tsconfig.samples.json" - }, { "path": "./tsconfig.test.json" } ] -} +} \ No newline at end of file diff --git a/sdk/resources/arm-resources/tsconfig.samples.json b/sdk/resources/arm-resources/tsconfig.samples.json index 4259779f93c2..3e3f70ad7028 100644 --- a/sdk/resources/arm-resources/tsconfig.samples.json +++ b/sdk/resources/arm-resources/tsconfig.samples.json @@ -2,9 +2,7 @@ "extends": "../../../tsconfig.samples.base.json", "compilerOptions": { "paths": { - "@azure/arm-resources": [ - "./dist/esm" - ] + "@azure/arm-resources": ["./dist/esm"] } } } diff --git a/sdk/resources/arm-resources/tsconfig.test.json b/sdk/resources/arm-resources/tsconfig.test.json index 3c2b783a8c1b..290ca214aebc 100644 --- a/sdk/resources/arm-resources/tsconfig.test.json +++ b/sdk/resources/arm-resources/tsconfig.test.json @@ -1,6 +1,3 @@ { - "extends": [ - "./tsconfig.src.json", - "../../../tsconfig.test.base.json" - ] + "extends": ["./tsconfig.src.json", "../../../tsconfig.test.base.json"] }