From 5e545ad586b9dbd7dab7d3b84f1ea808fb6bc8df Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 5 Jan 2022 10:48:17 +0000 Subject: [PATCH] CodeGen from PR 16949 in Azure/azure-rest-api-specs Track2 modify readme.go.md 6 (#16949) * Track2 modify readme.go.md 6 * mariadb derective description --- common/config/rush/pnpm-lock.yaml | 131 +++--- rush.json | 5 + .../arm-managementpartner/CHANGELOG.md | 11 + .../{LICENSE.txt => LICENSE} | 4 +- .../arm-managementpartner/README.md | 147 ++++--- .../arm-managementpartner/_meta.json | 7 + .../arm-managementpartner/api-extractor.json | 18 + .../arm-managementpartner/package.json | 98 +++-- .../review/arm-managementpartner.api.md | 171 ++++++++ .../arm-managementpartner/rollup.config.js | 211 ++++++++-- .../aCEProvisioningManagementPartnerAPI.ts | 90 +++-- ...ProvisioningManagementPartnerAPIContext.ts | 56 --- .../arm-managementpartner/src/index.ts | 12 + .../arm-managementpartner/src/models/index.ts | 377 ++++++------------ .../src/models/mappers.ts | 138 +++---- .../src/models/operationMappers.ts | 18 - .../src/models/parameters.ts | 65 +-- .../src/models/partnerMappers.ts | 17 - .../src/operations/index.ts | 9 +- .../src/operations/operation.ts | 162 ++++---- .../src/operations/partner.ts | 228 ++++------- .../src/operations/partners.ts | 54 +++ .../src/operationsInterfaces/index.ts | 11 + .../src/operationsInterfaces/operation.ts | 22 + .../src/operationsInterfaces/partner.ts | 57 +++ .../src/operationsInterfaces/partners.ts | 18 + .../arm-managementpartner/test/sampleTest.ts | 48 +++ .../arm-managementpartner/tsconfig.json | 8 +- sdk/managementpartner/ci.yml | 29 ++ 29 files changed, 1328 insertions(+), 894 deletions(-) create mode 100644 sdk/managementpartner/arm-managementpartner/CHANGELOG.md rename sdk/managementpartner/arm-managementpartner/{LICENSE.txt => LICENSE} (96%) create mode 100644 sdk/managementpartner/arm-managementpartner/_meta.json create mode 100644 sdk/managementpartner/arm-managementpartner/api-extractor.json create mode 100644 sdk/managementpartner/arm-managementpartner/review/arm-managementpartner.api.md delete mode 100644 sdk/managementpartner/arm-managementpartner/src/aCEProvisioningManagementPartnerAPIContext.ts create mode 100644 sdk/managementpartner/arm-managementpartner/src/index.ts delete mode 100644 sdk/managementpartner/arm-managementpartner/src/models/operationMappers.ts delete mode 100644 sdk/managementpartner/arm-managementpartner/src/models/partnerMappers.ts create mode 100644 sdk/managementpartner/arm-managementpartner/src/operations/partners.ts create mode 100644 sdk/managementpartner/arm-managementpartner/src/operationsInterfaces/index.ts create mode 100644 sdk/managementpartner/arm-managementpartner/src/operationsInterfaces/operation.ts create mode 100644 sdk/managementpartner/arm-managementpartner/src/operationsInterfaces/partner.ts create mode 100644 sdk/managementpartner/arm-managementpartner/src/operationsInterfaces/partners.ts create mode 100644 sdk/managementpartner/arm-managementpartner/test/sampleTest.ts create mode 100644 sdk/managementpartner/ci.yml diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 694e81b4a476..09b2a349d6a6 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -47,6 +47,7 @@ specifiers: '@rush-temp/arm-logic': file:./projects/arm-logic.tgz '@rush-temp/arm-managedapplications': file:./projects/arm-managedapplications.tgz '@rush-temp/arm-managementgroups': file:./projects/arm-managementgroups.tgz + '@rush-temp/arm-managementpartner': file:./projects/arm-managementpartner.tgz '@rush-temp/arm-mediaservices': file:./projects/arm-mediaservices.tgz '@rush-temp/arm-monitor': file:./projects/arm-monitor.tgz '@rush-temp/arm-msi': file:./projects/arm-msi.tgz @@ -228,6 +229,7 @@ dependencies: '@rush-temp/arm-logic': file:projects/arm-logic.tgz '@rush-temp/arm-managedapplications': file:projects/arm-managedapplications.tgz '@rush-temp/arm-managementgroups': file:projects/arm-managementgroups.tgz + '@rush-temp/arm-managementpartner': file:projects/arm-managementpartner.tgz '@rush-temp/arm-mediaservices': file:projects/arm-mediaservices.tgz '@rush-temp/arm-monitor': file:projects/arm-monitor.tgz '@rush-temp/arm-msi': file:projects/arm-msi.tgz @@ -6977,7 +6979,7 @@ packages: hasBin: true dev: false - /ts-node/10.4.0_276ff2ad8f60608417677a4691c0f835: + /ts-node/10.4.0_28670484a221c7e896c5d6b821a5cbb7: resolution: {integrity: sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==} hasBin: true peerDependencies: @@ -7003,11 +7005,11 @@ packages: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 4.2.4 + typescript: 4.4.4 yn: 3.1.1 dev: false - /ts-node/10.4.0_54d7f9b57c83a5c5120be11b085b9de6: + /ts-node/10.4.0_f9f9f28f986ed7ad377c75abc9f416f4: resolution: {integrity: sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==} hasBin: true peerDependencies: @@ -7033,7 +7035,7 @@ packages: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 4.4.4 + typescript: 4.2.4 yn: 3.1.1 dev: false @@ -7629,7 +7631,7 @@ packages: prettier: 2.5.1 rimraf: 3.0.2 rollup: 1.32.1 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -7857,7 +7859,7 @@ packages: rollup: 1.32.1 sinon: 9.2.4 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -7908,7 +7910,7 @@ packages: rollup: 1.32.1 sinon: 9.2.4 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -7965,7 +7967,7 @@ packages: rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.14.5 @@ -8770,6 +8772,27 @@ packages: uglify-js: 3.14.5 dev: false + file:projects/arm-managementpartner.tgz: + resolution: {integrity: sha512-DBzr7LTRx/3JzaBduSBa4ZTN8l2u7uerHfjHnrYUOTb8fUXvaASA9v1rpTECWCet9VP67iWSfTXP9/hnk4sOjg==, tarball: file:projects/arm-managementpartner.tgz} + name: '@rush-temp/arm-managementpartner' + version: 0.0.0 + dependencies: + '@microsoft/api-extractor': 7.19.2 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 + cross-env: 7.0.3 + mkdirp: 1.0.4 + mocha: 7.2.0 + rimraf: 3.0.2 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + tslib: 2.3.1 + typescript: 4.2.4 + uglify-js: 3.14.5 + dev: false + file:projects/arm-mediaservices.tgz: resolution: {integrity: sha512-wt5O7fsBlkomvh57wJRSiBwgIAAmjjLwaX3HhUj2WNHhIjY/M3PQ8n/172v99nzZ2hTxBQPmokO4eyz9sKSqDA==, tarball: file:projects/arm-mediaservices.tgz} name: '@rush-temp/arm-mediaservices' @@ -9487,7 +9510,7 @@ packages: rollup: 1.32.1 safe-buffer: 5.2.1 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -9982,7 +10005,7 @@ packages: dev: false file:projects/core-amqp.tgz: - resolution: {integrity: sha512-jmyXvDp5FyZIlqp1zATESQp6qO2NqjKSfY5o9ojPsKN/g9WJ45RL4jfy+cD5u8C2t9jSDTsCoL+jbiLptpkDLA==, tarball: file:projects/core-amqp.tgz} + resolution: {integrity: sha512-nAZlMW/WFVSloK1iVzoSJNx9CHjvMl4/kJrnq1s5Okn96/AQX19SYkqfdvmew1Oy3bxfDC2g3n3e1CFLrlSyEg==, tarball: file:projects/core-amqp.tgz} name: '@rush-temp/core-amqp' version: 0.0.0 dependencies: @@ -10025,7 +10048,7 @@ packages: rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 url: 0.11.0 @@ -10111,7 +10134,7 @@ packages: rimraf: 3.0.2 rollup: 1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -10342,7 +10365,7 @@ packages: shx: 0.3.3 sinon: 9.2.4 tough-cookie: 4.0.0 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 tunnel: 0.0.6 typescript: 4.2.4 @@ -10390,7 +10413,7 @@ packages: prettier: 2.5.1 rimraf: 3.0.2 rollup: 1.32.1 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.14.5 @@ -10657,7 +10680,7 @@ packages: sinon: 9.2.4 snap-shot-it: 7.9.6 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 universal-user-agent: 6.0.0 @@ -10714,7 +10737,7 @@ packages: rollup-plugin-terser: 5.3.1_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -10760,7 +10783,7 @@ packages: rollup: 1.32.1 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 - ts-node: 10.4.0_54d7f9b57c83a5c5120be11b085b9de6 + ts-node: 10.4.0_28670484a221c7e896c5d6b821a5cbb7 tslib: 2.3.1 typescript: 4.4.4 yaml: 1.10.2 @@ -10917,7 +10940,7 @@ packages: rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -10979,7 +11002,7 @@ packages: rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 sinon: 9.2.4 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -11034,7 +11057,7 @@ packages: prettier: 2.5.1 rimraf: 3.0.2 rollup: 1.32.1 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -11087,7 +11110,7 @@ packages: prettier: 2.5.1 rimraf: 3.0.2 rollup: 1.32.1 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -11289,7 +11312,7 @@ packages: rollup-plugin-terser: 5.3.1_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -11553,7 +11576,7 @@ packages: rimraf: 3.0.2 rollup: 1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11702,7 +11725,7 @@ packages: rimraf: 3.0.2 rollup: 1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11774,7 +11797,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11794,7 +11817,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11814,7 +11837,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11834,7 +11857,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -11873,7 +11896,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11894,7 +11917,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -11917,7 +11940,7 @@ packages: moment: 2.29.1 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -11937,7 +11960,7 @@ packages: eslint: 7.32.0 prettier: 1.19.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11957,7 +11980,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11978,7 +12001,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12000,7 +12023,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12021,7 +12044,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12041,7 +12064,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -12060,7 +12083,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -12081,7 +12104,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12104,7 +12127,7 @@ packages: node-fetch: 2.6.6 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12125,7 +12148,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12146,7 +12169,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12167,7 +12190,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12539,7 +12562,7 @@ packages: rimraf: 3.0.2 rollup: 1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -12608,7 +12631,7 @@ packages: rimraf: 3.0.2 rollup: 1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 ws: 8.3.0 @@ -12671,7 +12694,7 @@ packages: rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 sinon: 9.2.4 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -12734,7 +12757,7 @@ packages: rollup-plugin-terser: 5.3.1_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -12797,7 +12820,7 @@ packages: rollup-plugin-terser: 5.3.1_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -12858,7 +12881,7 @@ packages: rollup-plugin-terser: 5.3.1_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -12916,7 +12939,7 @@ packages: rollup-plugin-terser: 5.3.1_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -12976,7 +12999,7 @@ packages: rollup-plugin-terser: 5.3.1_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -13028,7 +13051,7 @@ packages: rollup: 1.32.1 sinon: 9.2.4 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.14.5 @@ -13082,7 +13105,7 @@ packages: rollup: 1.32.1 sinon: 9.2.4 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.14.5 @@ -13135,7 +13158,7 @@ packages: rollup: 1.32.1 sinon: 9.2.4 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.14.5 diff --git a/rush.json b/rush.json index 66a9aa13703f..fa40628026bb 100644 --- a/rush.json +++ b/rush.json @@ -1215,6 +1215,11 @@ "packageName": "@azure/arm-containerinstance", "projectFolder": "sdk/containerinstance/arm-containerinstance", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-managementpartner", + "projectFolder": "sdk/managementpartner/arm-managementpartner", + "versionPolicyName": "management" } ] } \ No newline at end of file diff --git a/sdk/managementpartner/arm-managementpartner/CHANGELOG.md b/sdk/managementpartner/arm-managementpartner/CHANGELOG.md new file mode 100644 index 000000000000..a5ba2847e401 --- /dev/null +++ b/sdk/managementpartner/arm-managementpartner/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 2.0.0 (2022-01-05) + +The package of @azure/arm-managementpartner is using our next generation design principles since version 2.0.0, which contains breaking changes. + +To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). + +To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). + +To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/managementpartner/arm-managementpartner/LICENSE.txt b/sdk/managementpartner/arm-managementpartner/LICENSE similarity index 96% rename from sdk/managementpartner/arm-managementpartner/LICENSE.txt rename to sdk/managementpartner/arm-managementpartner/LICENSE index a70e8cf66038..5d1d36e0af80 100644 --- a/sdk/managementpartner/arm-managementpartner/LICENSE.txt +++ b/sdk/managementpartner/arm-managementpartner/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -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/managementpartner/arm-managementpartner/README.md b/sdk/managementpartner/arm-managementpartner/README.md index fb4710ce1fe2..7063bb6f366f 100644 --- a/sdk/managementpartner/arm-managementpartner/README.md +++ b/sdk/managementpartner/arm-managementpartner/README.md @@ -1,101 +1,98 @@ -## Azure ACEProvisioningManagementPartnerAPI SDK for JavaScript +# Azure Service client library for JavaScript -This package contains an isomorphic SDK for ACEProvisioningManagementPartnerAPI. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Service client. + +This API describe ACE Provisioning ManagementPartner + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/managementpartner/arm-managementpartner) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-managementpartner) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-managementpartner) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. -### How to Install +### Prerequisites -``` +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-managementpartner` package + +Install the Azure Service client library for JavaScript with `npm`: + +```bash npm install @azure/arm-managementpartner ``` -### How to use +### Create and authenticate a `ACEProvisioningManagementPartnerAPI` -#### nodejs - Authentication, client creation and get partner as an example written in TypeScript. +To create a client object to access the Azure Service API, you will need the `endpoint` of your Azure Service resource and a `credential`. The Azure Service client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure Service resource in the [Azure Portal][azure_portal]. -##### Install @azure/ms-rest-nodeauth +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). -``` -npm install @azure/ms-rest-nodeauth -``` +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: -##### Sample code - -```ts -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; -import { ACEProvisioningManagementPartnerAPI, ACEProvisioningManagementPartnerAPIModels, ACEProvisioningManagementPartnerAPIMappers } from "@azure/arm-managementpartner"; -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -msRestNodeAuth.interactiveLogin().then((creds) => { - const client = new ACEProvisioningManagementPartnerAPI(creds, subscriptionId); - const partnerId = "testpartnerId"; - client.partner.get(partnerId).then((result) => { - console.log("The result is:"); - console.log(result); - }); -}).catch((err) => { - console.error(err); -}); +```bash +npm install @azure/identity ``` -#### browser - Authentication, client creation and get partner as an example written in JavaScript. +You will also need to **register a new AAD application and grant access to Azure Service** 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`. -##### Install @azure/ms-rest-browserauth +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). +```javascript +const { ACEProvisioningManagementPartnerAPI } = require("@azure/arm-managementpartner"); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new ACEProvisioningManagementPartnerAPI(new DefaultAzureCredential(), subscriptionId); ``` -npm install @azure/ms-rest-browserauth -``` -##### Sample code - -See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. - -- index.html -```html - - - - @azure/arm-managementpartner sample - - - - - - - - + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### ACEProvisioningManagementPartnerAPI + +`ACEProvisioningManagementPartnerAPI` is the primary interface for developers using the Azure Service client library. Explore the methods on this client object to understand the different features of the Azure Service service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); ``` -## Related projects +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). -- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) +## Next steps +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + +## Related projects + +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fmanagementpartner%2Farm-managementpartner%2FREADME.png) + +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/managementpartner/arm-managementpartner/_meta.json b/sdk/managementpartner/arm-managementpartner/_meta.json new file mode 100644 index 000000000000..43bef4599693 --- /dev/null +++ b/sdk/managementpartner/arm-managementpartner/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "e8c6db17dc13a00155936dcaeacf4da0a1fabf77", + "readme": "specification/managementpartner/resource-manager/readme.md", + "autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/managementpartner/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20211130.1", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "use": "@autorest/typescript@6.0.0-alpha.16.20211130.1" +} \ No newline at end of file diff --git a/sdk/managementpartner/arm-managementpartner/api-extractor.json b/sdk/managementpartner/arm-managementpartner/api-extractor.json new file mode 100644 index 000000000000..b55d44de81bd --- /dev/null +++ b/sdk/managementpartner/arm-managementpartner/api-extractor.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "docModel": { "enabled": true }, + "apiReport": { "enabled": true, "reportFolder": "./review" }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-managementpartner.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/managementpartner/arm-managementpartner/package.json b/sdk/managementpartner/arm-managementpartner/package.json index 6c2b42a7f552..ee5a5067e1e2 100644 --- a/sdk/managementpartner/arm-managementpartner/package.json +++ b/sdk/managementpartner/arm-managementpartner/package.json @@ -1,55 +1,89 @@ { "name": "@azure/arm-managementpartner", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "ACEProvisioningManagementPartnerAPI Library with typescript type definitions for node.js and browser.", - "version": "1.1.0", + "description": "A generated SDK for ACEProvisioningManagementPartnerAPI.", + "version": "2.0.0", + "engines": { "node": ">=12.0.0" }, "dependencies": { - "@azure/ms-rest-azure-js": "^1.1.0", - "@azure/ms-rest-js": "^1.1.0", - "tslib": "^1.9.3" + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], + "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], "license": "MIT", - "main": "./dist/arm-managementpartner.js", - "module": "./esm/aCEProvisioningManagementPartnerAPI.js", - "types": "./esm/aCEProvisioningManagementPartnerAPI.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-managementpartner.d.ts", "devDependencies": { - "typescript": "^3.1.1", - "rollup": "^0.66.2", - "rollup-plugin-node-resolve": "^3.4.0", - "uglify-js": "^3.4.9" + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "mkdirp": "^1.0.4", + "rollup": "^1.16.3", + "rollup-plugin-sourcemaps": "^0.4.2", + "typescript": "~4.2.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^1.0.0", + "mocha": "^7.1.1", + "cross-env": "^7.0.2" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/main/sdk/managementpartner/arm-managementpartner", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/managementpartner/arm-managementpartner", "repository": { "type": "git", - "url": "https://github.com/azure/azure-sdk-for-js.git" - }, - "bugs": { - "url": "https://github.com/azure/azure-sdk-for-js/issues" + "url": "https://github.com/Azure/azure-sdk-for-js.git" }, + "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "files": [ "dist/**/*.js", "dist/**/*.js.map", "dist/**/*.d.ts", "dist/**/*.d.ts.map", - "esm/**/*.js", - "esm/**/*.js.map", - "esm/**/*.d.ts", - "esm/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", "src/**/*.ts", + "README.md", + "LICENSE", "rollup.config.js", - "tsconfig.json" + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" ], "scripts": { - "build": "tsc && rollup -c rollup.config.js && npm run minify", - "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-managementpartner.js.map'\" -o ./dist/arm-managementpartner.min.js ./dist/arm-managementpartner.js", - "prepack": "npm install && npm run build" + "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "api-extractor run --local", + "lint": "echo skipped", + "audit": "echo skipped", + "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "npm run integration-test", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:browser": "echo skipped", + "docs": "echo skipped" }, "sideEffects": false, "autoPublish": true diff --git a/sdk/managementpartner/arm-managementpartner/review/arm-managementpartner.api.md b/sdk/managementpartner/arm-managementpartner/review/arm-managementpartner.api.md new file mode 100644 index 000000000000..65b88d7f2f67 --- /dev/null +++ b/sdk/managementpartner/arm-managementpartner/review/arm-managementpartner.api.md @@ -0,0 +1,171 @@ +## API Report File for "@azure/arm-managementpartner" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; + +// @public (undocumented) +export class ACEProvisioningManagementPartnerAPI extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, options?: ACEProvisioningManagementPartnerAPIOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + operation: Operation; + // (undocumented) + partner: Partner; + // (undocumented) + partners: Partners; +} + +// @public +export interface ACEProvisioningManagementPartnerAPIOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface ErrorModel { + error?: ExtendedErrorInfo; +} + +// @public +export type ErrorResponseCode = string; + +// @public +export interface ExtendedErrorInfo { + code?: ErrorResponseCode; + message?: string; +} + +// @public +export enum KnownErrorResponseCode { + // (undocumented) + BadRequest = "BadRequest", + // (undocumented) + Conflict = "Conflict", + // (undocumented) + NotFound = "NotFound" +} + +// @public +export enum KnownManagementPartnerState { + // (undocumented) + Active = "Active", + // (undocumented) + Deleted = "Deleted" +} + +// @public +export type ManagementPartnerState = string; + +// @public +export interface Operation { + list(options?: OperationListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationDisplay { + description?: string; + operation?: string; + provider?: string; + resource?: string; +} + +// @public +export interface OperationList { + nextLink?: string; + value?: OperationResponse[]; +} + +// @public +export interface OperationListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationListNextResponse = OperationList; + +// @public +export interface OperationListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationListResponse = OperationList; + +// @public +export interface OperationResponse { + display?: OperationDisplay; + name?: string; + origin?: string; +} + +// @public +export interface Partner { + create(partnerId: string, options?: PartnerCreateOptionalParams): Promise; + delete(partnerId: string, options?: PartnerDeleteOptionalParams): Promise; + get(partnerId: string, options?: PartnerGetOptionalParams): Promise; + update(partnerId: string, options?: PartnerUpdateOptionalParams): Promise; +} + +// @public +export interface PartnerCreateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PartnerCreateResponse = PartnerResponse; + +// @public +export interface PartnerDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface PartnerGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PartnerGetResponse = PartnerResponse; + +// @public +export interface PartnerResponse { + createdTime?: Date; + etag?: number; + readonly id?: string; + readonly name?: string; + objectId?: string; + partnerId?: string; + partnerName?: string; + state?: ManagementPartnerState; + tenantId?: string; + readonly type?: string; + updatedTime?: Date; + version?: number; +} + +// @public +export interface Partners { + get(options?: PartnersGetOptionalParams): Promise; +} + +// @public +export interface PartnersGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PartnersGetResponse = PartnerResponse; + +// @public +export interface PartnerUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PartnerUpdateResponse = PartnerResponse; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/managementpartner/arm-managementpartner/rollup.config.js b/sdk/managementpartner/arm-managementpartner/rollup.config.js index f35592c8b48e..9be1955eb7f1 100644 --- a/sdk/managementpartner/arm-managementpartner/rollup.config.js +++ b/sdk/managementpartner/arm-managementpartner/rollup.config.js @@ -1,31 +1,188 @@ -import nodeResolve from "rollup-plugin-node-resolve"; +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + +// #region Warning Handler + +/** + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +function ignoreNiseSinonEvalWarnings(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependencyWarnings(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; + /** - * @type {import('rollup').RollupFileOptions} + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. */ -const config = { - input: './esm/aCEProvisioningManagementPartnerAPI.js', - external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"], - output: { - file: "./dist/arm-managementpartner.js", - format: "umd", - name: "Azure.ArmManagementpartner", - sourcemap: true, - globals: { - "@azure/ms-rest-js": "msRest", - "@azure/ms-rest-azure-js": "msRestAzure" +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] }, - banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */` - }, - plugins: [ - nodeResolve({ module: true }) - ] + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false }; -export default config; + +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve(), cjs()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/managementpartner/arm-managementpartner/src/aCEProvisioningManagementPartnerAPI.ts b/sdk/managementpartner/arm-managementpartner/src/aCEProvisioningManagementPartnerAPI.ts index 0fdeb8e0ae10..970ae5080258 100644 --- a/sdk/managementpartner/arm-managementpartner/src/aCEProvisioningManagementPartnerAPI.ts +++ b/sdk/managementpartner/arm-managementpartner/src/aCEProvisioningManagementPartnerAPI.ts @@ -1,43 +1,71 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; -import * as operations from "./operations"; -import { ACEProvisioningManagementPartnerAPIContext } from "./aCEProvisioningManagementPartnerAPIContext"; +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { PartnerImpl, OperationImpl, PartnersImpl } from "./operations"; +import { Partner, Operation, Partners } from "./operationsInterfaces"; +import { ACEProvisioningManagementPartnerAPIOptionalParams } from "./models"; - -class ACEProvisioningManagementPartnerAPI extends ACEProvisioningManagementPartnerAPIContext { - // Operation groups - partner: operations.Partner; - operation: operations.Operation; +export class ACEProvisioningManagementPartnerAPI extends coreClient.ServiceClient { + $host: string; + apiVersion: string; /** * Initializes a new instance of the ACEProvisioningManagementPartnerAPI class. - * @param credentials Credentials needed for the client to connect to Azure. - * @param [options] The parameter options + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param options The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials, options?: Models.ACEProvisioningManagementPartnerAPIOptions) { - super(credentials, options); - this.partner = new operations.Partner(this); - this.operation = new operations.Operation(this); - } -} + constructor( + credentials: coreAuth.TokenCredential, + options?: ACEProvisioningManagementPartnerAPIOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: ACEProvisioningManagementPartnerAPIOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; -// Operation Specifications + const packageDetails = `azsdk-js-arm-managementpartner/2.0.0`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; -export { - ACEProvisioningManagementPartnerAPI, - ACEProvisioningManagementPartnerAPIContext, - Models as ACEProvisioningManagementPartnerAPIModels, - Mappers as ACEProvisioningManagementPartnerAPIMappers -}; -export * from "./operations"; + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2018-02-01"; + this.partner = new PartnerImpl(this); + this.operation = new OperationImpl(this); + this.partners = new PartnersImpl(this); + } + + partner: Partner; + operation: Operation; + partners: Partners; +} diff --git a/sdk/managementpartner/arm-managementpartner/src/aCEProvisioningManagementPartnerAPIContext.ts b/sdk/managementpartner/arm-managementpartner/src/aCEProvisioningManagementPartnerAPIContext.ts deleted file mode 100644 index 6f295935fd1d..000000000000 --- a/sdk/managementpartner/arm-managementpartner/src/aCEProvisioningManagementPartnerAPIContext.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as Models from "./models"; -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; - -const packageName = "@azure/arm-managementpartner"; -const packageVersion = "0.1.0"; - -export class ACEProvisioningManagementPartnerAPIContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials; - apiVersion?: string; - - /** - * Initializes a new instance of the ACEProvisioningManagementPartnerAPI class. - * @param credentials Credentials needed for the client to connect to Azure. - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials, options?: Models.ACEProvisioningManagementPartnerAPIOptions) { - if (credentials == undefined) { - throw new Error('\'credentials\' cannot be null.'); - } - - if (!options) { - options = {}; - } - if(!options.userAgent) { - const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); - options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; - } - - super(credentials, options); - - this.apiVersion = '2018-02-01'; - this.acceptLanguage = 'en-US'; - this.longRunningOperationRetryTimeout = 30; - this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; - this.requestContentType = "application/json; charset=utf-8"; - this.credentials = credentials; - - if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { - this.acceptLanguage = options.acceptLanguage; - } - if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { - this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; - } - } -} diff --git a/sdk/managementpartner/arm-managementpartner/src/index.ts b/sdk/managementpartner/arm-managementpartner/src/index.ts new file mode 100644 index 000000000000..0f163d287a4b --- /dev/null +++ b/sdk/managementpartner/arm-managementpartner/src/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/// +export * from "./models"; +export { ACEProvisioningManagementPartnerAPI } from "./aCEProvisioningManagementPartnerAPI"; +export * from "./operationsInterfaces"; diff --git a/sdk/managementpartner/arm-managementpartner/src/models/index.ts b/sdk/managementpartner/arm-managementpartner/src/models/index.ts index 4af5bdaceb3e..c078806f4140 100644 --- a/sdk/managementpartner/arm-managementpartner/src/models/index.ts +++ b/sdk/managementpartner/arm-managementpartner/src/models/index.ts @@ -1,299 +1,180 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export { BaseResource, CloudError }; - - -/** - * @interface - * An interface representing PartnerResponse. - * this is the management partner operations response - * - * @extends BaseResource - */ -export interface PartnerResponse extends BaseResource { - /** - * @member {number} [etag] Type of the partner - */ +/** this is the management partner operations response */ +export interface PartnerResponse { + /** Type of the partner */ etag?: number; /** - * @member {string} [id] Identifier of the partner - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Identifier of the partner + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * @member {string} [name] Name of the partner - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Name of the partner + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * @member {string} [partnerId] This is the partner id + * Type of resource. "Microsoft.ManagementPartner/partners" + * NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly type?: string; + /** This is the partner id */ partnerId?: string; - /** - * @member {string} [partnerName] This is the partner name - */ + /** This is the partner name */ partnerName?: string; - /** - * @member {string} [tenantId] This is the tenant id. - */ + /** This is the tenant id. */ tenantId?: string; - /** - * @member {string} [objectId] This is the object id. - */ + /** This is the object id. */ objectId?: string; - /** - * @member {string} [version] This is the version. - */ - version?: string; - /** - * @member {Date} [updatedTime] This is the DateTime when the partner was - * updated. - */ + /** This is the version. */ + version?: number; + /** This is the DateTime when the partner was updated. */ updatedTime?: Date; - /** - * @member {Date} [createdTime] This is the DateTime when the partner was - * created. - */ + /** This is the DateTime when the partner was created. */ createdTime?: Date; - /** - * @member {State} [state] This is the partner state. Possible values - * include: 'Active', 'Deleted' - */ - state?: State; - /** - * @member {string} [type] Type of resource. - * "Microsoft.ManagementPartner/partners" - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly type?: string; + /** This is the partner state */ + state?: ManagementPartnerState; } -/** - * @interface - * An interface representing ExtendedErrorInfo. - * this is the extended error info - * - */ +/** this is the management partner operations error */ +export interface ErrorModel { + /** this is the ExtendedErrorInfo property */ + error?: ExtendedErrorInfo; +} + +/** this is the extended error info */ export interface ExtendedErrorInfo { - /** - * @member {Code} [code] this is the error response code. Possible values - * include: 'NotFound', 'Conflict', 'BadRequest' - */ - code?: Code; - /** - * @member {string} [message] this is the extended error info message - */ + /** this is the error response code */ + code?: ErrorResponseCode; + /** this is the extended error info message */ message?: string; } -/** - * @interface - * An interface representing ErrorModel. - * this is the management partner operations error - * - */ -export interface ErrorModel { - /** - * @member {ExtendedErrorInfo} [error] this is the ExtendedErrorInfo property - */ - error?: ExtendedErrorInfo; +/** this is the management partner operations list */ +export interface OperationList { + /** this is the operation response list */ + value?: OperationResponse[]; + /** Url to get the next page of items. */ + nextLink?: string; } -/** - * @interface - * An interface representing OperationDisplay. - * this is the management partner operation - * - */ +/** this is the management partner operations response */ +export interface OperationResponse { + /** this is the operation response name */ + name?: string; + /** this is the operation display */ + display?: OperationDisplay; + /** the is operation response origin information */ + origin?: string; +} + +/** this is the management partner operation */ export interface OperationDisplay { - /** - * @member {string} [provider] the is management partner provider - */ + /** the is management partner provider */ provider?: string; - /** - * @member {string} [resource] the is management partner resource - */ + /** the is management partner resource */ resource?: string; - /** - * @member {string} [operation] the is management partner operation - */ + /** the is management partner operation */ operation?: string; - /** - * @member {string} [description] the is management partner operation - * description - */ + /** the is management partner operation description */ description?: string; } -/** - * @interface - * An interface representing OperationResponse. - * this is the management partner operations response - * - */ -export interface OperationResponse { - /** - * @member {string} [name] this is the operation response name - */ - name?: string; - /** - * @member {OperationDisplay} [display] this is the operation display - */ - display?: OperationDisplay; - /** - * @member {string} [origin] the is operation response origin information - */ - origin?: string; +/** Known values of {@link ManagementPartnerState} that the service accepts. */ +export enum KnownManagementPartnerState { + Active = "Active", + Deleted = "Deleted" } /** - * @interface - * An interface representing ACEProvisioningManagementPartnerAPIOptions. - * @extends AzureServiceClientOptions + * Defines values for ManagementPartnerState. \ + * {@link KnownManagementPartnerState} can be used interchangeably with ManagementPartnerState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Active** \ + * **Deleted** */ -export interface ACEProvisioningManagementPartnerAPIOptions extends AzureServiceClientOptions { - /** - * @member {string} [baseUri] - */ - baseUri?: string; -} +export type ManagementPartnerState = string; - -/** - * @interface - * An interface representing the OperationList. - * this is the management partner operations list - * - * @extends Array - */ -export interface OperationList extends Array { - /** - * @member {string} [nextLink] Url to get the next page of items. - */ - nextLink?: string; +/** Known values of {@link ErrorResponseCode} that the service accepts. */ +export enum KnownErrorResponseCode { + NotFound = "NotFound", + Conflict = "Conflict", + BadRequest = "BadRequest" } /** - * Defines values for State. - * Possible values include: 'Active', 'Deleted' - * @readonly - * @enum {string} + * Defines values for ErrorResponseCode. \ + * {@link KnownErrorResponseCode} can be used interchangeably with ErrorResponseCode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NotFound** \ + * **Conflict** \ + * **BadRequest** */ -export type State = 'Active' | 'Deleted'; +export type ErrorResponseCode = string; -/** - * Defines values for Code. - * Possible values include: 'NotFound', 'Conflict', 'BadRequest' - * @readonly - * @enum {string} - */ -export type Code = 'NotFound' | 'Conflict' | 'BadRequest'; +/** Optional parameters. */ +export interface PartnerGetOptionalParams extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type PartnerGetResponse = PartnerResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: PartnerResponse; - }; -}; +/** Contains response data for the get operation. */ +export type PartnerGetResponse = PartnerResponse; -/** - * Contains response data for the create operation. - */ -export type PartnerCreateResponse = PartnerResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: PartnerResponse; - }; -}; +/** Optional parameters. */ +export interface PartnerCreateOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the update operation. - */ -export type PartnerUpdateResponse = PartnerResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: PartnerResponse; - }; -}; +/** Contains response data for the create operation. */ +export type PartnerCreateResponse = PartnerResponse; -/** - * Contains response data for the list operation. - */ -export type OperationListResponse = OperationList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationList; - }; -}; +/** Optional parameters. */ +export interface PartnerUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listNext operation. - */ -export type OperationListNextResponse = OperationList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationList; - }; -}; +/** Contains response data for the update operation. */ +export type PartnerUpdateResponse = PartnerResponse; + +/** Optional parameters. */ +export interface PartnerDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface OperationListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationListResponse = OperationList; + +/** Optional parameters. */ +export interface OperationListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationListNextResponse = OperationList; + +/** Optional parameters. */ +export interface PartnersGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type PartnersGetResponse = PartnerResponse; + +/** Optional parameters. */ +export interface ACEProvisioningManagementPartnerAPIOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/managementpartner/arm-managementpartner/src/models/mappers.ts b/sdk/managementpartner/arm-managementpartner/src/models/mappers.ts index abdba22c5a52..dd4a4c3b467a 100644 --- a/sdk/managementpartner/arm-managementpartner/src/models/mappers.ts +++ b/sdk/managementpartner/arm-managementpartner/src/models/mappers.ts @@ -1,21 +1,14 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export const CloudError = CloudErrorMapper; -export const BaseResource = BaseResourceMapper; - -export const PartnerResponse: msRest.CompositeMapper = { - serializedName: "PartnerResponse", +export const PartnerResponse: coreClient.CompositeMapper = { type: { name: "Composite", className: "PartnerResponse", @@ -27,15 +20,22 @@ export const PartnerResponse: msRest.CompositeMapper = { } }, id: { - readOnly: true, serializedName: "id", + readOnly: true, type: { name: "String" } }, name: { - readOnly: true, serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, type: { name: "String" } @@ -67,7 +67,7 @@ export const PartnerResponse: msRest.CompositeMapper = { version: { serializedName: "properties.version", type: { - name: "String" + name: "Number" } }, updatedTime: { @@ -87,42 +87,12 @@ export const PartnerResponse: msRest.CompositeMapper = { type: { name: "String" } - }, - type: { - readOnly: true, - serializedName: "type", - type: { - name: "String" - } } } } }; -export const ExtendedErrorInfo: msRest.CompositeMapper = { - serializedName: "ExtendedErrorInfo", - type: { - name: "Composite", - className: "ExtendedErrorInfo", - modelProperties: { - code: { - serializedName: "code", - type: { - name: "String" - } - }, - message: { - serializedName: "message", - type: { - name: "String" - } - } - } - } -}; - -export const ErrorModel: msRest.CompositeMapper = { - serializedName: "Error", +export const ErrorModel: coreClient.CompositeMapper = { type: { name: "Composite", className: "ErrorModel", @@ -138,32 +108,46 @@ export const ErrorModel: msRest.CompositeMapper = { } }; -export const OperationDisplay: msRest.CompositeMapper = { - serializedName: "OperationDisplay", +export const ExtendedErrorInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationDisplay", + className: "ExtendedErrorInfo", modelProperties: { - provider: { - serializedName: "provider", + code: { + serializedName: "code", type: { name: "String" } }, - resource: { - serializedName: "resource", + message: { + serializedName: "message", type: { name: "String" } - }, - operation: { - serializedName: "operation", + } + } + } +}; + +export const OperationList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationList", + modelProperties: { + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OperationResponse" + } + } } }, - description: { - serializedName: "description", + nextLink: { + serializedName: "nextLink", type: { name: "String" } @@ -172,8 +156,7 @@ export const OperationDisplay: msRest.CompositeMapper = { } }; -export const OperationResponse: msRest.CompositeMapper = { - serializedName: "OperationResponse", +export const OperationResponse: coreClient.CompositeMapper = { type: { name: "Composite", className: "OperationResponse", @@ -201,26 +184,31 @@ export const OperationResponse: msRest.CompositeMapper = { } }; -export const OperationList: msRest.CompositeMapper = { - serializedName: "OperationList", +export const OperationDisplay: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationList", + className: "OperationDisplay", modelProperties: { - value: { - serializedName: "", + provider: { + serializedName: "provider", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "OperationResponse" - } - } + name: "String" } }, - nextLink: { - serializedName: "nextLink", + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + }, + description: { + serializedName: "description", type: { name: "String" } diff --git a/sdk/managementpartner/arm-managementpartner/src/models/operationMappers.ts b/sdk/managementpartner/arm-managementpartner/src/models/operationMappers.ts deleted file mode 100644 index e360e157e02e..000000000000 --- a/sdk/managementpartner/arm-managementpartner/src/models/operationMappers.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - OperationList, - OperationResponse, - OperationDisplay, - ErrorModel, - ExtendedErrorInfo -} from "../models/mappers"; - diff --git a/sdk/managementpartner/arm-managementpartner/src/models/parameters.ts b/sdk/managementpartner/arm-managementpartner/src/models/parameters.ts index 6108e0ed6cb4..31b2a1db66e1 100644 --- a/sdk/managementpartner/arm-managementpartner/src/models/parameters.ts +++ b/sdk/managementpartner/arm-managementpartner/src/models/parameters.ts @@ -1,53 +1,72 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; -export const acceptLanguage: msRest.OperationParameter = { - parameterPath: "acceptLanguage", +export const accept: OperationParameter = { + parameterPath: "accept", mapper: { - serializedName: "accept-language", - defaultValue: 'en-US', + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", type: { name: "String" } } }; -export const apiVersion: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const $host: OperationURLParameter = { + parameterPath: "$host", mapper: { + serializedName: "$host", required: true, - serializedName: "api-version", type: { name: "String" } - } + }, + skipEncoding: true }; -export const nextPageLink: msRest.OperationURLParameter = { - parameterPath: "nextPageLink", + +export const partnerId: OperationURLParameter = { + parameterPath: "partnerId", mapper: { + serializedName: "partnerId", required: true, - serializedName: "nextLink", type: { name: "String" } - }, - skipEncoding: true + } }; -export const partnerId: msRest.OperationURLParameter = { - parameterPath: "partnerId", + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - required: true, - serializedName: "partnerId", + defaultValue: "2018-02-01", + isConstant: true, + serializedName: "api-version", type: { name: "String" } } }; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; diff --git a/sdk/managementpartner/arm-managementpartner/src/models/partnerMappers.ts b/sdk/managementpartner/arm-managementpartner/src/models/partnerMappers.ts deleted file mode 100644 index 0629f716e619..000000000000 --- a/sdk/managementpartner/arm-managementpartner/src/models/partnerMappers.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - PartnerResponse, - BaseResource, - ErrorModel, - ExtendedErrorInfo -} from "../models/mappers"; - diff --git a/sdk/managementpartner/arm-managementpartner/src/operations/index.ts b/sdk/managementpartner/arm-managementpartner/src/operations/index.ts index b5aff1635fd8..e8c7fa2a08c7 100644 --- a/sdk/managementpartner/arm-managementpartner/src/operations/index.ts +++ b/sdk/managementpartner/arm-managementpartner/src/operations/index.ts @@ -1,12 +1,11 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export * from "./partner"; export * from "./operation"; +export * from "./partners"; diff --git a/sdk/managementpartner/arm-managementpartner/src/operations/operation.ts b/sdk/managementpartner/arm-managementpartner/src/operations/operation.ts index 5d00c81e4a8f..2289a2953658 100644 --- a/sdk/managementpartner/arm-managementpartner/src/operations/operation.ts +++ b/sdk/managementpartner/arm-managementpartner/src/operations/operation.ts @@ -1,97 +1,111 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/operationMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operation } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ACEProvisioningManagementPartnerAPIContext } from "../aCEProvisioningManagementPartnerAPIContext"; +import { ACEProvisioningManagementPartnerAPI } from "../aCEProvisioningManagementPartnerAPI"; +import { + OperationResponse, + OperationListNextOptionalParams, + OperationListOptionalParams, + OperationListResponse, + OperationListNextResponse +} from "../models"; -/** Class representing a Operation. */ -export class Operation { - private readonly client: ACEProvisioningManagementPartnerAPIContext; +/// +/** Class containing Operation operations. */ +export class OperationImpl implements Operation { + private readonly client: ACEProvisioningManagementPartnerAPI; /** - * Create a Operation. - * @param {ACEProvisioningManagementPartnerAPIContext} client Reference to the service client. + * Initialize a new instance of the class Operation class. + * @param client Reference to the service client */ - constructor(client: ACEProvisioningManagementPartnerAPIContext) { + constructor(client: ACEProvisioningManagementPartnerAPI) { this.client = client; } /** * List all the operations. - * @summary Get operations. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options + public list( + options?: OperationListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listOperationSpec, - callback) as Promise; + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: OperationListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: OperationListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } } /** * List all the operations. - * @summary Get operations. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * @param options The options parameters. */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + private _list( + options?: OperationListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listNext( + nextLink: string, + options?: OperationListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.ManagementPartner/operations", httpMethod: "GET", - path: "providers/Microsoft.ManagementPartner/operations", - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.OperationList @@ -100,19 +114,14 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.OperationList @@ -121,5 +130,8 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/managementpartner/arm-managementpartner/src/operations/partner.ts b/sdk/managementpartner/arm-managementpartner/src/operations/partner.ts index cb179faa6450..19f98fe5de35 100644 --- a/sdk/managementpartner/arm-managementpartner/src/operations/partner.ts +++ b/sdk/managementpartner/arm-managementpartner/src/operations/partner.ts @@ -1,162 +1,104 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/partnerMappers"; +import { Partner } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ACEProvisioningManagementPartnerAPIContext } from "../aCEProvisioningManagementPartnerAPIContext"; +import { ACEProvisioningManagementPartnerAPI } from "../aCEProvisioningManagementPartnerAPI"; +import { + PartnerGetOptionalParams, + PartnerGetResponse, + PartnerCreateOptionalParams, + PartnerCreateResponse, + PartnerUpdateOptionalParams, + PartnerUpdateResponse, + PartnerDeleteOptionalParams +} from "../models"; -/** Class representing a Partner. */ -export class Partner { - private readonly client: ACEProvisioningManagementPartnerAPIContext; +/** Class containing Partner operations. */ +export class PartnerImpl implements Partner { + private readonly client: ACEProvisioningManagementPartnerAPI; /** - * Create a Partner. - * @param {ACEProvisioningManagementPartnerAPIContext} client Reference to the service client. + * Initialize a new instance of the class Partner class. + * @param client Reference to the service client */ - constructor(client: ACEProvisioningManagementPartnerAPIContext) { + constructor(client: ACEProvisioningManagementPartnerAPI) { this.client = client; } /** * Get the management partner using the partnerId, objectId and tenantId. - * @summary Get a specific `Partner`. * @param partnerId Id of the Partner - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(partnerId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param partnerId Id of the Partner - * @param callback The callback - */ - get(partnerId: string, callback: msRest.ServiceCallback): void; - /** - * @param partnerId Id of the Partner - * @param options The optional parameters - * @param callback The callback - */ - get(partnerId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(partnerId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + partnerId: string, + options?: PartnerGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - partnerId, - options - }, - getOperationSpec, - callback) as Promise; + { partnerId, options }, + getOperationSpec + ); } /** * Create a management partner for the objectId and tenantId. - * @summary Create a specific `Partner`. * @param partnerId Id of the Partner - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - create(partnerId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param partnerId Id of the Partner - * @param callback The callback - */ - create(partnerId: string, callback: msRest.ServiceCallback): void; - /** - * @param partnerId Id of the Partner - * @param options The optional parameters - * @param callback The callback - */ - create(partnerId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - create(partnerId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + create( + partnerId: string, + options?: PartnerCreateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - partnerId, - options - }, - createOperationSpec, - callback) as Promise; + { partnerId, options }, + createOperationSpec + ); } /** * Update the management partner for the objectId and tenantId. - * @summary Update a specific `Partner`. - * @param partnerId Id of the Partner - * @param [options] The optional parameters - * @returns Promise - */ - update(partnerId: string, options?: msRest.RequestOptionsBase): Promise; - /** * @param partnerId Id of the Partner - * @param callback The callback + * @param options The options parameters. */ - update(partnerId: string, callback: msRest.ServiceCallback): void; - /** - * @param partnerId Id of the Partner - * @param options The optional parameters - * @param callback The callback - */ - update(partnerId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(partnerId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + partnerId: string, + options?: PartnerUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - partnerId, - options - }, - updateOperationSpec, - callback) as Promise; + { partnerId, options }, + updateOperationSpec + ); } /** * Delete the management partner for the objectId and tenantId. - * @summary Delete a specific `Partner`. - * @param partnerId Id of the Partner - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(partnerId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param partnerId Id of the Partner - * @param callback The callback - */ - deleteMethod(partnerId: string, callback: msRest.ServiceCallback): void; - /** * @param partnerId Id of the Partner - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - deleteMethod(partnerId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(partnerId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + partnerId: string, + options?: PartnerDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - partnerId, - options - }, - deleteMethodOperationSpec, - callback); + { partnerId, options }, + deleteOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.ManagementPartner/partners/{partnerId}", httpMethod: "GET", - path: "providers/Microsoft.ManagementPartner/partners/{partnerId}", - urlParameters: [ - Parameters.partnerId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.PartnerResponse @@ -165,21 +107,14 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.partnerId], + headerParameters: [Parameters.accept], serializer }; - -const createOperationSpec: msRest.OperationSpec = { +const createOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.ManagementPartner/partners/{partnerId}", httpMethod: "PUT", - path: "providers/Microsoft.ManagementPartner/partners/{partnerId}", - urlParameters: [ - Parameters.partnerId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.PartnerResponse @@ -188,21 +123,14 @@ const createOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.partnerId], + headerParameters: [Parameters.accept], serializer }; - -const updateOperationSpec: msRest.OperationSpec = { +const updateOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.ManagementPartner/partners/{partnerId}", httpMethod: "PATCH", - path: "providers/Microsoft.ManagementPartner/partners/{partnerId}", - urlParameters: [ - Parameters.partnerId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.PartnerResponse @@ -211,26 +139,22 @@ const updateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.partnerId], + headerParameters: [Parameters.accept], serializer }; - -const deleteMethodOperationSpec: msRest.OperationSpec = { +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.ManagementPartner/partners/{partnerId}", httpMethod: "DELETE", - path: "providers/Microsoft.ManagementPartner/partners/{partnerId}", - urlParameters: [ - Parameters.partnerId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: {}, default: { bodyMapper: Mappers.ErrorModel } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.partnerId], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/managementpartner/arm-managementpartner/src/operations/partners.ts b/sdk/managementpartner/arm-managementpartner/src/operations/partners.ts new file mode 100644 index 000000000000..f8e7a7e94875 --- /dev/null +++ b/sdk/managementpartner/arm-managementpartner/src/operations/partners.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { Partners } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ACEProvisioningManagementPartnerAPI } from "../aCEProvisioningManagementPartnerAPI"; +import { PartnersGetOptionalParams, PartnersGetResponse } from "../models"; + +/** Class containing Partners operations. */ +export class PartnersImpl implements Partners { + private readonly client: ACEProvisioningManagementPartnerAPI; + + /** + * Initialize a new instance of the class Partners class. + * @param client Reference to the service client + */ + constructor(client: ACEProvisioningManagementPartnerAPI) { + this.client = client; + } + + /** + * Get the management partner using the objectId and tenantId. + * @param options The options parameters. + */ + get(options?: PartnersGetOptionalParams): Promise { + return this.client.sendOperationRequest({ options }, getOperationSpec); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.ManagementPartner/partners", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PartnerResponse + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/managementpartner/arm-managementpartner/src/operationsInterfaces/index.ts b/sdk/managementpartner/arm-managementpartner/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..e8c7fa2a08c7 --- /dev/null +++ b/sdk/managementpartner/arm-managementpartner/src/operationsInterfaces/index.ts @@ -0,0 +1,11 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./partner"; +export * from "./operation"; +export * from "./partners"; diff --git a/sdk/managementpartner/arm-managementpartner/src/operationsInterfaces/operation.ts b/sdk/managementpartner/arm-managementpartner/src/operationsInterfaces/operation.ts new file mode 100644 index 000000000000..e22ef838b2e3 --- /dev/null +++ b/sdk/managementpartner/arm-managementpartner/src/operationsInterfaces/operation.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 { OperationResponse, OperationListOptionalParams } from "../models"; + +/// +/** Interface representing a Operation. */ +export interface Operation { + /** + * List all the operations. + * @param options The options parameters. + */ + list( + options?: OperationListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/managementpartner/arm-managementpartner/src/operationsInterfaces/partner.ts b/sdk/managementpartner/arm-managementpartner/src/operationsInterfaces/partner.ts new file mode 100644 index 000000000000..ec6a9f57f5f6 --- /dev/null +++ b/sdk/managementpartner/arm-managementpartner/src/operationsInterfaces/partner.ts @@ -0,0 +1,57 @@ +/* + * 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 { + PartnerGetOptionalParams, + PartnerGetResponse, + PartnerCreateOptionalParams, + PartnerCreateResponse, + PartnerUpdateOptionalParams, + PartnerUpdateResponse, + PartnerDeleteOptionalParams +} from "../models"; + +/** Interface representing a Partner. */ +export interface Partner { + /** + * Get the management partner using the partnerId, objectId and tenantId. + * @param partnerId Id of the Partner + * @param options The options parameters. + */ + get( + partnerId: string, + options?: PartnerGetOptionalParams + ): Promise; + /** + * Create a management partner for the objectId and tenantId. + * @param partnerId Id of the Partner + * @param options The options parameters. + */ + create( + partnerId: string, + options?: PartnerCreateOptionalParams + ): Promise; + /** + * Update the management partner for the objectId and tenantId. + * @param partnerId Id of the Partner + * @param options The options parameters. + */ + update( + partnerId: string, + options?: PartnerUpdateOptionalParams + ): Promise; + /** + * Delete the management partner for the objectId and tenantId. + * @param partnerId Id of the Partner + * @param options The options parameters. + */ + delete( + partnerId: string, + options?: PartnerDeleteOptionalParams + ): Promise; +} diff --git a/sdk/managementpartner/arm-managementpartner/src/operationsInterfaces/partners.ts b/sdk/managementpartner/arm-managementpartner/src/operationsInterfaces/partners.ts new file mode 100644 index 000000000000..5abc55c8f2e6 --- /dev/null +++ b/sdk/managementpartner/arm-managementpartner/src/operationsInterfaces/partners.ts @@ -0,0 +1,18 @@ +/* + * 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 { PartnersGetOptionalParams, PartnersGetResponse } from "../models"; + +/** Interface representing a Partners. */ +export interface Partners { + /** + * Get the management partner using the objectId and tenantId. + * @param options The options parameters. + */ + get(options?: PartnersGetOptionalParams): Promise; +} diff --git a/sdk/managementpartner/arm-managementpartner/test/sampleTest.ts b/sdk/managementpartner/arm-managementpartner/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/managementpartner/arm-managementpartner/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/managementpartner/arm-managementpartner/tsconfig.json b/sdk/managementpartner/arm-managementpartner/tsconfig.json index 87bbf5b5fa49..6e3251194117 100644 --- a/sdk/managementpartner/arm-managementpartner/tsconfig.json +++ b/sdk/managementpartner/arm-managementpartner/tsconfig.json @@ -3,17 +3,17 @@ "module": "es6", "moduleResolution": "node", "strict": true, - "target": "es5", + "target": "es6", "sourceMap": true, "declarationMap": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6"], + "lib": ["es6", "dom"], "declaration": true, - "outDir": "./esm", + "outDir": "./dist-esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], + "include": ["./src/**/*.ts", "./test/**/*.ts"], "exclude": ["node_modules"] } diff --git a/sdk/managementpartner/ci.yml b/sdk/managementpartner/ci.yml new file mode 100644 index 000000000000..365c222c0511 --- /dev/null +++ b/sdk/managementpartner/ci.yml @@ -0,0 +1,29 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. +trigger: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/managementpartner/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/managementpartner/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: managementpartner + Artifacts: + - name: azure-arm-managementpartner + safeName: azurearmmanagementpartner + \ No newline at end of file