From 7035ec6d6f3a6ea3b94b882b44ff8790473a0002 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 18 Mar 2025 07:41:42 +0000 Subject: [PATCH] CodeGen from PR 3638 in test-repo-billy/azure-rest-api-specs Merge f14c57007b0af48c4c63a0d3ea823db7d7273b7b into 2b2e803b5aa04ba3b98ca563f7ac5ac576a0fe0e --- common/config/rush/pnpm-lock.yaml | 126 +- sdk/changes/arm-changes/CHANGELOG.md | 18 +- sdk/changes/arm-changes/LICENSE | 2 +- sdk/changes/arm-changes/README.md | 9 +- sdk/changes/arm-changes/_meta.json | 10 +- sdk/changes/arm-changes/api-extractor.json | 6 +- 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 | 29 +- sdk/changes/arm-changes/src/models/index.ts | 7 +- sdk/changes/arm-changes/src/models/mappers.ts | 178 +- .../arm-changes/src/models/parameters.ts | 76 +- .../arm-changes/src/operations/changes.ts | 81 +- .../src/operationsInterfaces/changes.ts | 6 +- sdk/changes/arm-changes/src/pagingHelper.ts | 10 +- sdk/changes/arm-changes/test/sampleTest.ts | 40 + sdk/changes/arm-changes/test/snippets.spec.ts | 18 +- .../arm-changes/tsconfig.browser.config.json | 19 +- sdk/changes/arm-changes/tsconfig.json | 44 +- .../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 | 15 +- .../arm-databoundaries/_meta.json | 12 +- .../arm-databoundaries/api-extractor.json | 6 +- .../arm-databoundaries/package.json | 33 +- .../review/arm-databoundaries.api.md | 66 + .../arm-databoundaries/sample.env | 2 +- .../src/databoundariesManegementClient.ts | 8 +- .../arm-databoundaries/src/index.ts | 2 + .../arm-databoundaries/src/models/index.ts | 174 +- .../arm-databoundaries/src/models/mappers.ts | 194 +- .../src/models/parameters.ts | 46 +- .../src/operations/dataBoundaries.ts | 2 +- .../src/operations/index.ts | 1 + .../src/operations/operations.ts | 149 ++ .../src/operationsInterfaces/index.ts | 1 + .../src/operationsInterfaces/operations.ts | 22 + .../arm-databoundaries/src/pagingHelper.ts | 39 + .../arm-databoundaries/test/sampleTest.ts | 40 + .../arm-databoundaries/test/snippets.spec.ts | 27 +- .../arm-databoundaries/tsconfig.json | 46 +- sdk/features/arm-features/CHANGELOG.md | 19 +- sdk/features/arm-features/LICENSE | 2 +- sdk/features/arm-features/README.md | 9 +- sdk/features/arm-features/_meta.json | 14 +- sdk/features/arm-features/api-extractor.json | 6 +- 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 | 91 +- sdk/features/arm-features/src/models/index.ts | 22 +- .../arm-features/src/models/mappers.ts | 424 ++-- .../arm-features/src/models/parameters.ts | 64 +- .../arm-features/src/operations/features.ts | 132 +- .../subscriptionFeatureRegistrations.ts | 144 +- .../src/operationsInterfaces/features.ts | 12 +- .../subscriptionFeatureRegistrations.ts | 12 +- sdk/features/arm-features/src/pagingHelper.ts | 10 +- sdk/features/arm-features/test/sampleTest.ts | 40 + .../arm-features/test/snippets.spec.ts | 18 +- .../arm-features/tsconfig.browser.config.json | 5 +- sdk/features/arm-features/tsconfig.json | 37 +- .../arm-features/tsconfig.samples.json | 4 +- sdk/features/arm-features/tsconfig.test.json | 5 +- .../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 | 9 +- sdk/links/arm-links/_meta.json | 14 +- sdk/links/arm-links/api-extractor.json | 6 +- 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 | 49 +- sdk/links/arm-links/src/models/index.ts | 5 +- sdk/links/arm-links/src/models/mappers.ts | 122 +- sdk/links/arm-links/src/models/parameters.ts | 64 +- .../arm-links/src/operations/operations.ts | 29 +- .../arm-links/src/operations/resourceLinks.ts | 92 +- .../src/operationsInterfaces/operations.ts | 2 +- .../src/operationsInterfaces/resourceLinks.ts | 12 +- sdk/links/arm-links/src/pagingHelper.ts | 10 +- sdk/links/arm-links/test/sampleTest.ts | 40 + sdk/links/arm-links/test/snippets.spec.ts | 18 +- .../arm-links/tsconfig.browser.config.json | 5 +- sdk/links/arm-links/tsconfig.json | 40 +- sdk/links/arm-links/tsconfig.samples.json | 4 +- sdk/links/arm-links/tsconfig.test.json | 5 +- 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 | 17 +- sdk/locks/arm-locks/_meta.json | 12 +- sdk/locks/arm-locks/api-extractor.json | 6 +- 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 | 51 +- sdk/locks/arm-locks/src/models/index.ts | 57 +- sdk/locks/arm-locks/src/models/mappers.ts | 204 +- sdk/locks/arm-locks/src/models/parameters.ts | 90 +- .../src/operations/authorizationOperations.ts | 33 +- .../src/operations/managementLocks.ts | 444 ++-- .../authorizationOperations.ts | 4 +- .../operationsInterfaces/managementLocks.ts | 34 +- sdk/locks/arm-locks/src/pagingHelper.ts | 10 +- sdk/locks/arm-locks/test/sampleTest.ts | 40 + sdk/locks/arm-locks/test/snippets.spec.ts | 18 +- .../arm-locks/tsconfig.browser.config.json | 5 +- sdk/locks/arm-locks/tsconfig.json | 38 +- sdk/locks/arm-locks/tsconfig.samples.json | 4 +- sdk/locks/arm-locks/tsconfig.test.json | 5 +- 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 | 9 +- .../arm-managedapplications/_meta.json | 14 +- .../api-extractor.json | 6 +- .../arm-managedapplications/package.json | 32 +- .../review/arm-managedapplications.api.md | 574 +---- .../arm-managedapplications/sample.env | 5 +- .../src/applicationClient.ts | 79 +- .../arm-managedapplications/src/lroImpl.ts | 10 +- .../src/models/index.ts | 1058 +--------- .../src/models/mappers.ts | 1640 +++------------ .../src/models/parameters.ts | 152 +- .../src/operations/applicationDefinitions.ts | 674 +++--- .../src/operations/applications.ts | 815 ++------ .../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 | 2 +- .../test/sampleTest.ts | 40 + .../test/snippets.spec.ts | 18 +- .../tsconfig.browser.config.json | 5 +- .../arm-managedapplications/tsconfig.json | 41 +- .../tsconfig.samples.json | 4 +- .../tsconfig.test.json | 5 +- .../vitest.browser.config.ts | 3 +- .../arm-managedapplications/vitest.config.ts | 1 + .../vitest.esm.config.ts | 6 +- sdk/policy/arm-policy/CHANGELOG.md | 142 ++ sdk/policy/arm-policy/LICENSE | 2 +- sdk/policy/arm-policy/README.md | 9 +- sdk/policy/arm-policy/_meta.json | 14 +- sdk/policy/arm-policy/api-extractor.json | 6 +- sdk/policy/arm-policy/package.json | 35 +- .../arm-policy/review/arm-policy.api.md | 609 ++++-- sdk/policy/arm-policy/sample.env | 5 +- sdk/policy/arm-policy/src/lroImpl.ts | 42 + sdk/policy/arm-policy/src/models/index.ts | 1084 ++++++---- sdk/policy/arm-policy/src/models/mappers.ts | 1847 ++++++++++------- .../arm-policy/src/models/parameters.ts | 289 +-- .../src/operations/dataPolicyManifests.ts | 190 -- sdk/policy/arm-policy/src/operations/index.ts | 5 +- .../src/operations/policyAssignments.ts | 348 ++-- .../operations/policyDefinitionVersions.ts | 902 ++++++++ .../src/operations/policyDefinitions.ts | 265 ++- .../src/operations/policyExemptions.ts | 877 -------- .../operations/policySetDefinitionVersions.ts | 907 ++++++++ .../src/operations/policySetDefinitions.ts | 288 +-- .../arm-policy/src/operations/policyTokens.ts | 149 ++ .../dataPolicyManifests.ts | 40 - .../src/operationsInterfaces/index.ts | 5 +- .../operationsInterfaces/policyAssignments.ts | 26 +- .../policyDefinitionVersions.ts | 193 ++ .../operationsInterfaces/policyDefinitions.ts | 34 +- .../operationsInterfaces/policyExemptions.ts | 151 -- .../policySetDefinitionVersions.ts | 196 ++ .../policySetDefinitions.ts | 34 +- .../src/operationsInterfaces/policyTokens.ts | 41 + sdk/policy/arm-policy/src/pagingHelper.ts | 2 +- sdk/policy/arm-policy/src/policyClient.ts | 100 +- sdk/policy/arm-policy/test/sampleTest.ts | 40 + sdk/policy/arm-policy/test/snippets.spec.ts | 18 +- .../arm-policy/tsconfig.browser.config.json | 5 +- sdk/policy/arm-policy/tsconfig.json | 39 +- sdk/policy/arm-policy/tsconfig.samples.json | 4 +- sdk/policy/arm-policy/tsconfig.test.json | 5 +- .../arm-policy/vitest.browser.config.ts | 3 +- sdk/policy/arm-policy/vitest.config.ts | 1 + sdk/policy/arm-policy/vitest.esm.config.ts | 6 +- .../arm-resources-subscriptions/LICENSE | 2 +- .../arm-resources-subscriptions/README.md | 11 +- .../arm-resources-subscriptions/_meta.json | 10 +- .../api-extractor.json | 6 +- .../arm-resources-subscriptions/package.json | 24 +- .../arm-resources-subscriptions/sample.env | 5 +- .../src/models/index.ts | 10 +- .../src/models/mappers.ts | 638 +++--- .../src/models/parameters.ts | 50 +- .../src/operations/operations.ts | 32 +- .../src/operations/subscriptions.ts | 81 +- .../src/operations/tenants.ts | 32 +- .../src/operationsInterfaces/operations.ts | 2 +- .../src/operationsInterfaces/subscriptions.ts | 10 +- .../src/operationsInterfaces/tenants.ts | 2 +- .../src/pagingHelper.ts | 2 +- .../src/subscriptionClient.ts | 43 +- .../test/sampleTest.ts | 40 + .../test/snippets.spec.ts | 18 +- .../arm-resources-subscriptions/tsconfig.json | 43 +- sdk/resources/arm-resources/LICENSE | 2 +- sdk/resources/arm-resources/README.md | 9 +- sdk/resources/arm-resources/_meta.json | 10 +- .../arm-resources/api-extractor.json | 6 +- sdk/resources/arm-resources/package.json | 24 +- .../src/resourceManagementClient.ts | 2 +- .../arm-resources/test/sampleTest.ts | 40 + .../arm-resources/test/snippets.spec.ts | 18 +- sdk/resources/arm-resources/tsconfig.json | 36 +- .../arm-resourcesdeploymentstacks/LICENSE | 2 +- .../arm-resourcesdeploymentstacks/README.md | 11 +- .../arm-resourcesdeploymentstacks/_meta.json | 10 +- .../api-extractor.json | 6 +- .../package.json | 24 +- .../arm-resourcesdeploymentstacks/sample.env | 5 +- .../src/deploymentStacksClient.ts | 2 +- .../src/lroImpl.ts | 4 + .../test/sampleTest.ts | 40 + .../test/snippets.spec.ts | 18 +- .../tsconfig.json | 45 +- .../arm-templatespecs/CHANGELOG.md | 36 +- sdk/templatespecs/arm-templatespecs/LICENSE | 2 +- sdk/templatespecs/arm-templatespecs/README.md | 15 +- .../arm-templatespecs/_meta.json | 12 +- .../arm-templatespecs/api-extractor.json | 6 +- .../arm-templatespecs/package.json | 27 +- .../review/arm-templatespecs.api.md | 53 +- .../arm-templatespecs/sample.env | 5 +- .../arm-templatespecs/src/models/index.ts | 63 +- .../arm-templatespecs/src/models/mappers.ts | 274 +-- .../src/models/parameters.ts | 80 +- .../src/operations/templateSpecVersions.ts | 295 ++- .../src/operations/templateSpecs.ts | 304 ++- .../templateSpecVersions.ts | 35 +- .../src/operationsInterfaces/templateSpecs.ts | 33 +- .../arm-templatespecs/src/pagingHelper.ts | 10 +- .../src/templateSpecsClient.ts | 51 +- .../arm-templatespecs/test/sampleTest.ts | 40 + .../arm-templatespecs/test/snippets.spec.ts | 17 +- .../arm-templatespecs/tsconfig.json | 42 +- 256 files changed, 11531 insertions(+), 10763 deletions(-) create mode 100644 sdk/changes/arm-changes/test/sampleTest.ts 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.ts create mode 100644 sdk/features/arm-features/test/sampleTest.ts create mode 100644 sdk/links/arm-links/test/sampleTest.ts create mode 100644 sdk/locks/arm-locks/test/sampleTest.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.ts create mode 100644 sdk/policy/arm-policy/src/lroImpl.ts delete mode 100644 sdk/policy/arm-policy/src/operations/dataPolicyManifests.ts create mode 100644 sdk/policy/arm-policy/src/operations/policyDefinitionVersions.ts delete mode 100644 sdk/policy/arm-policy/src/operations/policyExemptions.ts create mode 100644 sdk/policy/arm-policy/src/operations/policySetDefinitionVersions.ts create mode 100644 sdk/policy/arm-policy/src/operations/policyTokens.ts delete mode 100644 sdk/policy/arm-policy/src/operationsInterfaces/dataPolicyManifests.ts create mode 100644 sdk/policy/arm-policy/src/operationsInterfaces/policyDefinitionVersions.ts delete mode 100644 sdk/policy/arm-policy/src/operationsInterfaces/policyExemptions.ts create mode 100644 sdk/policy/arm-policy/src/operationsInterfaces/policySetDefinitionVersions.ts create mode 100644 sdk/policy/arm-policy/src/operationsInterfaces/policyTokens.ts create mode 100644 sdk/policy/arm-policy/test/sampleTest.ts create mode 100644 sdk/resources-subscriptions/arm-resources-subscriptions/test/sampleTest.ts create mode 100644 sdk/resources/arm-resources/test/sampleTest.ts create mode 100644 sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/test/sampleTest.ts create mode 100644 sdk/templatespecs/arm-templatespecs/test/sampleTest.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 8600166fe0f3..b15161f0db8a 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -1309,10 +1309,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'} @@ -1357,10 +1353,6 @@ packages: resolution: {integrity: sha512-DxOSLua+NdpWoSqULhjDyAZTXFdP/LKkqtYuxxz1SCN289zk3OG8UOpnCQAz/tygyACBtWp/BoO72ptK7msY8g==} engines: {node: '>=18.0.0'} - '@azure/core-xml@1.4.5': - resolution: {integrity: sha512-gT4H8mTaSXRz7eGTuQyq1aIJnJqeXzpOe9Ay7Z3FrCouer14CbV3VzjnJrNrQfbBpGBLO9oy8BmrY75A0p53cA==} - engines: {node: '>=18.0.0'} - '@azure/functions@3.5.1': resolution: {integrity: sha512-6UltvJiuVpvHSwLcK/Zc6NfUwlkDLOFFx97BHCJzlWNsfiWwzwmTsxJXg4kE/LemKTHxPpfoPE+kOJ8hAdiKFQ==} @@ -1440,10 +1432,6 @@ packages: resolution: {integrity: sha512-IzD+hfqGqFtXymHXm4RzrZW2MsSH2M7RLmZsKaKVi7SUxbeYTUeX+ALk8gVzkM8ykb7EzlDLWCNErKfAa57rYQ==} engines: {node: '>=18.0.0'} - '@azure/storage-file-share@12.26.0': - resolution: {integrity: sha512-o/cvWx+904JqK1OjG4/lrnDXZMwSsnPEnlKtJVcx1XntTsthCejA6ZMHJMCEU0yiu4wJ8Q+Bp5a8zEdzkRZIVQ==} - engines: {node: '>=18.0.0'} - '@azure/template@1.0.13-beta.1': resolution: {integrity: sha512-dn0mqAC4jPUbqAOUxdkVNihu1rV6Na7rX8xtwU2LI0JKlZJXOULxzDR4Zyc02s5aUdLpRkyxGoGStdkc+dJC4w==} engines: {node: '>=18.0.0'} @@ -2574,7 +2562,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-C/67FXLUgyDWTUDHrhqLsIpKSz4laswUzpwnO0jvvrYGp4ZyxpJhfWskcOIEiT+H50t0QNNZRs5ndUG8y14KGg==, tarball: file:projects/arm-changes.tgz} version: 0.0.0 '@rush-temp/arm-chaos@file:projects/arm-chaos.tgz': @@ -2690,7 +2678,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-2w7HqnctNKahu/dVGEDk4g3uYRK1e22n9gmpNZRu7zWthUmNnGB2gW/BjU1RFtzfP+m+KDpwK0EhcMhj3dUIYw==, tarball: file:projects/arm-databoundaries.tgz} version: 0.0.0 '@rush-temp/arm-databox@file:projects/arm-databox.tgz': @@ -2838,7 +2826,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-en596/aK8os4s03nSaAsHmc+hKnSc1JPV7aMooOr1/5Rk4jDQ+Pn9g07XXgIq/kfaB93eQ2JCEPAwtHDeOkM+A==, tarball: file:projects/arm-features.tgz} version: 0.0.0 '@rush-temp/arm-fluidrelay@file:projects/arm-fluidrelay.tgz': @@ -2962,7 +2950,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-+eeUkBRjFEZtXgAUNguZBug8r+6M1lBP70qZAOp3g15Tc79KZN4UqclzTxGY7g6TGOYd37FqpipBjrNUCMFy0A==, tarball: file:projects/arm-links.tgz} version: 0.0.0 '@rush-temp/arm-loadtesting@file:projects/arm-loadtesting.tgz': @@ -2974,7 +2962,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-WaG2FGwcXpTr2I4J+woFz1pEKwDUssuqwrXgqXdfNrb51hr4c5o9Rak1h2X0qJ9QoQ045jPhj+Em60QXBSxorg==, tarball: file:projects/arm-locks.tgz} version: 0.0.0 '@rush-temp/arm-logic@file:projects/arm-logic.tgz': @@ -2998,7 +2986,7 @@ packages: version: 0.0.0 '@rush-temp/arm-managedapplications@file:projects/arm-managedapplications.tgz': - resolution: {integrity: sha512-UbbFrI6JYvteNsOjTYYZb1Brf4NHXw3gDHEJUfQrKyJ+mT2n/xDIVtDHEFyA7V5dFiL4GDcw4EBx35cNrry6Tw==, tarball: file:projects/arm-managedapplications.tgz} + resolution: {integrity: sha512-5mmOdVwj1MSIFcTUmq0klNjCcxmG7hd7l4MdPqrZEq9FofMFNZEP+dX8F4F0aZytpEOmbfr0zUbTEB5LfJ1Hsg==, tarball: file:projects/arm-managedapplications.tgz} version: 0.0.0 '@rush-temp/arm-managednetworkfabric@file:projects/arm-managednetworkfabric.tgz': @@ -3150,7 +3138,7 @@ packages: version: 0.0.0 '@rush-temp/arm-policy@file:projects/arm-policy.tgz': - resolution: {integrity: sha512-uSg1661j1xPl494tmGf3J1s/nGF/p8LEYNgsG2buTY0/FE+lZv4qgMb4dBbgdK4pLat2GXDucCCgDWKmAmUP4A==, tarball: file:projects/arm-policy.tgz} + resolution: {integrity: sha512-DoBCVPzHHCFysH60sR5oXA4sBvIHuNCnOphvsghycWP4WrUqjFP3qh3gvXXTcRbYRbtuSqjKLOQehRqELwPl6A==, tarball: file:projects/arm-policy.tgz} version: 0.0.0 '@rush-temp/arm-policyinsights@file:projects/arm-policyinsights.tgz': @@ -3254,15 +3242,15 @@ packages: version: 0.0.0 '@rush-temp/arm-resources-subscriptions@file:projects/arm-resources-subscriptions.tgz': - resolution: {integrity: sha512-dpbuMBCn5+QceRpPWU/tAM7gsWY1cxrowdGKEarYfN21uvIbyJgl/cjUSzwpIcFte22xsuT5p2xJvbUrNCERgw==, tarball: file:projects/arm-resources-subscriptions.tgz} + resolution: {integrity: sha512-G0AXtCnk72TPPpArB2jsXCVWW80IsN6e57FNHeJY3rl7mQCx540637iob+kyRoGqbjdr9rhyXsmnyME5jQ+FGw==, tarball: file:projects/arm-resources-subscriptions.tgz} 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-JC47efCmUj17LQh3gSg59NA577W08n/pn/RAI+5c28Q4zZ420PZSo8ww5Aw97xF3yMsP8wSl8tNLqU4dOLbRhw==, tarball: file:projects/arm-resources.tgz} version: 0.0.0 '@rush-temp/arm-resourcesdeploymentstacks@file:projects/arm-resourcesdeploymentstacks.tgz': - resolution: {integrity: sha512-Zag8EFItLBCwNHvwDUzd0TYDcoqFJFUm9NfHCd7yTFQGxkbXVQ2HPVlzp69mfHxTFbtUF334/e8HffWj9UdPgQ==, tarball: file:projects/arm-resourcesdeploymentstacks.tgz} + resolution: {integrity: sha512-xmV7Zh5PXxLUwgT6QrR1Xo4UHlziwmz00ZlXRvH9C8MteFBQqXtxSl8VcNsHjY/7zzrFvVDZDLYiw0871kCnIQ==, tarball: file:projects/arm-resourcesdeploymentstacks.tgz} version: 0.0.0 '@rush-temp/arm-scvmm@file:projects/arm-scvmm.tgz': @@ -3406,7 +3394,7 @@ packages: version: 0.0.0 '@rush-temp/arm-templatespecs@file:projects/arm-templatespecs.tgz': - resolution: {integrity: sha512-4xOW7LuC+PWooZssCQ3TCQ0VuFD8Ood75hZhtqcpGTvs/Hwze+CVEo9Cy9B8vmWuQxMKyMRPoOtt2vYibi4csg==, tarball: file:projects/arm-templatespecs.tgz} + resolution: {integrity: sha512-JVavvarmAhvuYEyWVyMRvMGl/kFuWQ5n9I5JkqcC7VAETib1cWxSj3W9fxlvTbopANC/bAriXUWhSaxSsaWd6w==, tarball: file:projects/arm-templatespecs.tgz} version: 0.0.0 '@rush-temp/arm-terraform@file:projects/arm-terraform.tgz': @@ -3866,7 +3854,7 @@ packages: version: 0.0.0 '@rush-temp/perf-storage-file-share@file:projects/perf-storage-file-share.tgz': - resolution: {integrity: sha512-8wCFKHwG4f1OaVLGPs1ZHUoBpHnbOmtqyvFSDVKCtnpuy3bnxTdK+wdjE6uWuvHOxOv9xSJyTS2ekQhcvFs6Aw==, tarball: file:projects/perf-storage-file-share.tgz} + resolution: {integrity: sha512-0EmfhpZnjn3yxng5UYDMwxKPkiHYwkeNJFHwLPxayGzJhiiRgd5cNIM4Pvh5UNSIHIcSJVXltoazvBY/Pmrh1w==, tarball: file:projects/perf-storage-file-share.tgz} version: 0.0.0 '@rush-temp/perf-template@file:projects/perf-template.tgz': @@ -3926,7 +3914,7 @@ packages: version: 0.0.0 '@rush-temp/storage-file-datalake@file:projects/storage-file-datalake.tgz': - resolution: {integrity: sha512-cjeUa7EgqQ1nhsJYVM/yhMUosEinE++tWwgkm5DpeZ7j1M2phPqKE/M5auu209emar9WER/UgBIB/A350a9GpA==, tarball: file:projects/storage-file-datalake.tgz} + resolution: {integrity: sha512-AwMwBu+HEpNMO73vrFi36Li/brUqekXTJr5yVgYm2NX9FD1OsROC6Za3ChVTfzaotO8hEmCvrnBklm0n/QT24w==, tarball: file:projects/storage-file-datalake.tgz} version: 0.0.0 '@rush-temp/storage-file-share@file:projects/storage-file-share.tgz': @@ -8196,18 +8184,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 @@ -8298,11 +8274,6 @@ snapshots: '@azure/abort-controller': 2.1.2 tslib: 2.8.1 - '@azure/core-xml@1.4.5': - dependencies: - fast-xml-parser: 5.0.9 - tslib: 2.8.1 - '@azure/functions@3.5.1': dependencies: iconv-lite: 0.6.3 @@ -8490,23 +8461,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@azure/storage-file-share@12.26.0': - dependencies: - '@azure/abort-controller': 2.1.2 - '@azure/core-auth': 1.9.0 - '@azure/core-client': 1.9.3 - '@azure/core-http-compat': 2.2.0 - '@azure/core-paging': 1.6.2 - '@azure/core-rest-pipeline': 1.19.1 - '@azure/core-tracing': 1.2.0 - '@azure/core-util': 1.11.0 - '@azure/core-xml': 1.4.5 - '@azure/logger': 1.1.4 - events: 3.3.0 - tslib: 2.8.1 - transitivePeerDependencies: - - supports-color - '@azure/template@1.0.13-beta.1': dependencies: '@azure/core-auth': 1.9.0 @@ -11305,11 +11259,12 @@ snapshots: '@rush-temp/arm-changes@file:projects/arm-changes.tgz(@types/debug@4.1.12)(msw@2.7.3(@types/node@22.7.9)(typescript@5.8.2))(tsx@4.19.3)(vite@6.2.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(yaml@2.7.0)': dependencies: '@types/node': 18.19.80 - '@vitest/browser': 3.0.9(@types/node@18.19.80)(playwright@1.51.1)(typescript@5.8.2)(vite@6.2.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.9) + '@vitest/browser': 3.0.9(@types/node@18.19.80)(playwright@1.51.1)(typescript@5.6.3)(vite@6.2.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.9) '@vitest/coverage-istanbul': 3.0.9(vitest@3.0.9) + dotenv: 16.4.7 playwright: 1.51.1 tslib: 2.8.1 - typescript: 5.8.2 + typescript: 5.6.3 vitest: 3.0.9(@types/debug@4.1.12)(@types/node@18.19.80)(@vitest/browser@3.0.9)(msw@2.7.3(@types/node@22.7.9)(typescript@5.8.2))(tsx@4.19.3)(yaml@2.7.0) transitivePeerDependencies: - '@edge-runtime/vm' @@ -12319,12 +12274,12 @@ snapshots: '@rush-temp/arm-databoundaries@file:projects/arm-databoundaries.tgz(@types/debug@4.1.12)(msw@2.7.3(@types/node@22.7.9)(typescript@5.8.2))(tsx@4.19.3)(vite@6.2.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(yaml@2.7.0)': dependencies: '@types/node': 18.19.80 - '@vitest/browser': 3.0.9(@types/node@18.19.80)(playwright@1.51.1)(typescript@5.8.2)(vite@6.2.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.9) + '@vitest/browser': 3.0.9(@types/node@18.19.80)(playwright@1.51.1)(typescript@5.6.3)(vite@6.2.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.9) '@vitest/coverage-istanbul': 3.0.9(vitest@3.0.9) dotenv: 16.4.7 playwright: 1.51.1 tslib: 2.8.1 - typescript: 5.8.2 + typescript: 5.6.3 vitest: 3.0.9(@types/debug@4.1.12)(@types/node@18.19.80)(@vitest/browser@3.0.9)(msw@2.7.3(@types/node@22.7.9)(typescript@5.8.2))(tsx@4.19.3)(yaml@2.7.0) transitivePeerDependencies: - '@edge-runtime/vm' @@ -13605,11 +13560,12 @@ snapshots: '@rush-temp/arm-features@file:projects/arm-features.tgz(@types/debug@4.1.12)(msw@2.7.3(@types/node@22.7.9)(typescript@5.8.2))(tsx@4.19.3)(vite@6.2.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(yaml@2.7.0)': dependencies: '@types/node': 18.19.80 - '@vitest/browser': 3.0.9(@types/node@18.19.80)(playwright@1.51.1)(typescript@5.8.2)(vite@6.2.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.9) + '@vitest/browser': 3.0.9(@types/node@18.19.80)(playwright@1.51.1)(typescript@5.6.3)(vite@6.2.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.9) '@vitest/coverage-istanbul': 3.0.9(vitest@3.0.9) + dotenv: 16.4.7 playwright: 1.51.1 tslib: 2.8.1 - typescript: 5.8.2 + typescript: 5.6.3 vitest: 3.0.9(@types/debug@4.1.12)(@types/node@18.19.80)(@vitest/browser@3.0.9)(msw@2.7.3(@types/node@22.7.9)(typescript@5.8.2))(tsx@4.19.3)(yaml@2.7.0) transitivePeerDependencies: - '@edge-runtime/vm' @@ -14683,13 +14639,13 @@ snapshots: '@rush-temp/arm-links@file:projects/arm-links.tgz(@types/debug@4.1.12)(msw@2.7.3(@types/node@22.7.9)(typescript@5.8.2))(tsx@4.19.3)(vite@6.2.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(yaml@2.7.0)': dependencies: - '@azure/arm-resources': 5.2.0 '@types/node': 18.19.80 - '@vitest/browser': 3.0.9(@types/node@18.19.80)(playwright@1.51.1)(typescript@5.8.2)(vite@6.2.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.9) + '@vitest/browser': 3.0.9(@types/node@18.19.80)(playwright@1.51.1)(typescript@5.6.3)(vite@6.2.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.9) '@vitest/coverage-istanbul': 3.0.9(vitest@3.0.9) + dotenv: 16.4.7 playwright: 1.51.1 tslib: 2.8.1 - typescript: 5.8.2 + typescript: 5.6.3 vitest: 3.0.9(@types/debug@4.1.12)(@types/node@18.19.80)(@vitest/browser@3.0.9)(msw@2.7.3(@types/node@22.7.9)(typescript@5.8.2))(tsx@4.19.3)(yaml@2.7.0) transitivePeerDependencies: - '@edge-runtime/vm' @@ -14787,11 +14743,12 @@ snapshots: '@rush-temp/arm-locks@file:projects/arm-locks.tgz(@types/debug@4.1.12)(msw@2.7.3(@types/node@22.7.9)(typescript@5.8.2))(tsx@4.19.3)(vite@6.2.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(yaml@2.7.0)': dependencies: '@types/node': 18.19.80 - '@vitest/browser': 3.0.9(@types/node@18.19.80)(playwright@1.51.1)(typescript@5.8.2)(vite@6.2.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.9) + '@vitest/browser': 3.0.9(@types/node@18.19.80)(playwright@1.51.1)(typescript@5.6.3)(vite@6.2.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.9) '@vitest/coverage-istanbul': 3.0.9(vitest@3.0.9) + dotenv: 16.4.7 playwright: 1.51.1 tslib: 2.8.1 - typescript: 5.8.2 + typescript: 5.6.3 vitest: 3.0.9(@types/debug@4.1.12)(@types/node@18.19.80)(@vitest/browser@3.0.9)(msw@2.7.3(@types/node@22.7.9)(typescript@5.8.2))(tsx@4.19.3)(yaml@2.7.0) transitivePeerDependencies: - '@edge-runtime/vm' @@ -14993,12 +14950,12 @@ snapshots: dependencies: '@azure/core-lro': 2.7.2 '@types/node': 18.19.80 - '@vitest/browser': 3.0.9(@types/node@18.19.80)(playwright@1.51.1)(typescript@5.8.2)(vite@6.2.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.9) + '@vitest/browser': 3.0.9(@types/node@18.19.80)(playwright@1.51.1)(typescript@5.6.3)(vite@6.2.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.9) '@vitest/coverage-istanbul': 3.0.9(vitest@3.0.9) dotenv: 16.4.7 playwright: 1.51.1 tslib: 2.8.1 - typescript: 5.8.2 + typescript: 5.6.3 vitest: 3.0.9(@types/debug@4.1.12)(@types/node@18.19.80)(@vitest/browser@3.0.9)(msw@2.7.3(@types/node@22.7.9)(typescript@5.8.2))(tsx@4.19.3)(yaml@2.7.0) transitivePeerDependencies: - '@edge-runtime/vm' @@ -16308,13 +16265,14 @@ snapshots: '@rush-temp/arm-policy@file:projects/arm-policy.tgz(@types/debug@4.1.12)(msw@2.7.3(@types/node@22.7.9)(typescript@5.8.2))(tsx@4.19.3)(vite@6.2.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(yaml@2.7.0)': dependencies: + '@azure/core-lro': 2.7.2 '@types/node': 18.19.80 - '@vitest/browser': 3.0.9(@types/node@18.19.80)(playwright@1.51.1)(typescript@5.8.2)(vite@6.2.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.9) + '@vitest/browser': 3.0.9(@types/node@18.19.80)(playwright@1.51.1)(typescript@5.6.3)(vite@6.2.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.9) '@vitest/coverage-istanbul': 3.0.9(vitest@3.0.9) dotenv: 16.4.7 playwright: 1.51.1 tslib: 2.8.1 - typescript: 5.8.2 + typescript: 5.6.3 vitest: 3.0.9(@types/debug@4.1.12)(@types/node@18.19.80)(@vitest/browser@3.0.9)(msw@2.7.3(@types/node@22.7.9)(typescript@5.8.2))(tsx@4.19.3)(yaml@2.7.0) transitivePeerDependencies: - '@edge-runtime/vm' @@ -17213,12 +17171,12 @@ snapshots: '@rush-temp/arm-resources-subscriptions@file:projects/arm-resources-subscriptions.tgz(@types/debug@4.1.12)(msw@2.7.3(@types/node@22.7.9)(typescript@5.8.2))(tsx@4.19.3)(vite@6.2.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(yaml@2.7.0)': dependencies: '@types/node': 18.19.80 - '@vitest/browser': 3.0.9(@types/node@18.19.80)(playwright@1.51.1)(typescript@5.8.2)(vite@6.2.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.9) + '@vitest/browser': 3.0.9(@types/node@18.19.80)(playwright@1.51.1)(typescript@5.6.3)(vite@6.2.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.9) '@vitest/coverage-istanbul': 3.0.9(vitest@3.0.9) dotenv: 16.4.7 playwright: 1.51.1 tslib: 2.8.1 - typescript: 5.8.2 + typescript: 5.6.3 vitest: 3.0.9(@types/debug@4.1.12)(@types/node@18.19.80)(@vitest/browser@3.0.9)(msw@2.7.3(@types/node@22.7.9)(typescript@5.8.2))(tsx@4.19.3)(yaml@2.7.0) transitivePeerDependencies: - '@edge-runtime/vm' @@ -17248,12 +17206,12 @@ snapshots: dependencies: '@azure/core-lro': 2.7.2 '@types/node': 18.19.80 - '@vitest/browser': 3.0.9(@types/node@18.19.80)(playwright@1.51.1)(typescript@5.8.2)(vite@6.2.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.9) + '@vitest/browser': 3.0.9(@types/node@18.19.80)(playwright@1.51.1)(typescript@5.6.3)(vite@6.2.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.9) '@vitest/coverage-istanbul': 3.0.9(vitest@3.0.9) dotenv: 16.4.7 playwright: 1.51.1 tslib: 2.8.1 - typescript: 5.8.2 + typescript: 5.6.3 vitest: 3.0.9(@types/debug@4.1.12)(@types/node@18.19.80)(@vitest/browser@3.0.9)(msw@2.7.3(@types/node@22.7.9)(typescript@5.8.2))(tsx@4.19.3)(yaml@2.7.0) transitivePeerDependencies: - '@edge-runtime/vm' @@ -17283,12 +17241,12 @@ snapshots: dependencies: '@azure/core-lro': 2.7.2 '@types/node': 18.19.80 - '@vitest/browser': 3.0.9(@types/node@18.19.80)(playwright@1.51.1)(typescript@5.8.2)(vite@6.2.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.9) + '@vitest/browser': 3.0.9(@types/node@18.19.80)(playwright@1.51.1)(typescript@5.6.3)(vite@6.2.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.9) '@vitest/coverage-istanbul': 3.0.9(vitest@3.0.9) dotenv: 16.4.7 playwright: 1.51.1 tslib: 2.8.1 - typescript: 5.8.2 + typescript: 5.6.3 vitest: 3.0.9(@types/debug@4.1.12)(@types/node@18.19.80)(@vitest/browser@3.0.9)(msw@2.7.3(@types/node@22.7.9)(typescript@5.8.2))(tsx@4.19.3)(yaml@2.7.0) transitivePeerDependencies: - '@edge-runtime/vm' @@ -18535,11 +18493,12 @@ snapshots: '@rush-temp/arm-templatespecs@file:projects/arm-templatespecs.tgz(@types/debug@4.1.12)(msw@2.7.3(@types/node@22.7.9)(typescript@5.8.2))(tsx@4.19.3)(vite@6.2.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(yaml@2.7.0)': dependencies: '@types/node': 18.19.80 - '@vitest/browser': 3.0.9(@types/node@18.19.80)(playwright@1.51.1)(typescript@5.8.2)(vite@6.2.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.9) + '@vitest/browser': 3.0.9(@types/node@18.19.80)(playwright@1.51.1)(typescript@5.6.3)(vite@6.2.2(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.9) '@vitest/coverage-istanbul': 3.0.9(vitest@3.0.9) + dotenv: 16.4.7 playwright: 1.51.1 tslib: 2.8.1 - typescript: 5.8.2 + typescript: 5.6.3 vitest: 3.0.9(@types/debug@4.1.12)(@types/node@18.19.80)(@vitest/browser@3.0.9)(msw@2.7.3(@types/node@22.7.9)(typescript@5.8.2))(tsx@4.19.3)(yaml@2.7.0) transitivePeerDependencies: - '@edge-runtime/vm' @@ -22227,7 +22186,6 @@ snapshots: '@rush-temp/perf-storage-file-share@file:projects/perf-storage-file-share.tgz': dependencies: - '@azure/storage-file-share': 12.26.0 '@types/node': 18.19.80 dotenv: 16.4.7 eslint: 9.22.0 @@ -23661,7 +23619,7 @@ snapshots: '@types/chai-as-promised@7.1.8': dependencies: - '@types/chai': 4.3.20 + '@types/chai': 5.2.0 '@types/chai-as-promised@8.0.2': dependencies: diff --git a/sdk/changes/arm-changes/CHANGELOG.md b/sdk/changes/arm-changes/CHANGELOG.md index 60ff25a11e58..de759936dbeb 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-03-18) + ### 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..dac48ce6c4aa 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 @@ -108,7 +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) - +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fchanges%2Farm-changes%2FREADME.png) [azure_cli]: https://learn.microsoft.com/cli/azure [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..31bf9062391b 100644 --- a/sdk/changes/arm-changes/_meta.json +++ b/sdk/changes/arm-changes/_meta.json @@ -1,8 +1,8 @@ { - "commit": "20df2424a278ca19437e437a7dbf3a7857a0dd9d", + "commit": "a3dcf1c9eb0324a1e4e9a12ec4655f54ba1f44f5", "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", - "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" + "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/test-repo-billy/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.23", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/changes/arm-changes/api-extractor.json b/sdk/changes/arm-changes/api-extractor.json index abb49f21d093..56ec3ae5911b 100644 --- a/sdk/changes/arm-changes/api-extractor.json +++ b/sdk/changes/arm-changes/api-extractor.json @@ -1,6 +1,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "dist/esm/index.d.ts", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", "docModel": { "enabled": true }, @@ -11,7 +11,7 @@ "dtsRollup": { "enabled": true, "untrimmedFilePath": "", - "publicTrimmedFilePath": "dist/arm-changes.d.ts" + "publicTrimmedFilePath": "./types/arm-changes.d.ts" }, "messages": { "tsdocMessageReporting": { @@ -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 d3fe51009e27..8f1ab045af61 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": [ @@ -19,28 +19,31 @@ "azure", "typescript", "browser", - "isomorphic", - "cloud" + "isomorphic" ], "license": "MIT", "main": "./dist/commonjs/index.js", - "module": "./dist/esm/index.js", + "module": "./dist-esm/src/index.js", "types": "./dist/commonjs/index.d.ts", "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.8.0", + "@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", - "typescript": "~5.8.2", + "dotenv": "^16.0.0", + "playwright": "^1.51.1", + "typescript": "~5.6.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", + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, @@ -87,14 +90,7 @@ ] }, "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-changes?view=azure-node-preview" - }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/changes/arm-changes", "type": "module", "tshy": { "project": "./tsconfig.src.json", @@ -135,4 +131,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..6a3032e265ce 100644 --- a/sdk/changes/arm-changes/src/changesClient.ts +++ b/sdk/changes/arm-changes/src/changesClient.ts @@ -11,7 +11,7 @@ import * as coreRestPipeline from "@azure/core-rest-pipeline"; import { PipelineRequest, PipelineResponse, - SendRequest + SendRequest, } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { ChangesImpl } from "./operations/index.js"; @@ -33,7 +33,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 +48,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 +61,21 @@ export class ChangesClient extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + 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 + coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -84,7 +85,7 @@ export class ChangesClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ @@ -94,9 +95,9 @@ export class ChangesClient extends coreClient.ServiceClient { `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -118,7 +119,7 @@ export class ChangesClient extends coreClient.ServiceClient { name: "CustomApiVersionPolicy", async sendRequest( request: PipelineRequest, - next: SendRequest + next: SendRequest, ): Promise { const param = request.url.split("?"); if (param.length > 1) { @@ -132,7 +133,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..ee8b8a223556 100644 --- a/sdk/changes/arm-changes/src/models/index.ts +++ b/sdk/changes/arm-changes/src/models/index.ts @@ -192,12 +192,7 @@ 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; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type ChangesListNextResponse = ChangeResourceListResult; 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..089bfd7c9a91 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,21 +229,20 @@ 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 + Parameters.skipToken, ], urlParameters: [ Parameters.$host, @@ -251,22 +250,21 @@ const listOperationSpec: coreClient.OperationSpec = { 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 +274,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 +297,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..205cccc26592 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) { @@ -28,7 +28,7 @@ export function getContinuationToken(page: unknown): string | undefined { export function setContinuationToken( page: unknown, - continuationToken: string | undefined + continuationToken: string | undefined, ): void { if (typeof page !== "object" || page === null || !continuationToken) { return; diff --git a/sdk/changes/arm-changes/test/sampleTest.ts b/sdk/changes/arm-changes/test/sampleTest.ts new file mode 100644 index 000000000000..a1cf7c25afd2 --- /dev/null +++ b/sdk/changes/arm-changes/test/sampleTest.ts @@ -0,0 +1,40 @@ +/* + * 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"; + +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 (ctx) => { + recorder = new Recorder(ctx); + await recorder.start(recorderOptions); + }); + + afterEach(async () => { + await recorder.stop(); + }); + + it("sample test", async function () { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/changes/arm-changes/test/snippets.spec.ts b/sdk/changes/arm-changes/test/snippets.spec.ts index 4213275ba20d..6f3b1f2460e8 100644 --- a/sdk/changes/arm-changes/test/snippets.spec.ts +++ b/sdk/changes/arm-changes/test/snippets.spec.ts @@ -1,15 +1,29 @@ +/* + * 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 { ChangesClient } from "../src/index.js"; -import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; +import { + DefaultAzureCredential, + InteractiveBrowserCredential, +} from "@azure/identity"; import { setLogLevel } from "@azure/logger"; import { describe, it } from "vitest"; describe("snippets", () => { it("ReadmeSampleCreateClient_Node", async () => { const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new ChangesClient(new DefaultAzureCredential(), subscriptionId); + const client = new ChangesClient( + new DefaultAzureCredential(), + subscriptionId, + ); }); it("ReadmeSampleCreateClient_Browser", async () => { diff --git a/sdk/changes/arm-changes/tsconfig.browser.config.json b/sdk/changes/arm-changes/tsconfig.browser.config.json index b6586181d006..0c8bafa97126 100644 --- a/sdk/changes/arm-changes/tsconfig.browser.config.json +++ b/sdk/changes/arm-changes/tsconfig.browser.config.json @@ -1,17 +1,6 @@ { - "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..6850f7a0b342 100644 --- a/sdk/changes/arm-changes/tsconfig.json +++ b/sdk/changes/arm-changes/tsconfig.json @@ -1,13 +1,35 @@ { - "references": [ - { - "path": "./tsconfig.src.json" - }, - { - "path": "./tsconfig.samples.json" - }, - { - "path": "./tsconfig.test.json" - } + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": [ + "es6", + "dom" + ], + "declaration": true, + "outDir": "./dist-esm", + "importHelpers": true + }, + "include": [ + "src/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts" + ], + "exclude": [ + "node_modules" ] -} +} \ No newline at end of file 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..4d98965e7c55 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-03-18) ### 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..75389d5cfd8a 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 @@ -106,7 +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) - +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fdataboundaries%2Farm-databoundaries%2FREADME.png) [azure_cli]: https://learn.microsoft.com/cli/azure [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..31bf9062391b 100644 --- a/sdk/databoundaries/arm-databoundaries/_meta.json +++ b/sdk/databoundaries/arm-databoundaries/_meta.json @@ -1,8 +1,8 @@ { - "commit": "bc3aa2bbc4494553649019585c3bc8a4229a25d0", + "commit": "a3dcf1c9eb0324a1e4e9a12ec4655f54ba1f44f5", "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", - "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" -} + "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/test-repo-billy/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.23", + "use": "@autorest/typescript@^6.0.12" +} \ No newline at end of file diff --git a/sdk/databoundaries/arm-databoundaries/api-extractor.json b/sdk/databoundaries/arm-databoundaries/api-extractor.json index 25f21ad8c7a8..f7fb1be741b9 100644 --- a/sdk/databoundaries/arm-databoundaries/api-extractor.json +++ b/sdk/databoundaries/arm-databoundaries/api-extractor.json @@ -1,6 +1,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "dist/esm/index.d.ts", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", "docModel": { "enabled": true }, @@ -11,7 +11,7 @@ "dtsRollup": { "enabled": true, "untrimmedFilePath": "", - "publicTrimmedFilePath": "dist/arm-databoundaries.d.ts" + "publicTrimmedFilePath": "./types/arm-databoundaries.d.ts" }, "messages": { "tsdocMessageReporting": { @@ -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 4fd066c05428..85bd2370cd2c 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": [ @@ -18,29 +19,31 @@ "azure", "typescript", "browser", - "isomorphic", - "cloud" + "isomorphic" ], "license": "MIT", "main": "./dist/commonjs/index.js", - "module": "./dist/esm/index.js", + "module": "./dist-esm/src/index.js", "types": "./dist/commonjs/index.d.ts", "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.8.0", "@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", - "typescript": "~5.8.2", + "playwright": "^1.51.1", + "typescript": "~5.6.2", "vitest": "^3.0.9" }, - "repository": "github:Azure/azure-sdk-for-js", + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, @@ -88,14 +91,6 @@ }, "autoPublish": true, "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", @@ -136,4 +131,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..843bebbb4dae 100644 --- a/sdk/databoundaries/arm-databoundaries/src/databoundariesManegementClient.ts +++ b/sdk/databoundaries/arm-databoundaries/src/databoundariesManegementClient.ts @@ -14,8 +14,8 @@ import { 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 +44,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}` @@ -97,6 +97,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); } @@ -129,5 +130,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..3fc9c81e5dc1 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 */ @@ -210,6 +310,20 @@ export enum KnownCreatedByType { */ export type CreatedByType = string; +/** Optional parameters. */ +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 {} 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..e50e2773317d 100644 --- a/sdk/databoundaries/arm-databoundaries/src/operations/dataBoundaries.ts +++ b/sdk/databoundaries/arm-databoundaries/src/operations/dataBoundaries.ts @@ -103,7 +103,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..f1044e8d4b11 --- /dev/null +++ b/sdk/databoundaries/arm-databoundaries/src/operations/operations.ts @@ -0,0 +1,149 @@ +/* + * 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..16fcc4862385 --- /dev/null +++ b/sdk/databoundaries/arm-databoundaries/src/operationsInterfaces/operations.ts @@ -0,0 +1,22 @@ +/* + * 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..205cccc26592 --- /dev/null +++ b/sdk/databoundaries/arm-databoundaries/src/pagingHelper.ts @@ -0,0 +1,39 @@ +/* + * 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.ts b/sdk/databoundaries/arm-databoundaries/test/sampleTest.ts new file mode 100644 index 000000000000..a1cf7c25afd2 --- /dev/null +++ b/sdk/databoundaries/arm-databoundaries/test/sampleTest.ts @@ -0,0 +1,40 @@ +/* + * 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"; + +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 (ctx) => { + recorder = new Recorder(ctx); + await recorder.start(recorderOptions); + }); + + afterEach(async () => { + await recorder.stop(); + }); + + it("sample test", async function () { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/databoundaries/arm-databoundaries/test/snippets.spec.ts b/sdk/databoundaries/arm-databoundaries/test/snippets.spec.ts index 18b146521ace..da5a38e87184 100644 --- a/sdk/databoundaries/arm-databoundaries/test/snippets.spec.ts +++ b/sdk/databoundaries/arm-databoundaries/test/snippets.spec.ts @@ -1,25 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { DataboundariesManegementClient } from "../src/index.js"; -import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; +import { + DefaultAzureCredential, + InteractiveBrowserCredential, +} from "@azure/identity"; import { setLogLevel } from "@azure/logger"; 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.json b/sdk/databoundaries/arm-databoundaries/tsconfig.json index 19ceb382b521..7fb199d28afa 100644 --- a/sdk/databoundaries/arm-databoundaries/tsconfig.json +++ b/sdk/databoundaries/arm-databoundaries/tsconfig.json @@ -1,13 +1,37 @@ { - "references": [ - { - "path": "./tsconfig.src.json" - }, - { - "path": "./tsconfig.samples.json" - }, - { - "path": "./tsconfig.test.json" - } + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": [ + "es6", + "dom" + ], + "declaration": true, + "outDir": "./dist-esm", + "importHelpers": true + }, + "include": [ + "src/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts" + ], + "exclude": [ + "node_modules" ] -} +} \ No newline at end of file diff --git a/sdk/features/arm-features/CHANGELOG.md b/sdk/features/arm-features/CHANGELOG.md index ed01550a1e65..d8471b2e3ef9 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-03-18) + ### 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..382ff59677d7 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 @@ -108,7 +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) - +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Ffeatures%2Farm-features%2FREADME.png) [azure_cli]: https://learn.microsoft.com/cli/azure [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..31bf9062391b 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", - "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" -} + "commit": "a3dcf1c9eb0324a1e4e9a12ec4655f54ba1f44f5", + "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/test-repo-billy/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.23", + "use": "@autorest/typescript@^6.0.12" +} \ No newline at end of file diff --git a/sdk/features/arm-features/api-extractor.json b/sdk/features/arm-features/api-extractor.json index 600702b41d91..1279529db2df 100644 --- a/sdk/features/arm-features/api-extractor.json +++ b/sdk/features/arm-features/api-extractor.json @@ -1,6 +1,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "dist/esm/index.d.ts", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", "docModel": { "enabled": true }, @@ -11,7 +11,7 @@ "dtsRollup": { "enabled": true, "untrimmedFilePath": "", - "publicTrimmedFilePath": "dist/arm-features.d.ts" + "publicTrimmedFilePath": "./types/arm-features.d.ts" }, "messages": { "tsdocMessageReporting": { @@ -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 709ab35e33d5..aa77157456aa 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": [ @@ -19,29 +19,31 @@ "azure", "typescript", "browser", - "isomorphic", - "cloud" + "isomorphic" ], "license": "MIT", "main": "./dist/commonjs/index.js", - "module": "./dist/esm/index.js", + "module": "./dist-esm/src/index.js", "types": "./dist/commonjs/index.d.ts", "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.8.0", "@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", - "typescript": "~5.8.2", + "dotenv": "^16.0.0", + "playwright": "^1.51.1", + "typescript": "~5.6.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", + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, @@ -88,14 +90,7 @@ ] }, "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-features?view=azure-node-preview" - }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/features/arm-features", "type": "module", "tshy": { "project": "./tsconfig.src.json", @@ -136,4 +131,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..0ca7051f0a8b 100644 --- a/sdk/features/arm-features/src/featureClient.ts +++ b/sdk/features/arm-features/src/featureClient.ts @@ -11,18 +11,18 @@ import * as coreRestPipeline from "@azure/core-rest-pipeline"; import { PipelineRequest, PipelineResponse, - SendRequest + 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 + SubscriptionFeatureRegistrationsImpl, } from "./operations/index.js"; import { Features, - SubscriptionFeatureRegistrations + SubscriptionFeatureRegistrations, } from "./operationsInterfaces/index.js"; import * as Parameters from "./models/parameters.js"; import * as Mappers from "./models/mappers.js"; @@ -32,14 +32,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 +50,27 @@ 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 +79,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 +92,21 @@ export class FeatureClient extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + 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 + coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -101,7 +116,7 @@ export class FeatureClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ @@ -111,9 +126,9 @@ export class FeatureClient extends coreClient.ServiceClient { `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -123,9 +138,8 @@ 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); } @@ -138,7 +152,7 @@ export class FeatureClient extends coreClient.ServiceClient { name: "CustomApiVersionPolicy", async sendRequest( request: PipelineRequest, - next: SendRequest + next: SendRequest, ): Promise { const param = request.url.split("?"); if (param.length > 1) { @@ -152,7 +166,7 @@ export class FeatureClient extends coreClient.ServiceClient { request.url = param[0] + "?" + newParams.join("&"); } return next(request); - } + }, }; this.pipeline.addPolicy(apiVersionPolicy); } @@ -162,7 +176,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 +191,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 +218,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; @@ -216,7 +230,7 @@ export class FeatureClient extends coreClient.ServiceClient { * @param options The options parameters. */ private _listOperations( - options?: ListOperationsOptionalParams + options?: ListOperationsOptionalParams, ): Promise { return this.sendOperationRequest({ options }, listOperationsOperationSpec); } @@ -228,11 +242,11 @@ export class FeatureClient extends coreClient.ServiceClient { */ private _listOperationsNext( nextLink: string, - options?: ListOperationsNextOptionalParams + options?: ListOperationsNextOptionalParams, ): Promise { return this.sendOperationRequest( { nextLink, options }, - listOperationsNextOperationSpec + listOperationsNextOperationSpec, ); } @@ -247,30 +261,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..ffc973d8b47d 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", } /** @@ -323,7 +323,8 @@ export interface SubscriptionFeatureRegistrationsGetOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ -export type SubscriptionFeatureRegistrationsGetResponse = SubscriptionFeatureRegistration; +export type SubscriptionFeatureRegistrationsGetResponse = + SubscriptionFeatureRegistration; /** Optional parameters. */ export interface SubscriptionFeatureRegistrationsCreateOrUpdateOptionalParams @@ -333,7 +334,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,28 +346,32 @@ 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 diff --git a/sdk/features/arm-features/src/models/mappers.ts b/sdk/features/arm-features/src/models/mappers.ts index 3c1185f9501a..d94745c23183 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,123 +204,127 @@ export const FeatureProperties: coreClient.CompositeMapper = { state: { serializedName: "state", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const SubscriptionFeatureRegistrationProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SubscriptionFeatureRegistrationProperties", - modelProperties: { - tenantId: { - serializedName: "tenantId", - readOnly: true, - type: { - name: "String" - } - }, - subscriptionId: { - serializedName: "subscriptionId", - readOnly: true, - type: { - name: "String" - } - }, - featureName: { - serializedName: "featureName", - readOnly: true, - type: { - name: "String" - } - }, - displayName: { - serializedName: "displayName", - readOnly: true, - type: { - name: "String" - } - }, - providerNamespace: { - serializedName: "providerNamespace", - readOnly: true, - type: { - name: "String" - } - }, - state: { - serializedName: "state", - type: { - name: "String" - } - }, - authorizationProfile: { - serializedName: "authorizationProfile", - type: { - name: "Composite", - className: "AuthorizationProfile" - } - }, - metadata: { - serializedName: "metadata", - type: { - name: "Dictionary", - value: { type: { name: "String" }, constraints: { MaxLength: 1000 } } - } - }, - releaseDate: { - serializedName: "releaseDate", - readOnly: true, - type: { - name: "DateTime" - } - }, - registrationDate: { - serializedName: "registrationDate", - readOnly: true, - type: { - name: "DateTime" - } - }, - documentationLink: { - constraints: { - MaxLength: 1000 +export const SubscriptionFeatureRegistrationProperties: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "SubscriptionFeatureRegistrationProperties", + modelProperties: { + tenantId: { + serializedName: "tenantId", + readOnly: true, + type: { + name: "String", + }, }, - serializedName: "documentationLink", - readOnly: true, - type: { - name: "String" - } - }, - approvalType: { - serializedName: "approvalType", - readOnly: true, - type: { - name: "String" - } - }, - shouldFeatureDisplayInPortal: { - defaultValue: false, - serializedName: "shouldFeatureDisplayInPortal", - type: { - name: "Boolean" - } - }, - description: { - constraints: { - MaxLength: 1000 + subscriptionId: { + serializedName: "subscriptionId", + readOnly: true, + type: { + name: "String", + }, }, - serializedName: "description", - type: { - name: "String" - } - } - } - } -}; + featureName: { + serializedName: "featureName", + readOnly: true, + type: { + name: "String", + }, + }, + displayName: { + serializedName: "displayName", + readOnly: true, + type: { + name: "String", + }, + }, + providerNamespace: { + serializedName: "providerNamespace", + readOnly: true, + type: { + name: "String", + }, + }, + state: { + serializedName: "state", + type: { + name: "String", + }, + }, + authorizationProfile: { + serializedName: "authorizationProfile", + type: { + name: "Composite", + className: "AuthorizationProfile", + }, + }, + metadata: { + serializedName: "metadata", + type: { + name: "Dictionary", + value: { + type: { name: "String" }, + constraints: { MaxLength: 1000 }, + }, + }, + }, + releaseDate: { + serializedName: "releaseDate", + readOnly: true, + type: { + name: "DateTime", + }, + }, + registrationDate: { + serializedName: "registrationDate", + readOnly: true, + type: { + name: "DateTime", + }, + }, + documentationLink: { + constraints: { + MaxLength: 1000, + }, + serializedName: "documentationLink", + readOnly: true, + type: { + name: "String", + }, + }, + approvalType: { + serializedName: "approvalType", + readOnly: true, + type: { + name: "String", + }, + }, + shouldFeatureDisplayInPortal: { + defaultValue: false, + serializedName: "shouldFeatureDisplayInPortal", + type: { + name: "Boolean", + }, + }, + description: { + constraints: { + MaxLength: 1000, + }, + serializedName: "description", + type: { + name: "String", + }, + }, + }, + }, + }; export const AuthorizationProfile: coreClient.CompositeMapper = { type: { @@ -331,39 +335,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 +379,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 +408,8 @@ export const SubscriptionFeatureRegistrationList: coreClient.CompositeMapper = { nextLink: { serializedName: "nextLink", type: { - name: "String" - } + name: "String", + }, }, value: { serializedName: "value", @@ -414,13 +418,13 @@ export const SubscriptionFeatureRegistrationList: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "SubscriptionFeatureRegistration" - } - } - } - } - } - } + className: "SubscriptionFeatureRegistration", + }, + }, + }, + }, + }, + }, }; export const SubscriptionFeatureRegistration: coreClient.CompositeMapper = { @@ -433,9 +437,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..daeb3ce98015 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 { @@ -123,16 +123,16 @@ export class FeaturesImpl implements Features { return this.listPagingPage( resourceProviderNamespace, options, - settings + settings, ); - } + }, }; } private async *listPagingPage( resourceProviderNamespace: string, options?: FeaturesListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: FeaturesListResponse; let continuationToken = settings?.continuationToken; @@ -147,7 +147,7 @@ export class FeaturesImpl implements Features { result = await this._listNext( resourceProviderNamespace, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -158,11 +158,11 @@ export class FeaturesImpl implements Features { private async *listPagingAll( resourceProviderNamespace: string, - options?: FeaturesListOptionalParams + options?: FeaturesListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage( resourceProviderNamespace, - options + options, )) { yield* page; } @@ -173,7 +173,7 @@ export class FeaturesImpl implements Features { * @param options The options parameters. */ private _listAll( - options?: FeaturesListAllOptionalParams + options?: FeaturesListAllOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listAllOperationSpec); } @@ -186,11 +186,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 +203,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 +220,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 +237,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,11 +252,11 @@ export class FeaturesImpl implements Features { */ private _listAllNext( nextLink: string, - options?: FeaturesListAllNextOptionalParams + options?: FeaturesListAllNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listAllNextOperationSpec + listAllNextOperationSpec, ); } @@ -269,11 +269,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 +285,136 @@ 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 + 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..8b5ab6aa5457 100644 --- a/sdk/features/arm-features/src/operations/subscriptionFeatureRegistrations.ts +++ b/sdk/features/arm-features/src/operations/subscriptionFeatureRegistrations.ts @@ -27,13 +27,14 @@ import { SubscriptionFeatureRegistrationsCreateOrUpdateResponse, SubscriptionFeatureRegistrationsDeleteOptionalParams, SubscriptionFeatureRegistrationsListBySubscriptionNextResponse, - SubscriptionFeatureRegistrationsListAllBySubscriptionNextResponse + SubscriptionFeatureRegistrationsListAllBySubscriptionNextResponse, } from "../models/index.js"; /// /** Class containing SubscriptionFeatureRegistrations operations. */ export class SubscriptionFeatureRegistrationsImpl - implements SubscriptionFeatureRegistrations { + implements SubscriptionFeatureRegistrations +{ private readonly client: FeatureClient; /** @@ -51,7 +52,7 @@ export class SubscriptionFeatureRegistrationsImpl */ public listBySubscription( providerNamespace: string, - options?: SubscriptionFeatureRegistrationsListBySubscriptionOptionalParams + options?: SubscriptionFeatureRegistrationsListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listBySubscriptionPagingAll(providerNamespace, options); return { @@ -68,16 +69,16 @@ export class SubscriptionFeatureRegistrationsImpl return this.listBySubscriptionPagingPage( providerNamespace, options, - settings + settings, ); - } + }, }; } private async *listBySubscriptionPagingPage( providerNamespace: string, options?: SubscriptionFeatureRegistrationsListBySubscriptionOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: SubscriptionFeatureRegistrationsListBySubscriptionResponse; let continuationToken = settings?.continuationToken; @@ -92,7 +93,7 @@ export class SubscriptionFeatureRegistrationsImpl result = await this._listBySubscriptionNext( providerNamespace, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -103,11 +104,11 @@ export class SubscriptionFeatureRegistrationsImpl private async *listBySubscriptionPagingAll( providerNamespace: string, - options?: SubscriptionFeatureRegistrationsListBySubscriptionOptionalParams + options?: SubscriptionFeatureRegistrationsListBySubscriptionOptionalParams, ): AsyncIterableIterator { for await (const page of this.listBySubscriptionPagingPage( providerNamespace, - options + options, )) { yield* page; } @@ -118,7 +119,7 @@ export class SubscriptionFeatureRegistrationsImpl * @param options The options parameters. */ public listAllBySubscription( - options?: SubscriptionFeatureRegistrationsListAllBySubscriptionOptionalParams + options?: SubscriptionFeatureRegistrationsListAllBySubscriptionOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listAllBySubscriptionPagingAll(options); return { @@ -133,13 +134,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; @@ -153,7 +154,7 @@ export class SubscriptionFeatureRegistrationsImpl while (continuationToken) { result = await this._listAllBySubscriptionNext( continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -163,7 +164,7 @@ export class SubscriptionFeatureRegistrationsImpl } private async *listAllBySubscriptionPagingAll( - options?: SubscriptionFeatureRegistrationsListAllBySubscriptionOptionalParams + options?: SubscriptionFeatureRegistrationsListAllBySubscriptionOptionalParams, ): AsyncIterableIterator { for await (const page of this.listAllBySubscriptionPagingPage(options)) { yield* page; @@ -179,11 +180,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 +197,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 +214,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 +229,11 @@ export class SubscriptionFeatureRegistrationsImpl */ private _listBySubscription( providerNamespace: string, - options?: SubscriptionFeatureRegistrationsListBySubscriptionOptionalParams + options?: SubscriptionFeatureRegistrationsListBySubscriptionOptionalParams, ): Promise { return this.client.sendOperationRequest( { providerNamespace, options }, - listBySubscriptionOperationSpec + listBySubscriptionOperationSpec, ); } @@ -241,11 +242,11 @@ export class SubscriptionFeatureRegistrationsImpl * @param options The options parameters. */ private _listAllBySubscription( - options?: SubscriptionFeatureRegistrationsListAllBySubscriptionOptionalParams + options?: SubscriptionFeatureRegistrationsListAllBySubscriptionOptionalParams, ): Promise { return this.client.sendOperationRequest( { options }, - listAllBySubscriptionOperationSpec + listAllBySubscriptionOperationSpec, ); } @@ -258,11 +259,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 +274,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 +286,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 +323,104 @@ 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 + 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 + 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..517886213373 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"; /// @@ -27,7 +27,7 @@ export interface Features { * @param options The options parameters. */ listAll( - options?: FeaturesListAllOptionalParams + options?: FeaturesListAllOptionalParams, ): PagedAsyncIterableIterator; /** * Gets all the preview features in a provider namespace that are available through AFEC for the @@ -37,7 +37,7 @@ export interface Features { */ list( resourceProviderNamespace: string, - options?: FeaturesListOptionalParams + options?: FeaturesListOptionalParams, ): PagedAsyncIterableIterator; /** * Gets the preview feature with the specified name. @@ -48,7 +48,7 @@ export interface Features { get( resourceProviderNamespace: string, featureName: string, - options?: FeaturesGetOptionalParams + options?: FeaturesGetOptionalParams, ): Promise; /** * Registers the preview feature for the subscription. @@ -59,7 +59,7 @@ export interface Features { register( resourceProviderNamespace: string, featureName: string, - options?: FeaturesRegisterOptionalParams + options?: FeaturesRegisterOptionalParams, ): Promise; /** * Unregisters the preview feature for the subscription. @@ -70,6 +70,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..205cccc26592 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) { @@ -28,7 +28,7 @@ export function getContinuationToken(page: unknown): string | undefined { export function setContinuationToken( page: unknown, - continuationToken: string | undefined + continuationToken: string | undefined, ): void { if (typeof page !== "object" || page === null || !continuationToken) { return; diff --git a/sdk/features/arm-features/test/sampleTest.ts b/sdk/features/arm-features/test/sampleTest.ts new file mode 100644 index 000000000000..a1cf7c25afd2 --- /dev/null +++ b/sdk/features/arm-features/test/sampleTest.ts @@ -0,0 +1,40 @@ +/* + * 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"; + +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 (ctx) => { + recorder = new Recorder(ctx); + await recorder.start(recorderOptions); + }); + + afterEach(async () => { + await recorder.stop(); + }); + + it("sample test", async function () { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/features/arm-features/test/snippets.spec.ts b/sdk/features/arm-features/test/snippets.spec.ts index b516f6e9841c..979e8900e8f2 100644 --- a/sdk/features/arm-features/test/snippets.spec.ts +++ b/sdk/features/arm-features/test/snippets.spec.ts @@ -1,15 +1,29 @@ +/* + * 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 { FeatureClient } from "../src/index.js"; -import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; +import { + DefaultAzureCredential, + InteractiveBrowserCredential, +} from "@azure/identity"; import { setLogLevel } from "@azure/logger"; import { describe, it } from "vitest"; describe("snippets", () => { it("ReadmeSampleCreateClient_Node", async () => { const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new FeatureClient(new DefaultAzureCredential(), subscriptionId); + const client = new FeatureClient( + new DefaultAzureCredential(), + subscriptionId, + ); }); it("ReadmeSampleCreateClient_Browser", async () => { diff --git a/sdk/features/arm-features/tsconfig.browser.config.json b/sdk/features/arm-features/tsconfig.browser.config.json index 75871518e3a0..0c8bafa97126 100644 --- a/sdk/features/arm-features/tsconfig.browser.config.json +++ b/sdk/features/arm-features/tsconfig.browser.config.json @@ -1,3 +1,6 @@ { - "extends": ["./tsconfig.test.json", "../../../tsconfig.browser.base.json"] + "extends": [ + "./tsconfig.test.json", + "../../../tsconfig.browser.base.json" + ] } diff --git a/sdk/features/arm-features/tsconfig.json b/sdk/features/arm-features/tsconfig.json index 19ceb382b521..b4ac39389770 100644 --- a/sdk/features/arm-features/tsconfig.json +++ b/sdk/features/arm-features/tsconfig.json @@ -1,13 +1,28 @@ { - "references": [ - { - "path": "./tsconfig.src.json" - }, - { - "path": "./tsconfig.samples.json" - }, - { - "path": "./tsconfig.test.json" - } + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": [ + "es6", + "dom" + ], + "declaration": true, + "outDir": "./dist-esm", + "importHelpers": true + }, + "include": [ + "src/**/*.ts", + "test/**/*.ts", + "test/**/*.ts" + ], + "exclude": [ + "node_modules" ] -} +} \ No newline at end of file diff --git a/sdk/features/arm-features/tsconfig.samples.json b/sdk/features/arm-features/tsconfig.samples.json index a77667fb8974..67ffc0fc5283 100644 --- a/sdk/features/arm-features/tsconfig.samples.json +++ b/sdk/features/arm-features/tsconfig.samples.json @@ -2,7 +2,9 @@ "extends": "../../../tsconfig.samples.base.json", "compilerOptions": { "paths": { - "@azure/arm-features": ["./dist/esm"] + "@azure/arm-features": [ + "./dist/esm" + ] } } } diff --git a/sdk/features/arm-features/tsconfig.test.json b/sdk/features/arm-features/tsconfig.test.json index 290ca214aebc..3c2b783a8c1b 100644 --- a/sdk/features/arm-features/tsconfig.test.json +++ b/sdk/features/arm-features/tsconfig.test.json @@ -1,3 +1,6 @@ { - "extends": ["./tsconfig.src.json", "../../../tsconfig.test.base.json"] + "extends": [ + "./tsconfig.src.json", + "../../../tsconfig.test.base.json" + ] } 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..375e65e53052 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-03-18) + ### 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..cce1ba7ebbb6 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,8 @@ 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) +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Flinks%2Farm-links%2FREADME.png) + [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..31bf9062391b 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", - "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" -} + "commit": "a3dcf1c9eb0324a1e4e9a12ec4655f54ba1f44f5", + "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/test-repo-billy/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.23", + "use": "@autorest/typescript@^6.0.12" +} \ No newline at end of file diff --git a/sdk/links/arm-links/api-extractor.json b/sdk/links/arm-links/api-extractor.json index 745f44b8b7fc..bc0112cb9f26 100644 --- a/sdk/links/arm-links/api-extractor.json +++ b/sdk/links/arm-links/api-extractor.json @@ -1,6 +1,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "dist/esm/index.d.ts", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", "docModel": { "enabled": true }, @@ -11,7 +11,7 @@ "dtsRollup": { "enabled": true, "untrimmedFilePath": "", - "publicTrimmedFilePath": "dist/arm-links.d.ts" + "publicTrimmedFilePath": "./types/arm-links.d.ts" }, "messages": { "tsdocMessageReporting": { @@ -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 4fe4463ccd3b..99d6b48e08ff 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": [ @@ -19,30 +19,31 @@ "azure", "typescript", "browser", - "isomorphic", - "cloud" + "isomorphic" ], "license": "MIT", "main": "./dist/commonjs/index.js", - "module": "./dist/esm/index.js", + "module": "./dist-esm/src/index.js", "types": "./dist/commonjs/index.d.ts", "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.8.0", "@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", - "typescript": "~5.8.2", + "dotenv": "^16.0.0", + "playwright": "^1.51.1", + "typescript": "~5.6.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", + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, @@ -89,6 +90,7 @@ ] }, "autoPublish": true, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/links/arm-links", "type": "module", "tshy": { "project": "./tsconfig.src.json", @@ -129,4 +131,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..6bd87f4257fc 100644 --- a/sdk/links/arm-links/src/managementLinkClient.ts +++ b/sdk/links/arm-links/src/managementLinkClient.ts @@ -11,7 +11,7 @@ import * as coreRestPipeline from "@azure/core-rest-pipeline"; import { PipelineRequest, PipelineResponse, - SendRequest + SendRequest, } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { OperationsImpl, ResourceLinksImpl } from "./operations/index.js"; @@ -21,7 +21,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 +32,27 @@ 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 +61,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 +74,21 @@ export class ManagementLinkClient extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + 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 + coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -83,7 +98,7 @@ export class ManagementLinkClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ @@ -93,9 +108,9 @@ export class ManagementLinkClient extends coreClient.ServiceClient { `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -118,7 +133,7 @@ export class ManagementLinkClient extends coreClient.ServiceClient { name: "CustomApiVersionPolicy", async sendRequest( request: PipelineRequest, - next: SendRequest + next: SendRequest, ): Promise { const param = request.url.split("?"); if (param.length > 1) { @@ -132,7 +147,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..1788384b5787 100644 --- a/sdk/links/arm-links/src/models/index.ts +++ b/sdk/links/arm-links/src/models/index.ts @@ -138,10 +138,7 @@ 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; 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..a053bc93bf66 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"; /// @@ -39,7 +39,7 @@ export class OperationsImpl implements Operations { * @param options The options parameters. */ public list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -54,13 +54,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 +81,7 @@ export class OperationsImpl implements Operations { } private async *listPagingAll( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -93,7 +93,7 @@ export class OperationsImpl implements Operations { * @param options The options parameters. */ private _list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -105,11 +105,11 @@ export class OperationsImpl implements Operations { */ private _listNext( nextLink: string, - options?: OperationsListNextOptionalParams + options?: OperationsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -121,24 +121,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..99dc36c6b391 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; @@ -143,7 +143,7 @@ export class ResourceLinksImpl implements ResourceLinks { result = await this._listAtSourceScopeNext( scope, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -154,7 +154,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; @@ -171,11 +171,11 @@ export class ResourceLinksImpl implements ResourceLinks { */ delete( linkId: string, - options?: ResourceLinksDeleteOptionalParams + options?: ResourceLinksDeleteOptionalParams, ): Promise { return this.client.sendOperationRequest( { linkId, options }, - deleteOperationSpec + deleteOperationSpec, ); } @@ -191,11 +191,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, ); } @@ -207,11 +207,11 @@ export class ResourceLinksImpl implements ResourceLinks { */ get( linkId: string, - options?: ResourceLinksGetOptionalParams + options?: ResourceLinksGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { linkId, options }, - getOperationSpec + getOperationSpec, ); } @@ -220,11 +220,11 @@ export class ResourceLinksImpl implements ResourceLinks { * @param options The options parameters. */ private _listAtSubscription( - options?: ResourceLinksListAtSubscriptionOptionalParams + options?: ResourceLinksListAtSubscriptionOptionalParams, ): Promise { return this.client.sendOperationRequest( { options }, - listAtSubscriptionOperationSpec + listAtSubscriptionOperationSpec, ); } @@ -237,11 +237,11 @@ export class ResourceLinksImpl implements ResourceLinks { */ private _listAtSourceScope( scope: string, - options?: ResourceLinksListAtSourceScopeOptionalParams + options?: ResourceLinksListAtSourceScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, options }, - listAtSourceScopeOperationSpec + listAtSourceScopeOperationSpec, ); } @@ -252,11 +252,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 +271,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 +288,90 @@ 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 + 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..16fcc4862385 100644 --- a/sdk/links/arm-links/src/operationsInterfaces/operations.ts +++ b/sdk/links/arm-links/src/operationsInterfaces/operations.ts @@ -17,6 +17,6 @@ export interface Operations { * @param options The options parameters. */ list( - options?: OperationsListOptionalParams + 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..324222ed0f50 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. @@ -49,7 +49,7 @@ export interface ResourceLinks { */ delete( linkId: string, - options?: ResourceLinksDeleteOptionalParams + options?: ResourceLinksDeleteOptionalParams, ): Promise; /** * Creates or updates a resource link between the specified resources. @@ -63,7 +63,7 @@ export interface ResourceLinks { createOrUpdate( linkId: string, parameters: ResourceLink, - options?: ResourceLinksCreateOrUpdateOptionalParams + options?: ResourceLinksCreateOrUpdateOptionalParams, ): Promise; /** * Gets a resource link with the specified ID. @@ -73,6 +73,6 @@ export interface ResourceLinks { */ get( linkId: string, - options?: ResourceLinksGetOptionalParams + options?: ResourceLinksGetOptionalParams, ): Promise; } diff --git a/sdk/links/arm-links/src/pagingHelper.ts b/sdk/links/arm-links/src/pagingHelper.ts index d85fc13bce1e..205cccc26592 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) { @@ -28,7 +28,7 @@ export function getContinuationToken(page: unknown): string | undefined { export function setContinuationToken( page: unknown, - continuationToken: string | undefined + continuationToken: string | undefined, ): void { if (typeof page !== "object" || page === null || !continuationToken) { return; diff --git a/sdk/links/arm-links/test/sampleTest.ts b/sdk/links/arm-links/test/sampleTest.ts new file mode 100644 index 000000000000..a1cf7c25afd2 --- /dev/null +++ b/sdk/links/arm-links/test/sampleTest.ts @@ -0,0 +1,40 @@ +/* + * 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"; + +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 (ctx) => { + recorder = new Recorder(ctx); + await recorder.start(recorderOptions); + }); + + afterEach(async () => { + await recorder.stop(); + }); + + it("sample test", async function () { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/links/arm-links/test/snippets.spec.ts b/sdk/links/arm-links/test/snippets.spec.ts index a2ec458bb7ec..b460ed99e7d0 100644 --- a/sdk/links/arm-links/test/snippets.spec.ts +++ b/sdk/links/arm-links/test/snippets.spec.ts @@ -1,15 +1,29 @@ +/* + * 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 { ManagementLinkClient } from "../src/index.js"; -import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; +import { + DefaultAzureCredential, + InteractiveBrowserCredential, +} from "@azure/identity"; import { setLogLevel } from "@azure/logger"; import { describe, it } from "vitest"; describe("snippets", () => { it("ReadmeSampleCreateClient_Node", async () => { const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new ManagementLinkClient(new DefaultAzureCredential(), subscriptionId); + const client = new ManagementLinkClient( + new DefaultAzureCredential(), + subscriptionId, + ); }); it("ReadmeSampleCreateClient_Browser", async () => { diff --git a/sdk/links/arm-links/tsconfig.browser.config.json b/sdk/links/arm-links/tsconfig.browser.config.json index 75871518e3a0..0c8bafa97126 100644 --- a/sdk/links/arm-links/tsconfig.browser.config.json +++ b/sdk/links/arm-links/tsconfig.browser.config.json @@ -1,3 +1,6 @@ { - "extends": ["./tsconfig.test.json", "../../../tsconfig.browser.base.json"] + "extends": [ + "./tsconfig.test.json", + "../../../tsconfig.browser.base.json" + ] } diff --git a/sdk/links/arm-links/tsconfig.json b/sdk/links/arm-links/tsconfig.json index 19ceb382b521..4ca574fbd5fb 100644 --- a/sdk/links/arm-links/tsconfig.json +++ b/sdk/links/arm-links/tsconfig.json @@ -1,13 +1,31 @@ { - "references": [ - { - "path": "./tsconfig.src.json" - }, - { - "path": "./tsconfig.samples.json" - }, - { - "path": "./tsconfig.test.json" - } + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": [ + "es6", + "dom" + ], + "declaration": true, + "outDir": "./dist-esm", + "importHelpers": true + }, + "include": [ + "src/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts" + ], + "exclude": [ + "node_modules" ] -} +} \ No newline at end of file diff --git a/sdk/links/arm-links/tsconfig.samples.json b/sdk/links/arm-links/tsconfig.samples.json index a82d55784152..67de1796b138 100644 --- a/sdk/links/arm-links/tsconfig.samples.json +++ b/sdk/links/arm-links/tsconfig.samples.json @@ -2,7 +2,9 @@ "extends": "../../../tsconfig.samples.base.json", "compilerOptions": { "paths": { - "@azure/arm-links": ["./dist/esm"] + "@azure/arm-links": [ + "./dist/esm" + ] } } } diff --git a/sdk/links/arm-links/tsconfig.test.json b/sdk/links/arm-links/tsconfig.test.json index 290ca214aebc..3c2b783a8c1b 100644 --- a/sdk/links/arm-links/tsconfig.test.json +++ b/sdk/links/arm-links/tsconfig.test.json @@ -1,3 +1,6 @@ { - "extends": ["./tsconfig.src.json", "../../../tsconfig.test.base.json"] + "extends": [ + "./tsconfig.src.json", + "../../../tsconfig.test.base.json" + ] } 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..e95586801903 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-03-18) + ### 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 a6ee67370c6f..bd9e8e325cdb 100644 --- a/sdk/locks/arm-locks/README.md +++ b/sdk/locks/arm-locks/README.md @@ -44,24 +44,33 @@ 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). Using Node.js and Node-like environments, you can use the `DefaultAzureCredential` class to authenticate the client. ```ts snippet:ReadmeSampleCreateClient_Node +import { ManagementLockClient } from "@azure/arm-locks"; +import { DefaultAzureCredential } from "@azure/identity"; +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new ManagementLockClient(new DefaultAzureCredential(), subscriptionId); ``` For browser environments, use the `InteractiveBrowserCredential` from the `@azure/identity` package to authenticate. ```ts snippet:ReadmeSampleCreateClient_Browser - +import { InteractiveBrowserCredential } from "@azure/identity"; +import { ManagementLockClient } from "@azure/arm-locks"; + +const credential = new InteractiveBrowserCredential({ + tenantId: "", + 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 @@ -96,6 +105,8 @@ 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) +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Flocks%2Farm-locks%2FREADME.png) + [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..31bf9062391b 100644 --- a/sdk/locks/arm-locks/_meta.json +++ b/sdk/locks/arm-locks/_meta.json @@ -1,8 +1,8 @@ { - "commit": "a42f1b58607091c4f255ead152a8ef323fa0b280", + "commit": "a3dcf1c9eb0324a1e4e9a12ec4655f54ba1f44f5", "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", - "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" -} + "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/test-repo-billy/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.23", + "use": "@autorest/typescript@^6.0.12" +} \ No newline at end of file diff --git a/sdk/locks/arm-locks/api-extractor.json b/sdk/locks/arm-locks/api-extractor.json index 47ca0e02dc13..d62f01cf7a13 100644 --- a/sdk/locks/arm-locks/api-extractor.json +++ b/sdk/locks/arm-locks/api-extractor.json @@ -1,6 +1,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "dist/esm/index.d.ts", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", "docModel": { "enabled": true }, @@ -11,7 +11,7 @@ "dtsRollup": { "enabled": true, "untrimmedFilePath": "", - "publicTrimmedFilePath": "dist/arm-locks.d.ts" + "publicTrimmedFilePath": "./types/arm-locks.d.ts" }, "messages": { "tsdocMessageReporting": { @@ -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 95116eba2c62..d491f212ec82 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": [ @@ -19,29 +19,31 @@ "azure", "typescript", "browser", - "isomorphic", - "cloud" + "isomorphic" ], "license": "MIT", "main": "./dist/commonjs/index.js", - "module": "./dist/esm/index.js", + "module": "./dist-esm/src/index.js", "types": "./dist/commonjs/index.d.ts", "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.8.0", "@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", - "typescript": "~5.8.2", + "dotenv": "^16.0.0", + "playwright": "^1.51.1", + "typescript": "~5.6.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", + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, @@ -88,14 +90,7 @@ ] }, "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-locks?view=azure-node-preview" - }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/locks/arm-locks", "type": "module", "tshy": { "project": "./tsconfig.src.json", @@ -136,4 +131,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..ff9e3008026c 100644 --- a/sdk/locks/arm-locks/src/managementLockClient.ts +++ b/sdk/locks/arm-locks/src/managementLockClient.ts @@ -11,20 +11,20 @@ import * as coreRestPipeline from "@azure/core-rest-pipeline"; import { PipelineRequest, PipelineResponse, - SendRequest + SendRequest, } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { AuthorizationOperationsImpl, ManagementLocksImpl } from "./operations/index.js"; import { AuthorizationOperations, - ManagementLocks + 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 +35,27 @@ 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 +64,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 +77,21 @@ export class ManagementLockClient extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + 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 + coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -86,7 +101,7 @@ export class ManagementLockClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ @@ -96,9 +111,9 @@ export class ManagementLockClient extends coreClient.ServiceClient { `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -121,7 +136,7 @@ export class ManagementLockClient extends coreClient.ServiceClient { name: "CustomApiVersionPolicy", async sendRequest( request: PipelineRequest, - next: SendRequest + next: SendRequest, ): Promise { const param = request.url.split("?"); if (param.length > 1) { @@ -135,7 +150,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..4354ad8880fb 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", } /** @@ -207,7 +207,8 @@ export interface ManagementLocksCreateOrUpdateAtResourceGroupLevelOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the createOrUpdateAtResourceGroupLevel operation. */ -export type ManagementLocksCreateOrUpdateAtResourceGroupLevelResponse = ManagementLockObject; +export type ManagementLocksCreateOrUpdateAtResourceGroupLevelResponse = + ManagementLockObject; /** Optional parameters. */ export interface ManagementLocksDeleteAtResourceGroupLevelOptionalParams @@ -218,7 +219,8 @@ export interface ManagementLocksGetAtResourceGroupLevelOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the getAtResourceGroupLevel operation. */ -export type ManagementLocksGetAtResourceGroupLevelResponse = ManagementLockObject; +export type ManagementLocksGetAtResourceGroupLevelResponse = + ManagementLockObject; /** Optional parameters. */ export interface ManagementLocksCreateOrUpdateByScopeOptionalParams @@ -243,7 +245,8 @@ export interface ManagementLocksCreateOrUpdateAtResourceLevelOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the createOrUpdateAtResourceLevel operation. */ -export type ManagementLocksCreateOrUpdateAtResourceLevelResponse = ManagementLockObject; +export type ManagementLocksCreateOrUpdateAtResourceLevelResponse = + ManagementLockObject; /** Optional parameters. */ export interface ManagementLocksDeleteAtResourceLevelOptionalParams @@ -261,7 +264,8 @@ export interface ManagementLocksCreateOrUpdateAtSubscriptionLevelOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the createOrUpdateAtSubscriptionLevel operation. */ -export type ManagementLocksCreateOrUpdateAtSubscriptionLevelResponse = ManagementLockObject; +export type ManagementLocksCreateOrUpdateAtSubscriptionLevelResponse = + ManagementLockObject; /** Optional parameters. */ export interface ManagementLocksDeleteAtSubscriptionLevelOptionalParams @@ -272,7 +276,8 @@ export interface ManagementLocksGetAtSubscriptionLevelOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the getAtSubscriptionLevel operation. */ -export type ManagementLocksGetAtSubscriptionLevelResponse = ManagementLockObject; +export type ManagementLocksGetAtSubscriptionLevelResponse = + ManagementLockObject; /** Optional parameters. */ export interface ManagementLocksListAtResourceGroupLevelOptionalParams @@ -282,7 +287,8 @@ export interface ManagementLocksListAtResourceGroupLevelOptionalParams } /** Contains response data for the listAtResourceGroupLevel operation. */ -export type ManagementLocksListAtResourceGroupLevelResponse = ManagementLockListResult; +export type ManagementLocksListAtResourceGroupLevelResponse = + ManagementLockListResult; /** Optional parameters. */ export interface ManagementLocksListAtResourceLevelOptionalParams @@ -292,7 +298,8 @@ export interface ManagementLocksListAtResourceLevelOptionalParams } /** Contains response data for the listAtResourceLevel operation. */ -export type ManagementLocksListAtResourceLevelResponse = ManagementLockListResult; +export type ManagementLocksListAtResourceLevelResponse = + ManagementLockListResult; /** Optional parameters. */ export interface ManagementLocksListAtSubscriptionLevelOptionalParams @@ -302,7 +309,8 @@ export interface ManagementLocksListAtSubscriptionLevelOptionalParams } /** Contains response data for the listAtSubscriptionLevel operation. */ -export type ManagementLocksListAtSubscriptionLevelResponse = ManagementLockListResult; +export type ManagementLocksListAtSubscriptionLevelResponse = + ManagementLockListResult; /** Optional parameters. */ export interface ManagementLocksListByScopeOptionalParams @@ -316,40 +324,31 @@ 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; +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; +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; +export type ManagementLocksListAtSubscriptionLevelNextResponse = + ManagementLockListResult; /** Optional parameters. */ export interface ManagementLocksListByScopeNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listByScopeNext operation. */ export type ManagementLocksListByScopeNextResponse = ManagementLockListResult; 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..21c7d47c8d2c 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,11 +105,11 @@ export class AuthorizationOperationsImpl implements AuthorizationOperations { */ private _listNext( nextLink: string, - options?: AuthorizationOperationsListNextOptionalParams + options?: AuthorizationOperationsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -121,30 +121,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..e08559a04a7b 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,11 +73,11 @@ export class ManagementLocksImpl implements ManagementLocks { */ public listAtResourceGroupLevel( resourceGroupName: string, - options?: ManagementLocksListAtResourceGroupLevelOptionalParams + options?: ManagementLocksListAtResourceGroupLevelOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listAtResourceGroupLevelPagingAll( resourceGroupName, - options + options, ); return { next() { @@ -93,16 +93,16 @@ export class ManagementLocksImpl implements ManagementLocks { return this.listAtResourceGroupLevelPagingPage( resourceGroupName, options, - settings + settings, ); - } + }, }; } private async *listAtResourceGroupLevelPagingPage( resourceGroupName: string, options?: ManagementLocksListAtResourceGroupLevelOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ManagementLocksListAtResourceGroupLevelResponse; let continuationToken = settings?.continuationToken; @@ -117,7 +117,7 @@ export class ManagementLocksImpl implements ManagementLocks { result = await this._listAtResourceGroupLevelNext( resourceGroupName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -128,11 +128,11 @@ export class ManagementLocksImpl implements ManagementLocks { private async *listAtResourceGroupLevelPagingAll( resourceGroupName: string, - options?: ManagementLocksListAtResourceGroupLevelOptionalParams + options?: ManagementLocksListAtResourceGroupLevelOptionalParams, ): AsyncIterableIterator { for await (const page of this.listAtResourceGroupLevelPagingPage( resourceGroupName, - options + options, )) { yield* page; } @@ -154,7 +154,7 @@ export class ManagementLocksImpl implements ManagementLocks { parentResourcePath: string, resourceType: string, resourceName: string, - options?: ManagementLocksListAtResourceLevelOptionalParams + options?: ManagementLocksListAtResourceLevelOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listAtResourceLevelPagingAll( resourceGroupName, @@ -162,7 +162,7 @@ export class ManagementLocksImpl implements ManagementLocks { parentResourcePath, resourceType, resourceName, - options + options, ); return { next() { @@ -182,9 +182,9 @@ export class ManagementLocksImpl implements ManagementLocks { resourceType, resourceName, options, - settings + settings, ); - } + }, }; } @@ -195,7 +195,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 +206,7 @@ export class ManagementLocksImpl implements ManagementLocks { parentResourcePath, resourceType, resourceName, - options + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -221,7 +221,7 @@ export class ManagementLocksImpl implements ManagementLocks { resourceType, resourceName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -236,7 +236,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 +244,7 @@ export class ManagementLocksImpl implements ManagementLocks { parentResourcePath, resourceType, resourceName, - options + options, )) { yield* page; } @@ -255,7 +255,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 +270,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; @@ -290,7 +290,7 @@ export class ManagementLocksImpl implements ManagementLocks { while (continuationToken) { result = await this._listAtSubscriptionLevelNext( continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -300,7 +300,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 +318,7 @@ export class ManagementLocksImpl implements ManagementLocks { */ public listByScope( scope: string, - options?: ManagementLocksListByScopeOptionalParams + options?: ManagementLocksListByScopeOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByScopePagingAll(scope, options); return { @@ -333,14 +333,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 +362,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 +384,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 +403,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 +420,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 +443,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 +460,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,11 +477,11 @@ export class ManagementLocksImpl implements ManagementLocks { getByScope( scope: string, lockName: string, - options?: ManagementLocksGetByScopeOptionalParams + options?: ManagementLocksGetByScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, lockName, options }, - getByScopeOperationSpec + getByScopeOperationSpec, ); } @@ -508,7 +508,7 @@ export class ManagementLocksImpl implements ManagementLocks { resourceName: string, lockName: string, parameters: ManagementLockObject, - options?: ManagementLocksCreateOrUpdateAtResourceLevelOptionalParams + options?: ManagementLocksCreateOrUpdateAtResourceLevelOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -519,9 +519,9 @@ export class ManagementLocksImpl implements ManagementLocks { resourceName, lockName, parameters, - options + options, }, - createOrUpdateAtResourceLevelOperationSpec + createOrUpdateAtResourceLevelOperationSpec, ); } @@ -546,7 +546,7 @@ export class ManagementLocksImpl implements ManagementLocks { resourceType: string, resourceName: string, lockName: string, - options?: ManagementLocksDeleteAtResourceLevelOptionalParams + options?: ManagementLocksDeleteAtResourceLevelOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -556,9 +556,9 @@ export class ManagementLocksImpl implements ManagementLocks { resourceType, resourceName, lockName, - options + options, }, - deleteAtResourceLevelOperationSpec + deleteAtResourceLevelOperationSpec, ); } @@ -579,7 +579,7 @@ export class ManagementLocksImpl implements ManagementLocks { resourceType: string, resourceName: string, lockName: string, - options?: ManagementLocksGetAtResourceLevelOptionalParams + options?: ManagementLocksGetAtResourceLevelOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -589,9 +589,9 @@ export class ManagementLocksImpl implements ManagementLocks { resourceType, resourceName, lockName, - options + options, }, - getAtResourceLevelOperationSpec + getAtResourceLevelOperationSpec, ); } @@ -608,11 +608,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 +625,11 @@ export class ManagementLocksImpl implements ManagementLocks { */ deleteAtSubscriptionLevel( lockName: string, - options?: ManagementLocksDeleteAtSubscriptionLevelOptionalParams + options?: ManagementLocksDeleteAtSubscriptionLevelOptionalParams, ): Promise { return this.client.sendOperationRequest( { lockName, options }, - deleteAtSubscriptionLevelOperationSpec + deleteAtSubscriptionLevelOperationSpec, ); } @@ -640,11 +640,11 @@ export class ManagementLocksImpl implements ManagementLocks { */ getAtSubscriptionLevel( lockName: string, - options?: ManagementLocksGetAtSubscriptionLevelOptionalParams + options?: ManagementLocksGetAtSubscriptionLevelOptionalParams, ): Promise { return this.client.sendOperationRequest( { lockName, options }, - getAtSubscriptionLevelOperationSpec + getAtSubscriptionLevelOperationSpec, ); } @@ -655,11 +655,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 +679,7 @@ export class ManagementLocksImpl implements ManagementLocks { parentResourcePath: string, resourceType: string, resourceName: string, - options?: ManagementLocksListAtResourceLevelOptionalParams + options?: ManagementLocksListAtResourceLevelOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -688,9 +688,9 @@ export class ManagementLocksImpl implements ManagementLocks { parentResourcePath, resourceType, resourceName, - options + options, }, - listAtResourceLevelOperationSpec + listAtResourceLevelOperationSpec, ); } @@ -699,11 +699,11 @@ export class ManagementLocksImpl implements ManagementLocks { * @param options The options parameters. */ private _listAtSubscriptionLevel( - options?: ManagementLocksListAtSubscriptionLevelOptionalParams + options?: ManagementLocksListAtSubscriptionLevelOptionalParams, ): Promise { return this.client.sendOperationRequest( { options }, - listAtSubscriptionLevelOperationSpec + listAtSubscriptionLevelOperationSpec, ); } @@ -718,11 +718,11 @@ export class ManagementLocksImpl implements ManagementLocks { */ private _listByScope( scope: string, - options?: ManagementLocksListByScopeOptionalParams + options?: ManagementLocksListByScopeOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, options }, - listByScopeOperationSpec + listByScopeOperationSpec, ); } @@ -736,11 +736,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 +762,7 @@ export class ManagementLocksImpl implements ManagementLocks { resourceType: string, resourceName: string, nextLink: string, - options?: ManagementLocksListAtResourceLevelNextOptionalParams + options?: ManagementLocksListAtResourceLevelNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -772,9 +772,9 @@ export class ManagementLocksImpl implements ManagementLocks { resourceType, resourceName, nextLink, - options + options, }, - listAtResourceLevelNextOperationSpec + listAtResourceLevelNextOperationSpec, ); } @@ -786,11 +786,11 @@ export class ManagementLocksImpl implements ManagementLocks { */ private _listAtSubscriptionLevelNext( nextLink: string, - options?: ManagementLocksListAtSubscriptionLevelNextOptionalParams + options?: ManagementLocksListAtSubscriptionLevelNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listAtSubscriptionLevelNextOperationSpec + listAtSubscriptionLevelNextOperationSpec, ); } @@ -807,107 +807,105 @@ 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, ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const createOrUpdateAtResourceGroupLevelOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.ManagementLockObject - }, - 201: { - bodyMapper: Mappers.ManagementLockObject +const createOrUpdateAtResourceGroupLevelOperationSpec: coreClient.OperationSpec = + { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ManagementLockObject, + }, + 201: { + bodyMapper: Mappers.ManagementLockObject, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.lockName, - Parameters.subscriptionId - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.lockName, + Parameters.subscriptionId, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + 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 +914,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 +962,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 +987,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 +1012,106 @@ 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}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.ManagementLockObject - }, - 201: { - bodyMapper: Mappers.ManagementLockObject +const createOrUpdateAtSubscriptionLevelOperationSpec: coreClient.OperationSpec = + { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ManagementLockObject, + }, + 201: { + bodyMapper: Mappers.ManagementLockObject, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.lockName, - Parameters.subscriptionId - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.lockName, + Parameters.subscriptionId, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + 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 + 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 + 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 + 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 +1121,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 +1197,42 @@ 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 + 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..d361cb0723d4 100644 --- a/sdk/locks/arm-locks/src/operationsInterfaces/authorizationOperations.ts +++ b/sdk/locks/arm-locks/src/operationsInterfaces/authorizationOperations.ts @@ -9,7 +9,7 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { Operation, - AuthorizationOperationsListOptionalParams + AuthorizationOperationsListOptionalParams, } from "../models/index.js"; /// @@ -20,6 +20,6 @@ export interface AuthorizationOperations { * @param options The options parameters. */ list( - options?: AuthorizationOperationsListOptionalParams + 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..205cccc26592 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) { @@ -28,7 +28,7 @@ export function getContinuationToken(page: unknown): string | undefined { export function setContinuationToken( page: unknown, - continuationToken: string | undefined + continuationToken: string | undefined, ): void { if (typeof page !== "object" || page === null || !continuationToken) { return; diff --git a/sdk/locks/arm-locks/test/sampleTest.ts b/sdk/locks/arm-locks/test/sampleTest.ts new file mode 100644 index 000000000000..a1cf7c25afd2 --- /dev/null +++ b/sdk/locks/arm-locks/test/sampleTest.ts @@ -0,0 +1,40 @@ +/* + * 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"; + +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 (ctx) => { + recorder = new Recorder(ctx); + await recorder.start(recorderOptions); + }); + + afterEach(async () => { + await recorder.stop(); + }); + + it("sample test", async function () { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/locks/arm-locks/test/snippets.spec.ts b/sdk/locks/arm-locks/test/snippets.spec.ts index 815debc5c395..b231d22519bb 100644 --- a/sdk/locks/arm-locks/test/snippets.spec.ts +++ b/sdk/locks/arm-locks/test/snippets.spec.ts @@ -1,15 +1,29 @@ +/* + * 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 { ManagementLockClient } from "../src/index.js"; -import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; +import { + DefaultAzureCredential, + InteractiveBrowserCredential, +} from "@azure/identity"; import { setLogLevel } from "@azure/logger"; import { describe, it } from "vitest"; describe("snippets", () => { it("ReadmeSampleCreateClient_Node", async () => { const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new ManagementLockClient(new DefaultAzureCredential(), subscriptionId); + const client = new ManagementLockClient( + new DefaultAzureCredential(), + subscriptionId, + ); }); it("ReadmeSampleCreateClient_Browser", async () => { diff --git a/sdk/locks/arm-locks/tsconfig.browser.config.json b/sdk/locks/arm-locks/tsconfig.browser.config.json index 75871518e3a0..0c8bafa97126 100644 --- a/sdk/locks/arm-locks/tsconfig.browser.config.json +++ b/sdk/locks/arm-locks/tsconfig.browser.config.json @@ -1,3 +1,6 @@ { - "extends": ["./tsconfig.test.json", "../../../tsconfig.browser.base.json"] + "extends": [ + "./tsconfig.test.json", + "../../../tsconfig.browser.base.json" + ] } diff --git a/sdk/locks/arm-locks/tsconfig.json b/sdk/locks/arm-locks/tsconfig.json index 19ceb382b521..4bae17dce511 100644 --- a/sdk/locks/arm-locks/tsconfig.json +++ b/sdk/locks/arm-locks/tsconfig.json @@ -1,13 +1,29 @@ { - "references": [ - { - "path": "./tsconfig.src.json" - }, - { - "path": "./tsconfig.samples.json" - }, - { - "path": "./tsconfig.test.json" - } + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": [ + "es6", + "dom" + ], + "declaration": true, + "outDir": "./dist-esm", + "importHelpers": true + }, + "include": [ + "src/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts" + ], + "exclude": [ + "node_modules" ] -} +} \ No newline at end of file diff --git a/sdk/locks/arm-locks/tsconfig.samples.json b/sdk/locks/arm-locks/tsconfig.samples.json index 463182fa482e..61d1031d234c 100644 --- a/sdk/locks/arm-locks/tsconfig.samples.json +++ b/sdk/locks/arm-locks/tsconfig.samples.json @@ -2,7 +2,9 @@ "extends": "../../../tsconfig.samples.base.json", "compilerOptions": { "paths": { - "@azure/arm-locks": ["./dist/esm"] + "@azure/arm-locks": [ + "./dist/esm" + ] } } } diff --git a/sdk/locks/arm-locks/tsconfig.test.json b/sdk/locks/arm-locks/tsconfig.test.json index 290ca214aebc..3c2b783a8c1b 100644 --- a/sdk/locks/arm-locks/tsconfig.test.json +++ b/sdk/locks/arm-locks/tsconfig.test.json @@ -1,3 +1,6 @@ { - "extends": ["./tsconfig.src.json", "../../../tsconfig.test.base.json"] + "extends": [ + "./tsconfig.src.json", + "../../../tsconfig.test.base.json" + ] } 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..3c4ca8b2a2ec 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-03-18) + +### 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..fac783748049 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,8 @@ 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) +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fmanagedapplications%2Farm-managedapplications%2FREADME.png) + [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..31bf9062391b 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", - "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" -} + "commit": "a3dcf1c9eb0324a1e4e9a12ec4655f54ba1f44f5", + "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/test-repo-billy/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.23", + "use": "@autorest/typescript@^6.0.12" +} \ No newline at end of file diff --git a/sdk/managedapplications/arm-managedapplications/api-extractor.json b/sdk/managedapplications/arm-managedapplications/api-extractor.json index 292b8442d8e6..5788fd065335 100644 --- a/sdk/managedapplications/arm-managedapplications/api-extractor.json +++ b/sdk/managedapplications/arm-managedapplications/api-extractor.json @@ -1,6 +1,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "dist/esm/index.d.ts", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", "docModel": { "enabled": true }, @@ -11,7 +11,7 @@ "dtsRollup": { "enabled": true, "untrimmedFilePath": "", - "publicTrimmedFilePath": "dist/arm-managedapplications.d.ts" + "publicTrimmedFilePath": "./types/arm-managedapplications.d.ts" }, "messages": { "tsdocMessageReporting": { @@ -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 ab01f820143f..07b13662d3b3 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": [ @@ -21,29 +21,31 @@ "azure", "typescript", "browser", - "isomorphic", - "cloud" + "isomorphic" ], "license": "MIT", "main": "./dist/commonjs/index.js", - "module": "./dist/esm/index.js", + "module": "./dist-esm/src/index.js", "types": "./dist/commonjs/index.d.ts", "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.8.0", "@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", - "typescript": "~5.8.2", + "playwright": "^1.51.1", + "typescript": "~5.6.2", "vitest": "^3.0.9" }, - "repository": "github:Azure/azure-sdk-for-js", + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, @@ -91,14 +93,6 @@ }, "autoPublish": true, "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", @@ -139,4 +133,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..2c1620e04f65 100644 --- a/sdk/managedapplications/arm-managedapplications/src/applicationClient.ts +++ b/sdk/managedapplications/arm-managedapplications/src/applicationClient.ts @@ -11,21 +11,13 @@ import * as coreRestPipeline from "@azure/core-rest-pipeline"; import { PipelineRequest, PipelineResponse, - SendRequest + 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 +26,7 @@ import { ListOperationsNextOptionalParams, ListOperationsOptionalParams, ListOperationsResponse, - ListOperationsNextResponse + ListOperationsNextResponse, } from "./models/index.js"; /// @@ -52,16 +44,16 @@ export class ApplicationClient extends coreClient.ServiceClient { constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: ApplicationClientOptionalParams + options?: ApplicationClientOptionalParams, ); constructor( credentials: coreAuth.TokenCredential, - options?: ApplicationClientOptionalParams + 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 +73,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 +86,21 @@ export class ApplicationClient extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + 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 + coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -117,7 +110,7 @@ export class ApplicationClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ @@ -127,9 +120,9 @@ export class ApplicationClient extends coreClient.ServiceClient { `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -137,10 +130,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); } @@ -153,7 +145,7 @@ export class ApplicationClient extends coreClient.ServiceClient { name: "CustomApiVersionPolicy", async sendRequest( request: PipelineRequest, - next: SendRequest + next: SendRequest, ): Promise { const param = request.url.split("?"); if (param.length > 1) { @@ -167,7 +159,7 @@ export class ApplicationClient extends coreClient.ServiceClient { request.url = param[0] + "?" + newParams.join("&"); } return next(request); - } + }, }; this.pipeline.addPolicy(apiVersionPolicy); } @@ -177,7 +169,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 +184,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 +211,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; @@ -231,7 +223,7 @@ export class ApplicationClient extends coreClient.ServiceClient { * @param options The options parameters. */ private _listOperations( - options?: ListOperationsOptionalParams + options?: ListOperationsOptionalParams, ): Promise { return this.sendOperationRequest({ options }, listOperationsOperationSpec); } @@ -243,17 +235,16 @@ export class ApplicationClient extends coreClient.ServiceClient { */ private _listOperationsNext( nextLink: string, - options?: ListOperationsNextOptionalParams + options?: ListOperationsNextOptionalParams, ): Promise { return this.sendOperationRequest( { nextLink, options }, - listOperationsNextOperationSpec + listOperationsNextOperationSpec, ); } applications: Applications; applicationDefinitions: ApplicationDefinitions; - jitRequests: JitRequests; } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); @@ -263,29 +254,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..5f88efab981b 100644 --- a/sdk/managedapplications/arm-managedapplications/src/lroImpl.ts +++ b/sdk/managedapplications/arm-managedapplications/src/lroImpl.ts @@ -5,6 +5,10 @@ * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + import { AbortSignalLike } from "@azure/abort-controller"; import { LongRunningOperation, LroResponse } from "@azure/core-lro"; @@ -24,15 +28,15 @@ export function createLroSpec(inputs: { sendInitialRequest: () => sendOperationFn(args, spec), sendPollRequest: ( path: string, - options?: { abortSignal?: AbortSignalLike } + 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..c0cd856834c9 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,277 +285,10 @@ 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 @@ -1101,14 +337,10 @@ 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 @@ -1156,47 +388,11 @@ export type ApplicationsCreateOrUpdateByIdResponse = Application; 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 @@ -1221,35 +417,33 @@ export type ApplicationDefinitionsGetResponse = ApplicationDefinition; /** Optional parameters. */ export interface ApplicationDefinitionsDeleteOptionalParams - 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 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; +export type ApplicationDefinitionsCreateOrUpdateResponse = + ApplicationDefinition; /** Optional parameters. */ export interface ApplicationDefinitionsListByResourceGroupOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listByResourceGroup operation. */ -export type ApplicationDefinitionsListByResourceGroupResponse = ApplicationDefinitionListResult; - -/** Optional parameters. */ -export interface ApplicationDefinitionsListBySubscriptionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscription operation. */ -export type ApplicationDefinitionsListBySubscriptionResponse = ApplicationDefinitionListResult; +export type ApplicationDefinitionsListByResourceGroupResponse = + ApplicationDefinitionListResult; /** Optional parameters. */ export interface ApplicationDefinitionsGetByIdOptionalParams @@ -1260,45 +454,15 @@ 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,33 +470,17 @@ 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 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..2126754f3000 100644 --- a/sdk/managedapplications/arm-managedapplications/src/operations/applicationDefinitions.ts +++ b/sdk/managedapplications/arm-managedapplications/src/operations/applicationDefinitions.ts @@ -13,31 +13,28 @@ 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 +57,7 @@ export class ApplicationDefinitionsImpl implements ApplicationDefinitions { */ public listByResourceGroup( resourceGroupName: string, - options?: ApplicationDefinitionsListByResourceGroupOptionalParams + options?: ApplicationDefinitionsListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); return { @@ -77,16 +74,16 @@ export class ApplicationDefinitionsImpl implements ApplicationDefinitions { return this.listByResourceGroupPagingPage( resourceGroupName, options, - settings + settings, ); - } + }, }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, options?: ApplicationDefinitionsListByResourceGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ApplicationDefinitionsListByResourceGroupResponse; let continuationToken = settings?.continuationToken; @@ -101,7 +98,7 @@ export class ApplicationDefinitionsImpl implements ApplicationDefinitions { result = await this._listByResourceGroupNext( resourceGroupName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -112,70 +109,16 @@ export class ApplicationDefinitionsImpl implements ApplicationDefinitions { private async *listByResourceGroupPagingAll( resourceGroupName: string, - options?: ApplicationDefinitionsListByResourceGroupOptionalParams + options?: ApplicationDefinitionsListByResourceGroupOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByResourceGroupPagingPage( resourceGroupName, - options + 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 - ): AsyncIterableIterator { - for await (const page of this.listBySubscriptionPagingPage(options)) { - yield* page; - } - } - /** * Gets the managed application definition. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -185,67 +128,192 @@ 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. */ - delete( + async beginDelete( resourceGroupName: string, applicationDefinitionName: string, - options?: ApplicationDefinitionsDeleteOptionalParams + 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. + */ + async beginDeleteAndWait( + resourceGroupName: string, + applicationDefinitionName: string, + 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 +323,91 @@ 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 +416,116 @@ 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 +537,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 +549,194 @@ 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 - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.resourceGroupName, 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 - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, 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..fde4df824a0f 100644 --- a/sdk/managedapplications/arm-managedapplications/src/operations/applications.ts +++ b/sdk/managedapplications/arm-managedapplications/src/operations/applications.ts @@ -16,7 +16,7 @@ import { ApplicationClient } from "../applicationClient.js"; import { SimplePollerLike, OperationState, - createHttpPoller + createHttpPoller, } from "@azure/core-lro"; import { createLroSpec } from "../lroImpl.js"; import { @@ -41,16 +41,8 @@ import { ApplicationsCreateOrUpdateByIdResponse, ApplicationsUpdateByIdOptionalParams, ApplicationsUpdateByIdResponse, - ApplicationsRefreshPermissionsOptionalParams, - ApplicationsListAllowedUpgradePlansOptionalParams, - ApplicationsListAllowedUpgradePlansResponse, - UpdateAccessDefinition, - ApplicationsUpdateAccessOptionalParams, - ListTokenRequest, - ApplicationsListTokensOptionalParams, - ApplicationsListTokensResponse, ApplicationsListByResourceGroupNextResponse, - ApplicationsListBySubscriptionNextResponse + ApplicationsListBySubscriptionNextResponse, } from "../models/index.js"; /// @@ -67,13 +59,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 { @@ -90,16 +82,16 @@ export class ApplicationsImpl implements Applications { return this.listByResourceGroupPagingPage( resourceGroupName, options, - settings + settings, ); - } + }, }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, options?: ApplicationsListByResourceGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ApplicationsListByResourceGroupResponse; let continuationToken = settings?.continuationToken; @@ -114,7 +106,7 @@ export class ApplicationsImpl implements Applications { result = await this._listByResourceGroupNext( resourceGroupName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -125,22 +117,22 @@ export class ApplicationsImpl implements Applications { private async *listByResourceGroupPagingAll( resourceGroupName: string, - options?: ApplicationsListByResourceGroupOptionalParams + options?: ApplicationsListByResourceGroupOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByResourceGroupPagingPage( resourceGroupName, - options + 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 +147,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 +174,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 +190,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 +207,24 @@ 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 +233,8 @@ export class ApplicationsImpl implements Applications { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -251,20 +242,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 +269,18 @@ export class ApplicationsImpl implements Applications { async beginDeleteAndWait( resourceGroupName: string, applicationName: string, - options?: ApplicationsDeleteOptionalParams + options?: ApplicationsDeleteOptionalParams, ): Promise { const poller = await this.beginDelete( resourceGroupName, applicationName, - options + 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 +290,7 @@ export class ApplicationsImpl implements Applications { resourceGroupName: string, applicationName: string, parameters: Application, - options?: ApplicationsCreateOrUpdateOptionalParams + options?: ApplicationsCreateOrUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -309,21 +299,20 @@ 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 +321,8 @@ export class ApplicationsImpl implements Applications { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -341,15 +330,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 +346,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,133 +362,60 @@ 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 + listBySubscriptionOperationSpec, ); } @@ -513,11 +428,11 @@ export class ApplicationsImpl implements Applications { */ getById( applicationId: string, - options?: ApplicationsGetByIdOptionalParams + options?: ApplicationsGetByIdOptionalParams, ): Promise { return this.client.sendOperationRequest( { applicationId, options }, - getByIdOperationSpec + getByIdOperationSpec, ); } @@ -530,25 +445,24 @@ 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 +471,8 @@ export class ApplicationsImpl implements Applications { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -566,20 +480,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 +507,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 +524,7 @@ export class ApplicationsImpl implements Applications { async beginCreateOrUpdateById( applicationId: string, parameters: Application, - options?: ApplicationsCreateOrUpdateByIdOptionalParams + options?: ApplicationsCreateOrUpdateByIdOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -620,21 +533,20 @@ 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 +555,8 @@ export class ApplicationsImpl implements Applications { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -652,15 +564,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 +580,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,307 +596,31 @@ export class ApplicationsImpl implements Applications { async beginCreateOrUpdateByIdAndWait( applicationId: string, parameters: Application, - options?: ApplicationsCreateOrUpdateByIdOptionalParams + options?: ApplicationsCreateOrUpdateByIdOptionalParams, ): Promise { const poller = await this.beginCreateOrUpdateById( applicationId, 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 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( + updateById( 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. - * @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( - 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 + { applicationId, options }, + updateByIdOperationSpec, ); } @@ -998,11 +633,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 +648,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 +660,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 +690,126 @@ 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.resourceGroupName, Parameters.subscriptionId, - Parameters.resourceGroupName ], 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 +820,95 @@ 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 + bodyMapper: Mappers.Application, }, - 204: { - bodyMapper: Mappers.ApplicationPatchable - }, - 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 + 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..205cccc26592 100644 --- a/sdk/managedapplications/arm-managedapplications/src/pagingHelper.ts +++ b/sdk/managedapplications/arm-managedapplications/src/pagingHelper.ts @@ -28,7 +28,7 @@ export function getContinuationToken(page: unknown): string | undefined { export function setContinuationToken( page: unknown, - continuationToken: string | undefined + continuationToken: string | undefined, ): void { if (typeof page !== "object" || page === null || !continuationToken) { return; diff --git a/sdk/managedapplications/arm-managedapplications/test/sampleTest.ts b/sdk/managedapplications/arm-managedapplications/test/sampleTest.ts new file mode 100644 index 000000000000..a1cf7c25afd2 --- /dev/null +++ b/sdk/managedapplications/arm-managedapplications/test/sampleTest.ts @@ -0,0 +1,40 @@ +/* + * 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"; + +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 (ctx) => { + recorder = new Recorder(ctx); + await recorder.start(recorderOptions); + }); + + afterEach(async () => { + await recorder.stop(); + }); + + it("sample test", async function () { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/managedapplications/arm-managedapplications/test/snippets.spec.ts b/sdk/managedapplications/arm-managedapplications/test/snippets.spec.ts index 8812a9c88293..8713a047fff4 100644 --- a/sdk/managedapplications/arm-managedapplications/test/snippets.spec.ts +++ b/sdk/managedapplications/arm-managedapplications/test/snippets.spec.ts @@ -1,15 +1,29 @@ +/* + * 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 { ApplicationClient } from "../src/index.js"; -import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; +import { + DefaultAzureCredential, + InteractiveBrowserCredential, +} from "@azure/identity"; import { setLogLevel } from "@azure/logger"; import { describe, it } from "vitest"; describe("snippets", () => { it("ReadmeSampleCreateClient_Node", async () => { const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new ApplicationClient(new DefaultAzureCredential(), subscriptionId); + const client = new ApplicationClient( + new DefaultAzureCredential(), + subscriptionId, + ); }); it("ReadmeSampleCreateClient_Browser", async () => { diff --git a/sdk/managedapplications/arm-managedapplications/tsconfig.browser.config.json b/sdk/managedapplications/arm-managedapplications/tsconfig.browser.config.json index 75871518e3a0..0c8bafa97126 100644 --- a/sdk/managedapplications/arm-managedapplications/tsconfig.browser.config.json +++ b/sdk/managedapplications/arm-managedapplications/tsconfig.browser.config.json @@ -1,3 +1,6 @@ { - "extends": ["./tsconfig.test.json", "../../../tsconfig.browser.base.json"] + "extends": [ + "./tsconfig.test.json", + "../../../tsconfig.browser.base.json" + ] } diff --git a/sdk/managedapplications/arm-managedapplications/tsconfig.json b/sdk/managedapplications/arm-managedapplications/tsconfig.json index 19ceb382b521..532c30c06f72 100644 --- a/sdk/managedapplications/arm-managedapplications/tsconfig.json +++ b/sdk/managedapplications/arm-managedapplications/tsconfig.json @@ -1,13 +1,32 @@ { - "references": [ - { - "path": "./tsconfig.src.json" - }, - { - "path": "./tsconfig.samples.json" - }, - { - "path": "./tsconfig.test.json" - } + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": [ + "es6", + "dom" + ], + "declaration": true, + "outDir": "./dist-esm", + "importHelpers": true + }, + "include": [ + "src/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts" + ], + "exclude": [ + "node_modules" ] -} +} \ No newline at end of file diff --git a/sdk/managedapplications/arm-managedapplications/tsconfig.samples.json b/sdk/managedapplications/arm-managedapplications/tsconfig.samples.json index ccb13ce76fa2..02c873150798 100644 --- a/sdk/managedapplications/arm-managedapplications/tsconfig.samples.json +++ b/sdk/managedapplications/arm-managedapplications/tsconfig.samples.json @@ -2,7 +2,9 @@ "extends": "../../../tsconfig.samples.base.json", "compilerOptions": { "paths": { - "@azure/arm-managedapplications": ["./dist/esm"] + "@azure/arm-managedapplications": [ + "./dist/esm" + ] } } } diff --git a/sdk/managedapplications/arm-managedapplications/tsconfig.test.json b/sdk/managedapplications/arm-managedapplications/tsconfig.test.json index 290ca214aebc..3c2b783a8c1b 100644 --- a/sdk/managedapplications/arm-managedapplications/tsconfig.test.json +++ b/sdk/managedapplications/arm-managedapplications/tsconfig.test.json @@ -1,3 +1,6 @@ { - "extends": ["./tsconfig.src.json", "../../../tsconfig.test.base.json"] + "extends": [ + "./tsconfig.src.json", + "../../../tsconfig.test.base.json" + ] } 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 2b1c9394c8fe..ebf50b704cbc 100644 --- a/sdk/policy/arm-policy/CHANGELOG.md +++ b/sdk/policy/arm-policy/CHANGELOG.md @@ -1,5 +1,147 @@ # Release History + +## 6.0.0 (2025-03-18) + +### Features Added + - Added operation group PolicyDefinitionVersions + - Added operation group PolicySetDefinitionVersions + - Added operation group PolicyTokens + - Added Interface ErrorDetail + - Added Interface ExternalEvaluationEndpointInvocationResult + - Added Interface ExternalEvaluationEndpointSettings + - Added Interface ExternalEvaluationEnforcementSettings + - Added Interface Override + - Added Interface PolicyDefinitionVersion + - Added Interface PolicyDefinitionVersionListResult + - Added Interface PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams + - Added Interface PolicyDefinitionVersionsCreateOrUpdateOptionalParams + - Added Interface PolicyDefinitionVersionsDeleteAtManagementGroupOptionalParams + - Added Interface PolicyDefinitionVersionsDeleteOptionalParams + - Added Interface PolicyDefinitionVersionsGetAtManagementGroupOptionalParams + - Added Interface PolicyDefinitionVersionsGetBuiltInOptionalParams + - Added Interface PolicyDefinitionVersionsGetOptionalParams + - Added Interface PolicyDefinitionVersionsListAllAtManagementGroupOptionalParams + - Added Interface PolicyDefinitionVersionsListAllBuiltinsOptionalParams + - Added Interface PolicyDefinitionVersionsListAllOptionalParams + - Added Interface PolicyDefinitionVersionsListBuiltInNextOptionalParams + - Added Interface PolicyDefinitionVersionsListBuiltInOptionalParams + - Added Interface PolicyDefinitionVersionsListByManagementGroupNextOptionalParams + - Added Interface PolicyDefinitionVersionsListByManagementGroupOptionalParams + - Added Interface PolicyDefinitionVersionsListNextOptionalParams + - Added Interface PolicyDefinitionVersionsListOptionalParams + - Added Interface PolicyLogInfo + - Added Interface PolicySetDefinitionVersion + - Added Interface PolicySetDefinitionVersionListResult + - Added Interface PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams + - Added Interface PolicySetDefinitionVersionsCreateOrUpdateOptionalParams + - Added Interface PolicySetDefinitionVersionsDeleteAtManagementGroupOptionalParams + - Added Interface PolicySetDefinitionVersionsDeleteOptionalParams + - Added Interface PolicySetDefinitionVersionsGetAtManagementGroupOptionalParams + - Added Interface PolicySetDefinitionVersionsGetBuiltInOptionalParams + - Added Interface PolicySetDefinitionVersionsGetOptionalParams + - Added Interface PolicySetDefinitionVersionsListAllAtManagementGroupOptionalParams + - Added Interface PolicySetDefinitionVersionsListAllBuiltinsOptionalParams + - Added Interface PolicySetDefinitionVersionsListAllOptionalParams + - Added Interface PolicySetDefinitionVersionsListBuiltInNextOptionalParams + - Added Interface PolicySetDefinitionVersionsListBuiltInOptionalParams + - Added Interface PolicySetDefinitionVersionsListByManagementGroupNextOptionalParams + - Added Interface PolicySetDefinitionVersionsListByManagementGroupOptionalParams + - Added Interface PolicySetDefinitionVersionsListNextOptionalParams + - Added Interface PolicySetDefinitionVersionsListOptionalParams + - Added Interface PolicyTokenOperation + - Added Interface PolicyTokenRequest + - Added Interface PolicyTokenResponse + - Added Interface PolicyTokensAcquireOptionalParams + - Added Interface ResourceSelector + - Added Interface Selector + - Added Type Alias AssignmentType + - Added Type Alias ExternalEndpointResult + - Added Type Alias OverrideKind + - Added Type Alias PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupResponse + - Added Type Alias PolicyDefinitionVersionsCreateOrUpdateResponse + - Added Type Alias PolicyDefinitionVersionsGetAtManagementGroupResponse + - Added Type Alias PolicyDefinitionVersionsGetBuiltInResponse + - Added Type Alias PolicyDefinitionVersionsGetResponse + - Added Type Alias PolicyDefinitionVersionsListAllAtManagementGroupResponse + - Added Type Alias PolicyDefinitionVersionsListAllBuiltinsResponse + - Added Type Alias PolicyDefinitionVersionsListAllResponse + - Added Type Alias PolicyDefinitionVersionsListBuiltInNextResponse + - Added Type Alias PolicyDefinitionVersionsListBuiltInResponse + - Added Type Alias PolicyDefinitionVersionsListByManagementGroupNextResponse + - Added Type Alias PolicyDefinitionVersionsListByManagementGroupResponse + - Added Type Alias PolicyDefinitionVersionsListNextResponse + - Added Type Alias PolicyDefinitionVersionsListResponse + - Added Type Alias PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupResponse + - Added Type Alias PolicySetDefinitionVersionsCreateOrUpdateResponse + - Added Type Alias PolicySetDefinitionVersionsGetAtManagementGroupResponse + - Added Type Alias PolicySetDefinitionVersionsGetBuiltInResponse + - Added Type Alias PolicySetDefinitionVersionsGetResponse + - Added Type Alias PolicySetDefinitionVersionsListAllAtManagementGroupResponse + - Added Type Alias PolicySetDefinitionVersionsListAllBuiltinsResponse + - Added Type Alias PolicySetDefinitionVersionsListAllResponse + - Added Type Alias PolicySetDefinitionVersionsListBuiltInNextResponse + - Added Type Alias PolicySetDefinitionVersionsListBuiltInResponse + - Added Type Alias PolicySetDefinitionVersionsListByManagementGroupNextResponse + - Added Type Alias PolicySetDefinitionVersionsListByManagementGroupResponse + - Added Type Alias PolicySetDefinitionVersionsListNextResponse + - Added Type Alias PolicySetDefinitionVersionsListResponse + - Added Type Alias PolicyTokenResult + - Added Type Alias PolicyTokensAcquireResponse + - Added Type Alias SelectorKind + - Interface ErrorResponse has a new optional parameter error + - Interface ParameterDefinitionsValue has a new optional parameter schema + - Interface PolicyAssignment has a new optional parameter assignmentType + - Interface PolicyAssignment has a new optional parameter definitionVersion + - Interface PolicyAssignment has a new optional parameter effectiveDefinitionVersion + - Interface PolicyAssignment has a new optional parameter instanceId + - Interface PolicyAssignment has a new optional parameter latestDefinitionVersion + - Interface PolicyAssignment has a new optional parameter overrides + - Interface PolicyAssignment has a new optional parameter resourceSelectors + - Interface PolicyAssignmentsGetOptionalParams has a new optional parameter expand + - Interface PolicyAssignmentsListForManagementGroupOptionalParams has a new optional parameter expand + - Interface PolicyAssignmentsListForResourceGroupOptionalParams has a new optional parameter expand + - Interface PolicyAssignmentsListForResourceOptionalParams has a new optional parameter expand + - Interface PolicyAssignmentsListOptionalParams has a new optional parameter expand + - Interface PolicyAssignmentUpdate has a new optional parameter overrides + - Interface PolicyAssignmentUpdate has a new optional parameter resourceSelectors + - Interface PolicyClientOptionalParams has a new optional parameter apiVersion + - Interface PolicyDefinition has a new optional parameter externalEvaluationEnforcementSettings + - Interface PolicyDefinition has a new optional parameter version + - Interface PolicyDefinition has a new optional parameter versions + - Interface PolicyDefinitionReference has a new optional parameter definitionVersion + - Interface PolicyDefinitionReference has a new optional parameter effectiveDefinitionVersion + - Interface PolicyDefinitionReference has a new optional parameter latestDefinitionVersion + - Interface PolicySetDefinition has a new optional parameter version + - Interface PolicySetDefinition has a new optional parameter versions + - Interface PolicySetDefinitionsGetAtManagementGroupOptionalParams has a new optional parameter expand + - Interface PolicySetDefinitionsGetBuiltInOptionalParams has a new optional parameter expand + - Interface PolicySetDefinitionsGetOptionalParams has a new optional parameter expand + - Interface PolicySetDefinitionsListBuiltInOptionalParams has a new optional parameter expand + - Interface PolicySetDefinitionsListByManagementGroupOptionalParams has a new optional parameter expand + - Interface PolicySetDefinitionsListOptionalParams has a new optional parameter expand + - Added Enum KnownAssignmentType + - Added Enum KnownExternalEndpointResult + - Added Enum KnownOverrideKind + - Added Enum KnownPolicyTokenResult + - Added Enum KnownSelectorKind + - Enum KnownEnforcementMode has a new value Enroll + +### Breaking Changes + + - Removed operation group DataPolicyManifests + - Removed operation group PolicyExemptions + - 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 + - Class PolicyClient no longer has parameter dataPolicyManifests + - Class PolicyClient no longer has parameter policyExemptions + - Removed Enum KnownAliasPathAttributes + - Removed Enum KnownAliasPathTokenType + - Removed Enum KnownExemptionCategory + ## 5.2.0-beta.1 (2025-01-13) ### Features Added diff --git a/sdk/policy/arm-policy/LICENSE b/sdk/policy/arm-policy/LICENSE index b2f52a2bad4e..63447fd8bbbf 100644 --- a/sdk/policy/arm-policy/LICENSE +++ b/sdk/policy/arm-policy/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/policy/arm-policy/README.md b/sdk/policy/arm-policy/README.md index ca65c1d30f98..c72dba445e5c 100644 --- a/sdk/policy/arm-policy/README.md +++ b/sdk/policy/arm-policy/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 Policy** 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 { 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); ``` ### 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,8 @@ 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) +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fpolicy%2Farm-policy%2FREADME.png) + [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/policy/arm-policy/_meta.json b/sdk/policy/arm-policy/_meta.json index 442878ad507b..31bf9062391b 100644 --- a/sdk/policy/arm-policy/_meta.json +++ b/sdk/policy/arm-policy/_meta.json @@ -1,8 +1,8 @@ { - "commit": "a42f1b58607091c4f255ead152a8ef323fa0b280", - "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", - "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" -} + "commit": "a3dcf1c9eb0324a1e4e9a12ec4655f54ba1f44f5", + "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/test-repo-billy/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.23", + "use": "@autorest/typescript@^6.0.12" +} \ No newline at end of file diff --git a/sdk/policy/arm-policy/api-extractor.json b/sdk/policy/arm-policy/api-extractor.json index f9e8c66c6d62..312311c56461 100644 --- a/sdk/policy/arm-policy/api-extractor.json +++ b/sdk/policy/arm-policy/api-extractor.json @@ -1,6 +1,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "dist/esm/index.d.ts", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", "docModel": { "enabled": true }, @@ -11,7 +11,7 @@ "dtsRollup": { "enabled": true, "untrimmedFilePath": "", - "publicTrimmedFilePath": "dist/arm-policy.d.ts" + "publicTrimmedFilePath": "./types/arm-policy.d.ts" }, "messages": { "tsdocMessageReporting": { @@ -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 5d6ceb3d9e86..5e9011f53e0e 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": "5.2.0-beta.1", + "version": "6.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": [ @@ -19,30 +21,31 @@ "azure", "typescript", "browser", - "isomorphic", - "cloud" + "isomorphic" ], "license": "MIT", "main": "./dist/commonjs/index.js", - "module": "./dist/esm/index.js", + "module": "./dist-esm/src/index.js", "types": "./dist/commonjs/index.d.ts", "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-managementgroups": "^2.0.1", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.7.0", + "@azure/identity": "^4.8.0", "@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", - "typescript": "~5.8.2", + "playwright": "^1.51.1", + "typescript": "~5.6.2", "vitest": "^3.0.9" }, - "repository": "github:Azure/azure-sdk-for-js", + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, @@ -90,14 +93,6 @@ }, "autoPublish": true, "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" - }, "type": "module", "tshy": { "project": "./tsconfig.src.json", @@ -138,4 +133,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 906abdb54c43..567ad12b3885 100644 --- a/sdk/policy/arm-policy/review/arm-policy.api.md +++ b/sdk/policy/arm-policy/review/arm-policy.api.md @@ -6,143 +6,66 @@ import * as coreAuth from '@azure/core-auth'; import * as coreClient from '@azure/core-client'; +import { OperationState } from '@azure/core-lro'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { SimplePollerLike } from '@azure/core-lro'; // @public -export interface Alias { - readonly defaultMetadata?: AliasPathMetadata; - defaultPath?: string; - defaultPattern?: AliasPattern; - name?: string; - paths?: AliasPath[]; - type?: AliasType; -} - -// @public -export interface AliasPath { - apiVersions?: string[]; - readonly metadata?: AliasPathMetadata; - path?: string; - pattern?: AliasPattern; -} - -// @public -export type AliasPathAttributes = string; - -// @public (undocumented) -export interface AliasPathMetadata { - readonly attributes?: AliasPathAttributes; - readonly type?: AliasPathTokenType; -} - -// @public -export type AliasPathTokenType = string; - -// @public -export interface AliasPattern { - phrase?: string; - type?: AliasPatternType; - variable?: string; -} - -// @public -export type AliasPatternType = "NotSpecified" | "Extract"; - -// @public -export type AliasType = "NotSpecified" | "PlainText" | "Mask"; - -// @public -export interface CloudError { - error?: ErrorResponse; -} +export type AssignmentType = string; // @public export type CreatedByType = string; // @public -export interface DataEffect { - detailsSchema?: any; - name?: string; -} - -// @public -export interface DataManifestCustomResourceFunctionDefinition { - allowCustomProperties?: boolean; - defaultProperties?: string[]; - fullyQualifiedResourceType?: string; - name?: string; -} +export type EnforcementMode = string; // @public -export interface DataPolicyManifest { - custom?: DataManifestCustomResourceFunctionDefinition[]; - effects?: DataEffect[]; - fieldValues?: string[]; - readonly id?: string; - isBuiltInOnly?: boolean; - readonly name?: string; - namespaces?: string[]; - policyMode?: string; - resourceTypeAliases?: ResourceTypeAliases[]; - standard?: string[]; +export interface ErrorAdditionalInfo { + readonly info?: any; readonly type?: string; } // @public -export interface DataPolicyManifestListResult { - nextLink?: string; - value?: DataPolicyManifest[]; -} - -// @public -export interface DataPolicyManifests { - getByPolicyMode(policyMode: string, options?: DataPolicyManifestsGetByPolicyModeOptionalParams): Promise; - list(options?: DataPolicyManifestsListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface DataPolicyManifestsGetByPolicyModeOptionalParams extends coreClient.OperationOptions { +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; } // @public -export type DataPolicyManifestsGetByPolicyModeResponse = DataPolicyManifest; - -// @public -export interface DataPolicyManifestsListNextOptionalParams extends coreClient.OperationOptions { +export interface ErrorResponse { + error?: ErrorDetail; } // @public -export type DataPolicyManifestsListNextResponse = DataPolicyManifestListResult; +export type ExternalEndpointResult = string; // @public -export interface DataPolicyManifestsListOptionalParams extends coreClient.OperationOptions { - filter?: string; +export interface ExternalEvaluationEndpointInvocationResult { + claims?: any; + expiration?: Date; + message?: string; + policyInfo?: PolicyLogInfo; + result?: ExternalEndpointResult; + retryAfter?: Date; } // @public -export type DataPolicyManifestsListResponse = DataPolicyManifestListResult; - -// @public -export type EnforcementMode = string; - -// @public -export interface ErrorAdditionalInfo { - readonly info?: any; - readonly type?: string; +export interface ExternalEvaluationEndpointSettings { + details?: any; + kind?: string; } // @public -export interface ErrorResponse { - readonly additionalInfo?: ErrorAdditionalInfo[]; - readonly code?: string; - readonly details?: ErrorResponse[]; - readonly message?: string; - readonly target?: string; +export interface ExternalEvaluationEnforcementSettings { + endpointSettings?: ExternalEvaluationEndpointSettings; + missingTokenAction?: string; + resultLifespan?: string; + roleDefinitionIds?: string[]; } -// @public -export type ExemptionCategory = string; - // @public export function getContinuationToken(page: unknown): string | undefined; @@ -157,21 +80,11 @@ export interface Identity { } // @public -export enum KnownAliasPathAttributes { - Modifiable = "Modifiable", - None = "None" -} - -// @public -export enum KnownAliasPathTokenType { - Any = "Any", - Array = "Array", - Boolean = "Boolean", - Integer = "Integer", +export enum KnownAssignmentType { + Custom = "Custom", NotSpecified = "NotSpecified", - Number = "Number", - Object = "Object", - String = "String" + System = "System", + SystemHidden = "SystemHidden" } // @public @@ -185,13 +98,20 @@ export enum KnownCreatedByType { // @public export enum KnownEnforcementMode { Default = "Default", - DoNotEnforce = "DoNotEnforce" + DoNotEnforce = "DoNotEnforce", + Enroll = "Enroll" } // @public -export enum KnownExemptionCategory { - Mitigated = "Mitigated", - Waiver = "Waiver" +export enum KnownExternalEndpointResult { + Failed = "Failed", + Succeeded = "Succeeded" +} + +// @public +export enum KnownOverrideKind { + DefinitionVersion = "definitionVersion", + PolicyEffect = "policyEffect" } // @public @@ -205,6 +125,12 @@ export enum KnownParameterType { String = "String" } +// @public +export enum KnownPolicyTokenResult { + Failed = "Failed", + Succeeded = "Succeeded" +} + // @public export enum KnownPolicyType { BuiltIn = "BuiltIn", @@ -213,17 +139,36 @@ export enum KnownPolicyType { Static = "Static" } +// @public +export enum KnownSelectorKind { + PolicyDefinitionReferenceId = "policyDefinitionReferenceId", + ResourceLocation = "resourceLocation", + ResourceType = "resourceType", + ResourceWithoutLocation = "resourceWithoutLocation" +} + // @public export interface NonComplianceMessage { message: string; policyDefinitionReferenceId?: string; } +// @public +export interface Override { + kind?: OverrideKind; + selectors?: Selector[]; + value?: string; +} + +// @public +export type OverrideKind = string; + // @public export interface ParameterDefinitionsValue { allowedValues?: any[]; defaultValue?: any; metadata?: ParameterDefinitionsValueMetadata; + schema?: any; type?: ParameterType; } @@ -246,20 +191,27 @@ export interface ParameterValuesValue { // @public export interface PolicyAssignment { + assignmentType?: AssignmentType; + definitionVersion?: string; description?: string; displayName?: string; + readonly effectiveDefinitionVersion?: string; enforcementMode?: EnforcementMode; readonly id?: string; identity?: Identity; + readonly instanceId?: string; + readonly latestDefinitionVersion?: string; location?: string; metadata?: any; readonly name?: string; nonComplianceMessages?: NonComplianceMessage[]; notScopes?: string[]; + overrides?: Override[]; parameters?: { [propertyName: string]: ParameterValuesValue; }; policyDefinitionId?: string; + resourceSelectors?: ResourceSelector[]; readonly scope?: string; readonly systemData?: SystemData; readonly type?: string; @@ -324,6 +276,7 @@ export type PolicyAssignmentsGetByIdResponse = PolicyAssignment; // @public export interface PolicyAssignmentsGetOptionalParams extends coreClient.OperationOptions { + expand?: string; } // @public @@ -338,6 +291,7 @@ export type PolicyAssignmentsListForManagementGroupNextResponse = PolicyAssignme // @public export interface PolicyAssignmentsListForManagementGroupOptionalParams extends coreClient.OperationOptions { + expand?: string; filter?: string; top?: number; } @@ -354,6 +308,7 @@ export type PolicyAssignmentsListForResourceGroupNextResponse = PolicyAssignment // @public export interface PolicyAssignmentsListForResourceGroupOptionalParams extends coreClient.OperationOptions { + expand?: string; filter?: string; top?: number; } @@ -370,6 +325,7 @@ export type PolicyAssignmentsListForResourceNextResponse = PolicyAssignmentListR // @public export interface PolicyAssignmentsListForResourceOptionalParams extends coreClient.OperationOptions { + expand?: string; filter?: string; top?: number; } @@ -386,6 +342,7 @@ export type PolicyAssignmentsListNextResponse = PolicyAssignmentListResult; // @public export interface PolicyAssignmentsListOptionalParams extends coreClient.OperationOptions { + expand?: string; filter?: string; top?: number; } @@ -407,10 +364,12 @@ export interface PolicyAssignmentsUpdateOptionalParams extends coreClient.Operat // @public export type PolicyAssignmentsUpdateResponse = PolicyAssignment; -// @public (undocumented) +// @public export interface PolicyAssignmentUpdate { identity?: Identity; location?: string; + overrides?: Override[]; + resourceSelectors?: ResourceSelector[]; } // @public (undocumented) @@ -420,22 +379,27 @@ export class PolicyClient extends coreClient.ServiceClient { constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: PolicyClientOptionalParams); constructor(credentials: coreAuth.TokenCredential, options?: PolicyClientOptionalParams); // (undocumented) - dataPolicyManifests: DataPolicyManifests; + apiVersion: string; // (undocumented) policyAssignments: PolicyAssignments; // (undocumented) policyDefinitions: PolicyDefinitions; // (undocumented) - policyExemptions: PolicyExemptions; + policyDefinitionVersions: PolicyDefinitionVersions; // (undocumented) policySetDefinitions: PolicySetDefinitions; // (undocumented) + policySetDefinitionVersions: PolicySetDefinitionVersions; + // (undocumented) + policyTokens: PolicyTokens; + // (undocumented) subscriptionId?: string; } // @public export interface PolicyClientOptionalParams extends coreClient.ServiceClientOptions { $host?: string; + apiVersion?: string; endpoint?: string; } @@ -443,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; @@ -454,6 +419,8 @@ export interface PolicyDefinition { policyType?: PolicyType; readonly systemData?: SystemData; readonly type?: string; + version?: string; + versions?: string[]; } // @public @@ -473,7 +440,10 @@ export interface PolicyDefinitionListResult { // @public export interface PolicyDefinitionReference { + definitionVersion?: string; + readonly effectiveDefinitionVersion?: string; groupNames?: string[]; + readonly latestDefinitionVersion?: string; parameters?: { [propertyName: string]: ParameterValuesValue; }; @@ -484,11 +454,11 @@ export interface PolicyDefinitionReference { // @public export interface PolicyDefinitions { createOrUpdate(policyDefinitionName: string, parameters: PolicyDefinition, options?: PolicyDefinitionsCreateOrUpdateOptionalParams): Promise; - createOrUpdateAtManagementGroup(policyDefinitionName: string, managementGroupId: string, parameters: PolicyDefinition, options?: PolicyDefinitionsCreateOrUpdateAtManagementGroupOptionalParams): Promise; + createOrUpdateAtManagementGroup(managementGroupId: string, policyDefinitionName: string, parameters: PolicyDefinition, options?: PolicyDefinitionsCreateOrUpdateAtManagementGroupOptionalParams): Promise; delete(policyDefinitionName: string, options?: PolicyDefinitionsDeleteOptionalParams): Promise; - deleteAtManagementGroup(policyDefinitionName: string, managementGroupId: string, options?: PolicyDefinitionsDeleteAtManagementGroupOptionalParams): Promise; + deleteAtManagementGroup(managementGroupId: string, policyDefinitionName: string, options?: PolicyDefinitionsDeleteAtManagementGroupOptionalParams): Promise; get(policyDefinitionName: string, options?: PolicyDefinitionsGetOptionalParams): Promise; - getAtManagementGroup(policyDefinitionName: string, managementGroupId: string, options?: PolicyDefinitionsGetAtManagementGroupOptionalParams): Promise; + getAtManagementGroup(managementGroupId: string, policyDefinitionName: string, options?: PolicyDefinitionsGetAtManagementGroupOptionalParams): Promise; getBuiltIn(policyDefinitionName: string, options?: PolicyDefinitionsGetBuiltInOptionalParams): Promise; list(options?: PolicyDefinitionsListOptionalParams): PagedAsyncIterableIterator; listBuiltIn(options?: PolicyDefinitionsListBuiltInOptionalParams): PagedAsyncIterableIterator; @@ -587,114 +557,180 @@ export interface PolicyDefinitionsListOptionalParams extends coreClient.Operatio export type PolicyDefinitionsListResponse = PolicyDefinitionListResult; // @public -export interface PolicyExemption { +export interface PolicyDefinitionVersion { description?: string; displayName?: string; - exemptionCategory: ExemptionCategory; - expiresOn?: Date; + externalEvaluationEnforcementSettings?: ExternalEvaluationEnforcementSettings; readonly id?: string; metadata?: any; + mode?: string; readonly name?: string; - policyAssignmentId: string; - policyDefinitionReferenceIds?: string[]; + parameters?: { + [propertyName: string]: ParameterDefinitionsValue; + }; + policyRule?: any; + policyType?: PolicyType; readonly systemData?: SystemData; readonly type?: string; + version?: string; } // @public -export interface PolicyExemptionListResult { - readonly nextLink?: string; - value?: PolicyExemption[]; +export interface PolicyDefinitionVersionListResult { + nextLink?: string; + value?: PolicyDefinitionVersion[]; } // @public -export interface PolicyExemptions { - createOrUpdate(scope: string, policyExemptionName: string, parameters: PolicyExemption, options?: PolicyExemptionsCreateOrUpdateOptionalParams): Promise; - delete(scope: string, policyExemptionName: string, options?: PolicyExemptionsDeleteOptionalParams): Promise; - get(scope: string, policyExemptionName: string, options?: PolicyExemptionsGetOptionalParams): Promise; - list(options?: PolicyExemptionsListOptionalParams): PagedAsyncIterableIterator; - listForManagementGroup(managementGroupId: string, options?: PolicyExemptionsListForManagementGroupOptionalParams): PagedAsyncIterableIterator; - listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: PolicyExemptionsListForResourceOptionalParams): PagedAsyncIterableIterator; - listForResourceGroup(resourceGroupName: string, options?: PolicyExemptionsListForResourceGroupOptionalParams): PagedAsyncIterableIterator; +export interface PolicyDefinitionVersions { + createOrUpdate(policyDefinitionName: string, policyDefinitionVersion: string, parameters: PolicyDefinitionVersion, options?: PolicyDefinitionVersionsCreateOrUpdateOptionalParams): Promise; + createOrUpdateAtManagementGroup(managementGroupName: string, policyDefinitionName: string, policyDefinitionVersion: string, parameters: PolicyDefinitionVersion, options?: PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams): Promise; + delete(policyDefinitionName: string, policyDefinitionVersion: string, options?: PolicyDefinitionVersionsDeleteOptionalParams): Promise; + deleteAtManagementGroup(managementGroupName: string, policyDefinitionName: string, policyDefinitionVersion: string, options?: PolicyDefinitionVersionsDeleteAtManagementGroupOptionalParams): Promise; + get(policyDefinitionName: string, policyDefinitionVersion: string, options?: PolicyDefinitionVersionsGetOptionalParams): Promise; + getAtManagementGroup(managementGroupName: string, policyDefinitionName: string, policyDefinitionVersion: string, options?: PolicyDefinitionVersionsGetAtManagementGroupOptionalParams): Promise; + getBuiltIn(policyDefinitionName: string, policyDefinitionVersion: string, options?: PolicyDefinitionVersionsGetBuiltInOptionalParams): Promise; + list(policyDefinitionName: string, options?: PolicyDefinitionVersionsListOptionalParams): PagedAsyncIterableIterator; + listAll(options?: PolicyDefinitionVersionsListAllOptionalParams): Promise; + listAllAtManagementGroup(managementGroupName: string, options?: PolicyDefinitionVersionsListAllAtManagementGroupOptionalParams): Promise; + listAllBuiltins(options?: PolicyDefinitionVersionsListAllBuiltinsOptionalParams): Promise; + listBuiltIn(policyDefinitionName: string, options?: PolicyDefinitionVersionsListBuiltInOptionalParams): PagedAsyncIterableIterator; + listByManagementGroup(managementGroupName: string, policyDefinitionName: string, options?: PolicyDefinitionVersionsListByManagementGroupOptionalParams): PagedAsyncIterableIterator; } // @public -export interface PolicyExemptionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +export interface PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams extends coreClient.OperationOptions { } // @public -export type PolicyExemptionsCreateOrUpdateResponse = PolicyExemption; +export type PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupResponse = PolicyDefinitionVersion; // @public -export interface PolicyExemptionsDeleteOptionalParams extends coreClient.OperationOptions { +export interface PolicyDefinitionVersionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { } // @public -export interface PolicyExemptionsGetOptionalParams extends coreClient.OperationOptions { +export type PolicyDefinitionVersionsCreateOrUpdateResponse = PolicyDefinitionVersion; + +// @public +export interface PolicyDefinitionVersionsDeleteAtManagementGroupOptionalParams extends coreClient.OperationOptions { } // @public -export type PolicyExemptionsGetResponse = PolicyExemption; +export interface PolicyDefinitionVersionsDeleteOptionalParams extends coreClient.OperationOptions { +} // @public -export interface PolicyExemptionsListForManagementGroupNextOptionalParams extends coreClient.OperationOptions { +export interface PolicyDefinitionVersionsGetAtManagementGroupOptionalParams extends coreClient.OperationOptions { } // @public -export type PolicyExemptionsListForManagementGroupNextResponse = PolicyExemptionListResult; +export type PolicyDefinitionVersionsGetAtManagementGroupResponse = PolicyDefinitionVersion; // @public -export interface PolicyExemptionsListForManagementGroupOptionalParams extends coreClient.OperationOptions { - filter?: string; +export interface PolicyDefinitionVersionsGetBuiltInOptionalParams extends coreClient.OperationOptions { } // @public -export type PolicyExemptionsListForManagementGroupResponse = PolicyExemptionListResult; +export type PolicyDefinitionVersionsGetBuiltInResponse = PolicyDefinitionVersion; // @public -export interface PolicyExemptionsListForResourceGroupNextOptionalParams extends coreClient.OperationOptions { +export interface PolicyDefinitionVersionsGetOptionalParams extends coreClient.OperationOptions { } // @public -export type PolicyExemptionsListForResourceGroupNextResponse = PolicyExemptionListResult; +export type PolicyDefinitionVersionsGetResponse = PolicyDefinitionVersion; // @public -export interface PolicyExemptionsListForResourceGroupOptionalParams extends coreClient.OperationOptions { - filter?: string; +export interface PolicyDefinitionVersionsListAllAtManagementGroupOptionalParams extends coreClient.OperationOptions { } // @public -export type PolicyExemptionsListForResourceGroupResponse = PolicyExemptionListResult; +export type PolicyDefinitionVersionsListAllAtManagementGroupResponse = PolicyDefinitionVersionListResult; // @public -export interface PolicyExemptionsListForResourceNextOptionalParams extends coreClient.OperationOptions { +export interface PolicyDefinitionVersionsListAllBuiltinsOptionalParams extends coreClient.OperationOptions { } // @public -export type PolicyExemptionsListForResourceNextResponse = PolicyExemptionListResult; +export type PolicyDefinitionVersionsListAllBuiltinsResponse = PolicyDefinitionVersionListResult; // @public -export interface PolicyExemptionsListForResourceOptionalParams extends coreClient.OperationOptions { - filter?: string; +export interface PolicyDefinitionVersionsListAllOptionalParams extends coreClient.OperationOptions { } // @public -export type PolicyExemptionsListForResourceResponse = PolicyExemptionListResult; +export type PolicyDefinitionVersionsListAllResponse = PolicyDefinitionVersionListResult; // @public -export interface PolicyExemptionsListNextOptionalParams extends coreClient.OperationOptions { +export interface PolicyDefinitionVersionsListBuiltInNextOptionalParams extends coreClient.OperationOptions { } // @public -export type PolicyExemptionsListNextResponse = PolicyExemptionListResult; +export type PolicyDefinitionVersionsListBuiltInNextResponse = PolicyDefinitionVersionListResult; // @public -export interface PolicyExemptionsListOptionalParams extends coreClient.OperationOptions { - filter?: string; +export interface PolicyDefinitionVersionsListBuiltInOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type PolicyDefinitionVersionsListBuiltInResponse = PolicyDefinitionVersionListResult; + +// @public +export interface PolicyDefinitionVersionsListByManagementGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PolicyDefinitionVersionsListByManagementGroupNextResponse = PolicyDefinitionVersionListResult; + +// @public +export interface PolicyDefinitionVersionsListByManagementGroupOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type PolicyDefinitionVersionsListByManagementGroupResponse = PolicyDefinitionVersionListResult; + +// @public +export interface PolicyDefinitionVersionsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PolicyDefinitionVersionsListNextResponse = PolicyDefinitionVersionListResult; + +// @public +export interface PolicyDefinitionVersionsListOptionalParams extends coreClient.OperationOptions { + top?: number; } // @public -export type PolicyExemptionsListResponse = PolicyExemptionListResult; +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 { @@ -711,6 +747,8 @@ export interface PolicySetDefinition { policyType?: PolicyType; readonly systemData?: SystemData; readonly type?: string; + version?: string; + versions?: string[]; } // @public @@ -722,11 +760,11 @@ export interface PolicySetDefinitionListResult { // @public export interface PolicySetDefinitions { createOrUpdate(policySetDefinitionName: string, parameters: PolicySetDefinition, options?: PolicySetDefinitionsCreateOrUpdateOptionalParams): Promise; - createOrUpdateAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, parameters: PolicySetDefinition, options?: PolicySetDefinitionsCreateOrUpdateAtManagementGroupOptionalParams): Promise; + createOrUpdateAtManagementGroup(managementGroupId: string, policySetDefinitionName: string, parameters: PolicySetDefinition, options?: PolicySetDefinitionsCreateOrUpdateAtManagementGroupOptionalParams): Promise; delete(policySetDefinitionName: string, options?: PolicySetDefinitionsDeleteOptionalParams): Promise; - deleteAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, options?: PolicySetDefinitionsDeleteAtManagementGroupOptionalParams): Promise; + deleteAtManagementGroup(managementGroupId: string, policySetDefinitionName: string, options?: PolicySetDefinitionsDeleteAtManagementGroupOptionalParams): Promise; get(policySetDefinitionName: string, options?: PolicySetDefinitionsGetOptionalParams): Promise; - getAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, options?: PolicySetDefinitionsGetAtManagementGroupOptionalParams): Promise; + getAtManagementGroup(managementGroupId: string, policySetDefinitionName: string, options?: PolicySetDefinitionsGetAtManagementGroupOptionalParams): Promise; getBuiltIn(policySetDefinitionName: string, options?: PolicySetDefinitionsGetBuiltInOptionalParams): Promise; list(options?: PolicySetDefinitionsListOptionalParams): PagedAsyncIterableIterator; listBuiltIn(options?: PolicySetDefinitionsListBuiltInOptionalParams): PagedAsyncIterableIterator; @@ -757,6 +795,7 @@ export interface PolicySetDefinitionsDeleteOptionalParams extends coreClient.Ope // @public export interface PolicySetDefinitionsGetAtManagementGroupOptionalParams extends coreClient.OperationOptions { + expand?: string; } // @public @@ -764,6 +803,7 @@ export type PolicySetDefinitionsGetAtManagementGroupResponse = PolicySetDefiniti // @public export interface PolicySetDefinitionsGetBuiltInOptionalParams extends coreClient.OperationOptions { + expand?: string; } // @public @@ -771,6 +811,7 @@ export type PolicySetDefinitionsGetBuiltInResponse = PolicySetDefinition; // @public export interface PolicySetDefinitionsGetOptionalParams extends coreClient.OperationOptions { + expand?: string; } // @public @@ -785,6 +826,7 @@ export type PolicySetDefinitionsListBuiltInNextResponse = PolicySetDefinitionLis // @public export interface PolicySetDefinitionsListBuiltInOptionalParams extends coreClient.OperationOptions { + expand?: string; filter?: string; top?: number; } @@ -801,6 +843,7 @@ export type PolicySetDefinitionsListByManagementGroupNextResponse = PolicySetDef // @public export interface PolicySetDefinitionsListByManagementGroupOptionalParams extends coreClient.OperationOptions { + expand?: string; filter?: string; top?: number; } @@ -817,6 +860,7 @@ export type PolicySetDefinitionsListNextResponse = PolicySetDefinitionListResult // @public export interface PolicySetDefinitionsListOptionalParams extends coreClient.OperationOptions { + expand?: string; filter?: string; top?: number; } @@ -824,6 +868,205 @@ export interface PolicySetDefinitionsListOptionalParams extends coreClient.Opera // @public export type PolicySetDefinitionsListResponse = PolicySetDefinitionListResult; +// @public +export interface PolicySetDefinitionVersion { + description?: string; + displayName?: string; + readonly id?: string; + metadata?: any; + readonly name?: string; + parameters?: { + [propertyName: string]: ParameterDefinitionsValue; + }; + policyDefinitionGroups?: PolicyDefinitionGroup[]; + policyDefinitions?: PolicyDefinitionReference[]; + policyType?: PolicyType; + readonly systemData?: SystemData; + readonly type?: string; + version?: string; +} + +// @public +export interface PolicySetDefinitionVersionListResult { + nextLink?: string; + value?: PolicySetDefinitionVersion[]; +} + +// @public +export interface PolicySetDefinitionVersions { + createOrUpdate(policySetDefinitionName: string, policyDefinitionVersion: string, parameters: PolicySetDefinitionVersion, options?: PolicySetDefinitionVersionsCreateOrUpdateOptionalParams): Promise; + createOrUpdateAtManagementGroup(managementGroupName: string, policySetDefinitionName: string, policyDefinitionVersion: string, parameters: PolicySetDefinitionVersion, options?: PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams): Promise; + delete(policySetDefinitionName: string, policyDefinitionVersion: string, options?: PolicySetDefinitionVersionsDeleteOptionalParams): Promise; + deleteAtManagementGroup(managementGroupName: string, policySetDefinitionName: string, policyDefinitionVersion: string, options?: PolicySetDefinitionVersionsDeleteAtManagementGroupOptionalParams): Promise; + get(policySetDefinitionName: string, policyDefinitionVersion: string, options?: PolicySetDefinitionVersionsGetOptionalParams): Promise; + getAtManagementGroup(managementGroupName: string, policySetDefinitionName: string, policyDefinitionVersion: string, options?: PolicySetDefinitionVersionsGetAtManagementGroupOptionalParams): Promise; + getBuiltIn(policySetDefinitionName: string, policyDefinitionVersion: string, options?: PolicySetDefinitionVersionsGetBuiltInOptionalParams): Promise; + list(policySetDefinitionName: string, options?: PolicySetDefinitionVersionsListOptionalParams): PagedAsyncIterableIterator; + listAll(options?: PolicySetDefinitionVersionsListAllOptionalParams): Promise; + listAllAtManagementGroup(managementGroupName: string, options?: PolicySetDefinitionVersionsListAllAtManagementGroupOptionalParams): Promise; + listAllBuiltins(options?: PolicySetDefinitionVersionsListAllBuiltinsOptionalParams): Promise; + listBuiltIn(policySetDefinitionName: string, options?: PolicySetDefinitionVersionsListBuiltInOptionalParams): PagedAsyncIterableIterator; + listByManagementGroup(managementGroupName: string, policySetDefinitionName: string, options?: PolicySetDefinitionVersionsListByManagementGroupOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupResponse = PolicySetDefinitionVersion; + +// @public +export interface PolicySetDefinitionVersionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PolicySetDefinitionVersionsCreateOrUpdateResponse = PolicySetDefinitionVersion; + +// @public +export interface PolicySetDefinitionVersionsDeleteAtManagementGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface PolicySetDefinitionVersionsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface PolicySetDefinitionVersionsGetAtManagementGroupOptionalParams extends coreClient.OperationOptions { + expand?: string; +} + +// @public +export type PolicySetDefinitionVersionsGetAtManagementGroupResponse = PolicySetDefinitionVersion; + +// @public +export interface PolicySetDefinitionVersionsGetBuiltInOptionalParams extends coreClient.OperationOptions { + expand?: string; +} + +// @public +export type PolicySetDefinitionVersionsGetBuiltInResponse = PolicySetDefinitionVersion; + +// @public +export interface PolicySetDefinitionVersionsGetOptionalParams extends coreClient.OperationOptions { + expand?: string; +} + +// @public +export type PolicySetDefinitionVersionsGetResponse = PolicySetDefinitionVersion; + +// @public +export interface PolicySetDefinitionVersionsListAllAtManagementGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PolicySetDefinitionVersionsListAllAtManagementGroupResponse = PolicySetDefinitionVersionListResult; + +// @public +export interface PolicySetDefinitionVersionsListAllBuiltinsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PolicySetDefinitionVersionsListAllBuiltinsResponse = PolicySetDefinitionVersionListResult; + +// @public +export interface PolicySetDefinitionVersionsListAllOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PolicySetDefinitionVersionsListAllResponse = PolicySetDefinitionVersionListResult; + +// @public +export interface PolicySetDefinitionVersionsListBuiltInNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PolicySetDefinitionVersionsListBuiltInNextResponse = PolicySetDefinitionVersionListResult; + +// @public +export interface PolicySetDefinitionVersionsListBuiltInOptionalParams extends coreClient.OperationOptions { + expand?: string; + top?: number; +} + +// @public +export type PolicySetDefinitionVersionsListBuiltInResponse = PolicySetDefinitionVersionListResult; + +// @public +export interface PolicySetDefinitionVersionsListByManagementGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PolicySetDefinitionVersionsListByManagementGroupNextResponse = PolicySetDefinitionVersionListResult; + +// @public +export interface PolicySetDefinitionVersionsListByManagementGroupOptionalParams extends coreClient.OperationOptions { + expand?: string; + top?: number; +} + +// @public +export type PolicySetDefinitionVersionsListByManagementGroupResponse = PolicySetDefinitionVersionListResult; + +// @public +export interface PolicySetDefinitionVersionsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PolicySetDefinitionVersionsListNextResponse = PolicySetDefinitionVersionListResult; + +// @public +export interface PolicySetDefinitionVersionsListOptionalParams extends coreClient.OperationOptions { + expand?: string; + top?: number; +} + +// @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; @@ -831,11 +1074,21 @@ export type PolicyType = string; export type ResourceIdentityType = "SystemAssigned" | "UserAssigned" | "None"; // @public -export interface ResourceTypeAliases { - aliases?: Alias[]; - resourceType?: string; +export interface ResourceSelector { + name?: string; + selectors?: Selector[]; +} + +// @public +export interface Selector { + in?: string[]; + kind?: SelectorKind; + notIn?: string[]; } +// @public +export type SelectorKind = string; + // @public export interface SystemData { createdAt?: Date; diff --git a/sdk/policy/arm-policy/sample.env b/sdk/policy/arm-policy/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/policy/arm-policy/sample.env +++ b/sdk/policy/arm-policy/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/policy/arm-policy/src/lroImpl.ts b/sdk/policy/arm-policy/src/lroImpl.ts new file mode 100644 index 000000000000..5f88efab981b --- /dev/null +++ b/sdk/policy/arm-policy/src/lroImpl.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AbortSignalLike } from "@azure/abort-controller"; +import { 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 43f12f588453..4719c1e7cf7b 100644 --- a/sdk/policy/arm-policy/src/models/index.ts +++ b/sdk/policy/arm-policy/src/models/index.ts @@ -8,183 +8,6 @@ import * as coreClient from "@azure/core-client"; -/** The data policy manifest. */ -export interface DataPolicyManifest { - /** - * The ID of the data policy manifest. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * The name of the data policy manifest (it's the same as the Policy Mode). - * 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/dataPolicyManifests). - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** The list of namespaces for the data policy manifest. */ - namespaces?: string[]; - /** The policy mode of the data policy manifest. */ - policyMode?: string; - /** A value indicating whether policy mode is allowed only in built-in definitions. */ - isBuiltInOnly?: boolean; - /** An array of resource type aliases. */ - resourceTypeAliases?: ResourceTypeAliases[]; - /** The effect definition. */ - effects?: DataEffect[]; - /** The non-alias field accessor values that can be used in the policy rule. */ - fieldValues?: string[]; - /** The standard resource functions (subscription and/or resourceGroup). */ - standard?: string[]; - /** An array of data manifest custom resource definition. */ - custom?: DataManifestCustomResourceFunctionDefinition[]; -} - -/** The resource type aliases definition. */ -export interface ResourceTypeAliases { - /** The resource type name. */ - resourceType?: string; - /** The aliases for property names. */ - aliases?: Alias[]; -} - -/** The alias type. */ -export interface Alias { - /** The alias name. */ - name?: string; - /** The paths for an alias. */ - paths?: AliasPath[]; - /** The type of the alias. */ - type?: AliasType; - /** The default path for an alias. */ - defaultPath?: string; - /** The default pattern for an alias. */ - defaultPattern?: AliasPattern; - /** - * The default alias path metadata. Applies to the default path and to any alias path that doesn't have metadata - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly defaultMetadata?: AliasPathMetadata; -} - -/** The type of the paths for alias. */ -export interface AliasPath { - /** The path of an alias. */ - path?: string; - /** The API versions. */ - apiVersions?: string[]; - /** The pattern for an alias path. */ - pattern?: AliasPattern; - /** - * The metadata of the alias path. If missing, fall back to the default metadata of the alias. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly metadata?: AliasPathMetadata; -} - -/** The type of the pattern for an alias path. */ -export interface AliasPattern { - /** The alias pattern phrase. */ - phrase?: string; - /** The alias pattern variable. */ - variable?: string; - /** The type of alias pattern */ - type?: AliasPatternType; -} - -export interface AliasPathMetadata { - /** - * The type of the token that the alias path is referring to. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: AliasPathTokenType; - /** - * The attributes of the token that the alias path is referring to. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly attributes?: AliasPathAttributes; -} - -/** The data effect definition. */ -export interface DataEffect { - /** The data effect name. */ - name?: string; - /** The data effect details schema. */ - detailsSchema?: any; -} - -/** The custom resource function definition. */ -export interface DataManifestCustomResourceFunctionDefinition { - /** The function name as it will appear in the policy rule. eg - 'vault'. */ - name?: string; - /** The fully qualified control plane resource type that this function represents. eg - 'Microsoft.KeyVault/vaults'. */ - fullyQualifiedResourceType?: string; - /** The top-level properties that can be selected on the function's output. eg - [ "name", "location" ] if vault().name and vault().location are supported */ - defaultProperties?: string[]; - /** A value indicating whether the custom properties within the property bag are allowed. Needs api-version to be specified in the policy rule eg - vault('2019-06-01'). */ - allowCustomProperties?: boolean; -} - -/** 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 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?: ErrorResponse[]; - /** - * 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?: any; -} - -/** List of data policy manifests. */ -export interface DataPolicyManifestListResult { - /** An array of data policy manifests. */ - value?: DataPolicyManifest[]; - /** The URL to use for getting the next set of results. */ - nextLink?: string; -} - /** The policy assignment. */ export interface PolicyAssignment { /** @@ -215,6 +38,18 @@ export interface PolicyAssignment { 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. @@ -228,10 +63,21 @@ export interface PolicyAssignment { 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. */ + /** 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 value of a parameter. */ @@ -248,6 +94,34 @@ export interface NonComplianceMessage { 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 { /** @@ -297,11 +171,65 @@ export interface SystemData { lastModifiedAt?: Date; } +/** 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?: any; +} + +/** 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 assignments. */ @@ -348,6 +276,12 @@ export interface PolicyDefinition { 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 details of the source of external evaluation results required by the policy during enforcement evaluation. */ + externalEvaluationEnforcementSettings?: ExternalEvaluationEnforcementSettings; } /** The definition of a parameter that can be provided to the policy. */ @@ -358,6 +292,8 @@ export interface ParameterDefinitionsValue { 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; } @@ -376,6 +312,26 @@ export interface ParameterDefinitionsValueMetadata { 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. */ + 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. */ + 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. */ @@ -384,6 +340,56 @@ export interface PolicyDefinitionListResult { 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 { /** @@ -406,7 +412,7 @@ export interface PolicySetDefinition { * 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. */ + /** 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; @@ -420,12 +426,28 @@ export interface PolicySetDefinition { 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. */ export interface PolicyDefinitionReference { /** The ID of the policy definition or policy set definition. */ 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 parameter values for the referenced policy rule. The keys are the parameter names. */ parameters?: { [propertyName: string]: ParameterValuesValue }; /** A unique id (within the policy set definition) for this policy definition reference. */ @@ -456,115 +478,162 @@ export interface PolicySetDefinitionListResult { nextLink?: string; } -/** The policy exemption. */ -export interface PolicyExemption { - /** - * 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; +/** List of policy set definition versions. */ +export interface PolicySetDefinitionVersionListResult { + /** An array of policy set definition versions. */ + value?: PolicySetDefinitionVersion[]; + /** The URL to use for getting the next set of results. */ + nextLink?: string; +} + +/** The policy set definition version. */ +export interface PolicySetDefinitionVersion { /** - * The ID of the policy exemption. + * The ID of the policy set 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 exemption. + * The name of the policy set 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/policyExemptions). + * The type of the resource (Microsoft.Authorization/policySetDefinitions/versions). * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; - /** The ID of the policy assignment that is being exempted. */ - policyAssignmentId: string; - /** The policy definition reference ID list when the associated policy assignment is an assignment of a policy set definition. */ - policyDefinitionReferenceIds?: string[]; - /** The policy exemption category. Possible values are Waiver and Mitigated. */ - exemptionCategory: ExemptionCategory; - /** The expiration date and time (in UTC ISO 8601 format yyyy-MM-ddTHH:mm:ssZ) of the policy exemption. */ - expiresOn?: Date; - /** The display name of the policy exemption. */ + /** + * 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 display name of the policy set definition. */ displayName?: string; - /** The description of the policy exemption. */ + /** The policy set definition description. */ description?: string; - /** The policy exemption metadata. Metadata is an open ended object and is typically a collection of key value pairs. */ + /** 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; } -/** List of policy exemptions. */ -export interface PolicyExemptionListResult { - /** An array of policy exemptions. */ - value?: PolicyExemption[]; - /** - * The URL to use for getting the next set of results. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; +/** The policy token request properties. */ +export interface PolicyTokenRequest { + /** The resource operation to acquire a token for. */ + operation?: PolicyTokenOperation; + /** The change reference. */ + changeReference?: string; } -/** Known values of {@link AliasPathTokenType} that the service accepts. */ -export enum KnownAliasPathTokenType { - /** The token type is not specified. */ - NotSpecified = "NotSpecified", - /** The token type can be anything. */ - Any = "Any", - /** The token type is string. */ - String = "String", - /** The token type is object. */ - Object = "Object", - /** The token type is array. */ - Array = "Array", - /** The token type is integer. */ - Integer = "Integer", - /** The token type is number. */ - Number = "Number", - /** The token type is boolean. */ - Boolean = "Boolean" +/** 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; } -/** - * Defines values for AliasPathTokenType. \ - * {@link KnownAliasPathTokenType} can be used interchangeably with AliasPathTokenType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **NotSpecified**: The token type is not specified. \ - * **Any**: The token type can be anything. \ - * **String**: The token type is string. \ - * **Object**: The token type is object. \ - * **Array**: The token type is array. \ - * **Integer**: The token type is integer. \ - * **Number**: The token type is number. \ - * **Boolean**: The token type is boolean. - */ -export type AliasPathTokenType = string; +/** 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; +} -/** Known values of {@link AliasPathAttributes} that the service accepts. */ -export enum KnownAliasPathAttributes { - /** The token that the alias path is referring to has no attributes. */ - None = "None", - /** The token that the alias path is referring to is modifiable by policies with 'modify' effect. */ - Modifiable = "Modifiable" +/** 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; } -/** - * Defines values for AliasPathAttributes. \ - * {@link KnownAliasPathAttributes} can be used interchangeably with AliasPathAttributes, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **None**: The token that the alias path is referring to has no attributes. \ - * **Modifiable**: The token that the alias path is referring to is modifiable by policies with 'modify' effect. - */ -export type AliasPathAttributes = string; +/** 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[]; +} /** 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" + 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", } /** @@ -573,10 +642,77 @@ export enum KnownEnforcementMode { * 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. + * **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", +} + +/** + * 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", +} + +/** + * 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 */ @@ -586,7 +722,7 @@ export enum KnownCreatedByType { /** ManagedIdentity */ ManagedIdentity = "ManagedIdentity", /** Key */ - Key = "Key" + Key = "Key", } /** @@ -610,7 +746,7 @@ export enum KnownPolicyType { /** Custom */ Custom = "Custom", /** Static */ - Static = "Static" + Static = "Static", } /** @@ -640,7 +776,7 @@ export enum KnownParameterType { /** Float */ Float = "Float", /** DateTime */ - DateTime = "DateTime" + DateTime = "DateTime", } /** @@ -658,53 +794,43 @@ export enum KnownParameterType { */ export type ParameterType = string; -/** Known values of {@link ExemptionCategory} that the service accepts. */ -export enum KnownExemptionCategory { - /** This category of exemptions usually means the scope is not applicable for the policy. */ - Waiver = "Waiver", - /** This category of exemptions usually means the mitigation actions have been applied to the scope. */ - Mitigated = "Mitigated" +/** Known values of {@link PolicyTokenResult} that the service accepts. */ +export enum KnownPolicyTokenResult { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", } /** - * Defines values for ExemptionCategory. \ - * {@link KnownExemptionCategory} can be used interchangeably with ExemptionCategory, + * 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 - * **Waiver**: This category of exemptions usually means the scope is not applicable for the policy. \ - * **Mitigated**: This category of exemptions usually means the mitigation actions have been applied to the scope. + * **Succeeded** \ + * **Failed** */ -export type ExemptionCategory = string; -/** Defines values for AliasPatternType. */ -export type AliasPatternType = "NotSpecified" | "Extract"; -/** Defines values for AliasType. */ -export type AliasType = "NotSpecified" | "PlainText" | "Mask"; -/** Defines values for ResourceIdentityType. */ -export type ResourceIdentityType = "SystemAssigned" | "UserAssigned" | "None"; - -/** Optional parameters. */ -export interface DataPolicyManifestsGetByPolicyModeOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getByPolicyMode operation. */ -export type DataPolicyManifestsGetByPolicyModeResponse = DataPolicyManifest; - -/** Optional parameters. */ -export interface DataPolicyManifestsListOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: "namespace eq '{value}'". If $filter is not provided, no filtering is performed. If $filter=namespace eq '{value}' is provided, the returned list only includes all data policy manifests that have a namespace matching the provided value. */ - filter?: string; +export type PolicyTokenResult = string; + +/** Known values of {@link ExternalEndpointResult} that the service accepts. */ +export enum KnownExternalEndpointResult { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", } -/** Contains response data for the list operation. */ -export type DataPolicyManifestsListResponse = DataPolicyManifestListResult; - -/** Optional parameters. */ -export interface DataPolicyManifestsListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type DataPolicyManifestsListNextResponse = DataPolicyManifestListResult; +/** + * 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 @@ -722,7 +848,10 @@ export type PolicyAssignmentsCreateResponse = PolicyAssignment; /** Optional parameters. */ export interface PolicyAssignmentsGetOptionalParams - extends coreClient.OperationOptions {} + 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; @@ -737,6 +866,8 @@ 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. */ @@ -744,11 +875,14 @@ export interface PolicyAssignmentsListForResourceGroupOptionalParams } /** Contains response data for the listForResourceGroup operation. */ -export type PolicyAssignmentsListForResourceGroupResponse = PolicyAssignmentListResult; +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. */ @@ -756,11 +890,14 @@ export interface PolicyAssignmentsListForResourceOptionalParams } /** Contains response data for the listForResource operation. */ -export type PolicyAssignmentsListForResourceResponse = PolicyAssignmentListResult; +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. */ @@ -768,11 +905,14 @@ export interface PolicyAssignmentsListForManagementGroupOptionalParams } /** Contains response data for the listForManagementGroup operation. */ -export type PolicyAssignmentsListForManagementGroupResponse = PolicyAssignmentListResult; +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. */ @@ -815,21 +955,24 @@ export interface PolicyAssignmentsListForResourceGroupNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listForResourceGroupNext operation. */ -export type PolicyAssignmentsListForResourceGroupNextResponse = PolicyAssignmentListResult; +export type PolicyAssignmentsListForResourceGroupNextResponse = + PolicyAssignmentListResult; /** Optional parameters. */ export interface PolicyAssignmentsListForResourceNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listForResourceNext operation. */ -export type PolicyAssignmentsListForResourceNextResponse = PolicyAssignmentListResult; +export type PolicyAssignmentsListForResourceNextResponse = + PolicyAssignmentListResult; /** Optional parameters. */ export interface PolicyAssignmentsListForManagementGroupNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listForManagementGroupNext operation. */ -export type PolicyAssignmentsListForManagementGroupNextResponse = PolicyAssignmentListResult; +export type PolicyAssignmentsListForManagementGroupNextResponse = + PolicyAssignmentListResult; /** Optional parameters. */ export interface PolicyAssignmentsListNextOptionalParams @@ -868,7 +1011,8 @@ export interface PolicyDefinitionsCreateOrUpdateAtManagementGroupOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the createOrUpdateAtManagementGroup operation. */ -export type PolicyDefinitionsCreateOrUpdateAtManagementGroupResponse = PolicyDefinition; +export type PolicyDefinitionsCreateOrUpdateAtManagementGroupResponse = + PolicyDefinition; /** Optional parameters. */ export interface PolicyDefinitionsDeleteAtManagementGroupOptionalParams @@ -915,7 +1059,8 @@ export interface PolicyDefinitionsListByManagementGroupOptionalParams } /** Contains response data for the listByManagementGroup operation. */ -export type PolicyDefinitionsListByManagementGroupResponse = PolicyDefinitionListResult; +export type PolicyDefinitionsListByManagementGroupResponse = + PolicyDefinitionListResult; /** Optional parameters. */ export interface PolicyDefinitionsListNextOptionalParams @@ -929,14 +1074,144 @@ export interface PolicyDefinitionsListBuiltInNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listBuiltInNext operation. */ -export type PolicyDefinitionsListBuiltInNextResponse = PolicyDefinitionListResult; +export type PolicyDefinitionsListBuiltInNextResponse = + PolicyDefinitionListResult; /** Optional parameters. */ export interface PolicyDefinitionsListByManagementGroupNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listByManagementGroupNext operation. */ -export type PolicyDefinitionsListByManagementGroupNextResponse = PolicyDefinitionListResult; +export type PolicyDefinitionsListByManagementGroupNextResponse = + PolicyDefinitionListResult; + +/** Optional parameters. */ +export interface PolicyDefinitionVersionsListAllBuiltinsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listAllBuiltins operation. */ +export type PolicyDefinitionVersionsListAllBuiltinsResponse = + PolicyDefinitionVersionListResult; + +/** Optional parameters. */ +export interface PolicyDefinitionVersionsListAllAtManagementGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listAllAtManagementGroup operation. */ +export type PolicyDefinitionVersionsListAllAtManagementGroupResponse = + PolicyDefinitionVersionListResult; + +/** Optional parameters. */ +export interface PolicyDefinitionVersionsListAllOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listAll operation. */ +export type PolicyDefinitionVersionsListAllResponse = + PolicyDefinitionVersionListResult; + +/** Optional parameters. */ +export interface PolicyDefinitionVersionsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type PolicyDefinitionVersionsCreateOrUpdateResponse = + PolicyDefinitionVersion; + +/** Optional parameters. */ +export interface PolicyDefinitionVersionsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface PolicyDefinitionVersionsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type PolicyDefinitionVersionsGetResponse = PolicyDefinitionVersion; + +/** Optional parameters. */ +export interface PolicyDefinitionVersionsGetBuiltInOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getBuiltIn operation. */ +export type PolicyDefinitionVersionsGetBuiltInResponse = + PolicyDefinitionVersion; + +/** Optional parameters. */ +export interface PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdateAtManagementGroup operation. */ +export type PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupResponse = + PolicyDefinitionVersion; + +/** Optional parameters. */ +export interface PolicyDefinitionVersionsDeleteAtManagementGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface PolicyDefinitionVersionsGetAtManagementGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getAtManagementGroup operation. */ +export type PolicyDefinitionVersionsGetAtManagementGroupResponse = + PolicyDefinitionVersion; + +/** Optional parameters. */ +export interface PolicyDefinitionVersionsListOptionalParams + extends coreClient.OperationOptions { + /** 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 PolicyDefinitionVersionsListResponse = + PolicyDefinitionVersionListResult; + +/** Optional parameters. */ +export interface PolicyDefinitionVersionsListBuiltInOptionalParams + extends coreClient.OperationOptions { + /** 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. */ +export type PolicyDefinitionVersionsListBuiltInResponse = + PolicyDefinitionVersionListResult; + +/** Optional parameters. */ +export interface PolicyDefinitionVersionsListByManagementGroupOptionalParams + extends coreClient.OperationOptions { + /** 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. */ +export type PolicyDefinitionVersionsListByManagementGroupResponse = + PolicyDefinitionVersionListResult; + +/** Optional parameters. */ +export interface PolicyDefinitionVersionsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type PolicyDefinitionVersionsListNextResponse = + PolicyDefinitionVersionListResult; + +/** Optional parameters. */ +export interface PolicyDefinitionVersionsListBuiltInNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBuiltInNext operation. */ +export type PolicyDefinitionVersionsListBuiltInNextResponse = + PolicyDefinitionVersionListResult; + +/** Optional parameters. */ +export interface PolicyDefinitionVersionsListByManagementGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByManagementGroupNext operation. */ +export type PolicyDefinitionVersionsListByManagementGroupNextResponse = + PolicyDefinitionVersionListResult; /** Optional parameters. */ export interface PolicySetDefinitionsCreateOrUpdateOptionalParams @@ -951,14 +1226,20 @@ export interface PolicySetDefinitionsDeleteOptionalParams /** Optional parameters. */ export interface PolicySetDefinitionsGetOptionalParams - extends coreClient.OperationOptions {} + 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 PolicySetDefinitionsGetResponse = PolicySetDefinition; /** Optional parameters. */ export interface PolicySetDefinitionsGetBuiltInOptionalParams - extends coreClient.OperationOptions {} + 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 getBuiltIn operation. */ export type PolicySetDefinitionsGetBuiltInResponse = PolicySetDefinition; @@ -966,6 +1247,8 @@ 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. */ @@ -978,6 +1261,8 @@ 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. */ @@ -985,14 +1270,16 @@ export interface PolicySetDefinitionsListBuiltInOptionalParams } /** Contains response data for the listBuiltIn operation. */ -export type PolicySetDefinitionsListBuiltInResponse = PolicySetDefinitionListResult; +export type PolicySetDefinitionsListBuiltInResponse = + PolicySetDefinitionListResult; /** Optional parameters. */ export interface PolicySetDefinitionsCreateOrUpdateAtManagementGroupOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the createOrUpdateAtManagementGroup operation. */ -export type PolicySetDefinitionsCreateOrUpdateAtManagementGroupResponse = PolicySetDefinition; +export type PolicySetDefinitionsCreateOrUpdateAtManagementGroupResponse = + PolicySetDefinition; /** Optional parameters. */ export interface PolicySetDefinitionsDeleteAtManagementGroupOptionalParams @@ -1000,14 +1287,20 @@ export interface PolicySetDefinitionsDeleteAtManagementGroupOptionalParams /** Optional parameters. */ export interface PolicySetDefinitionsGetAtManagementGroupOptionalParams - extends coreClient.OperationOptions {} + 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 getAtManagementGroup operation. */ -export type PolicySetDefinitionsGetAtManagementGroupResponse = PolicySetDefinition; +export type PolicySetDefinitionsGetAtManagementGroupResponse = + PolicySetDefinition; /** 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. */ @@ -1015,120 +1308,195 @@ export interface PolicySetDefinitionsListByManagementGroupOptionalParams } /** Contains response data for the listByManagementGroup operation. */ -export type PolicySetDefinitionsListByManagementGroupResponse = PolicySetDefinitionListResult; +export type PolicySetDefinitionsListByManagementGroupResponse = + PolicySetDefinitionListResult; /** Optional parameters. */ export interface PolicySetDefinitionsListNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ -export type PolicySetDefinitionsListNextResponse = PolicySetDefinitionListResult; +export type PolicySetDefinitionsListNextResponse = + PolicySetDefinitionListResult; /** Optional parameters. */ export interface PolicySetDefinitionsListBuiltInNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listBuiltInNext operation. */ -export type PolicySetDefinitionsListBuiltInNextResponse = PolicySetDefinitionListResult; +export type PolicySetDefinitionsListBuiltInNextResponse = + PolicySetDefinitionListResult; /** Optional parameters. */ export interface PolicySetDefinitionsListByManagementGroupNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listByManagementGroupNext operation. */ -export type PolicySetDefinitionsListByManagementGroupNextResponse = PolicySetDefinitionListResult; +export type PolicySetDefinitionsListByManagementGroupNextResponse = + PolicySetDefinitionListResult; + +/** Optional parameters. */ +export interface PolicySetDefinitionVersionsListAllBuiltinsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listAllBuiltins operation. */ +export type PolicySetDefinitionVersionsListAllBuiltinsResponse = + PolicySetDefinitionVersionListResult; + +/** Optional parameters. */ +export interface PolicySetDefinitionVersionsListAllAtManagementGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listAllAtManagementGroup operation. */ +export type PolicySetDefinitionVersionsListAllAtManagementGroupResponse = + PolicySetDefinitionVersionListResult; /** Optional parameters. */ -export interface PolicyExemptionsDeleteOptionalParams +export interface PolicySetDefinitionVersionsListAllOptionalParams extends coreClient.OperationOptions {} +/** Contains response data for the listAll operation. */ +export type PolicySetDefinitionVersionsListAllResponse = + PolicySetDefinitionVersionListResult; + /** Optional parameters. */ -export interface PolicyExemptionsCreateOrUpdateOptionalParams +export interface PolicySetDefinitionVersionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the createOrUpdate operation. */ -export type PolicyExemptionsCreateOrUpdateResponse = PolicyExemption; +export type PolicySetDefinitionVersionsCreateOrUpdateResponse = + PolicySetDefinitionVersion; /** Optional parameters. */ -export interface PolicyExemptionsGetOptionalParams +export interface PolicySetDefinitionVersionsDeleteOptionalParams extends coreClient.OperationOptions {} +/** Optional parameters. */ +export interface PolicySetDefinitionVersionsGetOptionalParams + 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 PolicyExemptionsGetResponse = PolicyExemption; +export type PolicySetDefinitionVersionsGetResponse = PolicySetDefinitionVersion; /** Optional parameters. */ -export interface PolicyExemptionsListOptionalParams +export interface PolicySetDefinitionVersionsGetBuiltInOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter is not provided, the unfiltered list includes all policy exemptions associated with the scope, including those that apply directly or apply from containing scopes. If $filter=atScope() is provided, the returned list only includes all policy exemptions 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 exemptions that at the given scope. If $filter=excludeExpired() is provided, the returned list only includes all policy exemptions that either haven't expired or didn't set expiration date. If $filter=policyAssignmentId eq '{value}' is provided. the returned list only includes all policy exemptions that are associated with the give policyAssignmentId. */ - filter?: string; + /** Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. */ + expand?: string; +} + +/** Contains response data for the getBuiltIn operation. */ +export type PolicySetDefinitionVersionsGetBuiltInResponse = + PolicySetDefinitionVersion; + +/** Optional parameters. */ +export interface PolicySetDefinitionVersionsListOptionalParams + extends coreClient.OperationOptions { + /** 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. */ -export type PolicyExemptionsListResponse = PolicyExemptionListResult; +export type PolicySetDefinitionVersionsListResponse = + PolicySetDefinitionVersionListResult; /** Optional parameters. */ -export interface PolicyExemptionsListForResourceGroupOptionalParams +export interface PolicySetDefinitionVersionsListBuiltInOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter is not provided, the unfiltered list includes all policy exemptions associated with the scope, including those that apply directly or apply from containing scopes. If $filter=atScope() is provided, the returned list only includes all policy exemptions 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 exemptions that at the given scope. If $filter=excludeExpired() is provided, the returned list only includes all policy exemptions that either haven't expired or didn't set expiration date. If $filter=policyAssignmentId eq '{value}' is provided. the returned list only includes all policy exemptions that are associated with the give policyAssignmentId. */ - filter?: string; + /** 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 listForResourceGroup operation. */ -export type PolicyExemptionsListForResourceGroupResponse = PolicyExemptionListResult; +/** Contains response data for the listBuiltIn operation. */ +export type PolicySetDefinitionVersionsListBuiltInResponse = + PolicySetDefinitionVersionListResult; + +/** Optional parameters. */ +export interface PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdateAtManagementGroup operation. */ +export type PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupResponse = + PolicySetDefinitionVersion; /** Optional parameters. */ -export interface PolicyExemptionsListForResourceOptionalParams +export interface PolicySetDefinitionVersionsDeleteAtManagementGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface PolicySetDefinitionVersionsGetAtManagementGroupOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter is not provided, the unfiltered list includes all policy exemptions associated with the scope, including those that apply directly or apply from containing scopes. If $filter=atScope() is provided, the returned list only includes all policy exemptions 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 exemptions that at the given scope. If $filter=excludeExpired() is provided, the returned list only includes all policy exemptions that either haven't expired or didn't set expiration date. If $filter=policyAssignmentId eq '{value}' is provided. the returned list only includes all policy exemptions that are associated with the give policyAssignmentId. */ - filter?: string; + /** 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 PolicyExemptionsListForResourceResponse = PolicyExemptionListResult; +/** Contains response data for the getAtManagementGroup operation. */ +export type PolicySetDefinitionVersionsGetAtManagementGroupResponse = + PolicySetDefinitionVersion; /** Optional parameters. */ -export interface PolicyExemptionsListForManagementGroupOptionalParams +export interface PolicySetDefinitionVersionsListByManagementGroupOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter is not provided, the unfiltered list includes all policy exemptions associated with the scope, including those that apply directly or apply from containing scopes. If $filter=atScope() is provided, the returned list only includes all policy exemptions 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 exemptions that at the given scope. If $filter=excludeExpired() is provided, the returned list only includes all policy exemptions that either haven't expired or didn't set expiration date. If $filter=policyAssignmentId eq '{value}' is provided. the returned list only includes all policy exemptions that are associated with the give policyAssignmentId. */ - filter?: string; + /** 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 listForManagementGroup operation. */ -export type PolicyExemptionsListForManagementGroupResponse = PolicyExemptionListResult; +/** Contains response data for the listByManagementGroup operation. */ +export type PolicySetDefinitionVersionsListByManagementGroupResponse = + PolicySetDefinitionVersionListResult; /** Optional parameters. */ -export interface PolicyExemptionsListNextOptionalParams +export interface PolicySetDefinitionVersionsListNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ -export type PolicyExemptionsListNextResponse = PolicyExemptionListResult; +export type PolicySetDefinitionVersionsListNextResponse = + PolicySetDefinitionVersionListResult; /** Optional parameters. */ -export interface PolicyExemptionsListForResourceGroupNextOptionalParams +export interface PolicySetDefinitionVersionsListBuiltInNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listForResourceGroupNext operation. */ -export type PolicyExemptionsListForResourceGroupNextResponse = PolicyExemptionListResult; +/** Contains response data for the listBuiltInNext operation. */ +export type PolicySetDefinitionVersionsListBuiltInNextResponse = + PolicySetDefinitionVersionListResult; /** Optional parameters. */ -export interface PolicyExemptionsListForResourceNextOptionalParams +export interface PolicySetDefinitionVersionsListByManagementGroupNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listForResourceNext operation. */ -export type PolicyExemptionsListForResourceNextResponse = PolicyExemptionListResult; +/** Contains response data for the listByManagementGroupNext operation. */ +export type PolicySetDefinitionVersionsListByManagementGroupNextResponse = + PolicySetDefinitionVersionListResult; /** Optional parameters. */ -export interface PolicyExemptionsListForManagementGroupNextOptionalParams - extends coreClient.OperationOptions {} +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 listForManagementGroupNext operation. */ -export type PolicyExemptionsListForManagementGroupNextResponse = PolicyExemptionListResult; +/** Contains response data for the acquire operation. */ +export type PolicyTokensAcquireResponse = PolicyTokenResponse; /** Optional parameters. */ export interface PolicyClientOptionalParams extends coreClient.ServiceClientOptions { /** server parameter */ $host?: string; + /** Api Version */ + apiVersion?: string; /** Overrides client endpoint. */ endpoint?: string; } diff --git a/sdk/policy/arm-policy/src/models/mappers.ts b/sdk/policy/arm-policy/src/models/mappers.ts index 118f4863c37e..137b235bc830 100644 --- a/sdk/policy/arm-policy/src/models/mappers.ts +++ b/sdk/policy/arm-policy/src/models/mappers.ts @@ -8,389 +8,468 @@ import * as coreClient from "@azure/core-client"; -export const DataPolicyManifest: coreClient.CompositeMapper = { +export const PolicyAssignment: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataPolicyManifest", + className: "PolicyAssignment", modelProperties: { id: { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - type: { - serializedName: "type", + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity", + }, + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData", + }, + }, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String", + }, + }, + policyDefinitionId: { + serializedName: "properties.policyDefinitionId", + type: { + name: "String", + }, + }, + definitionVersion: { + serializedName: "properties.definitionVersion", + type: { + name: "String", + }, + }, + latestDefinitionVersion: { + serializedName: "properties.latestDefinitionVersion", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - namespaces: { - serializedName: "properties.namespaces", + effectiveDefinitionVersion: { + serializedName: "properties.effectiveDefinitionVersion", + readOnly: true, + type: { + name: "String", + }, + }, + scope: { + serializedName: "properties.scope", + readOnly: true, + type: { + name: "String", + }, + }, + notScopes: { + serializedName: "properties.notScopes", type: { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "String", + }, + }, + }, }, - policyMode: { - serializedName: "properties.policyMode", + parameters: { + serializedName: "properties.parameters", type: { - name: "String" - } + name: "Dictionary", + value: { + type: { name: "Composite", className: "ParameterValuesValue" }, + }, + }, }, - isBuiltInOnly: { - serializedName: "properties.isBuiltInOnly", + description: { + serializedName: "properties.description", + type: { + name: "String", + }, + }, + metadata: { + serializedName: "properties.metadata", type: { - name: "Boolean" - } + name: "any", + }, }, - resourceTypeAliases: { - serializedName: "properties.resourceTypeAliases", + enforcementMode: { + defaultValue: "Default", + serializedName: "properties.enforcementMode", + type: { + name: "String", + }, + }, + nonComplianceMessages: { + serializedName: "properties.nonComplianceMessages", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ResourceTypeAliases" - } - } - } + className: "NonComplianceMessage", + }, + }, + }, }, - effects: { - serializedName: "properties.effects", + resourceSelectors: { + serializedName: "properties.resourceSelectors", type: { name: "Sequence", element: { type: { name: "Composite", - className: "DataEffect" - } - } - } + className: "ResourceSelector", + }, + }, + }, }, - fieldValues: { - serializedName: "properties.fieldValues", + overrides: { + serializedName: "properties.overrides", type: { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "Composite", + className: "Override", + }, + }, + }, }, - standard: { - serializedName: "properties.resourceFunctions.standard", + assignmentType: { + serializedName: "properties.assignmentType", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } + name: "String", + }, }, - custom: { - serializedName: "properties.resourceFunctions.custom", + instanceId: { + serializedName: "properties.instanceId", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DataManifestCustomResourceFunctionDefinition" - } - } - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const ResourceTypeAliases: coreClient.CompositeMapper = { +export const ParameterValuesValue: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceTypeAliases", + className: "ParameterValuesValue", modelProperties: { - resourceType: { - serializedName: "resourceType", + value: { + serializedName: "value", type: { - name: "String" - } + name: "any", + }, }, - aliases: { - serializedName: "aliases", + }, + }, +}; + +export const NonComplianceMessage: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NonComplianceMessage", + modelProperties: { + message: { + serializedName: "message", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Alias" - } - } - } - } - } - } + name: "String", + }, + }, + policyDefinitionReferenceId: { + serializedName: "policyDefinitionReferenceId", + type: { + name: "String", + }, + }, + }, + }, }; -export const Alias: coreClient.CompositeMapper = { +export const ResourceSelector: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Alias", + className: "ResourceSelector", modelProperties: { name: { serializedName: "name", type: { - name: "String" - } + name: "String", + }, }, - paths: { - serializedName: "paths", + selectors: { + serializedName: "selectors", type: { name: "Sequence", element: { type: { name: "Composite", - className: "AliasPath" - } - } - } + className: "Selector", + }, + }, + }, }, - type: { - serializedName: "type", + }, + }, +}; + +export const Selector: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Selector", + modelProperties: { + kind: { + serializedName: "kind", type: { - name: "Enum", - allowedValues: ["NotSpecified", "PlainText", "Mask"] - } + name: "String", + }, }, - defaultPath: { - serializedName: "defaultPath", + in: { + serializedName: "in", type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, }, - defaultPattern: { - serializedName: "defaultPattern", + notIn: { + serializedName: "notIn", type: { - name: "Composite", - className: "AliasPattern" - } + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, }, - defaultMetadata: { - serializedName: "defaultMetadata", - type: { - name: "Composite", - className: "AliasPathMetadata" - } - } - } - } + }, + }, }; -export const AliasPath: coreClient.CompositeMapper = { +export const Override: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AliasPath", + className: "Override", modelProperties: { - path: { - serializedName: "path", + kind: { + serializedName: "kind", type: { - name: "String" - } + name: "String", + }, }, - apiVersions: { - serializedName: "apiVersions", + value: { + serializedName: "value", + type: { + name: "String", + }, + }, + selectors: { + serializedName: "selectors", type: { name: "Sequence", element: { type: { - name: "String" - } - } - } - }, - pattern: { - serializedName: "pattern", - type: { - name: "Composite", - className: "AliasPattern" - } + name: "Composite", + className: "Selector", + }, + }, + }, }, - metadata: { - serializedName: "metadata", - type: { - name: "Composite", - className: "AliasPathMetadata" - } - } - } - } + }, + }, }; -export const AliasPattern: coreClient.CompositeMapper = { +export const Identity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AliasPattern", + className: "Identity", modelProperties: { - phrase: { - serializedName: "phrase", + principalId: { + serializedName: "principalId", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - variable: { - serializedName: "variable", + tenantId: { + serializedName: "tenantId", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", type: { name: "Enum", - allowedValues: ["NotSpecified", "Extract"] - } - } - } - } + allowedValues: ["SystemAssigned", "UserAssigned", "None"], + }, + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { + name: "Composite", + className: "UserAssignedIdentitiesValue", + }, + }, + }, + }, + }, + }, }; -export const AliasPathMetadata: coreClient.CompositeMapper = { +export const UserAssignedIdentitiesValue: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AliasPathMetadata", + className: "UserAssignedIdentitiesValue", modelProperties: { - type: { - serializedName: "type", + principalId: { + serializedName: "principalId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - attributes: { - serializedName: "attributes", + clientId: { + serializedName: "clientId", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const DataEffect: coreClient.CompositeMapper = { +export const SystemData: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataEffect", + className: "SystemData", modelProperties: { - name: { - serializedName: "name", + createdBy: { + serializedName: "createdBy", type: { - name: "String" - } + name: "String", + }, }, - detailsSchema: { - serializedName: "detailsSchema", + createdByType: { + serializedName: "createdByType", type: { - name: "any" - } - } - } - } -}; - -export const DataManifestCustomResourceFunctionDefinition: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataManifestCustomResourceFunctionDefinition", - modelProperties: { - name: { - serializedName: "name", + name: "String", + }, + }, + createdAt: { + serializedName: "createdAt", type: { - name: "String" - } + name: "DateTime", + }, }, - fullyQualifiedResourceType: { - serializedName: "fullyQualifiedResourceType", + lastModifiedBy: { + serializedName: "lastModifiedBy", type: { - name: "String" - } + name: "String", + }, }, - defaultProperties: { - serializedName: "defaultProperties", + lastModifiedByType: { + serializedName: "lastModifiedByType", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - allowCustomProperties: { - serializedName: "allowCustomProperties", - type: { - name: "Boolean" - } - } - } - } + name: "String", + }, + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime", + }, + }, + }, + }, }; -export const CloudError: coreClient.CompositeMapper = { +export const ErrorResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CloudError", + className: "ErrorResponse", modelProperties: { error: { serializedName: "error", type: { name: "Composite", - className: "ErrorResponse" - } - } - } - } + className: "ErrorDetail", + }, + }, + }, + }, }; -export const ErrorResponse: coreClient.CompositeMapper = { +export const ErrorDetail: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorResponse", + className: "ErrorDetail", modelProperties: { code: { 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", @@ -400,10 +479,10 @@ export const ErrorResponse: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorResponse" - } - } - } + className: "ErrorDetail", + }, + }, + }, }, additionalInfo: { serializedName: "additionalInfo", @@ -413,13 +492,13 @@ export const ErrorResponse: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorAdditionalInfo" - } - } - } - } - } - } + className: "ErrorAdditionalInfo", + }, + }, + }, + }, + }, + }, }; export const ErrorAdditionalInfo: coreClient.CompositeMapper = { @@ -431,24 +510,70 @@ export const ErrorAdditionalInfo: coreClient.CompositeMapper = { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, info: { serializedName: "info", readOnly: true, type: { - name: "any" - } - } - } - } + name: "any", + }, + }, + }, + }, +}; + +export const PolicyAssignmentUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PolicyAssignmentUpdate", + modelProperties: { + 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: "ResourceSelector", + }, + }, + }, + }, + overrides: { + serializedName: "properties.overrides", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Override", + }, + }, + }, + }, + }, + }, }; -export const DataPolicyManifestListResult: coreClient.CompositeMapper = { +export const PolicyAssignmentListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataPolicyManifestListResult", + className: "PolicyAssignmentListResult", modelProperties: { value: { serializedName: "value", @@ -457,314 +582,304 @@ export const DataPolicyManifestListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "DataPolicyManifest" - } - } - } + className: "PolicyAssignment", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const PolicyAssignment: coreClient.CompositeMapper = { +export const PolicyDefinition: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyAssignment", + className: "PolicyDefinition", modelProperties: { id: { serializedName: "id", readOnly: true, type: { - name: "String" - } - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - location: { - serializedName: "location", - type: { - name: "String" - } - }, - identity: { - serializedName: "identity", + type: { + serializedName: "type", + readOnly: true, type: { - name: "Composite", - className: "Identity" - } + name: "String", + }, }, systemData: { serializedName: "systemData", type: { name: "Composite", - className: "SystemData" - } + className: "SystemData", + }, + }, + policyType: { + serializedName: "properties.policyType", + type: { + name: "String", + }, + }, + mode: { + defaultValue: "Indexed", + serializedName: "properties.mode", + type: { + name: "String", + }, }, displayName: { serializedName: "properties.displayName", type: { - name: "String" - } + name: "String", + }, }, - policyDefinitionId: { - serializedName: "properties.policyDefinitionId", + description: { + serializedName: "properties.description", type: { - name: "String" - } + name: "String", + }, }, - scope: { - serializedName: "properties.scope", - readOnly: true, + policyRule: { + serializedName: "properties.policyRule", type: { - name: "String" - } + name: "any", + }, }, - notScopes: { - serializedName: "properties.notScopes", + metadata: { + serializedName: "properties.metadata", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } + name: "any", + }, }, parameters: { serializedName: "properties.parameters", type: { name: "Dictionary", value: { - type: { name: "Composite", className: "ParameterValuesValue" } - } - } + type: { name: "Composite", className: "ParameterDefinitionsValue" }, + }, + }, }, - description: { - serializedName: "properties.description", + version: { + serializedName: "properties.version", type: { - name: "String" - } + name: "String", + }, }, - metadata: { - serializedName: "properties.metadata", - type: { - name: "any" - } - }, - enforcementMode: { - defaultValue: "Default", - serializedName: "properties.enforcementMode", - type: { - name: "String" - } - }, - nonComplianceMessages: { - serializedName: "properties.nonComplianceMessages", + versions: { + serializedName: "properties.versions", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "NonComplianceMessage" - } - } - } - } - } - } -}; - -export const ParameterValuesValue: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ParameterValuesValue", - modelProperties: { - value: { - serializedName: "value", + name: "String", + }, + }, + }, + }, + externalEvaluationEnforcementSettings: { + serializedName: "properties.externalEvaluationEnforcementSettings", type: { - name: "any" - } - } - } - } + name: "Composite", + className: "ExternalEvaluationEnforcementSettings", + }, + }, + }, + }, }; -export const NonComplianceMessage: coreClient.CompositeMapper = { +export const ParameterDefinitionsValue: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NonComplianceMessage", + className: "ParameterDefinitionsValue", modelProperties: { - message: { - serializedName: "message", - required: true, + type: { + serializedName: "type", type: { - name: "String" - } + name: "String", + }, }, - policyDefinitionReferenceId: { - serializedName: "policyDefinitionReferenceId", - type: { - name: "String" - } - } - } - } -}; - -export const Identity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Identity", - modelProperties: { - principalId: { - serializedName: "principalId", - readOnly: true, + allowedValues: { + serializedName: "allowedValues", type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "any", + }, + }, + }, }, - tenantId: { - serializedName: "tenantId", - readOnly: true, + defaultValue: { + serializedName: "defaultValue", type: { - name: "String" - } + name: "any", + }, }, - type: { - serializedName: "type", + schema: { + serializedName: "schema", type: { - name: "Enum", - allowedValues: ["SystemAssigned", "UserAssigned", "None"] - } + name: "any", + }, }, - userAssignedIdentities: { - serializedName: "userAssignedIdentities", + metadata: { + serializedName: "metadata", type: { - name: "Dictionary", - value: { - type: { - name: "Composite", - className: "UserAssignedIdentitiesValue" - } - } - } - } - } - } + name: "Composite", + className: "ParameterDefinitionsValueMetadata", + }, + }, + }, + }, }; -export const UserAssignedIdentitiesValue: coreClient.CompositeMapper = { +export const ParameterDefinitionsValueMetadata: coreClient.CompositeMapper = { type: { name: "Composite", - className: "UserAssignedIdentitiesValue", + className: "ParameterDefinitionsValueMetadata", + additionalProperties: { type: { name: "Object" } }, modelProperties: { - principalId: { - serializedName: "principalId", - readOnly: true, + displayName: { + serializedName: "displayName", type: { - name: "String" - } + name: "String", + }, }, - clientId: { - serializedName: "clientId", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const SystemData: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SystemData", - modelProperties: { - createdBy: { - serializedName: "createdBy", + description: { + serializedName: "description", type: { - name: "String" - } + name: "String", + }, }, - createdByType: { - serializedName: "createdByType", + strongType: { + serializedName: "strongType", type: { - name: "String" - } + name: "String", + }, }, - createdAt: { - serializedName: "createdAt", + assignPermissions: { + serializedName: "assignPermissions", type: { - name: "DateTime" - } + name: "Boolean", + }, }, - lastModifiedBy: { - serializedName: "lastModifiedBy", + }, + }, +}; + +export const ExternalEvaluationEnforcementSettings: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "ExternalEvaluationEnforcementSettings", + modelProperties: { + missingTokenAction: { + serializedName: "missingTokenAction", + type: { + name: "String", + }, + }, + resultLifespan: { + constraints: { + Pattern: new RegExp( + "^P(\\d+Y)?(\\d+M)?(\\d+D)?(T(\\d+H)?(\\d+M)?(\\d+(\\.\\d+)?S)?)?$", + ), + }, + serializedName: "resultLifespan", + type: { + name: "String", + }, + }, + endpointSettings: { + serializedName: "endpointSettings", + type: { + name: "Composite", + className: "ExternalEvaluationEndpointSettings", + }, + }, + roleDefinitionIds: { + serializedName: "roleDefinitionIds", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, + }; + +export const ExternalEvaluationEndpointSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExternalEvaluationEndpointSettings", + modelProperties: { + kind: { + serializedName: "kind", type: { - name: "String" - } + name: "String", + }, }, - lastModifiedByType: { - serializedName: "lastModifiedByType", + details: { + serializedName: "details", type: { - name: "String" - } + name: "any", + }, }, - lastModifiedAt: { - serializedName: "lastModifiedAt", - type: { - name: "DateTime" - } - } - } - } + }, + }, }; -export const PolicyAssignmentUpdate: coreClient.CompositeMapper = { +export const PolicyDefinitionListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyAssignmentUpdate", + className: "PolicyDefinitionListResult", modelProperties: { - location: { - serializedName: "location", + value: { + serializedName: "value", type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicyDefinition", + }, + }, + }, }, - identity: { - serializedName: "identity", + nextLink: { + serializedName: "nextLink", type: { - name: "Composite", - className: "Identity" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const PolicyAssignmentListResult: coreClient.CompositeMapper = { +export const PolicyDefinitionVersionListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyAssignmentListResult", + className: "PolicyDefinitionVersionListResult", modelProperties: { value: { serializedName: "value", @@ -773,202 +888,115 @@ export const PolicyAssignmentListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "PolicyAssignment" - } - } - } + className: "PolicyDefinitionVersion", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const PolicyDefinition: coreClient.CompositeMapper = { +export const PolicyDefinitionVersion: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyDefinition", + className: "PolicyDefinitionVersion", modelProperties: { id: { 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", + }, }, systemData: { serializedName: "systemData", type: { name: "Composite", - className: "SystemData" - } + className: "SystemData", + }, }, policyType: { serializedName: "properties.policyType", type: { - name: "String" - } + name: "String", + }, }, mode: { defaultValue: "Indexed", serializedName: "properties.mode", type: { - name: "String" - } + name: "String", + }, }, displayName: { serializedName: "properties.displayName", type: { - name: "String" - } + name: "String", + }, }, description: { serializedName: "properties.description", type: { - name: "String" - } + name: "String", + }, }, policyRule: { serializedName: "properties.policyRule", type: { - name: "any" - } + name: "any", + }, }, metadata: { serializedName: "properties.metadata", type: { - name: "any" - } + name: "any", + }, }, parameters: { serializedName: "properties.parameters", type: { name: "Dictionary", value: { - type: { name: "Composite", className: "ParameterDefinitionsValue" } - } - } - } - } - } -}; - -export const ParameterDefinitionsValue: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ParameterDefinitionsValue", - modelProperties: { - type: { - serializedName: "type", - type: { - name: "String" - } - }, - allowedValues: { - serializedName: "allowedValues", - type: { - name: "Sequence", - element: { - type: { - name: "any" - } - } - } + type: { name: "Composite", className: "ParameterDefinitionsValue" }, + }, + }, }, - defaultValue: { - serializedName: "defaultValue", + version: { + serializedName: "properties.version", type: { - name: "any" - } + name: "String", + }, }, - metadata: { - serializedName: "metadata", + externalEvaluationEnforcementSettings: { + serializedName: "properties.externalEvaluationEnforcementSettings", type: { name: "Composite", - className: "ParameterDefinitionsValueMetadata" - } - } - } - } -}; - -export const ParameterDefinitionsValueMetadata: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ParameterDefinitionsValueMetadata", - additionalProperties: { type: { name: "Object" } }, - modelProperties: { - displayName: { - serializedName: "displayName", - type: { - name: "String" - } + className: "ExternalEvaluationEnforcementSettings", + }, }, - description: { - serializedName: "description", - type: { - name: "String" - } - }, - strongType: { - serializedName: "strongType", - type: { - name: "String" - } - }, - assignPermissions: { - serializedName: "assignPermissions", - type: { - name: "Boolean" - } - } - } - } -}; - -export const PolicyDefinitionListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PolicyDefinitionListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PolicyDefinition" - } - } - } - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - } - } - } + }, + }, }; export const PolicySetDefinition: coreClient.CompositeMapper = { @@ -980,62 +1008,62 @@ export const PolicySetDefinition: 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", + }, }, systemData: { serializedName: "systemData", type: { name: "Composite", - className: "SystemData" - } + className: "SystemData", + }, }, policyType: { serializedName: "properties.policyType", type: { - name: "String" - } + name: "String", + }, }, displayName: { serializedName: "properties.displayName", type: { - name: "String" - } + name: "String", + }, }, description: { serializedName: "properties.description", type: { - name: "String" - } + name: "String", + }, }, metadata: { serializedName: "properties.metadata", type: { - name: "any" - } + name: "any", + }, }, parameters: { serializedName: "properties.parameters", type: { name: "Dictionary", value: { - type: { name: "Composite", className: "ParameterDefinitionsValue" } - } - } + type: { name: "Composite", className: "ParameterDefinitionsValue" }, + }, + }, }, policyDefinitions: { serializedName: "properties.policyDefinitions", @@ -1044,10 +1072,10 @@ export const PolicySetDefinition: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "PolicyDefinitionReference" - } - } - } + className: "PolicyDefinitionReference", + }, + }, + }, }, policyDefinitionGroups: { serializedName: "properties.policyDefinitionGroups", @@ -1056,13 +1084,30 @@ export const PolicySetDefinition: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "PolicyDefinitionGroup" - } - } - } - } - } - } + className: "PolicyDefinitionGroup", + }, + }, + }, + }, + version: { + serializedName: "properties.version", + type: { + name: "String", + }, + }, + versions: { + serializedName: "properties.versions", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, }; export const PolicyDefinitionReference: coreClient.CompositeMapper = { @@ -1074,23 +1119,43 @@ export const PolicyDefinitionReference: coreClient.CompositeMapper = { serializedName: "policyDefinitionId", required: true, type: { - name: "String" - } + name: "String", + }, + }, + definitionVersion: { + serializedName: "definitionVersion", + type: { + name: "String", + }, + }, + latestDefinitionVersion: { + serializedName: "latestDefinitionVersion", + readOnly: true, + type: { + name: "String", + }, + }, + effectiveDefinitionVersion: { + serializedName: "effectiveDefinitionVersion", + readOnly: true, + type: { + name: "String", + }, }, parameters: { serializedName: "parameters", type: { name: "Dictionary", value: { - type: { name: "Composite", className: "ParameterValuesValue" } - } - } + type: { name: "Composite", className: "ParameterValuesValue" }, + }, + }, }, policyDefinitionReferenceId: { serializedName: "policyDefinitionReferenceId", type: { - name: "String" - } + name: "String", + }, }, groupNames: { serializedName: "groupNames", @@ -1098,13 +1163,13 @@ export const PolicyDefinitionReference: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } - } - } - } + name: "String", + }, + }, + }, + }, + }, + }, }; export const PolicyDefinitionGroup: coreClient.CompositeMapper = { @@ -1116,35 +1181,35 @@ export const PolicyDefinitionGroup: coreClient.CompositeMapper = { serializedName: "name", required: true, type: { - name: "String" - } + name: "String", + }, }, displayName: { serializedName: "displayName", type: { - name: "String" - } + name: "String", + }, }, category: { serializedName: "category", type: { - name: "String" - } + name: "String", + }, }, description: { serializedName: "description", type: { - name: "String" - } + name: "String", + }, }, additionalMetadataId: { serializedName: "additionalMetadataId", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const PolicySetDefinitionListResult: coreClient.CompositeMapper = { @@ -1159,131 +1224,449 @@ export const PolicySetDefinitionListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "PolicySetDefinition" - } - } - } + className: "PolicySetDefinition", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const PolicyExemption: coreClient.CompositeMapper = { +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: "PolicyExemption", + className: "PolicySetDefinitionVersion", modelProperties: { - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData" - } - }, id: { 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", + }, }, - policyAssignmentId: { - serializedName: "properties.policyAssignmentId", - required: true, + 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: { + name: "String", + }, + }, + metadata: { + serializedName: "properties.metadata", + type: { + name: "any", + }, + }, + parameters: { + serializedName: "properties.parameters", type: { - name: "String" - } + name: "Dictionary", + value: { + type: { name: "Composite", className: "ParameterDefinitionsValue" }, + }, + }, }, - policyDefinitionReferenceIds: { - serializedName: "properties.policyDefinitionReferenceIds", + policyDefinitions: { + serializedName: "properties.policyDefinitions", type: { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "Composite", + className: "PolicyDefinitionReference", + }, + }, + }, }, - exemptionCategory: { - serializedName: "properties.exemptionCategory", - required: true, + policyDefinitionGroups: { + serializedName: "properties.policyDefinitionGroups", type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicyDefinitionGroup", + }, + }, + }, }, - expiresOn: { - serializedName: "properties.expiresOn", + version: { + serializedName: "properties.version", type: { - name: "DateTime" - } + name: "String", + }, }, - displayName: { - serializedName: "properties.displayName", + }, + }, +}; + +export const PolicyTokenRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PolicyTokenRequest", + modelProperties: { + operation: { + serializedName: "operation", type: { - name: "String" - } + name: "Composite", + className: "PolicyTokenOperation", + }, }, - description: { - serializedName: "properties.description", + changeReference: { + serializedName: "changeReference", type: { - name: "String" - } + name: "String", + }, }, - metadata: { - serializedName: "properties.metadata", + }, + }, +}; + +export const PolicyTokenOperation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PolicyTokenOperation", + modelProperties: { + uri: { + serializedName: "uri", + type: { + name: "String", + }, + }, + httpMethod: { + serializedName: "httpMethod", + type: { + name: "String", + }, + }, + content: { + serializedName: "content", type: { - name: "any" - } - } - } - } + name: "any", + }, + }, + }, + }, }; -export const PolicyExemptionListResult: coreClient.CompositeMapper = { +export const PolicyTokenResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyExemptionListResult", + className: "PolicyTokenResponse", modelProperties: { - value: { - serializedName: "value", + result: { + serializedName: "result", + type: { + name: "String", + }, + }, + message: { + serializedName: "message", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retryAfter", + type: { + name: "DateTime", + }, + }, + results: { + serializedName: "results", type: { name: "Sequence", element: { type: { name: "Composite", - className: "PolicyExemption" - } - } - } + className: "ExternalEvaluationEndpointInvocationResult", + }, + }, + }, }, - nextLink: { - serializedName: "nextLink", - readOnly: true, + changeReference: { + serializedName: "changeReference", + type: { + name: "String", + }, + }, + token: { + serializedName: "token", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + tokenId: { + serializedName: "tokenId", + type: { + name: "String", + }, + }, + expiration: { + serializedName: "expiration", + type: { + name: "DateTime", + }, + }, + }, + }, +}; + +export const ExternalEvaluationEndpointInvocationResult: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "ExternalEvaluationEndpointInvocationResult", + modelProperties: { + policyInfo: { + serializedName: "policyInfo", + type: { + name: "Composite", + className: "PolicyLogInfo", + }, + }, + result: { + serializedName: "result", + type: { + name: "String", + }, + }, + message: { + serializedName: "message", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retryAfter", + type: { + name: "DateTime", + }, + }, + claims: { + serializedName: "claims", + type: { + name: "any", + }, + }, + expiration: { + serializedName: "expiration", + type: { + name: "DateTime", + }, + }, + }, + }, + }; + +export const PolicyLogInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PolicyLogInfo", + modelProperties: { + policyDefinitionId: { + serializedName: "policyDefinitionId", + type: { + name: "String", + }, + }, + policySetDefinitionId: { + serializedName: "policySetDefinitionId", + type: { + name: "String", + }, + }, + policyDefinitionReferenceId: { + serializedName: "policyDefinitionReferenceId", + type: { + name: "String", + }, + }, + policySetDefinitionName: { + serializedName: "policySetDefinitionName", + type: { + name: "String", + }, + }, + policySetDefinitionDisplayName: { + serializedName: "policySetDefinitionDisplayName", + type: { + name: "String", + }, + }, + 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: "String", + }, + }, + }, + }, + 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: "String", + }, + }, + }, + }, + }, + }, }; diff --git a/sdk/policy/arm-policy/src/models/parameters.ts b/sdk/policy/arm-policy/src/models/parameters.ts index fb889168ae82..d9868f57a013 100644 --- a/sdk/policy/arm-policy/src/models/parameters.ts +++ b/sdk/policy/arm-policy/src/models/parameters.ts @@ -9,14 +9,16 @@ import { OperationParameter, OperationURLParameter, - OperationQueryParameter + OperationQueryParameter, } from "@azure/core-client"; import { PolicyAssignment as PolicyAssignmentMapper, PolicyAssignmentUpdate as PolicyAssignmentUpdateMapper, PolicyDefinition as PolicyDefinitionMapper, + PolicyDefinitionVersion as PolicyDefinitionVersionMapper, PolicySetDefinition as PolicySetDefinitionMapper, - PolicyExemption as PolicyExemptionMapper + PolicySetDefinitionVersion as PolicySetDefinitionVersionMapper, + PolicyTokenRequest as PolicyTokenRequestMapper, } from "../models/mappers.js"; export const accept: OperationParameter = { @@ -26,9 +28,9 @@ export const accept: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const $host: OperationURLParameter = { @@ -37,56 +39,10 @@ export const $host: OperationURLParameter = { serializedName: "$host", required: true, type: { - name: "String" - } - }, - skipEncoding: true -}; - -export const policyMode: OperationURLParameter = { - parameterPath: "policyMode", - mapper: { - serializedName: "policyMode", - required: true, - type: { - name: "String" - } - } -}; - -export const apiVersion: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2020-09-01", - isConstant: true, - serializedName: "api-version", - type: { - name: "String" - } - } -}; - -export const filter: OperationQueryParameter = { - parameterPath: ["options", "filter"], - mapper: { - serializedName: "$filter", - type: { - name: "String" - } - }, - skipEncoding: true -}; - -export const nextLink: OperationURLParameter = { - parameterPath: "nextLink", - mapper: { - serializedName: "nextLink", - required: true, - type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const scope: OperationURLParameter = { @@ -95,33 +51,36 @@ export const scope: OperationURLParameter = { serializedName: "scope", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const policyAssignmentName: OperationURLParameter = { parameterPath: "policyAssignmentName", mapper: { + constraints: { + Pattern: new RegExp("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$"), + }, serializedName: "policyAssignmentName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const apiVersion1: OperationQueryParameter = { +export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-06-01", + defaultValue: "2025-03-01", isConstant: true, serializedName: "api-version", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const contentType: OperationParameter = { @@ -131,19 +90,40 @@ export const contentType: OperationParameter = { isConstant: true, serializedName: "Content-Type", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const parameters: OperationParameter = { parameterPath: "parameters", - mapper: PolicyAssignmentMapper + mapper: PolicyAssignmentMapper, +}; + +export const expand: OperationQueryParameter = { + parameterPath: ["options", "expand"], + mapper: { + serializedName: "$expand", + type: { + name: "String", + }, + }, }; export const parameters1: OperationParameter = { parameterPath: "parameters", - mapper: PolicyAssignmentUpdateMapper + mapper: PolicyAssignmentUpdateMapper, +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + serializedName: "subscriptionId", + required: true, + type: { + name: "Uuid", + }, + }, }; export const resourceGroupName: OperationURLParameter = { @@ -152,14 +132,25 @@ 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 filter: OperationQueryParameter = { + parameterPath: ["options", "filter"], + mapper: { + serializedName: "$filter", + type: { + name: "String", + }, + }, + skipEncoding: true, }; export const top: OperationQueryParameter = { @@ -167,24 +158,13 @@ export const top: OperationQueryParameter = { mapper: { constraints: { InclusiveMaximum: 1000, - InclusiveMinimum: 1 + InclusiveMinimum: 1, }, serializedName: "$top", type: { - name: "Number" - } - } -}; - -export const subscriptionId: OperationURLParameter = { - parameterPath: "subscriptionId", - mapper: { - serializedName: "subscriptionId", - required: true, - type: { - name: "String" - } - } + name: "Number", + }, + }, }; export const resourceProviderNamespace: OperationURLParameter = { @@ -193,9 +173,9 @@ export const resourceProviderNamespace: OperationURLParameter = { serializedName: "resourceProviderNamespace", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const parentResourcePath: OperationURLParameter = { @@ -204,10 +184,10 @@ export const parentResourcePath: OperationURLParameter = { serializedName: "parentResourcePath", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const resourceType: OperationURLParameter = { @@ -216,21 +196,24 @@ export const resourceType: OperationURLParameter = { serializedName: "resourceType", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const resourceName: OperationURLParameter = { parameterPath: "resourceName", mapper: { + constraints: { + Pattern: new RegExp("^.+$"), + }, serializedName: "resourceName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const managementGroupId: OperationURLParameter = { @@ -239,9 +222,9 @@ export const managementGroupId: OperationURLParameter = { serializedName: "managementGroupId", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const policyAssignmentId: OperationURLParameter = { @@ -250,68 +233,102 @@ export const policyAssignmentId: OperationURLParameter = { serializedName: "policyAssignmentId", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String", + }, + }, + skipEncoding: true, }; export const parameters2: OperationParameter = { parameterPath: "parameters", - mapper: PolicyDefinitionMapper + mapper: PolicyDefinitionMapper, }; export const policyDefinitionName: OperationURLParameter = { parameterPath: "policyDefinitionName", mapper: { + constraints: { + Pattern: new RegExp("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$"), + }, serializedName: "policyDefinitionName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, +}; + +export const managementGroupName: OperationURLParameter = { + parameterPath: "managementGroupName", + mapper: { + constraints: { + MaxLength: 90, + MinLength: 1, + }, + serializedName: "managementGroupName", + required: true, + type: { + name: "String", + }, + }, }; export const parameters3: OperationParameter = { parameterPath: "parameters", - mapper: PolicySetDefinitionMapper + mapper: PolicyDefinitionVersionMapper, }; -export const policySetDefinitionName: OperationURLParameter = { - parameterPath: "policySetDefinitionName", +export const policyDefinitionVersion: OperationURLParameter = { + parameterPath: "policyDefinitionVersion", mapper: { - serializedName: "policySetDefinitionName", + constraints: { + Pattern: new RegExp("^\\d+\\.\\d+\\.\\d+$"), + }, + serializedName: "policyDefinitionVersion", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const policyExemptionName: OperationURLParameter = { - parameterPath: "policyExemptionName", +export const parameters4: OperationParameter = { + parameterPath: "parameters", + mapper: PolicySetDefinitionMapper, +}; + +export const policySetDefinitionName: OperationURLParameter = { + parameterPath: "policySetDefinitionName", mapper: { - serializedName: "policyExemptionName", + constraints: { + Pattern: new RegExp("^[^<>*%&:\\?.+/]*[^<>*%&:\\?.+/ ]+$"), + }, + serializedName: "policySetDefinitionName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const apiVersion2: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2020-07-01-preview", - isConstant: true, - serializedName: "api-version", - type: { - name: "String" - } - } +export const parameters5: OperationParameter = { + parameterPath: "parameters", + mapper: PolicySetDefinitionVersionMapper, }; -export const parameters4: OperationParameter = { +export const parameters6: OperationParameter = { parameterPath: "parameters", - mapper: PolicyExemptionMapper + mapper: PolicyTokenRequestMapper, }; diff --git a/sdk/policy/arm-policy/src/operations/dataPolicyManifests.ts b/sdk/policy/arm-policy/src/operations/dataPolicyManifests.ts deleted file mode 100644 index fe6c3d4da7c9..000000000000 --- a/sdk/policy/arm-policy/src/operations/dataPolicyManifests.ts +++ /dev/null @@ -1,190 +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 { DataPolicyManifests } 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 { - DataPolicyManifest, - DataPolicyManifestsListNextOptionalParams, - DataPolicyManifestsListOptionalParams, - DataPolicyManifestsListResponse, - DataPolicyManifestsGetByPolicyModeOptionalParams, - DataPolicyManifestsGetByPolicyModeResponse, - DataPolicyManifestsListNextResponse -} from "../models/index.js"; - -/// -/** Class containing DataPolicyManifests operations. */ -export class DataPolicyManifestsImpl implements DataPolicyManifests { - private readonly client: PolicyClient; - - /** - * Initialize a new instance of the class DataPolicyManifests class. - * @param client Reference to the service client - */ - constructor(client: PolicyClient) { - this.client = client; - } - - /** - * This operation retrieves a list of all the data policy manifests that match the optional given - * $filter. Valid values for $filter are: "$filter=namespace eq '{0}'". If $filter is not provided, the - * unfiltered list includes all data policy manifests for data resource types. If $filter=namespace is - * provided, the returned list only includes all data policy manifests that have a namespace matching - * the provided value. - * @param options The options parameters. - */ - public list( - options?: DataPolicyManifestsListOptionalParams - ): 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?: DataPolicyManifestsListOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: DataPolicyManifestsListResponse; - 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?: DataPolicyManifestsListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * This operation retrieves the data policy manifest with the given policy mode. - * @param policyMode The policy mode of the data policy manifest to get. - * @param options The options parameters. - */ - getByPolicyMode( - policyMode: string, - options?: DataPolicyManifestsGetByPolicyModeOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { policyMode, options }, - getByPolicyModeOperationSpec - ); - } - - /** - * This operation retrieves a list of all the data policy manifests that match the optional given - * $filter. Valid values for $filter are: "$filter=namespace eq '{0}'". If $filter is not provided, the - * unfiltered list includes all data policy manifests for data resource types. If $filter=namespace is - * provided, the returned list only includes all data policy manifests that have a namespace matching - * the provided value. - * @param options The options parameters. - */ - private _list( - options?: DataPolicyManifestsListOptionalParams - ): 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?: DataPolicyManifestsListNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getByPolicyModeOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Authorization/dataPolicyManifests/{policyMode}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DataPolicyManifest - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.policyMode], - headerParameters: [Parameters.accept], - serializer -}; -const listOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Authorization/dataPolicyManifests", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DataPolicyManifestListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [Parameters.$host], - headerParameters: [Parameters.accept], - serializer -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DataPolicyManifestListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - urlParameters: [Parameters.$host, Parameters.nextLink], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/policy/arm-policy/src/operations/index.ts b/sdk/policy/arm-policy/src/operations/index.ts index cc113d214132..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 "./dataPolicyManifests.js"; export * from "./policyAssignments.js"; export * from "./policyDefinitions.js"; +export * from "./policyDefinitionVersions.js"; export * from "./policySetDefinitions.js"; -export * from "./policyExemptions.js"; +export * from "./policySetDefinitionVersions.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 2c710b34ad16..cce833df6178 100644 --- a/sdk/policy/arm-policy/src/operations/policyAssignments.ts +++ b/sdk/policy/arm-policy/src/operations/policyAssignments.ts @@ -47,7 +47,7 @@ import { PolicyAssignmentsListForResourceGroupNextResponse, PolicyAssignmentsListForResourceNextResponse, PolicyAssignmentsListForManagementGroupNextResponse, - PolicyAssignmentsListNextResponse + PolicyAssignmentsListNextResponse, } from "../models/index.js"; /// @@ -80,7 +80,7 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { */ public listForResourceGroup( resourceGroupName: string, - options?: PolicyAssignmentsListForResourceGroupOptionalParams + options?: PolicyAssignmentsListForResourceGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listForResourceGroupPagingAll(resourceGroupName, options); return { @@ -97,16 +97,16 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { return this.listForResourceGroupPagingPage( resourceGroupName, options, - settings + settings, ); - } + }, }; } private async *listForResourceGroupPagingPage( resourceGroupName: string, options?: PolicyAssignmentsListForResourceGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: PolicyAssignmentsListForResourceGroupResponse; let continuationToken = settings?.continuationToken; @@ -121,7 +121,7 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { result = await this._listForResourceGroupNext( resourceGroupName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -132,11 +132,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { private async *listForResourceGroupPagingAll( resourceGroupName: string, - options?: PolicyAssignmentsListForResourceGroupOptionalParams + options?: PolicyAssignmentsListForResourceGroupOptionalParams, ): AsyncIterableIterator { for await (const page of this.listForResourceGroupPagingPage( resourceGroupName, - options + options, )) { yield* page; } @@ -180,7 +180,7 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { parentResourcePath: string, resourceType: string, resourceName: string, - options?: PolicyAssignmentsListForResourceOptionalParams + options?: PolicyAssignmentsListForResourceOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listForResourcePagingAll( resourceGroupName, @@ -188,7 +188,7 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { parentResourcePath, resourceType, resourceName, - options + options, ); return { next() { @@ -208,9 +208,9 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { resourceType, resourceName, options, - settings + settings, ); - } + }, }; } @@ -221,7 +221,7 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { resourceType: string, resourceName: string, options?: PolicyAssignmentsListForResourceOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: PolicyAssignmentsListForResourceResponse; let continuationToken = settings?.continuationToken; @@ -232,7 +232,7 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { parentResourcePath, resourceType, resourceName, - options + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -247,7 +247,7 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { resourceType, resourceName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -262,7 +262,7 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { parentResourcePath: string, resourceType: string, resourceName: string, - options?: PolicyAssignmentsListForResourceOptionalParams + options?: PolicyAssignmentsListForResourceOptionalParams, ): AsyncIterableIterator { for await (const page of this.listForResourcePagingPage( resourceGroupName, @@ -270,7 +270,7 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { parentResourcePath, resourceType, resourceName, - options + options, )) { yield* page; } @@ -290,11 +290,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { */ public listForManagementGroup( managementGroupId: string, - options?: PolicyAssignmentsListForManagementGroupOptionalParams + options?: PolicyAssignmentsListForManagementGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listForManagementGroupPagingAll( managementGroupId, - options + options, ); return { next() { @@ -310,16 +310,16 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { return this.listForManagementGroupPagingPage( managementGroupId, options, - settings + settings, ); - } + }, }; } private async *listForManagementGroupPagingPage( managementGroupId: string, options?: PolicyAssignmentsListForManagementGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: PolicyAssignmentsListForManagementGroupResponse; let continuationToken = settings?.continuationToken; @@ -334,7 +334,7 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { result = await this._listForManagementGroupNext( managementGroupId, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -345,11 +345,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { private async *listForManagementGroupPagingAll( managementGroupId: string, - options?: PolicyAssignmentsListForManagementGroupOptionalParams + options?: PolicyAssignmentsListForManagementGroupOptionalParams, ): AsyncIterableIterator { for await (const page of this.listForManagementGroupPagingPage( managementGroupId, - options + options, )) { yield* page; } @@ -370,7 +370,7 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { * @param options The options parameters. */ public list( - options?: PolicyAssignmentsListOptionalParams + options?: PolicyAssignmentsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -385,13 +385,13 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: PolicyAssignmentsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: PolicyAssignmentsListResponse; let continuationToken = settings?.continuationToken; @@ -412,7 +412,7 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { } private async *listPagingAll( - options?: PolicyAssignmentsListOptionalParams + options?: PolicyAssignmentsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -434,11 +434,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { delete( scope: string, policyAssignmentName: string, - options?: PolicyAssignmentsDeleteOptionalParams + options?: PolicyAssignmentsDeleteOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, policyAssignmentName, options }, - deleteOperationSpec + deleteOperationSpec, ); } @@ -459,11 +459,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { scope: string, policyAssignmentName: string, parameters: PolicyAssignment, - options?: PolicyAssignmentsCreateOptionalParams + options?: PolicyAssignmentsCreateOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, policyAssignmentName, parameters, options }, - createOperationSpec + createOperationSpec, ); } @@ -480,11 +480,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { get( scope: string, policyAssignmentName: string, - options?: PolicyAssignmentsGetOptionalParams + options?: PolicyAssignmentsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, policyAssignmentName, options }, - getOperationSpec + getOperationSpec, ); } @@ -505,11 +505,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { scope: string, policyAssignmentName: string, parameters: PolicyAssignmentUpdate, - options?: PolicyAssignmentsUpdateOptionalParams + options?: PolicyAssignmentsUpdateOptionalParams, ): Promise { return this.client.sendOperationRequest( { scope, policyAssignmentName, parameters, options }, - updateOperationSpec + updateOperationSpec, ); } @@ -530,11 +530,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { */ private _listForResourceGroup( resourceGroupName: string, - options?: PolicyAssignmentsListForResourceGroupOptionalParams + options?: PolicyAssignmentsListForResourceGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, options }, - listForResourceGroupOperationSpec + listForResourceGroupOperationSpec, ); } @@ -576,7 +576,7 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { parentResourcePath: string, resourceType: string, resourceName: string, - options?: PolicyAssignmentsListForResourceOptionalParams + options?: PolicyAssignmentsListForResourceOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -585,9 +585,9 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { parentResourcePath, resourceType, resourceName, - options + options, }, - listForResourceOperationSpec + listForResourceOperationSpec, ); } @@ -605,11 +605,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { */ private _listForManagementGroup( managementGroupId: string, - options?: PolicyAssignmentsListForManagementGroupOptionalParams + options?: PolicyAssignmentsListForManagementGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { managementGroupId, options }, - listForManagementGroupOperationSpec + listForManagementGroupOperationSpec, ); } @@ -628,7 +628,7 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { * @param options The options parameters. */ private _list( - options?: PolicyAssignmentsListOptionalParams + options?: PolicyAssignmentsListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -647,11 +647,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { */ deleteById( policyAssignmentId: string, - options?: PolicyAssignmentsDeleteByIdOptionalParams + options?: PolicyAssignmentsDeleteByIdOptionalParams, ): Promise { return this.client.sendOperationRequest( { policyAssignmentId, options }, - deleteByIdOperationSpec + deleteByIdOperationSpec, ); } @@ -673,11 +673,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { createById( policyAssignmentId: string, parameters: PolicyAssignment, - options?: PolicyAssignmentsCreateByIdOptionalParams + options?: PolicyAssignmentsCreateByIdOptionalParams, ): Promise { return this.client.sendOperationRequest( { policyAssignmentId, parameters, options }, - createByIdOperationSpec + createByIdOperationSpec, ); } @@ -695,11 +695,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { */ getById( policyAssignmentId: string, - options?: PolicyAssignmentsGetByIdOptionalParams + options?: PolicyAssignmentsGetByIdOptionalParams, ): Promise { return this.client.sendOperationRequest( { policyAssignmentId, options }, - getByIdOperationSpec + getByIdOperationSpec, ); } @@ -721,11 +721,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { updateById( policyAssignmentId: string, parameters: PolicyAssignmentUpdate, - options?: PolicyAssignmentsUpdateByIdOptionalParams + options?: PolicyAssignmentsUpdateByIdOptionalParams, ): Promise { return this.client.sendOperationRequest( { policyAssignmentId, parameters, options }, - updateByIdOperationSpec + updateByIdOperationSpec, ); } @@ -738,11 +738,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { private _listForResourceGroupNext( resourceGroupName: string, nextLink: string, - options?: PolicyAssignmentsListForResourceGroupNextOptionalParams + options?: PolicyAssignmentsListForResourceGroupNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, nextLink, options }, - listForResourceGroupNextOperationSpec + listForResourceGroupNextOperationSpec, ); } @@ -765,7 +765,7 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { resourceType: string, resourceName: string, nextLink: string, - options?: PolicyAssignmentsListForResourceNextOptionalParams + options?: PolicyAssignmentsListForResourceNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -775,9 +775,9 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { resourceType, resourceName, nextLink, - options + options, }, - listForResourceNextOperationSpec + listForResourceNextOperationSpec, ); } @@ -790,11 +790,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { private _listForManagementGroupNext( managementGroupId: string, nextLink: string, - options?: PolicyAssignmentsListForManagementGroupNextOptionalParams + options?: PolicyAssignmentsListForManagementGroupNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { managementGroupId, nextLink, options }, - listForManagementGroupNextOperationSpec + listForManagementGroupNextOperationSpec, ); } @@ -805,11 +805,11 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { */ private _listNext( nextLink: string, - options?: PolicyAssignmentsListNextOptionalParams + options?: PolicyAssignmentsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -817,322 +817,334 @@ export class PolicyAssignmentsImpl implements PolicyAssignments { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", + path: "/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", httpMethod: "DELETE", responses: { 200: { - bodyMapper: Mappers.PolicyAssignment + bodyMapper: Mappers.PolicyAssignment, }, 204: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.scope, - Parameters.policyAssignmentName + Parameters.policyAssignmentName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", + path: "/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", httpMethod: "PUT", responses: { 201: { - bodyMapper: Mappers.PolicyAssignment + bodyMapper: Mappers.PolicyAssignment, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.scope, - Parameters.policyAssignmentName + Parameters.policyAssignmentName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", + path: "/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyAssignment + bodyMapper: Mappers.PolicyAssignment, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [ Parameters.$host, Parameters.scope, - Parameters.policyAssignmentName + Parameters.policyAssignmentName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const updateOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", + path: "/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.PolicyAssignment + bodyMapper: Mappers.PolicyAssignment, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters1, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.scope, - Parameters.policyAssignmentName + Parameters.policyAssignmentName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const listForResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/policyAssignments", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/policyAssignments", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyAssignmentListResult + bodyMapper: Mappers.PolicyAssignmentListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], + queryParameters: [ + Parameters.apiVersion, + Parameters.expand, + Parameters.filter, + Parameters.top, + ], urlParameters: [ Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.subscriptionId ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listForResourceOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/policyAssignments", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/policyAssignments", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyAssignmentListResult + bodyMapper: Mappers.PolicyAssignmentListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], + queryParameters: [ + Parameters.apiVersion, + Parameters.expand, + Parameters.filter, + Parameters.top, + ], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, - Parameters.resourceName + Parameters.resourceName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listForManagementGroupOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyAssignments", + path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyAssignments", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyAssignmentListResult + bodyMapper: Mappers.PolicyAssignmentListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], + queryParameters: [ + Parameters.apiVersion, + Parameters.expand, + Parameters.filter, + Parameters.top, + ], urlParameters: [Parameters.$host, Parameters.managementGroupId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyAssignments", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyAssignments", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyAssignmentListResult + bodyMapper: Mappers.PolicyAssignmentListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], + queryParameters: [ + Parameters.apiVersion, + Parameters.expand, + Parameters.filter, + Parameters.top, + ], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const deleteByIdOperationSpec: coreClient.OperationSpec = { path: "/{policyAssignmentId}", httpMethod: "DELETE", responses: { 200: { - bodyMapper: Mappers.PolicyAssignment + bodyMapper: Mappers.PolicyAssignment, }, 204: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.policyAssignmentId], headerParameters: [Parameters.accept], - serializer + serializer, }; const createByIdOperationSpec: coreClient.OperationSpec = { path: "/{policyAssignmentId}", httpMethod: "PUT", responses: { 201: { - bodyMapper: Mappers.PolicyAssignment + bodyMapper: Mappers.PolicyAssignment, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.policyAssignmentId], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const getByIdOperationSpec: coreClient.OperationSpec = { path: "/{policyAssignmentId}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyAssignment + bodyMapper: Mappers.PolicyAssignment, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.policyAssignmentId], headerParameters: [Parameters.accept], - serializer + serializer, }; const updateByIdOperationSpec: coreClient.OperationSpec = { path: "/{policyAssignmentId}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.PolicyAssignment + bodyMapper: Mappers.PolicyAssignment, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters1, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.policyAssignmentId], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const listForResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyAssignmentListResult + bodyMapper: Mappers.PolicyAssignmentListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, - Parameters.nextLink, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listForResourceNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyAssignmentListResult + bodyMapper: Mappers.PolicyAssignmentListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, - Parameters.nextLink, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, - Parameters.resourceName + Parameters.resourceName, + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listForManagementGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyAssignmentListResult + bodyMapper: Mappers.PolicyAssignmentListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, + Parameters.managementGroupId, Parameters.nextLink, - Parameters.managementGroupId ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyAssignmentListResult + bodyMapper: Mappers.PolicyAssignmentListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, + Parameters.subscriptionId, Parameters.nextLink, - Parameters.subscriptionId ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/policy/arm-policy/src/operations/policyDefinitionVersions.ts b/sdk/policy/arm-policy/src/operations/policyDefinitionVersions.ts new file mode 100644 index 000000000000..7b9c28c36874 --- /dev/null +++ b/sdk/policy/arm-policy/src/operations/policyDefinitionVersions.ts @@ -0,0 +1,902 @@ +/* + * 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 { 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 { PolicyClient } from "../policyClient.js"; +import { + PolicyDefinitionVersion, + PolicyDefinitionVersionsListNextOptionalParams, + PolicyDefinitionVersionsListOptionalParams, + PolicyDefinitionVersionsListResponse, + PolicyDefinitionVersionsListBuiltInNextOptionalParams, + PolicyDefinitionVersionsListBuiltInOptionalParams, + PolicyDefinitionVersionsListBuiltInResponse, + PolicyDefinitionVersionsListByManagementGroupNextOptionalParams, + PolicyDefinitionVersionsListByManagementGroupOptionalParams, + PolicyDefinitionVersionsListByManagementGroupResponse, + PolicyDefinitionVersionsListAllBuiltinsOptionalParams, + PolicyDefinitionVersionsListAllBuiltinsResponse, + PolicyDefinitionVersionsListAllAtManagementGroupOptionalParams, + PolicyDefinitionVersionsListAllAtManagementGroupResponse, + PolicyDefinitionVersionsListAllOptionalParams, + PolicyDefinitionVersionsListAllResponse, + PolicyDefinitionVersionsCreateOrUpdateOptionalParams, + PolicyDefinitionVersionsCreateOrUpdateResponse, + PolicyDefinitionVersionsDeleteOptionalParams, + PolicyDefinitionVersionsGetOptionalParams, + PolicyDefinitionVersionsGetResponse, + PolicyDefinitionVersionsGetBuiltInOptionalParams, + PolicyDefinitionVersionsGetBuiltInResponse, + PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams, + PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupResponse, + PolicyDefinitionVersionsDeleteAtManagementGroupOptionalParams, + PolicyDefinitionVersionsGetAtManagementGroupOptionalParams, + PolicyDefinitionVersionsGetAtManagementGroupResponse, + PolicyDefinitionVersionsListNextResponse, + PolicyDefinitionVersionsListBuiltInNextResponse, + PolicyDefinitionVersionsListByManagementGroupNextResponse, +} from "../models/index.js"; + +/// +/** Class containing PolicyDefinitionVersions operations. */ +export class PolicyDefinitionVersionsImpl implements PolicyDefinitionVersions { + private readonly client: PolicyClient; + + /** + * Initialize a new instance of the class PolicyDefinitionVersions class. + * @param client Reference to the service client + */ + constructor(client: PolicyClient) { + this.client = client; + } + + /** + * This operation retrieves a list of all the policy definition versions for the given policy + * definition. + * @param policyDefinitionName The name of the policy definition. + * @param options The options parameters. + */ + public list( + policyDefinitionName: string, + options?: PolicyDefinitionVersionsListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(policyDefinitionName, 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(policyDefinitionName, options, settings); + }, + }; + } + + private async *listPagingPage( + policyDefinitionName: string, + options?: PolicyDefinitionVersionsListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: PolicyDefinitionVersionsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(policyDefinitionName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + policyDefinitionName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + policyDefinitionName: string, + options?: PolicyDefinitionVersionsListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + policyDefinitionName, + options, + )) { + yield* page; + } + } + + /** + * This operation retrieves a list of all the built-in policy definition versions for the given policy + * definition. + * @param policyDefinitionName The name of the policy definition. + * @param options The options parameters. + */ + public listBuiltIn( + policyDefinitionName: string, + options?: PolicyDefinitionVersionsListBuiltInOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listBuiltInPagingAll(policyDefinitionName, 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.listBuiltInPagingPage( + policyDefinitionName, + options, + settings, + ); + }, + }; + } + + private async *listBuiltInPagingPage( + policyDefinitionName: string, + options?: PolicyDefinitionVersionsListBuiltInOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: PolicyDefinitionVersionsListBuiltInResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBuiltIn(policyDefinitionName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBuiltInNext( + policyDefinitionName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBuiltInPagingAll( + policyDefinitionName: string, + options?: PolicyDefinitionVersionsListBuiltInOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listBuiltInPagingPage( + policyDefinitionName, + options, + )) { + yield* page; + } + } + + /** + * This operation retrieves a list of all the policy definition versions for the given policy + * definition in the given management group. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policyDefinitionName The name of the policy definition. + * @param options The options parameters. + */ + public listByManagementGroup( + managementGroupName: string, + policyDefinitionName: string, + options?: PolicyDefinitionVersionsListByManagementGroupOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByManagementGroupPagingAll( + managementGroupName, + policyDefinitionName, + 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.listByManagementGroupPagingPage( + managementGroupName, + policyDefinitionName, + options, + settings, + ); + }, + }; + } + + private async *listByManagementGroupPagingPage( + managementGroupName: string, + policyDefinitionName: string, + options?: PolicyDefinitionVersionsListByManagementGroupOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: PolicyDefinitionVersionsListByManagementGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByManagementGroup( + managementGroupName, + policyDefinitionName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByManagementGroupNext( + managementGroupName, + policyDefinitionName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByManagementGroupPagingAll( + managementGroupName: string, + policyDefinitionName: string, + options?: PolicyDefinitionVersionsListByManagementGroupOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByManagementGroupPagingPage( + managementGroupName, + policyDefinitionName, + options, + )) { + yield* page; + } + } + + /** + * This operation lists all the built-in policy definition versions for all built-in policy + * definitions. + * @param options The options parameters. + */ + listAllBuiltins( + options?: PolicyDefinitionVersionsListAllBuiltinsOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { options }, + listAllBuiltinsOperationSpec, + ); + } + + /** + * This operation lists all the policy definition versions for all policy definitions at the management + * group scope. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param options The options parameters. + */ + listAllAtManagementGroup( + managementGroupName: string, + options?: PolicyDefinitionVersionsListAllAtManagementGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { managementGroupName, options }, + listAllAtManagementGroupOperationSpec, + ); + } + + /** + * This operation lists all the policy definition versions for all policy definitions within a + * subscription. + * @param options The options parameters. + */ + listAll( + options?: PolicyDefinitionVersionsListAllOptionalParams, + ): Promise { + return this.client.sendOperationRequest({ options }, listAllOperationSpec); + } + + /** + * This operation creates or updates a policy definition in the given subscription with the given name. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the + * major version number, y is the minor version number, and z is the patch number + * @param parameters The policy definition properties. + * @param options The options parameters. + */ + createOrUpdate( + policyDefinitionName: string, + policyDefinitionVersion: string, + parameters: PolicyDefinitionVersion, + options?: PolicyDefinitionVersionsCreateOrUpdateOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policyDefinitionName, policyDefinitionVersion, parameters, options }, + createOrUpdateOperationSpec, + ); + } + + /** + * This operation deletes the policy definition version in the given subscription with the given name. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the + * major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + delete( + policyDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicyDefinitionVersionsDeleteOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policyDefinitionName, policyDefinitionVersion, options }, + deleteOperationSpec, + ); + } + + /** + * This operation retrieves the policy definition version in the given subscription with the given + * name. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the + * major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + get( + policyDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicyDefinitionVersionsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policyDefinitionName, policyDefinitionVersion, options }, + getOperationSpec, + ); + } + + /** + * This operation retrieves the built-in policy definition version with the given name. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the + * major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + getBuiltIn( + policyDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicyDefinitionVersionsGetBuiltInOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policyDefinitionName, policyDefinitionVersion, options }, + getBuiltInOperationSpec, + ); + } + + /** + * This operation creates or updates a policy definition version in the given management group with the + * given name. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the + * major version number, y is the minor version number, and z is the patch number + * @param parameters The policy definition properties. + * @param options The options parameters. + */ + createOrUpdateAtManagementGroup( + managementGroupName: string, + policyDefinitionName: string, + policyDefinitionVersion: string, + parameters: PolicyDefinitionVersion, + options?: PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + managementGroupName, + policyDefinitionName, + policyDefinitionVersion, + parameters, + options, + }, + createOrUpdateAtManagementGroupOperationSpec, + ); + } + + /** + * This operation deletes the policy definition in the given management group with the given name. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the + * major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + deleteAtManagementGroup( + managementGroupName: string, + policyDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicyDefinitionVersionsDeleteAtManagementGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + managementGroupName, + policyDefinitionName, + policyDefinitionVersion, + options, + }, + deleteAtManagementGroupOperationSpec, + ); + } + + /** + * This operation retrieves the policy definition version in the given management group with the given + * name. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the + * major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + getAtManagementGroup( + managementGroupName: string, + policyDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicyDefinitionVersionsGetAtManagementGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + managementGroupName, + policyDefinitionName, + policyDefinitionVersion, + options, + }, + getAtManagementGroupOperationSpec, + ); + } + + /** + * This operation retrieves a list of all the policy definition versions for the given policy + * definition. + * @param policyDefinitionName The name of the policy definition. + * @param options The options parameters. + */ + private _list( + policyDefinitionName: string, + options?: PolicyDefinitionVersionsListOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policyDefinitionName, options }, + listOperationSpec, + ); + } + + /** + * This operation retrieves a list of all the built-in policy definition versions for the given policy + * definition. + * @param policyDefinitionName The name of the policy definition. + * @param options The options parameters. + */ + private _listBuiltIn( + policyDefinitionName: string, + options?: PolicyDefinitionVersionsListBuiltInOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policyDefinitionName, options }, + listBuiltInOperationSpec, + ); + } + + /** + * This operation retrieves a list of all the policy definition versions for the given policy + * definition in the given management group. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policyDefinitionName The name of the policy definition. + * @param options The options parameters. + */ + private _listByManagementGroup( + managementGroupName: string, + policyDefinitionName: string, + options?: PolicyDefinitionVersionsListByManagementGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { managementGroupName, policyDefinitionName, options }, + listByManagementGroupOperationSpec, + ); + } + + /** + * ListNext + * @param policyDefinitionName The name of the policy definition. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + policyDefinitionName: string, + nextLink: string, + options?: PolicyDefinitionVersionsListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policyDefinitionName, nextLink, options }, + listNextOperationSpec, + ); + } + + /** + * ListBuiltInNext + * @param policyDefinitionName The name of the policy definition. + * @param nextLink The nextLink from the previous successful call to the ListBuiltIn method. + * @param options The options parameters. + */ + private _listBuiltInNext( + policyDefinitionName: string, + nextLink: string, + options?: PolicyDefinitionVersionsListBuiltInNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policyDefinitionName, nextLink, options }, + listBuiltInNextOperationSpec, + ); + } + + /** + * ListByManagementGroupNext + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policyDefinitionName The name of the policy definition. + * @param nextLink The nextLink from the previous successful call to the ListByManagementGroup method. + * @param options The options parameters. + */ + private _listByManagementGroupNext( + managementGroupName: string, + policyDefinitionName: string, + nextLink: string, + options?: PolicyDefinitionVersionsListByManagementGroupNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { managementGroupName, policyDefinitionName, nextLink, options }, + listByManagementGroupNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listAllBuiltinsOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Authorization/listPolicyDefinitionVersions", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer, +}; +const listAllAtManagementGroupOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/listPolicyDefinitionVersions", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.managementGroupName], + headerParameters: [Parameters.accept], + serializer, +}; +const listAllOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/listPolicyDefinitionVersions", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions/{policyDefinitionVersion}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionVersion, + }, + 201: { + bodyMapper: Mappers.PolicyDefinitionVersion, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.policyDefinitionName, + Parameters.policyDefinitionVersion, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions/{policyDefinitionVersion}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.policyDefinitionName, + Parameters.policyDefinitionVersion, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions/{policyDefinitionVersion}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionVersion, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.policyDefinitionName, + Parameters.policyDefinitionVersion, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getBuiltInOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions/{policyDefinitionVersion}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionVersion, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.policyDefinitionName, + Parameters.policyDefinitionVersion, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateAtManagementGroupOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions/{policyDefinitionVersion}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionVersion, + }, + 201: { + bodyMapper: Mappers.PolicyDefinitionVersion, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.policyDefinitionName, + Parameters.managementGroupName, + Parameters.policyDefinitionVersion, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteAtManagementGroupOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions/{policyDefinitionVersion}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.policyDefinitionName, + Parameters.managementGroupName, + Parameters.policyDefinitionVersion, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getAtManagementGroupOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions/{policyDefinitionVersion}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionVersion, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.policyDefinitionName, + Parameters.managementGroupName, + Parameters.policyDefinitionVersion, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.policyDefinitionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listBuiltInOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [Parameters.$host, Parameters.policyDefinitionName], + headerParameters: [Parameters.accept], + serializer, +}; +const listByManagementGroupOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.policyDefinitionName, + Parameters.managementGroupName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.policyDefinitionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listBuiltInNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.policyDefinitionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByManagementGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.policyDefinitionName, + Parameters.managementGroupName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/policy/arm-policy/src/operations/policyDefinitions.ts b/sdk/policy/arm-policy/src/operations/policyDefinitions.ts index 80104bb5fb73..5e1505b9e981 100644 --- a/sdk/policy/arm-policy/src/operations/policyDefinitions.ts +++ b/sdk/policy/arm-policy/src/operations/policyDefinitions.ts @@ -38,7 +38,7 @@ import { PolicyDefinitionsGetAtManagementGroupResponse, PolicyDefinitionsListNextResponse, PolicyDefinitionsListBuiltInNextResponse, - PolicyDefinitionsListByManagementGroupNextResponse + PolicyDefinitionsListByManagementGroupNextResponse, } from "../models/index.js"; /// @@ -68,7 +68,7 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { * @param options The options parameters. */ public list( - options?: PolicyDefinitionsListOptionalParams + options?: PolicyDefinitionsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -83,13 +83,13 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: PolicyDefinitionsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: PolicyDefinitionsListResponse; let continuationToken = settings?.continuationToken; @@ -110,7 +110,7 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { } private async *listPagingAll( - options?: PolicyDefinitionsListOptionalParams + options?: PolicyDefinitionsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -126,7 +126,7 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { * @param options The options parameters. */ public listBuiltIn( - options?: PolicyDefinitionsListBuiltInOptionalParams + options?: PolicyDefinitionsListBuiltInOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listBuiltInPagingAll(options); return { @@ -141,13 +141,13 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { throw new Error("maxPageSize is not supported by this operation."); } return this.listBuiltInPagingPage(options, settings); - } + }, }; } private async *listBuiltInPagingPage( options?: PolicyDefinitionsListBuiltInOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: PolicyDefinitionsListBuiltInResponse; let continuationToken = settings?.continuationToken; @@ -168,7 +168,7 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { } private async *listBuiltInPagingAll( - options?: PolicyDefinitionsListBuiltInOptionalParams + options?: PolicyDefinitionsListBuiltInOptionalParams, ): AsyncIterableIterator { for await (const page of this.listBuiltInPagingPage(options)) { yield* page; @@ -191,11 +191,11 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { */ public listByManagementGroup( managementGroupId: string, - options?: PolicyDefinitionsListByManagementGroupOptionalParams + options?: PolicyDefinitionsListByManagementGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByManagementGroupPagingAll( managementGroupId, - options + options, ); return { next() { @@ -211,16 +211,16 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { return this.listByManagementGroupPagingPage( managementGroupId, options, - settings + settings, ); - } + }, }; } private async *listByManagementGroupPagingPage( managementGroupId: string, options?: PolicyDefinitionsListByManagementGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: PolicyDefinitionsListByManagementGroupResponse; let continuationToken = settings?.continuationToken; @@ -235,7 +235,7 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { result = await this._listByManagementGroupNext( managementGroupId, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -246,11 +246,11 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { private async *listByManagementGroupPagingAll( managementGroupId: string, - options?: PolicyDefinitionsListByManagementGroupOptionalParams + options?: PolicyDefinitionsListByManagementGroupOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByManagementGroupPagingPage( managementGroupId, - options + options, )) { yield* page; } @@ -265,11 +265,11 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { createOrUpdate( policyDefinitionName: string, parameters: PolicyDefinition, - options?: PolicyDefinitionsCreateOrUpdateOptionalParams + options?: PolicyDefinitionsCreateOrUpdateOptionalParams, ): Promise { return this.client.sendOperationRequest( { policyDefinitionName, parameters, options }, - createOrUpdateOperationSpec + createOrUpdateOperationSpec, ); } @@ -280,11 +280,11 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { */ delete( policyDefinitionName: string, - options?: PolicyDefinitionsDeleteOptionalParams + options?: PolicyDefinitionsDeleteOptionalParams, ): Promise { return this.client.sendOperationRequest( { policyDefinitionName, options }, - deleteOperationSpec + deleteOperationSpec, ); } @@ -295,11 +295,11 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { */ get( policyDefinitionName: string, - options?: PolicyDefinitionsGetOptionalParams + options?: PolicyDefinitionsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { policyDefinitionName, options }, - getOperationSpec + getOperationSpec, ); } @@ -310,65 +310,65 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { */ getBuiltIn( policyDefinitionName: string, - options?: PolicyDefinitionsGetBuiltInOptionalParams + options?: PolicyDefinitionsGetBuiltInOptionalParams, ): Promise { return this.client.sendOperationRequest( { policyDefinitionName, options }, - getBuiltInOperationSpec + getBuiltInOperationSpec, ); } /** * This operation creates or updates a policy definition in the given management group with the given * name. - * @param policyDefinitionName The name of the policy definition to create. * @param managementGroupId The ID of the management group. + * @param policyDefinitionName The name of the policy definition to create. * @param parameters The policy definition properties. * @param options The options parameters. */ createOrUpdateAtManagementGroup( - policyDefinitionName: string, managementGroupId: string, + policyDefinitionName: string, parameters: PolicyDefinition, - options?: PolicyDefinitionsCreateOrUpdateAtManagementGroupOptionalParams + options?: PolicyDefinitionsCreateOrUpdateAtManagementGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( - { policyDefinitionName, managementGroupId, parameters, options }, - createOrUpdateAtManagementGroupOperationSpec + { managementGroupId, policyDefinitionName, parameters, options }, + createOrUpdateAtManagementGroupOperationSpec, ); } /** * This operation deletes the policy definition in the given management group with the given name. - * @param policyDefinitionName The name of the policy definition to delete. * @param managementGroupId The ID of the management group. + * @param policyDefinitionName The name of the policy definition to delete. * @param options The options parameters. */ deleteAtManagementGroup( - policyDefinitionName: string, managementGroupId: string, - options?: PolicyDefinitionsDeleteAtManagementGroupOptionalParams + policyDefinitionName: string, + options?: PolicyDefinitionsDeleteAtManagementGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( - { policyDefinitionName, managementGroupId, options }, - deleteAtManagementGroupOperationSpec + { managementGroupId, policyDefinitionName, options }, + deleteAtManagementGroupOperationSpec, ); } /** * This operation retrieves the policy definition in the given management group with the given name. - * @param policyDefinitionName The name of the policy definition to get. * @param managementGroupId The ID of the management group. + * @param policyDefinitionName The name of the policy definition to get. * @param options The options parameters. */ getAtManagementGroup( - policyDefinitionName: string, managementGroupId: string, - options?: PolicyDefinitionsGetAtManagementGroupOptionalParams + policyDefinitionName: string, + options?: PolicyDefinitionsGetAtManagementGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( - { policyDefinitionName, managementGroupId, options }, - getAtManagementGroupOperationSpec + { managementGroupId, policyDefinitionName, options }, + getAtManagementGroupOperationSpec, ); } @@ -386,7 +386,7 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { * @param options The options parameters. */ private _list( - options?: PolicyDefinitionsListOptionalParams + options?: PolicyDefinitionsListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -400,11 +400,11 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { * @param options The options parameters. */ private _listBuiltIn( - options?: PolicyDefinitionsListBuiltInOptionalParams + options?: PolicyDefinitionsListBuiltInOptionalParams, ): Promise { return this.client.sendOperationRequest( { options }, - listBuiltInOperationSpec + listBuiltInOperationSpec, ); } @@ -424,11 +424,11 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { */ private _listByManagementGroup( managementGroupId: string, - options?: PolicyDefinitionsListByManagementGroupOptionalParams + options?: PolicyDefinitionsListByManagementGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { managementGroupId, options }, - listByManagementGroupOperationSpec + listByManagementGroupOperationSpec, ); } @@ -439,11 +439,11 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { */ private _listNext( nextLink: string, - options?: PolicyDefinitionsListNextOptionalParams + options?: PolicyDefinitionsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } @@ -454,11 +454,11 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { */ private _listBuiltInNext( nextLink: string, - options?: PolicyDefinitionsListBuiltInNextOptionalParams + options?: PolicyDefinitionsListBuiltInNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listBuiltInNextOperationSpec + listBuiltInNextOperationSpec, ); } @@ -471,11 +471,11 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { private _listByManagementGroupNext( managementGroupId: string, nextLink: string, - options?: PolicyDefinitionsListByManagementGroupNextOptionalParams + options?: PolicyDefinitionsListByManagementGroupNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { managementGroupId, nextLink, options }, - listByManagementGroupNextOperationSpec + listByManagementGroupNextOperationSpec, ); } } @@ -483,250 +483,241 @@ export class PolicyDefinitionsImpl implements PolicyDefinitions { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", httpMethod: "PUT", responses: { 201: { - bodyMapper: Mappers.PolicyDefinition + bodyMapper: Mappers.PolicyDefinition, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters2, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.policyDefinitionName + Parameters.policyDefinitionName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", httpMethod: "DELETE", responses: { 200: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.policyDefinitionName + Parameters.policyDefinitionName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyDefinition + bodyMapper: Mappers.PolicyDefinition, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.policyDefinitionName + Parameters.policyDefinitionName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getBuiltInOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + path: "/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyDefinition + bodyMapper: Mappers.PolicyDefinition, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.policyDefinitionName], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateAtManagementGroupOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", httpMethod: "PUT", responses: { 201: { - bodyMapper: Mappers.PolicyDefinition + bodyMapper: Mappers.PolicyDefinition, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters2, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.managementGroupId, - Parameters.policyDefinitionName + Parameters.policyDefinitionName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const deleteAtManagementGroupOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", httpMethod: "DELETE", responses: { 200: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.managementGroupId, - Parameters.policyDefinitionName + Parameters.policyDefinitionName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getAtManagementGroupOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyDefinition + bodyMapper: Mappers.PolicyDefinition, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.managementGroupId, - Parameters.policyDefinitionName + Parameters.policyDefinitionName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyDefinitionListResult + bodyMapper: Mappers.PolicyDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], + queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listBuiltInOperationSpec: coreClient.OperationSpec = { path: "/providers/Microsoft.Authorization/policyDefinitions", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyDefinitionListResult + bodyMapper: Mappers.PolicyDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], + queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByManagementGroupOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions", + path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyDefinitionListResult + bodyMapper: Mappers.PolicyDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], + queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top], urlParameters: [Parameters.$host, Parameters.managementGroupId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyDefinitionListResult + bodyMapper: Mappers.PolicyDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, + Parameters.subscriptionId, Parameters.nextLink, - Parameters.subscriptionId ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listBuiltInNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyDefinitionListResult + bodyMapper: Mappers.PolicyDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByManagementGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicyDefinitionListResult + bodyMapper: Mappers.PolicyDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, + Parameters.managementGroupId, Parameters.nextLink, - Parameters.managementGroupId ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/policy/arm-policy/src/operations/policyExemptions.ts b/sdk/policy/arm-policy/src/operations/policyExemptions.ts deleted file mode 100644 index a362e9398e6b..000000000000 --- a/sdk/policy/arm-policy/src/operations/policyExemptions.ts +++ /dev/null @@ -1,877 +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 { PolicyExemptions } 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 { - PolicyExemption, - PolicyExemptionsListNextOptionalParams, - PolicyExemptionsListOptionalParams, - PolicyExemptionsListResponse, - PolicyExemptionsListForResourceGroupNextOptionalParams, - PolicyExemptionsListForResourceGroupOptionalParams, - PolicyExemptionsListForResourceGroupResponse, - PolicyExemptionsListForResourceNextOptionalParams, - PolicyExemptionsListForResourceOptionalParams, - PolicyExemptionsListForResourceResponse, - PolicyExemptionsListForManagementGroupNextOptionalParams, - PolicyExemptionsListForManagementGroupOptionalParams, - PolicyExemptionsListForManagementGroupResponse, - PolicyExemptionsDeleteOptionalParams, - PolicyExemptionsCreateOrUpdateOptionalParams, - PolicyExemptionsCreateOrUpdateResponse, - PolicyExemptionsGetOptionalParams, - PolicyExemptionsGetResponse, - PolicyExemptionsListNextResponse, - PolicyExemptionsListForResourceGroupNextResponse, - PolicyExemptionsListForResourceNextResponse, - PolicyExemptionsListForManagementGroupNextResponse -} from "../models/index.js"; - -/// -/** Class containing PolicyExemptions operations. */ -export class PolicyExemptionsImpl implements PolicyExemptions { - private readonly client: PolicyClient; - - /** - * Initialize a new instance of the class PolicyExemptions class. - * @param client Reference to the service client - */ - constructor(client: PolicyClient) { - this.client = client; - } - - /** - * This operation retrieves the list of all policy exemptions associated with the given subscription - * that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()', - * 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not provided, the unfiltered - * list includes all policy exemptions associated with the subscription, including those that apply - * directly or from management groups that contain the given subscription, as well as any applied to - * objects contained within the subscription. - * @param options The options parameters. - */ - public list( - options?: PolicyExemptionsListOptionalParams - ): 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?: PolicyExemptionsListOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: PolicyExemptionsListResponse; - 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?: PolicyExemptionsListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * This operation retrieves the list of all policy exemptions associated with the given resource group - * in the given subscription that match the optional given $filter. Valid values for $filter are: - * 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter - * is not provided, the unfiltered list includes all policy exemptions associated with the resource - * group, including those that apply directly or apply from containing scopes, as well as any applied - * to resources contained within the resource group. - * @param resourceGroupName The name of the resource group containing the resource. - * @param options The options parameters. - */ - public listForResourceGroup( - resourceGroupName: string, - options?: PolicyExemptionsListForResourceGroupOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listForResourceGroupPagingAll(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.listForResourceGroupPagingPage( - resourceGroupName, - options, - settings - ); - } - }; - } - - private async *listForResourceGroupPagingPage( - resourceGroupName: string, - options?: PolicyExemptionsListForResourceGroupOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: PolicyExemptionsListForResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listForResourceGroup(resourceGroupName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listForResourceGroupNext( - resourceGroupName, - continuationToken, - options - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listForResourceGroupPagingAll( - resourceGroupName: string, - options?: PolicyExemptionsListForResourceGroupOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listForResourceGroupPagingPage( - resourceGroupName, - options - )) { - yield* page; - } - } - - /** - * This operation retrieves the list of all policy exemptions associated with the specified resource in - * the given resource group and subscription that match the optional given $filter. Valid values for - * $filter are: 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. - * If $filter is not provided, the unfiltered list includes all policy exemptions associated with the - * resource, including those that apply directly or from all containing scopes, as well as any applied - * to resources contained within the resource. Three parameters plus the resource name are used to - * identify a specific resource. If the resource is not part of a parent resource (the more common - * case), the parent resource path should not be provided (or provided as ''). For example a web app - * could be specified as ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', - * {resourceType} == 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent - * resource, then all parameters should be provided. For example a virtual machine DNS name could be - * specified as ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == - * 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', {resourceName} == - * 'MyComputerName'). A convenient alternative to providing the namespace and type name separately is - * to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', - * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). - * @param resourceGroupName The name of the resource group containing the resource. - * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace - * of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) - * @param parentResourcePath The parent resource path. Use empty string if there is none. - * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from - * Microsoft.Web/sites). - * @param resourceName The name of the resource. - * @param options The options parameters. - */ - public listForResource( - resourceGroupName: string, - resourceProviderNamespace: string, - parentResourcePath: string, - resourceType: string, - resourceName: string, - options?: PolicyExemptionsListForResourceOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listForResourcePagingAll( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - 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.listForResourcePagingPage( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - options, - settings - ); - } - }; - } - - private async *listForResourcePagingPage( - resourceGroupName: string, - resourceProviderNamespace: string, - parentResourcePath: string, - resourceType: string, - resourceName: string, - options?: PolicyExemptionsListForResourceOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: PolicyExemptionsListForResourceResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listForResource( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - options - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listForResourceNext( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - continuationToken, - options - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listForResourcePagingAll( - resourceGroupName: string, - resourceProviderNamespace: string, - parentResourcePath: string, - resourceType: string, - resourceName: string, - options?: PolicyExemptionsListForResourceOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listForResourcePagingPage( - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - options - )) { - yield* page; - } - } - - /** - * This operation retrieves the list of all policy exemptions applicable to the management group that - * match the given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()', - * 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter=atScope() is provided, the - * returned list includes all policy exemptions that are assigned to the management group or the - * management group's ancestors. - * @param managementGroupId The ID of the management group. - * @param options The options parameters. - */ - public listForManagementGroup( - managementGroupId: string, - options?: PolicyExemptionsListForManagementGroupOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listForManagementGroupPagingAll( - managementGroupId, - options - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listForManagementGroupPagingPage( - managementGroupId, - options, - settings - ); - } - }; - } - - private async *listForManagementGroupPagingPage( - managementGroupId: string, - options?: PolicyExemptionsListForManagementGroupOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: PolicyExemptionsListForManagementGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listForManagementGroup(managementGroupId, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listForManagementGroupNext( - managementGroupId, - continuationToken, - options - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listForManagementGroupPagingAll( - managementGroupId: string, - options?: PolicyExemptionsListForManagementGroupOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listForManagementGroupPagingPage( - managementGroupId, - options - )) { - yield* page; - } - } - - /** - * This operation deletes a policy exemption, given its name and the scope it was created in. The scope - * of a policy exemption is the part of its ID preceding - * '/providers/Microsoft.Authorization/policyExemptions/{policyExemptionName}'. - * @param scope The scope of the policy exemption. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param policyExemptionName The name of the policy exemption to delete. - * @param options The options parameters. - */ - delete( - scope: string, - policyExemptionName: string, - options?: PolicyExemptionsDeleteOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, policyExemptionName, options }, - deleteOperationSpec - ); - } - - /** - * This operation creates or updates a policy exemption with the given scope and name. Policy - * exemptions apply to all resources contained within their scope. For example, when you create a - * policy exemption at resource group scope for a policy assignment at the same or above level, the - * exemption exempts to all applicable resources in the resource group. - * @param scope The scope of the policy exemption. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param policyExemptionName The name of the policy exemption to delete. - * @param parameters Parameters for the policy exemption. - * @param options The options parameters. - */ - createOrUpdate( - scope: string, - policyExemptionName: string, - parameters: PolicyExemption, - options?: PolicyExemptionsCreateOrUpdateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, policyExemptionName, parameters, options }, - createOrUpdateOperationSpec - ); - } - - /** - * This operation retrieves a single policy exemption, given its name and the scope it was created at. - * @param scope The scope of the policy exemption. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param policyExemptionName The name of the policy exemption to delete. - * @param options The options parameters. - */ - get( - scope: string, - policyExemptionName: string, - options?: PolicyExemptionsGetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, policyExemptionName, options }, - getOperationSpec - ); - } - - /** - * This operation retrieves the list of all policy exemptions associated with the given subscription - * that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()', - * 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not provided, the unfiltered - * list includes all policy exemptions associated with the subscription, including those that apply - * directly or from management groups that contain the given subscription, as well as any applied to - * objects contained within the subscription. - * @param options The options parameters. - */ - private _list( - options?: PolicyExemptionsListOptionalParams - ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * This operation retrieves the list of all policy exemptions associated with the given resource group - * in the given subscription that match the optional given $filter. Valid values for $filter are: - * 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter - * is not provided, the unfiltered list includes all policy exemptions associated with the resource - * group, including those that apply directly or apply from containing scopes, as well as any applied - * to resources contained within the resource group. - * @param resourceGroupName The name of the resource group containing the resource. - * @param options The options parameters. - */ - private _listForResourceGroup( - resourceGroupName: string, - options?: PolicyExemptionsListForResourceGroupOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listForResourceGroupOperationSpec - ); - } - - /** - * This operation retrieves the list of all policy exemptions associated with the specified resource in - * the given resource group and subscription that match the optional given $filter. Valid values for - * $filter are: 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. - * If $filter is not provided, the unfiltered list includes all policy exemptions associated with the - * resource, including those that apply directly or from all containing scopes, as well as any applied - * to resources contained within the resource. Three parameters plus the resource name are used to - * identify a specific resource. If the resource is not part of a parent resource (the more common - * case), the parent resource path should not be provided (or provided as ''). For example a web app - * could be specified as ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', - * {resourceType} == 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent - * resource, then all parameters should be provided. For example a virtual machine DNS name could be - * specified as ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == - * 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', {resourceName} == - * 'MyComputerName'). A convenient alternative to providing the namespace and type name separately is - * to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', - * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). - * @param resourceGroupName The name of the resource group containing the resource. - * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace - * of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) - * @param parentResourcePath The parent resource path. Use empty string if there is none. - * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from - * Microsoft.Web/sites). - * @param resourceName The name of the resource. - * @param options The options parameters. - */ - private _listForResource( - resourceGroupName: string, - resourceProviderNamespace: string, - parentResourcePath: string, - resourceType: string, - resourceName: string, - options?: PolicyExemptionsListForResourceOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - options - }, - listForResourceOperationSpec - ); - } - - /** - * This operation retrieves the list of all policy exemptions applicable to the management group that - * match the given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()', - * 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter=atScope() is provided, the - * returned list includes all policy exemptions that are assigned to the management group or the - * management group's ancestors. - * @param managementGroupId The ID of the management group. - * @param options The options parameters. - */ - private _listForManagementGroup( - managementGroupId: string, - options?: PolicyExemptionsListForManagementGroupOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { managementGroupId, options }, - listForManagementGroupOperationSpec - ); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: PolicyExemptionsListNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec - ); - } - - /** - * ListForResourceGroupNext - * @param resourceGroupName The name of the resource group containing the resource. - * @param nextLink The nextLink from the previous successful call to the ListForResourceGroup method. - * @param options The options parameters. - */ - private _listForResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: PolicyExemptionsListForResourceGroupNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listForResourceGroupNextOperationSpec - ); - } - - /** - * ListForResourceNext - * @param resourceGroupName The name of the resource group containing the resource. - * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace - * of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) - * @param parentResourcePath The parent resource path. Use empty string if there is none. - * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from - * Microsoft.Web/sites). - * @param resourceName The name of the resource. - * @param nextLink The nextLink from the previous successful call to the ListForResource method. - * @param options The options parameters. - */ - private _listForResourceNext( - resourceGroupName: string, - resourceProviderNamespace: string, - parentResourcePath: string, - resourceType: string, - resourceName: string, - nextLink: string, - options?: PolicyExemptionsListForResourceNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - resourceProviderNamespace, - parentResourcePath, - resourceType, - resourceName, - nextLink, - options - }, - listForResourceNextOperationSpec - ); - } - - /** - * ListForManagementGroupNext - * @param managementGroupId The ID of the management group. - * @param nextLink The nextLink from the previous successful call to the ListForManagementGroup method. - * @param options The options parameters. - */ - private _listForManagementGroupNext( - managementGroupId: string, - nextLink: string, - options?: PolicyExemptionsListForManagementGroupNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { managementGroupId, nextLink, options }, - listForManagementGroupNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/policyExemptions/{policyExemptionName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion2], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.policyExemptionName - ], - headerParameters: [Parameters.accept], - serializer -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/policyExemptions/{policyExemptionName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.PolicyExemption - }, - 201: { - bodyMapper: Mappers.PolicyExemption - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - requestBody: Parameters.parameters4, - queryParameters: [Parameters.apiVersion2], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.policyExemptionName - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const getOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/policyExemptions/{policyExemptionName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyExemption - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion2], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.policyExemptionName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyExemptions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyExemptionListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.filter, Parameters.apiVersion2], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer -}; -const listForResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/policyExemptions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyExemptionListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.filter, Parameters.apiVersion2], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId - ], - headerParameters: [Parameters.accept], - serializer -}; -const listForResourceOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/policyExemptions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyExemptionListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.filter, Parameters.apiVersion2], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.resourceProviderNamespace, - Parameters.parentResourcePath, - Parameters.resourceType, - Parameters.resourceName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listForManagementGroupOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyExemptions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyExemptionListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.filter, Parameters.apiVersion2], - urlParameters: [Parameters.$host, Parameters.managementGroupId], - headerParameters: [Parameters.accept], - serializer -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyExemptionListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId - ], - headerParameters: [Parameters.accept], - serializer -}; -const listForResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyExemptionListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.resourceGroupName, - Parameters.subscriptionId - ], - headerParameters: [Parameters.accept], - serializer -}; -const listForResourceNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyExemptionListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.resourceProviderNamespace, - Parameters.parentResourcePath, - Parameters.resourceType, - Parameters.resourceName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listForManagementGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyExemptionListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.managementGroupId - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/policy/arm-policy/src/operations/policySetDefinitionVersions.ts b/sdk/policy/arm-policy/src/operations/policySetDefinitionVersions.ts new file mode 100644 index 000000000000..7fd7a76f7778 --- /dev/null +++ b/sdk/policy/arm-policy/src/operations/policySetDefinitionVersions.ts @@ -0,0 +1,907 @@ +/* + * 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 { 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 { PolicyClient } from "../policyClient.js"; +import { + PolicySetDefinitionVersion, + PolicySetDefinitionVersionsListNextOptionalParams, + PolicySetDefinitionVersionsListOptionalParams, + PolicySetDefinitionVersionsListResponse, + PolicySetDefinitionVersionsListBuiltInNextOptionalParams, + PolicySetDefinitionVersionsListBuiltInOptionalParams, + PolicySetDefinitionVersionsListBuiltInResponse, + PolicySetDefinitionVersionsListByManagementGroupNextOptionalParams, + PolicySetDefinitionVersionsListByManagementGroupOptionalParams, + PolicySetDefinitionVersionsListByManagementGroupResponse, + PolicySetDefinitionVersionsListAllBuiltinsOptionalParams, + PolicySetDefinitionVersionsListAllBuiltinsResponse, + PolicySetDefinitionVersionsListAllAtManagementGroupOptionalParams, + PolicySetDefinitionVersionsListAllAtManagementGroupResponse, + PolicySetDefinitionVersionsListAllOptionalParams, + PolicySetDefinitionVersionsListAllResponse, + PolicySetDefinitionVersionsCreateOrUpdateOptionalParams, + PolicySetDefinitionVersionsCreateOrUpdateResponse, + PolicySetDefinitionVersionsDeleteOptionalParams, + PolicySetDefinitionVersionsGetOptionalParams, + PolicySetDefinitionVersionsGetResponse, + PolicySetDefinitionVersionsGetBuiltInOptionalParams, + PolicySetDefinitionVersionsGetBuiltInResponse, + PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams, + PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupResponse, + PolicySetDefinitionVersionsDeleteAtManagementGroupOptionalParams, + PolicySetDefinitionVersionsGetAtManagementGroupOptionalParams, + PolicySetDefinitionVersionsGetAtManagementGroupResponse, + PolicySetDefinitionVersionsListNextResponse, + PolicySetDefinitionVersionsListBuiltInNextResponse, + PolicySetDefinitionVersionsListByManagementGroupNextResponse, +} from "../models/index.js"; + +/// +/** Class containing PolicySetDefinitionVersions operations. */ +export class PolicySetDefinitionVersionsImpl + implements PolicySetDefinitionVersions +{ + private readonly client: PolicyClient; + + /** + * Initialize a new instance of the class PolicySetDefinitionVersions class. + * @param client Reference to the service client + */ + constructor(client: PolicyClient) { + this.client = client; + } + + /** + * This operation retrieves a list of all the policy set definition versions for the given policy set + * definition. + * @param policySetDefinitionName The name of the policy set definition. + * @param options The options parameters. + */ + public list( + policySetDefinitionName: string, + options?: PolicySetDefinitionVersionsListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(policySetDefinitionName, 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(policySetDefinitionName, options, settings); + }, + }; + } + + private async *listPagingPage( + policySetDefinitionName: string, + options?: PolicySetDefinitionVersionsListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: PolicySetDefinitionVersionsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(policySetDefinitionName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + policySetDefinitionName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + policySetDefinitionName: string, + options?: PolicySetDefinitionVersionsListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + policySetDefinitionName, + options, + )) { + yield* page; + } + } + + /** + * This operation retrieves a list of all the built-in policy set definition versions for the given + * built-in policy set definition. + * @param policySetDefinitionName The name of the policy set definition. + * @param options The options parameters. + */ + public listBuiltIn( + policySetDefinitionName: string, + options?: PolicySetDefinitionVersionsListBuiltInOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listBuiltInPagingAll(policySetDefinitionName, 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.listBuiltInPagingPage( + policySetDefinitionName, + options, + settings, + ); + }, + }; + } + + private async *listBuiltInPagingPage( + policySetDefinitionName: string, + options?: PolicySetDefinitionVersionsListBuiltInOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: PolicySetDefinitionVersionsListBuiltInResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBuiltIn(policySetDefinitionName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBuiltInNext( + policySetDefinitionName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBuiltInPagingAll( + policySetDefinitionName: string, + options?: PolicySetDefinitionVersionsListBuiltInOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listBuiltInPagingPage( + policySetDefinitionName, + options, + )) { + yield* page; + } + } + + /** + * This operation retrieves a list of all the policy set definition versions for the given policy set + * definition in a given management group. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @param options The options parameters. + */ + public listByManagementGroup( + managementGroupName: string, + policySetDefinitionName: string, + options?: PolicySetDefinitionVersionsListByManagementGroupOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByManagementGroupPagingAll( + managementGroupName, + policySetDefinitionName, + 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.listByManagementGroupPagingPage( + managementGroupName, + policySetDefinitionName, + options, + settings, + ); + }, + }; + } + + private async *listByManagementGroupPagingPage( + managementGroupName: string, + policySetDefinitionName: string, + options?: PolicySetDefinitionVersionsListByManagementGroupOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: PolicySetDefinitionVersionsListByManagementGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByManagementGroup( + managementGroupName, + policySetDefinitionName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByManagementGroupNext( + managementGroupName, + policySetDefinitionName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByManagementGroupPagingAll( + managementGroupName: string, + policySetDefinitionName: string, + options?: PolicySetDefinitionVersionsListByManagementGroupOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByManagementGroupPagingPage( + managementGroupName, + policySetDefinitionName, + options, + )) { + yield* page; + } + } + + /** + * This operation lists all the built-in policy set definition versions for all built-in policy set + * definitions. + * @param options The options parameters. + */ + listAllBuiltins( + options?: PolicySetDefinitionVersionsListAllBuiltinsOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { options }, + listAllBuiltinsOperationSpec, + ); + } + + /** + * This operation lists all the policy set definition versions for all policy set definitions at the + * management group scope. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param options The options parameters. + */ + listAllAtManagementGroup( + managementGroupName: string, + options?: PolicySetDefinitionVersionsListAllAtManagementGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { managementGroupName, options }, + listAllAtManagementGroupOperationSpec, + ); + } + + /** + * This operation lists all the policy set definition versions for all policy set definitions within a + * subscription. + * @param options The options parameters. + */ + listAll( + options?: PolicySetDefinitionVersionsListAllOptionalParams, + ): Promise { + return this.client.sendOperationRequest({ options }, listAllOperationSpec); + } + + /** + * This operation creates or updates a policy set definition version in the given subscription with the + * given name and version. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is + * the major version number, y is the minor version number, and z is the patch number + * @param parameters The policy set definition properties. + * @param options The options parameters. + */ + createOrUpdate( + policySetDefinitionName: string, + policyDefinitionVersion: string, + parameters: PolicySetDefinitionVersion, + options?: PolicySetDefinitionVersionsCreateOrUpdateOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policySetDefinitionName, policyDefinitionVersion, parameters, options }, + createOrUpdateOperationSpec, + ); + } + + /** + * This operation deletes the policy set definition version in the given subscription with the given + * name and version. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is + * the major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + delete( + policySetDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicySetDefinitionVersionsDeleteOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policySetDefinitionName, policyDefinitionVersion, options }, + deleteOperationSpec, + ); + } + + /** + * This operation retrieves the policy set definition version in the given subscription with the given + * name and version. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is + * the major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + get( + policySetDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicySetDefinitionVersionsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policySetDefinitionName, policyDefinitionVersion, options }, + getOperationSpec, + ); + } + + /** + * This operation retrieves the built-in policy set definition version with the given name and version. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is + * the major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + getBuiltIn( + policySetDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicySetDefinitionVersionsGetBuiltInOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policySetDefinitionName, policyDefinitionVersion, options }, + getBuiltInOperationSpec, + ); + } + + /** + * This operation retrieves a list of all the policy set definition versions for the given policy set + * definition. + * @param policySetDefinitionName The name of the policy set definition. + * @param options The options parameters. + */ + private _list( + policySetDefinitionName: string, + options?: PolicySetDefinitionVersionsListOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policySetDefinitionName, options }, + listOperationSpec, + ); + } + + /** + * This operation retrieves a list of all the built-in policy set definition versions for the given + * built-in policy set definition. + * @param policySetDefinitionName The name of the policy set definition. + * @param options The options parameters. + */ + private _listBuiltIn( + policySetDefinitionName: string, + options?: PolicySetDefinitionVersionsListBuiltInOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policySetDefinitionName, options }, + listBuiltInOperationSpec, + ); + } + + /** + * This operation creates or updates a policy set definition version in the given management group with + * the given name and version. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is + * the major version number, y is the minor version number, and z is the patch number + * @param parameters The policy set definition version properties. + * @param options The options parameters. + */ + createOrUpdateAtManagementGroup( + managementGroupName: string, + policySetDefinitionName: string, + policyDefinitionVersion: string, + parameters: PolicySetDefinitionVersion, + options?: PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + managementGroupName, + policySetDefinitionName, + policyDefinitionVersion, + parameters, + options, + }, + createOrUpdateAtManagementGroupOperationSpec, + ); + } + + /** + * This operation deletes the policy set definition version in the given management group with the + * given name and version. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is + * the major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + deleteAtManagementGroup( + managementGroupName: string, + policySetDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicySetDefinitionVersionsDeleteAtManagementGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + managementGroupName, + policySetDefinitionName, + policyDefinitionVersion, + options, + }, + deleteAtManagementGroupOperationSpec, + ); + } + + /** + * This operation retrieves the policy set definition version in the given management group with the + * given name and version. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is + * the major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + getAtManagementGroup( + managementGroupName: string, + policySetDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicySetDefinitionVersionsGetAtManagementGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + managementGroupName, + policySetDefinitionName, + policyDefinitionVersion, + options, + }, + getAtManagementGroupOperationSpec, + ); + } + + /** + * This operation retrieves a list of all the policy set definition versions for the given policy set + * definition in a given management group. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @param options The options parameters. + */ + private _listByManagementGroup( + managementGroupName: string, + policySetDefinitionName: string, + options?: PolicySetDefinitionVersionsListByManagementGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { managementGroupName, policySetDefinitionName, options }, + listByManagementGroupOperationSpec, + ); + } + + /** + * ListNext + * @param policySetDefinitionName The name of the policy set definition. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + policySetDefinitionName: string, + nextLink: string, + options?: PolicySetDefinitionVersionsListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policySetDefinitionName, nextLink, options }, + listNextOperationSpec, + ); + } + + /** + * ListBuiltInNext + * @param policySetDefinitionName The name of the policy set definition. + * @param nextLink The nextLink from the previous successful call to the ListBuiltIn method. + * @param options The options parameters. + */ + private _listBuiltInNext( + policySetDefinitionName: string, + nextLink: string, + options?: PolicySetDefinitionVersionsListBuiltInNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { policySetDefinitionName, nextLink, options }, + listBuiltInNextOperationSpec, + ); + } + + /** + * ListByManagementGroupNext + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @param nextLink The nextLink from the previous successful call to the ListByManagementGroup method. + * @param options The options parameters. + */ + private _listByManagementGroupNext( + managementGroupName: string, + policySetDefinitionName: string, + nextLink: string, + options?: PolicySetDefinitionVersionsListByManagementGroupNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { managementGroupName, policySetDefinitionName, nextLink, options }, + listByManagementGroupNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listAllBuiltinsOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Authorization/listPolicySetDefinitionVersions", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer, +}; +const listAllAtManagementGroupOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/listPolicySetDefinitionVersions", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.managementGroupName], + headerParameters: [Parameters.accept], + serializer, +}; +const listAllOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/listPolicySetDefinitionVersions", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionVersion, + }, + 201: { + bodyMapper: Mappers.PolicySetDefinitionVersion, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters5, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.policyDefinitionVersion, + Parameters.policySetDefinitionName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.policyDefinitionVersion, + Parameters.policySetDefinitionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionVersion, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.expand], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.policyDefinitionVersion, + Parameters.policySetDefinitionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getBuiltInOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionVersion, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.expand], + urlParameters: [ + Parameters.$host, + Parameters.policyDefinitionVersion, + Parameters.policySetDefinitionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.expand, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.policySetDefinitionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listBuiltInOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.expand, Parameters.top], + urlParameters: [Parameters.$host, Parameters.policySetDefinitionName], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateAtManagementGroupOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionVersion, + }, + 201: { + bodyMapper: Mappers.PolicySetDefinitionVersion, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters5, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupName, + Parameters.policyDefinitionVersion, + Parameters.policySetDefinitionName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteAtManagementGroupOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupName, + Parameters.policyDefinitionVersion, + Parameters.policySetDefinitionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getAtManagementGroupOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionVersion, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.expand], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupName, + Parameters.policyDefinitionVersion, + Parameters.policySetDefinitionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByManagementGroupOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.expand, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupName, + Parameters.policySetDefinitionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.policySetDefinitionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listBuiltInNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.policySetDefinitionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByManagementGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionVersionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.managementGroupName, + Parameters.policySetDefinitionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/policy/arm-policy/src/operations/policySetDefinitions.ts b/sdk/policy/arm-policy/src/operations/policySetDefinitions.ts index 1edcf4f14913..0b08f9351d1f 100644 --- a/sdk/policy/arm-policy/src/operations/policySetDefinitions.ts +++ b/sdk/policy/arm-policy/src/operations/policySetDefinitions.ts @@ -38,7 +38,7 @@ import { PolicySetDefinitionsGetAtManagementGroupResponse, PolicySetDefinitionsListNextResponse, PolicySetDefinitionsListBuiltInNextResponse, - PolicySetDefinitionsListByManagementGroupNextResponse + PolicySetDefinitionsListByManagementGroupNextResponse, } from "../models/index.js"; /// @@ -68,7 +68,7 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { * @param options The options parameters. */ public list( - options?: PolicySetDefinitionsListOptionalParams + options?: PolicySetDefinitionsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -83,13 +83,13 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: PolicySetDefinitionsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: PolicySetDefinitionsListResponse; let continuationToken = settings?.continuationToken; @@ -110,7 +110,7 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { } private async *listPagingAll( - options?: PolicySetDefinitionsListOptionalParams + options?: PolicySetDefinitionsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -124,7 +124,7 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { * @param options The options parameters. */ public listBuiltIn( - options?: PolicySetDefinitionsListBuiltInOptionalParams + options?: PolicySetDefinitionsListBuiltInOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listBuiltInPagingAll(options); return { @@ -139,13 +139,13 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { throw new Error("maxPageSize is not supported by this operation."); } return this.listBuiltInPagingPage(options, settings); - } + }, }; } private async *listBuiltInPagingPage( options?: PolicySetDefinitionsListBuiltInOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: PolicySetDefinitionsListBuiltInResponse; let continuationToken = settings?.continuationToken; @@ -166,7 +166,7 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { } private async *listBuiltInPagingAll( - options?: PolicySetDefinitionsListBuiltInOptionalParams + options?: PolicySetDefinitionsListBuiltInOptionalParams, ): AsyncIterableIterator { for await (const page of this.listBuiltInPagingPage(options)) { yield* page; @@ -189,11 +189,11 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { */ public listByManagementGroup( managementGroupId: string, - options?: PolicySetDefinitionsListByManagementGroupOptionalParams + options?: PolicySetDefinitionsListByManagementGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByManagementGroupPagingAll( managementGroupId, - options + options, ); return { next() { @@ -209,16 +209,16 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { return this.listByManagementGroupPagingPage( managementGroupId, options, - settings + settings, ); - } + }, }; } private async *listByManagementGroupPagingPage( managementGroupId: string, options?: PolicySetDefinitionsListByManagementGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: PolicySetDefinitionsListByManagementGroupResponse; let continuationToken = settings?.continuationToken; @@ -233,7 +233,7 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { result = await this._listByManagementGroupNext( managementGroupId, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -244,11 +244,11 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { private async *listByManagementGroupPagingAll( managementGroupId: string, - options?: PolicySetDefinitionsListByManagementGroupOptionalParams + options?: PolicySetDefinitionsListByManagementGroupOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByManagementGroupPagingPage( managementGroupId, - options + options, )) { yield* page; } @@ -264,11 +264,11 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { createOrUpdate( policySetDefinitionName: string, parameters: PolicySetDefinition, - options?: PolicySetDefinitionsCreateOrUpdateOptionalParams + options?: PolicySetDefinitionsCreateOrUpdateOptionalParams, ): Promise { return this.client.sendOperationRequest( { policySetDefinitionName, parameters, options }, - createOrUpdateOperationSpec + createOrUpdateOperationSpec, ); } @@ -279,11 +279,11 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { */ delete( policySetDefinitionName: string, - options?: PolicySetDefinitionsDeleteOptionalParams + options?: PolicySetDefinitionsDeleteOptionalParams, ): Promise { return this.client.sendOperationRequest( { policySetDefinitionName, options }, - deleteOperationSpec + deleteOperationSpec, ); } @@ -294,11 +294,11 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { */ get( policySetDefinitionName: string, - options?: PolicySetDefinitionsGetOptionalParams + options?: PolicySetDefinitionsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { policySetDefinitionName, options }, - getOperationSpec + getOperationSpec, ); } @@ -309,11 +309,11 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { */ getBuiltIn( policySetDefinitionName: string, - options?: PolicySetDefinitionsGetBuiltInOptionalParams + options?: PolicySetDefinitionsGetBuiltInOptionalParams, ): Promise { return this.client.sendOperationRequest( { policySetDefinitionName, options }, - getBuiltInOperationSpec + getBuiltInOperationSpec, ); } @@ -331,7 +331,7 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { * @param options The options parameters. */ private _list( - options?: PolicySetDefinitionsListOptionalParams + options?: PolicySetDefinitionsListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -343,66 +343,66 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { * @param options The options parameters. */ private _listBuiltIn( - options?: PolicySetDefinitionsListBuiltInOptionalParams + options?: PolicySetDefinitionsListBuiltInOptionalParams, ): Promise { return this.client.sendOperationRequest( { options }, - listBuiltInOperationSpec + listBuiltInOperationSpec, ); } /** * This operation creates or updates a policy set definition in the given management group with the * given name. - * @param policySetDefinitionName The name of the policy set definition to create. * @param managementGroupId The ID of the management group. + * @param policySetDefinitionName The name of the policy set definition to create. * @param parameters The policy set definition properties. * @param options The options parameters. */ createOrUpdateAtManagementGroup( - policySetDefinitionName: string, managementGroupId: string, + policySetDefinitionName: string, parameters: PolicySetDefinition, - options?: PolicySetDefinitionsCreateOrUpdateAtManagementGroupOptionalParams + options?: PolicySetDefinitionsCreateOrUpdateAtManagementGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( - { policySetDefinitionName, managementGroupId, parameters, options }, - createOrUpdateAtManagementGroupOperationSpec + { managementGroupId, policySetDefinitionName, parameters, options }, + createOrUpdateAtManagementGroupOperationSpec, ); } /** * This operation deletes the policy set definition in the given management group with the given name. - * @param policySetDefinitionName The name of the policy set definition to delete. * @param managementGroupId The ID of the management group. + * @param policySetDefinitionName The name of the policy set definition to delete. * @param options The options parameters. */ deleteAtManagementGroup( - policySetDefinitionName: string, managementGroupId: string, - options?: PolicySetDefinitionsDeleteAtManagementGroupOptionalParams + policySetDefinitionName: string, + options?: PolicySetDefinitionsDeleteAtManagementGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( - { policySetDefinitionName, managementGroupId, options }, - deleteAtManagementGroupOperationSpec + { managementGroupId, policySetDefinitionName, options }, + deleteAtManagementGroupOperationSpec, ); } /** * This operation retrieves the policy set definition in the given management group with the given * name. - * @param policySetDefinitionName The name of the policy set definition to get. * @param managementGroupId The ID of the management group. + * @param policySetDefinitionName The name of the policy set definition to get. * @param options The options parameters. */ getAtManagementGroup( - policySetDefinitionName: string, managementGroupId: string, - options?: PolicySetDefinitionsGetAtManagementGroupOptionalParams + policySetDefinitionName: string, + options?: PolicySetDefinitionsGetAtManagementGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( - { policySetDefinitionName, managementGroupId, options }, - getAtManagementGroupOperationSpec + { managementGroupId, policySetDefinitionName, options }, + getAtManagementGroupOperationSpec, ); } @@ -422,11 +422,11 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { */ private _listByManagementGroup( managementGroupId: string, - options?: PolicySetDefinitionsListByManagementGroupOptionalParams + options?: PolicySetDefinitionsListByManagementGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { managementGroupId, options }, - listByManagementGroupOperationSpec + listByManagementGroupOperationSpec, ); } @@ -437,11 +437,11 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { */ private _listNext( nextLink: string, - options?: PolicySetDefinitionsListNextOptionalParams + options?: PolicySetDefinitionsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } @@ -452,11 +452,11 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { */ private _listBuiltInNext( nextLink: string, - options?: PolicySetDefinitionsListBuiltInNextOptionalParams + options?: PolicySetDefinitionsListBuiltInNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listBuiltInNextOperationSpec + listBuiltInNextOperationSpec, ); } @@ -469,11 +469,11 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { private _listByManagementGroupNext( managementGroupId: string, nextLink: string, - options?: PolicySetDefinitionsListByManagementGroupNextOptionalParams + options?: PolicySetDefinitionsListByManagementGroupNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { managementGroupId, nextLink, options }, - listByManagementGroupNextOperationSpec + listByManagementGroupNextOperationSpec, ); } } @@ -481,256 +481,262 @@ export class PolicySetDefinitionsImpl implements PolicySetDefinitions { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.PolicySetDefinition + bodyMapper: Mappers.PolicySetDefinition, }, 201: { - bodyMapper: Mappers.PolicySetDefinition + bodyMapper: Mappers.PolicySetDefinition, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.parameters3, - queryParameters: [Parameters.apiVersion1], + requestBody: Parameters.parameters4, + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.policySetDefinitionName + Parameters.policySetDefinitionName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", httpMethod: "DELETE", responses: { 200: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.policySetDefinitionName + Parameters.policySetDefinitionName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicySetDefinition + bodyMapper: Mappers.PolicySetDefinition, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.policySetDefinitionName + Parameters.policySetDefinitionName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getBuiltInOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + path: "/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicySetDefinition + bodyMapper: Mappers.PolicySetDefinition, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [Parameters.$host, Parameters.policySetDefinitionName], headerParameters: [Parameters.accept], - serializer + serializer, }; const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicySetDefinitionListResult + bodyMapper: Mappers.PolicySetDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], + queryParameters: [ + Parameters.apiVersion, + Parameters.expand, + Parameters.filter, + Parameters.top, + ], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listBuiltInOperationSpec: coreClient.OperationSpec = { path: "/providers/Microsoft.Authorization/policySetDefinitions", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicySetDefinitionListResult + bodyMapper: Mappers.PolicySetDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], + queryParameters: [ + Parameters.apiVersion, + Parameters.expand, + Parameters.filter, + Parameters.top, + ], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateAtManagementGroupOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.PolicySetDefinition + bodyMapper: Mappers.PolicySetDefinition, }, 201: { - bodyMapper: Mappers.PolicySetDefinition + bodyMapper: Mappers.PolicySetDefinition, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.parameters3, - queryParameters: [Parameters.apiVersion1], + requestBody: Parameters.parameters4, + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.managementGroupId, - Parameters.policySetDefinitionName + Parameters.policySetDefinitionName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const deleteAtManagementGroupOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", httpMethod: "DELETE", responses: { 200: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.managementGroupId, - Parameters.policySetDefinitionName + Parameters.policySetDefinitionName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getAtManagementGroupOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicySetDefinition + bodyMapper: Mappers.PolicySetDefinition, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [ Parameters.$host, Parameters.managementGroupId, - Parameters.policySetDefinitionName + Parameters.policySetDefinitionName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByManagementGroupOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions", + path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicySetDefinitionListResult + bodyMapper: Mappers.PolicySetDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], + queryParameters: [ + Parameters.apiVersion, + Parameters.expand, + Parameters.filter, + Parameters.top, + ], urlParameters: [Parameters.$host, Parameters.managementGroupId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicySetDefinitionListResult + bodyMapper: Mappers.PolicySetDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, + Parameters.subscriptionId, Parameters.nextLink, - Parameters.subscriptionId ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listBuiltInNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicySetDefinitionListResult + bodyMapper: Mappers.PolicySetDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByManagementGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PolicySetDefinitionListResult + bodyMapper: Mappers.PolicySetDefinitionListResult, }, default: { - bodyMapper: Mappers.CloudError - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, + Parameters.managementGroupId, Parameters.nextLink, - Parameters.managementGroupId ], headerParameters: [Parameters.accept], - serializer + serializer, }; 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..c334952adfa7 --- /dev/null +++ b/sdk/policy/arm-policy/src/operations/policyTokens.ts @@ -0,0 +1,149 @@ +/* + * 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< + OperationState, + 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/dataPolicyManifests.ts b/sdk/policy/arm-policy/src/operationsInterfaces/dataPolicyManifests.ts deleted file mode 100644 index 29cc8f2dbf63..000000000000 --- a/sdk/policy/arm-policy/src/operationsInterfaces/dataPolicyManifests.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - DataPolicyManifest, - DataPolicyManifestsListOptionalParams, - DataPolicyManifestsGetByPolicyModeOptionalParams, - DataPolicyManifestsGetByPolicyModeResponse -} from "../models/index.js"; - -/// -/** Interface representing a DataPolicyManifests. */ -export interface DataPolicyManifests { - /** - * This operation retrieves a list of all the data policy manifests that match the optional given - * $filter. Valid values for $filter are: "$filter=namespace eq '{0}'". If $filter is not provided, the - * unfiltered list includes all data policy manifests for data resource types. If $filter=namespace is - * provided, the returned list only includes all data policy manifests that have a namespace matching - * the provided value. - * @param options The options parameters. - */ - list( - options?: DataPolicyManifestsListOptionalParams - ): PagedAsyncIterableIterator; - /** - * This operation retrieves the data policy manifest with the given policy mode. - * @param policyMode The policy mode of the data policy manifest to get. - * @param options The options parameters. - */ - getByPolicyMode( - policyMode: string, - options?: DataPolicyManifestsGetByPolicyModeOptionalParams - ): Promise; -} diff --git a/sdk/policy/arm-policy/src/operationsInterfaces/index.ts b/sdk/policy/arm-policy/src/operationsInterfaces/index.ts index cc113d214132..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 "./dataPolicyManifests.js"; export * from "./policyAssignments.js"; export * from "./policyDefinitions.js"; +export * from "./policyDefinitionVersions.js"; export * from "./policySetDefinitions.js"; -export * from "./policyExemptions.js"; +export * from "./policySetDefinitionVersions.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 2e291096f4df..4de807099b2a 100644 --- a/sdk/policy/arm-policy/src/operationsInterfaces/policyAssignments.ts +++ b/sdk/policy/arm-policy/src/operationsInterfaces/policyAssignments.ts @@ -29,7 +29,7 @@ import { PolicyAssignmentsGetByIdOptionalParams, PolicyAssignmentsGetByIdResponse, PolicyAssignmentsUpdateByIdOptionalParams, - PolicyAssignmentsUpdateByIdResponse + PolicyAssignmentsUpdateByIdResponse, } from "../models/index.js"; /// @@ -52,7 +52,7 @@ export interface PolicyAssignments { */ listForResourceGroup( resourceGroupName: string, - options?: PolicyAssignmentsListForResourceGroupOptionalParams + options?: PolicyAssignmentsListForResourceGroupOptionalParams, ): PagedAsyncIterableIterator; /** * This operation retrieves the list of all policy assignments associated with the specified resource @@ -92,7 +92,7 @@ export interface PolicyAssignments { parentResourcePath: string, resourceType: string, resourceName: string, - options?: PolicyAssignmentsListForResourceOptionalParams + options?: PolicyAssignmentsListForResourceOptionalParams, ): PagedAsyncIterableIterator; /** * This operation retrieves the list of all policy assignments applicable to the management group that @@ -108,7 +108,7 @@ export interface PolicyAssignments { */ listForManagementGroup( managementGroupId: string, - options?: PolicyAssignmentsListForManagementGroupOptionalParams + options?: PolicyAssignmentsListForManagementGroupOptionalParams, ): PagedAsyncIterableIterator; /** * This operation retrieves the list of all policy assignments associated with the given subscription @@ -125,7 +125,7 @@ export interface PolicyAssignments { * @param options The options parameters. */ list( - options?: PolicyAssignmentsListOptionalParams + options?: PolicyAssignmentsListOptionalParams, ): PagedAsyncIterableIterator; /** * This operation deletes a policy assignment, given its name and the scope it was created in. The @@ -142,7 +142,7 @@ export interface PolicyAssignments { delete( scope: string, policyAssignmentName: string, - options?: PolicyAssignmentsDeleteOptionalParams + options?: PolicyAssignmentsDeleteOptionalParams, ): Promise; /** * This operation creates or updates a policy assignment with the given scope and name. Policy @@ -161,7 +161,7 @@ export interface PolicyAssignments { scope: string, policyAssignmentName: string, parameters: PolicyAssignment, - options?: PolicyAssignmentsCreateOptionalParams + options?: PolicyAssignmentsCreateOptionalParams, ): Promise; /** * This operation retrieves a single policy assignment, given its name and the scope it was created at. @@ -176,7 +176,7 @@ export interface PolicyAssignments { get( scope: string, policyAssignmentName: string, - options?: PolicyAssignmentsGetOptionalParams + options?: PolicyAssignmentsGetOptionalParams, ): Promise; /** * This operation updates a policy assignment with the given scope and name. Policy assignments apply @@ -195,7 +195,7 @@ export interface PolicyAssignments { scope: string, policyAssignmentName: string, parameters: PolicyAssignmentUpdate, - options?: PolicyAssignmentsUpdateOptionalParams + options?: PolicyAssignmentsUpdateOptionalParams, ): Promise; /** * This operation deletes the policy with the given ID. Policy assignment IDs have this format: @@ -211,7 +211,7 @@ export interface PolicyAssignments { */ deleteById( policyAssignmentId: string, - options?: PolicyAssignmentsDeleteByIdOptionalParams + options?: PolicyAssignmentsDeleteByIdOptionalParams, ): Promise; /** * This operation creates or updates the policy assignment with the given ID. Policy assignments made @@ -231,7 +231,7 @@ export interface PolicyAssignments { createById( policyAssignmentId: string, parameters: PolicyAssignment, - options?: PolicyAssignmentsCreateByIdOptionalParams + options?: PolicyAssignmentsCreateByIdOptionalParams, ): Promise; /** * The operation retrieves the policy assignment with the given ID. Policy assignment IDs have this @@ -247,7 +247,7 @@ export interface PolicyAssignments { */ getById( policyAssignmentId: string, - options?: PolicyAssignmentsGetByIdOptionalParams + options?: PolicyAssignmentsGetByIdOptionalParams, ): Promise; /** * This operation updates the policy assignment with the given ID. Policy assignments made on a scope @@ -267,6 +267,6 @@ export interface PolicyAssignments { updateById( policyAssignmentId: string, parameters: PolicyAssignmentUpdate, - options?: PolicyAssignmentsUpdateByIdOptionalParams + options?: PolicyAssignmentsUpdateByIdOptionalParams, ): Promise; } diff --git a/sdk/policy/arm-policy/src/operationsInterfaces/policyDefinitionVersions.ts b/sdk/policy/arm-policy/src/operationsInterfaces/policyDefinitionVersions.ts new file mode 100644 index 000000000000..3ae3c95736e7 --- /dev/null +++ b/sdk/policy/arm-policy/src/operationsInterfaces/policyDefinitionVersions.ts @@ -0,0 +1,193 @@ +/* + * 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 { + PolicyDefinitionVersion, + PolicyDefinitionVersionsListOptionalParams, + PolicyDefinitionVersionsListBuiltInOptionalParams, + PolicyDefinitionVersionsListByManagementGroupOptionalParams, + PolicyDefinitionVersionsListAllBuiltinsOptionalParams, + PolicyDefinitionVersionsListAllBuiltinsResponse, + PolicyDefinitionVersionsListAllAtManagementGroupOptionalParams, + PolicyDefinitionVersionsListAllAtManagementGroupResponse, + PolicyDefinitionVersionsListAllOptionalParams, + PolicyDefinitionVersionsListAllResponse, + PolicyDefinitionVersionsCreateOrUpdateOptionalParams, + PolicyDefinitionVersionsCreateOrUpdateResponse, + PolicyDefinitionVersionsDeleteOptionalParams, + PolicyDefinitionVersionsGetOptionalParams, + PolicyDefinitionVersionsGetResponse, + PolicyDefinitionVersionsGetBuiltInOptionalParams, + PolicyDefinitionVersionsGetBuiltInResponse, + PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams, + PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupResponse, + PolicyDefinitionVersionsDeleteAtManagementGroupOptionalParams, + PolicyDefinitionVersionsGetAtManagementGroupOptionalParams, + PolicyDefinitionVersionsGetAtManagementGroupResponse, +} from "../models/index.js"; + +/// +/** Interface representing a PolicyDefinitionVersions. */ +export interface PolicyDefinitionVersions { + /** + * This operation retrieves a list of all the policy definition versions for the given policy + * definition. + * @param policyDefinitionName The name of the policy definition. + * @param options The options parameters. + */ + list( + policyDefinitionName: string, + options?: PolicyDefinitionVersionsListOptionalParams, + ): PagedAsyncIterableIterator; + /** + * This operation retrieves a list of all the built-in policy definition versions for the given policy + * definition. + * @param policyDefinitionName The name of the policy definition. + * @param options The options parameters. + */ + listBuiltIn( + policyDefinitionName: string, + options?: PolicyDefinitionVersionsListBuiltInOptionalParams, + ): PagedAsyncIterableIterator; + /** + * This operation retrieves a list of all the policy definition versions for the given policy + * definition in the given management group. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policyDefinitionName The name of the policy definition. + * @param options The options parameters. + */ + listByManagementGroup( + managementGroupName: string, + policyDefinitionName: string, + options?: PolicyDefinitionVersionsListByManagementGroupOptionalParams, + ): PagedAsyncIterableIterator; + /** + * This operation lists all the built-in policy definition versions for all built-in policy + * definitions. + * @param options The options parameters. + */ + listAllBuiltins( + options?: PolicyDefinitionVersionsListAllBuiltinsOptionalParams, + ): Promise; + /** + * This operation lists all the policy definition versions for all policy definitions at the management + * group scope. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param options The options parameters. + */ + listAllAtManagementGroup( + managementGroupName: string, + options?: PolicyDefinitionVersionsListAllAtManagementGroupOptionalParams, + ): Promise; + /** + * This operation lists all the policy definition versions for all policy definitions within a + * subscription. + * @param options The options parameters. + */ + listAll( + options?: PolicyDefinitionVersionsListAllOptionalParams, + ): Promise; + /** + * This operation creates or updates a policy definition in the given subscription with the given name. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the + * major version number, y is the minor version number, and z is the patch number + * @param parameters The policy definition properties. + * @param options The options parameters. + */ + createOrUpdate( + policyDefinitionName: string, + policyDefinitionVersion: string, + parameters: PolicyDefinitionVersion, + options?: PolicyDefinitionVersionsCreateOrUpdateOptionalParams, + ): Promise; + /** + * This operation deletes the policy definition version in the given subscription with the given name. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the + * major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + delete( + policyDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicyDefinitionVersionsDeleteOptionalParams, + ): Promise; + /** + * This operation retrieves the policy definition version in the given subscription with the given + * name. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the + * major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + get( + policyDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicyDefinitionVersionsGetOptionalParams, + ): Promise; + /** + * This operation retrieves the built-in policy definition version with the given name. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the + * major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + getBuiltIn( + policyDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicyDefinitionVersionsGetBuiltInOptionalParams, + ): Promise; + /** + * This operation creates or updates a policy definition version in the given management group with the + * given name. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the + * major version number, y is the minor version number, and z is the patch number + * @param parameters The policy definition properties. + * @param options The options parameters. + */ + createOrUpdateAtManagementGroup( + managementGroupName: string, + policyDefinitionName: string, + policyDefinitionVersion: string, + parameters: PolicyDefinitionVersion, + options?: PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams, + ): Promise; + /** + * This operation deletes the policy definition in the given management group with the given name. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the + * major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + deleteAtManagementGroup( + managementGroupName: string, + policyDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicyDefinitionVersionsDeleteAtManagementGroupOptionalParams, + ): Promise; + /** + * This operation retrieves the policy definition version in the given management group with the given + * name. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the + * major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + getAtManagementGroup( + managementGroupName: string, + policyDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicyDefinitionVersionsGetAtManagementGroupOptionalParams, + ): Promise; +} diff --git a/sdk/policy/arm-policy/src/operationsInterfaces/policyDefinitions.ts b/sdk/policy/arm-policy/src/operationsInterfaces/policyDefinitions.ts index c592dcd6bba8..7df15a597ddf 100644 --- a/sdk/policy/arm-policy/src/operationsInterfaces/policyDefinitions.ts +++ b/sdk/policy/arm-policy/src/operationsInterfaces/policyDefinitions.ts @@ -23,7 +23,7 @@ import { PolicyDefinitionsCreateOrUpdateAtManagementGroupResponse, PolicyDefinitionsDeleteAtManagementGroupOptionalParams, PolicyDefinitionsGetAtManagementGroupOptionalParams, - PolicyDefinitionsGetAtManagementGroupResponse + PolicyDefinitionsGetAtManagementGroupResponse, } from "../models/index.js"; /// @@ -43,7 +43,7 @@ export interface PolicyDefinitions { * @param options The options parameters. */ list( - options?: PolicyDefinitionsListOptionalParams + options?: PolicyDefinitionsListOptionalParams, ): PagedAsyncIterableIterator; /** * This operation retrieves a list of all the built-in policy definitions that match the optional given @@ -54,7 +54,7 @@ export interface PolicyDefinitions { * @param options The options parameters. */ listBuiltIn( - options?: PolicyDefinitionsListBuiltInOptionalParams + options?: PolicyDefinitionsListBuiltInOptionalParams, ): PagedAsyncIterableIterator; /** * This operation retrieves a list of all the policy definitions in a given management group that match @@ -72,7 +72,7 @@ export interface PolicyDefinitions { */ listByManagementGroup( managementGroupId: string, - options?: PolicyDefinitionsListByManagementGroupOptionalParams + options?: PolicyDefinitionsListByManagementGroupOptionalParams, ): PagedAsyncIterableIterator; /** * This operation creates or updates a policy definition in the given subscription with the given name. @@ -83,7 +83,7 @@ export interface PolicyDefinitions { createOrUpdate( policyDefinitionName: string, parameters: PolicyDefinition, - options?: PolicyDefinitionsCreateOrUpdateOptionalParams + options?: PolicyDefinitionsCreateOrUpdateOptionalParams, ): Promise; /** * This operation deletes the policy definition in the given subscription with the given name. @@ -92,7 +92,7 @@ export interface PolicyDefinitions { */ delete( policyDefinitionName: string, - options?: PolicyDefinitionsDeleteOptionalParams + options?: PolicyDefinitionsDeleteOptionalParams, ): Promise; /** * This operation retrieves the policy definition in the given subscription with the given name. @@ -101,7 +101,7 @@ export interface PolicyDefinitions { */ get( policyDefinitionName: string, - options?: PolicyDefinitionsGetOptionalParams + options?: PolicyDefinitionsGetOptionalParams, ): Promise; /** * This operation retrieves the built-in policy definition with the given name. @@ -110,42 +110,42 @@ export interface PolicyDefinitions { */ getBuiltIn( policyDefinitionName: string, - options?: PolicyDefinitionsGetBuiltInOptionalParams + options?: PolicyDefinitionsGetBuiltInOptionalParams, ): Promise; /** * This operation creates or updates a policy definition in the given management group with the given * name. - * @param policyDefinitionName The name of the policy definition to create. * @param managementGroupId The ID of the management group. + * @param policyDefinitionName The name of the policy definition to create. * @param parameters The policy definition properties. * @param options The options parameters. */ createOrUpdateAtManagementGroup( - policyDefinitionName: string, managementGroupId: string, + policyDefinitionName: string, parameters: PolicyDefinition, - options?: PolicyDefinitionsCreateOrUpdateAtManagementGroupOptionalParams + options?: PolicyDefinitionsCreateOrUpdateAtManagementGroupOptionalParams, ): Promise; /** * This operation deletes the policy definition in the given management group with the given name. - * @param policyDefinitionName The name of the policy definition to delete. * @param managementGroupId The ID of the management group. + * @param policyDefinitionName The name of the policy definition to delete. * @param options The options parameters. */ deleteAtManagementGroup( - policyDefinitionName: string, managementGroupId: string, - options?: PolicyDefinitionsDeleteAtManagementGroupOptionalParams + policyDefinitionName: string, + options?: PolicyDefinitionsDeleteAtManagementGroupOptionalParams, ): Promise; /** * This operation retrieves the policy definition in the given management group with the given name. - * @param policyDefinitionName The name of the policy definition to get. * @param managementGroupId The ID of the management group. + * @param policyDefinitionName The name of the policy definition to get. * @param options The options parameters. */ getAtManagementGroup( - policyDefinitionName: string, managementGroupId: string, - options?: PolicyDefinitionsGetAtManagementGroupOptionalParams + policyDefinitionName: string, + options?: PolicyDefinitionsGetAtManagementGroupOptionalParams, ): Promise; } diff --git a/sdk/policy/arm-policy/src/operationsInterfaces/policyExemptions.ts b/sdk/policy/arm-policy/src/operationsInterfaces/policyExemptions.ts deleted file mode 100644 index be795bfcecaa..000000000000 --- a/sdk/policy/arm-policy/src/operationsInterfaces/policyExemptions.ts +++ /dev/null @@ -1,151 +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 { - PolicyExemption, - PolicyExemptionsListOptionalParams, - PolicyExemptionsListForResourceGroupOptionalParams, - PolicyExemptionsListForResourceOptionalParams, - PolicyExemptionsListForManagementGroupOptionalParams, - PolicyExemptionsDeleteOptionalParams, - PolicyExemptionsCreateOrUpdateOptionalParams, - PolicyExemptionsCreateOrUpdateResponse, - PolicyExemptionsGetOptionalParams, - PolicyExemptionsGetResponse -} from "../models/index.js"; - -/// -/** Interface representing a PolicyExemptions. */ -export interface PolicyExemptions { - /** - * This operation retrieves the list of all policy exemptions associated with the given subscription - * that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()', - * 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not provided, the unfiltered - * list includes all policy exemptions associated with the subscription, including those that apply - * directly or from management groups that contain the given subscription, as well as any applied to - * objects contained within the subscription. - * @param options The options parameters. - */ - list( - options?: PolicyExemptionsListOptionalParams - ): PagedAsyncIterableIterator; - /** - * This operation retrieves the list of all policy exemptions associated with the given resource group - * in the given subscription that match the optional given $filter. Valid values for $filter are: - * 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter - * is not provided, the unfiltered list includes all policy exemptions associated with the resource - * group, including those that apply directly or apply from containing scopes, as well as any applied - * to resources contained within the resource group. - * @param resourceGroupName The name of the resource group containing the resource. - * @param options The options parameters. - */ - listForResourceGroup( - resourceGroupName: string, - options?: PolicyExemptionsListForResourceGroupOptionalParams - ): PagedAsyncIterableIterator; - /** - * This operation retrieves the list of all policy exemptions associated with the specified resource in - * the given resource group and subscription that match the optional given $filter. Valid values for - * $filter are: 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. - * If $filter is not provided, the unfiltered list includes all policy exemptions associated with the - * resource, including those that apply directly or from all containing scopes, as well as any applied - * to resources contained within the resource. Three parameters plus the resource name are used to - * identify a specific resource. If the resource is not part of a parent resource (the more common - * case), the parent resource path should not be provided (or provided as ''). For example a web app - * could be specified as ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', - * {resourceType} == 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent - * resource, then all parameters should be provided. For example a virtual machine DNS name could be - * specified as ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == - * 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', {resourceName} == - * 'MyComputerName'). A convenient alternative to providing the namespace and type name separately is - * to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', - * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). - * @param resourceGroupName The name of the resource group containing the resource. - * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace - * of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) - * @param parentResourcePath The parent resource path. Use empty string if there is none. - * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from - * Microsoft.Web/sites). - * @param resourceName The name of the resource. - * @param options The options parameters. - */ - listForResource( - resourceGroupName: string, - resourceProviderNamespace: string, - parentResourcePath: string, - resourceType: string, - resourceName: string, - options?: PolicyExemptionsListForResourceOptionalParams - ): PagedAsyncIterableIterator; - /** - * This operation retrieves the list of all policy exemptions applicable to the management group that - * match the given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()', - * 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter=atScope() is provided, the - * returned list includes all policy exemptions that are assigned to the management group or the - * management group's ancestors. - * @param managementGroupId The ID of the management group. - * @param options The options parameters. - */ - listForManagementGroup( - managementGroupId: string, - options?: PolicyExemptionsListForManagementGroupOptionalParams - ): PagedAsyncIterableIterator; - /** - * This operation deletes a policy exemption, given its name and the scope it was created in. The scope - * of a policy exemption is the part of its ID preceding - * '/providers/Microsoft.Authorization/policyExemptions/{policyExemptionName}'. - * @param scope The scope of the policy exemption. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param policyExemptionName The name of the policy exemption to delete. - * @param options The options parameters. - */ - delete( - scope: string, - policyExemptionName: string, - options?: PolicyExemptionsDeleteOptionalParams - ): Promise; - /** - * This operation creates or updates a policy exemption with the given scope and name. Policy - * exemptions apply to all resources contained within their scope. For example, when you create a - * policy exemption at resource group scope for a policy assignment at the same or above level, the - * exemption exempts to all applicable resources in the resource group. - * @param scope The scope of the policy exemption. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param policyExemptionName The name of the policy exemption to delete. - * @param parameters Parameters for the policy exemption. - * @param options The options parameters. - */ - createOrUpdate( - scope: string, - policyExemptionName: string, - parameters: PolicyExemption, - options?: PolicyExemptionsCreateOrUpdateOptionalParams - ): Promise; - /** - * This operation retrieves a single policy exemption, given its name and the scope it was created at. - * @param scope The scope of the policy exemption. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param policyExemptionName The name of the policy exemption to delete. - * @param options The options parameters. - */ - get( - scope: string, - policyExemptionName: string, - options?: PolicyExemptionsGetOptionalParams - ): Promise; -} diff --git a/sdk/policy/arm-policy/src/operationsInterfaces/policySetDefinitionVersions.ts b/sdk/policy/arm-policy/src/operationsInterfaces/policySetDefinitionVersions.ts new file mode 100644 index 000000000000..d5af57990542 --- /dev/null +++ b/sdk/policy/arm-policy/src/operationsInterfaces/policySetDefinitionVersions.ts @@ -0,0 +1,196 @@ +/* + * 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 { + PolicySetDefinitionVersion, + PolicySetDefinitionVersionsListOptionalParams, + PolicySetDefinitionVersionsListBuiltInOptionalParams, + PolicySetDefinitionVersionsListByManagementGroupOptionalParams, + PolicySetDefinitionVersionsListAllBuiltinsOptionalParams, + PolicySetDefinitionVersionsListAllBuiltinsResponse, + PolicySetDefinitionVersionsListAllAtManagementGroupOptionalParams, + PolicySetDefinitionVersionsListAllAtManagementGroupResponse, + PolicySetDefinitionVersionsListAllOptionalParams, + PolicySetDefinitionVersionsListAllResponse, + PolicySetDefinitionVersionsCreateOrUpdateOptionalParams, + PolicySetDefinitionVersionsCreateOrUpdateResponse, + PolicySetDefinitionVersionsDeleteOptionalParams, + PolicySetDefinitionVersionsGetOptionalParams, + PolicySetDefinitionVersionsGetResponse, + PolicySetDefinitionVersionsGetBuiltInOptionalParams, + PolicySetDefinitionVersionsGetBuiltInResponse, + PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams, + PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupResponse, + PolicySetDefinitionVersionsDeleteAtManagementGroupOptionalParams, + PolicySetDefinitionVersionsGetAtManagementGroupOptionalParams, + PolicySetDefinitionVersionsGetAtManagementGroupResponse, +} from "../models/index.js"; + +/// +/** Interface representing a PolicySetDefinitionVersions. */ +export interface PolicySetDefinitionVersions { + /** + * This operation retrieves a list of all the policy set definition versions for the given policy set + * definition. + * @param policySetDefinitionName The name of the policy set definition. + * @param options The options parameters. + */ + list( + policySetDefinitionName: string, + options?: PolicySetDefinitionVersionsListOptionalParams, + ): PagedAsyncIterableIterator; + /** + * This operation retrieves a list of all the built-in policy set definition versions for the given + * built-in policy set definition. + * @param policySetDefinitionName The name of the policy set definition. + * @param options The options parameters. + */ + listBuiltIn( + policySetDefinitionName: string, + options?: PolicySetDefinitionVersionsListBuiltInOptionalParams, + ): PagedAsyncIterableIterator; + /** + * This operation retrieves a list of all the policy set definition versions for the given policy set + * definition in a given management group. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @param options The options parameters. + */ + listByManagementGroup( + managementGroupName: string, + policySetDefinitionName: string, + options?: PolicySetDefinitionVersionsListByManagementGroupOptionalParams, + ): PagedAsyncIterableIterator; + /** + * This operation lists all the built-in policy set definition versions for all built-in policy set + * definitions. + * @param options The options parameters. + */ + listAllBuiltins( + options?: PolicySetDefinitionVersionsListAllBuiltinsOptionalParams, + ): Promise; + /** + * This operation lists all the policy set definition versions for all policy set definitions at the + * management group scope. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param options The options parameters. + */ + listAllAtManagementGroup( + managementGroupName: string, + options?: PolicySetDefinitionVersionsListAllAtManagementGroupOptionalParams, + ): Promise; + /** + * This operation lists all the policy set definition versions for all policy set definitions within a + * subscription. + * @param options The options parameters. + */ + listAll( + options?: PolicySetDefinitionVersionsListAllOptionalParams, + ): Promise; + /** + * This operation creates or updates a policy set definition version in the given subscription with the + * given name and version. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is + * the major version number, y is the minor version number, and z is the patch number + * @param parameters The policy set definition properties. + * @param options The options parameters. + */ + createOrUpdate( + policySetDefinitionName: string, + policyDefinitionVersion: string, + parameters: PolicySetDefinitionVersion, + options?: PolicySetDefinitionVersionsCreateOrUpdateOptionalParams, + ): Promise; + /** + * This operation deletes the policy set definition version in the given subscription with the given + * name and version. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is + * the major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + delete( + policySetDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicySetDefinitionVersionsDeleteOptionalParams, + ): Promise; + /** + * This operation retrieves the policy set definition version in the given subscription with the given + * name and version. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is + * the major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + get( + policySetDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicySetDefinitionVersionsGetOptionalParams, + ): Promise; + /** + * This operation retrieves the built-in policy set definition version with the given name and version. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is + * the major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + getBuiltIn( + policySetDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicySetDefinitionVersionsGetBuiltInOptionalParams, + ): Promise; + /** + * This operation creates or updates a policy set definition version in the given management group with + * the given name and version. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is + * the major version number, y is the minor version number, and z is the patch number + * @param parameters The policy set definition version properties. + * @param options The options parameters. + */ + createOrUpdateAtManagementGroup( + managementGroupName: string, + policySetDefinitionName: string, + policyDefinitionVersion: string, + parameters: PolicySetDefinitionVersion, + options?: PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupOptionalParams, + ): Promise; + /** + * This operation deletes the policy set definition version in the given management group with the + * given name and version. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is + * the major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + deleteAtManagementGroup( + managementGroupName: string, + policySetDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicySetDefinitionVersionsDeleteAtManagementGroupOptionalParams, + ): Promise; + /** + * This operation retrieves the policy set definition version in the given management group with the + * given name and version. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is + * the major version number, y is the minor version number, and z is the patch number + * @param options The options parameters. + */ + getAtManagementGroup( + managementGroupName: string, + policySetDefinitionName: string, + policyDefinitionVersion: string, + options?: PolicySetDefinitionVersionsGetAtManagementGroupOptionalParams, + ): Promise; +} diff --git a/sdk/policy/arm-policy/src/operationsInterfaces/policySetDefinitions.ts b/sdk/policy/arm-policy/src/operationsInterfaces/policySetDefinitions.ts index 00a73b4197dd..cca4213109a4 100644 --- a/sdk/policy/arm-policy/src/operationsInterfaces/policySetDefinitions.ts +++ b/sdk/policy/arm-policy/src/operationsInterfaces/policySetDefinitions.ts @@ -23,7 +23,7 @@ import { PolicySetDefinitionsCreateOrUpdateAtManagementGroupResponse, PolicySetDefinitionsDeleteAtManagementGroupOptionalParams, PolicySetDefinitionsGetAtManagementGroupOptionalParams, - PolicySetDefinitionsGetAtManagementGroupResponse + PolicySetDefinitionsGetAtManagementGroupResponse, } from "../models/index.js"; /// @@ -43,7 +43,7 @@ export interface PolicySetDefinitions { * @param options The options parameters. */ list( - options?: PolicySetDefinitionsListOptionalParams + options?: PolicySetDefinitionsListOptionalParams, ): PagedAsyncIterableIterator; /** * This operation retrieves a list of all the built-in policy set definitions that match the optional @@ -52,7 +52,7 @@ export interface PolicySetDefinitions { * @param options The options parameters. */ listBuiltIn( - options?: PolicySetDefinitionsListBuiltInOptionalParams + options?: PolicySetDefinitionsListBuiltInOptionalParams, ): PagedAsyncIterableIterator; /** * This operation retrieves a list of all the policy set definitions in a given management group that @@ -70,7 +70,7 @@ export interface PolicySetDefinitions { */ listByManagementGroup( managementGroupId: string, - options?: PolicySetDefinitionsListByManagementGroupOptionalParams + options?: PolicySetDefinitionsListByManagementGroupOptionalParams, ): PagedAsyncIterableIterator; /** * This operation creates or updates a policy set definition in the given subscription with the given @@ -82,7 +82,7 @@ export interface PolicySetDefinitions { createOrUpdate( policySetDefinitionName: string, parameters: PolicySetDefinition, - options?: PolicySetDefinitionsCreateOrUpdateOptionalParams + options?: PolicySetDefinitionsCreateOrUpdateOptionalParams, ): Promise; /** * This operation deletes the policy set definition in the given subscription with the given name. @@ -91,7 +91,7 @@ export interface PolicySetDefinitions { */ delete( policySetDefinitionName: string, - options?: PolicySetDefinitionsDeleteOptionalParams + options?: PolicySetDefinitionsDeleteOptionalParams, ): Promise; /** * This operation retrieves the policy set definition in the given subscription with the given name. @@ -100,7 +100,7 @@ export interface PolicySetDefinitions { */ get( policySetDefinitionName: string, - options?: PolicySetDefinitionsGetOptionalParams + options?: PolicySetDefinitionsGetOptionalParams, ): Promise; /** * This operation retrieves the built-in policy set definition with the given name. @@ -109,43 +109,43 @@ export interface PolicySetDefinitions { */ getBuiltIn( policySetDefinitionName: string, - options?: PolicySetDefinitionsGetBuiltInOptionalParams + options?: PolicySetDefinitionsGetBuiltInOptionalParams, ): Promise; /** * This operation creates or updates a policy set definition in the given management group with the * given name. - * @param policySetDefinitionName The name of the policy set definition to create. * @param managementGroupId The ID of the management group. + * @param policySetDefinitionName The name of the policy set definition to create. * @param parameters The policy set definition properties. * @param options The options parameters. */ createOrUpdateAtManagementGroup( - policySetDefinitionName: string, managementGroupId: string, + policySetDefinitionName: string, parameters: PolicySetDefinition, - options?: PolicySetDefinitionsCreateOrUpdateAtManagementGroupOptionalParams + options?: PolicySetDefinitionsCreateOrUpdateAtManagementGroupOptionalParams, ): Promise; /** * This operation deletes the policy set definition in the given management group with the given name. - * @param policySetDefinitionName The name of the policy set definition to delete. * @param managementGroupId The ID of the management group. + * @param policySetDefinitionName The name of the policy set definition to delete. * @param options The options parameters. */ deleteAtManagementGroup( - policySetDefinitionName: string, managementGroupId: string, - options?: PolicySetDefinitionsDeleteAtManagementGroupOptionalParams + policySetDefinitionName: string, + options?: PolicySetDefinitionsDeleteAtManagementGroupOptionalParams, ): Promise; /** * This operation retrieves the policy set definition in the given management group with the given * name. - * @param policySetDefinitionName The name of the policy set definition to get. * @param managementGroupId The ID of the management group. + * @param policySetDefinitionName The name of the policy set definition to get. * @param options The options parameters. */ getAtManagementGroup( - policySetDefinitionName: string, managementGroupId: string, - options?: PolicySetDefinitionsGetAtManagementGroupOptionalParams + policySetDefinitionName: string, + options?: PolicySetDefinitionsGetAtManagementGroupOptionalParams, ): Promise; } 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..b79dbb50c1f5 --- /dev/null +++ b/sdk/policy/arm-policy/src/operationsInterfaces/policyTokens.ts @@ -0,0 +1,41 @@ +/* + * 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< + OperationState, + 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/pagingHelper.ts b/sdk/policy/arm-policy/src/pagingHelper.ts index 269a2b9814b5..205cccc26592 100644 --- a/sdk/policy/arm-policy/src/pagingHelper.ts +++ b/sdk/policy/arm-policy/src/pagingHelper.ts @@ -28,7 +28,7 @@ export function getContinuationToken(page: unknown): string | undefined { export function setContinuationToken( page: unknown, - continuationToken: string | undefined + continuationToken: string | undefined, ): void { if (typeof page !== "object" || page === null || !continuationToken) { return; diff --git a/sdk/policy/arm-policy/src/policyClient.ts b/sdk/policy/arm-policy/src/policyClient.ts index 8e0c60e6453f..b5674452256d 100644 --- a/sdk/policy/arm-policy/src/policyClient.ts +++ b/sdk/policy/arm-policy/src/policyClient.ts @@ -8,58 +8,65 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; +import { + PipelineRequest, + PipelineResponse, + SendRequest, +} from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { - DataPolicyManifestsImpl, PolicyAssignmentsImpl, PolicyDefinitionsImpl, + PolicyDefinitionVersionsImpl, PolicySetDefinitionsImpl, - PolicyExemptionsImpl + PolicySetDefinitionVersionsImpl, + PolicyTokensImpl, } from "./operations/index.js"; import { - DataPolicyManifests, PolicyAssignments, PolicyDefinitions, + PolicyDefinitionVersions, PolicySetDefinitions, - PolicyExemptions + PolicySetDefinitionVersions, + PolicyTokens, } from "./operationsInterfaces/index.js"; import { PolicyClientOptionalParams } from "./models/index.js"; export class PolicyClient extends coreClient.ServiceClient { $host: string; + apiVersion: string; subscriptionId?: string; /** * Initializes a new instance of the PolicyClient class. * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param options The parameter options */ constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: PolicyClientOptionalParams + options?: PolicyClientOptionalParams, ); constructor( credentials: coreAuth.TokenCredential, - options?: PolicyClientOptionalParams + options?: PolicyClientOptionalParams, ); constructor( credentials: coreAuth.TokenCredential, - subscriptionIdOrOptions?: string | PolicyClientOptionalParams, - options?: PolicyClientOptionalParams + subscriptionIdOrOptions?: PolicyClientOptionalParams | string, + options?: PolicyClientOptionalParams, ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); } + let subscriptionId: string | undefined; - if (!subscriptionIdOrOptions !== undefined) { - if (typeof subscriptionIdOrOptions === "string") { - subscriptionId = subscriptionIdOrOptions; - } else if (typeof subscriptionIdOrOptions === "object") { - options = subscriptionIdOrOptions; - } + if (typeof subscriptionIdOrOptions === "string") { + subscriptionId = subscriptionIdOrOptions; + } else if (typeof subscriptionIdOrOptions === "object") { + options = subscriptionIdOrOptions; } // Initializing default values for options @@ -68,10 +75,10 @@ export class PolicyClient extends coreClient.ServiceClient { } const defaults: PolicyClientOptionalParams = { requestContentType: "application/json; charset=utf-8", - credential: credentials + credential: credentials, }; - const packageDetails = `azsdk-js-arm-policy/5.2.0-beta.1`; + const packageDetails = `azsdk-js-arm-policy/6.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -81,20 +88,21 @@ export class PolicyClient extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + 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 + coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -104,7 +112,7 @@ export class PolicyClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ @@ -114,9 +122,9 @@ export class PolicyClient extends coreClient.ServiceClient { `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -124,16 +132,50 @@ export class PolicyClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.dataPolicyManifests = new DataPolicyManifestsImpl(this); + 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.policyExemptions = new PolicyExemptionsImpl(this); + this.policySetDefinitionVersions = new PolicySetDefinitionVersionsImpl( + this, + ); + this.policyTokens = new PolicyTokensImpl(this); + this.addCustomApiVersionPolicy(options.apiVersion); + } + + /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ + private addCustomApiVersionPolicy(apiVersion?: string) { + if (!apiVersion) { + return; + } + const apiVersionPolicy = { + name: "CustomApiVersionPolicy", + async sendRequest( + request: PipelineRequest, + next: SendRequest, + ): Promise { + const param = request.url.split("?"); + if (param.length > 1) { + const newParams = param[1].split("&").map((item) => { + if (item.indexOf("api-version") > -1) { + return "api-version=" + apiVersion; + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + }, + }; + this.pipeline.addPolicy(apiVersionPolicy); } - dataPolicyManifests: DataPolicyManifests; policyAssignments: PolicyAssignments; policyDefinitions: PolicyDefinitions; + policyDefinitionVersions: PolicyDefinitionVersions; policySetDefinitions: PolicySetDefinitions; - policyExemptions: PolicyExemptions; + policySetDefinitionVersions: PolicySetDefinitionVersions; + policyTokens: PolicyTokens; } diff --git a/sdk/policy/arm-policy/test/sampleTest.ts b/sdk/policy/arm-policy/test/sampleTest.ts new file mode 100644 index 000000000000..a1cf7c25afd2 --- /dev/null +++ b/sdk/policy/arm-policy/test/sampleTest.ts @@ -0,0 +1,40 @@ +/* + * 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"; + +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 (ctx) => { + recorder = new Recorder(ctx); + await recorder.start(recorderOptions); + }); + + afterEach(async () => { + await recorder.stop(); + }); + + it("sample test", async function () { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/policy/arm-policy/test/snippets.spec.ts b/sdk/policy/arm-policy/test/snippets.spec.ts index a720e9ccf529..bc896d0e4226 100644 --- a/sdk/policy/arm-policy/test/snippets.spec.ts +++ b/sdk/policy/arm-policy/test/snippets.spec.ts @@ -1,15 +1,29 @@ +/* + * 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 { PolicyClient } from "../src/index.js"; -import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; +import { + DefaultAzureCredential, + InteractiveBrowserCredential, +} from "@azure/identity"; import { setLogLevel } from "@azure/logger"; import { describe, it } from "vitest"; describe("snippets", () => { it("ReadmeSampleCreateClient_Node", async () => { const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new PolicyClient(new DefaultAzureCredential(), subscriptionId); + const client = new PolicyClient( + new DefaultAzureCredential(), + subscriptionId, + ); }); it("ReadmeSampleCreateClient_Browser", async () => { diff --git a/sdk/policy/arm-policy/tsconfig.browser.config.json b/sdk/policy/arm-policy/tsconfig.browser.config.json index 75871518e3a0..0c8bafa97126 100644 --- a/sdk/policy/arm-policy/tsconfig.browser.config.json +++ b/sdk/policy/arm-policy/tsconfig.browser.config.json @@ -1,3 +1,6 @@ { - "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..acfa80d6baf6 100644 --- a/sdk/policy/arm-policy/tsconfig.json +++ b/sdk/policy/arm-policy/tsconfig.json @@ -1,13 +1,30 @@ { - "references": [ - { - "path": "./tsconfig.src.json" - }, - { - "path": "./tsconfig.samples.json" - }, - { - "path": "./tsconfig.test.json" - } + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": [ + "es6", + "dom" + ], + "declaration": true, + "outDir": "./dist-esm", + "importHelpers": true + }, + "include": [ + "src/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts" + ], + "exclude": [ + "node_modules" ] -} +} \ No newline at end of file diff --git a/sdk/policy/arm-policy/tsconfig.samples.json b/sdk/policy/arm-policy/tsconfig.samples.json index f5ea3b3d21f7..e1cf3a314f09 100644 --- a/sdk/policy/arm-policy/tsconfig.samples.json +++ b/sdk/policy/arm-policy/tsconfig.samples.json @@ -2,7 +2,9 @@ "extends": "../../../tsconfig.samples.base.json", "compilerOptions": { "paths": { - "@azure/arm-policy": ["./dist/esm"] + "@azure/arm-policy": [ + "./dist/esm" + ] } } } diff --git a/sdk/policy/arm-policy/tsconfig.test.json b/sdk/policy/arm-policy/tsconfig.test.json index 290ca214aebc..3c2b783a8c1b 100644 --- a/sdk/policy/arm-policy/tsconfig.test.json +++ b/sdk/policy/arm-policy/tsconfig.test.json @@ -1,3 +1,6 @@ { - "extends": ["./tsconfig.src.json", "../../../tsconfig.test.base.json"] + "extends": [ + "./tsconfig.src.json", + "../../../tsconfig.test.base.json" + ] } diff --git a/sdk/policy/arm-policy/vitest.browser.config.ts b/sdk/policy/arm-policy/vitest.browser.config.ts index 10e70dbfa8ee..182729ab5ce9 100644 --- a/sdk/policy/arm-policy/vitest.browser.config.ts +++ b/sdk/policy/arm-policy/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/policy/arm-policy/vitest.config.ts b/sdk/policy/arm-policy/vitest.config.ts index 86a71911ccc2..40e031385dd8 100644 --- a/sdk/policy/arm-policy/vitest.config.ts +++ b/sdk/policy/arm-policy/vitest.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. diff --git a/sdk/policy/arm-policy/vitest.esm.config.ts b/sdk/policy/arm-policy/vitest.esm.config.ts index 5e9735e9b144..a70127279fc9 100644 --- a/sdk/policy/arm-policy/vitest.esm.config.ts +++ b/sdk/policy/arm-policy/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/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..4f9a248de81c 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 @@ -108,7 +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) - +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fresources-subscriptions%2Farm-resources-subscriptions%2FREADME.png) [azure_cli]: https://learn.microsoft.com/cli/azure [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..31bf9062391b 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": "a3dcf1c9eb0324a1e4e9a12ec4655f54ba1f44f5", "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", - "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" + "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/test-repo-billy/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.23", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/api-extractor.json b/sdk/resources-subscriptions/arm-resources-subscriptions/api-extractor.json index 93b4d73575fc..e6ee8b9d231c 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/api-extractor.json +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/api-extractor.json @@ -1,6 +1,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "dist/esm/index.d.ts", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", "docModel": { "enabled": true }, @@ -11,7 +11,7 @@ "dtsRollup": { "enabled": true, "untrimmedFilePath": "", - "publicTrimmedFilePath": "dist/arm-resources-subscriptions.d.ts" + "publicTrimmedFilePath": "./types/arm-resources-subscriptions.d.ts" }, "messages": { "tsdocMessageReporting": { @@ -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 b9f63c0bd011..6a180f1da1c0 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": [ @@ -23,21 +23,21 @@ ], "license": "MIT", "main": "./dist/commonjs/index.js", - "module": "./dist/esm/index.js", + "module": "./dist-esm/src/index.js", "types": "./dist/commonjs/index.d.ts", "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.8.0", "@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", - "typescript": "~5.8.2", + "playwright": "^1.51.1", + "typescript": "~5.6.2", "vitest": "^3.0.9" }, "repository": { @@ -91,14 +91,6 @@ }, "autoPublish": true, "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", @@ -139,4 +131,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..d1a0fe76aedc 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", } /** 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..a6c3d0404f2a 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,56 @@ 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 +503,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 +528,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 +559,11 @@ export const ManagedByTenant: coreClient.CompositeMapper = { serializedName: "tenantId", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const SubscriptionListResult: coreClient.CompositeMapper = { @@ -572,20 +578,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 +606,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 +631,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 +677,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 +715,8 @@ export const CheckZonePeersRequest: coreClient.CompositeMapper = { location: { serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, subscriptionIds: { serializedName: "subscriptionIds", @@ -718,13 +724,13 @@ export const CheckZonePeersRequest: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } - } - } - } + name: "String", + }, + }, + }, + }, + }, + }, }; export const CheckZonePeersResult: coreClient.CompositeMapper = { @@ -736,14 +742,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 +758,13 @@ export const CheckZonePeersResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "AvailabilityZonePeers" - } - } - } - } - } - } + className: "AvailabilityZonePeers", + }, + }, + }, + }, + }, + }, }; export const AvailabilityZonePeers: coreClient.CompositeMapper = { @@ -770,8 +776,8 @@ export const AvailabilityZonePeers: coreClient.CompositeMapper = { serializedName: "availabilityZone", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, peers: { serializedName: "peers", @@ -780,13 +786,13 @@ export const AvailabilityZonePeers: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Peers" - } - } - } - } - } - } + className: "Peers", + }, + }, + }, + }, + }, + }, }; export const Peers: coreClient.CompositeMapper = { @@ -798,18 +804,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 +827,11 @@ export const ErrorResponseAutoGenerated: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorDetail" - } - } - } - } + className: "ErrorDetail", + }, + }, + }, + }, }; export const ErrorDetail: coreClient.CompositeMapper = { @@ -837,22 +843,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 +868,10 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorDetail" - } - } - } + className: "ErrorDetail", + }, + }, + }, }, additionalInfo: { serializedName: "additionalInfo", @@ -875,13 +881,13 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorAdditionalInfo" - } - } - } - } - } - } + className: "ErrorAdditionalInfo", + }, + }, + }, + }, + }, + }, }; export const ResourceName: coreClient.CompositeMapper = { @@ -893,18 +899,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 +921,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 +948,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 +991,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 +1028,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..6b3d03b1b38e 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"; /// @@ -39,7 +39,7 @@ export class OperationsImpl implements Operations { * @param options The options parameters. */ public list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -54,13 +54,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 +81,7 @@ export class OperationsImpl implements Operations { } private async *listPagingAll( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -93,7 +93,7 @@ export class OperationsImpl implements Operations { * @param options The options parameters. */ private _list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -105,11 +105,11 @@ export class OperationsImpl implements Operations { */ private _listNext( nextLink: string, - options?: OperationsListNextOptionalParams + options?: OperationsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -121,29 +121,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..03d69e69ef35 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,11 +81,11 @@ export class SubscriptionsImpl implements Subscriptions { private async *listLocationsPagingAll( subscriptionId: string, - options?: SubscriptionsListLocationsOptionalParams + options?: SubscriptionsListLocationsOptionalParams, ): AsyncIterableIterator { for await (const page of this.listLocationsPagingPage( subscriptionId, - options + options, )) { yield* page; } @@ -96,7 +96,7 @@ export class SubscriptionsImpl implements Subscriptions { * @param options The options parameters. */ public list( - options?: SubscriptionsListOptionalParams + options?: SubscriptionsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -111,13 +111,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 +138,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 +153,11 @@ export class SubscriptionsImpl implements Subscriptions { */ private _listLocations( subscriptionId: string, - options?: SubscriptionsListLocationsOptionalParams + options?: SubscriptionsListLocationsOptionalParams, ): Promise { return this.client.sendOperationRequest( { subscriptionId, options }, - listLocationsOperationSpec + listLocationsOperationSpec, ); } @@ -168,11 +168,11 @@ export class SubscriptionsImpl implements Subscriptions { */ get( subscriptionId: string, - options?: SubscriptionsGetOptionalParams + options?: SubscriptionsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { subscriptionId, options }, - getOperationSpec + getOperationSpec, ); } @@ -181,7 +181,7 @@ export class SubscriptionsImpl implements Subscriptions { * @param options The options parameters. */ private _list( - options?: SubscriptionsListOptionalParams + options?: SubscriptionsListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -195,11 +195,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,11 +210,11 @@ export class SubscriptionsImpl implements Subscriptions { */ private _listNext( nextLink: string, - options?: SubscriptionsListNextOptionalParams + options?: SubscriptionsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -226,80 +226,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..a5ca103bf5bf 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; @@ -93,7 +93,7 @@ export class TenantsImpl implements Tenants { * @param options The options parameters. */ private _list( - options?: TenantsListOptionalParams + options?: TenantsListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -105,11 +105,11 @@ export class TenantsImpl implements Tenants { */ private _listNext( nextLink: string, - options?: TenantsListNextOptionalParams + options?: TenantsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -121,29 +121,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..16fcc4862385 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/operations.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/operations.ts @@ -17,6 +17,6 @@ export interface Operations { * @param options The options parameters. */ list( - options?: OperationsListOptionalParams + 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..ef9dbfa28222 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,14 +30,14 @@ 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 + options?: SubscriptionsListOptionalParams, ): PagedAsyncIterableIterator; /** * Gets details about a specified subscription. @@ -46,7 +46,7 @@ export interface Subscriptions { */ get( subscriptionId: string, - options?: SubscriptionsGetOptionalParams + options?: SubscriptionsGetOptionalParams, ): Promise; /** * Compares a subscriptions logical zone mapping @@ -57,6 +57,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..e36e2e290e4c 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/tenants.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/operationsInterfaces/tenants.ts @@ -17,6 +17,6 @@ export interface Tenants { * @param options The options parameters. */ list( - options?: TenantsListOptionalParams + 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..205cccc26592 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/pagingHelper.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/pagingHelper.ts @@ -28,7 +28,7 @@ export function getContinuationToken(page: unknown): string | undefined { export function setContinuationToken( page: unknown, - continuationToken: string | undefined + 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..263f9a854558 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/src/subscriptionClient.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/src/subscriptionClient.ts @@ -11,7 +11,7 @@ import * as coreRestPipeline from "@azure/core-rest-pipeline"; import { PipelineRequest, PipelineResponse, - SendRequest + SendRequest, } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { OperationsImpl, SubscriptionsImpl, TenantsImpl } from "./operations/index.js"; @@ -21,7 +21,7 @@ import * as Mappers from "./models/mappers.js"; import { SubscriptionClientOptionalParams, CheckResourceNameOptionalParams, - CheckResourceNameResponse + CheckResourceNameResponse, } from "./models/index.js"; export class SubscriptionClient extends coreClient.ServiceClient { @@ -35,7 +35,7 @@ export class SubscriptionClient extends coreClient.ServiceClient { */ constructor( credentials: coreAuth.TokenCredential, - options?: SubscriptionClientOptionalParams + options?: SubscriptionClientOptionalParams, ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); @@ -47,10 +47,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 +60,21 @@ export class SubscriptionClient extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + 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 + coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -83,7 +84,7 @@ export class SubscriptionClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ @@ -93,9 +94,9 @@ export class SubscriptionClient extends coreClient.ServiceClient { `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } @@ -117,7 +118,7 @@ export class SubscriptionClient extends coreClient.ServiceClient { name: "CustomApiVersionPolicy", async sendRequest( request: PipelineRequest, - next: SendRequest + next: SendRequest, ): Promise { const param = request.url.split("?"); if (param.length > 1) { @@ -131,7 +132,7 @@ export class SubscriptionClient extends coreClient.ServiceClient { request.url = param[0] + "?" + newParams.join("&"); } return next(request); - } + }, }; this.pipeline.addPolicy(apiVersionPolicy); } @@ -142,11 +143,11 @@ export class SubscriptionClient extends coreClient.ServiceClient { * @param options The options parameters. */ checkResourceName( - options?: CheckResourceNameOptionalParams + options?: CheckResourceNameOptionalParams, ): Promise { return this.sendOperationRequest( { options }, - checkResourceNameOperationSpec + checkResourceNameOperationSpec, ); } @@ -162,16 +163,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.ts b/sdk/resources-subscriptions/arm-resources-subscriptions/test/sampleTest.ts new file mode 100644 index 000000000000..a1cf7c25afd2 --- /dev/null +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/test/sampleTest.ts @@ -0,0 +1,40 @@ +/* + * 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"; + +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 (ctx) => { + recorder = new Recorder(ctx); + await recorder.start(recorderOptions); + }); + + afterEach(async () => { + await recorder.stop(); + }); + + it("sample test", async function () { + console.log("Hi, I'm a test!"); + }); +}); 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..3b9bb1adf8ea 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/test/snippets.spec.ts +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/test/snippets.spec.ts @@ -1,15 +1,29 @@ +/* + * 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 { SubscriptionClient } from "../src/index.js"; -import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; +import { + DefaultAzureCredential, + InteractiveBrowserCredential, +} from "@azure/identity"; import { setLogLevel } from "@azure/logger"; import { describe, it } from "vitest"; describe("snippets", () => { it("ReadmeSampleCreateClient_Node", async () => { const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new SubscriptionClient(new DefaultAzureCredential(), subscriptionId); + const client = new SubscriptionClient( + new DefaultAzureCredential(), + subscriptionId, + ); }); it("ReadmeSampleCreateClient_Browser", async () => { diff --git a/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.json b/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.json index 19ceb382b521..ba97259d3e40 100644 --- a/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.json +++ b/sdk/resources-subscriptions/arm-resources-subscriptions/tsconfig.json @@ -1,13 +1,34 @@ { - "references": [ - { - "path": "./tsconfig.src.json" - }, - { - "path": "./tsconfig.samples.json" - }, - { - "path": "./tsconfig.test.json" - } + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": [ + "es6", + "dom" + ], + "declaration": true, + "outDir": "./dist-esm", + "importHelpers": true + }, + "include": [ + "src/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts" + ], + "exclude": [ + "node_modules" ] -} +} \ No newline at end of file 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..a3d7ad89584b 100644 --- a/sdk/resources/arm-resources/README.md +++ b/sdk/resources/arm-resources/README.md @@ -6,7 +6,7 @@ Provides operations for working with resources and resource groups. [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources/arm-resources) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-resources) | -[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-resources) | +[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-resources?view=azure-node-preview) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started @@ -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 @@ -107,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) +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fresources%2Farm-resources%2FREADME.png) [azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/ diff --git a/sdk/resources/arm-resources/_meta.json b/sdk/resources/arm-resources/_meta.json index f127ba6214d8..31bf9062391b 100644 --- a/sdk/resources/arm-resources/_meta.json +++ b/sdk/resources/arm-resources/_meta.json @@ -1,8 +1,8 @@ { - "commit": "35ace1532807c025b39eb837a5198115e3488f61", + "commit": "a3dcf1c9eb0324a1e4e9a12ec4655f54ba1f44f5", "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", - "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" + "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/test-repo-billy/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.23", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/resources/arm-resources/api-extractor.json b/sdk/resources/arm-resources/api-extractor.json index 18c93cc719dc..20477a758ec1 100644 --- a/sdk/resources/arm-resources/api-extractor.json +++ b/sdk/resources/arm-resources/api-extractor.json @@ -1,6 +1,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "dist/esm/index.d.ts", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", "docModel": { "enabled": true }, @@ -11,7 +11,7 @@ "dtsRollup": { "enabled": true, "untrimmedFilePath": "", - "publicTrimmedFilePath": "dist/arm-resources.d.ts" + "publicTrimmedFilePath": "./types/arm-resources.d.ts" }, "messages": { "tsdocMessageReporting": { @@ -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 11dc2bd255d9..d1efe3519ef0 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": "1.0.0-beta.1", "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": [ @@ -25,21 +25,21 @@ ], "license": "MIT", "main": "./dist/commonjs/index.js", - "module": "./dist/esm/index.js", + "module": "./dist-esm/src/index.js", "types": "./dist/commonjs/index.d.ts", "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.8.0", "@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", - "typescript": "~5.8.2", + "playwright": "^1.51.1", + "typescript": "~5.6.2", "vitest": "^3.0.9" }, "repository": { @@ -93,14 +93,6 @@ }, "autoPublish": true, "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", @@ -141,4 +133,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/resources/arm-resources/src/resourceManagementClient.ts b/sdk/resources/arm-resources/src/resourceManagementClient.ts index 8a877914d5b2..4f825b3ee5bb 100644 --- a/sdk/resources/arm-resources/src/resourceManagementClient.ts +++ b/sdk/resources/arm-resources/src/resourceManagementClient.ts @@ -82,7 +82,7 @@ export class ResourceManagementClient extends coreClient.ServiceClient { credential: credentials, }; - const packageDetails = `azsdk-js-arm-resources/6.0.1`; + const packageDetails = `azsdk-js-arm-resources/1.0.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` diff --git a/sdk/resources/arm-resources/test/sampleTest.ts b/sdk/resources/arm-resources/test/sampleTest.ts new file mode 100644 index 000000000000..a1cf7c25afd2 --- /dev/null +++ b/sdk/resources/arm-resources/test/sampleTest.ts @@ -0,0 +1,40 @@ +/* + * 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"; + +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 (ctx) => { + recorder = new Recorder(ctx); + await recorder.start(recorderOptions); + }); + + afterEach(async () => { + await recorder.stop(); + }); + + it("sample test", async function () { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/resources/arm-resources/test/snippets.spec.ts b/sdk/resources/arm-resources/test/snippets.spec.ts index e0f7036e0f07..bc30001c36d6 100644 --- a/sdk/resources/arm-resources/test/snippets.spec.ts +++ b/sdk/resources/arm-resources/test/snippets.spec.ts @@ -1,15 +1,29 @@ +/* + * 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 { ResourceManagementClient } from "../src/index.js"; -import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; +import { + DefaultAzureCredential, + InteractiveBrowserCredential, +} from "@azure/identity"; import { setLogLevel } from "@azure/logger"; import { describe, it } from "vitest"; describe("snippets", () => { it("ReadmeSampleCreateClient_Node", async () => { const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new ResourceManagementClient(new DefaultAzureCredential(), subscriptionId); + const client = new ResourceManagementClient( + new DefaultAzureCredential(), + subscriptionId, + ); }); it("ReadmeSampleCreateClient_Browser", async () => { diff --git a/sdk/resources/arm-resources/tsconfig.json b/sdk/resources/arm-resources/tsconfig.json index 19ceb382b521..b35d05ad6e9d 100644 --- a/sdk/resources/arm-resources/tsconfig.json +++ b/sdk/resources/arm-resources/tsconfig.json @@ -1,13 +1,27 @@ { - "references": [ - { - "path": "./tsconfig.src.json" - }, - { - "path": "./tsconfig.samples.json" - }, - { - "path": "./tsconfig.test.json" - } + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": [ + "es6", + "dom" + ], + "declaration": true, + "outDir": "./dist-esm", + "importHelpers": true + }, + "include": [ + "src/**/*.ts", + "test/**/*.ts" + ], + "exclude": [ + "node_modules" ] -} +} \ No newline at end of file diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/LICENSE b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/LICENSE index b2f52a2bad4e..63447fd8bbbf 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/LICENSE +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/LICENSE @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/README.md b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/README.md index 2c0a3d8be8c6..c1b2f763e8ea 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/README.md +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/README.md @@ -6,7 +6,7 @@ The APIs listed in this specification can be used to manage Deployment stack res [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-resourcesdeploymentstacks) | -[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-resourcesdeploymentstacks) | +[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-resourcesdeploymentstacks?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 DeploymentStacks** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. For more information about how to create an Azure AD Application check out [this guide](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). @@ -64,16 +63,14 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur import { InteractiveBrowserCredential } from "@azure/identity"; import { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks"; -const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", - clientId: "", -}); + clientId: "" + }); const client = new DeploymentStacksClient(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,7 +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) - +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fresourcesdeploymentstacks%2Farm-resourcesdeploymentstacks%2FREADME.png) [azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/ diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/_meta.json b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/_meta.json index 711ebacb70e8..31bf9062391b 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/_meta.json +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/_meta.json @@ -1,8 +1,8 @@ { - "commit": "3a9110b06d1053fb4ef5f5c56002506dcc283c95", + "commit": "a3dcf1c9eb0324a1e4e9a12ec4655f54ba1f44f5", "readme": "specification/resources/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\resources\\resource-manager\\readme.md --use=@autorest/typescript@6.0.23 --generate-sample=true", - "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.9", - "use": "@autorest/typescript@6.0.23" + "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/test-repo-billy/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.23", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/api-extractor.json b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/api-extractor.json index 66ac2e5f1233..a6aef8d34614 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/api-extractor.json +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/api-extractor.json @@ -1,6 +1,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "dist/esm/index.d.ts", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", "docModel": { "enabled": true }, @@ -11,7 +11,7 @@ "dtsRollup": { "enabled": true, "untrimmedFilePath": "", - "publicTrimmedFilePath": "dist/arm-resourcesdeploymentstacks.d.ts" + "publicTrimmedFilePath": "./types/arm-resourcesdeploymentstacks.d.ts" }, "messages": { "tsdocMessageReporting": { @@ -28,4 +28,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/package.json b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/package.json index ff228087af0a..88c8319ec2b5 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/package.json +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/package.json @@ -3,17 +3,17 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for DeploymentStacksClient.", - "version": "1.0.1", + "version": "1.0.0-beta.2", "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": [ @@ -25,21 +25,21 @@ ], "license": "MIT", "main": "./dist/commonjs/index.js", - "module": "./dist/esm/index.js", + "module": "./dist-esm/src/index.js", "types": "./dist/commonjs/index.d.ts", "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.8.0", "@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", - "typescript": "~5.8.2", + "playwright": "^1.51.1", + "typescript": "~5.6.2", "vitest": "^3.0.9" }, "repository": { @@ -93,14 +93,6 @@ }, "autoPublish": true, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-resourcesdeploymentstacks?view=azure-node-preview" - }, "type": "module", "tshy": { "project": "./tsconfig.src.json", @@ -141,4 +133,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/sample.env b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/sample.env +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/deploymentStacksClient.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/deploymentStacksClient.ts index e6b232c16657..aec42239ef8a 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/deploymentStacksClient.ts +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/deploymentStacksClient.ts @@ -64,7 +64,7 @@ export class DeploymentStacksClient extends coreClient.ServiceClient { credential: credentials, }; - const packageDetails = `azsdk-js-arm-resourcesdeploymentstacks/1.0.1`; + const packageDetails = `azsdk-js-arm-resourcesdeploymentstacks/1.0.0-beta.2`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/lroImpl.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/lroImpl.ts index d8bc98987053..5f88efab981b 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/lroImpl.ts +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/src/lroImpl.ts @@ -5,6 +5,10 @@ * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + import { AbortSignalLike } from "@azure/abort-controller"; import { LongRunningOperation, LroResponse } from "@azure/core-lro"; diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/test/sampleTest.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/test/sampleTest.ts new file mode 100644 index 000000000000..a1cf7c25afd2 --- /dev/null +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/test/sampleTest.ts @@ -0,0 +1,40 @@ +/* + * 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"; + +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 (ctx) => { + recorder = new Recorder(ctx); + await recorder.start(recorderOptions); + }); + + afterEach(async () => { + await recorder.stop(); + }); + + it("sample test", async function () { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/test/snippets.spec.ts b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/test/snippets.spec.ts index 55d34b8b17b7..0eb10a50558a 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/test/snippets.spec.ts +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/test/snippets.spec.ts @@ -1,15 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { DeploymentStacksClient } from "../src/index.js"; -import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; +import { + DefaultAzureCredential, + InteractiveBrowserCredential, +} from "@azure/identity"; import { setLogLevel } from "@azure/logger"; import { describe, it } from "vitest"; describe("snippets", () => { it("ReadmeSampleCreateClient_Node", async () => { const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeploymentStacksClient(new DefaultAzureCredential(), subscriptionId); + const client = new DeploymentStacksClient( + new DefaultAzureCredential(), + subscriptionId, + ); }); it("ReadmeSampleCreateClient_Browser", async () => { diff --git a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/tsconfig.json b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/tsconfig.json index 19ceb382b521..36d3b14667f6 100644 --- a/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/tsconfig.json +++ b/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/tsconfig.json @@ -1,13 +1,36 @@ { - "references": [ - { - "path": "./tsconfig.src.json" - }, - { - "path": "./tsconfig.samples.json" - }, - { - "path": "./tsconfig.test.json" - } + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": [ + "es6", + "dom" + ], + "declaration": true, + "outDir": "./dist-esm", + "importHelpers": true + }, + "include": [ + "src/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts" + ], + "exclude": [ + "node_modules" ] -} +} \ No newline at end of file diff --git a/sdk/templatespecs/arm-templatespecs/CHANGELOG.md b/sdk/templatespecs/arm-templatespecs/CHANGELOG.md index cabbd0a67e3b..8341b78cdf6a 100644 --- a/sdk/templatespecs/arm-templatespecs/CHANGELOG.md +++ b/sdk/templatespecs/arm-templatespecs/CHANGELOG.md @@ -1,15 +1,33 @@ # Release History - -## 2.1.1 (Unreleased) - + +## 3.0.0 (2025-03-18) + ### Features Added -### Breaking Changes - -### Bugs Fixed + - Added operation TemplateSpecs.getBuiltIn + - Added operation TemplateSpecs.listBuiltIns + - Added operation TemplateSpecVersions.getBuiltIn + - Added operation TemplateSpecVersions.listBuiltIns + - Added Interface TemplateSpecsGetBuiltInOptionalParams + - Added Interface TemplateSpecsListBuiltInsNextOptionalParams + - Added Interface TemplateSpecsListBuiltInsOptionalParams + - Added Interface TemplateSpecVersionsGetBuiltInOptionalParams + - Added Interface TemplateSpecVersionsListBuiltInsNextOptionalParams + - Added Interface TemplateSpecVersionsListBuiltInsOptionalParams + - Added Type Alias TemplateSpecsGetBuiltInResponse + - Added Type Alias TemplateSpecsListBuiltInsNextResponse + - Added Type Alias TemplateSpecsListBuiltInsResponse + - Added Type Alias TemplateSpecVersionsGetBuiltInResponse + - Added Type Alias TemplateSpecVersionsListBuiltInsNextResponse + - Added Type Alias TemplateSpecVersionsListBuiltInsResponse -### Other Changes +### Breaking Changes + - Class TemplateSpecsClient has a new signature + - Interface TemplateSpecsListByResourceGroupNextOptionalParams no longer has parameter expand + - Interface TemplateSpecsListBySubscriptionNextOptionalParams no longer has parameter expand + + ## 2.1.0 (2022-11-23) ### Features Added @@ -21,10 +39,10 @@ ## 2.0.1 (2022-04-18) -### Features Added +**features** - Bug fix ## 2.0.0 (2021-12-16) -- The package of @azure/arm-templatespecs 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-templatespecs 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/templatespecs/arm-templatespecs/LICENSE b/sdk/templatespecs/arm-templatespecs/LICENSE index b2f52a2bad4e..63447fd8bbbf 100644 --- a/sdk/templatespecs/arm-templatespecs/LICENSE +++ b/sdk/templatespecs/arm-templatespecs/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/templatespecs/arm-templatespecs/README.md b/sdk/templatespecs/arm-templatespecs/README.md index 1e621a8e1b33..bbbe07a0a727 100644 --- a/sdk/templatespecs/arm-templatespecs/README.md +++ b/sdk/templatespecs/arm-templatespecs/README.md @@ -44,12 +44,11 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure TemplateSpecs** 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). Using Node.js and Node-like environments, you can use the `DefaultAzureCredential` class to authenticate the client. - + ```ts snippet:ReadmeSampleCreateClient_Node import { TemplateSpecsClient } from "@azure/arm-templatespecs"; import { DefaultAzureCredential } from "@azure/identity"; @@ -57,23 +56,21 @@ import { DefaultAzureCredential } from "@azure/identity"; const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new TemplateSpecsClient(new DefaultAzureCredential(), subscriptionId); ``` - + For browser environments, use the `InteractiveBrowserCredential` from the `@azure/identity` package to authenticate. - + ```ts snippet:ReadmeSampleCreateClient_Browser import { InteractiveBrowserCredential } from "@azure/identity"; import { TemplateSpecsClient } from "@azure/arm-templatespecs"; -const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", - clientId: "", -}); + clientId: "" + }); const client = new TemplateSpecsClient(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,7 +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) - +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Ftemplatespecs%2Farm-templatespecs%2FREADME.png) [azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/ diff --git a/sdk/templatespecs/arm-templatespecs/_meta.json b/sdk/templatespecs/arm-templatespecs/_meta.json index 4b98b8203a1f..31bf9062391b 100644 --- a/sdk/templatespecs/arm-templatespecs/_meta.json +++ b/sdk/templatespecs/arm-templatespecs/_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", - "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" + "commit": "a3dcf1c9eb0324a1e4e9a12ec4655f54ba1f44f5", + "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/test-repo-billy/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.23", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/templatespecs/arm-templatespecs/api-extractor.json b/sdk/templatespecs/arm-templatespecs/api-extractor.json index 548fd020629c..933b7f47abcd 100644 --- a/sdk/templatespecs/arm-templatespecs/api-extractor.json +++ b/sdk/templatespecs/arm-templatespecs/api-extractor.json @@ -1,6 +1,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "dist/esm/index.d.ts", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", "docModel": { "enabled": true }, @@ -11,7 +11,7 @@ "dtsRollup": { "enabled": true, "untrimmedFilePath": "", - "publicTrimmedFilePath": "dist/arm-templatespecs.d.ts" + "publicTrimmedFilePath": "./types/arm-templatespecs.d.ts" }, "messages": { "tsdocMessageReporting": { @@ -28,4 +28,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/templatespecs/arm-templatespecs/package.json b/sdk/templatespecs/arm-templatespecs/package.json index 5af4d3d72adc..8943f234a847 100644 --- a/sdk/templatespecs/arm-templatespecs/package.json +++ b/sdk/templatespecs/arm-templatespecs/package.json @@ -3,15 +3,15 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for TemplateSpecsClient.", - "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": [ @@ -23,23 +23,23 @@ ], "license": "MIT", "main": "./dist/commonjs/index.js", - "module": "./dist/esm/index.js", + "module": "./dist-esm/src/index.js", "types": "./dist/commonjs/index.d.ts", "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.8.0", "@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", - "typescript": "~5.8.2", + "dotenv": "^16.0.0", + "playwright": "^1.51.1", + "typescript": "~5.6.2", "vitest": "^3.0.9" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/templatespecs/arm-templatespecs", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" @@ -90,14 +90,7 @@ ] }, "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-templatespecs?view=azure-node-preview" - }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/templatespecs/arm-templatespecs", "type": "module", "tshy": { "project": "./tsconfig.src.json", @@ -138,4 +131,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/templatespecs/arm-templatespecs/review/arm-templatespecs.api.md b/sdk/templatespecs/arm-templatespecs/review/arm-templatespecs.api.md index 56c81b6f8c56..a45a09d0af6b 100644 --- a/sdk/templatespecs/arm-templatespecs/review/arm-templatespecs.api.md +++ b/sdk/templatespecs/arm-templatespecs/review/arm-templatespecs.api.md @@ -88,6 +88,8 @@ export interface TemplateSpecs { createOrUpdate(resourceGroupName: string, templateSpecName: string, templateSpec: TemplateSpec, options?: TemplateSpecsCreateOrUpdateOptionalParams): Promise; delete(resourceGroupName: string, templateSpecName: string, options?: TemplateSpecsDeleteOptionalParams): Promise; get(resourceGroupName: string, templateSpecName: string, options?: TemplateSpecsGetOptionalParams): Promise; + getBuiltIn(templateSpecName: string, options?: TemplateSpecsGetBuiltInOptionalParams): Promise; + listBuiltIns(options?: TemplateSpecsListBuiltInsOptionalParams): PagedAsyncIterableIterator; listByResourceGroup(resourceGroupName: string, options?: TemplateSpecsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; listBySubscription(options?: TemplateSpecsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; update(resourceGroupName: string, templateSpecName: string, options?: TemplateSpecsUpdateOptionalParams): Promise; @@ -98,10 +100,11 @@ export class TemplateSpecsClient extends coreClient.ServiceClient { // (undocumented) $host: string; constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: TemplateSpecsClientOptionalParams); + constructor(credentials: coreAuth.TokenCredential, options?: TemplateSpecsClientOptionalParams); // (undocumented) apiVersion: string; // (undocumented) - subscriptionId: string; + subscriptionId?: string; // (undocumented) templateSpecs: TemplateSpecs; // (undocumented) @@ -131,6 +134,14 @@ export interface TemplateSpecsError { error?: ErrorResponse; } +// @public +export interface TemplateSpecsGetBuiltInOptionalParams extends coreClient.OperationOptions { + expand?: TemplateSpecExpandKind; +} + +// @public +export type TemplateSpecsGetBuiltInResponse = TemplateSpec; + // @public export interface TemplateSpecsGetOptionalParams extends coreClient.OperationOptions { expand?: TemplateSpecExpandKind; @@ -140,10 +151,24 @@ export interface TemplateSpecsGetOptionalParams extends coreClient.OperationOpti export type TemplateSpecsGetResponse = TemplateSpec; // @public -export interface TemplateSpecsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +export interface TemplateSpecsListBuiltInsNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TemplateSpecsListBuiltInsNextResponse = TemplateSpecsListResult; + +// @public +export interface TemplateSpecsListBuiltInsOptionalParams extends coreClient.OperationOptions { expand?: TemplateSpecExpandKind; } +// @public +export type TemplateSpecsListBuiltInsResponse = TemplateSpecsListResult; + +// @public +export interface TemplateSpecsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + // @public export type TemplateSpecsListByResourceGroupNextResponse = TemplateSpecsListResult; @@ -157,7 +182,6 @@ export type TemplateSpecsListByResourceGroupResponse = TemplateSpecsListResult; // @public export interface TemplateSpecsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { - expand?: TemplateSpecExpandKind; } // @public @@ -217,7 +241,9 @@ export interface TemplateSpecVersions { createOrUpdate(resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, templateSpecVersionModel: TemplateSpecVersion, options?: TemplateSpecVersionsCreateOrUpdateOptionalParams): Promise; delete(resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, options?: TemplateSpecVersionsDeleteOptionalParams): Promise; get(resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, options?: TemplateSpecVersionsGetOptionalParams): Promise; + getBuiltIn(templateSpecName: string, templateSpecVersion: string, options?: TemplateSpecVersionsGetBuiltInOptionalParams): Promise; list(resourceGroupName: string, templateSpecName: string, options?: TemplateSpecVersionsListOptionalParams): PagedAsyncIterableIterator; + listBuiltIns(templateSpecName: string, options?: TemplateSpecVersionsListBuiltInsOptionalParams): PagedAsyncIterableIterator; update(resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, options?: TemplateSpecVersionsUpdateOptionalParams): Promise; } @@ -232,6 +258,13 @@ export type TemplateSpecVersionsCreateOrUpdateResponse = TemplateSpecVersion; export interface TemplateSpecVersionsDeleteOptionalParams extends coreClient.OperationOptions { } +// @public +export interface TemplateSpecVersionsGetBuiltInOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TemplateSpecVersionsGetBuiltInResponse = TemplateSpecVersion; + // @public export interface TemplateSpecVersionsGetOptionalParams extends coreClient.OperationOptions { } @@ -239,6 +272,20 @@ export interface TemplateSpecVersionsGetOptionalParams extends coreClient.Operat // @public export type TemplateSpecVersionsGetResponse = TemplateSpecVersion; +// @public +export interface TemplateSpecVersionsListBuiltInsNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TemplateSpecVersionsListBuiltInsNextResponse = TemplateSpecVersionsListResult; + +// @public +export interface TemplateSpecVersionsListBuiltInsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TemplateSpecVersionsListBuiltInsResponse = TemplateSpecVersionsListResult; + // @public export interface TemplateSpecVersionsListNextOptionalParams extends coreClient.OperationOptions { } diff --git a/sdk/templatespecs/arm-templatespecs/sample.env b/sdk/templatespecs/arm-templatespecs/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/templatespecs/arm-templatespecs/sample.env +++ b/sdk/templatespecs/arm-templatespecs/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/templatespecs/arm-templatespecs/src/models/index.ts b/sdk/templatespecs/arm-templatespecs/src/models/index.ts index f5969135d28f..177fa2d2f020 100644 --- a/sdk/templatespecs/arm-templatespecs/src/models/index.ts +++ b/sdk/templatespecs/arm-templatespecs/src/models/index.ts @@ -204,7 +204,7 @@ export enum KnownCreatedByType { /** ManagedIdentity */ ManagedIdentity = "ManagedIdentity", /** Key */ - Key = "Key" + Key = "Key", } /** @@ -222,7 +222,7 @@ export type CreatedByType = string; /** Known values of {@link TemplateSpecExpandKind} that the service accepts. */ export enum KnownTemplateSpecExpandKind { /** Includes version information with the Template Spec. */ - Versions = "versions" + Versions = "versions", } /** @@ -286,24 +286,47 @@ export interface TemplateSpecsListByResourceGroupOptionalParams export type TemplateSpecsListByResourceGroupResponse = TemplateSpecsListResult; /** Optional parameters. */ -export interface TemplateSpecsListBySubscriptionNextOptionalParams +export interface TemplateSpecsGetBuiltInOptionalParams extends coreClient.OperationOptions { /** Allows for expansion of additional Template Spec details in the response. Optional. */ expand?: TemplateSpecExpandKind; } -/** Contains response data for the listBySubscriptionNext operation. */ -export type TemplateSpecsListBySubscriptionNextResponse = TemplateSpecsListResult; +/** Contains response data for the getBuiltIn operation. */ +export type TemplateSpecsGetBuiltInResponse = TemplateSpec; /** Optional parameters. */ -export interface TemplateSpecsListByResourceGroupNextOptionalParams +export interface TemplateSpecsListBuiltInsOptionalParams extends coreClient.OperationOptions { /** Allows for expansion of additional Template Spec details in the response. Optional. */ expand?: TemplateSpecExpandKind; } +/** Contains response data for the listBuiltIns operation. */ +export type TemplateSpecsListBuiltInsResponse = TemplateSpecsListResult; + +/** Optional parameters. */ +export interface TemplateSpecsListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type TemplateSpecsListBySubscriptionNextResponse = + TemplateSpecsListResult; + +/** Optional parameters. */ +export interface TemplateSpecsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + /** Contains response data for the listByResourceGroupNext operation. */ -export type TemplateSpecsListByResourceGroupNextResponse = TemplateSpecsListResult; +export type TemplateSpecsListByResourceGroupNextResponse = + TemplateSpecsListResult; + +/** Optional parameters. */ +export interface TemplateSpecsListBuiltInsNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBuiltInsNext operation. */ +export type TemplateSpecsListBuiltInsNextResponse = TemplateSpecsListResult; /** Optional parameters. */ export interface TemplateSpecVersionsCreateOrUpdateOptionalParams @@ -340,12 +363,36 @@ export interface TemplateSpecVersionsListOptionalParams /** Contains response data for the list operation. */ export type TemplateSpecVersionsListResponse = TemplateSpecVersionsListResult; +/** Optional parameters. */ +export interface TemplateSpecVersionsListBuiltInsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBuiltIns operation. */ +export type TemplateSpecVersionsListBuiltInsResponse = + TemplateSpecVersionsListResult; + +/** Optional parameters. */ +export interface TemplateSpecVersionsGetBuiltInOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getBuiltIn operation. */ +export type TemplateSpecVersionsGetBuiltInResponse = TemplateSpecVersion; + /** Optional parameters. */ export interface TemplateSpecVersionsListNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ -export type TemplateSpecVersionsListNextResponse = TemplateSpecVersionsListResult; +export type TemplateSpecVersionsListNextResponse = + TemplateSpecVersionsListResult; + +/** Optional parameters. */ +export interface TemplateSpecVersionsListBuiltInsNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBuiltInsNext operation. */ +export type TemplateSpecVersionsListBuiltInsNextResponse = + TemplateSpecVersionsListResult; /** Optional parameters. */ export interface TemplateSpecsClientOptionalParams diff --git a/sdk/templatespecs/arm-templatespecs/src/models/mappers.ts b/sdk/templatespecs/arm-templatespecs/src/models/mappers.ts index b005c1e9585b..40955cd6bbdb 100644 --- a/sdk/templatespecs/arm-templatespecs/src/models/mappers.ts +++ b/sdk/templatespecs/arm-templatespecs/src/models/mappers.ts @@ -17,25 +17,25 @@ export const TemplateSpecVersionInfo: coreClient.CompositeMapper = { serializedName: "description", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, timeCreated: { serializedName: "timeCreated", readOnly: true, type: { - name: "DateTime" - } + name: "DateTime", + }, }, timeModified: { serializedName: "timeModified", readOnly: true, type: { - name: "DateTime" - } - } - } - } + name: "DateTime", + }, + }, + }, + }, }; export const AzureResourceBase: coreClient.CompositeMapper = { @@ -47,32 +47,32 @@ export const AzureResourceBase: 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", + }, }, systemData: { serializedName: "systemData", type: { name: "Composite", - className: "SystemData" - } - } - } - } + className: "SystemData", + }, + }, + }, + }, }; export const SystemData: coreClient.CompositeMapper = { @@ -83,41 +83,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 TemplateSpecsError: coreClient.CompositeMapper = { @@ -129,11 +129,11 @@ export const TemplateSpecsError: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorResponse" - } - } - } - } + className: "ErrorResponse", + }, + }, + }, + }, }; export const ErrorResponse: coreClient.CompositeMapper = { @@ -145,22 +145,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", @@ -170,10 +170,10 @@ export const ErrorResponse: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorResponse" - } - } - } + className: "ErrorResponse", + }, + }, + }, }, additionalInfo: { serializedName: "additionalInfo", @@ -183,13 +183,13 @@ export const ErrorResponse: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorAdditionalInfo" - } - } - } - } - } - } + className: "ErrorAdditionalInfo", + }, + }, + }, + }, + }, + }, }; export const ErrorAdditionalInfo: coreClient.CompositeMapper = { @@ -201,19 +201,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 TemplateSpecsListResult: coreClient.CompositeMapper = { @@ -228,20 +228,20 @@ export const TemplateSpecsListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "TemplateSpec" - } - } - } + className: "TemplateSpec", + }, + }, + }, }, nextLink: { serializedName: "nextLink", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const LinkedTemplateArtifact: coreClient.CompositeMapper = { @@ -253,19 +253,19 @@ export const LinkedTemplateArtifact: coreClient.CompositeMapper = { serializedName: "path", required: true, type: { - name: "String" - } + name: "String", + }, }, template: { serializedName: "template", required: true, type: { name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } + value: { type: { name: "any" } }, + }, + }, + }, + }, }; export const TemplateSpecVersionsListResult: coreClient.CompositeMapper = { @@ -280,20 +280,20 @@ export const TemplateSpecVersionsListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "TemplateSpecVersion" - } - } - } + className: "TemplateSpecVersion", + }, + }, + }, }, nextLink: { serializedName: "nextLink", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const TemplateSpec: coreClient.CompositeMapper = { @@ -306,40 +306,40 @@ export const TemplateSpec: coreClient.CompositeMapper = { serializedName: "location", required: true, type: { - name: "String" - } + name: "String", + }, }, tags: { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } + value: { type: { name: "String" } }, + }, }, description: { constraints: { - MaxLength: 4096 + MaxLength: 4096, }, serializedName: "properties.description", type: { - name: "String" - } + name: "String", + }, }, displayName: { constraints: { - MaxLength: 64 + MaxLength: 64, }, serializedName: "properties.displayName", type: { - name: "String" - } + name: "String", + }, }, metadata: { serializedName: "properties.metadata", type: { name: "Dictionary", - value: { type: { name: "any" } } - } + value: { type: { name: "any" } }, + }, }, versions: { serializedName: "properties.versions", @@ -347,12 +347,12 @@ export const TemplateSpec: coreClient.CompositeMapper = { type: { name: "Dictionary", value: { - type: { name: "Composite", className: "TemplateSpecVersionInfo" } - } - } - } - } - } + type: { name: "Composite", className: "TemplateSpecVersionInfo" }, + }, + }, + }, + }, + }, }; export const TemplateSpecUpdateModel: coreClient.CompositeMapper = { @@ -365,11 +365,11 @@ export const TemplateSpecUpdateModel: coreClient.CompositeMapper = { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } + value: { type: { name: "String" } }, + }, + }, + }, + }, }; export const TemplateSpecVersion: coreClient.CompositeMapper = { @@ -382,24 +382,24 @@ export const TemplateSpecVersion: coreClient.CompositeMapper = { serializedName: "location", required: true, type: { - name: "String" - } + name: "String", + }, }, tags: { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } + value: { type: { name: "String" } }, + }, }, description: { constraints: { - MaxLength: 4096 + MaxLength: 4096, }, serializedName: "properties.description", type: { - name: "String" - } + name: "String", + }, }, linkedTemplates: { serializedName: "properties.linkedTemplates", @@ -408,34 +408,34 @@ export const TemplateSpecVersion: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "LinkedTemplateArtifact" - } - } - } + className: "LinkedTemplateArtifact", + }, + }, + }, }, metadata: { serializedName: "properties.metadata", type: { name: "Dictionary", - value: { type: { name: "any" } } - } + value: { type: { name: "any" } }, + }, }, mainTemplate: { serializedName: "properties.mainTemplate", type: { name: "Dictionary", - value: { type: { name: "any" } } - } + value: { type: { name: "any" } }, + }, }, uiFormDefinition: { serializedName: "properties.uiFormDefinition", type: { name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } + value: { type: { name: "any" } }, + }, + }, + }, + }, }; export const TemplateSpecVersionUpdateModel: coreClient.CompositeMapper = { @@ -448,9 +448,9 @@ export const TemplateSpecVersionUpdateModel: coreClient.CompositeMapper = { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } + value: { type: { name: "String" } }, + }, + }, + }, + }, }; diff --git a/sdk/templatespecs/arm-templatespecs/src/models/parameters.ts b/sdk/templatespecs/arm-templatespecs/src/models/parameters.ts index 17dbedda147e..aac5742b4af0 100644 --- a/sdk/templatespecs/arm-templatespecs/src/models/parameters.ts +++ b/sdk/templatespecs/arm-templatespecs/src/models/parameters.ts @@ -9,13 +9,13 @@ import { OperationParameter, OperationURLParameter, - OperationQueryParameter + OperationQueryParameter, } from "@azure/core-client"; import { TemplateSpec as TemplateSpecMapper, TemplateSpecUpdateModel as TemplateSpecUpdateModelMapper, TemplateSpecVersion as TemplateSpecVersionMapper, - TemplateSpecVersionUpdateModel as TemplateSpecVersionUpdateModelMapper + TemplateSpecVersionUpdateModel as TemplateSpecVersionUpdateModelMapper, } from "../models/mappers.js"; export const contentType: OperationParameter = { @@ -25,14 +25,14 @@ export const contentType: OperationParameter = { isConstant: true, serializedName: "Content-Type", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const templateSpec: OperationParameter = { parameterPath: "templateSpec", - mapper: TemplateSpecMapper + mapper: TemplateSpecMapper, }; export const accept: OperationParameter = { @@ -42,9 +42,9 @@ export const accept: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const $host: OperationURLParameter = { @@ -53,10 +53,10 @@ export const $host: OperationURLParameter = { serializedName: "$host", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const subscriptionId: OperationURLParameter = { @@ -65,9 +65,9 @@ export const subscriptionId: OperationURLParameter = { serializedName: "subscriptionId", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const resourceGroupName: OperationURLParameter = { @@ -76,14 +76,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 templateSpecName: OperationURLParameter = { @@ -92,31 +92,31 @@ export const templateSpecName: OperationURLParameter = { constraints: { Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), MaxLength: 90, - MinLength: 1 + MinLength: 1, }, serializedName: "templateSpecName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-05-01", + defaultValue: "2022-02-01", isConstant: true, serializedName: "api-version", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const templateSpec1: OperationParameter = { parameterPath: ["options", "templateSpec"], - mapper: TemplateSpecUpdateModelMapper + mapper: TemplateSpecUpdateModelMapper, }; export const expand: OperationQueryParameter = { @@ -124,9 +124,9 @@ export const expand: OperationQueryParameter = { mapper: { serializedName: "$expand", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const nextLink: OperationURLParameter = { @@ -135,15 +135,15 @@ export const nextLink: OperationURLParameter = { serializedName: "nextLink", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const templateSpecVersionModel: OperationParameter = { parameterPath: "templateSpecVersionModel", - mapper: TemplateSpecVersionMapper + mapper: TemplateSpecVersionMapper, }; export const templateSpecVersion: OperationURLParameter = { @@ -152,17 +152,17 @@ export const templateSpecVersion: OperationURLParameter = { constraints: { Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), MaxLength: 90, - MinLength: 1 + MinLength: 1, }, serializedName: "templateSpecVersion", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const templateSpecVersionUpdateModel: OperationParameter = { parameterPath: ["options", "templateSpecVersionUpdateModel"], - mapper: TemplateSpecVersionUpdateModelMapper + mapper: TemplateSpecVersionUpdateModelMapper, }; diff --git a/sdk/templatespecs/arm-templatespecs/src/operations/templateSpecVersions.ts b/sdk/templatespecs/arm-templatespecs/src/operations/templateSpecVersions.ts index 6f044ba490c1..4aaf8d77c962 100644 --- a/sdk/templatespecs/arm-templatespecs/src/operations/templateSpecVersions.ts +++ b/sdk/templatespecs/arm-templatespecs/src/operations/templateSpecVersions.ts @@ -18,6 +18,9 @@ import { TemplateSpecVersionsListNextOptionalParams, TemplateSpecVersionsListOptionalParams, TemplateSpecVersionsListResponse, + TemplateSpecVersionsListBuiltInsNextOptionalParams, + TemplateSpecVersionsListBuiltInsOptionalParams, + TemplateSpecVersionsListBuiltInsResponse, TemplateSpecVersionsCreateOrUpdateOptionalParams, TemplateSpecVersionsCreateOrUpdateResponse, TemplateSpecVersionsUpdateOptionalParams, @@ -25,7 +28,10 @@ import { TemplateSpecVersionsGetOptionalParams, TemplateSpecVersionsGetResponse, TemplateSpecVersionsDeleteOptionalParams, - TemplateSpecVersionsListNextResponse + TemplateSpecVersionsGetBuiltInOptionalParams, + TemplateSpecVersionsGetBuiltInResponse, + TemplateSpecVersionsListNextResponse, + TemplateSpecVersionsListBuiltInsNextResponse, } from "../models/index.js"; /// @@ -50,12 +56,12 @@ export class TemplateSpecVersionsImpl implements TemplateSpecVersions { public list( resourceGroupName: string, templateSpecName: string, - options?: TemplateSpecVersionsListOptionalParams + options?: TemplateSpecVersionsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll( resourceGroupName, templateSpecName, - options + options, ); return { next() { @@ -72,9 +78,9 @@ export class TemplateSpecVersionsImpl implements TemplateSpecVersions { resourceGroupName, templateSpecName, options, - settings + settings, ); - } + }, }; } @@ -82,7 +88,7 @@ export class TemplateSpecVersionsImpl implements TemplateSpecVersions { resourceGroupName: string, templateSpecName: string, options?: TemplateSpecVersionsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: TemplateSpecVersionsListResponse; let continuationToken = settings?.continuationToken; @@ -98,7 +104,7 @@ export class TemplateSpecVersionsImpl implements TemplateSpecVersions { resourceGroupName, templateSpecName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -110,12 +116,77 @@ export class TemplateSpecVersionsImpl implements TemplateSpecVersions { private async *listPagingAll( resourceGroupName: string, templateSpecName: string, - options?: TemplateSpecVersionsListOptionalParams + options?: TemplateSpecVersionsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage( resourceGroupName, templateSpecName, - options + options, + )) { + yield* page; + } + } + + /** + * Lists all the Template Spec versions in the specified built-in Template Spec. + * @param templateSpecName Name of the Template Spec. + * @param options The options parameters. + */ + public listBuiltIns( + templateSpecName: string, + options?: TemplateSpecVersionsListBuiltInsOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listBuiltInsPagingAll(templateSpecName, 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.listBuiltInsPagingPage(templateSpecName, options, settings); + }, + }; + } + + private async *listBuiltInsPagingPage( + templateSpecName: string, + options?: TemplateSpecVersionsListBuiltInsOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: TemplateSpecVersionsListBuiltInsResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBuiltIns(templateSpecName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBuiltInsNext( + templateSpecName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBuiltInsPagingAll( + templateSpecName: string, + options?: TemplateSpecVersionsListBuiltInsOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listBuiltInsPagingPage( + templateSpecName, + options, )) { yield* page; } @@ -134,7 +205,7 @@ export class TemplateSpecVersionsImpl implements TemplateSpecVersions { templateSpecName: string, templateSpecVersion: string, templateSpecVersionModel: TemplateSpecVersion, - options?: TemplateSpecVersionsCreateOrUpdateOptionalParams + options?: TemplateSpecVersionsCreateOrUpdateOptionalParams, ): Promise { return this.client.sendOperationRequest( { @@ -142,9 +213,9 @@ export class TemplateSpecVersionsImpl implements TemplateSpecVersions { templateSpecName, templateSpecVersion, templateSpecVersionModel, - options + options, }, - createOrUpdateOperationSpec + createOrUpdateOperationSpec, ); } @@ -159,11 +230,11 @@ export class TemplateSpecVersionsImpl implements TemplateSpecVersions { resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, - options?: TemplateSpecVersionsUpdateOptionalParams + options?: TemplateSpecVersionsUpdateOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, templateSpecName, templateSpecVersion, options }, - updateOperationSpec + updateOperationSpec, ); } @@ -178,11 +249,11 @@ export class TemplateSpecVersionsImpl implements TemplateSpecVersions { resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, - options?: TemplateSpecVersionsGetOptionalParams + options?: TemplateSpecVersionsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, templateSpecName, templateSpecVersion, options }, - getOperationSpec + getOperationSpec, ); } @@ -198,11 +269,11 @@ export class TemplateSpecVersionsImpl implements TemplateSpecVersions { resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, - options?: TemplateSpecVersionsDeleteOptionalParams + options?: TemplateSpecVersionsDeleteOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, templateSpecName, templateSpecVersion, options }, - deleteOperationSpec + deleteOperationSpec, ); } @@ -215,11 +286,43 @@ export class TemplateSpecVersionsImpl implements TemplateSpecVersions { private _list( resourceGroupName: string, templateSpecName: string, - options?: TemplateSpecVersionsListOptionalParams + options?: TemplateSpecVersionsListOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, templateSpecName, options }, - listOperationSpec + listOperationSpec, + ); + } + + /** + * Lists all the Template Spec versions in the specified built-in Template Spec. + * @param templateSpecName Name of the Template Spec. + * @param options The options parameters. + */ + private _listBuiltIns( + templateSpecName: string, + options?: TemplateSpecVersionsListBuiltInsOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { templateSpecName, options }, + listBuiltInsOperationSpec, + ); + } + + /** + * Gets a Template Spec version from a specific built-in Template Spec. + * @param templateSpecName Name of the Template Spec. + * @param templateSpecVersion The version of the Template Spec. + * @param options The options parameters. + */ + getBuiltIn( + templateSpecName: string, + templateSpecVersion: string, + options?: TemplateSpecVersionsGetBuiltInOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { templateSpecName, templateSpecVersion, options }, + getBuiltInOperationSpec, ); } @@ -234,11 +337,28 @@ export class TemplateSpecVersionsImpl implements TemplateSpecVersions { resourceGroupName: string, templateSpecName: string, nextLink: string, - options?: TemplateSpecVersionsListNextOptionalParams + options?: TemplateSpecVersionsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, templateSpecName, nextLink, options }, - listNextOperationSpec + listNextOperationSpec, + ); + } + + /** + * ListBuiltInsNext + * @param templateSpecName Name of the Template Spec. + * @param nextLink The nextLink from the previous successful call to the ListBuiltIns method. + * @param options The options parameters. + */ + private _listBuiltInsNext( + templateSpecName: string, + nextLink: string, + options?: TemplateSpecVersionsListBuiltInsNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { templateSpecName, nextLink, options }, + listBuiltInsNextOperationSpec, ); } } @@ -246,19 +366,18 @@ export class TemplateSpecVersionsImpl implements TemplateSpecVersions { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.TemplateSpecVersion + bodyMapper: Mappers.TemplateSpecVersion, }, 201: { - bodyMapper: Mappers.TemplateSpecVersion + bodyMapper: Mappers.TemplateSpecVersion, }, default: { - bodyMapper: Mappers.TemplateSpecsError - } + bodyMapper: Mappers.TemplateSpecsError, + }, }, requestBody: Parameters.templateSpecVersionModel, queryParameters: [Parameters.apiVersion], @@ -267,23 +386,22 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.templateSpecName, - Parameters.templateSpecVersion + Parameters.templateSpecVersion, ], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.TemplateSpecVersion + bodyMapper: Mappers.TemplateSpecVersion, }, default: { - bodyMapper: Mappers.TemplateSpecsError - } + bodyMapper: Mappers.TemplateSpecsError, + }, }, requestBody: Parameters.templateSpecVersionUpdateModel, queryParameters: [Parameters.apiVersion], @@ -292,23 +410,22 @@ const updateOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.templateSpecName, - Parameters.templateSpecVersion + Parameters.templateSpecVersion, ], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.TemplateSpecVersion + bodyMapper: Mappers.TemplateSpecVersion, }, default: { - bodyMapper: Mappers.TemplateSpecsError - } + bodyMapper: Mappers.TemplateSpecsError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -316,21 +433,20 @@ const getOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.templateSpecName, - Parameters.templateSpecVersion + Parameters.templateSpecVersion, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}", httpMethod: "DELETE", responses: { 200: {}, 204: {}, default: { - bodyMapper: Mappers.TemplateSpecsError - } + bodyMapper: Mappers.TemplateSpecsError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -338,52 +454,105 @@ const deleteOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.templateSpecName, - Parameters.templateSpecVersion + Parameters.templateSpecVersion, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.TemplateSpecVersionsListResult + bodyMapper: Mappers.TemplateSpecVersionsListResult, }, default: { - bodyMapper: Mappers.TemplateSpecsError - } + bodyMapper: Mappers.TemplateSpecsError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.templateSpecName + Parameters.templateSpecName, ], headerParameters: [Parameters.accept], - serializer + serializer, +}; +const listBuiltInsOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Resources/builtInTemplateSpecs/{templateSpecName}/versions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TemplateSpecVersionsListResult, + }, + default: { + bodyMapper: Mappers.TemplateSpecsError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.templateSpecName], + headerParameters: [Parameters.accept], + serializer, +}; +const getBuiltInOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Resources/builtInTemplateSpecs/{templateSpecName}/versions/{templateSpecVersion}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TemplateSpecVersion, + }, + default: { + bodyMapper: Mappers.TemplateSpecsError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.templateSpecName, + Parameters.templateSpecVersion, + ], + headerParameters: [Parameters.accept], + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.TemplateSpecVersionsListResult + bodyMapper: Mappers.TemplateSpecVersionsListResult, }, default: { - bodyMapper: Mappers.TemplateSpecsError - } + bodyMapper: Mappers.TemplateSpecsError, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.templateSpecName, - Parameters.nextLink + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listBuiltInsNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TemplateSpecVersionsListResult, + }, + default: { + bodyMapper: Mappers.TemplateSpecsError, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.templateSpecName, + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/templatespecs/arm-templatespecs/src/operations/templateSpecs.ts b/sdk/templatespecs/arm-templatespecs/src/operations/templateSpecs.ts index d026ea070d5f..b2233eb66ab3 100644 --- a/sdk/templatespecs/arm-templatespecs/src/operations/templateSpecs.ts +++ b/sdk/templatespecs/arm-templatespecs/src/operations/templateSpecs.ts @@ -21,6 +21,9 @@ import { TemplateSpecsListByResourceGroupNextOptionalParams, TemplateSpecsListByResourceGroupOptionalParams, TemplateSpecsListByResourceGroupResponse, + TemplateSpecsListBuiltInsNextOptionalParams, + TemplateSpecsListBuiltInsOptionalParams, + TemplateSpecsListBuiltInsResponse, TemplateSpecsCreateOrUpdateOptionalParams, TemplateSpecsCreateOrUpdateResponse, TemplateSpecsUpdateOptionalParams, @@ -28,8 +31,11 @@ import { TemplateSpecsGetOptionalParams, TemplateSpecsGetResponse, TemplateSpecsDeleteOptionalParams, + TemplateSpecsGetBuiltInOptionalParams, + TemplateSpecsGetBuiltInResponse, TemplateSpecsListBySubscriptionNextResponse, - TemplateSpecsListByResourceGroupNextResponse + TemplateSpecsListByResourceGroupNextResponse, + TemplateSpecsListBuiltInsNextResponse, } from "../models/index.js"; /// @@ -50,7 +56,7 @@ export class TemplateSpecsImpl implements TemplateSpecs { * @param options The options parameters. */ public listBySubscription( - options?: TemplateSpecsListBySubscriptionOptionalParams + options?: TemplateSpecsListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listBySubscriptionPagingAll(options); return { @@ -65,13 +71,13 @@ export class TemplateSpecsImpl implements TemplateSpecs { throw new Error("maxPageSize is not supported by this operation."); } return this.listBySubscriptionPagingPage(options, settings); - } + }, }; } private async *listBySubscriptionPagingPage( options?: TemplateSpecsListBySubscriptionOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: TemplateSpecsListBySubscriptionResponse; let continuationToken = settings?.continuationToken; @@ -92,7 +98,7 @@ export class TemplateSpecsImpl implements TemplateSpecs { } private async *listBySubscriptionPagingAll( - options?: TemplateSpecsListBySubscriptionOptionalParams + options?: TemplateSpecsListBySubscriptionOptionalParams, ): AsyncIterableIterator { for await (const page of this.listBySubscriptionPagingPage(options)) { yield* page; @@ -106,7 +112,7 @@ export class TemplateSpecsImpl implements TemplateSpecs { */ public listByResourceGroup( resourceGroupName: string, - options?: TemplateSpecsListByResourceGroupOptionalParams + options?: TemplateSpecsListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); return { @@ -123,16 +129,16 @@ export class TemplateSpecsImpl implements TemplateSpecs { return this.listByResourceGroupPagingPage( resourceGroupName, options, - settings + settings, ); - } + }, }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, options?: TemplateSpecsListByResourceGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: TemplateSpecsListByResourceGroupResponse; let continuationToken = settings?.continuationToken; @@ -147,7 +153,7 @@ export class TemplateSpecsImpl implements TemplateSpecs { result = await this._listByResourceGroupNext( resourceGroupName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -158,16 +164,70 @@ export class TemplateSpecsImpl implements TemplateSpecs { private async *listByResourceGroupPagingAll( resourceGroupName: string, - options?: TemplateSpecsListByResourceGroupOptionalParams + options?: TemplateSpecsListByResourceGroupOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByResourceGroupPagingPage( resourceGroupName, - options + options, )) { yield* page; } } + /** + * Lists built-in Template Specs. + * @param options The options parameters. + */ + public listBuiltIns( + options?: TemplateSpecsListBuiltInsOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listBuiltInsPagingAll(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.listBuiltInsPagingPage(options, settings); + }, + }; + } + + private async *listBuiltInsPagingPage( + options?: TemplateSpecsListBuiltInsOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: TemplateSpecsListBuiltInsResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBuiltIns(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBuiltInsNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBuiltInsPagingAll( + options?: TemplateSpecsListBuiltInsOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listBuiltInsPagingPage(options)) { + yield* page; + } + } + /** * Creates or updates a Template Spec. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -179,11 +239,11 @@ export class TemplateSpecsImpl implements TemplateSpecs { resourceGroupName: string, templateSpecName: string, templateSpec: TemplateSpec, - options?: TemplateSpecsCreateOrUpdateOptionalParams + options?: TemplateSpecsCreateOrUpdateOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, templateSpecName, templateSpec, options }, - createOrUpdateOperationSpec + createOrUpdateOperationSpec, ); } @@ -196,11 +256,11 @@ export class TemplateSpecsImpl implements TemplateSpecs { update( resourceGroupName: string, templateSpecName: string, - options?: TemplateSpecsUpdateOptionalParams + options?: TemplateSpecsUpdateOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, templateSpecName, options }, - updateOperationSpec + updateOperationSpec, ); } @@ -213,11 +273,11 @@ export class TemplateSpecsImpl implements TemplateSpecs { get( resourceGroupName: string, templateSpecName: string, - options?: TemplateSpecsGetOptionalParams + options?: TemplateSpecsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, templateSpecName, options }, - getOperationSpec + getOperationSpec, ); } @@ -230,11 +290,11 @@ export class TemplateSpecsImpl implements TemplateSpecs { delete( resourceGroupName: string, templateSpecName: string, - options?: TemplateSpecsDeleteOptionalParams + options?: TemplateSpecsDeleteOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, templateSpecName, options }, - deleteOperationSpec + deleteOperationSpec, ); } @@ -243,11 +303,11 @@ export class TemplateSpecsImpl implements TemplateSpecs { * @param options The options parameters. */ private _listBySubscription( - options?: TemplateSpecsListBySubscriptionOptionalParams + options?: TemplateSpecsListBySubscriptionOptionalParams, ): Promise { return this.client.sendOperationRequest( { options }, - listBySubscriptionOperationSpec + listBySubscriptionOperationSpec, ); } @@ -258,11 +318,39 @@ export class TemplateSpecsImpl implements TemplateSpecs { */ private _listByResourceGroup( resourceGroupName: string, - options?: TemplateSpecsListByResourceGroupOptionalParams + options?: TemplateSpecsListByResourceGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, options }, - listByResourceGroupOperationSpec + listByResourceGroupOperationSpec, + ); + } + + /** + * Gets a built-in Template Spec with a given name. + * @param templateSpecName Name of the Template Spec. + * @param options The options parameters. + */ + getBuiltIn( + templateSpecName: string, + options?: TemplateSpecsGetBuiltInOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { templateSpecName, options }, + getBuiltInOperationSpec, + ); + } + + /** + * Lists built-in Template Specs. + * @param options The options parameters. + */ + private _listBuiltIns( + options?: TemplateSpecsListBuiltInsOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBuiltInsOperationSpec, ); } @@ -273,11 +361,11 @@ export class TemplateSpecsImpl implements TemplateSpecs { */ private _listBySubscriptionNext( nextLink: string, - options?: TemplateSpecsListBySubscriptionNextOptionalParams + options?: TemplateSpecsListBySubscriptionNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listBySubscriptionNextOperationSpec + listBySubscriptionNextOperationSpec, ); } @@ -290,11 +378,26 @@ export class TemplateSpecsImpl implements TemplateSpecs { private _listByResourceGroupNext( resourceGroupName: string, nextLink: string, - options?: TemplateSpecsListByResourceGroupNextOptionalParams + options?: TemplateSpecsListByResourceGroupNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec + listByResourceGroupNextOperationSpec, + ); + } + + /** + * ListBuiltInsNext + * @param nextLink The nextLink from the previous successful call to the ListBuiltIns method. + * @param options The options parameters. + */ + private _listBuiltInsNext( + nextLink: string, + options?: TemplateSpecsListBuiltInsNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBuiltInsNextOperationSpec, ); } } @@ -302,19 +405,18 @@ export class TemplateSpecsImpl implements TemplateSpecs { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.TemplateSpec + bodyMapper: Mappers.TemplateSpec, }, 201: { - bodyMapper: Mappers.TemplateSpec + bodyMapper: Mappers.TemplateSpec, }, default: { - bodyMapper: Mappers.TemplateSpecsError - } + bodyMapper: Mappers.TemplateSpecsError, + }, }, requestBody: Parameters.templateSpec, queryParameters: [Parameters.apiVersion], @@ -322,23 +424,22 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.templateSpecName + Parameters.templateSpecName, ], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.TemplateSpec + bodyMapper: Mappers.TemplateSpec, }, default: { - bodyMapper: Mappers.TemplateSpecsError - } + bodyMapper: Mappers.TemplateSpecsError, + }, }, requestBody: Parameters.templateSpec1, queryParameters: [Parameters.apiVersion], @@ -346,131 +447,172 @@ const updateOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.templateSpecName + Parameters.templateSpecName, ], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.TemplateSpec + bodyMapper: Mappers.TemplateSpec, }, default: { - bodyMapper: Mappers.TemplateSpecsError - } + bodyMapper: Mappers.TemplateSpecsError, + }, }, queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.templateSpecName + Parameters.templateSpecName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}", httpMethod: "DELETE", responses: { 200: {}, 204: {}, default: { - bodyMapper: Mappers.TemplateSpecsError - } + bodyMapper: Mappers.TemplateSpecsError, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.templateSpecName + Parameters.templateSpecName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/templateSpecs/", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/templateSpecs/", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.TemplateSpecsListResult + bodyMapper: Mappers.TemplateSpecsListResult, }, default: { - bodyMapper: Mappers.TemplateSpecsError - } + bodyMapper: Mappers.TemplateSpecsError, + }, }, queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.TemplateSpecsListResult + bodyMapper: Mappers.TemplateSpecsListResult, }, default: { - bodyMapper: Mappers.TemplateSpecsError - } + bodyMapper: Mappers.TemplateSpecsError, + }, }, queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, ], headerParameters: [Parameters.accept], - serializer + serializer, +}; +const getBuiltInOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Resources/builtInTemplateSpecs/{templateSpecName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TemplateSpec, + }, + default: { + bodyMapper: Mappers.TemplateSpecsError, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.expand], + urlParameters: [Parameters.$host, Parameters.templateSpecName], + headerParameters: [Parameters.accept], + serializer, +}; +const listBuiltInsOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Resources/builtInTemplateSpecs/", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TemplateSpecsListResult, + }, + default: { + bodyMapper: Mappers.TemplateSpecsError, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.expand], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer, }; const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.TemplateSpecsListResult + bodyMapper: Mappers.TemplateSpecsListResult, }, default: { - bodyMapper: Mappers.TemplateSpecsError - } + bodyMapper: Mappers.TemplateSpecsError, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.TemplateSpecsListResult + bodyMapper: Mappers.TemplateSpecsListResult, }, default: { - bodyMapper: Mappers.TemplateSpecsError - } + bodyMapper: Mappers.TemplateSpecsError, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, +}; +const listBuiltInsNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TemplateSpecsListResult, + }, + default: { + bodyMapper: Mappers.TemplateSpecsError, + }, + }, + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer, }; diff --git a/sdk/templatespecs/arm-templatespecs/src/operationsInterfaces/templateSpecVersions.ts b/sdk/templatespecs/arm-templatespecs/src/operationsInterfaces/templateSpecVersions.ts index 969029e55b06..05986926f28b 100644 --- a/sdk/templatespecs/arm-templatespecs/src/operationsInterfaces/templateSpecVersions.ts +++ b/sdk/templatespecs/arm-templatespecs/src/operationsInterfaces/templateSpecVersions.ts @@ -10,13 +10,16 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { TemplateSpecVersion, TemplateSpecVersionsListOptionalParams, + TemplateSpecVersionsListBuiltInsOptionalParams, TemplateSpecVersionsCreateOrUpdateOptionalParams, TemplateSpecVersionsCreateOrUpdateResponse, TemplateSpecVersionsUpdateOptionalParams, TemplateSpecVersionsUpdateResponse, TemplateSpecVersionsGetOptionalParams, TemplateSpecVersionsGetResponse, - TemplateSpecVersionsDeleteOptionalParams + TemplateSpecVersionsDeleteOptionalParams, + TemplateSpecVersionsGetBuiltInOptionalParams, + TemplateSpecVersionsGetBuiltInResponse, } from "../models/index.js"; /// @@ -31,7 +34,16 @@ export interface TemplateSpecVersions { list( resourceGroupName: string, templateSpecName: string, - options?: TemplateSpecVersionsListOptionalParams + options?: TemplateSpecVersionsListOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Lists all the Template Spec versions in the specified built-in Template Spec. + * @param templateSpecName Name of the Template Spec. + * @param options The options parameters. + */ + listBuiltIns( + templateSpecName: string, + options?: TemplateSpecVersionsListBuiltInsOptionalParams, ): PagedAsyncIterableIterator; /** * Creates or updates a Template Spec version. @@ -46,7 +58,7 @@ export interface TemplateSpecVersions { templateSpecName: string, templateSpecVersion: string, templateSpecVersionModel: TemplateSpecVersion, - options?: TemplateSpecVersionsCreateOrUpdateOptionalParams + options?: TemplateSpecVersionsCreateOrUpdateOptionalParams, ): Promise; /** * Updates Template Spec Version tags with specified values. @@ -59,7 +71,7 @@ export interface TemplateSpecVersions { resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, - options?: TemplateSpecVersionsUpdateOptionalParams + options?: TemplateSpecVersionsUpdateOptionalParams, ): Promise; /** * Gets a Template Spec version from a specific Template Spec. @@ -72,7 +84,7 @@ export interface TemplateSpecVersions { resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, - options?: TemplateSpecVersionsGetOptionalParams + options?: TemplateSpecVersionsGetOptionalParams, ): Promise; /** * Deletes a specific version from a Template Spec. When operation completes, status code 200 returned @@ -86,6 +98,17 @@ export interface TemplateSpecVersions { resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, - options?: TemplateSpecVersionsDeleteOptionalParams + options?: TemplateSpecVersionsDeleteOptionalParams, ): Promise; + /** + * Gets a Template Spec version from a specific built-in Template Spec. + * @param templateSpecName Name of the Template Spec. + * @param templateSpecVersion The version of the Template Spec. + * @param options The options parameters. + */ + getBuiltIn( + templateSpecName: string, + templateSpecVersion: string, + options?: TemplateSpecVersionsGetBuiltInOptionalParams, + ): Promise; } diff --git a/sdk/templatespecs/arm-templatespecs/src/operationsInterfaces/templateSpecs.ts b/sdk/templatespecs/arm-templatespecs/src/operationsInterfaces/templateSpecs.ts index b4edfa768fcb..4616635202e6 100644 --- a/sdk/templatespecs/arm-templatespecs/src/operationsInterfaces/templateSpecs.ts +++ b/sdk/templatespecs/arm-templatespecs/src/operationsInterfaces/templateSpecs.ts @@ -11,13 +11,16 @@ import { TemplateSpec, TemplateSpecsListBySubscriptionOptionalParams, TemplateSpecsListByResourceGroupOptionalParams, + TemplateSpecsListBuiltInsOptionalParams, TemplateSpecsCreateOrUpdateOptionalParams, TemplateSpecsCreateOrUpdateResponse, TemplateSpecsUpdateOptionalParams, TemplateSpecsUpdateResponse, TemplateSpecsGetOptionalParams, TemplateSpecsGetResponse, - TemplateSpecsDeleteOptionalParams + TemplateSpecsDeleteOptionalParams, + TemplateSpecsGetBuiltInOptionalParams, + TemplateSpecsGetBuiltInResponse, } from "../models/index.js"; /// @@ -28,7 +31,7 @@ export interface TemplateSpecs { * @param options The options parameters. */ listBySubscription( - options?: TemplateSpecsListBySubscriptionOptionalParams + options?: TemplateSpecsListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator; /** * Lists all the Template Specs within the specified resource group. @@ -37,7 +40,14 @@ export interface TemplateSpecs { */ listByResourceGroup( resourceGroupName: string, - options?: TemplateSpecsListByResourceGroupOptionalParams + options?: TemplateSpecsListByResourceGroupOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Lists built-in Template Specs. + * @param options The options parameters. + */ + listBuiltIns( + options?: TemplateSpecsListBuiltInsOptionalParams, ): PagedAsyncIterableIterator; /** * Creates or updates a Template Spec. @@ -50,7 +60,7 @@ export interface TemplateSpecs { resourceGroupName: string, templateSpecName: string, templateSpec: TemplateSpec, - options?: TemplateSpecsCreateOrUpdateOptionalParams + options?: TemplateSpecsCreateOrUpdateOptionalParams, ): Promise; /** * Updates Template Spec tags with specified values. @@ -61,7 +71,7 @@ export interface TemplateSpecs { update( resourceGroupName: string, templateSpecName: string, - options?: TemplateSpecsUpdateOptionalParams + options?: TemplateSpecsUpdateOptionalParams, ): Promise; /** * Gets a Template Spec with a given name. @@ -72,7 +82,7 @@ export interface TemplateSpecs { get( resourceGroupName: string, templateSpecName: string, - options?: TemplateSpecsGetOptionalParams + options?: TemplateSpecsGetOptionalParams, ): Promise; /** * Deletes a Template Spec by name. When operation completes, status code 200 returned without content. @@ -83,6 +93,15 @@ export interface TemplateSpecs { delete( resourceGroupName: string, templateSpecName: string, - options?: TemplateSpecsDeleteOptionalParams + options?: TemplateSpecsDeleteOptionalParams, ): Promise; + /** + * Gets a built-in Template Spec with a given name. + * @param templateSpecName Name of the Template Spec. + * @param options The options parameters. + */ + getBuiltIn( + templateSpecName: string, + options?: TemplateSpecsGetBuiltInOptionalParams, + ): Promise; } diff --git a/sdk/templatespecs/arm-templatespecs/src/pagingHelper.ts b/sdk/templatespecs/arm-templatespecs/src/pagingHelper.ts index d85fc13bce1e..205cccc26592 100644 --- a/sdk/templatespecs/arm-templatespecs/src/pagingHelper.ts +++ b/sdk/templatespecs/arm-templatespecs/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) { @@ -28,7 +28,7 @@ export function getContinuationToken(page: unknown): string | undefined { export function setContinuationToken( page: unknown, - continuationToken: string | undefined + continuationToken: string | undefined, ): void { if (typeof page !== "object" || page === null || !continuationToken) { return; diff --git a/sdk/templatespecs/arm-templatespecs/src/templateSpecsClient.ts b/sdk/templatespecs/arm-templatespecs/src/templateSpecsClient.ts index 1c8380a81e04..ee04651117ad 100644 --- a/sdk/templatespecs/arm-templatespecs/src/templateSpecsClient.ts +++ b/sdk/templatespecs/arm-templatespecs/src/templateSpecsClient.ts @@ -11,7 +11,7 @@ import * as coreRestPipeline from "@azure/core-rest-pipeline"; import { PipelineRequest, PipelineResponse, - SendRequest + SendRequest, } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { TemplateSpecsImpl, TemplateSpecVersionsImpl } from "./operations/index.js"; @@ -20,7 +20,7 @@ import { TemplateSpecsClientOptionalParams } from "./models/index.js"; export class TemplateSpecsClient extends coreClient.ServiceClient { $host: string; - subscriptionId: string; + subscriptionId?: string; apiVersion: string; /** @@ -32,13 +32,27 @@ export class TemplateSpecsClient extends coreClient.ServiceClient { constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: TemplateSpecsClientOptionalParams + options?: TemplateSpecsClientOptionalParams, + ); + constructor( + credentials: coreAuth.TokenCredential, + options?: TemplateSpecsClientOptionalParams, + ); + constructor( + credentials: coreAuth.TokenCredential, + subscriptionIdOrOptions?: TemplateSpecsClientOptionalParams | string, + options?: TemplateSpecsClientOptionalParams, ) { 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 +61,10 @@ export class TemplateSpecsClient extends coreClient.ServiceClient { } const defaults: TemplateSpecsClientOptionalParams = { requestContentType: "application/json; charset=utf-8", - credential: credentials + credential: credentials, }; - const packageDetails = `azsdk-js-arm-templatespecs/2.1.1`; + const packageDetails = `azsdk-js-arm-templatespecs/3.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -60,20 +74,21 @@ export class TemplateSpecsClient extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + 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 + coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -83,7 +98,7 @@ export class TemplateSpecsClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ @@ -93,9 +108,9 @@ export class TemplateSpecsClient extends coreClient.ServiceClient { `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -103,7 +118,7 @@ export class TemplateSpecsClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-05-01"; + this.apiVersion = options.apiVersion || "2022-02-01"; this.templateSpecs = new TemplateSpecsImpl(this); this.templateSpecVersions = new TemplateSpecVersionsImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); @@ -118,7 +133,7 @@ export class TemplateSpecsClient extends coreClient.ServiceClient { name: "CustomApiVersionPolicy", async sendRequest( request: PipelineRequest, - next: SendRequest + next: SendRequest, ): Promise { const param = request.url.split("?"); if (param.length > 1) { @@ -132,7 +147,7 @@ export class TemplateSpecsClient extends coreClient.ServiceClient { request.url = param[0] + "?" + newParams.join("&"); } return next(request); - } + }, }; this.pipeline.addPolicy(apiVersionPolicy); } diff --git a/sdk/templatespecs/arm-templatespecs/test/sampleTest.ts b/sdk/templatespecs/arm-templatespecs/test/sampleTest.ts new file mode 100644 index 000000000000..a1cf7c25afd2 --- /dev/null +++ b/sdk/templatespecs/arm-templatespecs/test/sampleTest.ts @@ -0,0 +1,40 @@ +/* + * 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"; + +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 (ctx) => { + recorder = new Recorder(ctx); + await recorder.start(recorderOptions); + }); + + afterEach(async () => { + await recorder.stop(); + }); + + it("sample test", async function () { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/templatespecs/arm-templatespecs/test/snippets.spec.ts b/sdk/templatespecs/arm-templatespecs/test/snippets.spec.ts index 574e39cd2eb8..c9b5710796ba 100644 --- a/sdk/templatespecs/arm-templatespecs/test/snippets.spec.ts +++ b/sdk/templatespecs/arm-templatespecs/test/snippets.spec.ts @@ -1,16 +1,29 @@ +/* + * 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 { TemplateSpecsClient } from "../src/index.js"; -import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; +import { + DefaultAzureCredential, + InteractiveBrowserCredential, +} from "@azure/identity"; import { setLogLevel } from "@azure/logger"; import { describe, it } from "vitest"; describe("snippets", () => { it("ReadmeSampleCreateClient_Node", async () => { const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new TemplateSpecsClient(new DefaultAzureCredential(), subscriptionId); + const client = new TemplateSpecsClient( + new DefaultAzureCredential(), + subscriptionId, + ); }); it("ReadmeSampleCreateClient_Browser", async () => { diff --git a/sdk/templatespecs/arm-templatespecs/tsconfig.json b/sdk/templatespecs/arm-templatespecs/tsconfig.json index 19ceb382b521..c2af6704a33c 100644 --- a/sdk/templatespecs/arm-templatespecs/tsconfig.json +++ b/sdk/templatespecs/arm-templatespecs/tsconfig.json @@ -1,13 +1,33 @@ { - "references": [ - { - "path": "./tsconfig.src.json" - }, - { - "path": "./tsconfig.samples.json" - }, - { - "path": "./tsconfig.test.json" - } + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": [ + "es6", + "dom" + ], + "declaration": true, + "outDir": "./dist-esm", + "importHelpers": true + }, + "include": [ + "src/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts", + "test/**/*.ts" + ], + "exclude": [ + "node_modules" ] -} +} \ No newline at end of file